RFC 8832 | WebRTC Data Channel Establishment Protoc | January 2021 |
Jesup, et al. | Standards Track | [Page] |
The WebRTC framework specifies protocol support for direct interactiverich communication using audio, video, and data between two peers' web browsers.This document specifies a simple protocol for establishing symmetricdata channels between the peers. It uses a two-way handshake and allowssending of user data without waiting for the handshake to complete.¶
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 athttps://www.rfc-editor.org/info/rfc8832.¶
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://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The Data Channel Establishment Protocol (DCEP) is designed to provide, in theWebRTC data channel context[RFC8831],a simple in-band method for opening symmetric data channels.As discussed in[RFC8831], the protocol usesthe Stream Control Transmission Protocol (SCTP)[RFC4960]encapsulated in Datagram Transport Layer Security (DTLS) (described in[RFC8261]). This allows DCEP to benefit from thealready standardized transportand security features of SCTP and DTLS.DTLS 1.0 is defined in[RFC4347]; the presentlatest version, DTLS 1.2, is defined in[RFC6347]; and an upcoming version, DTLS 1.3, is defined in[TLS-DTLS13].¶
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.¶
This document uses the following terms:¶
The Data Channel Establishment Protocol is a simple, low-overhead wayto establish bidirectional data channels over an SCTP association with aconsistent 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 thesame stream identifier, into a single bidirectional data channel.The peer that initiates opening a data channel selects a streamidentifier for which the corresponding incoming and outgoing streamsare unused and sends a DATA_CHANNEL_OPEN message on the outgoing stream.The peer responds with a DATA_CHANNEL_ACK message on its correspondingoutgoing stream. Then the data channel is open.DCEP messages are sent on the same stream asthe user messages belonging to the data channel.The demultiplexing is based on the SCTP Payload Protocol Identifier (PPID),since DCEP uses a specific PPID.¶
Note: The opening sideMAY send user messages before the DATA_CHANNEL_ACKis received.¶
To avoid collisions where both sides try to open a data channel withthe same stream identifiers, each sideMUST use streams with either even orodd stream identifiers when sending a DATA_CHANNEL_OPEN message.When using SCTP over DTLS[RFC8261],the method used to determine which side uses odd or even is based on theunderlying DTLS connection role:the side acting as the DTLS clientMUST use streams with evenstream identifiers; the side acting as the DTLS serverMUST use streamswith odd stream identifiers.¶
Note: There is no attempt to ensure uniqueness for the label;if both sides open a data channel labeled "x" at the same time, there will betwo data channels labeled "x" -- one on an even stream pair, one on an odd pair.¶
The purpose of the protocol field is to ease cross-application interoperation ("federation")by identifying the user data being passed by means of an IANA-registered stringfrom the "WebSocket Subprotocol Name Registry" defined in[RFC6455].The field may be useful for homogeneous applications that may create more than onetype of data channel.Note that there is no attempt to ensure uniqueness for the protocolfield.¶
Every DCEP message starts with a one-bytefield called "Message Type" that indicates the type of the message.The corresponding values are managed by IANA(seeSection 8.2.1).¶
This message is initially sent using the data channel on the stream usedfor user messages.¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Message Type | Channel Type | Priority |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Reliability Parameter |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Label Length | Protocol Length |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\ /| Label |/ \+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\ /| Protocol |/ \+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
This field holds the IANA-defined message type for the DATA_CHANNEL_OPENmessage. The value of this field is 0x03, as specified inSection 8.2.1.¶
This field specifies the type of data channel to be opened. Thevalues are managed by IANA (seeSection 8.2.2):¶
The priority of the data channel, as described in[RFC8831].¶
For reliable data channels, this fieldMUST be set to 0 on the sending sideandMUST be ignored on the receiving side.If a partially reliable data channel with a limited number of retransmissions isused, this field specifies the number of retransmissions. If a partiallyreliable data channel with a limited lifetime is used, this field specifiesthe maximum lifetime in milliseconds. The following table summarizes this:¶
Channel Type | Reliability Parameter |
---|---|
DATA_CHANNEL_RELIABLE | Ignored |
DATA_CHANNEL_RELIABLE_UNORDERED | Ignored |
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT | Number of RTX |
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED | Number of RTX |
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED | Lifetime in ms |
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED | Lifetime in ms |
The length of the label field in bytes.¶
The length of the protocol field in bytes.¶
The name of the data channel as a UTF-8-encoded string, as specified in[RFC3629]. This may be an empty string.¶
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].¶
This message is sent in response to aDATA_CHANNEL_OPEN_RESPONSE message. It is sent on the stream used for usermessages using the data channel.Reception of this message tells the opener that the data channel setuphandshake is complete.¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Message Type |+-+-+-+-+-+-+-+-+¶
This field holds the IANA-defined message type for the DATA_CHANNEL_ACKmessage. The value of this field is 0x02, as specified inSection 8.2.1.¶
All DCEP messagesMUST be sent using ordered delivery and reliabletransmission. TheyMUST be sent on the same outgoing stream as the user messagesbelonging to the corresponding data channel.Multiplexing and demultiplexing is done by using the SCTP PPID.Therefore, a DCEP messageMUST be sent with theassigned PPID for the Data Channel Establishment Protocol(seeSection 8.1).Other messagesMUST NOT be sent using this PPID.¶
The peer that initiates opening a data channel selects a stream identifierfor which the corresponding incoming and outgoing streams are unused.If the side is acting as the DTLS client, itMUST choose an even stream identifier;if the side is acting as the DTLS server, itMUST choose an odd one. The initiating peerfills in the parameters of the DATA_CHANNEL_OPEN message and sends it onthe chosen stream.¶
If a DATA_CHANNEL_OPEN message is received on an unused stream,the stream identifier corresponds to the role of the peer, andall parameters in the DATA_CHANNEL_OPEN message are valid,then a corresponding DATA_CHANNEL_ACK message is sent on the stream with thesame stream identifier as the one the DATA_CHANNEL_OPEN message wasreceived on.¶
If the DATA_CHANNEL_OPEN message doesn't satisfy the conditions above, thereceiverMUST close the corresponding data channel using the proceduredescribed in[RFC8831] andMUST NOT send a DATA_CHANNEL_ACKmessage in response to the received message. This might occur if, for example,a DATA_CHANNEL_OPEN message is received on an already used stream, there areproblems with parameters within the DATA_CHANNEL_OPENmessage, the odd/even rule is violated, or the DATA_CHANNEL_OPEN message itselfis not well formed. Therefore, receiving an SCTP stream-reset request for a stream on whichno DATA_CHANNEL_ACK message has been received indicates to the sender of thecorresponding DATA_CHANNEL_OPEN message the failure of the data channelsetup procedure. After also successfully resetting the corresponding outgoingstream, which concludes the data channel closing initiated by the peer,a new DATA_CHANNEL_OPEN message can be sent on the stream.¶
After the DATA_CHANNEL_OPEN message has been sent, the sender of that messageMAY start sending messages containing user data withoutwaiting for the reception of the corresponding DATA_CHANNEL_ACK message.However, before the DATA_CHANNEL_ACK message or any other message has beenreceived on a data channel, all other messages containing user data andbelonging to this data channelMUST be sent ordered, no matterwhether the data channel is ordered or not.After the DATA_CHANNEL_ACK or any other message has been received on thedata channel, messages containing user dataMUST be sent ordered on ordereddata channels andMUST be sent unordered on unordered data channels.Therefore, receiving a message containing user data on an unused streamindicates an error. In that case, the corresponding data channelMUST be closed, as describedin[RFC8831].¶
The DATA_CHANNEL_OPEN message contains two variable-length fields:the protocol and the label. A receiver must be prepared to receiveDATA_CHANNEL_OPEN messages where these fields have the maximum length of65535 bytes. Error cases such as using inconsistent lengths of fields,using unknown parameter values, or violating the odd/even rule must also be handledby closing the corresponding data channel. An end point must also be preparedfor the peer to open the maximum number of data channels.¶
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].¶
IANA has updated the reference of an already existing SCTP PPIDassignment (Section 8.1) and created a newstandalone registry with its own URL for DCEP (Section 8.2) containing two newregistration tables (Sections8.2.1and8.2.2).¶
This document uses an SCTP Payload ProtocolIdentifier (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 hasupdated the reference to point to this document. The corresponding date has beenkept.¶
Therefore, this assignment now appears as follows:¶
Value | SCTP PPID | Reference | Date |
---|---|---|---|
WebRTC DCEP | 50 | RFC 8832 | 2013-09-20 |
IANA has created the "Data Channel Establishment Protocol (DCEP) Parameters" registry. It contains the two tables provided in Sections8.2.1and8.2.2.¶
IANA has created the "Message Types" registry for DCEP to manage the one-byte "Message Type" field in DCEP messages (seeSection 5). This registration table is a subregistry of the registry described inSection 8.2.¶
The assignment of new message types is done through an RFC Required action,as defined in[RFC8126].Documentation of new message typesMUST contain the following information:¶
The following are the initial registrations:¶
Name | Type | Reference |
---|---|---|
Reserved | 0x00 | RFC 8832 |
Reserved | 0x01 | RFC 8832 |
DATA_CHANNEL_ACK | 0x02 | RFC 8832 |
DATA_CHANNEL_OPEN | 0x03 | RFC 8832 |
Unassigned | 0x04-0xfe | |
Reserved | 0xff | RFC 8832 |
Note that values 0x00 and 0x01 are reserved to avoidinteroperability problems, since they have been used in draft versionsof the document.The value 0xff has been reserved for future extensibility.The range of possible values is from 0x00 to 0xff.¶
IANA has created the "Channel Types" registryfor DCEP to manage the one-byte"Channel Type" field in DATA_CHANNEL_OPEN messages(seeSection 5.1).This registration table is a subregistry within the registry described inSection 8.2.¶
The assignment of new message types is done through an RFC Required action,as defined in[RFC8126].Documentation of new Channel TypesMUST contain the following information:¶
If new Channel Types support ordered and unordered messagedelivery, the high-order bitMUST be used to indicate whetheror not the message delivery is unordered.¶
The following are the initial registrations:¶
Name | Type | Reference |
---|---|---|
DATA_CHANNEL_RELIABLE | 0x00 | RFC 8832 |
DATA_CHANNEL_RELIABLE_UNORDERED | 0x80 | RFC 8832 |
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT | 0x01 | RFC 8832 |
DATA_CHANNEL_PARTIAL_RELIABLE_REXMIT_UNORDERED | 0x81 | RFC 8832 |
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED | 0x02 | RFC 8832 |
DATA_CHANNEL_PARTIAL_RELIABLE_TIMED_UNORDERED | 0x82 | RFC 8832 |
Reserved | 0x7f | RFC 8832 |
Reserved | 0xff | RFC 8832 |
Unassigned | rest |
Values 0x7f and 0xff have been reserved for futureextensibility.The range of possible values is from 0x00 to 0xff.¶
The authors wish to thankHarald 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.¶