interviewpath
  • 0day streak
  • 10total XP
  • Level 1
0/6

Unit 4 · Networks · Lesson 3 of 10

Flow control, congestion control and queueing

Flow control protects a slow receiver; congestion control protects the network path. Together with the bandwidth-delay product and queueing delay they explain why a fast link can still give low throughput, why latency rises under load (bufferbloat), and how TCP congestion-control algorithms differ.
About 4 h 30 minFocus mode

Step 1: Learn the ideas

  • Receive window and flow control
  • Congestion window and data in flight
  • Bandwidth-delay product and window scaling
  • Propagation, transmission and queueing delay
  • Bufferbloat and jitter
  • Slow start and congestion avoidance (AIMD)
  • Fast retransmit, fast recovery and timeouts
  • CUBIC
  • Delay-based and model-based alternatives (Vegas, BBR)
  • Active queue management and ECN

Why it matters

"Throughput is low although the link is fast", "latency spikes when someone uploads a file", "transfers between regions are slow": these are flow-control, congestion-control or queueing problems. Infrastructure and SRE interviews probe them because the fixes (window sizes, buffer tuning, a different congestion controller, AQM) are counter-intuitive, and networking research starts from the same vocabulary.

Core ideas

Two windows. The receiver advertises a receive window (rwnd): how many more bytes it can buffer. That is flow control, end to end, about the receiver's memory and reading speed. The sender also keeps a congestion window (cwnd): its estimate of how much data the path can carry without overload. At most min(rwnd, cwnd) bytes may be unacknowledged at any time.

Bandwidth-delay product. To keep a path busy, the data in flight must cover one round trip: BDP = bottleneck bandwidth x RTT. A 100 Mbit/s path with an 80 ms RTT needs 100,000,000 x 0.08 / 8 = 1,000,000 bytes, about 1 MB, in flight. If either window is smaller, throughput is capped at window / RTT however fast the link is; that is why TCP window scaling exists and why long-distance transfers need large socket buffers.

Queueing and delay. RTT = propagation delay + transmission time + queueing delay. When packets arrive faster than the bottleneck sends them, a queue forms there. A queue that absorbs a burst and drains is useful; a queue that stays full only adds delay. Oversized, permanently full buffers are called bufferbloat, and they are why a video call stutters next to a bulk upload. Jitter, the variation in delay, mostly reflects changing queue occupancy. Active queue management (CoDel, FQ-CoDel, RED) drops or marks packets early to keep queues short; with ECN, routers mark packets instead of dropping them.

Loss-based congestion control. Reno starts with slow start, doubling cwnd every round trip until a loss or a threshold, then performs additive increase (about one segment per RTT) and multiplicative decrease (halving on loss). AIMD drives flows with similar RTTs toward equal shares. After a timeout the sender restarts from a small window. CUBIC, the default in Linux, Windows and Apple stacks, grows its window as a cubic function of the time since the last loss, which scales better on high-BDP paths, but it still treats loss as the main signal and therefore tends to fill buffers.

Other signals. Delay-based algorithms (Vegas and successors) back off when the RTT rises above its minimum; BBR builds a model from bottleneck bandwidth and minimum RTT and paces at the estimated rate. Which works best depends on buffer size, competing traffic and the version deployed, which is the starting point of congestion-control research.

Common misconceptions

  • "Flow control and congestion control are the same thing." Flow control protects the receiver and is signalled explicitly; congestion control protects the network and is inferred from loss, delay or ECN marks.
  • "Bigger buffers always help." They absorb bursts, but a permanently full buffer only adds latency.
  • "Low throughput means a slow link." With a small window, throughput = window / RTT; compute the BDP before blaming bandwidth.
  • "Packet loss always means congestion." Wireless errors and traffic policers also drop packets, which is one reason loss-based control underperforms there.
  • "Slow start is slow." The window grows exponentially; the name refers to starting small instead of sending a full window at once.

How to approach it

Practice the BDP calculation with units until it is automatic. Draw cwnd over time for Reno (the sawtooth) and label each phase. Connect it to observation: ss -ti shows cwnd, RTT, retransmissions and whether a flow is limited by the receiver window or the application. Mid and senior questions cover tuning long-haul transfers, why latency rises under load, what AQM changes, and CUBIC versus BBR tradeoffs without claiming either wins everywhere.

