7.3 TCP Congestion Control: AIMD, Slow Start & Thresholds
💡 Core Intuition: The Blind Explorer in an Uncharted Tunnel
🍳 The Everyday Analogy: Navigating in Complete Darkness
Imagine entering a pitch-black cave tunnel whose ceiling height you do not know:
- Slow Start (Exponential Acceleration): At the cave entrance, you do not crawl forward at 1 centimeter an hour. You start by taking 1 confident stride. If you do not hit your head, you take 2 strides. If clear, you sprint 4 strides, then 8 strides. You double your pace every second because you know you are far below the tunnel ceiling.
- Threshold Reached (Congestion Avoidance): Once you reach a marked checkpoint where you previously bumped your head (the Slow Start Threshold), sprinting blindly is dangerous. You immediately switch modes: you take exactly one careful additional stride per step ().
- Bumping Your Head (Multiplicative Decrease): Suddenly, your forehead hits a low-hanging stalactite! You do not gently slow down by 1 stride; you violently duck down, drop your pace by half (or drop down to 1 step), establish that the new danger height is half of your current speed, and begin cautiously inching forward again.
💻 Bridging to Computer Science
In TCP:
- The sender has zero advance knowledge of the intermediate routers' bottleneck bandwidth or buffer capacity.
- Slow Start quickly ramps up transmission from to probe the link's capacity, doubling the Congestion Window () every Round-Trip Time ().
- When crosses (Slow Start Threshold), TCP switches to Congestion Avoidance (Additive Increase), incrementing by only per .
- When packet loss occurs, TCP slashes its transmission window (Multiplicative Decrease), producing the famous AIMD Sawtooth Waveform.
📑Table of Contents
- 🪟 Dual-Window Governance: The Effective Sender Window
- 🚀 Phase 1: Slow Start (Exponential Acceleration)
- 🛡️ Phase 2: Congestion Avoidance (Additive Increase)
- 📉 Phase 3: Multiplicative Decrease & The Sawtooth Waveform
- ⚖️ Mathematical Proof of Fairness: The Chiu-Jain Convergence Plane
- 🏭 Real-World Production Context: Modern Linux TCP & Bufferbloat
- 📐 Numerical Applications & Worked Examples
- 🎯 Exam & Interview Pitfall Check
🪟 Dual-Window Governance: The Effective Sender Window
At any instant, a TCP sender is constrained by two entirely independent physical boundaries:
- Flow Control Boundary (): Dictated by the destination receiver to prevent socket buffer overflow.
- Congestion Control Boundary (): Maintained internally by the sender to prevent intermediate router queue exhaustion.
| Constraint Dimension | Flow Control Boundary () | Congestion Control Boundary () |
|---|---|---|
| Origin & Feedback | Communicated dynamically by the receiving host in TCP header ACK packets | Estimated and maintained locally by the sending host's OS kernel state machine |
| Target Protected | Protects the destination host's application socket receive buffer | Protects intermediate network routers, switch queues, and physical links |
| Constraint Dynamic | Static physical cap based on allocated user-space buffer memory | Dynamic elastic boundary probing transit capacity via loss signals |
| Governing Policy | Sliding Window Protocol (RFC 793, RFC 1323) | AIMD, Slow Start, Congestion Avoidance (RFC 5681) |
The maximum volume of unacknowledged data the sender is permitted to inject into the transit path is strictly governed by the Effective Sender Window:
- If : The bottleneck is the Receiver's CPU/RAM.
- If : The bottleneck is the Intermediate Network Fabric.
🚀 Phase 1: Slow Start (Exponential Acceleration)
When a TCP connection begins, the sender does not know whether the path can support or . Injecting a giant burst of packets immediately could cause instant buffer overflow.
Slow Start vs Congestion Avoidance: Two Modes of cwnd Growth
Contrasting rapid exponential bandwidth discovery against cautious linear capacity probing
Slow Start Phase (Exponential)
- •Initial Window: Starts at 1 MSS (or modern IW10).
- •Per-ACK Rule: cwnd increases by +1 MSS for every arriving ACK.
- •Per-RTT Rule: cwnd doubles every round trip: cwnd(k) = 2^k MSS.
- •Rapidly discovers order of magnitude of link capacity.
Congestion Avoidance Phase (Additive)
- •Triggered when cwnd reaches or exceeds ssthresh.
- •Per-ACK Rule: cwnd increases by (1 / cwnd) MSS for each arriving ACK.
- •Per-RTT Rule: cwnd increases by exactly +1 MSS per round trip time.
- •Cautiously probes for incremental spare bandwidth without triggering loss.
The Algorithm: Slow Start Mechanics
- Initialization: Set (historically , modern Linux defaults to ).
- Per-ACK Increment Rule: For every individual incoming valid acknowledgment:
- Per-RTT Growth Dynamic:
- Round 0: Sender transmits .
- Receiver sends 1 ACK becomes .
- Round 1: Sender transmits .
- Receiver sends 2 ACKs becomes .
- Round 2: Sender transmits .
- Receiver sends 4 ACKs becomes .
After round-trip times (s) with no packet loss:
Despite its name ("Slow Start"), the growth is actually exponential! It is called "slow" only in comparison to naive blasting of maximum window size at connection startup.
🛡️ Phase 2: Congestion Avoidance (Additive Increase)
Exponential doubling cannot continue indefinitely without overflowing router buffers. TCP introduces a governor called the Slow Start Threshold () (initially set to a large value, typically or the maximum receiver window).
The TCP Congestion State Transition Lifecycle
How the transport layer navigates exponential growth, linear probing, and multiplicative recovery
Slow Start
Exponential growth: cwnd doubles every RTT until ssthresh.
Congestion Avoidance
Additive increase: cwnd increases by +1 MSS per RTT.
Multiplicative Decrease
Halve ssthresh: ssthresh = max(2, cwnd / 2).
Re-Enter Slow Start
Set cwnd = 1 MSS (Tahoe) and ramp back up to new threshold.
The Algorithm: Congestion Avoidance Mechanics
Once , TCP switches to Congestion Avoidance:
- Per-ACK Increment Rule: For every incoming valid acknowledgment:
- Per-RTT Growth Dynamic:
- During one , the sender dispatches segments.
- As all segments are acknowledged:
- The window increases by exactly per :
This linear, cautious pacing allows TCP to steadily probe for newly available bandwidth without shocking the network.
📉 Phase 3: Multiplicative Decrease & The Sawtooth Waveform
When an intermediate router drops a packet due to buffer exhaustion, the sender detects packet loss.
The Multiplicative Decrease Rule
Regardless of whether loss is detected via Timeout or 3 Duplicate ACKs, the Slow Start Threshold is immediately cut in half:
In classic TCP Tahoe:
- After setting , the sender drops back to :
- The sender re-enters Slow Start, exponentially doubling up to the new , and then switches to linear Congestion Avoidance.
| Phase / State | Operational Condition | Rate of Change | Algorithmic Behavior & Waveform Trajectory |
|---|---|---|---|
| Phase 1: Slow Start | Exponential: doubles per | Rapidly escalates window () to probe pipe capacity. Steep exponential rising edge. | |
| Phase 2: Congestion Avoidance | Additive: per | Linear upward slope (). Cautiously probes spare bandwidth without queue collapse. | |
| Congestion / Loss Event | Packet loss detected (e.g. at ) | Instantaneous threshold cut | Buffer overflow occurs. Threshold halved: . |
| Tahoe Collapse | Post-loss recovery | Floor reset: | Immediate vertical plunge down to . Re-enters Slow Start up to , repeating the cycle. |
This cycle of linear ramp-up followed by sudden downward cuts produces the famous AIMD Sawtooth Waveform.
⚖️ Mathematical Proof of Fairness: The Chiu-Jain Convergence Plane
Why does TCP use Additive Increase Multiplicative Decrease (AIMD) rather than other combinations like Additive Increase Additive Decrease (AIAD) or Multiplicative Increase Multiplicative Decrease (MIMD)?
In 1989, Dah-Ming Chiu and Raj Jain published a seminal mathematical paper proving that only AIMD satisfies both optimal efficiency and distributive fairness among competing flows sharing a bottleneck link.
- Flow State Vector: , where and represent the transmission rates of User 1 and User 2.
- The Efficiency Boundary: The line with slope . Any operating point below this line underutilizes the physical bottleneck; points above it overload router queues and induce loss.
- The Fairness Boundary: The ray radiating from the origin at . All points along this line represent equal bandwidth allocation.
- The Optimal Operating Point: The intersection of the Efficiency Line and Fairness Line: .
| Allocation Scheme | Additive / Multiplicative Mechanics | Phase Plane Vector Behavior | Fairness Convergence Proof |
|---|---|---|---|
| AIAD (Additive Inc / Additive Dec) | Increase: , Decrease: | Moves parallel along a line back and forth | ❌ Does Not Converge: Trapped in a limit cycle; difference never decreases. |
| MIMD (Multiplicative Inc / Multiplicative Dec) | Increase: , Decrease: | Moves along rays passing through the origin | ❌ Does Not Converge: Ratio remains fixed; unfair allocations remain permanently unfair. |
| AIMD (Additive Inc / Multiplicative Dec) | Increase: , Decrease: | Additive steps shift trajectory at ; multiplicative cuts pull toward origin | ✅ Provably Converges: Repeated AIMD cycles pull the operating state asymptotically toward . |
The Chiu-Jain Convergence Geometry
Consider two flows with throughputs and sharing a bottleneck pipe of capacity :
- Efficiency Line: . (Points below the line underutilize the link; points above cause packet loss).
- Fairness Line: (a line passing through the origin).
- The Goal: Drive any arbitrary starting point toward the Optimal Intersection Point .
Vector Trajectories of Rate Adjustment Policies
- Additive Increase ():
- Both users increase throughput by the identical constant amount: .
- The vector moves at a angle parallel to the Fairness Line.
- It moves closer to the efficiency line without changing the difference .
- Multiplicative Decrease ():
- Both users reduce throughput proportionally: where .
- The vector moves directly toward the origin .
- Because the line to the origin makes a steeper angle for the user with higher throughput, the absolute gap shrinks by !
The Proof of Convergence
- Additive Increase pushes the state toward the efficiency line parallel to the fairness axis.
- Multiplicative Decrease pulls the state toward the origin, halving the disparity between the two flows.
- Together, each AIMD cycle acts as a spiral convergence that inexorably drives competing flows to the intersection of fairness and efficiency:
Under MIMD or AIAD, the trajectory forms closed loops or diverges, failing to provide distributed fairness.
🏭 Real-World Production Context: Modern Linux TCP & Bufferbloat
1. Initial Congestion Window Evolution (IW10)
In RFC 2581 (1999), TCP's initial window was strictly ().
- In 2013, Google published measurements demonstrating that slow-start latency dominated web page retrieval times.
- RFC 6928 updated the standard, setting ().
- This enables typical web requests (HTTP headers, small CSS/JS files) to complete in a single , eliminating multiple round-trip slow-start stalls.
2. The Bufferbloat Crisis & BBR
Traditional AIMD assumes that packet loss is the only signal of congestion.
- Modern router vendors installed massive multi-megabyte DRAM buffers to prevent packet drops.
- Instead of dropping packets, routers buffer thousands of segments, inflating s from to —a pathology known as Bufferbloat.
- In response, Google developed BBR (Bottleneck Bandwidth and RTT): a model-based congestion control algorithm that tracks bottleneck bandwidth and minimum propagation delay (), capping in-flight data at the Bandwidth-Delay Product () without needing to induce packet loss.
📐 Numerical Applications & Worked Examples
Example 1: Full TCP Tahoe Recovery Trace
Problem Statement:
A TCP connection using TCP Tahoe experiences a timeout when its congestion window reaches . The Maximum Segment Size is . The Round-Trip Time of the path is . Assume receiver window is unlimited.
- Find the new value of and immediately after the timeout.
- Trace the value of round-by-round until it reaches again.
- Compute the total time (in milliseconds) required for the connection to recover back to .
Step-by-Step Solution:
-
Identify Given Parameters:
-
Compute New Threshold & Initial Recovery Window:
-
Trace Window Progression Round-by-Round:
| RTT Round | Phase | cwnd at Start of Round | Window Growth Dynamic | cwnd at End of Round |
|---|---|---|---|---|
| Round 1 | Slow Start | () | Doubles () | () |
| Round 2 | Slow Start | () | Doubles () | () |
| Round 3 | Slow Start | () | Doubles () | () |
| Round 4 | Congestion Avoidance | () | Linear () | () |
| Round 5 | Congestion Avoidance | () | Linear () | () |
| ... | ... | ... | ... | ... |
| Round 11 | Congestion Avoidance | () | Linear () | () |
- Calculate Total Elapsed Recovery Time:
- Slow Start Phase: (reaches threshold of at end of Round 3).
- Congestion Avoidance Phase: Needs to advance from to .
- Total RTTs required:
- Total elapsed time:
Example 2: cwnd State Across Successive Transmissions
Problem Statement:
Consider an instance of TCP's AIMD algorithm where the window size at the start of the slow start phase is , and the threshold at the start of the first transmission is . Assume that a timeout occurs during the fifth transmission. Find the congestion window size at the end of the sixth transmission under TCP Tahoe.
Step-by-Step Solution:
- Initial State:
- , .
- Transmission 1 (Slow Start): Transmits . ACKs received .
- Transmission 2 (Slow Start): Transmits . ACKs received (Hits threshold!).
- Transmission 3 (Congestion Avoidance): Starts at . Grows linearly .
- Transmission 4 (Congestion Avoidance): Starts at . Grows linearly .
- Transmission 5: Transmits with . Timeout occurs!
- New threshold: .
- Reset window: .
- Transmission 6 (Slow Start): Transmits . ACK received .
Example 3: Effective Transmit Window with Receiver Limitation
Problem Statement:
A TCP sender has an estimated congestion window of . The receiver advertises . The sender has transmitted bytes up to () and received an ACK for byte (). How many additional bytes can the sender transmit immediately?
Step-by-Step Solution:
- Determine Effective Window:
- Calculate Data Currently in Flight:
- Calculate Usable Transmit Capacity:
🎯 Exam & Interview Pitfall Check
- Why does cwnd increase by 1 MSS per RTT in Congestion Avoidance if the formula is
cwnd = cwnd + 1/cwnd?: The formulacwnd = cwnd + 1/cwndis applied per incoming acknowledgment. During one RTT, the sender hascwndpackets outstanding, which generatescwndindividual ACKs. Summing the increment across all ACKs in that RTT yields: . - Why does AIMD converge to fair bandwidth sharing while AIAD does not?: In Additive Increase Additive Decrease (AIAD), both the increase and decrease vectors move parallel to the fairness line. Consequently, the initial throughput disparity is preserved forever. Only Multiplicative Decrease cuts the absolute gap by on every loss event, driving competing flows toward equal bandwidth allocation.
- Trap: Confusing Per-ACK Updates with Per-RTT Updates: In Slow Start,
cwnddoubles every RTT, but it increments by 1 MSS per ACK. If an exam question asks: "If cwnd is 8 MSS and 1 ACK arrives in slow start, what is the new cwnd?", the answer is (NOT 16 MSS!). It only becomes 16 MSS after all 8 ACKs return. - Trap: Assuming ssthresh is Halved After Resetting cwnd: The threshold must ALWAYS be computed from the current window at the moment of loss (). Resetting happens after calculating .