RFC 5450

Transmission Time Offsets in RTP Streams

πŸ“… published March 2009, from ietf

Transmission Time Offsets in RTP Streams πŸ¦‹

Okay bestie, so this is RFC 5450, and it's a Standards Track doc from the Network Working Group, dated March 2009. It was written by D. Singer (Apple Computer Inc.) and H. Desineni (Qualcomm). The header doesn't list anything it obsoletes or updates, so it stands on its own πŸ’…

Status of This Memo ✨

This document is an Internet standards track protocol for the Internet community, and it asks for discussion and suggestions for improvements. For the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited 🌸

Copyright (c) 2009 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, as they were in effect on the date of publication. Please read those carefully, because they spell out your rights and restrictions for this document. You can find them at http://trustee.ietf.org/license-info πŸ“œ

This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. The people who control the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process. Unless you get an adequate license from those copyright holders, 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. The one exception is formatting it for publication as an RFC or translating it into languages other than English 🌈

Abstract 🧚

This document describes a method for telling Real-time Transport Protocol (RTP) clients when RTP packets are transmitted at a time other than their 'nominal' transmission time. It also provides a mechanism for sending improved inter-arrival jitter reports from the clients, and those reports take the reported transmission times into account πŸ’œ

Table of Contents πŸ“

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.  Requirements Notation . . . . . . . . . . . . . . . . . . . . . 3
3.  Transmission Offset . . . . . . . . . . . . . . . . . . . . . . 3
4.  Extended Jitter Reports . . . . . . . . . . . . . . . . . . . . 5
5.  Signaling (Setup) Information . . . . . . . . . . . . . . . . . 6
6.  Security Considerations . . . . . . . . . . . . . . . . . . . . 6
7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
8.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 7
9.  Normative References  . . . . . . . . . . . . . . . . . . . . . 7

1. Introduction πŸ’–

Okay so the RTP specification [RFC3550] calculates network jitter on the assumption that packets are sent more or less in line with their RTP timestamps. That has to be true on average over longer stretches of time, because the client plays packets out according to those timestamps. But for individual packets it might not be true, and it's giving chaotic in a few situations:

  • When the stream's data rate is bursty. Video is the classic example, since I-frames can be a lot bigger than P or B frames, so traffic smoothing may need to be applied to keep a steady data rate.
  • In video with forward-decode dependencies, frames may have to be sent in decoding order (sequence number order) while still carrying presentation timestamps. In that case, a frame sent early in the sequence doesn't line up with its RTP timestamp.
  • When retransmissions happen, the retransmitted packet clearly has a different actual transmission time from the original, even though they share the same timestamp πŸ™ˆ

Sometimes it helps the receiver, or intermediate network elements, to know the packet's actual transmission time. This RTP header extension element is how that information gets communicated ✨

The RTP specification doesn't define a transmission timestamp, and neither does this spec. All this specification does is give information about how relative transmission times relate to relative RTP timestamps 🧚

This spec lets the transmitter tell the receiver about any known variation between the spacing of transmission times and the spacing of RTP timestamps. Any variation that isn't reported and happens at or after the point where the transmission time gets measured will be treated by the receiver as network jitter. The transmitter gets to decide where that measurement point is, but it should be consistent from packet to packet, obviously πŸ’…

This info can also be useful for reporting the inter-arrival jitter caused by the network, with the jitter caused by the source left out. A new RTP Control Protocol (RTCP) packet is defined to make that reporting possible πŸ¦‹

2. Requirements Notation πŸ“š

Okay, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are all interpreted as described in [RFC2119]. That's the whole rule for this section, iykyk πŸŽ€

3. Transmission Offset 🌸

Classically, two RTP packets with timestamps S2 and S1 are sent with a time gap between them of (S2 - S1). This spec lets you send an offset value O in each packet, which we'll call O1 and O2. The neat part is that the original transmission gap can be worked out as (S2 + O2) - (S1 + O1) 🫢

Here's the more precise definition. The function RtoN converts RTP times to Network Time Protocol (NTP) times, and NtoR does the reverse:

  • Start with an RTP stream that has a recent RTCP sender report relating RTP timestamp S0 to NTP timestamp N0.
  • Think about a packet sent after that, with RTP timestamp S1. Nominally, it's sent at N1 = (N0 + RtoN(S1 - S0)).
  • If it was actually sent at a different time, Na, then the offset value O1 is O1 = NtoR(Na - N1).

The transmission time gets signaled to the receiver in-band, using the general mechanism for RTP header extensions [RFC5285]. The payload of this extension (the transmitted value) is a 24-bit signed integer. Add it to the RTP timestamp of the packet and you get the "effective" RTP transmission time of the packet, on the RTP timescale. Using the equations above, the reported transmission time T1 of a packet with timestamp S1 and an offset of O1 is T1 = S1+O1. Those transmission time values only mean something when you compare two or more of them, though 🌈

Here's the form of the transmission offset extension block:

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |  ID   | len=2 |              transmission offset              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The length field is 2, which means 3 bytes follow 🧸

The sign of the offset value depends a lot on how the initial mapping of RTP to NTP times is chosen. Without scanning a whole stream first, you can't guarantee that the mapping keeps every offset positive. So this spec allows negative values, no drama πŸ™ƒ

Imagine a stream with these timestamps and sizes (in KB):

200    2 KB
300    4 KB
400    2 KB
500   12 KB
600   ...effective end of stream

That's 20 KB spread over 400 time units, so on average it's 1 KB per 20 time units. Once we traffic-smooth it, and given a transmission time of x for the first packet, the following packets go out at these intervals after it:

