[ntp:questions] Re: Reading time offset from ntp variables using ntpq

Richard B. Gilbert rgilbert88 at comcast.net
Thu Feb 16 15:13:22 UTC 2006

Daniel Kabs wrote:

> Hello David!
>  > As to which timestamp is "correct" you will need to read the
>  > architecture briefing on the NTP project page.
> That's not fair. I just wanted to use NTP as a tool to measure the time 
> drift of my system clock and now you pull the dreaded "read the 
> architecture briefing" weapon on me. What have I done to you to deserve 
> this? :-)
>  > While at it, understand
>  > the raw offset measurement does not reflect the actual clock offset,
>  > as the latter is determined by the clock discipline algorithm
>  > described in  the briefings on the project page. [...]
> You are talking about "clock discipline". That's confusing me as I am 
> running ntpd using option "disable ntp" which (according to your 
> implementation documentation) should disable time and frequency discipline.
> Cheers
> Daniel

You could probably use any of the four time stamps if you measure over a 
long enough period.

The four timestamps are:
Reference: the time the local clock was last set. (This makes no sense 
to me but that's what the RFC says!  It would make more sense if it were 
the time the reply was received by the client.)
Originate: the time the request packet left your system
Receive: the time the request packet arrived at the server
Transmit: the time the reply packet departed the server

I would guess that the transmit timestamp would provide the best 
accuracy if you have to measure over a short interval.  Since the drift 
of your local clock is changing constantly, if slowly, I would recommend 
measuring over an interval of at least twenty-four hours.

If the environment in which your devices are used is not similar in 
temperature and temperature variation, the whole effort is probably a 
waste of time!!

More information about the questions mailing list