[time-nuts] Tracking NTP displacement and correlation between two clients.

Bob Bownes bownes at gmail.com
Thu Oct 4 17:04:27 UTC 2012


On Thu, Oct 4, 2012 at 12:46 PM, Hal Murray <hmurray at megapathdsl.net> wrote:

>
> bownes at gmail.com said:
> > Due to reasons I really can't go into, a systems user is concerned with
> the
> > displacement of two servers from the same pair of stratum 2 NTP servers.
> <redacted>
>


> Assuming you are running the standard ntpd...  It includes all sorts of
> logging.
>
> Set up the two systems so they use each other as servers.   Turn on
> rawstats.
>  ntpd will add a line each time it exchanges a pair of packets with a
> server.
>  That line will have the IP Address and 4 time stamps.  See the
> documentation.  Details are in monopt.html  The 4 time stamps are:
>   time the request left the local system
>   time the request arrived at the remote system
>   time the response left the remote system
>   time the response arrived at the local system
>
> That looks like a bit of overkill. :)


> If you subtract the first two, you get the network transit time for the
> request packet as skewed by the clock offset.  Subtracting the last two
> gives
> you the transit time for the response packet.
>
> If you assume the network transit times are equal, you can compute the
> clock
> offset.  If you are on a LAN, the transit times will probably be tiny on
> the
> scale of 10s of ms.
>
>
In this case, the transit times should average out be very very close. The
two machines in question are plugged into adjacent network ports with the
same length of cable and the NTP server is on the same (lightly loaded) sub
net.

The problem stems from one of the two (identical) machines drifting off by
60-70 seconds per day. So a few ms here and there are ok.


How good is your connection to the big bad internet?  If you run a big
> download over a slow link, the queuing delays can confuse ntp.  You might
> want to look at the timings from your systems to the stratum-2 servers
> and/or
> from the stratum-2 servers to the outside world.
>
>
This is all relative to two internal stratum 2 servers on the same command
and control network. No large xfers allowed over it. There are physically
separate data, backup, and application networks for that.

Thanks for the suggestions folks. I'm going to look into some of the
standard ntp logging stuff as well as the scripts that John offered up. And
now, I'm probably going to have set something up to start comparing my 3
GPSDO's and their associated machines! :)

As an aside, I have seen that someone on the Raspberry Pi list has NTP
running with 1pps into the GPIO ports. I've got a stack of GPS modules in
stock with 1pps that are just itching to be tied to one of those, also in
stock. Maybe this weekend.

Bob


More information about the time-nuts mailing list