130 likes | 239 Views
TCP. EE122 Discussion 10/31/11. TCP Flow Control. Keep sender from overwhelming receiver Data not necessarily pushed to app layer. S. R. Adv_Win : 300. PKT_MAX = 200. Adv_Win : 300. Adv_Win : 100. Adv_Win : 100. ACK. ACK. ACK. MSS = min(PKT_MAX, Adv_Win ).
E N D
TCP EE122 Discussion 10/31/11
TCP Flow Control • Keep sender from overwhelming receiver • Data not necessarily pushed to app layer S R Adv_Win: 300 PKT_MAX = 200 Adv_Win: 300 Adv_Win: 100 Adv_Win: 100 ACK ACK ACK MSS = min(PKT_MAX, Adv_Win) Push data to application MSS = min(PKT_MAX, Adv_Win)
Congestion Control [1] • Avoid overwhelming the network • cwnd – congestion window • SSTHRESH –threshold until which exponential slow-start happens • TCP is either in slow-start mode or AIMD mode
Congestion Control [2] • TCP is either in slow-start mode or AIMD mode • Slow-start: for every ACK, increase cwnd by MSS • “AI”: for every window of packets being ACK-ed, increase cwnd by MSS
‘Vanilla’ TCP • Exponential slow-start till SSTHRESH • Set timer, which expires when packets are lost • At each new data ACK the timeout is RESET • On time-out, set SSTHRESH to (cwnd/2), and cwnd itself to 1 • Timeout = receiving nothing for an entire RTO • Usually a disaster!
‘Vanilla’ TCP Set SSTHRESH = 5; Enter Slow Start SSTHRESH = 5 crossed. Enter AIMD Set SSTHRESH = 1; Enter directly into AIMD since SSTHRESH is already crossed.
TCP Retransmission + Fast Recovery Set SSTHRESH = 5; However, enter AIMD directly! Set SSthresh = 1; Enter directly into AIMD since SSthresh is already crossed.
TCP Congestion Control: CWND Flowchart Slow Start Start 3 duplicate ACKs timeout (CWND > SSTHRESH) Additive Increase Simple Fast Retransmission Loss detected by timeout 3 duplicate ACKs timeout
TCP Congestion Control: CWND Flowchart Action when receive ACK CWND+= MSS Start 3 duplicate ACKs timeout (CWND > SSTHRESH) CWND += CWND = max(, MSS) SSTHRESH = CWND = MSS 3 duplicate ACKs timeout
Advanced Fast Retransmit Action when receive ACK CWND+= MSS Start SSTHRESH = CWND = timeout 3 duplicate ACKs (CWND > SSTHRESH) CWND += SSTHRESH = CWND = MSS CWND += MSS duplicate ACK timeout CWND = SSTHRESH new ACK