TCP Congestion Control: Slow Start, Congestion Avoidance, and AIMD
How TCP probes network capacity with cwnd and ssthresh, and why TCP Reno and Tahoe react differently to Triple Duplicate ACKs vs. Timeouts.
1. Flow Control vs. Congestion Control
A TCP sender limits how many unacknowledged bytes it can have in flight at any moment using two distinct windows:
- Flow Control (
rwnd— Receive Window): Advertised by the receiver in every ACK header so the sender does not overflow the receiver's socket buffer. - Congestion Control (
cwnd— Congestion Window): Maintained by the sender so it does not overload intermediate routers and links in the network.
The sender's effective window is min(cwnd, rwnd). Because standard IP routers do not tell endpoints their available link capacity, TCP must probe the network dynamically using cwnd (measured in multiples of MSS — Maximum Segment Size) and infer congestion from packet loss.
2. Slow Start and Congestion Avoidance
Set PACKET LOSS PROBABILITY (%) = 0 in the simulator above, click RESET, and click TICK (1 RTT) 7 times. Watch CWND (blue line) relative to the Slow Start Threshold (ssthresh, red dashed line, initially 16 MSS):
| Phase | Condition | Growth Rule | Per-RTT Trajectory (from cwnd = 1, ssthresh = 16) |
|---|---|---|---|
| Slow Start | cwnd < ssthresh | cwnd += 1 MSS on every ACK received → doubles every RTT (exponential) | 1 → 2 → 4 → 8 → 16 |
| Congestion Avoidance | cwnd ≥ ssthresh | cwnd += 1/cwnd MSS per ACK → +1 MSS per RTT (linear / additive increase) | 16 → 17 → 18 → 19… |
Why is exponential growth called "Slow Start"? Because starting at cwnd = 1 MSS is much slower than immediately blasting a full receive window on the first RTT; doubling each RTT lets the sender quickly discover the order-of-magnitude capacity before switching to cautious linear probing at ssthresh.
3. Reacting to Loss: Timeout vs. 3 Duplicate ACKs (Tahoe vs. Reno)
TCP detects packet loss in two ways, which signal very different levels of network congestion:
- Retransmission Timeout (RTO — Severe Congestion): The sender transmits a window of segments and receives no ACKs before its timer expires. The network path may be completely congested.
- Triple Duplicate ACK (3 Dup ACKs — Mild Congestion): Segment
kis lost, but subsequent segmentsk+1, k+2, k+3still arrive at the receiver! Each out-of-order arrival triggers an immediate duplicate ACK requesting segmentk. Receiving 3 duplicate ACKs triggers Fast Retransmit (resending segmentkimmediately without waiting for the timeout timer).
Compare how TCP Tahoe (1988) and TCP Reno (1990) respond in the simulator using the FORCE 3 DUP ACKs and FORCE TIMEOUT buttons:
| Loss Event | New ssthresh | TCP Tahoe Action | TCP Reno Action |
|---|---|---|---|
| Timeout | ⌊cwnd / 2⌋ | cwnd = 1 MSS, enter Slow Start | cwnd = 1 MSS, enter Slow Start |
| 3 Duplicate ACKs | ⌊cwnd / 2⌋ | cwnd = 1 MSS, enter Slow Start | Fast Recovery: cwnd = ssthresh + 3, then continue in Congestion Avoidance (halving the window instead of resetting to 1) |
4. AIMD Sawtooth and Bandwidth Fairness
In steady state under TCP Reno, Congestion Avoidance increases cwnd linearly by +1 MSS per RTT (Additive Increase), and Triple Duplicate ACKs cut cwnd in half (Multiplicative Decrease). This AIMD rule produces the classic sawtooth graph when you click AUTO-RUN.
Why AIMD guarantees fairness across competing flows: Suppose Flow A has cwnd = 30 and Flow B has cwnd = 10 sharing a bottleneck router. During Additive Increase, both add +1 per RTT (gap stays 20). When the bottleneck drops a packet, Multiplicative Decrease halves both windows to 15 and 5 — shrinking the gap from 20 to 10! Repeated AIMD cycles provably converge competing flows toward an equal share of bottleneck bandwidth.
Exercises
1. Set Packet Loss to 0%, click RESET, and click TICK (1 RTT) until CWND = 20. Now click FORCE 3 DUP ACKs under TCP Reno, then repeat under TCP Tahoe. Compare the resulting SSTHRESH, CWND, and Phase.
Show solution
cwnd = 20, both set ssthresh = 20 / 2 = 10.• TCP Reno: Enters Fast Recovery with
cwnd = 10 + 3 = 13.0, then transitions to Congestion Avoidance on the next ACK.• TCP Tahoe: Treats 3 Dup ACKs the same as a Timeout, resetting
cwnd = 1.0 and re-entering Slow Start.
2. Starting from cwnd = 1 and ssthresh = 16 with zero packet loss, how many RTT ticks does it take for cwnd to reach 20 MSS?
Show solution
1 → 2 → 4 → 8 → 16 (reaches ssthresh after 4 RTTs).• RTTs 5–8 (Congestion Avoidance +1/RTT):
16 → 17 → 18 → 19 → 20 (4 more RTTs).Total = 8 RTTs. Verify in the simulator by clicking TICK 8 times at 0% loss.
Quiz
How does cwnd grow during the Slow Start phase?
Each ACK in Slow Start adds 1 MSS to cwnd, which doubles the window over one full RTT.
Under TCP Reno, if cwnd = 24 MSS when 3 Duplicate ACKs arrive, what are the new values of ssthresh and cwnd?
Reno sets ssthresh = cwnd / 2 = 12 and inflates cwnd to ssthresh + 3 = 15 for the 3 segments that triggered the duplicate ACKs.
Why does TCP treat a Retransmission Timeout more severely than 3 Duplicate ACKs?
Duplicate ACKs are generated when out-of-order packets arrive, proving the path is still delivering traffic.
Why does AIMD (Additive Increase, Multiplicative Decrease) converge competing TCP flows to fair bandwidth shares?
Halving both windows shrinks the absolute difference between a large flow and a small flow by 50% on every loss event.