BBRv3: keepalives on an idle connection collapse max_bw

Open
#852 5 comments 5 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
networking

Research direction

Read the BBRv3 on_end_acks logic shown in the issue and compare it with the corresponding code in quinn-rs/quinn#2481. The issue describes a regression test on a simulated 100Mbit/s, 50ms link with 1s keepalives for 5 minutes; use that scenario to check whether max_bw stays near its initial value after the fix.

Written by the indexing model from the issue text.

Description

In on_end_acks:

if self.app_limited != 0 && self.delivered > self.app_limited {
    self.app_limited = 0;
} else if app_limited {
    self.app_limited = Ord::max(self.delivered + self.inflight, 1);
}

When the ack that clears the marker arrives while the sender is still idle, the else skips re-marking it. The next keepalive sample is then not app-limited, so it goes into the max_bw filter. After a few minutes of keepalives only, max_bw has aged out to roughly the keepalive rate, and the first transfer after idle starts from almost nothing.

We hit this in towonel after switching to BBRv3: page loads after a couple of minutes idle are ~200KB/s vs ~1MB/s on Cubic.

The fix is to drop the else (clear and re-mark are independent). I have a branch with the fix and a regression test: on a simulated 100Mbit/s, 50ms link, 5 min of 1s keepalives takes max_bw from 11.9MB/s to 800B/s before the fix, and it stays put after. Happy to open a PR if this sounds right.

Same code is in quinn-rs/quinn#2481.

Dominant language
Rust
Stars
454
Forks
98
Avg merge
2d 8h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from n0-computer/noq

All issues in n0-computer/noq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.