TCP congestion control
In short: TCP slows itself when the network is congested. It feels its way towards the available bandwidth via a window (cwnd) and halves the rate on packet loss.
In more detail: On a new connection TCP starts with a small window and doubles it every round trip (slow start) until a threshold is reached or loss occurs. Afterwards it grows linearly (congestion avoidance). Loss counts as a signal of congestion and the window shrinks (AIMD: additive increase, multiplicative decrease).
In Depth
- Flow control vs. congestion control: Receiver window protects the receiver, congestion control the network.
- Variants: Reno, CUBIC (Linux default), BBR (measures bandwidth and delay instead of loss).
- Bufferbloat: Overly large buffers in routers hide congestion and create high latency.
- Fast retransmit: Three duplicate ACKs trigger immediate retransmission.
- Bandwidth-delay product: Bandwidth × RTT = amount of data “in the pipe”, determines the needed window.
- UDP/QUIC: Need their own congestion control.
See also: QUIC and HTTP/3, Little’s law and capacity planning