DEV Community

gxqwb
gxqwb

Posted on

TCP BBR vs CUBIC: Two Theories of How Fast to Send

Every TCP connection has to decide how fast to send without drowning the network. For decades the standard answer was to speed up until packets were lost, then slow down. A newer family of algorithms asks a different question: measure the path's real capacity and delay, and send at that rate before loss occurs. Both fill the same pipe, but they interpret the evidence in radically different ways.

CUBIC infers congestion from dropped packets and reacts after the fact, while BBR models bandwidth and round-trip delay to send proactively, so one is a loss-driven protocol and the other a measurement-driven one.

That difference is not academic. It decides whether a video call recovers smoothly or stalls, whether a long-distance transfer fills a high-bandwidth link, and how fairly two competing flows share a bottleneck.

Part One: What each algorithm believes

CUBIC is the default in most Linux systems and the descendant of a long line of loss-based congestion controls. Its core assumption is that a dropped packet means the network is full. It grows the sending rate aggressively after a slow start, then backs off on loss and grows again along a cubic curve — fast at first, then slower as it approaches the previous rate, with occasional probes for more. The shape of that curve was tuned to recover quickly on high-speed, high-delay paths where older algorithms crawled.

BBR, from Google, rejects the idea that loss is the primary signal. It periodically measures the maximum bandwidth it can achieve and the minimum round-trip time it observes, then sends at roughly their product — the amount of data that fits in the pipe. When the path is not yet full, more data raises throughput without raising delay. When the path is full, delay rises. BBR watches for that rise and eases off before loss happens, then probes periodically to see if capacity has grown.

In short: CUBIC treats the network as a vessel that overflows, and BBR treats it as a pipe with a measurable width.

Part Two: The arithmetic of the trade

Consider a link with high bandwidth and long delay — a transcontinental path, say, where the round trip is a hundred milliseconds. To fill it, a sender must keep a large amount of data in flight. Loss-based algorithms increase the window until a buffer somewhere overflows, which means the path's buffers are regularly full and queuing delay is high. A packet that should take a hundred milliseconds may wait another hundred in a swollen queue. Video calls feel this as lag even when nothing is lost.

BBR aims to keep the queue nearly empty by sending at the measured pipe size. On the same path it can deliver comparable throughput with far lower steady-state delay, because it stops adding data once delay starts climbing rather than waiting for a drop. In networks with random loss that is not congestion — wireless links, for example — BBR also performs better, because it does not cut its rate for a packet that was corrupted rather than queued.

The economics are large. Global internet traffic is measured in exabytes per month, and content delivery networks worth tens of billions of dollars live or die by how efficiently they fill long-distance links. A few percent better link utilisation across a backbone translates into meaningful capital savings, because bandwidth is a recurring cost.

BBR wins on high-bandwidth, high-delay, or lossy paths where low queuing matters, while CUBIC remains competitive and exceptionally fair on ordinary networks where loss is a reliable congestion signal.

That is why the choice is deployed rather than universal: different paths reward different theories.

Part Three: Where each approach breaks

BBR's weakness is fairness and its handling of shallow buffers. Because it keeps sending near the measured capacity, multiple BBR flows sharing a bottleneck can overshoot together, and in some setups they have been shown to grab more than their share from loss-based flows. It can also react poorly when the path's delay changes for reasons unrelated to its own traffic, such as routing changes or competing bursts. Older versions were criticised for being too aggressive; later versions added safeguards, but the tuning remains delicate.

CUBIC's weakness is exactly the queue it tolerates. On paths with large buffers, it can fill them completely before noticing congestion, producing high and variable latency — the phenomenon known as bufferbloat. It also mistakes non-congestion loss for congestion, throttling itself on a noisy wireless hop even when the wired core is empty. And on very high-speed paths, the time to rediscover capacity after each loss can waste a slice of available bandwidth.

Neither algorithm is correct in the abstract. Each encodes a theory about what a network is, and each theory is more or less true depending on the path.

Part Four: An everyday example

Think of two drivers merging onto a busy highway. The first drives until they see brake lights, then slows, then accelerates again. This works when brake lights reliably mean congestion, but it means they spend a lot of time near the back of a queue and react late. The second watches the flow of cars ahead and the gaps between them, adjusting speed to match the highway's actual capacity before anyone brakes. That is smoother until another driver behaves unpredictably, at which point their smooth model can be fooled.

A third person watching both would say the first driver is cautious and reactive, the second is attentive and predictive. Neither is a better driver in every traffic pattern. The highway at rush hour and the empty highway at midnight reward different habits.

What is actually transferable

The broader lesson is that congestion control is a theory of inference: you cannot see the network directly, so you guess from signals, and your guess about which signal matters determines your behaviour. Loss is a delayed, ambiguous signal. Delay is an earlier, noisier one. Choosing between them is choosing which kind of error you prefer to make.

A second lesson is that protocols are deployed into an ecosystem, not a vacuum. An algorithm that is optimal alone can be unfair beside another, which is why operators often mix controls across different services. When you tune a network, ask what the dominant bottleneck looks like — deep buffers, wireless loss, long delay — and match the theory to the path rather than switching to whichever algorithm is currently fashionable.

CUBIC and BBR are not old and new versions of one idea but two different guesses about what a network tells you, and the better guess depends on the path you actually run over.

SOL: HCqPmPJM3NVtS6YrmVaTZYnuP8XZ2PFgQZKT94VK1LkS
Creating this takes real effort — thank you for the support.

Top comments (0)