TCP Congestion Control
Runs in browserVisualize AIMD and other algorithms
Algorithm
Parameters
Events
How to Use
Select algorithm and start simulation.
You will see:
- Congestion Window (cwnd) growth
- Packet Loss events & Recovery
- Algorithm behavior (AIMD/CUBIC)
AIMD (Additive Increase, Multiplicative Decrease)
Slow Start: cwnd doubles every RTT until ssthresh
Congestion Avoidance: cwnd increases by 1 per RTT
On Loss: ssthresh = cwnd/2, cwnd = ssthresh
TCP Congestion Control: The Traffic Cop of the Internet
TCP Congestion Control is the fundamental mechanism that prevents the global Internet from collapsing under its own weight. While Flow Control (the receiver throttling the sender) protects a slow device from being overwhelmed, Congestion Control protects the network (the routers and switches between them) from being saturated with more data than it can physically carry.
Key Concepts
- Congestion Window (cwnd): Max data in flight without ACK
- Slow Start: Exponential growth until threshold
- Congestion Avoidance: Linear growth after threshold
- Fast Retransmit: Retransmit on 3 duplicate ACKs
- Fast Recovery: Avoid slow start after packet loss
Common Algorithms
AIMD (Reno)
Additive Increase, Multiplicative Decrease. Classic algorithm: increase by 1, halve on loss.
CUBIC
Linux default. Uses cubic function for window growth. Better for high-bandwidth networks.
BBR
Google's Bottleneck Bandwidth and RTT. Measures available bandwidth directly.
When Congestion Occurs
TCP detects congestion through:
- Timeout: No ACK received — severe congestion, reset to slow start
- 3 Duplicate ACKs: Packet lost but network flowing — fast recovery
- ECN: Explicit Congestion Notification from routers
💡 Pro Tips
- Use BBR for better performance on lossy networks
- Tune initial cwnd for faster startup (Linux: tcp_initcwnd)
- Monitor retransmission rates to detect congestion
- Consider QUIC for applications needing lower latency
References & Further Reading
- RFC 5681: TCP Congestion Control - The standard specification.
- BBR: Congestion-Based Congestion Control - Google's BBR paper.
- High Performance Browser Networking - Excellent chapter on TCP.