pkt = (PKT_PTR) malloc(sizeof(PKT));
pkt->type = DATA;
pkt->seq_no = seq_no ++;
pkt->source = 1;
pkt->dest = 2;
pkt->size = 10;
sendm(sink,0,pkt); line_busy = 1;
receivedata= 0;
pkt = (PKT_PTR) malloc(sizeof(PKT));
pkt->type = ACK;
pkt->seq_no = seq_no ++;
pkt->source = 3;
pkt->dest = 1;
pkt->size = 10;
sendm(sink,0,pkt);
line_busy = 1;
ack=0;
if(node is 1 and tick and num_pkts_sent < num_pkts[node])
if(node is 1 and tick and num_pkts_sent < num_pkts[node])
//產(chǎn)生DATA分組(隨便寫個,我只想要個參考)
pkt = (PKT_PTR) malloc(sizeof(PKT));
pkt->type = /* */;
pkt->seq_no = /* */;
pkt->source = /* */;
pkt->dest = /* */;
pkt->size = /* */;
if (node is 2 and receivedata)
{
//直接將從1號節(jié)點處收到的Data分組轉(zhuǎn)發(fā)給3號節(jié)點
}
//如果該tsource函數(shù)是在3號節(jié)點上執(zhí)行,且已經(jīng)收到了2號節(jié)點轉(zhuǎn)發(fā)來的Data分組
else if (node is 3 and ack)
{
//產(chǎn)生ACK分組
//將該ACK分組回送給1號節(jié)點
}
來人啦
//產(chǎn)生DATA分組(隨便寫個,我只想要個參考)
pkt = (PKT_PTR) malloc(sizeof(PKT));
pkt->type = /* */;
pkt->seq_no = /* */;
pkt->source = /* */;
pkt->dest = /* */;
pkt->size = /* */;
if (node is 2 and receivedata)
{
//直接將從1號節(jié)點處收到的Data分組轉(zhuǎn)發(fā)給3號節(jié)點
}
//如果該tsource函數(shù)是在3號節(jié)點上執(zhí)行,且已經(jīng)收到了2號節(jié)點轉(zhuǎn)發(fā)來的Data分組
else if (node is 3 and ack)
{
//產(chǎn)生ACK分組
//將該ACK分組回送給1號節(jié)點
}
來人啦
其他人氣:592 ℃時間:2020-05-19 03:27:17
優(yōu)質(zhì)解答
我來回答
類似推薦
- 解釋一下下面的句子
- All of there impress me a lot.
- 幫忙解釋一下下面的句子.(盡量詳細(xì)點,謝謝)
- 請幫忙翻一下下面的句子哈
- 請解釋一下下面的句子、.
- 函數(shù)f(x)=sinx-cosx^2的最小值是?
- 英語翻譯
- I took my grandpa to the hospital this morning,_____ I missed the first class.
- So crazy
- 方差是各個數(shù)據(jù)與平均數(shù)之差的平方的平均數(shù)
- 函數(shù)y=f(x)與它反函數(shù)y=f^-1(x)怎么讀?
- These are photos of my families.Look at them 改錯
猜你喜歡
- 1平面與平面重合,是否屬于平行一類?那重合的兩直線,也屬于平行一類的嗎?
- 2非洲每年因饑餓死亡的人數(shù)及現(xiàn)在饑餓人口數(shù)量拜托各位了 3Q
- 3decide to do sth.還=什么
- 4(7/8)o you think of london?B:5.____london is one of the liveliest cities
- 5啤酒可以托運嗎
- 6邊長為2√6的等邊三角形的中心到一邊的距離為?
- 7please give your hand to help me
- 8已知2的X次方等于3的Y次方等于6的Z次方不等等于1,證明X分之一加Y分之一等于Z分之一.
- 9幫我做做?
- 10機械分析天平TG628A的使用說明書
- 11in winter ,we wear warm coats to protect our bodies_.
- 12( )was most importance to her ,she told me,was her family it this what as