[ntp:hackers] ntpdate offset from ntpd?

houston.jim at comcast.net houston.jim at comcast.net
Tue Dec 10 17:21:08 UTC 2013


On Mon, Dec 9, 2013 at 12:48 PM, John Stultz <john.stultz at linaro.org> wrote:
> Once converged, I'd expect to see the ntpdc -c peers offset stairstep
> around 0, ntpdc -c kerninfo offset jump to the peers offset then
> converge down towards 0, and the ntpdate output noisily oscillate
> around 0, possibly tracking the kerninfo lines if the noise is
> particularly low.
>
> But using a local server w/ minpoll 4 maxpoll 4 to get the noise down,
> I'm seeing the ntpdc -peers and kerninfo output as expected, but the
> strange bit is the ntpdate output seems to be consistently ~-125us
> offset from the ntpdc peers offset. So looking at a few days of data,
> I'm seeing two noisy lines oscillating around 0 +/- 100us and one
> noisy line around -125us +/- 100us.

Hi John,

I had similar expectations when I was playing with NTP.  I believe that
you are observing the effect of an error in the correction of the clock
frequency.  You should check the frequency file; maybe it is not being
updated correctly.

NTP can take days to correct for an error in the clock frequency.
I believe this is a feature and is valuable in preserving the accuracy 
when the server has a good oscillator (eg. atomic clock or even an oven
oscillator), but it is annoying with the typical oscillators in most
computers.

The way it works is most of the correction that NTP makes is proportional
to the clock error.  If the local clock frequency is correct, then the
correction will gradually bring the time into sync and the errors should
approach zero.  With a frequency error, the correction will be fighting
against the error constantly being added by the frequency error.  This
results in a balance where there is an error in the local time which is
proportional to the error in the clock frequency.  The frequency correction
is done by integrating this error over a much longer period (days).

Jim Houston


More information about the hackers mailing list