rfc-7164

RTP and Leap Seconds

K. Gross, R. Brandenburg
date2014-03 streamIETF areawit wgavtcore statusPROPOSED STANDARD pages9 canonicalhttps://www.rfc-editor.org/rfc/rfc7164 doi10.17487/RFC7164
This document discusses issues that arise when RTP sessions span Coordinated Universal Time (UTC) leap seconds. It updates RFC 3550 by describing how RTP senders and receivers should behave in the presence of leap seconds.

updates

Extracted elements (21)

design-rationale §5

POSIX clocks using time warping are explicitly discouraged for RTP timestamping because warping alters the length of a second, making the relationship between RTP timestamps and wall-clock time non-uniform and therefore non-interoperable across implementations.

rtp, realtime

design-rationale §5.1

RTP senders and receivers near a leap second should rely on internal clocks rather than RTCP sender reports to maintain synchronization, because the NTP timestamps in those reports become ambiguous or inaccurate during the two-second window surrounding a positive leap second.

rtp, ntp, realtime

design-rationale §5.1

The recommendation to assume a positive leap second at the end of every month's last day (rather than tracking the actual schedule) is a conservative simplification that avoids the need for out-of-band leap-second schedule distribution in all deployments.

rtp, realtime

interoperability-note §5

IEEE 1588, GPS, and other TAI-based clocks do not include leap seconds and require no special accommodation for RTP. NTP and OS clocks using UTC are leap-second-bearing and require the accommodations described in this document.

rtp, ntp, realtime

interoperability-note §5

Negative leap seconds do not introduce timestamp ambiguity or complications, so no special treatment is needed to avoid RTP timestamp ambiguity in their presence; however, receivers SHOULD still account for them when computing playout times.

rtp, realtime

interoperability-note §3.2

NTP inserts a leap second by freezing or slowing the clock for one second immediately prior to the last second of the affected day, making the last second have a real-time duration of two seconds and compromising timestamp accuracy during that period.

rtp, ntp, realtime

interoperability-note §3.3

POSIX systems are required to omit leap seconds from reported time, with implementations varying between repeating the last second, mirroring NTP behavior, or warping time. Timestamps within the last second of a leap-second day are therefore ambiguous.

rtp, realtime

interoperability-note §5

Some TAI-based systems (e.g., IEEE 1588, GPS) can deliver TAI-to-UTC mapping information, allowing receivers to synthesize a leap-second-bearing UTC clock. It is the timescale used, not the delivery mechanism, that determines whether a reference clock is leap-second-bearing.

rtp, ntp, realtime

interoperability-note §4

Without prior knowledge of the leap-second schedule, NTP servers and clients may become offset by exactly one second with respect to their UTC reference, with the discrepancy lasting anywhere from a few seconds to a few days and disrupting NTP-referenced RTP streams.

rtp, ntp, realtime

normative-requirement §5 MUST

All participants generating or consuming timestamps associated with a leap-second-bearing reference MUST recognize leap seconds and SHOULD have a working communications channel to receive notifications of leap-second scheduling.

rtp, ntp, realtime

normative-requirement §5.1 MAY

For the purpose of suspending or ignoring sender reports near a leap second, senders and receivers MAY assume that a positive leap second occurs at the end of the last day of every month.

rtp, ntp, realtime

normative-requirement §5 SHOULD

Generating or using NTP timestamps during the entire last second of a day on which a positive leap second has been scheduled SHOULD be avoided. The period to be avoided has a real-time duration of two seconds.

rtp, ntp, realtime

normative-requirement §5 SHOULD NOT

POSIX clocks that use a warping technique to accommodate leap seconds are not a good choice for an interoperable timestamp reference and SHOULD NOT be used to timestamp RTP streams.

rtp, realtime

normative-requirement §5.1 SHOULD

Receivers consuming leap-second-bearing timestamps SHOULD ignore timestamps in any sender reports generated in the vicinity of a positive leap second.

rtp, ntp, realtime

normative-requirement §5.2 SHOULD

Receivers consuming leap-second-bearing timestamps SHOULD take both positive and negative leap seconds in the reference into account to determine playout time based on RTP timestamps.

rtp, realtime

normative-requirement §5.1 SHOULD NOT

RTP senders using a leap-second-bearing reference SHOULD NOT generate sender reports containing an originating NTP timestamp in the vicinity of a positive leap second.

rtp, ntp, realtime

normative-requirement §5.1 MAY

To maintain a consistent RTCP schedule and avoid unintentional timeouts, senders suppressing sender reports near a leap second MAY send receiver reports in place of sender reports.

rtp, realtime

protocol-element §1

RTCP Sender Reports contain an NTP timestamp field used to create a mapping between RTP timestamps and the wall clock, enabling wall-clock-referenced playout. This mapping is the primary mechanism affected by leap seconds.

rtp, realtime

protocol-element §5

The NTP Leap Indicator in the NTP header is identified as a protocol means for notifying clocks of an impending leap second, forming part of the required communications channel for leap-second-aware RTP participants.

rtp, ntp, realtime

security-consideration §6

A stream can be disrupted by blocking or delaying leap-second notification to one participant, or by tricking a participant into believing a leap second has been scheduled when it has not. These vulnerabilities are inherited from RFC 3550 and are not introduced or worsened by this document.

rtp, security, realtime

security-consideration §6

RTP streams using a wall-clock reference present an additional attack vector compared to self-clocking streams: manipulation of the wall clock at either the sender or receiver can potentially disrupt streaming.

rtp, security, realtime