RFC 3605

Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)

๐Ÿ“… published October 2003, from ietf

RFC 3605: Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP) ๐Ÿ’–

Okay bestie, let's get into it! ๐ŸŽ€ This one is by C. Huitema from Microsoft, it's a Standards Track doc, and it's dated October 2003. It doesn't list anything it obsoletes or updates, so it's a standalone move. ๐Ÿฆ‹

Status of This Memo โœจ

This document specifies an Internet standards track protocol for the Internet community, and it's asking everyone for discussion and suggestions for improvements ๐Ÿซถ For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited ๐ŸŒธ

Copyright (C) The Internet Society (2003). All Rights Reserved. ๐ŸŒˆ

Abstract ๐Ÿงš

So SDP (the Session Description Protocol) is what describes the parameters of the media streams in multimedia sessions ๐ŸŽถ The tricky part is that when a session needs multiple ports, SDP assumes those ports have consecutive numbers. But if the session crosses a network address translation device that also does port mapping, the translation can wreck the ordering of ports ๐Ÿ˜ญ To fix that, this doc proposes an extension attribute to SDP ๐Ÿ’…

1. Introduction โœจ

The session invitation protocol (SIP, [RFC3261]) is often used to set up multi-media sessions on the Internet ๐Ÿ“ž There are lots of cases today where one or both ends of the connection are hidden behind a network address translation device [RFC2766] ๐Ÿ™ˆ In that case, the SDP text has to document the IP addresses and UDP ports as they show up on the "public Internet" side of the NAT. This memo assumes the host behind a NAT has some way to get those numbers. A possible way to learn them is briefly outlined in section 3, but just learning the numbers isn't enough, bestie ๐Ÿ’€

The SIP messages use the encoding defined in SDP [RFC2327] to describe the IP addresses and TCP or UDP ports used by the various media. Audio and video are usually sent using RTP [RFC3550], which needs two UDP ports: one for the media and one for the control protocol (RTCP) ๐ŸŽง SDP only carries one port number per media, and it says that "other ports used by the media application (such as the RTCP port) should be derived algorithmically from the base media port." ๐Ÿงฎ RTCP port numbers really did have to be derived from the base media port in older versions of RTP (like [RFC1889]). But that restriction has been lifted now, so there's a need to specify RTCP ports explicitly in SDP โœจ Heads up though: implementations of RTP that stick to the earlier [RFC1889] spec might not be able to use the SDP attributes specified in this document โš ๏ธ

When the NAT device does port mapping, there's no guarantee that the mappings of two separate ports keep the sequencing and the parity of the original port numbers ๐Ÿ˜ฉ It's even possible that when the NAT manages a pool of IP addresses, the RTP and RTCP ports get mapped to different addresses. So to get connections established even with the misordering and the possible parity switches the NAT causes, this doc proposes a specific SDP attribute that documents the RTCP port and, optionally, the RTCP address ๐Ÿฆ‹

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]. ๐Ÿ“œ

2. Description of the Solution ๐Ÿ’…

The main part of the solution is declaring an SDP attribute that documents the port used by RTCP ๐Ÿ”ฅ

2.1. The RTCP Attribute ๐ŸŽ€

The RTCP attribute documents the RTCP port used for a media stream, but only when that port is not the next higher (odd) port number after the RTP port described in the media line ๐Ÿ‘‘ It's a "value" attribute and follows the general syntax from page 18 of [RFC2327]: a=<attribute>:<value> ๐Ÿงš For the RTCP attribute:

  • the name is the ASCII string "rtcp" (lower case),
  • the value is the RTCP port number and optional address.

The formal description of the attribute is defined by the following ABNF [RFC2234] syntax ๐Ÿค“

rtcp-attribute =  "a=rtcp:" port  [nettype space addrtype space
                      connection-address] CRLF

In this description, the "port", "nettype", "addrtype" and "connection-address" tokens are defined as specified in "Appendix A: SDP Grammar" of [RFC2327] ๐Ÿ“–

