[ntp:questions] Extracting ntpq like information programmatically

John Hasler jhasler at newsguy.com
Sat Mar 30 12:43:23 UTC 2013


Claudio writes:
> Then why does NTP give a number to the offset and delay?

Because the information is often useful.  You can use it to evaluate
performance.  The name may be a bit misleading.  It isn't the actual
instantaneous offset: you can never know that.

> If the algorithm knows that it's lagging by X s, why doesn't it
> correct for that lag?

A few measurements don't suffice to be sure that what appears to be
offset isn't just noise.  The noise in this system has large components
at very, very low frequencies.  The simple, fast PID controller that I
think you are visualizing would just hunt like crazy.  You may want to
take a look at Dr. Mills' book.

BTW what kind of accuracy do you need and how quickly must your machines
converge to it?  Ntpd may not be your best choice.  It's designed to
synchronize always-on machines with relatively low drift rates over the
Internet.
-- 
John Hasler 
jhasler at newsguy.com
Dancing Horse Hill
Elmwood, WI USA



More information about the questions mailing list