[ntp:questions] Re: Make NTP timestamps leap-second-neutral (like GPS time)

hack hack at watson.ibm.com
Wed Jan 7 21:40:04 UTC 2004

In article <bthstv$bbm$1 at news.btv.ibm.com>, hack <hack at watson.ibm.com> wrote:

>Separate, but related issue:  could the leap jiggle be avoided with the
>*current* protocol?  Perhaps, and I'll address it in another post -- even
>if it undermines my argument for revising the protocol.

Suppose the OS has full and proper support for both TAI and UTC, perhaps
in the manner suggested by Markus Kuhn, where the nanoseconds word of the
OS UTC timestamp runs from 1,000,000,000 to 1,999,999,999 during a positive
leap second.

It would then be possible to construct unambiguous NTP timestamps: those
before the LSE (Leap Second Event) would have the LSE-pending flag set,
and those after the LSE would not.  The timestamp values during the leap
second would be repeated, and disambiguated through the flags.

Then the NTP program could unambiguously translate NTP timestamps to a
leap-second-neutral format for the purpose of arithmetic, and there would
be no discontinuity to jiggle around.

I wouldn't be surprised is that isn't exactly what NTP would do in such
an environment.  The question is, what can be done if we're not there yet?

If the OS knows nothing about leap seconds, NTP could do just as I proposed
in my original post:  take full control of the leap second transition and
process timestamps before inserting them in NTP packets, so they behave as
described above.

Dave Mills suggests that OSes that do have leap second support do so in
a manner that would also allow non-disruptive TAI-based timestamps to be
generated during and after an LSE.  All I've looked at is my RedHat 9
Linux source, and observed its timekeeping relative to a TSAT-PCI GPS
clock, and relative the the Pentium's own TSC, and I was not impressed.
Perhaps I didn't look in the right places?

So, here's a simple question:  Was there an NTP jiggle problem after the
last LSE in July 1999, and is there likely to be one at the next LSE --
or have the algorithms already improved to the point that the pinball
effects described so vividly in 1994 have vanished?


More information about the questions mailing list