1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-27 03:41:14 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Riten Gupta
5f74df10b6 Add network path model update events to qlog
Summary: Several "Network Path Model" parameters are described in Sec. 2.9 of the BBRv2 IETF draft. These quantities evolve throughout the connection and they are useful to analyze BBRv2 performance. This diff adds inflight_hi, inflight_lo, bandwidth_hi, and bandwidth_lo to the qlog.

Reviewed By: mjoras

Differential Revision: D61414936

fbshipit-source-id: 2862db2a6aab336fd8a60e4ae5b358e9ab5588b4
2024-08-26 14:07:23 -07:00
Adrian Catana
e5d4ad6c86 Annotate static initializers with new [[clang::lazy_init]] attribute
Reviewed By: smeenai

Differential Revision: D61483846

fbshipit-source-id: daa41b42efc1e9b8f0d86d5ddf0f04b2d5a0aab7
2024-08-21 05:42:38 -07:00
Matt Joras
b23e5027ea Add setting to not pace the init cwnd
Summary: This matches our BBRv1 implementation, and also what Google does. Pacing the initial congestion window is likely overly conservative, so add a knob to test it.

Reviewed By: kvtsoy

Differential Revision: D61295575

fbshipit-source-id: 63599ecabccec8f6e358b013a1e5384d1198e5d1
2024-08-14 18:56:29 -07:00
Matt Joras
aefc9e369b Introduce quic::Optional
Summary:
The idea here is to make it so we can swap out the type we are using for optionality. In the near term we are going to try swapping towards one that more aggressively tries to save size.

For now there is no functional change and this is just a big aliasing diff.

Reviewed By: sharmafb

Differential Revision: D57633896

fbshipit-source-id: 6eae5953d47395b390016e59cf9d639f3b6c8cfe
2024-06-11 11:02:02 -07:00
Joseph Beshay
e839fd69fe Do not log bandwidth estimate samples in qlog if not changed
Summary: As title. There are so many unnecessary bandwidth estimate updates in bbrv2 qlogs.

Reviewed By: mjoras

Differential Revision: D57783116

fbshipit-source-id: afeaa89d03c8c2f6f63ceb852790bb8706f46812
2024-05-24 17:26:48 -07:00
Joseph Beshay
6e1db76335 Add ccaConfig param for startup pace gain
Summary: As title.

Reviewed By: mjoras

Differential Revision: D56425968

fbshipit-source-id: 79d6566ae66aa1c63d44d33e83565d9b11e8d329
2024-04-22 18:46:43 -07:00
Riten Gupta
de0349d682 Enable packet conservation only when conservativeRecovery is set; disable cwnd decrease on loss when ignoreLoss is set
Summary:
1. Noticed that bbr2 was not discovering the available BtlBw because it exited startup early due to loss. Disabling packet conservation seems to help, in sims. bbr1 has conservativeRecovery flag set to false by default. In the same spirit, we should enable/disable packet conservation in bbr2 based on that flag.
2. The CWND is decreased by the loss amount. This should be disabled when ignoreLoss is true.

Reviewed By: jbeshay, mjoras

Differential Revision: D55612685

fbshipit-source-id: 0c811de78e4a6f273f340631d29ff9dcd27d898e
2024-04-05 12:48:47 -07:00
Joseph Beshay
c0ecb9e3ff Write applimited update events from bbr2
Summary:
The exact semantics of entering and leaving the app limited state are currently maintained by the congestion controller, therefore the qlog events have to be logged there.

This change logs app limited events from bbr2.

Reviewed By: sharmafb

Differential Revision: D55429423

fbshipit-source-id: 582252ab715411c65da25721107de52f01e59754
2024-03-28 13:39:04 -07:00
Joseph Beshay
f8ddab0741 Exit ProbeRTT early if the connection goes idle
Summary: If the connection goes idle (inflight bytes=0), there is no point in waiting for the rest of the probe rtt minimum duration. This change allows it to exit early.

Reviewed By: kvtsoy, sharmafb

Differential Revision: D55395803

