Congestion Control: Slow Start, Congestion Avoidance and Fast Recovery
Why TCP must slow down when the network is overloaded, how the congestion window limits a sender, and how slow start, congestion avoidance and fast recovery work, measured on a real Linux connection through a bottleneck.
kvi5hnuCode Sprout team member20 min readOn this page
Flow control, covered in article 69, stops a sender from overrunning the receiver. But the receiver is rarely the slowest part of the path. Somewhere between the two hosts there is a bottleneck: the slowest link, often a home uplink, a Wi-Fi hop or a busy peering link. If senders push data into it faster than it can carry, packets pile up in the router's queue, and when the queue is full the router drops them.
Congestion control is how TCP finds out how fast the path can go and slows down when it's overloaded. It's what lets billions of connections share the Internet without anyone coordinating them. This article covers the classic algorithms every TCP still builds on: the congestion window, slow start, congestion avoidance and fast recovery, with a real connection measured in the course lab.
Why congestion control exists
A router can store packets for a while, but it can't store them forever. If packets arrive faster than the outgoing link can send them, for long enough, the queue grows until memory runs out and the router discards packets. That state, where the network is dropping data because offered traffic exceeds capacity, is congestion. A single fast connection is enough to cause it.
Retransmission alone makes congestion worse. If every sender responds to loss by resending, the network carries more and more copies of the same data, and less and less useful data gets through. In October 1986 this happened on the early Internet: throughput between two sites at UC Berkeley and Lawrence Berkeley Laboratory, a few hundred meters apart, fell from 32 kbit/s to about 40 bit/s. This is congestion collapse. The fix, published in 1988, was the set of algorithms in this article, and every standard TCP has run them ever since.
How TCP detects congestion
Routers on the classic Internet don't tell senders that they're congested. TCP has to infer it, and the main signal is packet loss. TCP assumes that when a segment is lost, a queue somewhere overflowed, and that it should slow down.
On wired networks this assumption is usually right, because bit errors are very rare. On wireless links it's sometimes wrong: radio errors lose packets even when no queue is full. Link-layer retransmission in Wi-Fi and cellular hides most of those errors from TCP, but not all of them.
There are two other signals, both covered later in this part:
- Rising delay. A queue that fills makes packets wait longer, so the RTT goes up before anything is dropped. Delay-based algorithms such as Vegas and BBR use this (article 76).
- Explicit Congestion Notification (ECN). A router marks packets instead of dropping them, and the receiver reports the marks back (article 77).
The congestion window
To slow down, a TCP sender keeps a second limit next to the receiver's advertised window. The congestion window, cwnd, is the sender's estimate of how much data the network can handle. The sender may have at most this much unacknowledged data in flight:
Here rwnd is the receiver's advertised window (the Window field, scaled). The receiver tells the sender rwnd explicitly in every ACK, but nobody tells it cwnd: the sender has to work out cwnd from what happens to its packets. The amount of data actually sent and not yet acknowledged is the flight size, which is never more than W.
What should cwnd be? Ideally about the bandwidth-delay product (BDP) of the path: the bottleneck rate times the round-trip time. That's how much data fits "in the pipe" at once:
- With less than one BDP in flight, the bottleneck sometimes sits idle.
- With more than one BDP in flight, the extra can't go any faster. It just waits in a queue, adding delay, until the queue overflows.
The lab path used in this article has a 10 Mbit/s bottleneck and a 40 ms base RTT:
The router in front of the bottleneck can queue another 60,000 bytes (about 41 segments). So the connection should run without loss up to about 34 + 41 = 75 segments in flight, and lose packets above that. Keep those two numbers in mind for the graphs below.
The ACK clock
Once a connection is running, TCP's sending is paced by the ACKs coming back. Packets leave the sender in bursts, but they can cross the bottleneck only at its rate, so they come out the other side spaced apart. The receiver ACKs each one (or every second one) as it arrives, so the ACKs come back with the same spacing. When the sender gets an ACK, data has left the network, and it's safe to put the same amount in.
The diagram below follows one burst through a bottleneck and back.

