计网-第三章作业

  • 格式:doc
  • 大小:197.50 KB
  • 文档页数:6

Chapter 3注:括弧中标题号为第四版教材中对应的习题号1.(R14)Suppose Host A sends two TCP segments back to back to Host B over a TCP connection.The first segment has sequence number 90; the second has sequence number 110.a. How much data is in the first segment?b.Suppose that the first segment is lost but the second segment arrives at B. In theacknowledgment that Host B sends to Host A, what will be the acknowledgment number?答:a.[90,109]=20bytesb.ack number=90,对第一个报文段确认2.(R15)True or false?a. The size of the TCP RcvWindow never changes throughout the duration of the connection.b. suppose Host A is sending Host B a large file over a TCP connection. The number ofunacknowledged bytes that A sends cannot exceed the size of the receive buffer.c. Host A is sending Host B a large file over a TCP connection. Assume Host B has no data tosend Host A. Host B will not send acknowledgments to Host A because Host B cannot piggyback the acknowledgment on data.d. The TCP segment has a field in its header for RcvWindow.e. Suppose Host A is sending a large file to Host B over a TCP connection. If the sequencenumber for a segment of this connection is m, then the sequence number for the subsequent segment will necessarily be m + 1.f. Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The current valueof TimeoutInterval for the connection will necessarily be>=1 sec.g. Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over aTCP connection to Host B. In this same segment the acknowledgment number is necessarily42.答:a.Fb.Tc.F:即使没有数据传送,也会进行单独确认d.Te.F:按字节编号,不按报文段编号f.Fg.F:B->A的确认号不一定为38+4=423.(R17)True or false? Consider congestion control in TCP. When the timer expires at the sender,the threshold is set to one half of its previous value.答:F:应为当前拥塞窗口的一半,而不是阈值的一半。

4.(P3)UDP and TCP use 1s complement for their checksums. Suppose you have the followingthree 8-bit bytes: 01101010, 01001111, 01110011. What is the 1s complement of the sum ofthese 8-bit byte? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums. ) Show all work..Why is it that UDP takes complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?答:01101010+01001111=11000101, 11000101+01110011=00010001取反为11101110。

为了发现错误,接收端增加4个字组(3个原始的,1个取反后的),如果总数包含0,即有错误。

所有的一位错误会发现,但两位错误有可能不会被发现。

5.(P7)Draw the FSM for the receiver side of protocol rdt3.0.答:6.(P13)Consider a reliable data transfer protocol that uses only negative acknowledgements.Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable toa protocol to that uses ACKs? Why? Now suppose the sender has a lot of data to send and theend-to-end connection experiences few losses. In this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?答:在仅使用NAK的协议中,只有当接收到分组x+1时才能检测到分组x的丢失。

如果传输x和传输x+1之间有很长的延时,那么在此协议中修复分组x需要很长的时间;如果要发送大量的数据,在仅有NAK的协议中修复速度很快;如果错误很少,那么NAK 只偶尔发送ACK,则会明显减少反馈时间。

7.(P14)Consider the cross-country example shown in Figure 3.17. How big would the windowsize have to be for the channel utilization to be greater than 80 percent?答:U=n×L/R/(RTT+L/R)≥80%n≥30018.(P19)Answer true or false to the following questions and briefly justify your answer:a. With the SR protocol, it is possible for the sender to receive an ACK for a packet that fallsoutside of its current windowb. With GBN, it is possible for the sender to receive an ACK for a packet that falls outside ofits current window.c. The alternating-bit protocol is the same as the SR protocol with a sender and receiverwindow size of 1.d. The alternating-bit protocol is the same as the GBN protocol with a sender and receiverwindow size of 1.答:a.T:在t0时刻发送方窗口3发送包1,2,3;在t1时刻接收方接收ACKs1,2,3;在t2时刻发送方延时并重新发送1,2,3;在t3时刻接收方接收包并重新发送确认1,2,3;在t4时刻发送方接收接收方在t1时刻发送的ACKs并进入窗口4,5,6;在t5时刻发送方接收接收方在t2时刻发送的ACKs1,2,3。

这些ACKs在窗口之外。

b.T:见ac.Td.T:在窗口1时,SR,GBN,the alternating bit protocol 在功能上是一样的,窗口1会自动排除有可能无序的包。

9.(P23)Consider transferring an enormous file of L bytes from Host A to Host B. Assume anMSS of 1,460 bytes.a.What is the maximum value of L such that TCP sequence numbers are not exhausted?Recall that the TCP sequence number fields has 4 bytes.b.For the L you obtain in (a), find how long it takes to transmit the file. Assume that a totalof 66 bytes of transport, network, and data-link header are added to each segment before the resulting packet is sent our over a 100 Mbps link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously.答:a.TCP序号范围为4bytes,LMAX=232bytesb.传输速度=155Mbps,每段加66bytes大小的头,共分段:232bytes/1460bytes=2941758段;头大小和=2941758×66=194156028bytes;总共需传输194156028+232bytes=4489123324bytes=35912986592bits的数据;用10Mbps的速度传输则时间为3591s。