RFC 4571

Framing Real-time Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over Connection-Oriented Transport

πŸ“… published July 2006, from ietf

Framing Real-time Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over Connection-Oriented Transport πŸ’–

  • Network Working Group 🌸
  • RFC: 4571 πŸŽ€
  • Author: J. Lazzaro (UC Berkeley) 🧚
  • Category: Standards Track ✨
  • Date: July 2006 πŸ“…
  • Obsoletes / Updates: none listed in this header πŸ™ˆ

Status of This Memo πŸ“œ

okay so this doc is an Internet standards track protocol for the Internet community, and it literally wants your discussion and suggestions πŸ’¬ For where this protocol stands on the standardization front, check the current edition of the "Internet Official Protocol Standards" (STD 1) πŸ” And distribution of this memo is unlimited 🌈

Copyright (C) The Internet Society (2006). πŸ’œ

Abstract πŸ¦‹

this memo defines a way to frame Real-time Transport Protocol (RTP) and RTP Control Protocol (RTCP) packets onto connection-oriented transport, like TCP 🧡 It also explains how session descriptions can say that an RTP stream uses that framing method ✨

Table of Contents πŸ—‚οΈ

   1. Introduction ....................................................2
      1.1. Terminology ................................................2
   2. The Framing Method ..............................................2
   3. Packet Stream Properties ........................................3
   4. Session Descriptions for RTP/AVP over TCP .......................3
   5. Example .........................................................5
   6. Congestion Control ..............................................6
   7. Acknowledgements ................................................6
   8. Security Considerations .........................................6
   9. IANA Considerations .............................................7
   10. Normative References ...........................................7

1. Introduction ✨

okay so the Audio/Video Profile (AVP, [RFC3550]) for the Real-time Transport Protocol (RTP, [RFC3551]) doesn't define a way to frame RTP and RTP Control Protocol (RTCP) packets onto connection-oriented transport protocols, like TCP 😭 BUT earlier versions of RTP/AVP did define a framing method, and plenty of implementations still use it πŸ’…

in this memo we document that framing method from the earlier RTP/AVP versions πŸ“ we also add a mechanism so a session description [SDP] can signal that the framing method is being used πŸŽ€ Heads up: session description signalling for the framing method is new and was not defined in earlier versions of RTP/AVP, so it's a fresh glow-up 🌟

1.1. Terminology πŸ”‘

the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be read as described in BCP 14, RFC 2119 [RFC2119] 🧐

2. The Framing Method 🧩

Figure 1 is the one that defines the framing method πŸ‘‘

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    ---------------------------------------------------------------
   |             LENGTH            |  RTP or RTCP packet ...       |
    ---------------------------------------------------------------

Figure 1: The bit field definition of the framing method

the frame starts with a 16-bit unsigned integer LENGTH field, coded in network byte order (big-endian) πŸ“ If LENGTH is non-zero, an RTP or RTCP packet follows the LENGTH field πŸ¦‹ The value in the LENGTH field MUST equal the number of octets in the RTP or RTCP packet πŸ”₯ Zero is a valid LENGTH value, and it codes the null packet 🫢

this framing method does NOT use frame markers (aka an octet of constant value sitting in front of the LENGTH field) πŸ™…β€β™€οΈ Frame markers are useful for catching errors in the LENGTH field, so instead receivers SHOULD keep an eye on the RTP and RTCP header fields whose values are predictable, like the RTP version number πŸ‘€ For more guidance, see Appendix A.1 of [RFC3550] πŸ“–

3. Packet Stream Properties 🌊

honestly, in most respects the framing method doesn't specify anything above the level of a single packet πŸ’… In particular, Section 2 does not specify the following:

Bi-directional issues ↔️

Section 2 defines a framing method for use in one direction on a connection 🧭 How framed packets flowing in a defined direction relate to packets going the reverse direction is NOT specified πŸ€·β€β™€οΈ

Packet loss and reordering πŸŒ€

the reliable nature of a connection does NOT mean a framed RTP stream has contiguous sequence number ordering 😳 For example, say the connection is used to tunnel a UDP stream through a network middlebox that only passes TCP. Then the sequence numbers in the framed stream reflect any packet loss or reordering on the UDP portion of the end-to-end flow 🫠

Out-of-band semantics πŸšͺ

Section 2 does NOT define the RTP or RTCP semantics for closing a TCP socket, or for any other "out of band" signal on the connection πŸ”’

Memos that normatively include the framing method MAY specify these properties πŸ’œ For instance, Section 4 of this memo specifies these properties for RTP/AVP sessions described in session descriptions ✨

