Repository navigation
feat(sctp): time-based loss detection (RACK-TLP) - #302
Open
volchanskyi wants to merge 2 commits into
Open
volchanskyi wants to merge 2 commits into
volchanskyi wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #302 +/- ##
==========================================
+ Coverage 88.47% 88.61% +0.13%
==========================================
Files 512 514 +2
Lines 75483 76162 +679
==========================================
+ Hits 66787 67490 +703
+ Misses 8696 8672 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rainliu
requested changes
Nov 11, 2026
rainliu
left a comment
Member
There was a problem hiding this comment.
please rebase to fix conflict first. thanks.
TransportConfig::with_rack_tlp (off by default) and SettingEngineBuilder::with_sctp_rack_tlp turn on RFC 8985 loss detection for the sender: a chunk counts as lost once a chunk sent more than the reordering window after it is acknowledged, the window grows on duplicate TSN reports and lasts 16 recoveries, the three-report rule applies only until reordering is seen, and a tail loss probe goes out at the end of a burst. A cut whose every resend the peer reports as a duplicate is undone, with the RFC 3708 safeguards.
A path that sends some packets ahead of its whole queue, on both legs, as `tc netem reorder` does, left RACK-TLP cutting the window for losses that never happened. On a simulated 100 Mbit/s, 40 ms path with 1% of packets doing that each way, the sender kept 7 Mbit/s; with these four changes it keeps 92. - The smoothed and least round trips sample only chunks the cumulative TSN reached. A chunk acknowledged by a gap block may have overtaken the queue, and read 0.1-20 ms on the 40 ms path. That shrank the reordering window, and the needless resends it set off fed more short samples. - The reordering window starts at a quarter of the least round trip, and each later step adds a quarter of SRTT, up to SRTT. A short least round trip no longer keeps the window from reaching SRTT. - A SACK older than the ack point still has its duplicate TSNs read. The newer SACK that overtook it moved the ack point past it, but its repeats still prove resends needless. - A resend acknowledged with no repeat counts as needed after one RTO, not two SRTTs. A repeat queued behind a burst of resends arrives later than two round trips.
volchanskyi
force-pushed
the
sctp-rack-tlp
branch
from
November 13, 2026 01:14
b67196f to
83e4f6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #301, which makes the receiver report duplicate TSNs. This PR relies on those reports.
When a path reorders packets, the sender cuts its window for losses that never happened. A chunk is declared lost once three later chunks are acknowledged (
miss_indicator >= 3), and every recovery halvescwnd. Nothing ever gives a cut back when the "lost" chunk turns up. On a 100 Mbit/s, 40 ms path that sends 1% of packets 20 ms early, today's code is left with standing cuts and recovers them at one MTU per round trip.TransportConfig::with_rack_tlp(true)turns on RFC 8985 for the sender, and so doesSettingEngineBuilder::with_sctp_rack_tlp(true). Both are off by default, and with the setting off the sender behaves as it does today.cwndandssthreshgo back to their values before the cut, following Linux's DSACK undo. Cuts that overlap are undone together or not at all. The duplicate TSNs of a SACK older than the ack point are still read, since the SACK that overtook it may carry none. If a resent chunk is acknowledged and no duplicate shows up within one RTO, the cut stands. The RFC 3708 safeguards apply: a chunk resent twice blocks the undo, and a duplicate for a chunk that was never resent turns undo off for the rest of the association.sinceis now reassigned on every retransmission, as its doc comment already said. Karn's rule still takes RTT samples only from chunks sent once.New counters in
AssociationStats: window cuts, cuts undone, loss probes.Tests:
association/rack.rs).association/rack_tlp_test.rs):tc netem reorderdoes, still leaves 80% of the line in use (92 Mbit/s; 7 before the second commit, 57 with all of it but the in-order sampling)The second commit adds the in-order sampling, the window's SRTT steps, the stale-SACK repeats and the RTO horizon, found with a WebRTC download from Chrome over a netem router.
cargo fmt --check,cargo clippy,cargo test --workspace, the doc tests and bothscripts/check-*.pychecks pass locally on rustc 1.99.1, as do the semver check, the standalone crate checks, the crypto provider matrices, packaging and the nightly coverage run.