Data channels (RFC 8831, RFC 8832, RFC 8841)

View Source

Data channels are implemented by webrtc_dcep: the DCEP codec and a sans-IO manager that owns the SCTP association (webrtc_sctp_assoc, see sctp) and exposes channels by stream id. Tests are in webrtc_dcep_tests ("dcep" below); some use a raw SCTP association as the peer to send messages the manager itself never produces. Parsing the SDP a=max-message-size and a=sctp-port attributes belongs to the SDP module and is tracked in sdp.

RFC 8831 (data channels)

IDSectionRequirementModuleTestStatus
DC-16.1SCTP over DTLS with partial reliability (timed and limited retransmissions), stream reconfiguration signalled in Supported Extensionswebrtc_sctp_assocwebrtc_sctp_assoc_tests:handshake_testUnit tested
DC-26.1Message interleaving (RFC 8260) SHOULD be usedwebrtc_sctp_assocwebrtc_sctp_assoc_tests:interleaving_testUnit tested (offered only with the interleaving SCTP option, off by default like current browsers)
DC-36.265535 streams negotiatedwebrtc_sctp_assocwebrtc_sctp_assoc_tests:handshake_testUnit tested
DC-46.2Graceful shutdown and abort of the association close every channelwebrtc_dcepdcep:shutdown_closes_channels_testUnit tested
DC-56.4Reliable or partially reliable (retransmissions or lifetime), ordered or unordered channelswebrtc_dcepdcep:partial_reliability_channel_test, dcep:negotiated_testUnit tested
DC-66.4Priority carried in DATA_CHANNEL_OPEN and reportedwebrtc_dcepdcep:open_vector_testUnit tested
DC-76.4Priority interpreted as a weighted fair queueing weight by the SCTP scheduler; very_low, low, medium, high map to 128, 256, 512, 1024webrtc_dcep, webrtc_sctp_sendwebrtc_pc_SUITE:channel_prioritiesE2E tested: behind a 4 Mbps bottleneck a high priority channel queued after a very low priority one finishes first
DC-86.5Channels negotiated out of band on an agreed stream id, without DCEP; reusing a stream of an existing channel failswebrtc_dcepdcep:negotiated_test, dcep:id_parity_testUnit tested
DC-96.6One application message per SCTP user message; PPID 51 (string) and 53 (binary)webrtc_dcepdcep:open_ack_testUnit tested
DC-106.6Empty messages sent as one zero byte with PPID 56 / 57 and delivered as emptywebrtc_dcepdcep:empty_messages_testUnit tested
DC-116.6Deprecated PPID 52 / 54 partial messages accepted on receive and joined, bounded by the local maximum message sizewebrtc_dcepdcep:legacy_partial_ppid_testUnit tested
DC-126.6Unsupported PPID closes the channelwebrtc_dcepdcep:unknown_ppid_closes_testUnit tested
DC-136.6Without interleaving the sender SHOULD keep messages under 16 KBNon-compliant / known limitation: not enforced, the application chooses the message size
DC-146.7Closing resets the outgoing stream; a peer reset is answered with our own reset; the channel is closed once both directions are reset and the id can be reusedwebrtc_dcepdcep:close_test, dcep:remote_close_test, dcep:close_lossy_testUnit tested
DC-156.7Messages sent before the close are delivered before itwebrtc_dcep, webrtc_sctp_reconfigdcep:close_test, dcep:close_lossy_testUnit tested
DC-167A receiver copes with arbitrarily large messages: incoming messages are bounded by the SCTP max_message_size option (the advertised limit); a larger one closes its channel only, see MMS-5webrtc_sctp_recv, webrtc_dcepwebrtcsctp_assoc_tests:too_large*_testUnit tested

RFC 8832 (DCEP)

IDSectionRequirementModuleTestStatus
DCEP-15.1DATA_CHANNEL_OPEN with the six channel types, priority, reliability parameter, label and protocolwebrtc_dcepdcep:open_vector_test, dcep:all_channel_types_testUnit tested
DCEP-25.1Malformed messages rejected (truncation, extra bytes, unknown channel type, invalid UTF-8)webrtc_dcepdcep:codec_errors_testUnit tested
DCEP-35.2DATA_CHANNEL_ACKwebrtc_dcepdcep:ack_testUnit tested
DCEP-46DCEP messages sent ordered and reliable with PPID 50 on the channel's own streamwebrtc_dcepdcep:legacy_partial_ppid_test (ACK seen by a raw SCTP peer)Unit tested
DCEP-56The DTLS client picks even stream ids, the server odd oneswebrtc_dcepdcep:id_parity_testUnit tested
DCEP-66OPEN on a used stream, with the wrong parity or malformed: no ACK, the stream is resetwebrtc_dcepdcep:wrong_parity_open_test, dcep:duplicate_open_testUnit tested
DCEP-76The opener may send right after OPEN; user data goes ordered until the peer sent anything on the channelwebrtc_dcepdcep:ordered_until_ack_testUnit tested
DCEP-86User data on an unused stream: the stream is resetwebrtc_dcepdcep:data_on_unused_stream_testUnit tested
DCEP-96Channels opened before the association is up are announced once it iswebrtc_dcepdcep:open_before_connect_testUnit tested
DCEP-116, RFC 8831 §6.2A DATA_CHANNEL_OPEN or ACK that SCTP refuses (full send buffer, shutdown) is reported: the open fails with that error and no channel is left, an incoming channel is refused with a stream reset; ids must be below the negotiated stream counts once known, and channels opened earlier on higher ids are reported channel_error then closed, their queued data droppedwebrtc_dcep, webrtc_sctp_senddcep:open_send_error_test, dcep:stream_ids_bounded_testUnit tested
DCEP-106A stream reset of a channel that was never acknowledged reports the setup failurewebrtc_dcepdcep:wrong_parity_open_test (raw peer side)Unit tested

RFC 8841 (max-message-size)

IDSectionRequirementModuleTestStatus
MMS-16.1Never send a message larger than the peer's max-message-sizewebrtc_dcepdcep:max_message_size_testUnit tested
MMS-26.1Default of 64K when the attribute is absent, 0 means no limitwebrtc_dcepdcep:max_message_size_testUnit tested
MMS-36.1Our own limit advertised in SDP is the one the SCTP association enforces; the receive window holds at least two such messages; 0 is never advertised (we always have a memory bound)webrtc_transport, webrtc_jsep, webrtc_sctp_assocwebrtc_pc_SUITE:max_message_size_wiredE2E tested
MMS-56.1A received message over our limit, on any receive path (single chunk, fragmented, unordered DATA, PPID-based partial), closes that channel only (stream reset, datachannel_error event); later data on the stream is dropped until the resetwebrtc_sctp_recv, webrtc_dcepwebrtcsctp_assoc_tests:too_large*_test, webrtc_dcep_tests:oversize_closes_channel_only_testUnit tested
MMS-46.2SDP attribute syntax: a=max-message-size: and a decimal integer, a malformed value rejectedwebrtc_sdp_attrwebrtcsdp_tests:chrome_offer_test, firefox_offer_test, malformed_testUnit tested