This self-clocking keeps the amount of data in the network roughly constant in a steady state: one packet out for each packet that left. It's the reason the two algorithms below change cwnd per ACK rather than per unit of time. The problem is getting the clock started on a new connection, when there are no ACKs yet. That's slow start's job.
Slow start
A new connection has no idea how fast the path is. Sending a full receiver window at once could dump hundreds of packets into a queue that can hold a few dozen. Slow start probes instead:
- Start with a small initial window (IW). RFC 5681 allows up to about 4 KB (2 to 4 segments). Since RFC 6928, most systems use 10 segments, and Linux has used 10 since 2011.
- For every ACK that acknowledges new data, increase
cwndby the amount acknowledged, up to one segment per ACK.
Each segment that is acknowledged lets the sender send two more, so cwnd doubles every round trip: 10, 20, 40, 80, and so on. Despite the name, this is exponential growth. It's "slow" only compared with sending a full window immediately. Reaching a window of W segments from IW takes about round trips.
Here is the first half second of the lab connection on a log scale, where steady doubling shows as a straight line:

The growth is a little uneven, because the receiver's ACK timing and the sampling interval aren't in step with the round trips. Still, cwnd goes from 10 to 20, 40 and 80 in about four round trips.
Slow start also overshoots. cwnd peaked near 140 segments, almost twice the 75 the path can hold. That's built in: by the time the first loss is detected, a full RTT has passed, and during that RTT cwnd kept doubling. A sender in slow start typically ends up with about twice the right window in flight, loses a lot of packets at once, and has to recover. The steep drop after the peak is that recovery.
Congestion avoidance
Once cwnd reaches the slow start threshold, ssthresh, TCP switches to congestion avoidance. It now adds about one segment per round trip. In the formula, SMSS is the sender maximum segment size, the largest segment this sender may send (1448 bytes in the lab):
A window of cwnd bytes produces about cwnd / SMSS ACKs per round trip, and each adds SMSS × SMSS / cwnd, so together they add one SMSS. Growth is therefore linear in time, gently probing for spare capacity. This is the additive increase half of AIMD (additive increase, multiplicative decrease).
ssthresh is TCP's memory of where trouble started. A new connection begins with ssthresh effectively infinite, so it stays in slow start until the first loss. After a loss, TCP sets:
This is the multiplicative decrease: halving the window halves the sending rate. The rule for choosing between the two algorithms is then simple:
cwnd < ssthresh: slow start.cwnd > ssthresh: congestion avoidance.- When they're equal, either is allowed.
What happens on a loss
How far TCP backs off depends on how it found the loss.
Retransmission timeout (RTO). If the retransmission timer expires, TCP assumes the network may be badly congested: no ACKs at all came back for a whole timeout. It sets ssthresh as above, sets cwnd to one segment (the loss window), retransmits, and starts over in slow start. It slow-starts back up to the new ssthresh and then continues in congestion avoidance.
Three duplicate ACKs (fast retransmit). If segments after the lost one arrive, the receiver keeps sending duplicate ACKs. Each one means a segment left the network, so the network is still delivering. Collapsing to one segment would waste capacity, so TCP does something milder.
The first TCP with congestion control (4.3BSD Tahoe, 1988, a release of the BSD version of Unix) still went back to slow start on any loss. Reno (4.3BSD Reno, 1990) added fast recovery, which RFC 5681 describes like this:
- On the third duplicate ACK, set
ssthresh = max(FlightSize / 2, 2 × SMSS), retransmit the missing segment, and setcwnd = ssthresh + 3 × SMSS. The 3 accounts for the three segments the duplicate ACKs prove have left the network. - For each further duplicate ACK, add one SMSS to
cwnd. This "inflation" lets a new segment go out for each one that leaves, which keeps the ACK clock running. - When an ACK arrives that acknowledges new data, set
cwnd = ssthresh("deflation") and continue in congestion avoidance.
The result is that after a single loss, a Reno sender drops to half its previous rate and keeps going, instead of starting over from one segment.
The state diagram below puts the three phases and the two kinds of loss together.