Example encodings could be:

m=audio 49170 RTP/AVP 0
a=rtcp:53020
m=audio 49170 RTP/AVP 0
a=rtcp:53020 IN IP4 126.16.64.4
m=audio 49170 RTP/AVP 0
a=rtcp:53020 IN IP6 2001:2345:6789:ABCD:EF01:2345:6789:ABCD

The RTCP attribute MAY be used as a media level attribute ๐ŸŒธ It MUST NOT be used as a session level attribute, so don't even try it ๐Ÿ™…โ€โ™€๏ธ Even though the examples below are about a method that returns only unicast addresses, both unicast and multicast values are valid ๐ŸŒˆ

3. Discussion of the Solution ๐Ÿง 

Honestly the implementation is pretty straightforward ๐Ÿ’– The questions people ask most about this solution are: whether it's useful at all (can a host actually discover port numbers through an unmodified NAT?), whether it's sufficient (is there a need to document more than one ancillary port per media type?), and why we shouldn't just change the media definition instead of adding a new attribute ๐Ÿค”

3.1. How do we Discover Port Numbers? ๐Ÿ”

The solution is only useful if the host can discover the "translated port numbers," meaning the values of the ports as they appear on the "external side" of the NAT ๐Ÿ‘€ One option is to get help from a well-connected third party that acts as a server according to STUN [RFC3489]. That gives us a four step process:

  1. The host allocates two UDP ports numbers for an RTP/RTCP pair,
  2. The host sends a UDP message from each port to the STUN server,
  3. The STUN server reads the source address and port of the packet, and copies them in the text of a reply,
  4. The host parses the reply according to the STUN protocol and learns the external address and port corresponding to each of the two UDP ports.

This algorithm assumes the NAT uses the same translation for packets sent to the third party and to the "SDP peer" the host wants to connect with ๐Ÿคž There's no guarantee that every NAT box on the Internet works that way ๐Ÿ˜ฌ For an extensive discussion of the various types of NAT, implementers should look at the STUN specification [RFC3489] ๐Ÿ“š

3.2. Do we need to Support Multiple Ports? ๐Ÿฆ‹

Most media streams go over a single pair of RTP and RTCP ports ๐Ÿ’œ It's possible, though, to send a single media over several RTP flows, for example with hierarchical encoding ๐ŸŒˆ In that case, SDP encodes the port number used by RTP on the first flow, plus the number of flows, like this:

m=video 49170/2 RTP/AVP 31

In this example, the media is sent over 2 consecutive pairs of ports ๐Ÿงš They line up like this: RTP for the first flow (even number, 49170), RTCP for the first flow (odd number, 49171), RTP for the second flow (even number, 49172), and RTCP for the second flow (odd number, 49173) ๐ŸŽ€

In theory, SDP could be changed to document the many ports for the separate encoding layers. But honestly, layered encoding isn't used much in practice, and when it is, it's mostly paired with multicast transmission ๐Ÿ™„ The translation issues in this memo only apply to unicast transmission, so there's no short-term need for supporting multiple port descriptions โœจ It's more convenient and more robust to focus on the simple case where a media is sent over exactly one RTP/RTCP stream ๐Ÿ’…

3.3. Why not Expand the Media Definition? ๐Ÿคทโ€โ™€๏ธ

The RTP ports are already written in the media description line, so it would seem convenient to document the RTCP port in the same spot instead of making a new RTCP attribute ๐Ÿง The doc considered that design and rejected it for two reasons. First, adding an extra port number and an optional address to the media description would be awkward ๐Ÿ˜– Second, and more importantly, it would cause problems with existing applications, which would have to reject the entire media description if they didn't understand the extension ๐Ÿ’€ An attribute has a well-defined failure mode instead ๐Ÿฆ‹ Implementations that don't understand the "a=rtcp" attribute will simply ignore it. They won't send RTCP packets to the specified address, but they'll at least still be able to receive the media in the RTP packets ๐ŸŒธ


