Skip to content

fix: dynamically adjust time threshold on packet reordering#2145

Merged
toidiu merged 3 commits intomasterfrom
akothari/dynamic_time_threshold_on_reorder
Sep 2, 2025
Merged

fix: dynamically adjust time threshold on packet reordering#2145
toidiu merged 3 commits intomasterfrom
akothari/dynamic_time_threshold_on_reorder

Conversation

@toidiu
Copy link
Copy Markdown
Contributor

@toidiu toidiu commented Aug 28, 2025

Dynamic time threshold logic from
#470 was accidentally removed.

The goal is to make time-based detection less sensitive when a spurious loss is detected.

Reviewing

It would be best to review this change as separate commits:

  • 1st commit adds the time_thresh change
  • 2nd commit refactors an existing reordering tests to make it easier to read
  • 3rd commit adds the new test to test the time_thresh change

Testing

I also added the same test to the previous version (0.21.0) of code to confirm the behavior.

network simulator testing

I did some simulation testing to measure the effectiveness of this fix for BBRv3 in the gconsgestion branch. Because reordering is hard to control for there is a lot of variability between runs. However, across ~5 runs each the branch with the fix seems more resilient to packet reordering.

Setup
tc based simulator with

  • fq used to enable packet pacing
  • htb used for rate limiting (htb quantum 1514 rate 20mbit + queue pfifo limit 10800)
  • netem used for delay + packet reordering (netem limit 2000000 delay 52ms 2ms distribution pareto). (To eliminate reordering also apply rate 100gbit)

Before fix
before_time_thresh_fix

After fix
after_time_thresh_fix

@toidiu toidiu requested a review from a team as a code owner August 28, 2025 05:15
Comment thread quiche/src/recovery/mod.rs
Comment thread quiche/src/recovery/mod.rs Outdated
Comment thread quiche/src/recovery/gcongestion/recovery.rs
Comment thread quiche/src/recovery/mod.rs
Comment thread quiche/src/recovery/mod.rs Outdated
Comment thread quiche/src/recovery/mod.rs Outdated
Comment thread quiche/src/recovery/mod.rs
Comment thread quiche/src/recovery/mod.rs
Comment thread quiche/src/recovery/mod.rs Outdated
Comment thread quiche/src/recovery/mod.rs Outdated
// the logic.
#[rstest]
fn time_thresholds_on_reordering(
#[values("bbr2_gcongestion")] cc_algorithm_name: &str,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the intent to run this test against multiple congestion algorithms and have alternate assertions for each algorithm?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, there is a TODO comment to add other algos. I spent quite some time trying to fix congestion but the logic is too different and would require a large change. I didn't want to block on that.

This will prob be part of the "lets merge the two modules" work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO should be more clear about the desire to run this test against other algorithms.

Comment thread quiche/src/recovery/mod.rs Outdated
// | ................ | ..................... |
// THRESH_GAP THRESH_GAP
// ```
// Initial RTT in millis.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment seems out of place. The next line is THRESH_GAP, not RTT related.

@antoniovicente
Copy link
Copy Markdown
Contributor

Looks good.

Dynamic time threshold logic from
#470 was accidentally removed.

The goal is to make time-based detection less sensitive when a spurious
loss is detected.
Recovery logic was returning the wrong spurious loss count if no
new packets were acked. This fixes the bug.

I also added a new test for time-based loss detection, specifically
testing that the value increases after a spurious loss event.
@toidiu toidiu force-pushed the akothari/dynamic_time_threshold_on_reorder branch from 3d72f21 to a2484bd Compare September 2, 2025 18:05
@toidiu toidiu merged commit ec73e4c into master Sep 2, 2025
40 checks passed
@toidiu toidiu deleted the akothari/dynamic_time_threshold_on_reorder branch September 2, 2025 18:21
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.

2 participants