A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

TCP Flow Control and Congestion Control

Graduate Depth 87 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
431prerequisites beneath it
See this on the map →
Bandwidth, Latency, and ThroughputSliding Window Protocol+3 more→→QoS: Quality of Service
flow-control congestion-control window cwnd rtt

Core Idea

TCP's flow control (via a receive window) prevents the sender from overwhelming the receiver; congestion control (via a congestion window) prevents the sender from overwhelming the network. Algorithms like Reno, Cubic, and BBR adjust the congestion window based on packet loss and RTT to optimize throughput while minimizing queueing delay.

How It's Best Learned

Use network simulation tools to observe congestion window growth and shrinkage under packet loss; test different algorithms to see their behavior.

Common Misconceptions

Explainer

From your understanding of TCP and connection establishment, you know that TCP provides reliable, ordered delivery by using sequence numbers, acknowledgments, and retransmissions. But reliability alone is not enough — a sender that blasts data as fast as possible can overwhelm either the receiver or the network itself. TCP solves these two distinct problems with two separate mechanisms: flow control protects the receiver, and congestion control protects the network.

Flow control is the simpler of the two. The receiver advertises a receive window (rwnd) — the amount of buffer space it currently has available — in every ACK it sends back. The sender must never have more unacknowledged data in flight than the receiver's window allows. If the receiver is slow (perhaps its application is busy processing previous data), its buffer fills up, rwnd shrinks toward zero, and the sender pauses. When the receiver catches up and frees buffer space, rwnd grows again and the sender resumes. This is a direct, end-to-end feedback mechanism: the receiver explicitly tells the sender how much it can handle.

Congestion control is harder because the network cannot directly tell the sender how much capacity is available — the sender must infer it. TCP maintains a congestion window (cwnd) that limits how much data can be in flight, independent of the receive window. The effective sending rate is governed by the minimum of rwnd and cwnd. The classic algorithm has distinct phases. Slow start begins with a small cwnd (typically one or two segments) and doubles it every round-trip time — exponential growth that quickly probes available bandwidth. When cwnd reaches a threshold (ssthresh) or a packet loss is detected, the algorithm switches to congestion avoidance, where cwnd grows by roughly one segment per RTT — linear growth that cautiously probes for more capacity. When loss occurs, the sender interprets it as a signal of congestion and cuts cwnd dramatically (halving it in Reno, or resetting to one segment after a timeout).

Different congestion control algorithms refine this basic approach. TCP Reno halves cwnd on triple duplicate ACKs (fast recovery) but resets to slow start on timeouts. TCP Cubic, the default on Linux, uses a cubic function to grow cwnd more aggressively after a loss recovery, reaching the previous cwnd faster and then probing cautiously beyond it. BBR (Bottleneck Bandwidth and Round-trip propagation time), developed by Google, takes a fundamentally different approach: instead of reacting to loss, it actively estimates the bottleneck bandwidth and minimum RTT, then paces packets to match the estimated capacity. BBR performs significantly better on networks with large buffers where loss-based algorithms would fill queues before detecting congestion. The choice of algorithm profoundly affects throughput, latency, and fairness — and modern operating systems let you select or even swap algorithms per connection.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Literal Equations → Slope-Intercept Form → Point-Slope Form → Writing Linear Equations → Parallel and Perpendicular Line Slopes → Graphing Linear Equations → Piecewise Functions → One-Sided Limits → Continuity Definition → Limits and Continuity in Multiple Variables → Functions of Several Variables → Continuity in Multiple Variables → Partial Derivatives: Definition and Computation → Differentiability in Multiple Variables → Differentiability in Multivariable Functions → Total Differential and Linear Approximation → Chain Rule for Multivariable Functions → Implicit Differentiation → Related Rates → Optimization Problems → Critical Points of Multivariable Functions → Critical Points and Classification of Extrema → Second Partial Test for Local Extrema (Hessian) → The Hessian Matrix and Second Derivative Test → Unconstrained Optimization: Finding Extrema → Optimization in Multiple Variables → TCP Flow Control and Congestion Control

Longest path: 88 steps · 431 total prerequisite topics

Prerequisites (5)

Leads To (1)