fbshipit-source-id: 43e68120529e22ddfe7cc5a8a17091e952c958f9
2024-03-28 13:39:04 -07:00
Joseph Beshay
afed715a7f Add config to experiment with different pacing and cwnd gain during probe bw cruise and refill
Summary: As title.

Reviewed By: mjoras

Differential Revision: D54439761

fbshipit-source-id: 0746d8d1f956f1991001db6d4fcddf856b4f3371
2024-03-11 18:24:08 -07:00
Joseph Beshay
cb323ab533 Do not update bbr2's model using implicit acks
Summary: As title.

Reviewed By: mjoras

Differential Revision: D54605569

fbshipit-source-id: 5e2e2b8a26ec45524b0e1ddf92d25d3059fd94f8
2024-03-11 18:24:08 -07:00
Joseph Beshay
9a8bc643d9 Simplify options for ignoreLoss and ignoreInflightHi
Summary: This simplifies the logic for ignoring the short term and long term loss thresholds on bbr2 (Lo_ and Hi_ variables).

Reviewed By: mjoras

Differential Revision: D54697605

fbshipit-source-id: 44cd91974a20f267f1986542f8b993795287fe4d
2024-03-11 18:24:08 -07:00
Joseph Beshay
479286da12 Ensure ProbeBw_Up can effectively probe for available capacity
Summary:
ProbeBW_Up is the phase that probes for avaialable bandiwdth after BBRv2 has exited startup.

Previously, by using inflightLatest and having a strict equality check on being cwndLimited, ProbeBw_Up was not able to effectively probe for bandwidth.

This change improves BBRv2's ability to probe for bandwidth within one ProbeBW cycle from the capacity being available.

Reviewed By: mjoras

Differential Revision: D53597316

fbshipit-source-id: ce666417ac110ded1860fc4309a807c51c4a7566
2024-02-09 16:43:31 -08:00
Joseph Beshay
5a0d4a202b Do no leave a pacing margin on top of the pacer imperfections
Summary: Our current pacer achieves roughly 99% of the target pace. While we decide how to improve that, we should not leave more pacing margin in bbr2.

Reviewed By: mjoras

Differential Revision: D53586406

fbshipit-source-id: da4b9c22458792aa9266bcf7371b13f68f16d8d0
2024-02-09 16:43:31 -08:00
Joseph Beshay
047f7bcf13 Add transport setting for enabling reno coexistence
Summary:
Reno-coexistence forces bbr2 to terminate ProbeBW cycles early. When competing with other CCAs, this can cause bbr2 to back off rather than probe for more bandwidth because it advances the probe bw cycle count.

This change adds an options to control whether that is used.

Reviewed By: mjoras

Differential Revision: D53586408

fbshipit-source-id: 14fccc1aaaeb96dfc30f2e8df68c69d75d52a329
2024-02-09 16:43:31 -08:00
Joseph Beshay
4ab3b132e9 Improve probe bw cycle tracking
Summary:
Updating the cycle count in adaptUpperBounds() mean that it could happen prematurely if ProbeBw_Down lasts longer than a single round (rtt round).

This changes the logic to advance the ProbeBW cycle only when entering ProbeBw_Down. It also removes the advanceCycleAfterStartup option which is now irrelevant.

This results in better coexistence with loss-based CCAs.

Reviewed By: mjoras

Differential Revision: D53586407

fbshipit-source-id: fdc7ac23184e4edebb74f10026acb821f9df34f9
2024-02-09 16:43:31 -08:00
Joseph Beshay
8d14b97fb1 Fix bwProbeWait_ calculation
Summary: This was outright wrong. We need to wait 2-3 seconds.

Reviewed By: mjoras

Differential Revision: D53500129

fbshipit-source-id: bc270c950076919fd4fe8dbeb1b12c2d19d7ae15
2024-02-07 13:19:03 -08:00
Joseph Beshay
bfda236102 Keep packet conservation enabled when ignoring loss
Summary: As title

Reviewed By: mjoras

Differential Revision: D52633363

