Concepts / TCP performance

TCP performance

Congestion window

Also called cwnd, congestion control, slow start

The sender's own limit on data in flight, grown while all goes well and cut on loss.

The sender's own limit, set by losses
The sender's own limit, set by losses

The congestion window (cwnd) is the sender's guess at what the network takes; it never goes on the wire. In slow start every ack adds one, so it doubles each round trip: 10, 20, 40. Past ssthresh it grows by one a round trip. Three duplicate acks halve it, a timeout drops it to 1. The sender keeps min(cwnd, the receiver's window) in flight.

TCP sends no more than the smaller of the receiver's window and its congestion window. It grows fast in slow start, then more carefully, and is halved when a loss signals congestion. Halving takes more from a big window than from a small one, which is how strangers come to share a link without coordinating, as long as the queue drops packets rather than holding them all. ss -ti shows it.

See it on real machines

Read next

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab