Skip to content

Test overlapping TCP retransmission across sequence number wrap - #110

Open
szonov wants to merge 1 commit into
narrowlink:mainfrom
szonov:test/tcp-overlap-sequence-wrap
Open

szonov wants to merge 1 commit into
narrowlink:mainfrom
szonov:test/tcp-overlap-sequence-wrap

Conversation

@szonov

@szonov szonov commented Oct 18, 2026

Copy link
Copy Markdown

Follow up on #97 with a regression test for a segment that begins before the 32-bit sequence number wrap and ends after the current ACK.

With ACK at 3, send eight distinct bytes starting at u32::MAX - 2. Six bytes are already acknowledged (MAX-2, MAX-1, MAX, 0, 1, 2); only the final two should be delivered. Check the exact bytes, ACK advancing to 5, and an empty reassembly queue. Reinsert the same segment and check that it produces no duplicate data or ACK advancement.

The test passes with the existing #97 implementation. Restoring the pre-#97 behavior that drops every segment starting below ACK makes this test fail (None instead of the two new bytes).

Test-only change; no production code changes.

Validated on upstream 44bb34fe50bd9c04290b4b4f9bbeece1626a95d4 on macOS arm64 with Rust 1.99.0:

  • cargo fmt -- --check
  • cargo test --offline --locked: 37 unit tests and 23 documentation tests pass.
  • cargo clippy --offline --locked --all-targets -- -D warnings

The same commit and Cargo.lock were also validated on Linux ARM64 (Debian 12, Rust 1.98.1): all 37 unit tests and 23 documentation tests pass, as do formatting, Clippy with all targets/features and -D warnings, and the examples/tests build. Checks ran offline in a container with networking disabled. No live TUN/network test was performed.

Native Linux AMD64 validation also passes on Debian 13 with Rust 1.98.1, using the same commit and Cargo.lock: 37 unit tests, 23 documentation tests, formatting, Clippy for all targets/features with -D warnings, and the examples/tests build.

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.

1 participant