fbshipit-source-id: c4078e66c4550499ccbc70fcccbe99ce1128ea8d
2024-01-10 16:38:57 -08:00
Joseph Beshay
d53f434978 Add ccaConfig to advance cycle count when exiting startup
Summary:
BBRv2's bandwidth filter carries over the bandwidth sample from the Startup phase into probe bandwidth, without updating the cycle count. This delays the reaction to bandwidth changes by an additional probe bw cycle.

This change adds an option to count Startup as its own cycle in the bandwidth filter. It's defaulted to true.

Reviewed By: mjoras

Differential Revision: D50146879

fbshipit-source-id: 0b5b3a90171828848653b655dabc0133fa275583
2023-10-12 12:04:01 -07:00
Joseph Beshay
520f5f16a1 Adjust bandwidth windowed filter length to compensate for its use as expiry time
Summary:
The window_length parameter in the WindowedFilter is enforced by checking the distance between new sample and the old one is greater than the window length.

For BBRv2 max bandwidth filter, the timestamp is the integer cycle count number. Effectively the max value becomes the maximum of window+1 cycles.

This change compensates for that logic by subtracting 1 from the window length.

Reviewed By: mjoras

Differential Revision: D50136527

fbshipit-source-id: fd8a7bc444895e486f0a707c7aa2888ae1213083
2023-10-12 12:04:01 -07:00
Joseph Beshay
1d516652e6 Avoid using fmt
Summary: As title

Reviewed By: mjoras

Differential Revision: D49784758

fbshipit-source-id: 757a62e748df8a6874478321d9d379355c8705b6
2023-10-11 16:42:04 -07:00
Joseph Beshay
8a96e08d0e Fix inflightHi_ and bandwidthHi_ logic
Summary: bandwidthHi_ and inflightHi_ should only be set after loss has occured.

Reviewed By: mjoras

Differential Revision: D49784760

fbshipit-source-id: 99bfb98a7d07849e10fb89aaccf5ff51437d400b
2023-10-02 10:42:26 -07:00
Joseph Beshay
25bde289dc Set bandwidthHi when entering Drain
Summary:
When BBR2 switches from Startup to Drain, it starts applying a limit on pacing using bandwidthHi_. If this transition happens around an idleRestart, populating bandwidthHi_ from bandwidthLatest only, can result in lower samples that underutilize the link.

This change ensures that transitioning from Startup to Drain maintains the pacing rate.

Reviewed By: mjoras

Differential Revision: D49550971

fbshipit-source-id: 8f2644e8636382bc3498b3ec9c82e98cd15aa6d2
2023-09-26 15:49:05 -07:00
Joseph Beshay
10161ff564 Avoid entering ProbeRTT when the connection is app limited
Summary: When restarting from idle, the probeRTT min value can be updated without having to enter ProbeRTT.

Reviewed By: mjoras

Differential Revision: D49548502

fbshipit-source-id: 8471df3e15eb788b087764f2630537c71e164914
2023-09-26 15:49:05 -07:00
Joseph Beshay
837d229fa4 Add cca config options to ignore inflightHi and to control response to loss
Summary:
inflightHi currently forces the cwnd to be very close to the target BDP even during ProbeBW, this can slow down the ProbeBW_UP attempting to probe for more bandwidth.

Reaction to packet loss is a core difference between BBRv1 and BBRv2.

This adds a couple of cca config options to enable experimenting with both and compare specific parts of BBRv2 behavior in comparison to BBRv1.

Reviewed By: mjoras

Differential Revision: D49526118

fbshipit-source-id: 35ba83e834b1febd79c0e46af39b0205cde4dc1c
2023-09-26 15:49:05 -07:00
Joseph Beshay
a76144e18a Improve accounting of extraAckedDelivered in BBRv2
Summary:
Previously extraAckedDelivered was not reset for every train of packets so it could keep increasing and pushing the congestion window higher while in startup.

This did not have an impact on the speed the pacekts are sent because pacing was still only controlled by the bandwidth estimate_ but this could be visibile in the divergence between the cwnd and target pacing rate.

Reviewed By: hanidamlaj

Differential Revision: D49286012

