fix(router): size reorder buffer to the BDP + drop-not-skip at the OOM cap - #4239
Merged
Conversation
…M cap The reorder window was a flat 2048 packets (~2.8 MB) — ~16x below the MPTCP receive-buffer requirement B >= 2*sum(BW)*RTT_max (~46 MB / ~32Ki packets at the ~500 Mbps gigabit target with a ~350 ms slowest-active-leg RTT). Undersizing doesn't degrade gracefully: out-of-order data overflows and throughput collapses, and it hit the OOM backstop far too easily. Bump reorderWindow 2048 -> 32768. Also close the last stream-corruption path: the maxGap backstop used to flushAll (deliver PAST the gap = skip), which corrupts the reliable ordered stream (the bad-record-mac failure). At the cap the buffer now DROPS the excess out-of-order packet instead (checked BEFORE buffering so memory stays bounded) and never skips; the dropped seq is re-requested via SACK and the leg-dataprogress prune + retransmit refill the frontier IN ORDER. Removed the now-unused flushAll. Test asserts the buffer holds the gap, drops excess at the cap, and drains in order once it fills. The window is a flat gigabit-sized cap for now (steady occupancy stays tiny); a follow-up will make it adaptive to the measured RTT_max of the active set.
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.
The reorder window was a flat 2048 packets (~2.8 MB) — ~16× below the MPTCP receive-buffer requirement
B ≥ 2·ΣBW·RTT_max(~46 MB / ~32Ki packets at the ~500 Mbps target, ~350 ms slowest-active-leg RTT). Undersizing collapses throughput under wide-mux skew rather than degrading gracefully, and trips the OOM backstop far too easily. BumpsreorderWindow2048 → 32768 (a CAP, not steady occupancy — normal skew buffers only a handful).Also closes the last stream-corruption path: the
maxGapbackstop used toflushAll(deliver past the gap = skip), which corrupts the reliable ordered stream (bad record mac). At the cap it now drops the excess out-of-order packet (checked before buffering, so memory stays bounded) and never skips — the dropped seq is re-requested via SACK, and the leg-dataprogress prune + retransmit refill the frontier in order. Removed the unusedflushAll.Sizing follows the MPTCP/MP-QUIC multipath literature; a follow-up will make the window adaptive to the measured RTT_max of the active set. Developed with AI assistance (Claude).