📜 ⬆️ ⬇️

Leap second day today

In the previous post I already touched upon the topic of the second coordination and preparation for it. Since today is the very day when it will be brought in, I would like to go over this topic again to remind you how to make sure that this situation will be correctly handled. Welcome under cat.

And so, the correctly configured Stratum 1 ntp servers have already been sending the appropriate announcements for several hours, respectively, the situation has already “settled down”, and now you will get a clear picture when diagnosing your ntp server or client.

Announcement Verification


First of all, check that your software has correctly received and processed the announcement of the second coordination. The most universal way will be the analysis of ntp-traffic, using, for example, tcpdump . As a result, you will see something like this:
 11: 56: 41.692324 IP (tos 0xb8, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 76)
     192.168.134.4.123> 192.168.134.86.123: NTPv3, length 48
         Server, Leap indicator: + 1s (64), Stratum 1 (primary reference), poll 4s, precision -21
         Root Delay: 0.000000, Root dispersion: 0.000000, Reference-ID: GPS ^ @
           Reference Timestamp: 3550020995.728319585 (2012/06/30 11:56:35)
           Originator Timestamp: 3550021001.680305123 (2012/06/30 11:56:41)
           Receive Timestamp: 3550021001.692303419 (2012/06/30 11:56:41)
           Transmit Timestamp: 3550021001.692318439 (2012/06/30 11:56:41)
             Originator - Receive Timestamp: +0.011998336
             Originator - Transmit Timestamp: +0.012013342


Pay attention to the Leap indicator: - if everything is good, then in this field will be written "+ 1s".
If you use classic ntpd , then you can check its status by executing ntpq -c rv - the presence in the answer leap_add_sec or leap = 01 means that everything is OK.
Errors in this case can be caused by not very good choice of ntp-servers for synchronization. Unfortunately, the choice is easy to make a mistake. Among the 13 most famous Russian Stratum 1 servers at the moment only 8 correctly announce the second coordination.

Overview of Russian Stratum 1 ntp-servers

ServerThe presence of the announcement at the time of writing the post
ntp.aas.ru-
ntp.ab2b.ru+
time.bakulev.ru-
ntp.ix.ru-
ntp.mobatime.ru-
ntp0.ntp-servers.net+
ntp1.ntp-servers.net+
ntp2.ntp-servers.net+
ntp.sonur.ru+
ntp1.vniiftri.ru+
ntp2.vniiftri.ru+
ntp3.vniiftri.ru+
ntp4.vniiftri.ru-

Please use the above servers in accordance with the Rules of Engagement and the private terms of service of these servers.
')

Kernel check


If you have a unix-like operating system, it is worth checking whether ntpd could “bring” to its core the information that there will be an extra second at the end of the day. The fact is that ntpd can bring this information to the kernel if the kernel time discipline is used, that is, the set of ntp_ * calls.
In the case, if you run ntpd with the -x switch , specified tinker step step equal to 0 or more than 0.5 s, you explicitly banned kernel time discipline by disable kernel - kernel time discipline directive and the extra second in days for the kernel will be a surprise.
You can check this by running ntpdc -c kern or ntptime :
 $ ntpdc -c kern
 pll offset: 2.7e-08 s
 pll frequency: 23.073 ppm
 maximum error: 0.001501 s
 estimated error: 0 s
 status: 2011 pll ins nano
 pll time constant: 3
 precision: 1e-09 s
 frequency tolerance: 500 ppm

 $ / usr / sbin / ntptime
 ntp_gettime () returns code 1 (INS)
   time d3990b27.8eedaa5c Sat, Jun 30 2012 12: 20: 39.558, (.558314918),
   maximum error 2001 us, estimated error 0 us
 ntp_adjtime () returns code 1 (INS)
   modes 0x0 ()
   offset 0.026 us, frequency 23.073 ppm, interval 1 s,
   maximum error 2001 us, estimated error 0 us,
   status 0x2011 (PLL, INS, NANO),
   time constant 3, precision 0.001 us, tolerance 500 ppm,

The key here is the presence of the flag ins .

Updated: It is worth noting some progress in the behavior of the servers of the All-Russian Scientific Research Institute of Physicotechnical and Radio Engineering Measurements . If in 2008 they managed to click leapsecond on three servers, and on one enter leapsecond in the opposite direction, then this year only ntp4.vniiftri.ru runs for a second.

Source: https://habr.com/ru/post/146822/


All Articles