Announcement ____________ Quiz 1 - 3/18 material based on everything up to 3/9's lecture. Quiz 2 - change from 4/22 to 4/15 Last lecture The original version of TCP window flow control mechanism. Today - TCP enhancements: fast retransmit and fast recovery. _________________________________________________________________ Basic principle of TCP - A TCP source does not get explicit info about the current congestion status from the network. It views the network as a black box, and probes the network by increasing the transmission-window size until packet loss is detected, at which time it cuts back its window size. Recall: in TCP, every ack carries the sequence number of the last in-sequence packet seen by the receiver (cumulative acknowledgment). If the sender sees the ack sequence number repeated, a packet loss or a reordering is indicated. A) The original version : When there is no packet loss (no duplicated ACK): - during slow start phase, cnwd (snd_cnwd) doubles every RTT until ssthresh. - afterwards cnwd increases by 1 packet every RTT, called the congestion avoidance phase. When there is loss (duplicated ACKs received at the sender), - on timeout, ssthresh --> cnwd/2 cnwd --> 1 packet B) Enhanced version: Fast retransmit Idea -- the source retransmits the lost packet after receiving a number of (in practice, 3) duplicated ACKs instead of waiting for timeout. When this happens, ssthresh ---> cnwd/2 cnwd ---> 1 packet. This fast retransmission mechanism runs in parallel with the timeout mechanism. C) Further enhancement: Fast recovery On fast retransmit, a) instead of shrinking cnwd to 1 packet, it reduces to half of its previous value, i.e., same as the new ssthresh value. b) the source is allowed to send one packet for each deuplicated cumulative ACK received, even if this causes it to exceed the current cnwd. Intuition: each cumulative ACK, if duplicate, signals the availability of network resources. By ``inflating'' the actual window beyond the nominal window, a source can exploit this capacity. This window inflation ceases when a source receives the first nonduplicate cumulative ACK, indicating that the retransmission succeeded. Example of TCP Flow Control --------------------------- In the following example, we will trace the size of a source that is transmitting data over a connection with RTT=1. Assume that its initial value for slow-start threshold (ssthresh) = 5. The maximum allowed flow control window is 10. We also assume that the delay-bandwidth product on the connection is 4; i.e., the bottleneck service rate is 4 packets/sec, and the buffer size of the bottleneck is 4 packets. Initially, the window size of the source, snd_wnd is 1. (Refer to the table to follow the transitions.) 1. At time t=0, the source sends packet #1 (or PACK=1) and receives an acknowledgment ACK=2 at t=1. At the end of the first RTT, the source increases itw window size by 1; thus, snd_wnd = 2. 2. At t=1, it sends PACK=2 and 3. The window size, snd_wnd is increased by 1 for each ACK received, so that at the end of the second RTT, or at the beginning of the third RTT, snd_wnd = 4. 3. In the third RTT, the source sends PACK=4,5,6 and 7. At the end of the third RTT, when ACK=5 (for PACK=4) arrives, snd_wnd =5, and it reaches the slow-start threshold. thus, the ACKs = 6,7,8, which arrive during the fourth RTT, each contributes 1/5 to the window size. When ACK=8 is received, snd_wnd = 5.6. [Note: only the integer portion is used for flow control.] 4. In the fourth RTT, 5 packets can be outstanding, and the source transmits PACK=8,9,10,11 and 12. When the source receives ACK=10, during the fifth RTT, snd_wnd = 6, and ACK=11,12 and 13, each contribute 1/6 to the window size. Thus, at the end of fifth RTT, snd_wnd = 6.5. 5. In the absence of packet loss, snd_wnd continues to increase, until it reaches 9 packets during the eighth RTT. Of these, 4 packets are outstanding in the connection(``in the pipe'') because the bandwith-delay product is 4. 4 more packets can be buffered in the bottleneck. Thus, one packet, PACK=42, is lost at the bottleneck. This causes the receiver to repeat the cumulative ACKs sent during the ninth RTT, triggering a fast retransmission. 6. At the start of the ninth RTT, the source has 9 packets outstanding and has a window size, snd_wnd=9.333. During the ninth RTT, the source receives ACKs for PACK=34 to 41, which increases its snd_wnd to 10.2 at the end of the ninth RTT. Thus, the source, during 9th RTT, sends ten packets, ACK=43 to 52. The last ACK received during 9th RTT is ACK=42, which was the last packet sent before a packet loss. 7. In the 10th RTT, the source receives ACKs for packets sent in the 9th RTT. The ACKs for PACK=43 to 52 all carry the same cumulative ACK=42 (these ACKs increase snd_wnd from 10.2 to 10.5). On the third such duplicate, the source invokes fast retransmission and retransmits PACK=42. (Meanwhile, when it got ACK=44 and 45, it transmitted PACK=53 and 54.) In both TCP-Tahoe and TCP-Reno, fast retransmission causes the source to set its ssthresh = [10.5/2]=5 (integerportion). TCP-Reno sets its window size to 10.5/2=5.25 and enters the linear increase phase. Thus, in the 10th RTT, a TCP-Reno source has 5 packets outstanding: PACK=42, 53 to 56. In TCP-Tahoe, the window drops to 1. It cannot send any more packets after PACK=42. Thus, in the 10th RTT, a TCP-Tahoe source has 3 packets outstanding: PACK=53, 54 and 42. In 2 round-trip times, the window comes back to 4, and the source reenters the linear increase phase. Transition Table ---------------- RTT# Window range packets sent ssthresh peak buffer size ---- ------------ ------------ -------- ---------------- 1 1 - 2 1 5 0 2 2 - 4 2,3 5 0 3 4 - 5 4-7 5 0 4 5 - 5.6 8-12 5 1 5 5.6 - 6.5 13-18 5 2 6 6.5 - 7.428 19-25 5 3 7 7.428 - 8.375 26-33 5 4 8 8.375 - 9.333 34-42 5 4/drop 9 9.333 - 10.2 43-52 5 4/drop 10 10.2 - 10.5/5.25 42, 53-56 5 1