RTCWeb Working Group | R. Jesup |
Internet-Draft | Mozilla |
Intended status: Standards Track | S. Loreto |
Expires: October 13, 2013 | Ericsson |
M. Tuexen | |
Muenster Univ. of Appl. Sciences | |
April 11, 2013 |
WebRTC Data Channel Protocol
draft-jesup-rtcweb-data-protocol-04.txt
The Web Real-Time Communication (WebRTC) working group is charged to provide protocols to support for direct interactive rich communication using audio, video, and data between two peers' web-browsers. This document specifies an actual (minor) protocol for how the JS-layer DataChannel objects provide the data channels between the peers.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 13, 2013.
Copyright (c) 2013 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 (http://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 DataChannel Protocol is designed to provide, in the WebRTC context [I-D.ietf-rtcweb-overview], a generic transport service allowing Web Browser to exchange generic data in a bidirectional peer to peer fashion. As discussed in [I-D.ietf-rtcweb-data-channel] the protocol uses Stream Control Transmission Protocol (SCTP) [RFC4960] encapsulated on Datagram Transport Layer Security (DTLS) [RFC6347] as described in [I-D.tuexen-tsvwg-sctp-dtls-encaps] to benefit from their already standardized transport and security features.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
This document uses the following terms:
This protocol is a simple, low-overhead way to establish bidirectional Channels over an SCTP association with a consistent set of properties.
Channels are created by sending an DATA_CHANNEL_OPEN message on an unused Stream. There is no handshake, and the channel is available to send on as soon as the DATA_CHANNEL_OPEN has been sent.
To avoid glare in opening Channels, each side must use either even or odd Streams when sending a DATA_CHANNEL_OPEN message. The method used to determine which side uses odd or even is TBD and may be based on DTLS connection roles when used in rtcweb.
There is no attempt to resolve label glare; if both sides open a Channel labelled "x" at the same time, there will be two Channels labelled "x" - one on an even Stream pair, one on an odd pair.
The protocol field is to ease cross-application interoperation ("federation") by identifying the data being passed with an IANA-registered string.
Data that arrives which on an unused Stream MUST be held until a DATA_CHANNEL_OPEN arrived for that Channel, or if the protocol stack had been told to expect data on that Stream and deliver it immediately, or until [TBD - report error]. This allows for external negotiation of streams (or assumption of negotiation by cooperating applications). If a later DATA_CHANNEL_OPEN arrives that conflicts with the pre-set properties of the Channel, an error should be signaled to higher levels.
Channels are closed by resetting the Stream.
The opening handshake is based on the multimedia session description exchange that happens between the browsers, typically through a Web Server acting as the signaling service.
[I-D.ietf-mmusic-sctp-sdp] defines the protocol identifier, 'SCTP/DTLS', and defines how to establish an SCTP association over DTLS using the Session Description Protocol (SDP).
The SCTP association is created with the number of streams specified by the application, and if not specified, then it SHOULD default to 16 streams.
It is recommended that additional streams be available dynamically based on [RFC6525].
Control Messages are sent to manage opening bidirectional channels.
A DATA_CHANNEL_OPEN message is sent on the Stream that is intended to be used to send in that direction, and this creates a bidirectional Channel that may be used by both sides to send data.
This message is sent initially on the stream used for user messages using the channel. All DATA_CHANNEL_OPEN messages MUST be sent reliably and in-order.
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 | Reliability Parameter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Priority r | Label Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Protocol Length | / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | \ | | Label | / \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ / | Protocol | / \ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
When one side wants to add a channel, it picks an unused outgoing stream (either even or odd, depending on TBD); if no unused streams are available a negotiation to increase the number is done. It should also check that the other side has the same channel available, and if not then initiate an increase in the number of streams. It then sends a DATA_CHANNEL_OPEN control message on the outgoing stream.
When an DATA_CHANNEL_OPEN is received on an incoming stream, the Stream is associated with the newly-created Channel. If any data had arrived on the Stream before the Open arrives and had been buffered, it is now released on the new Channel.
The channel_type and reliability_parameters fields of the DATA_CHANNEL_OPEN message MUST be used to set up the reverse side of the Channel so that both directions use the same options by default.
Channels MUSTl be closed by resetting the outgoing stream If an incoming stream is reset by the peer, an corresponding outgoing stream reset SHOULD be issued. If both streams of a channel are reset, the channel is closed and the streams are available for reuse for new channel opens.
Data shall be sent using PPID's other than the Data Channel Control PPID. These PPID's should be registered with IANA via (TBD). The meaning of these data PPIDs and the format of the data shall be specific to the usage of this protocol, and typically shall be provided to the higher layers to allow proper decoding of the data.
It is RECOMMENDED that higher layers wishing to transfer large messages fragment them using PPIDs or other mechanisms to avoid monopolization of the SCTP association by the transfer of a single large message, unless a future SCTP draft relaxes this concern. If fragmented solely with PPID values, then transmission must occur on a reliable in-order channel. If in-band application framing is used, then other options may be possible.
For WebRTC, data PPID's for DOMStrings and binary data (and fragmentation thereof) shall be created.
All data sent on a Channel in both directions MUST be sent over the underlying Stream using the reliability defined when the Channel was opened unless the options are changed, or per-message options are specified by a higher level.
Data may be sent immediately after sending or receiving a DATA_CHANNEL_OPEN message.
It is recommended that message size be kept within certain size bounds (TBD) as applications wil not be able to support arbitrarily-large single messages.
To be done.
This document also defines three new SCTP Payload Protocol Identifiers (PPIDs). RFC 4960 [RFC4960] creates the registry from which these identifiers have been assigned. The following values have been reserved:
The authors wish to thank Martin Thompson, Cullen Jennings, Harald Alvestrand, Peter Thatcher, Adam Bergkvist, Justin Uberti, Randall Stewart, Stefan Håkansson and many others for their invaluable comments.
[I-D.ietf-rtcweb-overview] | Alvestrand, H., "Overview: Real Time Protocols for Brower-based Applications", Internet-Draft draft-ietf-rtcweb-overview-06, February 2013. |
[I-D.ietf-rtcweb-data-channel] | Jesup, R., Loreto, S. and M. Tuexen, "RTCWeb Datagram Connection", Internet-Draft draft-ietf-rtcweb-data-channel-02, October 2012. |