x + 000   2 KB
x + 040   4 KB
x + 120   2 KB
x + 160  12 KB
x + 400 ...effective end of stream

The choice of x is basically arbitrary, since only the relative values of timestamps matter. Now say that on the first packet I claim it went out at its RTP timestamp, meaning an offset of 0, so x is 200. Then the offset values are:

   0
 -60
 -80
-140

That's because I'm traffic-smoothing by conceptually sending the small packets 'early'. But only the relative values matter, so it's just as valid to say x is 400. Then the offset values are:

200
140
120
 60

🧁 Here's the tricky bit. In a stream where this extension isn't in effect (meaning it's neither declared nor negotiated), the actual transmission offset is unknown. But when the extension is in effect for a stream, it MAY be omitted from packets whose offset is 0 (zero). In other words, packets sent at their nominal time don't need to be tagged with this extension. So the implied transmission time of an un-tagged RTP packet depends on whether the extension is in effect for the stream (in which case the transmission offset is 0) or not (in which case the transmission offset is unknown) πŸ’œ

The jitter calculations an RTP client performs MUST NOT use these transmission offsets. In general, the sender (or intermediate network elements doing RTP analysis) can't always know whether the offsets have been taken into account. So, for consistency, the jitter calculation should keep working on the 'raw' reception times. Section 4 covers extended jitter reports, though, so keep reading ✨

There are no extensionattributes defined for this extension.

It's structurally possible to have more than one extension of the same type in a packet. However, this extension is only defined for the source to report. Intermediate network nodes that aren't the source of the RTP session MUST NOT add this extension (whether or not it was already present), and they MUST NOT alter an existing transmission offset value in a packet if the extension is already there πŸ™…β€β™€οΈ

(Of course, network elements that terminate an RTP flow and are the source for a new RTP flow can add a transmission offset extension header to the RTP packets of the new flow, if they want to 🫢)

4. Extended Jitter Reports ✨

okay so bestie, the normal inter-arrival jitter from Section 6.4.1 of [RFC3550] πŸŽ€ is great, but it's giving "everything including the source's own jitter" πŸ’… (the transmission time offsets). so if you want the actual network jitter with the source-introduced stuff taken out, you use this new RTCP packet type instead πŸ¦‹

here's the shape of it 🧚

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
hdr |V=2|P|    RC   |   PT=IJ=195   |             length            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                      inter-arrival jitter                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   .                                                               .
   .                                                               .
   .                                                               .
   |                      inter-arrival jitter                     |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

so the rules, no cap 😭 this packet MUST be placed after a receiver report (inside a compound RTCP packet), and it MUST have the same value for RC (reception report count) as that receiver report. the content is exactly that many inter-arrival jitter calculations, done with the same formula as sender and receiver reports, except it takes the transmission offsets into account. so the formula uses T1=S1+O1, T2, etc. instead of S1, S2, etc. 🌸 (if there's no transmission offset info for a stream, the jitter here and in the receiver report come out identical, which is honestly so relatable πŸ™ˆ)

the exact replacement equation, where Rj is the most recent arrival time πŸ‘‘:

D(i,j) = (Rj - Ri) - ((Sj + Oj) - (Si + Oi))
       = (Rj - (Sj + Oj)) - (Ri - (Si + Oi))

5. Signaling (Setup) Information πŸŽ€

the URI for declaring this header extension in an extmap attribute is urn:ietf:params:rtp-hdrext:toffset πŸ’– and there's no extra setup info needed for it (no extensionattributes). easy peasy 🫢

6. Security Considerations πŸ”₯

okay the transmission offsets are only informative, and it's honestly hard to see security issues from linking them to media streams πŸ™ˆ

the underlying security considerations of [RFC3550] SHOULD still be taken into account, so don't skip that bestie πŸ’…

⚠️ it's possible malicious senders (or systems messing with packets in transit) could send offsets that are implausible, confuse the receiver, or produce calculated jitter values that might mislead the sender. both the sender and receiver of the transmission offsets and jitter values SHOULD take care that this doesn't lead to denial of service or other problems. this is the part where we all get serious for a sec πŸ’€

7. IANA Considerations 🌈

the RTCP packet type for the adjusted inter-arrival jitter has been registered, following Section 15 of [RFC3550] ✨ IANA added a new value to the RTCP Control Packet types subregistry of the Real-Time Transport Protocol (RTP) Parameters registry:

abbrev.  name                                  value   Reference
-------  ------------------------------------  ------  ---------
IJ       Extended inter-arrival jitter report  195     RFC 5450

and IANA also registered a new extension URI in the RTP Compact Header Extensions subregistry of the same RTP Parameters registry:

   Extension URI: urn:ietf:params:rtp-hdrext:toffset
   Description:   Transmission Time offsets
   Contact:       singer@apple.com
   Reference:     RFC 5450

8. Acknowledgments πŸ’œ

Ron Frederick, Colin Perkins, and Steve Casner all contributed substantially to this document 🫢 their help turned an idea into a whole specification, iconic behavior πŸ‘‘

9. Normative References πŸ¦‹

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

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

[RFC5285] Singer, D. and H. Desineni, "A General Mechanism for RTP Header Extensions", RFC 5285, July 2008.

Authors' Addresses πŸŽ€

David Singer Apple Computer Inc. 1 Infinite Loop Cupertino, CA 95014 US

Phone: +1 408 996 1010 EMail: singer@apple.com

Harikishan Desineni Qualcomm 5775 Morehouse Drive San Diego, CA 92121 US

Phone: +1 858 845 8996 EMail: hd@qualcomm.com

πŸ“¦ where this page comes from