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

TCP Flow Control and Congestion Control

Graduate Depth 99 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
473prerequisites 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 → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → 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 → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Multiplying Binomials (FOIL) → Factoring Trinomials → Factoring Completely → Introduction to Rational Expressions → Simplifying Radical Expressions → Segments and Distance → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Similar Right Triangles and the Geometric Mean → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Special Right Triangles: 30-60-90 → Trigonometric Ratios Review → Vectors in Two Dimensions → Vectors in R^n → Scalar Multiplication of Vectors → Dot Product (Inner Product in R^n) → Cross Product in R^3 → Cross Product and Vector Area → Dot and Cross Products: Geometry and Computation → Equations of Lines and Planes in 3D → Tangent Planes and Linear Approximation → Tangent Planes to Surfaces → Level Sets and Surfaces in 3D → Contour Maps and Level Curves → Directional Derivatives and the Gradient → Optimization in Multiple Variables → TCP Flow Control and Congestion Control

Longest path: 100 steps · 473 total prerequisite topics

Prerequisites (5)

Leads To (1)