Key Moments
TCP b : Additive Increase Multiplicative Decrease & 'Slow Start' - Computerphile
Want to know something specific about what's covered?
We've already dissected every moment. Ask and we will deliver (with timestamps).
Key Moments
TCP's congestion control uses "slow start" for rapid initial growth and "additive increase, multiplicative decrease" (AIMD) for steady-state management but real-world performance is messier than textbook examples.
Key Insights
TCP's congestion control uses a 'congestion window' to determine how much data can be sent, distinct from the receiver's window, which is an older mechanism.
Loss detection in TCP is signaled by repeated duplicate acknowledgements (a 'triple duplicate') or by a timeout, which triggers a more drastic reduction in the congestion window.
The 'slow start' phase of TCP aggressively increases the congestion window exponentially (e.g., 1, 2, 4, 8, 16 packets) to quickly find available bandwidth.
After slow start, TCP employs 'Additive Increase Multiplicative Decrease' (AIMD), where the window grows by one packet per acknowledged round-trip and halves upon detecting congestion.
Modern TCP flavors, like Cubic (often used by Windows, Mac, and Linux), are adaptations of these core principles, acknowledging that the ideal behavior is more complex in practice.
Real-world network traffic, even when downloading a file with Wget, displays more 'jaggity' and complex behavior than the idealized sawtooth pattern of AIMD, influenced by factors like TLS and home network configurations.
The challenge of reliable and fast data transfer
The core goal of TCP at the transport layer is to ensure reliable and fast data transfer between applications on different computers. Building on previous concepts like sequence and acknowledgement numbers, TCP must manage data flow efficiently across networks of unknown size and varying quality. Sending data one packet at a time and waiting for an acknowledgement is prohibitively slow. Therefore, TCP aims to send multiple packets in a 'flight' and uses cumulative acknowledgements. The sender must adapt to network conditions, from high-speed fiber to slow, unreliable links, without explicit network congestion meters. This necessitates mechanisms to detect and respond to congestion.
Detecting congestion through round-trip times and packet loss
One primary signal of network issues is the Round Trip Time (RTT), the duration for a packet to travel to the receiver and its acknowledgement to return. Fluctuations in RTT can indicate increasing latency. Packet loss is another critical indicator. TCP infers loss when an acknowledgement number doesn't advance or when a timeout occurs, meaning no acknowledgement is received within an expected timeframe. A 'triple duplicate' acknowledgement—where the receiver repeatedly sends an acknowledgement for the last successfully received packet—is a strong hint that a subsequent packet was lost. If no acknowledgements are received at all (a timeout), it suggests severe network congestion. The sender's 'congestion window' (cwnd) is dynamically adjusted based on these signals.
Exponential growth: The 'slow start' phase
To quickly establish an appropriate sending rate, TCP employs a 'slow start' phase, ironically named because it is quite aggressive. Instead of linear growth, the congestion window increases exponentially. It starts small and doubles with each successful round-trip acknowledgement. This means sending 1, then 2, then 4, 8, 16 packets, and so on. This rapid escalation helps the sender quickly discover the approximate capacity of the network, preventing the inefficiency of slowly probing for bandwidth over long periods. This phase continues until the first packet loss is detected or a predefined threshold is reached, at which point TCP transitions to a more conservative growth strategy.
Steady-state management: Additive increase, multiplicative decrease (AIMD)
Once the initial rapid probing of 'slow start' is complete and the network's capacity is better estimated, TCP switches to 'Additive Increase, Multiplicative Decrease' (AIMD). In this phase, if all packets in the current window are successfully acknowledged, the congestion window is increased additively, typically by one packet size per round trip. This represents a slow, steady attempt to utilize more available bandwidth. However, upon detecting congestion (e.g., via triple duplicates or a timeout), the congestion window is drastically reduced, usually halved. This AIMD approach creates a sawtooth pattern where the window slowly grows until congestion is hit, then sharply decreases, and the process restarts. This helps to prevent continuous overwhelming of the network.
The role of different TCP flavors and RFC 5681
The specific rules and behaviors of congestion control are defined in RFCs, with RFC 5681 being a key document for congestion control. TCP is not a single monolithic protocol; various 'flavors' exist, reflecting different implementations and adjustments to the core algorithms. These flavors dictate how TCP responds to congestion signals and when it increases or decreases its window size. Cubic is currently the most popular flavor, used by major operating systems like Windows, macOS, and Linux. These modern flavors are adaptations designed to perform better on today's diverse and high-speed networks, though they are constrained by the legacy of the original TCP header design.
Real-world network traffic is more complex
While the textbook models of slow start and AIMD provide a clear understanding, real-world network traffic often exhibits more jagged and unpredictable behavior. This complexity arises from factors like Transport Layer Security (TLS), which adds overhead and can interleave with TCP packets, and home network configurations (e.g., mesh networks) that may reassemble or modify packets in unexpected ways. Capturing actual network traces, such as downloading a large file, reveals that the smooth sawtooth pattern of AIMD is not always observed. Instead, behaviors can be 'jaggity' due to competing traffic and varied network conditions, demonstrating that TCP must cope with a much messier environment than idealized classroom examples suggest.
TCP's enduring legacy and adaptability
Despite its origins in the 1980s, TCP has proven remarkably robust and adaptable. Its core mechanisms, developed when networks were significantly slower, have been refined over decades. While the TCP header has limited space for new features, contributing to slow evolution, and middleboxes or firewalls can interfere with non-standard behavior, TCP has managed to function effectively across diverse networks—from data centers to satellite connections. The protocol's ability to adjust its sending rate based on implicit congestion signals, its RTT-based timeouts, and its sophisticated window management (slow start and AIMD) allow it to operate efficiently even in a highly dynamic and competitive internet environment, serving well for nearly 50 years.
Mentioned in This Episode
●Products
●Software & Apps
TCP Congestion Control: Key Principles
Practical takeaways from this episode
Do This
Avoid This
Common Questions
TCP (Transmission Control Protocol) operates at the transport layer to ensure reliable data transfer between applications on different computers. It uses mechanisms like sequence numbers and acknowledgments to guarantee data arrives in order and without errors, making connections reliable.
Topics
Mentioned in this video
A popular modern flavor of TCP congestion control.
A network protocol analyzer used to capture and inspect network traffic.
A programming language used by the speaker to analyze captured TCP traffic.
A command-line utility for downloading files from the web, used here to download an Ubuntu distribution.
A Linux-based operating system whose distribution file was downloaded for analysis.
More from Computerphile
View all 87 summaries
23 minHuman Readable Code - Computerphile
25 minHacking on the PDP1 Raspberry Pi Emulator - Computerphile
23 minHaptic Rendering - Computerphile
23 minTemporal Networks, Where Page Rank meets Lord of the Rings - Computerphile
Ask anything from this episode.
Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.
Get Started Free