Skip to content

RTCDataChannel transitions to Closed state after a single failed delivery with max_retransmits(0) #776

@tasramazan625-bit

Description

@tasramazan625-bit

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

  1. RFC 8831, Section 6.1:

    "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".

  2. RFC 4960 (SCTP), Section 8:
    SCTP should only fail an association after reaching Association.Max.Retransmits thresholds. 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 Open and 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-rs behavior: Single failure leads to terminal state.

Steps to Reproduce

  1. Initialize a Data Channel with the following settings:
    let mut options = RTCDataChannelInit::default();
    options.ordered = Some(false);
    options.max_retransmits = Some(0);
  2. Establish a successful Peer Connection and wait for the Data Channel to be Open.
  3. Block network traffic to simulate a loss of connectivity.
  4. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions