[ntp:questions] Leap second functional question

Dean Weiten dmw at weiten.com
Sun Feb 17 21:04:48 UTC 2008


Hi there,

I've dug a bit for the answer to this question, but have not yet see the 
answer.  Perhaps it is buried somewhere that I haven't found it yet.

Exactly what is the specified behaviour for transmission of the NTP 
protocol around a leap second event?

1. Leap second indicator: shows leap second pending
    - how far in advance of the leap second does it start showing it 
pending?  One minute?  One hour?  12 hours?  One day?
    - I assume that it turns off at the **end** of the leap second it 
announces, correct?

2. NTP timestamp: shows seconds since 1900-01-01 00:00:00
    - is this value corrected for the leap second event?  Or does it 
just increase monotonically right on through, expecting the "listener" 
to correct for the leap second?

Contrived Example - Adding a Leap Second
========================================
As an example, let's say that there was a leap second to be added on 
2008-02-10 at 23:59:59 (hmm, or is that 2008-02-11 at 00:00:00?).  This 
is a contrived example, for sure, but it's a value for which I have the 
timestamp worked out.

If the leap second indicator bits turn off at the **end** of the leap 
second it announces, and if the timestamp increases monotonically right 
through, then the values returned in this contrived example might look 
like this:

Time                        Timestamp           Leap Second Bits
----                        ---------           ----------------
2008-02-10 23:59:58.0000    CB5A0E7E.00000000        01
2008-02-10 23:59:59.0000    CB5A0E7F.00000000        01
2008-02-10 23:59:59.5000    CB5A0E7F.80000000        01
2008-02-10 23:59:59.9000    CB5A0E7F.E6666666        01
2008-02-10 23:59:60:0000    CB5A0E80.00000000        01
2008-02-10 23:59:60.5000    CB5A0E80.80000000        01
2008-02-10 23:59:60.9000    CB5A0E80.E6666666        01
2008-02-11 00:00:00.0000    CB5A0E81.00000000        00
2008-02-11 00:00:01.0000    CB5A0E82.00000000        00

Contrived Example - Deleting a Leap Second
==========================================
Another contrived example, let's say that there was a leap second to be 
removed on 2008-02-11 at 00:00:00 (or is that 2008-02-10 at 23:59:59?).

Then the values returned in this contrived example might look like this:

Time                        Timestamp           Leap Second Bits
----                        ---------           ----------------
2008-02-10 23:59:58.0000    CB5A0E7E.00000000        01
2008-02-10 23:59:58.5000    CB5A0E7E.80000000        01
2008-02-10 23:59:58.9000    CB5A0E7E.E6666666        01
2008-02-11 00:00:00.0000    CB5A0E7F.00000000        00
2008-02-11 00:00:01.0000    CB5A0E80.00000000        00

Is this correct?  Or, can you mark up my examples to show how I might be 
in error?

Regards,

Dean Weiten.




More information about the questions mailing list