Skip to content

Calculation of SendAllowance in BBR is Wrong #4889

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

Open
4 tasks
lrfeng1 opened this issue Mar 4, 2025 · 3 comments
Open
4 tasks

Calculation of SendAllowance in BBR is Wrong #4889

lrfeng1 opened this issue Mar 4, 2025 · 3 comments
Assignees
Labels
Area: Performance Bug: Core A code bug in the Core MsQuic code external Proposed by non-MSFT
Milestone

Comments

@lrfeng1
Copy link

lrfeng1 commented Mar 4, 2025

Describe the bug

In the BbrCongestionControlGetSendAllowance function,we expect a result in BYTES to indicate that how many bytes can be sent next time. And in this function,
"SendAllowance = (uint32_t)(BandwidthEst * Bbr->PacingGain * TimeSinceLastSend / GAIN_UNIT);"
is used to calculate the value of SendAllowance.

However, from the codes, we know that,BandwidthEst is in bps (bit per second), TimeSinceLastSend is in us(micro second),PacingGain/GAIN_UNIT will be 1 or 1.25 or 0.75,we can ignore its unit.

Obiviously, when pacing is executing, we cannot get a value in BYTES in this function, we have to use a formula "bit per micro sec * micro sec / 8" to get a value in bytes.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

No response

MsQuic version

main

Steps taken to reproduce bug

it can easily be seen in the codes.
I found it in the following case.When I manually set the BandwidthEst to 6Gbps, i found that the actual throughput is too low and it is limited by the SendAllowance value.
So I found that the SendAllowance calculation is wrong.
this is because that 32-bit SendAllowance is not enough is this case (6G bps * 1 * several micro seconds), so when the 64-bit result is cut to 32-bit, the SendAllowacne result turns too small.

Expected behavior

a right value of SendAllowance

Actual outcome

a wrong value of SendAllowance

Additional details

No response

@anrossi anrossi added Bug: Core A code bug in the Core MsQuic code Area: Performance labels Mar 4, 2025
@nibanks nibanks added this to the Future milestone Mar 4, 2025
@lrfeng1
Copy link
Author

lrfeng1 commented Mar 6, 2025

@anrossi Hi, May I ask if this is indeed a Bug?

@anrossi
Copy link
Contributor

anrossi commented Mar 17, 2025

It sounds like a bug from your description, but I haven't had time to dig in and investigate it further

@nibanks
Copy link
Member

nibanks commented Mar 17, 2025

Feel free to suggest a PR, @lrfeng1.

@nibanks nibanks added the external Proposed by non-MSFT label Mar 18, 2025
@nibanks nibanks moved this to Planned in DPT Iteration Tracker Apr 24, 2025
@nibanks nibanks changed the title BUG:the calculation of SendAllowance in BBR is wrong Calculation of SendAllowance in BBR is Wrong Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Performance Bug: Core A code bug in the Core MsQuic code external Proposed by non-MSFT
Projects
Status: Planned
Development

No branches or pull requests

4 participants