[ntp:questions] Polling interval may be incorrect

Charles Elliott elliott.ch at verizon.net
Sat Nov 3 15:28:30 UTC 2012

NTPD version is 4.2.7.p310-o Oct 09 17:56:01.10 2012

For approximately 20130 observations of the time output in the clockstats
output (using the filegen week command) the average time between
observations (delta) is 15.999 seconds (taken to the precision of the
output)or 15.999153517 seconds if extended.  Plotting the difference (diff)
between GPS time and clockstats time, it appears as a sawtooth wave, and can
be seen here:
KiynY6c.  In other words, most of the time there are 16 observations of the
GPS time between clockstats outputs, except approximately every 1460
clockstats lines, when there are only 15 observations of GPS time. Here is
the actual data as an example:


Clockstats Date-Time     Delta         GPS-Str            GPS-Time

10/18/2012 2:11:45.356  00:15.999  061145.000     6:11:45.000

10/18/2012 2:12:01.355  00:15.999  061201.000     6:12:01.000

10/18/2012 2:12:17.354  00:15.999  061216.000     6:12:16.000

10/18/2012 2:12:33.353  00:15.999  061232.000     6:12:32.000


Note that the difference (diff) between clockstats time and GPS time is
0.355 ms in the second line above, and 1.354 in the third line.  Clockstats
time is the actual time the line is output.  Clockstats output is called
from the refclock_nmea receive routine, directly after the return from
refclock_receive, which sets the GPS destination time to the current system
time.  In other words, the clockstats time is within a few nanoseconds of
the GPS "packet" destination timestamp, which implies that the offset must
"jump" every 1460 polling intervals and accounts completely for the sawtooth
wave alluded to above.


For an NMEA GPS clock, the origin and destination timestamps are completely
fictitious, particularly in view of the fact that the NMEA GPS logic depends
on receiving a GPS string every second, except for an old Motorola GPS clock
which could be polled.  Why is not the solution to this problem to assume
that GPS NMEA strings are "broadcast" and process them the same way network
broadcasts are processed, which is more accurate than unicast processing?


Charles Elliott


More information about the questions mailing list