Congestion & Flow Control

congestion control

Imagine a motorway where thousands of cars all try to merge at once. If everyone keeps flooring the accelerator, traffic does not move faster — it grinds to a jam, and everybody arrives later. Congestion control is the set of rules that let many senders share the Internet's roads sensibly: each sender watches for signs that the road ahead is filling up, and voluntarily slows down before the jam forms. The remarkable thing is that no central traffic cop tells them to; each TCP sender figures it out on its own.

Concretely, congestion control governs how fast a sender is allowed to push data into the network as a whole — not how fast any one receiver can absorb it. The sender keeps a private variable, the congestion window (cwnd), that limits how many unacknowledged bytes may be in flight. It starts cautiously, ramps the window up while everything is going well, and cuts the window sharply the moment it sees a sign of trouble, which for classic TCP means a lost packet. By repeatedly probing upward and backing off, the sender tracks the network's available capacity without ever being told what it is.

It is vital to keep this separate from flow control. Flow control protects the RECEIVER from being overrun, using the receive window the receiver advertises. Congestion control protects the NETWORK — the shared links and the buffers inside routers — from being overrun by everyone at once. TCP obeys both at the same time: the amount it may send is roughly the smaller of the congestion window and the advertised receive window. Congestion control is the Internet's quiet, decentralised reason it does not collapse under its own popularity.

You start a large download and it quickly climbs to 50 Mbps. A neighbour on the same home line then starts their own download. Within a second or two your speed settles near 25 Mbps and theirs near 25 Mbps — neither of you agreed to this; both TCP senders independently detected the shared link filling up and each backed off until the link was shared roughly evenly.

No central authority assigned the split; two independent senders reaching a rough fair share is congestion control in action.

Congestion control is voluntary, not enforced by the network: it works only because the dominant senders (TCP, QUIC) choose to obey it. A flow that refuses to back off can grab an unfair share, which is why aggressive or non-conformant traffic is a real concern.

Also called
congestion avoidance and control壅塞控制擁塞控制