4.3.22 · D1Computer Networks

Foundations — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

3,137 words14 min readBack to topic

Before you can read the parent note, you need to see what every symbol stands for. We build them one at a time, each on top of the last. Nothing is used before it is drawn.


0. What is a "packet in flight"?

Picture a sender on the left and a receiver on the right, joined by a long tube (the network). The sender drops numbered balls (packets) into the tube. Each ball takes some time to travel across, and the receiver sends back a tiny receipt (an ACK) for each one.

Figure — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

Read the picture: on the far left is the SENDER (blue), on the far right the RECEIVER (green). The white rectangle between them is the network tube. The three yellow balls inside the tube are packets that have been sent but not yet acknowledged — those three are in flight. The blue arrow shows packets moving right; the red arrow shows ACKs (receipts) coming back left. The green double-arrow on the left marks one full down-and-back cycle: that height is one RTT (defined next).

WHY the topic needs this: congestion happens because too many balls are inside the tube at once and they jam up at a narrow point (a router). So the whole game is counting balls in flight. Every other symbol below is a way to count or limit them.


1. RTT — the round-trip time

Look again at figure s01 — the green double-arrow on the left edge. One ball goes right, its ACK comes back left. The total time for that there-and-back journey is the RTT.


2. MSS — the size of one ball

Real data isn't one giant blob; it's cut into equal chunks. The biggest chunk TCP will put in one packet is the MSS.

WHY: the topic constantly grows the window by "one full-size ball" at a time. Thinking in MSS-units turns messy byte counts into simple integers like — you'll see exactly this when the window rules appear in Section 3 and after.


3. The two windows: cwnd and rwnd

Now the heart of it. There are two separate limits on how many balls may be in flight, protecting two different things.

Figure — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

Read the picture: the blue bar is the cwnd gate (the network's limit); the red bar is the rwnd gate (the receiver's limit). The yellow arrow of data must squeeze through both gates to reach the receiver. Whichever gate is narrower is the one that actually stops you — that is the meaning of the min in the formula below.

Now that cwnd is defined, notice the pattern the parent uses everywhere: it grows cwnd by adding one MSS at a time (written cwnd += MSS, meaning "allow one more full-size ball in flight"). This is exactly why we measure cwnd in MSS-units from Section 2 — each step is a clean .

The difference between these two is exactly the topic Flow Control vs Congestion Control — rwnd is flow control, cwnd is congestion control. This whole note is about cwnd.


4. Throughput — why bigger cwnd means faster

We want throughput in bytes per second. Build it up one step at a time.


5. ssthresh — the "be careful now" line

The sender grows cwnd in two gears: a fast gear when far from the limit, a slow gear when near it. The dividing line is ssthresh (whose starting value we set in Section 3).

WHY needed: doubling forever would overshoot the capacity and cause a big loss. ssthresh is the marker that says "stop doubling, tiptoe from here."


6. Exponent and cube root — the growth shapes

Two mathematical shapes appear. You must recognise both. Because the second one needs the loss-factor , we introduce right here (it returns in full context in Section 7).

Figure — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

Read the picture: the blue dotted-line curve is slow start's — it starts at 1 and doubles each RTT, shooting upward. The yellow curve is CUBIC's window function . The green dashed line marks , the old ceiling. The red dotted vertical line at is the inflection: left of it the yellow curve is concave (rising but flattening — cautious, "we're near where it broke"), right of it it turns convex (accelerating upward — exploring for new bandwidth).

Before reading the formula, meet its two ingredients:


7. AIMD — the sawtooth, and the Greek letters

The parent uses (met above) and the phrase AIMD. Here is the full picture, drawn.

Figure — TCP congestion control — slow start, congestion avoidance, fast retransmit, CUBIC

Read the picture: the blue line is cwnd over time. It climbs in a slow straight ramp (additive increase, +1 per RTT), then at each red triangle a loss happens and cwnd is instantly cut by multiplication (multiplicative decrease). The height just before each cut is labelled in yellow — the peak the flow remembers. The repeating rise-then-drop pattern is the famous sawtooth.

Related deeper ideas you'll meet later: the size of a "full pipe" is the Bandwidth Delay Product (bandwidth × RTT); the queues that overflow are studied in Queueing and Router Buffers; and modern alternatives that use delay instead of loss are covered by BBR Congestion Control.


Prerequisite map

Packet and ACK

RTT one heartbeat

MSS chunk size

Throughput = cwnd times MSS over RTT

cwnd and rwnd

ssthresh switch line

Slow start doubling 2 to the n

Congestion avoidance plus 1

AIMD sawtooth and beta

Cube root undoes cube

CUBIC K and window curve

TCP Congestion Control

Each foundation on the left must be solid before the topic on the right makes sense.


Equipment checklist

Cover the right side; can you answer each before revealing?

What does "a packet in flight" mean?
It has left the sender but its ACK hasn't returned yet — it's inside the network tube.
What is one RTT and why is it TCP's clock?
The there-and-back time for a packet+ACK; the sender only learns new information once per RTT, so it can only react per RTT.
What is MSS and why measure cwnd in it?
Maximum Segment Size, the biggest data chunk per packet; counting in MSS turns byte math into simple integers.
Difference between cwnd and rwnd?
rwnd protects the receiver's buffer and rides in ACKs; cwnd protects the network and is private to the sender.
Write the send limit.
bytes in flight .
Where do cwnd and ssthresh START on a new connection?
cwnd starts small (modern default 10 MSS, classic 1 MSS); ssthresh starts effectively infinite until the first loss teaches a real value.
How is ssthresh UPDATED on a loss?
It is relearned: ssthresh ← half the current cwnd (CUBIC: β·cwnd), flooring at 2 MSS — this plants the ceiling where future slow start must stop.
Derive throughput in bytes/sec.
cwnd segments per RTT × MSS bytes/segment ÷ RTT seconds = cwnd×MSS / RTT bytes/s.
What is ssthresh?
The cwnd value where the sender switches from exponential doubling to linear +1-per-RTT growth.
What does describe here?
Slow-start cwnd after RTTs — doubling each RTT.
What are and in CUBIC's window?
= seconds since the last loss (real time, not RTTs); = a fixed steepness constant, default 0.4.
What does answer, and where does CUBIC use it?
"What cubed gives "; it undoes the cube to solve for in CUBIC.
Write and say why it carries .
; the curve must climb the removed fraction from back up to .
Expand AIMD and define and .
Additive Increase Multiplicative Decrease; = fraction of cwnd you KEEP on loss (cwnd ← βcwnd, default 0.8); = cwnd just before the last loss.