OK but here's the one thing the framing protocol DOES specify above the level of a single packet πŸ‘‘ If a direction of a connection carries RTP packets, the streams carried in that direction MUST support the use of multiple synchronization sources (SSRCs) in those RTP packets 🎢 If a direction of a connection carries RTCP packets, the streams carried in that direction MUST support the use of multiple SSRCs in those RTCP packets 🌈

6. Congestion Control πŸ’…

okay so the congestion control rules for RTP live in [RFC3550] 🌸 and that doc says it straight up: every transport protocol on the Internet has to deal with congestion somehow, and RTP is absolutely not exempt 😀

the Audio/Video Profile has its own congestion control requirements, and they're in [RFC3551] ✨ the main one is that RTP sessions should compete fairly with TCP flows sharing the network. and get this, because the framing method runs over TCP, it competes fairly with other TCP flows by definition 🫢 no extra work needed, it's giving built-in fairness πŸ‘‘


7. Acknowledgements πŸŽ€

this memo partly writes down discussions from the AVT mailing list about TCP and RTP πŸ¦‹ huge thank you to everyone who joined those conversations, you're the real MVPs πŸ’–


8. Security Considerations πŸ’€

okay this section is serious, bestie, so read it carefully πŸ™ˆ

implementors should carefully read the Security Considerations sections of the RTP [RFC3550] and RTP/AVP [RFC3551] documents, because most of the issues in those sections directly apply to RTP streams framed over TCP πŸ”₯

session descriptions that set up connection-oriented media sessions (like the example session in Figures 3 and 4 of Section 5) bring their own unique security concerns for streaming media 😭 the Security Considerations section of [COMEDIA] breaks all of that down in detail.

below, we talk about the security issues that are specific to the framing method from Section 2 🧚

attackers may send framed packets with large LENGTH values to exploit security holes in applications. πŸ’€

picture this: a C implementation declares a 1500-byte array as a stack variable and uses LENGTH as the bound on the loop that reads the framed packet into that array. it works totally fine for friendly apps sending Etherframe-sized RTP packets, but an attacker could absolutely exploit it 😱

so an implementation needs to handle packets of any length πŸ’… from a NULL packet (LENGTH == 0) all the way up to the biggest possible packet, the one holding 64K octets (LENGTH = 0xFFFF) 🌈


9. IANA Considerations πŸ“

[SDP] defines the syntax of session description media lines ✨ we copy that definition into Figure 2 of Section 4 of this memo, so you can see it right there πŸ‘€

in Section 4, we define a brand new token value for the <proto> field of media lines: TCP/RTP/AVP πŸ¦‹ Section 4 spells out what that token means, and Section 5 shows it in action inside a session description πŸ’œ


10. Normative References πŸ“š

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

[RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and Video Conferences with Minimal Control", STD 65, RFC 3551, July 2003.

[COMEDIA] Yon, D. and G. Camarillo, "TCP-Based Media Transport in the Session Description Protocol (SDP)", RFC 4145, September 2005.

[SDP] Handley, M., Jacobson, V., and C. Perkins. "SDP: Session Description Protocol", RFC 4566, July 2006.

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

[RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with Session Description Protocol (SDP)", RFC 3264, June 2002.

[RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)", RFC 3605, October 2003.

[RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 3556, July 2003.


Author's Address πŸ–ŠοΈ

John Lazzaro
UC Berkeley
CS Division
315 Soda Hall
Berkeley CA 94720-1776

EMail: lazzaro@cs.berkeley.edu

Copyright (C) The Internet Society (2006).

this document is subject to the rights, licenses and restrictions in BCP 78, and except as set out there, the authors keep all their rights 🫢

this document and the info in it are provided on an "AS IS" basis, and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS, OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE πŸ’…


Intellectual Property πŸ”

the IETF takes no position on the validity or scope of any Intellectual Property Rights or other rights that might be claimed to apply to the implementation or use of the technology in this document, or on whether any license under those rights might or might not be available πŸ€·β€β™€οΈ it also doesn't claim to have made any independent effort to find such rights. info on how RFC documents handle rights is in BCP 78 and BCP 79 πŸ“–

copies of IPR disclosures made to the IETF Secretariat, any assurances of licenses to be made available, and the results of any attempt to get a general license or permission for implementers or users to use these proprietary rights can be found in the IETF online IPR repository at http://www.ietf.org/ipr 🌐

the IETF invites any interested party to bring to its attention any copyrights, patents, patent applications, or other proprietary rights that may cover technology needed to implement this standard πŸ¦‹ send that info to the IETF at ietf-ipr@ietf.org πŸ’Œ


Acknowledgement 🌷

funding for the RFC Editor function comes from the IETF Administrative Support Activity (IASA) ✨

the end, bestie! πŸŒˆπŸ’–πŸŽ€

πŸ“¦ where this page comes from