[ntp:questions] strange behaviour of ntp peerstats entries.

David L. Mills mills at udel.edu
Fri Jan 25 15:05:50 UTC 2008


You could have saved a lot of time sweating the code if you looked at 
the briefings. See especially the before and after time series and note 
the 10 dB improvement in S/N.

You might not have noticed a couple of crucial issues in the clock 
filter code.

1. The basic principle is to select the samples that have not been 
delayed in queues, leaving hopefully the ones delayed only by 
propagation. It's better to discard the others that can only result in 
less accurate measurements.

2. The filter samples are correlated only if the total span of the 
filter is less than the Allan intercept, generally assumed in the order 
of 2000 s. For poll intervals above that, the samples become 
uncorrelated, so fewer samples are used.

3. Never use an old sample, only new onese. It often happens that the 
last used minimum delay sample is older than the most recent sample. The 
result is that the filter can toss out up to seven samples before 
finding a new candidate. The clock discipline loop  is specifically 
designed to deal with that, which is one reason the time constant is 
larger than you might like.


root wrote:

> OK, having looked at the code, I see what it is doing. It essentially 
> takes the measurement with the shortest delay in the past 8 measurements.
>  If that measurement happens to be the current one, it is actually used 
> in the clock loop. (Yes, I know this characterisation of the clock filter is cruder
> than reality).
> This makes the smaller variance of chrony even more impressive, since in my
>  tests, evey single measurement of offset was used to calculate the variance 
> in the case of chrony, while
> for ntp, only those "smallest" values as reported in peerstats were used. This also 
> explains why the roundtrip variance in ntp was so much better than chrony's. 
> snip


More information about the questions mailing list