Skip to content

refactor(sctp): identify outbound messages independently of wire sequences - #253

Open
realzoberg wants to merge 1 commit into
webrtc-rs:masterfrom
realzoberg:split/237-03-reset-lifecycle
Open

realzoberg wants to merge 1 commit into
webrtc-rs:masterfrom
realzoberg:split/237-03-reset-lifecycle

Conversation

@realzoberg

@realzoberg realzoberg commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Outbound message abandonment currently locates retained fragments through TSN ranges and identifies pending tails through queue positions. Give each outbound message one association-local MessageId, so its identity survives fragment removal and cannot refer to a later message that reuses the same wire TSN.

  • Assign the same local identity to every fragment at enqueue time. DATA encoding and public APIs stay unchanged.
  • Retire retained fragments and the pending tail by identity, preserving checked, atomic pending-tail validation and exactly-once buffer release.
  • Index only fragmented, partially reliable messages. Whole-message candidates use their TSN plus an identity check; reliable messages need no index entry.
  • Preserve fix(sctp): defer Rexmit abandonment until retransmission #242's candidate-only retry checks, T3 ordering, timer behavior and error handling.

The memory tradeoff is an 8-byte optional identity field per DATA chunk and an additional TSN index for fragmented, partially reliable messages. Index entries leave with cumulative acknowledgments; a single retained TSN is stored inline.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.82540% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.80%. Comparing base (784e464) to head (19e50c0).

Files with missing lines Patch % Lines
rtc-sctp/src/association/message_selection_test.rs 97.05% 2 Missing ⚠️
rtc-sctp/src/queue/payload_queue.rs 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #253      +/-   ##
==========================================
- Coverage   87.85%   87.80%   -0.05%     
==========================================
  Files         499      501       +2     
  Lines       72540    72646     +106     
==========================================
+ Hits        63728    63790      +62     
- Misses       8812     8856      +44     
Flag Coverage Δ
aws-lc-rs 87.64% <96.82%> (-0.05%) ⬇️
ring 87.80% <96.82%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@realzoberg
realzoberg force-pushed the split/237-03-reset-lifecycle branch from 7fad714 to 3a2692b Compare September 21, 2026 21:51
@realzoberg realzoberg changed the title fix(sctp): preserve reset lifecycle across SID reuse refactor(sctp): identify outbound messages independently of wire sequences Sep 21, 2026
…ences

Assign an association-local identity to each outbound message and use it
to retire retained fragments and the pending tail together. Index only
fragmented partially reliable messages, and verify whole-message candidates
against their identity before abandonment.

Extract the message-ownership groundwork from webrtc-rs#238 while preserving webrtc-rs#242's
candidate-only retry checks and checked pending-queue retirement. Cover
stale selections, cumulative-prefix removal and TSN wrap in the index.
@realzoberg
realzoberg force-pushed the split/237-03-reset-lifecycle branch from 3a2692b to 19e50c0 Compare September 21, 2026 23:04
@realzoberg
realzoberg marked this pull request as ready for review September 21, 2026 23:07
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