RFC 8832: WebRTC Data Channel Establishment Protocol
- R. Jesup,
- S. Loreto,
- M. Tüxen
Abstract
The WebRTC framework specifies protocol support for direct interactive rich communication using audio, video, and data between two peers' web browsers. This document specifies a simple protocol for establishing symmetric data channels between the peers. It uses a two-way handshake and allows sending of user data without waiting for the handshake to complete.¶
Status of This Memo
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
The Data Channel Establishment Protocol (DCEP) is designed to provide, in the WebRTC data channel context [RFC8831], a simple in-band method for opening symmetric data channels. As discussed in [RFC8831], the protocol uses the Stream Control Transmission Protocol (SCTP) [RFC4960] encapsulated in Datagram Transport Layer Security (DTLS) (described in [RFC8261]). This allows DCEP to benefit from the already standardized transport and security features of SCTP and DTLS. DTLS 1.0 is defined in [RFC4347]; the present latest version, DTLS 1.2, is defined in [RFC6347]; and an upcoming version, DTLS 1.3, is defined in [TLS-DTLS13].¶
2. Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP?14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
3. Terminology
This document uses the following terms:¶
- Association:
- An SCTP association.¶
- Stream:
- A unidirectional stream of an SCTP association. It is uniquely identified by an SCTP stream identifier (0-65534). Note: The SCTP stream identifier 65535 is reserved due to SCTP INIT and INIT-ACK chunks only allowing a maximum of 65535 streams to be negotiated (0-65534).¶
- Stream Identifier:
- The SCTP stream identifier uniquely identifying a stream.¶
- Data Channel:
- Two streams with the same stream identifier, one in each direction, which are managed together.¶
4. Protocol Overview
The Data Channel Establishment Protocol is a simple, low-overhead way to establish bidirectional data channels over an SCTP association with a consistent set of properties.¶
The set of consistent properties includes:¶
This protocol uses a two-way handshake to open a data channel.
The handshake pairs one incoming and one outgoing stream, both having the
same stream identifier, into a single bidirectional data channel.
The peer that initiates opening a data channel selects a stream
identifier for which the corresponding incoming and outgoing streams
are unused and sends a DATA
To avoid collisions where both sides try to open a data channel with
the same stream identifiers, each side MUST use streams with either even or
odd stream identifiers when sending a DATA
The purpose of the protocol field is to ease cross
5. Message Formats
Every DCEP message starts with a one-byte field called "Message Type" that indicates the type of the message. The corresponding values are managed by IANA (see Section 8.2.1).¶
5.1. DATA_CHANNEL_OPEN Message
This message is initially sent using the data channel on the stream used for user messages.¶
- Message Type: 1 byte (unsigned integer)
-
This field holds the IANA-defined message type for the DATA
_CHANNEL _OPEN message. The value of this field is 0x03, as specified in Section 8.2.1.¶ - Channel Type: 1 byte (unsigned integer)
-
This field specifies the type of data channel to be opened. The values are managed by IANA (see Section 8.2.2):¶
- DATA
_CHANNEL _RELIABLE (0x00): - The data channel provides a reliable in-order bidirectional communication.¶
- DATA
_CHANNEL _RELIABLE _UNORDERED (0x80): - The data channel provides a reliable unordered bidirectional communication.¶
- DATA
_CHANNEL _PARTIAL _RELIABLE _REXMIT (0x01): - The data channel provides a partially reliable in-order bidirectional communication. User messages will not be retransmitted more times than specified in the Reliability Parameter.¶
- DATA
_CHANNEL _PARTIAL _RELIABLE _REXMIT _UNORDERED (0x81): - The data channel provides a partially reliable unordered bidirectional communication. User messages will not be retransmitted more times than specified in the Reliability Parameter.¶
- DATA
_CHANNEL _PARTIAL _RELIABLE _TIMED (0x02): - The data channel provides a partially reliable in-order bidirectional communication. User messages might not be transmitted or retransmitted after a specified lifetime given in milliseconds in the Reliability Parameter. This lifetime starts when providing the user message to the protocol stack.¶
- DATA
_CHANNEL _PARTIAL _RELIABLE _TIMED _UNORDERED (0x82): - The data channel provides a partially reliable unordered bidirectional communication. User messages might not be transmitted or retransmitted after a specified lifetime given in milliseconds in the Reliability Parameter. This lifetime starts when providing the user message to the protocol stack.¶
- DATA
- Priority: 2 bytes (unsigned integer)
-
The priority of the data channel, as described in [RFC8831].¶
- Reliability Parameter: 4 bytes (unsigned integer)
-
For reliable data channels, this field MUST be set to 0 on the sending side and MUST be ignored on the receiving side. If a partially reliable data channel with a limited number of retransmissions is used, this field specifies the number of retransmissions
. If a partially reliable data channel with a limited lifetime is used, this field specifies the maximum lifetime in milliseconds. The following table summarizes this:¶
- Label Length: 2 bytes (unsigned integer)
-
The length of the label field in bytes.¶
- Protocol Length: 2 bytes (unsigned integer)
-
The length of the protocol field in bytes.¶
- Label: Variable Length (sequence of characters)
-
The name of the data channel as a UTF-8-encoded string, as specified in [RFC3629]. This may be an empty string.¶
- Protocol: Variable Length (sequence of characters)
-
If this is an empty string, the protocol is unspecified. If it is a non-empty string, it specifies a protocol registered in the "WebSocket Subprotocol Name Registry" created in [RFC6455]. This string is UTF-8 encoded, as specified in [RFC3629].¶
5.2. DATA_CHANNEL_ACK Message
This message is sent in response to a
DATA
- Message Type: 1 byte (unsigned integer)
-
This field holds the IANA-defined message type for the DATA
_CHANNEL _ACK message. The value of this field is 0x02, as specified in Section 8.2.1.¶
6. Procedures
All DCEP messages MUST be sent using ordered delivery and reliable transmission. They MUST be sent on the same outgoing stream as the user messages belonging to the corresponding data channel. Multiplexing and demultiplexing is done by using the SCTP PPID. Therefore, a DCEP message MUST be sent with the assigned PPID for the Data Channel Establishment Protocol (see Section 8.1). Other messages MUST NOT be sent using this PPID.¶
The peer that initiates opening a data channel selects a stream identifier
for which the corresponding incoming and outgoing streams are unused.
If the side is acting as the DTLS client, it MUST choose an even stream identifier;
if the side is acting as the DTLS server, it MUST choose an odd one. The initiating peer
fills in the parameters of the DATA
If a DATA
If the DATA
After the DATA
7. Security Considerations
The DATA
This protocol does not provide privacy, integrity, or authentication. It needs to be used as part of a protocol suite that contains all these things. Such a protocol suite is specified in [RFC8261].¶
8. IANA Considerations
IANA has updated the reference of an already existing SCTP PPID assignment (Section 8.1) and created a new standalone registry with its own URL for DCEP (Section 8.2) containing two new registration tables (Sections 8.2.1 and 8.2.2).¶
8.1. SCTP Payload Protocol Identifier
This document uses an SCTP Payload Protocol Identifier (PPID) previously registered as "WebRTC Control". [RFC4960] created the "SCTP Payload Protocol Identifiers" registry, in which this identifier was assigned. IANA has updated the PPID name from "WebRTC Control" to "WebRTC DCEP" and has updated the reference to point to this document. The corresponding date has been kept.¶
Therefore, this assignment now appears as follows:¶
8.2. New Standalone Registry for DCEP
IANA has created the "Data Channel Establishment Protocol (DCEP) Parameters" registry. It contains the two tables provided in Sections 8.2.1 and 8.2.2.¶
8.2.1. New Message Type Registry
IANA has created the "Message Types" registry for DCEP to manage the one-byte "Message Type" field in DCEP messages (see Section 5). This registration table is a subregistry of the registry described in Section 8.2.¶
The assignment of new message types is done through an RFC Required action, as defined in [RFC8126]. Documentation of new message types MUST contain the following information:¶
The following are the initial registrations:¶
Note that values 0x00 and 0x01 are reserved to avoid
interoperabilit
8.2.2. New Channel Type Registry
IANA has created the "Channel Types" registry
for DCEP to manage the one-byte
"Channel Type" field in DATA
The assignment of new message types is done through an RFC Required action, as defined in [RFC8126]. Documentation of new Channel Types MUST contain the following information:¶
If new Channel Types support ordered and unordered message delivery, the high-order bit MUST be used to indicate whether or not the message delivery is unordered.¶
The following are the initial registrations:¶
Values 0x7f and 0xff have been reserved for future extensibility. The range of possible values is from 0x00 to 0xff.¶
9. References
9.1. Normative References
- [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC3629]
-
Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, DOI 10
.17487 , , <https:///RFC3629 www >..rfc -editor .org /info /rfc3629 - [RFC4960]
-
Stewart, R., Ed., "Stream Control Transmission Protocol", RFC 4960, DOI 10
.17487 , , <https:///RFC4960 www >..rfc -editor .org /info /rfc4960 - [RFC8126]
-
Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10
.17487 , , <https:///RFC8126 www >..rfc -editor .org /info /rfc8126 - [RFC8261]
-
Tuexen, M., Stewart, R., Jesup, R., and S. Loreto, "Datagram Transport Layer Security (DTLS) Encapsulation of SCTP Packets", RFC 8261, DOI 10
.17487 , , <https:///RFC8261 www >..rfc -editor .org /info /rfc8261 - [RFC8831]
-
Jesup, R., Loreto, S., and M. Tüxen, "WebRTC Data Channels", RFC 8831, DOI 10
.17487 , , <https:///RFC8831 www >..rfc -editor .org /info /rfc8831
9.2. Informative References
- [RFC4347]
-
Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security", RFC 4347, DOI 10
.17487 , , <https:///RFC4347 www >..rfc -editor .org /info /rfc4347 - [RFC6347]
-
Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security Version 1.2", RFC 6347, DOI 10
.17487 , , <https:///RFC6347 www >..rfc -editor .org /info /rfc6347 - [RFC6455]
-
Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, DOI 10
.17487 , , <https:///RFC6455 www >..rfc -editor .org /info /rfc6455 - [RFC8826]
-
Rescorla, E., "Security Considerations for WebRTC", RFC 8826, DOI 10
.17487 , , <https:///RFC8826 www >..rfc -editor .org /info /rfc8826 - [RFC8827]
-
Rescorla, E., "WebRTC Security Architecture", RFC 8827, DOI 10
.17487 , , <https:///RFC8827 www >..rfc -editor .org /info /rfc8827 - [TLS-DTLS13]
-
Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", Work in Progress, Internet-Draft, draft
-ietf , , <https://-tls -dtls13 -39 tools >..ietf .org /html /draft -ietf -tls -dtls13 -39
Acknowledgements
The authors wish to thank Harald Alvestrand, Richard Barnes, Adam Bergkvist, Spencer Dawkins, Barry Dingle, Stefan Håkansson, Cullen Jennings, Paul Kyzivat, Doug Leonard, Alexey Melnikov, Pete Resnick, Irene Rüngeler, Randall Stewart, Peter Thatcher, Martin Thomson, Justin Uberti, and many others for their invaluable comments.¶