Why BBR Beats Loss‑Based Congestion Control: A Deep Dive into Its Model‑Based Design
This article examines the shortcomings of loss‑based congestion control, explains how shallow and deep buffering affect throughput, and provides a comprehensive, step‑by‑step breakdown of the BBR algorithm—including its network path model, terminology, design overview, control parameters, state machine, and detailed implementation code.
1. Background
Internet congestion control historically relied on loss‑based algorithms such as Reno and CUBIC, which assume packet loss equals congestion. While these worked well when network buffers matched bandwidth‑delay products, modern high‑speed, long‑distance networks with shallow buffers experience severe throughput loss when loss occurs before congestion, and deep buffers cause buffer‑bloat and unnecessary queuing delay.
2. Terminology
BBR.pacing_rate : The smoothed sending rate used to control packet spacing.
BBR.send_quantum : The maximum size of a grouped transmission unit.
cwnd : The congestion window limiting the amount of data in flight.
BBR.BtlBw : Estimated bottleneck bandwidth derived from the maximum delivery‑rate samples.
BBR.BtlBwFilter : A max‑filter that tracks the highest BtlBw samples over a window.
BtlBwFilterLen : Length of the BtlBw filter window (10 RTTs).
BBR.RTprop : Estimated minimum round‑trip propagation delay.
RTpropFilterLen : Length of the RTprop min‑filter (10 seconds).
BBR.pacing_gain : Dynamic gain applied to BtlBw to compute the pacing rate.
BBR.cwnd_gain : Dynamic gain applied to BtlBw·RTprop to compute the target cwnd.
BBRHighGain : Minimum gain (≈2.89) used in the Startup phase.
BBR.filled_pipe : Boolean indicating whether the pipe has been fully utilized.
BBRMinPipeCwnd : Minimum cwnd (4 packets or 4 × SMSS) to keep the pipeline alive.
3. Design Overview
BBR is a model‑based congestion control algorithm that explicitly models the network path. It estimates two key parameters: BtlBw (bottleneck bandwidth) and RTprop (minimum RTT). Using these, BBR aims for two operating points: rate balance (packet arrival rate equals BtlBw) and pipe‑fullness (in‑flight data equals BDP).
3.1 Network Path Model
BBR estimates BtlBw from delivery‑rate samples and RTprop from the smallest RTT samples, maintaining max and min filters respectively.
3.2 Control Parameters
BBR controls three parameters:
Pacing Rate : Adjusted by pacing_gain × BtlBw to smooth packet emission.
Send Quantum : Dynamically chosen based on current pacing_rate to balance CPU overhead and bandwidth utilization.
Congestion Window (cwnd) : Updated to track the target BDP, with safeguards for recovery and ProbeRTT phases.
3.3 State Machine
The BBR state machine consists of Startup, Drain, ProbeBW, and ProbeRTT phases.
Startup
BBR rapidly increases pacing_gain and cwnd_gain to BBRHighGain (≈2.89) to probe for the bottleneck bandwidth. When growth stalls (< 25 % over three rounds), BBR marks the pipe as filled and transitions to Drain.
Drain
During Drain, pacing_gain is set to 1 / BBRHighGain to empty the queue while maintaining cwnd_gain = BBRHighGain.
ProbeBW
ProbeBW runs a gain cycle (5/4, 3/4, 1, 1, 1, 1, 1, 1) each lasting roughly one RTT. The 5/4 phase probes for higher bandwidth, the 3/4 phase drains excess queue, and the remaining phases cruise at the estimated BtlBw.
ProbeRTT
Periodically (every 10 s) BBR enters ProbeRTT, reduces cwnd to BBRMinPipeCwnd for at least 200 ms to obtain a fresh RTprop measurement, then restores cwnd and returns to ProbeBW or Startup depending on pipe fullness.
4. Algorithm Details
4.1 BtlBw Estimation
BBR updates BtlBw on each ACK using a max‑filter over the last BtlBwFilterLen RTTs, ignoring samples marked as application‑limited unless they exceed the current BtlBw.
BBRUpdateBtlBw():
BBRUpdateRound()
if (rs.delivery_rate >= BBR.BtlBw || !rs.is_app_limited)
BBR.BtlBw = update_windowed_max_filter(filter=BBR.BtlBwFilter,
value=rs.delivery_rate,
time=BBR.round_count,
window_length=BtlBwFilterLen)4.2 RTprop Estimation
RTprop is the minimum RTT observed over the last RTpropFilterLen seconds. The filter expires after the interval, prompting a ProbeRTT.
BBRUpdateRTprop():
BBR.rtprop_expired = Now() > BBR.rtprop_stamp + RTpropFilterLen
if (packet.rtt >= 0 && (packet.rtt <= BBR.RTprop || BBR.rtprop_expired)) {
BBR.RTprop = packet.rtt
BBR.rtprop_stamp = Now()
}4.3 cwnd Management
BBR computes a target cwnd based on BtlBw·RTprop and a gain factor, then modulates cwnd during recovery, ProbeRTT, and normal operation to stay within the target while ensuring a minimum pipe depth.
BBRSetCwnd():
BBRUpdateTargetCwnd()
BBRModulateCwndForRecovery()
if (!BBR.packet_conservation) {
if (BBR.filled_pipe)
cwnd = min(cwnd + packets_delivered, BBR.target_cwnd)
else if (cwnd < BBR.target_cwnd || BBR.delivered < InitialCwnd)
cwnd = cwnd + packets_delivered
cwnd = max(cwnd, BBRMinPipeCwnd)
}
BBRModulateCwndForProbeRTT()References
[1]draft‑cheng‑iccrg‑delivery‑rate‑estimation: https://datatracker.ietf.org/doc/html/draft-cheng-iccrg-delivery-rate-estimation-00
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Douyu Streaming
Official account of Douyu Streaming Development Department, sharing audio and video technology best practices.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
