4. Requirements
This section lists the requirements for Peer-to-Peer (P2P) data channels between two browsers. Please note that this section is informational only.
Req. 1: Multiple simultaneous data channels must be supported. Note that there may be zero or more SRTP media streams in parallel with the data channels in the same PeerConnection, and the number and state (active/inactive) of these SRTP media streams may change at any time.
Req. 2: Both reliable and unreliable data channels must be supported.
Req. 3: Data channels of a PeerConnection must be congestion controlled either individually, as a class, or in conjunction with the SRTP media streams of the PeerConnection. This ensures that data channels don't cause congestion problems for these SRTP media streams, and that the WebRTC PeerConnection does not cause excessive problems when run in parallel with TCP connections.
Req. 4: The application should be able to provide guidance as to the relative priority of each data channel relative to each other and relative to the SRTP media streams. This will interact with the congestion control algorithms.
Req. 5: Data channels must be secured, which allows for confidentiality, integrity, and source authentication. See [RFC8826] and [RFC8827] for detailed information.
Req. 6: Data channels must provide message fragmentation support such that IP-layer fragmentation can be avoided no matter how large a message the JavaScript application passes to be sent. It also must ensure that large data channel transfers don't unduly delay traffic on other data channels.
Req. 7: The data channel transport protocol must not encode local IP addresses inside its protocol fields; doing so reveals potentially private information and leads to failure if the address is depended upon.
Req. 8: The data channel transport protocol should support unbounded-length "messages" (i.e., a virtual socket stream) at the application layer for such things as image-file-transfer; implementations might enforce a reasonable message size limit.
Req. 9: The data channel transport protocol should avoid IP fragmentation. It must support Path MTU (PMTU) discovery and must not rely on ICMP or ICMPv6 being generated or being passed back, especially for PMTU discovery.
Req. 10: It must be possible to implement the protocol stack in the user application space.