The Plain Picture#
Two different reasons a courier might slow down:
The receiver's storeroom is full — "Stop, I can only take 10 more boxes until I unpack." That's about the receiver.
The roads are jammed — if every courier keeps pushing trucks onto a jammed highway, nobody moves at all. Everyone needs to back off. That's about the network in between.
The Real Names#
Flow control protects the receiver. Every ACK carries a receive window: "I have room for this many more bytes." The sender never sends more than that without an ACK.
Congestion control protects the network. The sender keeps a congestion window: its own guess of how much data can be in flight without overloading the routers along the path. It sends at most the smaller of the two windows.
Under the Hood — congestion control in one diagram#
data in flight
│ packet loss! → cut back
│ ╱│
│ ╱ │ ╱
│ ╱ │ ╱ slowly grow again
│ ╱ │ ╱
│ slow ╱ │ ╱
│ start ╱ │ ╱
│ ╱ │╱
│ ╱
│ _╱ (doubles every round trip)
└──────────────────────────────────────────▶ timeSlow start: a new connection begins with a small window — about 10 segments (~14 KB) — and doubles it every round trip while ACKs keep coming.
When a packet is lost, TCP takes it as a sign of congestion and cuts the window, then grows it more carefully.
Modern algorithms (like CUBIC, the Linux default, and Google's BBR) differ in exactly how they grow and cut.
Why this matters to you: a brand-new connection is slow at first, because it starts small. A 14 KB first round trip means a 1 MB download needs several round trips just to ramp up. That's another reason to reuse warm connections (Ch 12) — and why keeping web pages' initial size small helps them load fast (Frontend Performance, Accessibility and Security (coming soon)).
Check yourself
3 questionsWhat's the difference between flow control and congestion control?
Show answerHide answer
Flow control stops the sender from overwhelming the receiver (receive window); congestion control stops it from overwhelming the network (congestion window).
What is slow start?
Show answerHide answer
Starting a connection with a small window and doubling it every round trip until loss occurs.
What does TCP treat as a signal that the network is congested?
Show answerHide answer
Packet loss.