Suggested order

  1. 1Read Computer Networks: A Systems Approach Section 1.5 (Performance), then compute the BDP for a 100 Mbit/s, 80 ms path and for a 10 Gbit/s, 1 ms path.
  2. 2Read Section 6.3 (TCP Congestion Control) for AIMD, slow start, fast retransmit and fast recovery, and CUBIC; sketch cwnd over time for Reno.
  3. 3Check the exact rules in RFC 5681 Sections 3.1 and 3.2.
  4. 4Read the ACM Queue article "Bufferbloat: Dark Buffers in the Internet" and explain in your own words why a full buffer adds delay without adding throughput.
  5. 5Read Jacobson and Karels (1988) with its paper guide in this app, focusing on slow start, RTT variance and conservation of packets.
  6. 6Do the bottleneck-emulation project: shape a link with tc, run a bulk transfer while pinging, and read cwnd and RTT with ss -tin.

Paper guides: BBR: Congestion-Based Congestion Control, Congestion Avoidance and Control

Step 2: Check off what you can do

Tap each one you can genuinely do or explain. Each earns 10 XP.

Step 3: Go deeper

  • Computer Networks: A Systems ApproachStart here

    Systems Approach (open online edition)

    Section: 6.3 TCP Congestion Control

    Main reading for AIMD, slow start, fast retransmit and recovery, and CUBIC.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Computer Networks: A Systems ApproachStart here

    Systems Approach (open online edition)

    Section: 1.5 Performance

    Bandwidth, latency and the delay x bandwidth product with worked examples.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • RFC 5681: TCP Congestion Control

    IETF (RFC Editor)

    Section: Section 3: Congestion Control Algorithms

    Precise statement of slow start, congestion avoidance, fast retransmit and fast recovery.

    Open(opens in a new tab)Not checkable automatically, 5 Oct 2026
  • Bufferbloat: Dark Buffers in the Internet

    ACM Queue

    Why oversized, permanently full buffers inflate latency, and the motivation for AQM.

    Open(opens in a new tab)Not checked, 5 Oct 2026
  • Congestion Avoidance and Control

    Lawrence Berkeley National Laboratory (author copy)

    The original congestion-control paper: conservation of packets, slow start, RTT variance and AIMD.

    Open(opens in a new tab)Link responded, 5 Oct 2026

Step 4: Practice

Compute the BDP for a 100 Mbit/s, 80 ms path and a 10 Gbit/s, 1 ms path before touching tools. In the bottleneck-emulation project, shape a link to about 20 Mbit/s with 40 ms of added delay, run a bulk transfer (for example with iperf3) while pinging, and record RTT with a small and a large queue limit; read cwnd, rtt and retransmissions with ss -tin. Repeat with net.ipv4.tcp_congestion_control set to cubic and, if available, bbr, and write down the kernel version.

Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).

Step 5: Test yourself

Answer each one out loud or on paper before you finish the lesson.

  1. Question 1A 1 Gbit/s path has a 50 ms RTT and a 64 KiB receive window. What throughput do you expect?
  2. Question 2What does a sender do after three duplicate ACKs, and how does that differ from a timeout?
  3. Question 3Why does a video call degrade while someone uploads a large file on the same home link?
  4. Question 4What does CUBIC change relative to Reno, and what does it keep?
  5. Question 5Name three causes of packet loss that are not congestion.
  6. Question 6From the sender's point of view, what is the difference between a dropped packet and an ECN-marked one?

You’re done when you can

  • Compute BDPs and window-limited throughput for three paths with correct units.
  • Draw a Reno cwnd trace through slow start, a fast-retransmit loss and a timeout, labelling each phase.
  • Explain bufferbloat and what AQM changes in under three minutes.
  • Read ss -ti output for a transfer and say whether it is limited by the receiver window, congestion or the application.

Finish the lesson

How confident do you feel?

Lesson complete!

+50 XP

Reviews will come up on the Practice tab so it sticks.

Unlocks next: Head-of-line blocking, QUIC and HTTP/3, Data-center networking, ECN and fairness, Transport and queueing foundations for research, Networking paper route: CS144 to BBR

Your notes and study time

Log study time