Octet

Explain slow start and congestion avoidance. What is ssthresh?

Show the answer

Say this first

A new connection does not know the path's capacity, so it starts with a small congestion window, 10 segments on modern stacks. In slow start cwnd grows by one segment per ACK, which doubles it every round trip. When cwnd reaches ssthresh, TCP switches to congestion avoidance and grows by about one segment per round trip. On loss detected by duplicate ACKs, ssthresh is set to about half the data in flight and cwnd drops to it. On a timeout, cwnd goes back to one segment and slow start begins again. ssthresh is the line between the two phases.

Go deeper

Round by round

RTTPhasecwnd (segments)
1Slow start10
2Slow start20
3Slow start40
4Slow start80, loss detected
5Recoveryssthresh = 40, cwnd = 40
6Congestion avoidance41
7Congestion avoidance42

This additive increase and multiplicative decrease (AIMD) makes the familiar sawtooth.

Why the initial window matters

An initial window of 10 segments (RFC 6928) is about 14.6 KB. A small web response fits in the first flight; a large one needs several round trips of slow start, which is why latency, not bandwidth, dominates small transfers.

Slow start after idle

Linux shrinks cwnd back toward the initial window when a connection has been idle for longer than one RTO (net.ipv4.tcp_slow_start_after_idle=1). Long-lived connections that send in bursts, like HTTP/2 or database links, sometimes turn it off.

Traps

  • Saying cwnd starts at one segment on modern systems. Linux and most stacks start at 10.
How did you do?Book 6.3 TCP Congestion Control