Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP Congestion Control Anthony D. Joseph CS262a November 14, 2001.

Similar presentations


Presentation on theme: "TCP Congestion Control Anthony D. Joseph CS262a November 14, 2001."— Presentation transcript:

1 TCP Congestion Control Anthony D. Joseph CS262a November 14, 2001

2 February 9, 2000CS 268 Lecture #72 Topics End-to-end reliable transport layer –Example: ARQ Flow-control (not today) –Window- / rate-based control –Avoid over-running receiver TCP congestion control –Share the network fairly

3 February 9, 2000CS 268 Lecture #73 Automatic Repeat/reQuest (ARQ) Motivation: congestion/flow control intertwined with reliable transport Basis for most reliable transport schemes Relies on acknowledgments (ACK) and timeouts Source sends packet Receiver ACKs each packet If data or ACK lost, timeout triggers and source re-transmits Simplest version: Stop-and-Wait

4 February 9, 2000CS 268 Lecture #74 What if ACK is Dropped? Receiver might assemble duplicate frames Solve problem with sequence number How many bits?

5 February 9, 2000CS 268 Lecture #75 Alternating Bit Protocol AB msg, #0 msg, #1 msg, #0 ack, #0 ack, #1 ack, #0 1-bit sequence number Why is this inefficient? Consider 1Mb/s link, 100ms path delay, 1000 byte packets Send rate is only 10kb/s << 1Mb/s!

6 February 9, 2000CS 268 Lecture #76 Sliding Window Pipelining: transmit next packet before current one ACK'd Window limits the amount of outstanding data How big should this window be? Twice bandwidth-delay product –Keep the “pipe” full Selfish! Really only your share of pipe

7 February 9, 2000CS 268 Lecture #77 Congestion Control Goal is to fill pipe, but what if resources cannot keep pace? Congestion is not solved with –Faster links 2x every 6 months, demand 2x / 6 months –Larger queue buffers –Better routing protocols

8 February 9, 2000CS 268 Lecture #78 Design Space Router versus host Reservations (proactive) versus adaptive (reactive) Window-based versus rate-based

9 February 9, 2000CS 268 Lecture #79 Congestion Avoidance and Control Paper Contributions Seminal paper on congestion control for TCP and the Internet Widely cited, huge impact Slow-start (similar to Jain's CUTE algorithm) Lots of nice intuition Creative, intuitive, and artistic application of theory to practice –But not fully rigorous

10 February 9, 2000CS 268 Lecture #710 Motivation: History Explosive growth in networks  congestion problems Oct 1986: Internet has series of “congestion collapses” –“Collapse” = increment in offered load causes decrement in performance LBL/UCB throughput down by 1000 (32 kb/s to 40 b/s)

11 February 9, 2000CS 268 Lecture #711 Collapse Questions Was 4.3BSD TCP mis-behaving? Could it be tuned to work under such heavy network load? “Yes” to both

12 February 9, 2000CS 268 Lecture #712 Results: 7 new algorithms in BSD/TCP (1) RTT variance estimation (not just mean) (2) Exponential timer backoff (3) Slow-start (4) Aggressive receiver ACKs (omitted) (5) Dynamic window adaptation (6) Karn's clamped retransmit backoff (omitted) (7) fast retransmit (omitted)

13 February 9, 2000CS 268 Lecture #713 Theme: “Conservation of Packets” In equilibrium, don't introduce new packet until old packet leaves system 3 ways for conservation to fail: –Connection doesn't reach equilibrium –Sender injects new packets before old ones leave –Can't reach equilibrium because of resource limits

14 February 9, 2000CS 268 Lecture #714 Three Mechanisms (1) Getting to equilibrium (2) Staying at equilibrium (3) Adjusting equilibrium point for dynamic contention

15 February 9, 2000CS 268 Lecture #715 Getting to Equilibrium: Slow-Start Conservation easy to maintain with “self-clocking” –Generate a new data packet for each received ACK –But this makes the system hard to start

16 February 9, 2000CS 268 Lecture #716 Solution: slow-start Subtle but, simple algorithm Introduce congestion window, cwnd, at sender Upon start-up (or re-start after packet loss), set cwnd to 1 For each ACK, increase cwnd by 1 When sending, send min(cwnd, wnd) where “wnd” is receiver's advertised window

17 February 9, 2000CS 268 Lecture #717 Slow-Start is Not Too Slow Window grows exponentially So time to get to window W (from 1) is R log 2 W for round-trip time R Guarantees that source will blast at most twice the bottleneck rate –Peaks of 200x before SS! Note: slow-start does NOT obey the packet conservation principle!

