-
-
Notifications
You must be signed in to change notification settings - Fork 462
Description
Description
I am reporting a behavior in webrtc-rs that seems to violate the expected behavior of unreliable Data Channels as defined in RFC 8831.
When a Data Channel is configured with ordered = false and max_retransmits = 0, a single failed transmission attempt (due to transient network loss) causes the channel to transition to the Closed state immediately, rather than simply dropping the packet.
RFC References
-
"Limiting the number of retransmissions to zero, combined with unordered delivery, provides a UDP-like service..."
A UDP-like service should inherently tolerate packet loss. Closing the entire association due to a single dropped packet contradicts the core purpose of "Partial Reliability".
-
RFC 4960 (SCTP), Section 8:
SCTP should only fail an association after reachingAssociation.Max.Retransmitsthresholds. A packet that is not retransmitted because of the PR-SCTP policy (as per RFC 3758) should be silently discarded by the sender's stack once the policy is met, without terminating the SCTP association or closing the Data Channel.
Observed Behavior
In webrtc-rs, if I simulate a network drop (e.g., sudo iptables -A OUTPUT -o lo -j DROP) and call data_channel.send(), the channel state moves to Closed immediately.
- Comparison with other stacks (C++, C#, aiortc): The channel stays
Openand simply discards the data (or waits for SCTP timeouts), allowing the service to resume once the network is restored without requiring a new handshake. - Current
webrtc-rsbehavior: Single failure leads to terminal state.
Steps to Reproduce
- Initialize a Data Channel with the following settings:
let mut options = RTCDataChannelInit::default(); options.ordered = Some(false); options.max_retransmits = Some(0);
- Establish a successful Peer Connection and wait for the Data Channel to be Open.
- Block network traffic to simulate a loss of connectivity.
- Attempt to send a message via data_channel.send_text("test").
Expected Result
The Data Channel should remain in the Open state. The packet should be discarded by the SCTP stack due to the 0-retransmission policy, but the channel should remain active for future attempts.
Actual Result
The Data Channel transitions to Closed immediately after the first failed send attempt.
Is this a known limitation of the current SCTP error handling, or is there a configuration parameter I should use to prevent the channel from closing on PR-SCTP discards?
Thanks for your help!