RFC 3605
Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)
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 Notice ๐
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:
- The host allocates two UDP ports numbers for an RTP/RTCP pair,
- The host sends a UDP message from each port to the STUN server,
- The STUN server reads the source address and port of the packet, and copies them in the text of a reply,
- 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
11. Full Copyright Statement ๐
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
- ietf: rfc3605 2003-10
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms