fix(transport): optionally accept reordered best-effort frames - #2701
Open
samconsidine wants to merge 1 commit into
Open
fix(transport): optionally accept reordered best-effort frames#2701samconsidine wants to merge 1 commit into
samconsidine wants to merge 1 commit into
Conversation
Signed-off-by: Sam Considine <sambconsidine@gmail.com>
Contributor
|
@samconsidine Please, sign the Eclipse Contributor Agreement so we're able to consider this change. |
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.
Description
What does this PR do?
Adds an optional receive-side sequence-number window for unfragmented BestEffort Frames arriving over non-streamed links.
When
transport.link.rx.best_effort_reorder_windowis non-zero, Zenoh keeps a bounded bitmap of recently observed sequence numbers. A reordered Frame inside the window is delivered once, while duplicates and Frames older than the window are dropped. Frames are delivered immediately; this does not buffer packets or restore their original delivery order.The default is
0, which preserves the existing strict monotonic validation. Reliable Frames, streamed links, multicast, and fragments retain their existing behavior.Example:
Why is this change needed?
Unordered transports such as QUIC DATAGRAM can deliver valid Frames out of sequence. The current receive path advances its sequence-number high-water mark when a later Frame arrives, then treats subsequently arriving earlier Frames as invalid. Forward batching or other network-induced reordering can therefore be amplified into substantial application-visible loss even when the packets reach the receiver.
In a controlled A/B reproduction using the same sender workload and network profile:
With the window enabled, 9,603 late reordered Frames were accepted. The maximum observed reorder distance was 29 sequence numbers (mean 16.05).
The implementation also handles sequence-number rollover and suppresses duplicate delivery. Reordered fragments are deliberately excluded because the current defragmenter tracks a single sequential message.
Validation
cargo test -p zenoh-config test_best_effort_reorder_window_config --libcargo test -p zenoh-transport common::seq_num::tests --libcargo test -p zenoh-transport --lib(30 passed, 1 ignored)cargo clippy -p zenoh-config -p zenoh-transport --lib -- -D warningsThe full local
zenoh-configtest suite has one unrelated existing failure: the TOML-format test runs although that local feature set reports only JSON, JSON5, and YAML support. The new configuration test passes both independently and within that suite.Related Issues
No matching existing issue was found.
🏷️ Label-Based Checklist
Based on the labels applied to this PR, please complete these additional requirements:
Labels:
enhancement✨ Enhancement Requirements
Since this PR enhances existing functionality:
Remember: Enhancements should not introduce new APIs or breaking changes.
Instructions:
- [ ]to- [x])This checklist updates automatically when labels change, but preserves your checked boxes.