Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ntpd stratum 1 funny offset with NetBSD 6 branch



Hi folks,

Is anyone happily running a stratum 1 NTP server with a GPS with a PPS
signal on NetBSD 6?

I've got a Garmin GPS18x on a Soekris net4801 where the GPS clock has
a funny offset.  Here's the output from "ntpq -pn":


     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.20.0    .PPS.            0 l   14   16   17    0.000  -658.75   6.388
 192.168.0.1     27.50.90.253     3 u   11   64    3    0.348   -0.594   0.166
 192.168.0.42    192.168.0.1      4 u   10   64    3    0.345    5.670   0.200
 202.191.108.73  47.187.174.51    2 u    8   64    3   30.141   -2.695   0.401
 59.167.170.228  203.35.83.242    2 u   11   64    3   55.362   -1.997   1.068
 27.50.90.253    202.46.181.123   2 u    8   64    3   36.167    0.108   0.162


The GPS clock offset appears to be reasonably random (but seems to like
between -800 and -600 more often than not), but is then pretty much
constant for each ntpd invocation.


I've thrown some debugging in ntpd, and the offset is very suspiciously
close to the time the PPS info was read from the kernel (the "now") and
not the time of the PPS timestamp (the "assert ts"):

time_pps_fetch: now = 1374192482.658097  assert ts = 1374192480.999648384
time_pps_fetch: now = 1374192484.675356  assert ts = 1374192482.990470645
time_pps_fetch: now = 1374192486.656708  assert ts = 1374192484.990341144
time_pps_fetch: now = 1374192488.659388  assert ts = 1374192487.005927355


My ntp.conf has this:

        server  127.127.20.0    mode 1          minpoll 4       maxpoll 4
        fudge   127.127.20.0    flag1 1         flag3 1         refid PPS

I've tried various modes to select different NMEA sentences without any
effect, and having flag3 (use kernel pps) set to 0 also has no effect.


With a NetBSD 5 userland and kernel, all is much happier:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.20.0    .PPS.            0 l   13   16  377    0.000    0.002   0.004
-192.168.0.42    192.168.0.1      4 u   53   64   77    0.371   -7.618   0.924
-192.168.0.1     27.50.90.253     3 u   48   64   77    0.379   -6.047   1.768
-54.252.129.186  149.20.64.28     2 u   38   64   77   33.982   -9.149   1.730
+202.125.45.77   223.252.32.9     2 u   40   64   77   47.374   -2.040   1.800
-202.191.108.72  47.187.174.51    2 u   42   64   77   29.762   -8.068   1.379


I've also tried the netbsd-5 version of ntp on netbsd-6, and that has the
same offset problem as native ntpd.

The PPS bits of the com driver and inside sys/kern don't appear to be
different in any obvious way.  I'm about to start looking at the 64-bit
time_t change.

Anyone have any ideas or suggestions?

Cheers,
Simon.


Home | Main Index | Thread Index | Old Index