fbshipit-source-id: 1340c939fde6b35e3edfefd248b52396c4c3195f
2023-09-15 15:19:13 -07:00
Joseph Beshay
85e9cda139 Bbr2 refactor inflightMax_, inflightHi_, inflightLo_, bwProbeSamples.
Summary:
Change inflightHi_ and inflightLo_ into optionals to makes it easier to distinguish between an initial value and not having a value.

Change inflightMax into a local variable.

Set initial value for sendQuantum_ and extraAckedDelivered_.

Change bwProbeSamples_ to a boolean bwProbeShouldHandleLoss_ so it's more descriptive.

Differential Revision: D48654867

fbshipit-source-id: 5447d4cd15f25391fa986ecf70bc08b3662070d8
2023-08-30 11:49:34 -07:00
Joseph Beshay
f4133c1719 Tune BBR2 startup parameters and bw estimation
Summary: As title.

Reviewed By: mjoras

Differential Revision: D48174310

fbshipit-source-id: 350b85ef006139d98f15afd3d4318c4bcdba1a3b
2023-08-10 20:03:02 -07:00
Christian Clauss
b8396fc119 Fix typos discovered by codespell
Summary:
`codespell --ignore-words-list=arithmetics,atleast,crate,crated,deriver,ect,hel,onl,startin,whats --skip="*.lock"`
* https://pypi.org/project/codespell

X-link: https://github.com/facebookincubator/mvfst/pull/307

Reviewed By: hanidamlaj, lnicco

Differential Revision: D47809078

Pulled By: kvtsoy

fbshipit-source-id: 566557f2389746db541ff265a5dec8d6404b3701
2023-07-26 17:10:41 -07:00
Konstantin Tsoy
73edee8252 Back out "Fix typos discovered by codespell"
Summary:
Original commit changeset: 337824bc37bc

Original Phabricator Diff: D47722462

Reviewed By: jbeshay, terrelln, lnicco

Differential Revision: D47801753

fbshipit-source-id: 795ffcccbc2223608e2a707ec2e5bcc7dd974eb3
2023-07-26 12:49:13 -07:00
Facebook Community Bot
9d89b66485 Re-sync with internal repository 2023-07-25 09:45:22 -07:00
Hani Damlaj
c88d675119 fix gcc warnings
Summary: - add folly::unreachable() statements where applicable

Reviewed By: mjoras

Differential Revision: D46911632

fbshipit-source-id: 22b337f4c255e973da19cc15cc928c847091472b
2023-06-26 18:59:24 -07:00
Joseph Beshay
a04bf99f19 Fix BBRv2 ProbeBW cycle counting
Summary:
The draft description mentions the max bw filter using the probe bw cycle count, but the pseudo code was using the round count. This change makes it match the description rather than the pseudo code. This fixes the situation where the pacing margin leads to a downward spiral in the target pacing rate (lower pacing rate -> lower bw estimate -> lower pacing rate -> etc.).

Also, the ack phase is not used so removing it.

Reviewed By: mjoras

Differential Revision: D46974994

fbshipit-source-id: 7936183e5cd10a75f88ede33045d7f4461fc27e0
2023-06-26 16:30:47 -07:00
Joseph Beshay
5426bc08a8 Add BBRv2 Congestion Controller
Summary:
This implements the BBRv2 congestion controller for Mvfst. This implementation aims at staying as close as possible to the naming and organization used in the latest draft. Wherever there are gaps in the spec or the pseudocode, this attempts to fill them with reasonable assumptions.

https://datatracker.ietf.org/doc/html/draft-cardwell-iccrg-bbr-congestion-control-02

Besides the spec differences, this implementation differs from Mvfst's BBRv1 as follows. These differences may be revisited in the future:
- The pacing rate is exclusively controlled by the CCA. No further scaling of the pacer rate is enforced. This enables BBRv2 control loop to keep tight control over queueing delay.
- BBRv2 does not rely on an external bandwidth or RTT sampler. Mvfst's BBRv1 decouples these which makes tracking the state a bit harder.

Reviewed By: mjoras

Differential Revision: D44599226

fbshipit-source-id: 1e488bd936db5826b73ff6205f988dd40e908eba
2023-06-22 13:56:23 -07:00