RFC 7983

Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)

πŸ“… published September 2016, from ietf

RFC 7983: Multiplexing Scheme Updates for SRTP πŸ’–

okay bestie, this is the RFC that fixes how one socket handles a bunch of different packet types πŸ¦‹ It's from September 2016, it's on the Standards Track (so it's real, official, approved stuff ✨), and it's by M. Petit-Huguenin of Impedance Mismatch and G. Salgueiro of Cisco Systems. It's an IETF document, ISSN 2070-1721, and its whole job is to update RFC 5764. The header doesn't list anything it obsoletes. The title is "Multiplexing Scheme Updates for Secure Real-time Transport Protocol (SRTP) Extension for Datagram Transport Layer Security (DTLS)" πŸŽ€

Abstract 🌸

So this doc is about putting DTLS, RTP, RTCP, STUN, TURN, and ZRTP packets all through one receiving socket and sorting them out. It overrides the guidance in RFC 5764 ("SRTP Extension for DTLS"), which had four issues. This document describes those issues and fixes them. It also updates RFC 5764. Main character energy πŸ‘‘

Status of This Memo πŸ“œ

This is an Internet Standards Track document πŸ”₯ It's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community. It went through public review and got approved by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check Section 2 of RFC 7841.

Info about the current status, errata, and where to send feedback is at http://www.rfc-editor.org/info/rfc7983 🧚

Copyright (c) 2016 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 read these carefully, because they spell out your rights and restrictions for 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 they come without warranty as described in the Simplified BSD License.

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of that material outside the IETF Standards Process. Without an adequate license from the person(s) controlling the copyright in those materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

Table of Contents πŸ“š

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   4
3.  Implicit Allocation of Codepoints for New STUN Methods  . . .   4
4.  Multiplexing of ZRTP  . . . . . . . . . . . . . . . . . . . .   5
5.  Implicit Allocation of New Codepoints for TLS ContentTypes  .   5
6.  Multiplexing of TURN Channels . . . . . . . . . . . . . . . .   7
7.  Updates to RFC 5764 . . . . . . . . . . . . . . . . . . . . .   8
8.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  10
  9.1.  STUN Methods  . . . . . . . . . . . . . . . . . . . . . .  10
  9.2.  TLS ContentType . . . . . . . . . . . . . . . . . . . . .  10
  9.3.  Traversal Using Relays around NAT (TURN) Channel Numbers   11
10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  11
  10.1.  Normative References . . . . . . . . . . . . . . . . . .  11
  10.2.  Informative References . . . . . . . . . . . . . . . . .  12
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  13
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  13

1. Introduction ✨

Okay so, Section 5.1.2 of "Datagram Transport Layer Security (DTLS) Extension to Establish Keys for the Secure Real-time Transport Protocol (SRTP)" [RFC5764] defines a way for an RTP [RFC3550] receiver to tell apart DTLS [RFC6347], STUN [RFC5389], and SRTP / SRTCP [RFC3711] packets that all arrive on the RTP port. Honestly it's a great idea, but the demultiplexing scheme has caused some problems 😭

  1. It implicitly allocated codepoints for new STUN methods without an IANA registry reflecting these new allocations.
  2. It did not take into account the fact that ZRTP [RFC6189] also needs to be demultiplexed with the other packet types explicitly mentioned in Section 5.1.2 of RFC 5764.
  3. It implicitly allocated codepoints for new Transport Layer Security (TLS) ContentTypes without an IANA registry reflecting these new allocations.
  4. 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.

Here's the drama πŸ’€ Overlapping ranges between IANA registries become a problem when someone allocates a new codepoint in one registry without carefully checking how it affects the others when it's demultiplexed. Among the other downsides of the demultiplexing algorithm in [RFC5764], it creates a need for coordination between codepoint assignments where none should exist, and that's organizationally and socially undesirable. But RFC 5764 is already widely deployed, so people need to be aware of this issue and know how it must be dealt with. So even if a codepoint's feature isn't initially thought to be useful for demultiplexing, the respective IANA registry expert should at least raise a flag when the allocated codepoint irrevocably prevents multiplexing 🚩

The first goal here is to make sure future allocations in any affected protocol are done with full knowledge of their impact on multiplexing. This happens by updating [RFC5764], which includes changing the IANA registries with instructions for coordination between the protocols at risk 🫢

A second goal is to let new protocols join the list of existing multiplexed protocols in a way that doesn't break existing implementations πŸ“

At the time of writing, the flaws in the demultiplexing scheme were unavoidably inherited by other documents, such as [RFC7345] and [SDP-BUNDLE]. So those, and any other affected documents, will also need to be corrected with the updates this document provides πŸ”§

2. Terminology πŸŽ€

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].

