PPS and selection algorithm issues
Jim Pennino
jimp at gonzo.specsol.net
Sun Sep 22 18:18:41 UTC 2024
Summary:
Ntpsec has a huge amount of jitter compared to legacy ntp and issues
with the clock selection algorithm, likely because of the jitter.
Background:
For several years I have been running 2 stratum 1 servers with legacy
ntp. One is a Pi based system with a GNSS HAT and the other is a PC
based system with Ubuntu Linux with a commercial GNSS disciplined
oscillator with a specified PPS accuracy of +/- 1 nanosecond.
An OS update to Ubuntu forced the change to ntpsec, and after some
initial issues where ntpd would just flat out not work with a refclock,
eventually patches were issued and refclock started to work, but nowhere
near as well as legacy ntp.
The version reported is ntpd ntpsec-1.2.2.
ntpq reports:
*NMEA(0) .GPS. 0 l 3 16 377 0.0000 0.2415 0.3372
xPPS(0) .PPS. 0 l 2 16 377 0.0000 -0.7080 0.0497
I have played with various settings for minsane and mindist but the 'x'
will not change to 'o'.
ntp.conf contains:
refclock nmea flag1 0 baud 9600 minpoll 4 time2 0.097
refclock pps minpoll 4 flag2 0 time1 0.002
If I try to use just the nmea driver with PPS support, everything fails.
There is an existing bug report on that.
Also the Pi based system shows a long term average jitter of around 130
microseconds and when running legacy ntp the long term average jitter
of the PC system was over an order of magnitude better, as would be
expected from a high accuracy and stability source.
Now the the long term average jitter is over an order of magnitude
larger than the Pi system.
While running legacy ntp I also had 2 ntp appliance servers with a
specified accuracy of +/- 100 nanoseconds in the configuration as legacy
ntp's selection algorithm goes wonky with less than 3 servers. Legacy
ntp would always select the GNSSDO device, as would be expected.
As ntpsec is advertised as working fine with just 1 refclock, I removed
them. I have tried putting them back in and the result was that ntpsec
would always chose one of the ntp appliances as the selected clock
likely because the jitter of the jitter of the local clock is over an
order of magnitude greater than the ntp appliances.
I have checked the OS settings and ldattach is still running and the
serial port is still set low_latency.
The OS is Ubuntu 24.04.1 LTS, the kernel is 6.8.0-45-lowlatency,
the ntpsec package is 1.2.2+dfsg1-4build2 and ntpd is ntpsec-1.2.2.
More information about the users
mailing list