7. Intellectual Property Statement โœจ

okay bestie, this part is the legal stuff, but it's still lowkey important ๐Ÿ’… The IETF doesn't take a side on whether any intellectual property rights apply to the technology in this document, whether anyone can get a license for them, or whether it even looked for those rights in the first place ๐Ÿซถ If you want the IETF's rules for rights in standards-track and standards-related documents, go read BCP-11 ๐Ÿ“š Copies of rights claims that were filed for publication, any promised licenses, or the results of someone trying to get a general license or permission for proprietary rights, can all be requested from the IETF Secretariat ๐ŸŽ€

The IETF also wants to hear from anyone who knows about copyrights, patents, patent applications, or other proprietary rights that might cover technology needed to implement this standard ๐Ÿ”ฅ Send that info to the IETF Executive Director, periodt ๐Ÿ’–

8. Acknowledgements ๐ŸŒธ

the original idea for using the "rtcp" attribute came from Ann Demirtjis ๐Ÿ‘‘ The document was reviewed by the MMUSIC and AVT working groups of the IETF, so shoutout to all of them ๐Ÿซถ๐Ÿฆ‹

9. References ๐Ÿ“š

9.1. Normative References

[RFC1889] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson. "RTP: A Transport Protocol for Real-Time Applications", RFC 1889, January 1996. ๐Ÿ’œ

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐ŸŒˆ

[RFC2234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. โœจ

[RFC2327] Handley, M. and V. Jacobson, "SDP: Session Description Protocol", RFC 2327, April 1998. ๐Ÿงš

[RFC3489] Rosenberg, J., Weinberger, J., Huitema, C. and R. Mahy. "STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)", RFC 3489, March 2003. ๐Ÿฆ‹

[RFC3550] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson. "RTP: A Transport Protocol for Real-Time Applications", RFC 3550, July 2003. ๐Ÿ’…

9.2. Informative References

[RFC2766] Tsirtsis, G. and P. Srisuresh. "Network Address Translation - Protocol Translation (NAT-PT)", RFC 2766, February 2000. ๐Ÿ“

[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M. and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. ๐ŸŽ€

[RFC3369] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3369, August 2002. ๐Ÿ™ˆ

[RFC3424] Daigle, L., "IAB considerations for UNilateral Self-Address Fixing (UNSAF) across network address translation", RFC 3424, November 2002. ๐Ÿ”ฅ

10. Author's Address ๐Ÿงš

this is where you find the author, Christian Huitema, at Microsoft Corporation ๐Ÿ’–

Christian Huitema
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052-6399

EMail: huitema@microsoft.com

Copyright (C) The Internet Society (2003). All Rights Reserved. ๐Ÿ’œ

okay so here's the big copyright vibe ๐Ÿซถ You're allowed to copy this document and share it with others, and you can make derivative works that comment on or explain it or help people implement it, and publish and distribute those, in whole or in part, with no restriction at all. The one condition is that the above copyright notice and this paragraph must be included on every copy and derivative work โœจ

the document itself can't be modified in any way, like removing the copyright notice or the references to the Internet Society or other Internet organizations. There are two exceptions: you can change it for developing Internet standards (in which case the Internet Standards process copyright procedures must be followed), or you can translate it into languages other than English ๐ŸŽ€

The limited permissions above are perpetual and won't be revoked by the Internet Society or its successors or assignees ๐Ÿฆ‹

And now the important disclaimer ๐Ÿ˜ญ This document and the information in it are provided on an "AS IS" basis, and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿ’€

Acknowledgement ๐Ÿซถ

funding for the RFC Editor function is currently provided by the Internet Society, and that's the end of RFC 3605 ๐ŸŒธ๐Ÿ’–

๐Ÿ“ฆ where this page comes from