Computer Network 2015fall
Homework 3
作业提交地址: ftp://my.ss.sysu.edu/~zhgf/ComputerNetwork2015/
1.UDP and TCP use 1's complement for their checksums. Suppose you have the following three 8-bit words: 01010101, 01110000, 11001100.
a)What is the 1's complement of the sum of these words? Please describe such mechanism.
b)Why is it that UDP take the 1's complement of the sum, i.e., why not just use the sum?
c)With the 1's 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?
Ans:
(a) 0101 0101
+ 0111 0000
1100 0101
1100 0101
+ 1100 1100
1001 0010
1’s complement: 0110 1101
(b) To detect “errors” (e.g., flipped bits) in transmitted segment.
(c) ①Compute checksum of received segment ②Check if computed checksum equals checksum field value:if NO, error detected; if YES, no error detected.
All one-bit errors will be detected, but two-bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1).
2.In our rdt protocols,
a)why did we need to introduce timers?
b)why did we need to introduce sequence numbers?
c)Suppose that the roundtrip delay between sender and receiver is constant and known to the sender. Would a timer still be necessary in protocol rdt 3.0, assuming that packets can be lost? Explain.
Ans:
(a) To handle losses in the channel. If the ACK for a transmitted packet is not received within the duration of the timer for the packet, the packet(or its ACK or NACK) is assumed to have been lost. Then the packet will be transmitted.
(b) To help a receiver to find out whether an arriving packet having new data or is an edition of retransmission.
(c) It’s necessary. Because if the round trip time is known, the sender will know either a packet or ACK(or NACK) of the packet is lost where the ACK(or NACK) might still be on the way after the timer expires. But a timer with constant duration is still necessary to detect the loss.
3.Consider transferring an enormous file of L bytes from host A to host B. Assume an MSS(Maximum Segment Size) of 1220 bytes.
a)What is the maximum length of L such that TCP sequence numbers are not
exhausted? Recall that the TCP number field has four bytes.
b)For the L you obtain in (a), find how long it takes to transmit the file. Assume that a total of 66 bytes of transport, network and data-link header are added to each segment before the resulting packet is sent out over a 10 Mbps link. Ignore flow control and congestion control, so A can pump out the segments back-to-back and continuously.
Ans:
(a) 4 bytes = 32 bits, 232=4,294,967,296
(b) The number of segment is . 66 bytes of header get added to each segment giving a total of 232,350,690 bytes of header.The total number of bytes transmitted is 2^32+232,250,690=3622x10^7bits.Thus it would take 3622 seconds=60 minutes to transmit the file.
4.True or false, then explain.
a)If a Web page consists of exactly one object, then non-persistent and persistent connections have exactly the same response time performance?
b)Consider sending one object of size O from server to browser over TCP. If O > S, where S is the maximum segment size, then the server will stall at least once?
c)Suppose a Web page consists of 10 objects, each of size O bits. For persistent HTTP, the RTT portion of the response time is 20 RTT ?
timeout on t2 timer
d)Suppose a Web page consists of 10 objects, each of size O bits. For non-persistent HTTP with 5 parallel connections, the RTT portion of the response time is 12 RTT ?
Ans:
(a) True. Because there is only one object.
(b) True. Because O is bigger than S.
(c) False. It’s 2. Because the connection still remain open after first transmission.
(d) False. It’s less than 12 because there are 5 parallel connections. After 2 RTT time, 5 objects would be transmitted at same time.
5.Assuming TCP Reno is the protocol experiencing the behavior shown above, answer the following questions. In all cases, you should provide a short discussion justifying your answer.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论