18 February 9, 2000CS 268 Lecture #718 Staying at Equilibrium: RTT If property (2) from above violated, means round-trip timer failed –Caused retransmission before last packet left network –Real timer algorithms often inadequate (see Zhang's work)

19 February 9, 2000CS 268 Lecture #719 Common Mistake Not estimating variance –R,  R increase with load, , in proportion to (1 -  ) -1 –For 75% utilization, R varies by a factor of 16 TCP spec said R   R + (1 -  ) M –where  = 0.9 and timeout value of  R, (  = 2) –but  = 2 works only up to 30% load... –Instead, scale  dynamically in proportion to  R Actually compute mean deviation to make code simper; see appendix –Note: improves low-load performance as well (where  < 2)

20 February 9, 2000CS 268 Lecture #720 Adjusting Equilibrium Point for Dynamic Contention Two components of “Congestion Avoidance” (1) Network must signal endpoints (2) Endpoints must react to signal by decreasing utilization

21 February 9, 2000CS 268 Lecture #721 How to Generate Congestion Signal Congestion  packet loss  timeout  congestion signal No need to change network –Unlike DECbit which requires all routers on path to be modified

22 February 9, 2000CS 268 Lecture #722 Endpoint action Queue length averaged over RTT is L i For constant queue size (steady-state), L i = N But, according to paper, under congestion: L i = N +  L i-1 –i.e., have to add in remnant leftover from previous averaging interval Closed form is: L i =  n L 0 Hence queue grows exponentially fast Thus, sender should back-off exponentially fast by adjusting its window as follows: W i = d W i-1 (d < 1)

23 February 9, 2000CS 268 Lecture #723 Growing the Window While backoff triggered by packet loss, how do we know when there's spare capacity? Nothing tells us  experiment with spontaneous increase –Use multiplicative increase? Leads to instabilities Easy to drive system into saturation, but hard to recover (rush-hour effect)

24 February 9, 2000CS 268 Lecture #724 Growing the Window (cont’d) “Without justification” (see Jain and Chiu), “best” increase policy is small, constant changes (additive): –W i = W i-1 + u (u << W max ), where W max is the “pipe size” Borrowed additive increase / multiplicative decrease algorithm from Jain et al, except for choice of parameters (claimed universal)

25 February 9, 2000CS 268 Lecture #725 Easy Implementation On timeout, set cwnd to ½ current window On each ACK, increase cwnd by 1/cwnd When sending send min(cwnd, wnd)

26 February 9, 2000CS 268 Lecture #726 Slow-Start and Congestion Avoidance Two separate algorithms with very different objectives, but they should be implemented together: –Maintain variable “ssthresh”, which represents crossover point –On timeout Set ssthresh to 1/2 current window (x decrease) Set cwnd to 1 (initiate slow-start) –Initiate slow-start up to ssthresh –Beyond ssthresh, enter congestion avoidance “linear mode” Yields impressive performance results

27 February 9, 2000CS 268 Lecture #727 Future Work Endpoints can ensure that capacity is not exceeded, but cannot necessarily find a fair operating point Only in gateways, where flows converge, is there enough information to control sharing and fair allocation (see Jaffe) Some research directions –Send signal early (basis for Floyd's RED gateways) –Punish misbehaving hosts by sending drop signal (Floyd/Fall)

28 February 9, 2000CS 268 Lecture #728 Fast Retransmit (Omitted in paper) Silly to wait for timeout if we have a good idea packet was dropped –Duplicate ACK means missing data –Maybe just reordered, wait for 3 dup ACKs –Respond with (fast) retransmit –Backoff by setting ssthresh to cwnd/2 –Fast recovery: set cwnd to cwnd/2 (no slow-start) –If this doesn't work, window stalls and timeout eventually fires

29 February 9, 2000CS 268 Lecture #729 Discussion Pipes getting larger, connections getting smaller (or staying fixed...) What happens if fair share of bandwidth is less than one packet per RTT? –Proposal for combined rate/window-based congestion control All of this seems like trial and error? –Where's the theory? What if we could change the routers? –RED, FQ, real-time scheduling...

30 February 9, 2000CS 268 Lecture #730 Discussion How to deal with malicious senders? –Router-based controls How to deal with malicious receivers? –Sender-side sanity checking / security –Router-based controls

31 February 9, 2000CS 268 Lecture #731 Take Aways / Recap Additive increase / multiplicative decrease Slow-start bottleneck “search algorithm” Distributed fairness sounds easy but hard (Jaffe)


Download ppt "TCP Congestion Control Anthony D. Joseph CS262a November 14, 2001."

Similar presentations


Ads by Google