Congestion Control
Protecting the network from collapse: slow start, AIMD, ECN, and BBR.
Level: advanced
What is it?
Congestion control adapts a sender's transmission rate to estimated network capacity and congestion. TCP algorithms infer congestion from signals such as loss, delay, or explicit congestion notification; designs differ in how they probe capacity and reduce sending rate.
Why does it matter?
Without congestion control, senders can inject more traffic than links and routers can handle, increasing queues, delay, retransmissions, and loss for many flows. Congestion control balances throughput with stability and sharing.
Mental model
Flow control protects the receiver from being overwhelmed; congestion control protects the path. A sender must respect both the receiver's advertised window and its congestion window.
How it works
- TCP's congestion window limits outstanding data in flight; the receiver window expresses receiver-side capacity.
- Slow start probes available capacity rapidly from a small initial window, within the algorithm's current behavior.
- AIMD-style algorithms increase cautiously and reduce on congestion signals, while modern algorithms may use different models.
- Packet loss can indicate congestion but can also have other causes; algorithms use timing and protocol-specific signals.
- Fairness is a property of competing flows and paths, not a guarantee that every connection receives identical throughput.
Steps
- A sender starts with a conservative congestion window.
- Successful acknowledgements permit the window to grow according to the algorithm.
- A congestion signal such as loss or ECN causes a reduction or a model update.
- The sender probes again while staying within the receiver's advertised window.
Real-world usage
- Explaining throughput collapse, queueing delay, and TCP behavior.
- Distinguishing congestion control from receiver flow control.
- Comparing different TCP congestion-control algorithms using measured workload results.
Common mistakes
- Treating the receiver window and congestion window as the same control.
- Assuming every dropped packet proves congestion.
- Comparing algorithms without accounting for RTT, bottlenecks, competing flows, and test conditions.
Interview questions
How does flow control differ from congestion control?
Flow control protects the receiver from excessive in-flight data; congestion control adapts sending to the network path's capacity.
What role does ECN play?
Where supported and negotiated, Explicit Congestion Notification lets network devices mark packets to signal congestion without relying solely on packet drops.