Chapter 5: 5) The two-segment-lifetime timeout results from the need to purge old late duplicates, and uncertainty of the sender of the last ACK as to whether it was received. For the first issue we only need one connection endpoint in TIMEWAIT; for the second issue, a host in the LAST ACK state expects to receive the last ACK, rather than send it. 12) (a) This is 125MB/sec; the sequence numbers wrap around when we send 2^32 B = 4GB. This would take 4GB/(125MB/sec) = 32 seconds. (b) Incrementing every 32 ms, it would take about 32×4×10^9 ms, or about four years, for the timestamp field to wrap. 25) If every other packet is lost, we transmit each packet twice. (a) Let E => 1 be the value for EstimatedRTT, and T = 2 × E be the value for TimeOut. We lose the first packet and back off TimeOut to 2×T. Then, when the packet arrives, we resume with EstimatedRTT = E, TimeOut = T. In other words, TimeOut doesn’t change. Chapter 6: 16) (a) In slow start, the size of the window doubles every RTT. At the end of the ith RTT, the window size is 2^i KB. It will take 10 RTTs before the send window has reached 2^10 KB = 1MB. (b) After 10 RTTs, 1023KB = 1MB - 1KB has been transferred, and the window size is now 1MB. Since we have not yet reached the maximum capacity of the network, slow start continues to double the window each RTT, so it takes 4 more RTTs to transfer the remaining 9MB (the amounts transferred during each of these last 4 RTTs are 1MB, 2MB, 4MB, 1MB; these are all well below the maximum capacity of the link in one RTT of 12.5MB). Therefore, the file is transferred in 14 RTTs. (c) It takes 1.4 seconds (14 RTTs) to send the file. The effective throughput is (10MB/1.4s) = 7.1MBps = 57.1Mbps. This is only 5.7% of the available link bandwidth. 17) Let the sender window size be 1 packet initially. The sender sends an entire windowful in one batch; for every ACK of such a windowful that the sender receives, it increases its effective window (which is counted in packets) by one. When there is a timeout, the effective window is cut into half the number of packets. Now consider the situation when the indicated packets are lost. The window size is initially 1; when we get the first ACK it increases to 2. At the beginning of the second RTT we send packets 2 and 3. When we get their ACKs we increase the window size to 3 and send packets 4, 5 and 6. When these ACKs arrive the window size becomes 4. Now, at the beginning of the fourth RTT, we send packets 7, 8, 9, and 10; by hypothesis packet 9 is lost. So, at the end of the fourth RTT we have a timeout and the window size is reduced to 4/2 = 2. Continuing, we have: RTT | 5 6 7 8 9 --------------------------------- Sent| 9-10 11-13 14-17 18-22 23-28 Again the congestion window increases up until packet 25 is lost, when it is halved, to 3, at the end of the ninth RTT. The plot should show the window size vs. RTT and will basically have a sawtooth shape with peaks right before lost packets. 20) We may still lose a batch of packets, or else the window size is small enough that three subsequent packets aren’t sent before the timeout. Fast retransmit needs to receive three duplicate ACKs before it will retransmit a packet. If so many packets are lost (or the window size is so small) that not even three duplicate ACKs make it back to the sender, then the the mechanism cannot be activated, and a timeout will occur. 21) We will assume in this exercise and the following two that when TCP encounters a timeout it reverts to stop-and-wait as the outstanding lost packets in the existing window get retransmitted one at a time, and that the slow start phase begins only when the existing window is fully acknowledged. In particular, once one timeout and retransmission is pending, subsequent timeouts of later packets are suppressed or ignored until the earlier acknowledgement is received. Such timeouts are still shown in the tables below, but no action is taken. We will let Data N denote the Nth packet; Ack N here denotes the acknowledgement for data up through and including data N. (a) Here is the table of events with TimeOut = 2 sec. There is no idle time on the R-B link. Time A recvs A sends R sends cwnd size ------------------------------------------------------------------------- 0 Data0 Data0 1 1 Ack0 Data1,2 Data1 2 2 Ack1 Data3,4 (4 dropped) Data2 3 3 Ack2 Data5,6 (6 dropped) Data3 4 4 Ack3/timeout4 Data 4 Data5 1 5 Ack3/timeout5&6 Data4 1 6 Ack5 Data 6 Data6 1 ------------------------------------------------------------------------- 7 Ack 6 Data7,8 (slow start) Data7 2