idnits 2.17.1 draft-ietf-avtcore-leap-second-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC3550, updated by this document, for RFC5378 checks: 1998-04-07) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (November 15, 2013) is 3814 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 AVTCore K. Gross 3 Internet-Draft AVA Networks 4 Updates: 3550 (if approved) R. van Brandenburg 5 Intended status: Standards Track TNO 6 Expires: May 19, 2014 November 15, 2013 8 RTP and Leap Seconds 9 draft-ietf-avtcore-leap-second-06 11 Abstract 13 This document discusses issues that arise when RTP sessions span 14 Coordinated Universal Time (UTC) leap seconds. It updates RFC 3550 15 to describe how RTP senders and receivers should behave in the 16 presence of leap seconds. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on May 19, 2014. 35 Copyright Notice 37 Copyright (c) 2013 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 54 3. Leap seconds . . . . . . . . . . . . . . . . . . . . . . . . 2 55 3.1. UTC behavior during positive leap second . . . . . . . . 3 56 3.2. NTP behavior during positive leap second . . . . . . . . 3 57 3.3. POSIX behavior during positive leap second . . . . . . . 3 58 3.4. Example of leap-second behaviors . . . . . . . . . . . . 4 59 4. Receiver behavior during leap second . . . . . . . . . . . . 5 60 5. Recommendations . . . . . . . . . . . . . . . . . . . . . . . 5 61 5.1. RTP Sender Reports . . . . . . . . . . . . . . . . . . . 6 62 5.2. RTP Packet Playout . . . . . . . . . . . . . . . . . . . 6 63 6. Security Considerations . . . . . . . . . . . . . . . . . . . 6 64 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 65 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 66 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 67 9.1. Normative References . . . . . . . . . . . . . . . . . . 7 68 9.2. Informative References . . . . . . . . . . . . . . . . . 7 69 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 71 1. Introduction 73 In some media networking applications, RTP streams are referenced to 74 a wall-clock time (absolute date and time). This is accomplished 75 through use of the NTP timestamp field in the RTCP sender report (SR) 76 to create a mapping between RTP timestamps and the wall clock. When 77 a wall-clock reference is used, the playout time for RTP packets is 78 referenced to the wall clock. Smooth and continuous media playout 79 requires a smooth and continuous time base. The time base used by 80 the wall clock may include leap seconds which are not rendered 81 smoothly. 83 This document updates RFC 3550 [1] providing recommendations for 84 smoothly rendering streamed media referenced to common wall clocks 85 which do not have smooth or continuous behavior in the presence of 86 leap seconds. 88 2. Terminology 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in RFC 2119 [2] and 93 indicate requirement levels for compliant implementations. 95 3. Leap seconds 96 The world scientific time standard is International Atomic Time (TAI) 97 which is based on vibrations of cesium atoms in an atomic clock. The 98 world civil time is based on the rotation of the Earth. In 1972 the 99 civil time standard, Coordinated Universal Time (UTC), was redefined 100 in terms of TAI and the concept of leap seconds was introduced to 101 allow UTC to remain synchronized with the rotation of the Earth. 103 Leap seconds are scheduled by the International Earth Rotation and 104 Reference Systems Service. Leap seconds may be scheduled at the last 105 day of any month but are preferentially scheduled for December and 106 June and secondarily March and September.[6] Because Earth's rotation 107 is unpredictable, leap seconds are typically not scheduled more than 108 six months in advance. 110 Leap seconds do not respect local time and always occur at the end of 111 the UTC day. Leap seconds can be scheduled to either add or remove a 112 second from the day. A leap second that adds an extra second is 113 known as a positive leap second. A leap second that skips a second 114 is known as a negative leap second. All leap seconds since their 115 introduction in 1972 have been scheduled in June or December and all 116 have been positive. 118 NOTE- The ITU is studying a proposal which could eventually eliminate 119 leap seconds from UTC. As of January 2012, this proposal is expected 120 to be decided no earlier than 2015.[7] 122 3.1. UTC behavior during positive leap second 124 UTC clocks feature a 61st second at the end of the day when a 125 positive leap second is scheduled. The leap second is designated 126 "23h 59m 60s". 128 3.2. NTP behavior during positive leap second 130 Under NTP[8] a leap second is inserted at the beginning of the last 131 second of the day. This results in the clock freezing or slowing for 132 one second immediately prior to the last second of the affected day. 133 This results in the last second of the day having a real-time 134 duration of two seconds. Timestamp accuracy is compromised during 135 this period because the clock's rate is not well defined. 137 3.3. POSIX behavior during positive leap second 139 The POSIX standard [3] requires that leap seconds be omitted from 140 reported time. All days are defined as having 86,400 seconds but the 141 timebase is defined to be UTC, a leap-second-bearing reference . 142 Implementors of POSIX systems are offered considerable latitude by 143 the standard as to how to map POSIX time to UTC. 145 In many systems leap seconds are accommodated by repeating the last 146 second of the day. A timestamp within the last second of the day is 147 therefore ambiguous in that it can refer to a moment in time in 148 either of the last two seconds of a day containing a leap second. 150 Other systems use the same technique used by NTP, freezing or slowing 151 for one second immediately prior to the last second of the affected 152 day. 154 In some cases [5] [4] leap seconds are accommodated by warping time, 155 slightly altering the length of the second in the vicinity of the 156 leap second. 158 3.4. Example of leap-second behaviors 160 Table 1 illustrates the positive leap second that occurred June 30, 161 2012 when the offset between International Atomic time (TAI) and UTC 162 changed from 34 to 35 seconds. The first column shows RTP timestamps 163 for an 8 kHz audio stream. The second column shows the TAI 164 reference. Following columns show behavior for the leap-second- 165 bearing wall clocks described above. Time values are shown at half- 166 second intervals. 168 +-------+--------------+--------------+--------------+--------------+ 169 | RTP | TAI | UTC | POSIX | NTP | 170 +-------+--------------+--------------+--------------+--------------+ 171 | 8000 | 00:00:32.500 | 23:59:58.500 | 23:59:58.500 | 23:59:58.500 | 172 | 12000 | 00:00:33.000 | 23:59:59.000 | 23:59:59.000 | 23:59:59.000 | 173 | 16000 | 00:00:33.500 | 23:59:59.500 | 23:59:59.500 | 23:59:59.500 | 174 | 20000 | 00:00:34.000 | 23:59:60.000 | 23:59:59.000 | 00:00:00.000 | 175 | 24000 | 00:00:34.500 | 23:59:60.500 | 23:59:59.500 | 00:00:00.000 | 176 | 28000 | 00:00:35.000 | 00:00:00.000 | 00:00:00.000 | 00:00:00.000 | 177 | 32000 | 00:00:35.500 | 00:00:00.500 | 00:00:00.500 | 00:00:00.500 | 178 +-------+--------------+--------------+--------------+--------------+ 180 Table 1 182 NOTE- Some NTP implementations do not entirely freeze the clock while 183 the leap second is inserted. Successive calls to retrieve system 184 time return infinitesimally larger (e.g. 1 microsecond or 1 185 nanosecond larger) time values. This behavior is designed to satisfy 186 assumptions applications may make that time increases monotonically. 187 This behavior occurs in the least-significant bits of the time value 188 and so is not typically visible in the human-readable format shown in 189 the table. 191 NOTE- POSIX implementations vary. The implementation shown here 192 repeats the last second of the affected day. Other implementations 193 mirror NTP behavior or alter the length of a second in the vicinity 194 of the leap second. 196 4. Receiver behavior during leap second 198 Timestamps generated during a leap second may be ambiguous or 199 interpreted differently by sender and receiver or interpreted 200 differently by different receivers. 202 Without prior knowledge of leap-second schedule, NTP servers and 203 clients may become offset by exactly one second with respect to their 204 UTC reference. This potential discrepancy begins when a leap second 205 occurs and ends when all participants receive a time update from a 206 server or peer. Depending on the system implementation, the offset 207 can last anywhere from a few seconds to a few days. A long-lived 208 discrepancy can be particularly disruptive to RTP operation. 210 These discrepancies, depending on direction, may cause receivers to 211 think they are receiving RTP packets after they should be played or 212 to attempt to buffer received data an additional second before 213 playing it. Either situation can cause an interruption in playback. 214 Some receivers may automatically recognize an unexpected offset and 215 resynchronize to the stream to accommodate it. Once the offset is 216 resolved, such receivers may need to resynchronize again. 218 5. Recommendations 220 Senders and receivers which are not referenced to a wall clock are 221 not affected by issues associated with leap seconds and no special 222 accommodation is required. 224 RTP implementation using a wall-clock reference is simplified by 225 using a clock with a timescale which does not include leap seconds. 226 IEEE 1588,[9] GPS [10] and other TAI [11] references do not include 227 leap seconds. NTP time, operating system clocks and other UTC 228 references include leap seconds. 230 All participants working to a leap-second-bearing reference SHOULD 231 recognize leap seconds and have a working communications channel to 232 receive notification of leap-second scheduling. Note that a working 233 communication channel includes a protocol means of notifying clocks 234 of an impending leap second such as the Leap Indicator in the NTP 235 header [8] but also a means for top-tier clocks to receive leap- 236 second schedule information published by the International Earth 237 Rotation and Reference Systems Service. [12] 239 Because of the timestamp ambiguity, positive leap seconds can 240 introduce and the inconsistent manner in which different systems 241 accommodate positive leap seconds, generating or using NTP timestamps 242 during the entire last second of a day on which a positive leap 243 second has been scheduled SHOULD be avoided. Note that the period to 244 be avoided has a real-time duration of two seconds. In the Table 1 245 example, the region to be avoided is indicated by RTP timestamps 246 12000 through 28000 248 Negative leap seconds do not introduce timestamp ambiguity or other 249 complications. No special treatment is needed to avoid ambiguity 250 with respect to RTP timestamps in the presence of a negative leap 251 second. 253 POSIX clocks which use the a warping technique to accommodate leap 254 seconds (e.g. [5] [4]) are not a good choice for an interoperable 255 timestamp reference and SHOULD be avoided for this application. 257 5.1. RTP Sender Reports 259 RTP Senders working to a leap-second-bearing reference SHOULD NOT 260 generate sender reports containing an originating NTP timestamp in 261 the vicinity of a positive leap second. To maintain a consistent 262 RTCP schedule and avoid the risk of unintentional timeouts, such 263 senders MAY send receiver reports in place of sender reports in the 264 vicinity of the leap second. 266 For the purpose of suspending sender reports in the vicinity of a 267 leap second, senders MAY assume a positive leap second occurs at the 268 end of the last day of every month. 270 Receivers working to a leap-second-bearing reference SHOULD ignore 271 timestamps in any sender reports generated in the vicinity of a 272 positive leap second. 274 For the purpose of ignoring sender reports in the vicinity of a leap 275 second, receivers MAY assume a positive leap second occurs at the end 276 of the last day of every month. 278 5.2. RTP Packet Playout 280 Receivers working to a leap-second-bearing reference SHOULD take both 281 positive and negative leap seconds in the reference into account in 282 determining playout time based on RTP timestamps for data in RTP 283 packets. 285 6. Security Considerations 287 RTP streams using a wall-clock reference as discussed here present an 288 additional attack vector compared to self-clocking streams. 290 Manipulation of the wall clock at either sender or receiver can 291 potentially disrupt streaming. 293 For an RTP stream operating to an leap-second-bearing reference to 294 operate reliably across a leap second, sender and receive must both 295 be aware of the leap second. It is possible to disrupt a stream by 296 blocking or delaying leap second notification to one of the 297 participants. Streaming can be similarly affected if one of the 298 participants can be tricked into believing a leap second has been 299 scheduled where there is not one. These vulnerabilities are present 300 in RFC 3550 [1] and these new recommendations neither heighten or 301 diminish them. Integrity of the leap second schedule is the 302 responsibility of the operating system and time distribution 303 mechanism both of which are outside the scope of RFC 3550 [1] and 304 these recommendations. 306 7. IANA Considerations 308 This document has no actions for IANA. 310 8. Acknowledgements 312 The authors would like to thank Steve Allen for his valuable comments 313 in helping to improve this document. 315 9. References 317 9.1. Normative References 319 [1] Schulzrinne, H., Casner, S., Frederick, R., and V. 320 Jacobson, "RTP: A Transport Protocol for Real-Time 321 Applications", STD 64, RFC 3550, July 2003. 323 [2] Bradner, S., "Key words for use in RFCs to Indicate 324 Requirement Levels", BCP 14, RFC 2119, March 1997. 326 9.2. Informative References 328 [3] IEEE, "IEEE Standard for Information Technology - Portable 329 Operating System Interface (POSIX)", IEEE Standard 330 1003.1-2008, 2008, . 333 [4] Google, Inc., "Time, technology and leaping seconds", 334 September 2011, . 337 [5] Kuhn, M., "Coordinated Universal Time with Smoothed Leap 338 Seconds (UTC-SLS)", draft-kuhn-leapsecond-00 (work in 339 progress), January 2006. 341 [6] ITU, "Standard-frequency and time-signal emissions", ITU-R 342 TF.460-6, February 2002, 343 . 345 [7] ITU, "Question 236/7", February 2012, 346 . 348 [8] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 349 Time Protocol Version 4: Protocol and Algorithms 350 Specification", RFC 5905, June 2010. 352 [9] IEEE, "IEEE Standard for a Precision Clock Synchronization 353 Protocol for Networked Measurement and Control Systems", 354 IEEE Standard 1588-2008, July 2008, . 357 [10] Global Positioning Systems Directorate, "Navstar GPS Space 358 Segment/Navigation User Segment Interfaces", September 359 2011, . 361 [11] Bureau International des Poids et Mesures (BIPM), 362 "International Atomic Time", November 2013, 363 . 365 [12] International Earth Rotation and Reference System Service, 366 "Bulletin C", November 2013, . 369 Authors' Addresses 371 Kevin Gross 372 AVA Networks 373 Boulder, CO 374 US 376 Email: kevin.gross@avanw.com 377 Ray van Brandenburg 378 TNO 379 Brassersplein 2 380 Delft 2612CT 381 the Netherlands 383 Phone: +31-88-866-7000 384 Email: ray.vanbrandenburg@tno.nl