3. Implicit Allocation of Codepoints for New STUN Methods πŸ¦‹

So the demultiplexing scheme in [RFC5764] says the receiver can identify the packet type by looking at the first byte. If that first byte is 0 or 1, the packet is STUN. The problem is that this implicit allocation limits the codepoints for STUN methods (see Section 18.1 of [RFC5389]) to values between 0x000 and 0x07F. That shrinks the number of STUN method codepoints assigned by IETF Review (the range 0x000 - 0x7FF) from 2048 down to just 128, and it kills any chance of STUN method codepoints being assigned by Designated Expert (the range 0x800 - 0xFFF). Not it 😀

To keep the Designated Expert range alive, this document allocates the values 2 and 3 to also identify STUN methods πŸ’œ

The IANA Registry for STUN methods has been changed to mark the codepoints from 0x100 to 0xFFF as Reserved. Those codepoints can still be allocated, but they need IETF Review, with a document that properly evaluates the risk of an assignment overlapping with other registries.

On top of that, this document updates the IANA registry so the STUN method codepoints in the 0x080-0x0FF range are also assigned via Designated Expert. The "STUN Methods" registry changes look like this:

OLD:

0x000-0x7FF     IETF Review
0x800-0xFFF     Designated Expert

NEW:

0x000-0x07F     IETF Review
0x080-0x0FF     Designated Expert
0x100-0xFFF     Reserved

4. Multiplexing of ZRTP 🌸

ZRTP [RFC6189] is a protocol for media path Diffie-Hellman exchange. It agrees on a session key and parameters for establishing unicast SRTP sessions for Voice over IP (VoIP) applications. ZRTP is media path keying because it's multiplexed on the same port as RTP and doesn't need support in the signaling protocol πŸ“ž

To stop future documents from assigning values in the unused range to a new protocol, this document modifies the [RFC5764] demultiplexing algorithm so it properly accounts for ZRTP [RFC6189], by allocating the values from 16 to 19 for this purpose ✨

5. Implicit Allocation of New Codepoints for TLS ContentTypes 🧚

The demultiplexing scheme in [RFC5764] says that if the first byte's value is between 20 and 63 (inclusive), the packet is DTLS. For DTLS 1.0 [RFC4347] and DTLS 1.2 [RFC6347], that first byte corresponds to the TLS ContentType field. You have to think carefully when assigning additional ContentTypes in the codepoint ranges 0 to 19 and 64 to 255, so that it doesn't prevent demultiplexing when that functionality is wanted. Note that [RFC5764] describes a narrow use of DTLS that works as long as the specific DTLS version abides by the restrictions on the demultiplexing byte (the ones this document imposes on the "TLS ContentType Registry"). Any extension or revision to DTLS that stops it from meeting these constraints should consider what values may show up in the first byte of the DTLS message, and what impact that would have on the multiplexing that [RFC5764] describes. πŸ”

For TLS packet identification, this document explicitly adds a warning to the codepoints from 0 to 19 and from 64 to 255, saying allocations in these ranges need coordination, as described in this document. The "TLS ContentType Registry" changes look like this πŸ’…

OLD:

0-19    Unassigned
20      change_cipher_spec
21      alert
22      handshake
23      application_data
24      heartbeat
25-255  Unassigned

NEW:

0-19    Unassigned (Requires coordination; see RFC 7983)
20      change_cipher_spec
21      alert
22      handshake
23      application_data
24      heartbeat
25-63   Unassigned
64-255  Unassigned (Requires coordination; see RFC 7983)

That's part 1 done, bestie 🌈 Part 2 is coming with the rest of the spec, so stay tuned πŸ¦‹πŸ’–

6. Multiplexing of TURN Channels ✨

