Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to set BBR quantum ratio #1607

Closed
wants to merge 4 commits into from
Closed

Add API to set BBR quantum ratio #1607

wants to merge 4 commits into from

Conversation

huitema
Copy link
Collaborator

@huitema huitema commented Dec 30, 2023

This PR adds an experimental API to change the "quantum ratio" of BBR from the default 0.001 (1/1000th of the pacing rate in bytes per second) to a larger value. The API is:

void picoquic_set_default_bbr_quantum_ratio(picoquic_quic_t* quic, double quantum_ratio);

It should be called before a connection is created. Calling the API does not affect existing connections.

@huitema
Copy link
Collaborator Author

huitema commented Jan 8, 2024

I made an additional change to BBR after analyzing a misbehaving implementation of the socket loop. On a PC build, the socket loop gets performance from four features: asynchronous receive, batched send, the Windows equivalent of GSO, batched receive (equivalent to GRO) and asynchronous send. The work in progress only had implementation for asynchronous receive, batched send and batched receive, and that turned out to be very slow - 6 to 10 Mbps instead of the expected 1Gbps. Of course, this is most probably due to the missing feature, but investigation showed that the slowness was made worse by a weird interaction with BBR:

  1. When using batched send, the RTT increases. If the connection remained with a high RTT for over 10 seconds, the "renew RTT min evaluation" feature of RTT min kicks in, and after that the bandwidth is stuck at 6-7 Mbps

  2. When the batches are sent slowly, they last a long time, way more than the low RTT. This causes the datarate evaluation module to misfunction, which creates a negative feedback loop inside BBR, driving the pacing rate down to a floor value of about 5 Mbps.

The two fixes are to make the RTT min evaluation much more lenient if the RTT is really small, and to add a parallel evaluation of the datarate as a sanity check. This mitigates the issue somewhat, with observed data rates in the 20-30 Mbps range. That's still bad, but not quite as bad.

@huitema
Copy link
Collaborator Author

huitema commented Jan 8, 2024

Of course, this mitigation is just a temporary band-aid. When performance is low, the proper solution is to understand what causes the slow-down.

@huitema
Copy link
Collaborator Author

huitema commented Feb 9, 2024

This branch is obsolete. It is superceded by the branch "bbr3-quantum-ratio", which provides support for the quantum ratio API over BBRv3 (default CC) and also BBRv1 (option).

@huitema huitema closed this Feb 9, 2024
@huitema huitema deleted the bbr_quantum_ratio branch February 9, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant