TCP Congestion Control

Slow start, congestion avoidance, CUBIC and BBR algorithms, congestion window vs receive window, and tuning TCP for high-bandwidth long-latency paths.

Overview

Overview TCP congestion control prevents senders from overloading the network. Without it, a fast sender fills every buffer in the path, causing queue overflow and packet drops, which trigger retransmissions that worsen congestion (congestive collapse). TCP probes for available bandwidth while backing off when it detects congestion.

The sender maintains a congestion window (cwnd) limiting unacknowledged data in flight. Effective throughput = min(cwnd, rwnd) / RTT, where rwnd is the receiver's advertised window. Slow start doubles cwnd each RTT until reaching ssthresh or packet loss. Congestion avoidance grows cwnd linearly after that.

CUBIC (Linux default since 2.6.19) uses a cubic growth function for faster recovery on high-BDP paths. BBR (Bottleneck Bandwidth and Round-trip propagation time) takes a fundamentally different approach -- it measures the bottleneck bandwidth and minimum RTT to model the pipe, keeping exactly BDP worth of data in flight rather than reacting to packet loss. BBR dramatically improves throughput on lossy paths (satellite, 4G) where packet loss is not purely caused by congestion.

Key concepts

  • Bandwidth-Delay Product (BDP)
  • BBR vs CUBIC
  • Buffer Bloat

Interview questions

  • You have a 10Gbps link between AWS regions with 80ms RTT but iperf3 shows only 200Mbps. What are the likely causes?

Sign up free to read the full topic

More Networking topics

Start free on Cariara · Coding problems · System design studio