110 likes | 275 Views
TCP Congestion Control: AIMD and Binomial. Shivkumar Kalyanaraman Rensselaer Polytechnic Institute shivkuma@ecse.rpi.edu http://www.ecse.rpi.edu/Homepages/shivkuma Based in part upon slides of Prof. Raj Jain (OSU), Srini Seshan (CMU), J. Kurose (U Mass), I.Stoica (UCB).
E N D
TCP Congestion Control: AIMD and Binomial Shivkumar Kalyanaraman Rensselaer Polytechnic Institute shivkuma@ecse.rpi.edu http://www.ecse.rpi.edu/Homepages/shivkuma Based in part upon slides of Prof. Raj Jain (OSU), Srini Seshan (CMU), J. Kurose (U Mass), I.Stoica (UCB)
Packet Loss Detection: Timeout Avoidance • Wait for Retransmission Time Out (RTO) • What’s the problem with this? • Because RTO is a performance killer • In BSD TCP implementation, RTO is usually more than 1 second • the granularity of RTT estimate is 500 ms • retransmission timeout is at least two times of RTT • Solution: Don’t wait for RTO to expire • Use fast retransmission/recovery for loss detection • Fall back to RTO only if these mechanisms fail. • TCP Versions: Tahoe, Reno, NewReno, SACK
TCP Congestion Control • Maintains three variables: • cwnd – congestion window • rcv_win – receiver advertised window • ssthresh – threshold size (used to update cwnd) • Rough estimate of knee point… • For sending use: win = min(rcv_win, cwnd)
Congestion Avoidance • Goal: maintain operating point at the left of the cliff: • How? • additive increase: starting from the rough estimate (ssthresh), slowly increase cwnd to probe for additional available bandwidth • multiplicative decrease: cut congestion window size aggressively if a loss is detected. • Ifcwnd > ssthreshtheneach time a segment is acknowledged increment cwnd by 1/cwnd i.e. (cwnd += 1/cwnd).
Fairness Line x1 x0 User 2’s Allocation x2 x2 Efficiency Line User 1’s Allocation x1 Additive Increase/Multiplicative Decrease (AIMD) Policy • Assumption: decrease policy must (at minimum) reverse the load increase over-and-above efficiency line • Implication: decrease factor should be conservatively set to account for any congestion detection lags etc
The big picture cwnd Congestion Avoidance Slow Start Time
Putting Everything Together:TCP Pseudo-code Initially: cwnd = 1; ssthresh = infinite; New ack received: if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1; else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd; Timeout: (loss detection) /* Multiplicative decrease */ ssthresh = win/2; cwnd = ssthresh; while (next < unack + win) transmit next packet; where win = min(cwnd, flow_win); unack next seq # win
TCP Congestion Control Summary • Sliding window limited by receiver window. • Dynamic windows: slow start (exponential rise), congestion avoidance (additive rise), multiplicative decrease. • Ack clocking • Adaptive timeout: need mean RTT & deviation • Timer backoff and Karn’s algo during retransmission • Go-back-N or Selective retransmission • Cumulative and Selective acknowledgements • Timeout avoidance: Fast Retransmit
TCP Congestion Control: AIMD • Inc: cwnd(t+rtt) = cnwd(t) + α, α>0; • Dec: cwnd(t+δt) = cnwd(t) - β cnwd(t), 1>β>0; • Throughput ~ pkt_size / [ rtt x sqrt(loss_rate)]
Binomial Congestion Control • Inc: cwnd(t+rtt) = cnwd(t) + α / cnwd(t)k , α>0; • Dec: cwnd(t+δt) = cnwd(t) - β cnwd(t)l , 1>β>0; • TCP friendly if k + l = 1; • AIMD: k=0, l=1; • IIAD: k=1, l =0; • SQRT: k=l=0.5.
The big picture cwnd Congestion Avoidance SQRT Slow Start AIMD Time