okay bestie, this part is about TURN channels πŸ¦‹ When ICE (Interactive Connectivity Establishment) [RFC5245] is in the picture, an implementation of RFC 5764 can get packets on the same socket from three different paths, see Figure 1 πŸ’…

  1. Directly from the source
  2. Through a NAT
  3. Relayed by a TURN server
       +------+
       | TURN |<------------------------+
       +------+                         |
          |                             |
          | +-------------------------+ |
          | |                         | |
          v v                         | |
   NAT -----------                    | |
          | | +---------------------+ | |
          | | |                     | | |
          v v v                     | | |
      +----------+              +----------+
      | RFC 5764 |              | RFC 5764 |
      +----------+              +----------+

        Figure 1: Packet Reception by an Implementation of RFC 5764

so even if ICE picks a non-relayed path, data can still show up from the TURN server 🫢 for example, with ICE aggressive nomination the media path can switch around quickly until it settles πŸ”₯ and 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 get a 4-byte prefix instead of the regular 36-byte STUN overhead (see Section 2.5 of [RFC5766]). the problem? the RFC 5764 demultiplexing scheme doesn't say what to do with packets that come in over a TURN channel, since those packets start with a first byte between 64 and 127 (inclusive) 😭 if the TURN server was told to send data over a TURN channel, then the RFC 5764 scheme will reject those packets. current implementations break RFC 5764 for values 64 to 127 (inclusive) and parse those packets as TURN instead πŸ™ˆ

so to stop future documents from grabbing values in that unused range for a new protocol, this document changes the RFC 5764 demultiplexing algorithm to properly handle TURN channels by setting aside the values from 64 to 79 for this purpose πŸ‘‘ this narrows the TURN channel space to a smaller set of possible channels when the TURN client does the channel binding request together with the demultiplexing scheme described in [RFC5764] ✨

7. Updates to RFC 5764

this document updates the text in Section 5.1.2 of [RFC5764] as follows πŸ’–

OLD TEXT

The 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.

                 +----------------+
                 | 127 < B < 192 -+--> forward to RTP
                 |                |
     packet -->  |  19 < B < 64  -+--> forward to DTLS
                 |                |
                 |       B < 2   -+--> forward to STUN
                 +----------------+

  Figure 3: The DTLS-SRTP receiver's packet demultiplexing algorithm.
       Here the field B denotes the leading byte of the packet.

END OLD TEXT

NEW TEXT

The 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.

                 +----------------+
                 |        [0..3] -+--> forward to STUN
                 |                |
                 |      [16..19] -+--> forward to ZRTP
                 |                |
     packet -->  |      [20..63] -+--> forward to DTLS
                 |                |
                 |      [64..79] -+--> forward to TURN Channel
                 |                |
                 |    [128..191] -+--> forward to RTP/RTCP
                 +----------------+

  Figure 3: The DTLS-SRTP receiver's packet demultiplexing algorithm.

END NEW TEXT

8. Security Considerations

okay this one is serious, so listen up 🚨🫢 this document updates existing IANA registries and adds a new range for TURN channels in the demultiplexing algorithm 🌈

these changes don't add any specific security considerations beyond the ones already covered in [RFC5764] πŸ”

9. IANA Considerations

9.1. STUN Methods

this spec has the registration info for reserved STUN Methods codepoints πŸ¦‹ as explained in Section 3, and following the procedures in Section 18.1 of [RFC5389] πŸ’…

Value:   0x100-0xFFF

Name:   Reserved (For DTLS-SRTP multiplexing collision avoidance, see
   RFC 7983.  Cannot be made available for assignment without IETF
   Review.)

Reference:   RFC 5764, RFC 7983

this spec also reassigns the ranges in the STUN Methods Registry like this ✨

Range:   0x000-0x07F

Registration Procedures:   IETF Review

Range:   0x080-0x0FF

Registration Procedures:   Designated Expert

9.2. TLS ContentType

this spec has the registration info for reserved TLS ContentType codepoints πŸŽ€ as explained in Section 5, and following the procedures in Section 12 of [RFC5246] 🌸

Value:   0-19

Description:   Unassigned (Requires coordination; see RFC 7983)

DTLS-OK:   N/A

Reference:   RFC 5764, RFC 7983

Value:   64-255

Description:   Unassigned (Requires coordination; see RFC 7983)

DTLS-OK:   N/A

Reference:   RFC 5764, RFC 7983

9.3. Traversal Using Relays around NAT (TURN) Channel Numbers

