Communication Networks · Visualized

TCP Congestion Control

Transport Reliability

TCP connections, retransmission timers and sliding windows that make lossy links behave.

6 interactive subtopics — each one animated, step-through and explained.

TCP Congestion Control

Transport Reliability

Routers have finite buffers; every sender pumping at full speed would collapse them. TCP probes for available capacity with a congestion window (cwnd): exponential slow start until the first loss, then linear growth with multiplicative decrease — Additive Increase, Multiplicative Decrease — which produces the classic sawtooth and shares bandwidth fairly among competing flows.

How TCP Congestion Control Works

  1. Slow start: cwnd starts small and DOUBLES every round-trip (exponential) while ACKs keep flowing.
  2. Crossing the slow-start threshold (ssthresh) switches to congestion avoidance: +1 MSS per RTT (linear).
  3. A timeout (severe loss) sets ssthresh = cwnd/2, collapses cwnd to 1 MSS and re-enters slow start.
  4. Triple duplicate ACKs (mild loss) trigger fast retransmit + fast recovery: halve cwnd and continue linearly.
  5. The effective send rate is min(flow control window, congestion window) — receiver AND network limits.

TCP Congestion Control Worked Example

Try it: Watch cwnd through slow start → loss → recovery.

cwnd climbs 1→2→4→8→16, crosses ssthresh=12 at 16… linear +1 per RTT… loss at 18! Fast recovery halves to 9 and ssthresh=9; the sawtooth repeats: grow linearly, drop by half, grow again — that is TCP sharing the pipe politely.

05101520cwndssthreshround 0time (RTTs) →
cwnd growth multiplicative decrease slow-start threshold
Stage 1 / 41
Round 0: cwnd = 1 — SLOW START: doubling every RTT (exponential probe).

TCP Congestion Control: Key Facts to Remember

AIMDadditive increase (+1/RTT), multiplicative decrease (×½) — the fairness recipe
FlavoursReno, CUBIC (Linux default), BBR (model-based, bufferbloat-resistant)
SignalTCP treats packet loss and rising RTT as congestion hints — no router asks explicitly

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.