Skip to content

Estimate rwnd by payload bytes#101

Open
boivie wants to merge 1 commit intowebrtc:mainfrom
boivie:bug-rwnd-payload-bytes
Open

Estimate rwnd by payload bytes#101
boivie wants to merge 1 commit intowebrtc:mainfrom
boivie:bug-rwnd-payload-bytes

Conversation

@boivie
Copy link
Collaborator

@boivie boivie commented Mar 10, 2026

The dcSCTP receiver was advertising available window space (arwnd) based solely on payload bytes, while the sender's rwnd estimation included packet headers. This mismatch caused the sender to underestimate the receiver's available buffer, potentially leading to reduced throughput.

This commit resolves the issue by ensuring both sender and receiver use payload bytes, as headers have been removed on the receiver side while in the reassembly queue.

This is a Rust port of the fix to the upstream C++ implementation at https://webrtc-review.googlesource.com/c/src/+/377122.

The dcSCTP receiver was advertising available window space (arwnd) based
solely on payload bytes, while the sender's rwnd estimation included
packet headers. This mismatch caused the sender to underestimate the
receiver's available buffer, potentially leading to reduced throughput.

This commit resolves the issue by ensuring both sender and receiver use
payload bytes, as headers have been removed on the receiver side while
in the reassembly queue.

This is a Rust port of the fix to the upstream C++ implementation at
https://webrtc-review.googlesource.com/c/src/+/377122.
@boivie boivie requested a review from lndmrk March 10, 2026 15:16
// and by the number of bytes of duplicated chunks reported in Duplicate TSNs.
let old_pba = self.partial_bytes_acked;
self.partial_bytes_acked += total_bytes_acked;
self.partial_bytes_acked += total_payload_bytes_acked;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, shouldn't this include header and padding?

https://datatracker.ietf.org/doc/html/rfc9260#section-7.2.2-4.2.1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !self.t3_rtx.is_running() {
self.t3_rtx.start(now);
}
let sent_bytes: usize = to_be_sent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by comment: Looks like this just duplicated bytes_retransmitted previosly.

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.

2 participants