ntpd never achieves synchronized, even with PPS source; ntpdig KOD

Robin H. Johnson robbat2 at gentoo.org
Tue Dec 18 07:22:20 UTC 2018


TL;DR:
------
1. ntpdig localhost always gets KOD
2. ntpsec never gets syncronized state: ntpwait never gives success
3. local clock ends up drifting :-(

Background:
-----------
I previously had another GPS puck, without PPS, and used it with classic
ntpd; the puck eventually stopped working, and I replaced it with a
GPS+PPS u-blox puck via Mark Atwood's occasional sales.

Mark was trying to convince me to switchover to ntpsec as well, which I
didn't actually get to until recently.

However, in doing so, I found that ntpsec never gets to synchronized
state on my machine.

For the below demonstration, configuration is the stock 1.1.2:
default.conf: use-gpsd-shm, use-pool, 
              use-no-remote-configuration, use-minimal-logging

Fresh start to confirm state:
# ntpdig -s -S ca.pool.ntp.org
2018-12-17 22:44:35.987560 (+0700) +2.240546 +/- 0.019099 
ca.pool.ntp.org 129.128.12.20 s2 no-leap
CLOCK: time stepped by 2.240546
#  ntpdig -s -S ca.pool.ntp.org
2018-12-17 22:44:44.460024 (+0700) -0.000036 +/- 0.018989 
ca.pool.ntp.org 129.128.12.20 s2 no-leap
CLOCK: time stepped by -0.000036

# /etc/init.d/ntp restart
ntp | * Starting ntp ...
ntp |2018-12-18T06:45:41 ntpd[11042]: INIT: ntpd ntpsec-1.1.2 
     2018-09-30T16:42:11Z: Starting
ntp |2018-12-18T06:45:41 ntpd[11042]: INIT: Command line: 
     /usr/sbin/ntpd -p /run/ntpd.pid -g -u ntp:ntp -x -c /etc/ntp.d/default.conf [ ok ]

# ntpq -p -n ; ntpdig -ddd localhost
     remote                        refid      st t when poll reach   delay   offset   jitter
============================================================================================
+SHM(0)                       .GPS.            0 l   10   64    1   0.0000 -137.466   0.0000
*SHM(1)                       .PPS.            0 l    9   64    1   0.0000  -7.9009   0.0000
 pool.ntp.org                 .POOL.          16 p    -  256    0   0.0000   0.0000   0.0001
 158.69.125.231               173.162.192.156  2 u    -   64    1  60.8591 -11.9539   0.1667
+209.115.181.108              206.108.0.134    3 u    -   64    1  13.8295  -6.0775   0.1698
 144.217.240.204              213.251.128.249  2 u    -   64    1  61.0646  -3.8776   0.1854
 129.128.12.20                129.128.153.62   2 u    -   64    1  23.4383  -5.5400   0.3409
ntpdig: querying ::1 (localhost)
ntpdig: Sent to ::1:
e3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 df c3 16 21 47 1e a0 00 ...........!G...
e4 00 00 e8 00 00 00 00 00 07 f2 0e 44 4f 57 4e ............DOWN
df c3 16 17 60 ca 48 4e df c3 16 21 47 1e a0 00 ....`.HN...!G...
df c3 16 21 47 22 21 8e df c3 16 21 47 29 f9 0c ...!G"!....!G)..
ntpdig: querying 127.0.0.1 (localhost)
ntpdig: Sent to 127.0.0.1:
e3 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 df c3 16 21 47 1e a0 00 ...........!G...
e4 00 00 e8 00 00 00 00 00 07 f2 0e 44 4f 57 4e ............DOWN
df c3 16 17 60 ca 48 4e df c3 16 21 47 1e a0 00 ....`.HN...!G...
df c3 16 21 47 40 9a bc df c3 16 21 47 44 32 65 ...!G at .....!GD2e
ntpdig: localhost: Response dropped: stratum 0, probable KOD packet
ntpdig: localhost: Response dropped: stratum 0, probable KOD packet
ntpdig: no eligible servers

# ntpwait  -v
Waiting for ntpd to synchronize... No!
ntpd did not synchronize.
(Even after hours)

Sometime later to be sure:
#  ntpq -p -n
     remote                        refid      st t when poll reach   delay   offset   jitter
============================================================================================
xSHM(0)                       .GPS.            0 l   19   64  377   0.0000 -134.030   3.0875
*SHM(1)                       .PPS.            0 l   18   64  377   0.0000  -0.5434   4.6119
 pool.ntp.org                 .POOL.          16 p    -  256    0   0.0000   0.0000   0.0001
-158.69.125.231               173.162.192.156  2 u    -   64  377  60.9259  -3.8232   5.9141
-209.115.181.108              206.108.0.134    3 u   62   64  377  14.1186   0.8184   5.4720
+144.217.240.204              213.251.128.249  2 u   65   64  377  61.4708   2.9191   5.3575
-129.128.12.20                129.128.153.62   2 u   59   64  377  23.4129   1.3014   5.4741
+158.69.226.90                213.251.128.249  2 u    9   64  377  61.0565  -0.5469   2.7180
-149.56.111.74                138.39.23.13     2 u   10   64  377  60.7539   0.3827   2.4776
-208.81.1.244                 200.98.196.212   2 u    8   64  377  46.2660  -5.8013   2.7630
-206.108.0.131                .PPS.            1 u   13   64  377  57.2570   1.4152   2.4424


tcpdump of ntpwait -n 2:
23:17:26.828337 IP6 (flowlabel 0x5322d, hlim 64, next-header UDP (17) payload length: 20) ::1.58431 > ::1.123: [bad udp cksum 0x0027 -> 0x4506!] NTPv2, length 12
	Reserved, Leap indicator: clock unsynchronized (192), Stratum 2 (secondary reference), poll 0 (1s), precision 1
	Root Delay: 0.000000, Root dispersion: 0.000000 [|ntp]
23:17:26.828453 IP6 (class 0xb8, flowlabel 0xe50b0, hlim 64, next-header UDP (17) payload length: 380) ::1.123 > ::1.58431: [bad udp cksum 0x018f -> 0x815e!] NTPv2, length 372
	Reserved, Leap indicator: clock unsynchronized (192), Stratum 130 (reserved), poll 0 (1s), precision 1
	Root Delay: 50200.000000, Root dispersion: 0.005493, Reference-ID: 118.101.114.115
	  Reference Timestamp:  1768910397.134497907 (2092/02/26 10:28:13)
	  Originator Timestamp: 1679847028.439260803 (2089/05/01 15:38:44)
	  Receive Timestamp:    758197809.180452358 (2060/02/16 08:58:25)
	  Transmit Timestamp:   808532013.188372445 (2061/09/20 23:41:49)
	    Originator - Receive Timestamp:  -921649219.258808445
	    Originator - Transmit Timestamp: -871315015.250888358

tcpdump of ntpdig -6 ::1
23:17:56.980230 IP6 (flowlabel 0xccae7, hlim 64, next-header UDP (17) payload length: 56) ::1.49497 > ::1.123: [bad udp cksum 0x004b -> 0xe251!] NTPv4, length 48
	Client, Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 0 (1s), precision 0
	Root Delay: 0.000000, Root dispersion: 0.000000, Reference-ID: (unspec)
	  Reference Timestamp:  0.000000000
	  Originator Timestamp: 0.000000000
	  Receive Timestamp:    0.000000000
	  Transmit Timestamp:   3754106276.980171203 (2018/12/17 23:17:56)
	    Originator - Receive Timestamp:  0.000000000
	    Originator - Transmit Timestamp: 3754106276.980171203 (2018/12/17 23:17:56)
23:17:56.980341 IP6 (class 0xb8, flowlabel 0x25c82, hlim 64, next-header UDP (17) payload length: 56) ::1.123 > ::1.49497: [bad udp cksum 0x004b -> 0x47a9!] NTPv4, length 48
	Server, Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 0 (1s), precision -23
	Root Delay: 0.000000, Root dispersion: 0.033187, Reference-ID: (unspec)
	  Reference Timestamp:  3754106274.113098032 (2018/12/17 23:17:54)
	  Originator Timestamp: 3754106276.980171203 (2018/12/17 23:17:56)
	  Receive Timestamp:    3754106276.980230634 (2018/12/17 23:17:56)
	  Transmit Timestamp:   3754106276.980324170 (2018/12/17 23:17:56)
	    Originator - Receive Timestamp:  +0.000059431
	    Originator - Transmit Timestamp: +0.000152966

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robbat2 at gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1113 bytes
Desc: Digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20181218/17314fe7/attachment-0001.bin>


More information about the devel mailing list