Lecture 14: Congestion Control" CSE 222A: Computer Communication Networks George Porter Thanks: Amin Vahdat, Dina Katabi and Alex C. Snoeren
Lecture 14 Overview" TCP congestion control review Dukkipati and McKeown paper 2
Congestion Control Overview" Challenge: how do we efficiently share network resources among billions of hosts? Today: TCP Hosts adjust rate based on packet losses Alternative solutions Fair queuing, RED (router support) Vegas, packet pair (add functionality to TCP) Rate control, credits 3
Detecting Congestion" Explicit congestion signaling Source Quench: ICMP message from router to sender DECBit / Explicit Congestion Notification (ECN):» Router marks packet based on queue occupancy (i.e. indication that packet encountered congestion along the way)» Receiver tells sender if queues are getting too full Implicit congestion signaling Packet loss» Assume congestion is primary source of packet loss» Lost packets indicate congestion Packet delay» Round-trip time increases as packets queue» Packet inter-arrival time is a function of bottleneck link 4
Throttling Options" Window-based (TCP) Constrain number of outstanding packets allowed in network Increase window to send faster; decrease to send slower Pro: Cheap to implement, good failure properties Con: Creates traffic bursts (requires bigger buffers) Rate-based (many streaming media protocols) Two parameters (period, packets) Allow sending of x packets in period y Pro: smooth traffic Con: fine-grained per-connection timers, what if receiver fails? 5
TCP Congestion Problems" Original TCP sent full window of data When links become loaded, queues fill up, leading to: Congestion collapse: when round-trip time exceeds retransmit interval this can create a stable condition in which every packet is being retransmitted many times Synchronized behavior: network oscillates between loaded and unloaded» Feedback loop 6
Queuing Disciplines" How to distribute buffers among users/flows When buffer overflows, which packet to drop? Simple solution: FIFO First in, first out If packet comes along with no available buffer space, drop it 7
Fair Queuing" Goals: Allocate resources equally among all users/flows Low delay for interactive users Protection against misbehaving users Approach: simulate general processor sharing (from OS world) Bitwise round robin Need to compute number of competing flows at each instant 8
Jacobson s Solution" Transport protocols should obey conservation of packets Use ACKs to clock injection of new packets Modify retransmission timer to adapt to variations in delay Infer network bandwidth from packet loss Drops è congestion è reduce rate No drops è no congestion è increase rate Limit send rate based on minimum of congestion window and advertised window 9
Choosing a Send Rate" Ideally: Keep equilibrium at knee of power curve Find knee somehow Keep number of packets in flight the same Don t send a new packet into the network until you know one has left (i.e., by receiving an ACK) What if you guess wrong, or if bandwidth availability changes? Compromise: adaptive approximation If congestion signaled, reduce sending rate by x If data delivered successfully, increase sending rate by y How to relate x and y? Most choices don t converge 10
TCP s Probing Approach" Source 100 Mbps Ethernet Router 45 Mbps T3 link Sink Each source independently probes the network to determine how much bandwidth is available Changes over time, since everyone does this Assume that packet loss implies congestion Since errors are rare; also, requires no support from routers 11
Basic TCP Algorithm" Window-based congestion control Unified congestion control and flow control mechanism rwin: advertised flow control window from receiver cwnd: congestion control window» Estimate of how much outstanding data network can deliver in a round-trip time Sender can only send MIN(rwin,cwnd) at any time Idea: decrease cwnd when congestion is encountered; increase cwnd otherwise Question: how much to adjust? 12
Congestion Avoidance" Goal: Adapt to changes in available bandwidth Additive Increase, Multiplicative Decrease (AIMD) Increase sending rate by a constant (e.g. MSS) Decrease sending rate by a linear factor (e.g. divide by 2) Rough intuition for why this works Let L i be queue length at time i In steady state: L i = N, where N is a constant During congestion, L i = N + yl i-1, where y > 0 Consequence: queue size increases multiplicatively» Must reduce sending rate multiplicatively as well 13
AIMD" Increase slowly while we believe there is bandwidth Additive increase per RTT cwnd += 1 full packet / RTT Source Destination Decrease quickly when there is loss (went too far!) Multiplicative decrease cwnd /= 2 14
TCP Sawtooth " Oscillates around bottleneck bandwidth Adjusts to changes in competing traffic window! (in segs)! 18! 16! 14! 12! 10! 8! 6! 4! 2! 0! Additive Increase/Multiplicative Decrease! round-trip times! 15
Slow Start" How do we find bottleneck bandwidth? Cannot use ACKs to clock without reaching equilibrium Start by sending a single packet Start slow to avoid overwhelming network Multiplicative increase until get packet loss Quickly find bottleneck Cut rate by half Shift into linear increase/multiplicative decrease 16
Slow Start" Quickly find the bottleneck bandwidth 300! Slow Start! 250! 200! window! (in segs)! 150! 100! 50! 0! 0! 1! 2! 3! 4! 5! 6! 7! 8! round-trip times! 17
Slow Start Problems" Slow start usually overshoots bottleneck Leading to many lost packets in window Can lose up to half of window size Bursty traffic source Will cause bursty losses for other flows Short flows Can spend entire time in slow start Especially for large bottleneck bandwidth Consider repeated connections to the same server E.g., for web connections 18
ACK Pacing in TCP" ACKs open up slots in the congestion/advertised window Bottleneck link determines rate to send ACK indicates one packet has left the network 19
Problems with ACK Pacing" ACK compression Variations in queuing delays on return path changes spacing between ACKs Example: ACK waits for single long packet Worse with bursty cross-traffic What happens after a timeout? Potentially, no ACKs to time packet transmissions Congestion avoidance Slow start back to last successful rate Back to linear increase/multiplicative increase at this point 20
Two TCP Connections" Reach equilibrium independent of initial bandwidth (assuming equal RTTs) 16 14 12 10 window (in segs) 8 6 4 2 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 round-trip times 21
TCP Friendliness " Problem: many different TCP implementations If cut back more slowly after drops è grab bigger share If add more quickly after ACKs è grab bigger share Incentive to cause congestion collapse Many TCP accelerators Easy to improve perf at expense of network Solutions? Per-flow fair queuing at router 22
Fairness vs. Efficiency" Coupled because a single mechanism controls both Example: In TCP, Additive-Increase Multiplicative- Decrease (AIMD) controls both XCP argues decoupling solves the problem: 1. To control congestion: use MIMD which shows fast response 2. To control fairness: use AIMD which converges to fairness 23
For Next Class " Read and review DCTCP paper 24