[ntp:questions] Extracting ntpq like information programmatically

unruh unruh at invalid.ca
Sun Mar 31 01:17:51 UTC 2013

On 2013-03-30, David Woolley <david at ex.djwhome.demon.invalid> wrote:
> Mischanko, Edward T wrote:
>> What can be done with ntpd's code to address the lack of speed in ramping
>> down the time constant as needed to keep up with changes in the local clock?
> The problem is that it only sees the effects and doesn't know the cause. 
>   To really speed it up, you would need to, for example, monitor the 
> temperature near the crystal, and reduce the time constant if there was 
> a sudden change.  However, if you had that parameter, you could also 
> compute a temperature compensation for the frequency and therefore do an 
> open loop correction.
> The basic question is, given only the history of the offsets, how do you 
> distinguish between a slowly increasing measurement error and a slowly 
> increasing error in the local clock time.
> I think the linear regression based systems respond faster because they 
> only use a finite amount of history.  I'm a bit wary, though of calling 
> this a distinction between IIR and FIR systems, as I suspect there are 
> IIR elements in the local clock state even in the linear regression 
> approaches.

ntpd only uses two points of history-- the last measurement used and teh
current one. But it slowly adjusts the clock. If the offset is there, it
could be because the local clock is out, or because the measurement is
bad. It will correct a bit under the assumption that the local clock is
bad, but not too much, in case it is an error. Linear regression keep a
much much longer history, and thus can better tell if the current offset
is due to local drifts or errors. It can also look at the trend of he

More information about the questions mailing list