Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)Impedance Mismatchmarc@petit-huguenin.orgCisco Systems7200-12 Kit Creek RoadResearch Triangle ParkNC27709USgsalguei@cisco.com
RAI
AVTCOREThis document defines how Datagram Transport Layer Security (DTLS), Real-time Transport Protocol (RTP), RTP Control Protocol (RTCP), Session Traversal Utilities for NAT (STUN), Traversal Using Relays around NAT (TURN), and ZRTP packets are multiplexed on a single receiving socket. It overrides the guidance from RFC 5764 ("SRTP Extension for DTLS"), which suffered from four issues described and fixed in this document.This document updates RFC 5764.Section 5.1.2 of Secure Real-time Transport Protocol (SRTP) Extension for DTLS defines a scheme for a Real-time Transport Protocol (RTP) receiver to demultiplex Datagram Transport Layer Security (DTLS), Session Traversal Utilities for NAT (STUN) and Secure Real-time Transport Protocol (SRTP)/Secure RTP Control Protocol (SRTCP) packets that are arriving on the RTP port. Unfortunately, this demultiplexing scheme has created problematic issues: It implicitly allocated codepoints for new STUN methods without an IANA registry reflecting these new allocations.It did not take into account the fact that ZRTP also needs to be demultiplexed with the other packet types explicitly mentioned in Section 5.1.2 of RFC 5764.It implicitly allocated codepoints for new Transport Layer Security (TLS) ContentTypes without an IANA registry reflecting these new allocations.It did not take into account the fact that the Traversal Using Relays around NAT (TURN) usage of STUN can create TURN channels that also need to be demultiplexed with the other packet types explicitly mentioned in Section 5.1.2 of RFC 5764.Having overlapping ranges between different IANA registries becomes an issue when a new codepoint is allocated in one of these registries without carefully analyzing the impact it could have on the other registries when that codepoint is demultiplexed. Among other downsides of the bad design of the demultiplexing algorithm detailed in , it creates a requirement for coordination between codepoint assignments where none should exist, and that is organizationally and socially undesirable. However, RFC 5764 has been widely deployed so there must be an awareness of this issue and how it must be dealt with. Thus, even if the feature related to a codepoint is not initially thought to be useful in the context of demultiplexing, the respective IANA registry expert should at least raise a flag when the allocated codepoint irrevocably prevents multiplexing.The first goal of this document is to make sure that future allocations in any of the affected protocols are done with the full knowledge of their impact on multiplexing. This is achieved by updating , which includes modifying the IANA registries with instructions for coordination between the protocols at risk.A second goal is to permit the addition of new protocols to the list of existing multiplexed protocols in a manner that does not break existing implementations. At the time of this writing, the flaws in the demultiplexing scheme were unavoidably inherited by other documents, such as and . So in addition, these and any other affected documents will need to be corrected with the updates this document provides. 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 . The demultiplexing scheme in states that the receiver can identify the packet type by looking at the first byte. If the value of this first byte is 0 or 1, the packet is identified to be STUN. The problem that arises as a result of this implicit allocation is that this restricts the codepoints for STUN methods (as described in Section 18.1 of ) to values between 0x000 and 0x07F, which in turn reduces the number of possible STUN method codepoints assigned by IETF Review (i.e., the range from (0x000 - 0x7FF) from 2048 to only 128 and eliminating the possibility of having STUN method codepoints assigned by Designated Expert (i.e., the range 0x800 - 0xFFF). To preserve the Designated Expert range, this document allocates the value 2 and 3 to also identify STUN methods.The IANA Registry for STUN methods is modified to mark the codepoints from 0x100 to 0xFFF as Reserved. These codepoints can still be allocated, but require IETF Review with a document that will properly evaluate the risk of an assignment overlapping with other registries. In addition, this document also updates the IANA registry such that the STUN method codepoints assigned in the 0x080-0x0FF range are also assigned via Designated Expert. The proposed changes to the STUN Method Registry are: OLD:NEW:ZRTP is a protocol for media path Diffie-Hellman
exchange to agree on a session key and parameters for establishing
unicast Secure Real-time Transport Protocol (SRTP) sessions for Voice
over IP (VoIP) applications. The ZRTP protocol is media path keying
because it is multiplexed on the same port as RTP and does not
require support in the signaling protocol.In order to prevent future documents from assigning values from the unused range to a new protocol, this document modifies the demultiplexing algorithm to properly account for ZRTP by allocating the values from 16 to 19 for this purpose.The demultiplexing scheme in dictates that if the value of the first byte is between 20 and 63 (inclusive), then the packet is identified to be DTLS. For DTLS 1.0 and DTLS 1.2 that first byte corresponds to the TLS ContentType field. Considerations must be taken into account when assigning additional ContentTypes in the code point ranges 0 to 19 and 64 to 255 so this does not prevent demultiplexing when this functionality is desirable. Note that describes a narrow use of DTLS that works as long as the specific DTLS version used abides by the restrictions on the demultiplexing byte (the ones that this document imposes on the TLS ContentType Registry). Any extension or revision to DTLS that causes it to no longer meet these constraints should consider what values may occur in the first byte of the DTLS message and what impact it would have on the multiplexing that describes.With respect to TLS packet identification, this document explicitly adds a warning to the codepoints from 0 to 19 and from 64 to 255 indicating that allocations in these ranges require coordination, as described in this document. The proposed changes to the TLS ContentType Registry are: OLD:NEW:When used with ICE, an RFC 5764 implementation can receive packets on the same socket from three different paths, as shown in : Directly from the sourceThrough a NATRelayed by a TURN server Even if the ICE algorithm succeeded in selecting a non-relayed path, it is still possible to receive data from the TURN server. For instance, when ICE is used with aggressive nomination the media path can quickly change until it stabilizes. Also, freeing ICE candidates is optional, so the TURN server can restart forwarding STUN connectivity checks during an ICE restart. TURN channels are an optimization where data packets are exchanged with a 4-byte prefix, instead of the standard 36-byte STUN overhead (see Section 2.5 of ). The problem is that the RFC 5764 demultiplexing scheme does not define what to do with packets received over a TURN channel since these packets will start with a first byte whose value will be between 64 and 127 (inclusive). If the TURN server was instructed to send data over a TURN channel, then the current RFC 5764 demultiplexing scheme will reject these packets. Current implementations violate RFC 5764 for values 64 to 127 (inclusive) and they instead parse packets with such values as TURN. In order to prevent future documents from assigning values from the unused range to a new protocol, this document modifies the RFC 5764 demultiplexing algorithm to properly account for TURN channels by allocating the values from 64 to 79 for this purpose. This modification restricts the TURN channel space to a more limited set of possible channels when the TURN client does the channel binding request in combination with the demultiplexing scheme described in .This document updates the text in Section 5.1.2 of as follows:OLD TEXTThe process for demultiplexing a packet is as follows. The receiver looks at the first byte of the packet. If the value of this byte is 0 or 1, then the packet is STUN. If the value is in between 128 and 191 (inclusive), then the packet is RTP (or RTCP, if both RTCP and RTP are being multiplexed over the same destination port). If the value is between 20 and 63 (inclusive), the packet is DTLS. This process is summarized in Figure 3. END OLD TEXTNEW TEXTThe process for demultiplexing a packet is as follows. The receiver looks at the first byte of the packet. If the value of this byte is in between 0 and 3 (inclusive), then the packet is STUN. If the value is between 16 and 19 (inclusive), then the packet is ZRTP. If the value is between 20 and 63 (inclusive), then the packet is DTLS. If the value is between 64 and 79 (inclusive), then the packet is TURN Channel. If the value is in between 128 and 191 (inclusive), then the packet is RTP (or RTCP, if both RTCP and RTP are being multiplexed over the same destination port). If the value does not match any known range then the packet MUST be dropped and an alert MAY be logged. This process is summarized in Figure 3.END NEW TEXTThis document updates existing IANA registries and adds a new range for TURN channels in the demuxing algorithm.These modifications do not introduce any specific security considerations beyond those detailed in .This specification contains the registration information for reserved STUN Methods codepoints, as explained in and in accordance with the procedures defined in Section 18.1 of .0x100-0xFFFReserved (MUST be allocated with IETF Review. For DTLS-SRTP multiplexing collision avoidance see RFCXXXX)RFC5764, RFCXXXXThis specification also reassigns the ranges in the STUN Methods Registry as follow:0x000-0x07FIETF Review0x080-0x0FFDesignated ExpertThis specification contains the registration information for reserved TLS ContentType codepoints, as explained in and in accordance with the procedures defined in Section 12 of .0-19Unassigned (Requires coordination, see RFCXXXX)N/ARFC5764, RFCXXXX64-255Unassigned (Requires coordination, see RFCXXXX))N/ARFC5764, RFCXXXXThis specification contains the registration information for reserved Traversal Using Relays around NAT (TURN) Channel Numbers codepoints, as explained in and in accordance with the procedures defined in Section 18 of .0x5000-0xFFFFReserved (For DTLS-SRTP multiplexing collision avoidance see RFCXXXX)RFCXXXX[RFC EDITOR NOTE: Please replace RFCXXXX with the RFC number assigned to this document (for all instances where this convention is used throughout this draft).]The implicit STUN Method codepoint allocations problem was first reported by Martin Thomson in the RTCWEB mailing-list and discussed further with Magnus Westerlund.Thanks to Simon Perreault, Colton Shields, Cullen Jennings, Colin Perkins, Magnus Westerlund, Paul Jones, Jonathan Lennox, Varun Singh, Justin Uberti, Joseph Salowey, Martin Thomson, Ben Campbell, Stephen Farrell, Alan Johnston, Mehmet Ersue, Matt Miller, Spencer Dawkins, Joel Halpern and Paul Kyzivat for the comments, suggestions, and questions that helped improve this document.This section must be removed before publication as an RFC.Addressed comments from AD review (editorial).Addressed comments from Gen-ART, Sec-Dir and OPS-Dir reviews.Removed Implementation Status section.Updated based on Magnus Westerlund's LC review comments.On advice of EKR changed boilerplate to pre5378Trust200902.Added ZRTP awareness to demultiplexing logic.Minor update to Security Considerations section.Addresses Martin Thomson, Ben Campbell and Stephen Farrell's review comments about TLS ContentType registrations.Addresses Colin's WGLC review commentsRemoved some remnants of the ordering from Section 6Moved Terminology from Section 5 to Section 2Removed Section on "Demultiplexing Algorithm Test Order"Split the Introduction into separate sectionsRevert to the RFC 5389, as the stunbis reference was needed only for STUN over SCTP.Remove any discussion about SCTP until a consensus emerges in TRAM.Instead of allocating the values that are common on each registry, the specification now only reserves them, giving the possibility to allocate them in case muxing is irrelevant.STUN range is now 0-3m with 2-3 being Designated Expert.TLS ContentType 0-19 and 64-255 are now reserved.Add SCTP over UDP value.If an implementation uses the source IP address/port to separate TURN channels packets then the whole channel numbers are available.If not the prefix is between 64 and 79.First byte test order is now by incremental values, so failure is deterministic.Redraw the demuxing diagram.Adoption by WG.Add reference to STUNbis.Change affiliation.