[HW] HW#03Q 2019

481 views
Skip to first unread message

Prof. Hsiao

unread,
Nov 3, 2019, 11:43:29 PM11/3/19
to NCCU Networking@MIS
Q1. In the rdt protocols, why did we need to introduce sequence numbers?
A1. Sequence numbers are required for a receiver to find out whether an arriving packet contains new data or is a retransmission.
 

Q2. In the rdt protocols, why did we need to introduce timers?
A2. 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. Hence, the packet is retransmitted. 


Q3. 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.
A3. A timer would still be necessary in the protocol rdt 3.0. If the round trip time is known, then the only advantage will be that, the sender knows for sure that either the packet or the ACK for the packet has been lost. As compared to the real scenario (i.e., the roundtrip delay is unknown), where the ACK might still be on the way to the sender, even after the timer expires (so that when timer expirer, the sender does not know either the packet or its ACK is lost). Therefore, to distinguish different losses, a timer of constant duration will still be necessary at the sender. 


Q4. True or False. You MUST explain.
(a) Host A is sending Host B a large file over a TCP connection. Assume Host B has no data to send Host A. Host B will not send acknowledgments to Host A because Host B cannot piggyback the acknowledgments on data
(b) The size of the TCP rwnd never changes throughout the duration of the connection.
(c) Suppose Host A is sending Host B a large file over a TCP connection. The number of unacknowledged bytes that A sends cannot exceed the size of the receive buffer.
(d) Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over a TCP connection to Host B. In this same segment the acknowledgment number is necessarily 42.

A4a. False. Even if Host B has no data to be sent to Host A. Host B can still send an acknowledgment to A without carrying any data in the payload. A single ACK packet is okay.
A4b. False. The receiver should report/update its rwnd to the sender every time the receiver sends an ACK back to the sender.
A4c. True. At the beginning of the communication, the receiver will report its initial receive buffer (using rwnd) to the sender, and the sender can send (at most) as many bytes as specified.
A4d. False. In this same segment, the ACK number is used by the Host A to acknowledge the data from B to A. There is nothing to do with the data from A to B.


Q5. True or False. You MUST explain.
(a) With the SR protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.
(b) With GBN, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.

A5a. True. If a sender resends all its packets again due to timeout, and the delayed acks are back; then the window of the sender moves forward. But the ACKS of the resent packets will eventually come back. Therefore, the sender will receive ACKs that are not in senders window.
A5b. True. By essentially the same scenario as in (a). 


Q6. Consider transferring an enormous file of L bytes from Host A to Host B. Assume an MSS of 536 bytes.
(a) What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP sequence number field has 4 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 headers are added to each segment before the resulting packet is sent out over a 155 Mbps link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously.

A6a. 4 byes = 32 bits => sequence number range [0, (2^32)-1]. So, theoretically, the maximum number of bytes that can be sent is 2^32 = 294,967,296.
A6b. The number of segments needed is (2^32)/536 = 8,012,999. The total number of bytes to be transmitted is (bytes for transferring the big file) + (bytes for headers) = (2^32) + (8012999 segments * 66 bytes/segment) = (2^32) + 528,857,934 = 4.824 * 10^9 bytes.
         Since the link speed is 155Mbs, so we need (4.824*10^9) / 155 Mbps = 249 seconds.


Reply all
Reply to author
Forward
0 new messages