I have a Linux server which has its time synchronized to a GPS-based NTP appliance located close by. Ping times from the server to the appliance are circa 1ms, with very low jitter:
--- x.x.x.x ping statistics --- 100 packets transmitted, 100 received, 0% packet loss, time 99001ms rtt min/avg/max/mdev = 0.874/0.957/1.052/0.051 ms
However, the NTP client estimates the accuracy of time synchronization to be around 5-6ms, which seems very high given the setup:
synchronised to NTP server (x.x.x.x) at stratum 2 time correct to within 5 ms polling server every 16 s
ntpq -p gives the following:
remote refid st t when poll reach delay offset jitter ============================================================================== *x.x.x.x .PPS. 1 u 10 16 377 0.964 -0.019 0.036
Two questions:
- What may be causing the NTP client to have such low confidence in the accuracy of the synchronization?
- Is there any way to measure the actual accuracy of the synchronization, say to the nearest millisecond?
The value that
ntpstat
displays after "time correct to within" is the root dispersion + root delay / 2.ntpq -p
doesn't show the "root dispersion" runntpq -c rl
instead.Notwithstanding, it is clear that the main source of the lack of accuracy is the dispersion rather than the delay (which is only 0.964).
The dispersion is the "nominal error relative to the primary reference source." I've briefly looked through the NTPv4 RFC and this is what it has to to say:
To use rrdtool terminology dispersion isn't a gauge but rather a counter. Seeing a large value may not indicate anything is wrong.
Alas, I wasn't able to understand the ntp algorithm well enough to see how to make this number smaller. I've noticed this value is reset occasionally. I don't know why.
The reason I asked about the hardware above is because many GPS devices (stratum 0, the 'root' source) connect to the computer that then acts as the NTP server via a serial link.
Serial connections often have 1-5ms jitter on the line due to signalling overheads/interrupt waits. Hence, I'm guessing your NTP source is reading from a serial source.
There are some tweaks you may be able to perform on the serial connection to reduce jitter. Primaily, disabling FIFO may gain you decent results.
http://support.ntp.org/bin/view/Support/KnownHardwareIssues#Section_9.1.5. http://www.febo.com/time-freq/ntp/jitter/index.html
Time correct within 5 ms IS GREAT!!! 5 ms is 5 / 1000 of a second. Anything under 100 ms is easily acceptable for anything other than a small handful of situations in that case you would not be using GPS but a local atomic clock and two external reference clocks. We get within 10 ms with the ntp pool.