[ntp:questions] Best ways to get the reference times from ntp

Maximilian Brehm maximilian.brehm at tu-ilmenau.de
Wed Apr 30 09:22:26 UTC 2014

On 2014-04-30, William Unruh  wrote:
 >On 2014-04-30, Maximilian
Brehm  wrote: >> >> >> Hey, >> >> for my application (external to ntpd)
I would like to extract >> the reference times of the peers ntpd
synchronizes with. Of course, >> there is ntpdc that shows me the
estimated offsets of the different >> reference clocks to the system
clock. Are there other more efficient >> ways? If not, would you
recommend me code segments in ntpd to extract >> this kind of data (by
writing the methods myself)? > >The system time of your system is the
best that ntpd can do to get the >reference times of the peers. So just
use the system time. >NOt sure what it is that you need to do this for.

This is related to another questions by me a few weeks ago. I wrote a
reference clock driver that uses a clock that only provides timestamps
relative to its starting point. It works well when setting its offset to
the system clock via CLOCK_REALTIME and clock_gettime to stabilize the
system clock. I would now like to include external ntp server. I can not
be sure that the system time is within millisecond range of the
reference time.
As far as I understood the ntp algorithms (especially
the select phase), if I continue to set the offset relative to the
system time my clock would be identified as false ticker at least in the
early phase of the algorithm. >> >> Regards >> >> >> Maximilian

[1] mailto:unruh at invalid.ca

More information about the questions mailing list