this spec has the registration info for reserved codepoints in the "Traversal Using Relays around NAT (TURN) Channel Numbers" registry 🧚 as explained in Section 6, and following the procedures in Section 18 of [RFC5766] ✨

Value:   0x5000-0xFFFF

Name:   Reserved (For DTLS-SRTP multiplexing collision avoidance, see
   RFC 7983.)

Reference:   RFC 7983

10. References

10.1. Normative References

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119,
           DOI 10.17487/RFC2119, March 1997,
           <http://www.rfc-editor.org/info/rfc2119>.

[RFC3550]  Schulzrinne, H., Casner, S., Frederick, R., and V.
           Jacobson, "RTP: A Transport Protocol for Real-Time
           Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550,
           July 2003, <http://www.rfc-editor.org/info/rfc3550>.

[RFC3711]  Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K.
           Norrman, "The Secure Real-time Transport Protocol (SRTP)",
           RFC 3711, DOI 10.17487/RFC3711, March 2004,
           <http://www.rfc-editor.org/info/rfc3711>.

[RFC5245]  Rosenberg, J., "Interactive Connectivity Establishment
           (ICE): A Protocol for Network Address Translator (NAT)
           Traversal for Offer/Answer Protocols", RFC 5245,
           DOI 10.17487/RFC5245, April 2010,
           <http://www.rfc-editor.org/info/rfc5245>.

[RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
           (TLS) Protocol Version 1.2", RFC 5246,
           DOI 10.17487/RFC5246, August 2008,
           <http://www.rfc-editor.org/info/rfc5246>.

[RFC5389]  Rosenberg, J., Mahy, R., Matthews, P., and D. Wing,
           "Session Traversal Utilities for NAT (STUN)", RFC 5389,
           DOI 10.17487/RFC5389, October 2008,
           <http://www.rfc-editor.org/info/rfc5389>.

[RFC5764]  McGrew, D. and E. Rescorla, "Datagram Transport Layer
           Security (DTLS) Extension to Establish Keys for the Secure
           Real-time Transport Protocol (SRTP)", RFC 5764,
           DOI 10.17487/RFC5764, May 2010,
           <http://www.rfc-editor.org/info/rfc5764>.

[RFC5766]  Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using
           Relays around NAT (TURN): Relay Extensions to Session
           Traversal Utilities for NAT (STUN)", RFC 5766,
           DOI 10.17487/RFC5766, April 2010,
           <http://www.rfc-editor.org/info/rfc5766>.

[RFC6347]  Rescorla, E. and N. Modadugu, "Datagram Transport Layer
           Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
           January 2012, <http://www.rfc-editor.org/info/rfc6347>.

10.2. Informative References

[RFC4347]  Rescorla, E. and N. Modadugu, "Datagram Transport Layer
           Security", RFC 4347, DOI 10.17487/RFC4347, April 2006,
           <http://www.rfc-editor.org/info/rfc4347>.

[RFC6189]  Zimmermann, P., Johnston, A., Ed., and J. Callas, "ZRTP:
           Media Path Key Agreement for Unicast Secure RTP",
           RFC 6189, DOI 10.17487/RFC6189, April 2011,
           <http://www.rfc-editor.org/info/rfc6189>.

[RFC7345]  Holmberg, C., Sedlacek, I., and G. Salgueiro, "UDP
           Transport Layer (UDPTL) over Datagram Transport Layer
           Security (DTLS)", RFC 7345, DOI 10.17487/RFC7345, August
           2014, <http://www.rfc-editor.org/info/rfc7345>.

[SDP-BUNDLE]
           Holmberg, C., Alvestrand, H., and C. Jennings,
           "Negotiating Media Multiplexing Using the Session
           Description Protocol (SDP)", Work in Progress,
           draft-ietf-mmusic-sdp-bundle-negotiation-32, August 2016.

Acknowledgements

the implicit STUN Method codepoint allocations problem was first reported by Martin Thomson on the RTCWEB mailing list, and then discussed further with Magnus Westerlund 🫢

thanks a ton 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 made this doc better πŸ’œπŸŒˆ

Authors' Addresses

Marc Petit-Huguenin
Impedance Mismatch

Email: marc@petit-huguenin.org


Gonzalo Salgueiro
Cisco Systems
7200-12 Kit Creek Road
Research Triangle Park, NC  27709
United States of America

Email: gsalguei@cisco.com
πŸ“¦ where this page comes from