4.3.22 · D3Computer Networks

Worked examples — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

4,240 words19 min readBack to topic

The scenario matrix

Every situation TCP congestion control can throw at you is one row below. The examples that follow are each tagged with the cell they cover, and together they fill the whole table.

Cell Situation Governing rule
A Pure slow start, no loss, ends at ssthresh double per RTT until cwnd ≥ ssthresh
B Slow start → congestion avoidance handover mid-run switch phase when threshold crossed
C Loss = 3 duplicate ACKs (mild) ssthresh ← cwnd/2; cwnd ← ssthresh; stay in CA
D Loss = timeout (severe) ssthresh ← cwnd/2; cwnd ← 1; restart slow start
E Degenerate: cwnd already = 1, timeout again floor at 1; ssthresh floored at 2
F Zero / boundary: cwnd exactly equals ssthresh at start which phase? (CA, by rule)
G Real-world word problem: throughput from cwnd & RTT throughput ≈ cwnd·MSS / RTT
H CUBIC climb: compute , window at several times
I Limiting behaviour: CUBIC vs Reno on a long fat pipe time-based vs RTT-based growth
J Exam twist: full trace mixing SS, CA, dup-ACK and timeout apply all rules in sequence

Prerequisite ideas we lean on: AIMD Fairness (why halving), Bandwidth Delay Product (why CUBIC exists), Queueing and Router Buffers (what "loss" physically means), and Flow Control vs Congestion Control (why cwnd ≠ rwnd).


Example 1 — Pure slow start to threshold · Cell A


Example 2 — Slow start handing over to congestion avoidance · Cell B (figure)


Example 3 — Mild loss: three duplicate ACKs · Cell C


Example 4 — Severe loss: timeout · Cell D


Example 5 — Degenerate corner: repeated timeouts at the floor · Cell E


Example 6 — Boundary: cwnd starts exactly at ssthresh · Cell F


Example 7 — Real-world throughput word problem · Cell G


Example 8 — CUBIC: compute K and the window curve · Cell H (figure)


Example 9 — Limiting behaviour: CUBIC vs Reno on a long fat pipe · Cell I (figure)


Example 10 — Exam twist: full mixed trace · Cell J (figure)


Recall Self-test — cover the answers

Mild loss (3 dup ACKs): cwnd becomes what, phase what? ::: cwnd ← ssthresh (≈ half), stay in congestion avoidance. Severe loss (timeout): cwnd becomes what, phase what? ::: cwnd ← 1 MSS, restart slow start; ssthresh halved. At the boundary cwnd = ssthresh, which phase? ::: Congestion avoidance (rule is cwnd < ssthresh ⇒ slow start). CUBIC's depends on RTT or wall-clock time? ::: Wall-clock time since the last loss — that gives RTT fairness. The formula for ? ::: — the time to climb back to the old peak.