# [ntp:questions] Keeping NTP Honest Redux

Unruh unruh-spam at physics.ubc.ca
Thu Nov 12 06:21:19 UTC 2009

```David Woolley <david at ex.djwhome.demon.invalid> writes:

>Unruh wrote:
>> David Woolley <david at ex.djwhome.demon.invalid> writes:
>>
>>> Unruh wrote:
>>>> David Woolley <david at ex.djwhome.demon.invalid> writes:
>>>>
>>
>>>>> Looking at the graphs, one needs the first derivative of the rate, as well.
>>>> Why? If you want the details of how chrony works, I could supply it, but it uses
>>
>>> Because most of the time the first derivative is almost constant, which
>>> will force an adaptive linear regression to use a very short baseline.
>>
>> Sorry. If the first derivative is almost constant, chrony will grow the baseline

>I think you are talking first derivative of phase (aka frequency).  This
>is first derivative of frequency, which will mean that the first
>derivative of phase is changing rapidly.

OK. Then it depends on the size of that second derivative of the phase. Yes, the
adaptive baseline will shorten, but just to the point where the second derivative
over the baseless is a bit less than the phase fluctuations (ie the test below is
still satisfied.) If the second derivative is huge, then the baseline SHOULD be
short because the frequency is changing quickly. This is why chrony can adapt to a
rapidly changing phase, and takes less than the 10 hours that ntpd takes to
straighten out a large change in frequency (more like 15 min) without degrading
the behaviour of when the frequency is stable ( where it does much better than ntp
does in averaging out the statistical fluctuations because of its long baseline.
ntp has a constant baseline (in terms of the poll interval), and it is quite
short, meaning it does not a great job of averaging out the statistical
fluctuations, and the time scale is long leading to very slow response time (in
part because ntp throws away 80% of the measurements it makes).

>> out to its max extent (64 data points). It is only when the first derivative
>> changes rapidly that the baseline is shortened. In typical use, the baseline is
>> about 15 to 20 points.
>>
>> (chrony runs a test-- using the number of times that the residual changes sign-- to
>> determine if the linear regression is statistically good or not.
>> )
>>
>>

```