Appearance
Congestion Control in TCP
Congestion control ensures the sender doesn't overwhelm the network (routers, links) — unlike flow control which protects the receiver.
The Problem
Many Senders ---- too much data ----> Router
(buffer overflow → packets dropped → network collapse)Congestion Window (cwnd)
- Sender-side limit on unacknowledged data in flight.
- Sender controlled (unlike rwnd which is receiver controlled).
- Not advertised — sender calculates it internally.
How TCP Detects Congestion
| Signal | Meaning | Severity |
|---|---|---|
| Packet loss (timeout) | Severe congestion | High |
| 3 Duplicate ACKs | Mild congestion | Low |
- Timeout — no ACK received in time → severe
- 3 Dup ACKs — receiver got out-of-order packet, keeps ACKing last good one → mild
TCP Congestion Control Algorithms
1. Slow Start
- Begins when connection starts or after timeout.
- cwnd starts at 1 MSS (Maximum Segment Size).
- Doubles every RTT (exponential growth).
- Continues until ssthresh (slow start threshold) is reached.
- Despite the name, slow start is actually fast (exponential). "Slow" refers to starting from 1 MSS instead of full speed.
2. Congestion Avoidance
- After reaching ssthresh.
- cwnd grows linearly — increases by 1 MSS per RTT.
- Probes network carefully for available bandwidth.
3. Fast Retransmit
- On receiving 3 duplicate ACKs.
- Sender immediately retransmits lost packet.
- Doesn't wait for timeout (timeout is slow).
4. Fast Recovery
- After Fast Retransmit (3 dup ACKs).
- Does NOT go back to Slow Start.
- Instead:
ssthresh = cwnd / 2 ; cwnd = ssthresh + 3; continue with Congestion Avoidance.
Slow Start Example
RTT 1: cwnd = 1 MSS
RTT 2: cwnd = 2 MSS
RTT 3: cwnd = 4 MSS
RTT 4: cwnd = 8 MSS ← hits ssthresh → switch to Congestion AvoidanceCongestion Avoidance Example
RTT 1: cwnd = 8 MSS
RTT 2: cwnd = 9 MSS
RTT 3: cwnd = 10 MSS
RTT 4: cwnd = 11 MSS ← congestion detected!Fast Retransmit Example
Sender receives: ACK5, ACK5, ACK5 (3 dup ACKs)
→ Immediately resend packet 6 without waiting for timeoutTCP Tahoe vs TCP Reno
| Event | TCP Tahoe | TCP Reno |
|---|---|---|
| Timeout | cwnd=1, go to Slow Start | cwnd=1, go to Slow Start |
| 3 Dup ACKs | cwnd=1, go to Slow Start | Fast Recovery (cwnd = ssthresh+3) |
- Tahoe — treats all loss the same (harsh)
- Reno — distinguishes between mild and severe congestion (smarter)
- Modern TCP uses Reno or newer (CUBIC, BBR)
cwnd over Time (Conceptual Sawtooth)
cwnd
| /
| / Congestion
| / Avoidance
| / /
| / --/----x (3 dup ACKs)
| / / \
| / / ssthresh \----/
| / / \
| /SS/ \ SS again (timeout)
|---------------------------------------→ time
SS = Slow Start (exponential)
/ = Congestion Avoidance (linear)
x = congestion detectedAIMD (Additive Increase Multiplicative Decrease)
- Additive Increase — grow cwnd by 1 MSS per RTT (slow, careful).
- Multiplicative Decrease — cut cwnd by half on congestion (aggressive reduction).
- This creates the sawtooth pattern typical of TCP throughput.
No congestion → cwnd + 1 MSS (per RTT)
Congestion → cwnd / 2Modern Congestion Control
| Algorithm | Used By | Approach |
|---|---|---|
| CUBIC | Linux default | Cubic function for window growth |
| BBR | Measures bandwidth & RTT directly | |
| QUIC | HTTP/3 | UDP-based, own congestion control |
Congestion Control vs Flow Control (Summary)
| Congestion Control | Flow Control | |
|---|---|---|
| Protects | Network | Receiver |
| Window | cwnd (sender) | rwnd (receiver) |
| Controlled by | Sender | Receiver |
| Signal | Packet loss / dup ACKs | rwnd in ACK |
| Algorithm | Slow start, AIMD | Sliding window |