There is one more rule. After a connection has been idle for longer than one RTO, its old cwnd may no longer match the network, and sending the whole window at once would be a burst. RFC 5681 says to restart from a restart window, min(IW, cwnd). Linux does this by default (net.ipv4.tcp_slow_start_after_idle = 1). Article 73 shows its effect.
The sawtooth: Reno measured over 25 seconds
Here is the whole lab connection. The default congestion control on this lab system is CUBIC, and Reno is also available:
net.ipv4.tcp_congestion_control = cubic
net.ipv4.tcp_available_congestion_control = reno cubic
The base RTT, measured with ping before the transfer:
5 packets transmitted, 5 received, 0% packet loss, time 1235ms
rtt min/avg/max/mdev = 47.058/60.249/102.996/21.468 ms
The minimum, about 47 ms, is the 40 ms of added delay plus processing and scheduling overhead in the lab (TCP's own minrtt later saw 41 ms). The higher values come from scheduling noise in the lab. And here is the sender's cwnd and ssthresh for the whole 25 seconds:

Everything this article has described is visible:
- Slow start and overshoot. The spike at the start goes to about 140 segments, far more than the path can hold.
- Recovery from the overshoot.
cwndcomes down in two steps to about 35. The large burst of losses took more than one reduction to clear. - Additive increase. Each rising edge is a straight line, about one segment per RTT. From 35 to 70 segments takes about 35 round trips of 45 to 75 ms, which matches the 2 to 3 seconds between drops.
- Multiplicative decrease. Each peak is at about 65 to 72 segments, close to the 75 the BDP and queue allow, and each drop roughly halves
cwnd. The dashedssthreshline steps to half of each peak. - No timeouts.
cwndnever drops to 1. Every loss here was repaired by fast retransmit and fast recovery.
The drops aren't vertical lines. On Linux, cwnd comes down over about one round trip rather than in one step, because PRR spreads the reduction across the ACKs that arrive during recovery.
A snapshot from ss about 12 seconds into the transfer shows the same state from the sender's point of view:
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 618296 192.0.2.10:40000 198.51.100.10:5201
reno wscale:10,10 rto:260 rtt:59.754/1.106 mss:1448 pmtu:1500 rcvmss:536 advmss:1448 cwnd:49 ssthresh:36 bytes_sent:13457749 bytes_retrans:118736 bytes_acked:13268062 segs_out:9297 segs_in:4458 data_segs_out:9295 send 9499213bps lastsnd:1 lastrcv:11752 lastack:1 pacing_rate 11399008bps delivery_rate 9322352bps delivered:9165 busy:11740ms unacked:49 retrans:0/82 reordering:4 reord_seen:1 rcv_space:14480 rcv_ssthresh:64088 notsent:547344 minrtt:41.186 snd_wnd:1146880 rcv_wnd:64512
The useful fields:
| Field | Meaning in this snapshot |
|---|---|
reno | The congestion control algorithm in use |
cwnd / ssthresh | cwnd is above ssthresh, so the connection is in congestion avoidance |
rtt and minrtt | The current smoothed RTT is well above the minimum. The difference is time spent waiting in the router's queue |
unacked | Segments in flight, equal to cwnd here: the sender is using its whole window |
retrans:0/N | No retransmission outstanding now, and N retransmitted segments so far |
notsent | Data the application has written that is waiting for window space |
delivery_rate | The rate at which data is being acknowledged, close to the 10 Mbit/s bottleneck |
The RTT figures tell you about the queue. With about 49 segments in flight and only 34 fitting in the BDP, roughly 15 segments (about 22 KB) were waiting in the queue. At 10 Mbit/s, 22 KB takes about 17 ms to drain, which is close to the gap between the smoothed RTT and minrtt.
The overall result from iperf3:
0.00-25.00 sec 27.6 MBytes 9.27 Mbits/sec 97 sender
0.00-25.08 sec 27.2 MBytes 9.11 Mbits/sec receiver
The columns are the time interval, the data transferred and the average rate; 97 on the sender's line is its count of retransmitted segments. The connection averaged a little over 9 Mbit/s on a 10 Mbit/s link, despite nearly a hundred retransmitted segments. The sawtooth never drops below one BDP for long, so the bottleneck is almost always busy. That's the point of sizing the queue at about one BDP: when cwnd halves, the queue drains but the link doesn't go idle.
Common questions
Why does TCP treat packet loss as a congestion signal?
On wired paths, nearly all loss comes from full queues, so loss is a reliable signal of congestion. TCP had no other signal when these algorithms were designed: routers didn't report their state. ECN and delay measurements were added later as earlier, gentler signals.
If slow start doubles every RTT, why is it called slow?
It's slow compared with what came before it: early TCPs sent the receiver's whole window at once. Slow start ramps up from a few segments, so even its exponential growth is gentler than an instant full-window burst.
What is the difference between cwnd and the receive window?
The receive window (rwnd) is set by the receiver and is about buffer space at the receiver. cwnd is computed by the sender and is about capacity in the network. The sender is limited by whichever is smaller. In the lab run, rwnd was over 1 MB, so cwnd was the limit.
Why does an RTO cut cwnd to one segment, but three duplicate ACKs only halve it?
Duplicate ACKs prove that later segments are still getting through, so the network is congested but working. A timeout means nothing came back for a whole RTO, which could mean severe congestion or a broken path, so TCP restarts from the most cautious state.
Does a congestion window apply to the receiver's ACKs?
No. ACKs aren't congestion-controlled by cwnd. The receiver sends them as data arrives. Congestion on the return path affects TCP only indirectly, by delaying or losing ACKs and so disturbing the ACK clock.
Why does ss show cwnd in segments, while RFC 5681 uses bytes?
The RFC states the rules in bytes, and some stacks keep cwnd in bytes. Linux keeps it in segments (packets) and multiplies by the MSS where needed. The behavior is equivalent when segments are full-sized.
Is Reno still used?
Rarely as the default: Linux, Windows and macOS default to CUBIC (RFC 9438, article 75), and some large services use BBR (article 76). But Reno's rules are the baseline every algorithm must be compared with. RFC 5681 says an implementation must not be more aggressive than these algorithms allow, and alternatives are judged on whether they share fairly with Reno-style TCP.
Summary
- Congestion means a bottleneck queue overflows because senders offer more than the link carries. Uncontrolled retransmission caused congestion collapse in 1986, and the algorithms here fixed it.
- TCP infers congestion mainly from loss. A sender may have at most
min(cwnd, rwnd)in flight, and the ideal is about one bandwidth-delay product. - ACKs pace the sender (the ACK clock). Slow start begins at IW (10 segments on Linux) and doubles
cwndevery RTT, typically overshooting the right window by about 2×. - Congestion avoidance adds about one segment per RTT once
cwndreachesssthresh. After a loss,ssthreshbecomes half the flight size. - A timeout resets
cwndto one segment and slow-starts again. Three duplicate ACKs trigger fast retransmit and fast recovery, which halve the rate without restarting. - The measured Reno connection showed every phase: slow start, overshoot, the linear-rise-and-halve sawtooth near BDP plus queue, and about 9.3 Mbit/s on a 10 Mbit/s link.
Practice questions
1. A path has a 50 Mbit/s bottleneck and a 60 ms RTT. What is its BDP in bytes and in 1448-byte segments?
Answer
50,000,000 × 0.060 = 3,000,000 bits = 375,000 bytes. 375,000 / 1448 ≈ 259 segments. A sender needs about 259 segments in flight to keep this link busy.
2. A new Linux connection starts with IW = 10 and nothing limits it except slow start. Roughly how many round trips does it take to reach a window of 640 segments?
Answer
640 / 10 = 64 = 2⁶, so about 6 round trips: 10, 20, 40, 80, 160, 320, 640. With delayed ACKs and per-ACK counting it can take somewhat longer.
3. A sender has 80 segments in flight when it gets the third duplicate ACK. Using RFC 5681 Reno rules, what are ssthresh and cwnd immediately afterward, and what is cwnd when recovery ends?
Answer
ssthresh = max(80 / 2, 2) = 40 segments. cwnd = ssthresh + 3 = 43 segments, inflated by one for each further duplicate ACK. When a new ACK ends recovery, cwnd = ssthresh = 40, and congestion avoidance continues from there.
4. The same sender instead suffers a retransmission timeout with 80 segments in flight. What are ssthresh and cwnd now, and how does the sender get back to a window of 40?
Answer
ssthresh = 40 and cwnd = 1 segment. It slow-starts (1, 2, 4, 8, 16, 32, then capped at 40) for about 6 round trips, then continues in congestion avoidance, adding one segment per RTT.
5. In the lab, the sawtooth peaked at about 70 segments while the BDP was about 34. Where were the other segments, and what did they cost?
Answer
In the router's queue in front of the bottleneck, which held up to 60 KB (about 41 segments). They didn't increase throughput, since the link was already busy, but they added queuing delay: the RTT rose from about 41 ms toward 60 ms and more near each peak.
6. Congestion avoidance adds one segment per RTT. Starting at 35 segments with an RTT of 50 ms, how long does it take to reach 70 segments?
Answer
35 RTTs × 50 ms = 1.75 seconds. In the lab, with the RTT rising toward 60 to 75 ms as the queue filled, each rise took about 2 to 3 seconds.
7. Why must a TCP sender wait for ACKs before growing cwnd, rather than simply increasing its rate over time?
Answer
ACKs are the only evidence the network delivered the data. Growing on ACKs ties the increase to what actually got through, and keeps the sender self-clocked: one new packet for each one that left. Growing on a timer would keep increasing the rate even when packets were piling up in a queue or being lost.
Previous: TCP Keepalive: Detecting Dead Peers and Keeping NAT Mappings Alive
Next: Better Loss Recovery: NewReno, SACK-Based Recovery, PRR and Limited Transmit

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.