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

David Woolley david at ex.djwhome.demon.co.uk.invalid
Sat Feb 2 23:07:43 UTC 2008

Unruh wrote:

> This is in the clock_filter algorithm. It selects the sample of the last 8
> which has the lowest delay (suitably aged) If that sample is the most

Yes.  That's what I am talking about.  Specifically clock_filter in

> recent, then it is actually used. Otherwise nothing is used that that
> clokck measuremnt is tossed. Once it has a measurement sucnh that the
> latest sample aslo has the least delay then that sample is passed to the
> clock selection process.

This is not what happens in RFC 1305 or ntpd 4.2.0.

> NO I am not talking about the clock selection process. It is teh

Nor am I.

> clock_filter which occurs before the clock selection algorithm comes into
> play.

  * clock_filter - add incoming clock sample to filter register and run
  *                the filter procedure to find the best sample.
          * Sort the samples in both lists by distance.
         for (i = 1; i < NTP_SHIFT; i++) {
          * If no acceptable samples remain in the shift register,
          * quietly tiptoe home leaving only the dispersion. Otherwise,
          * save the offset, delay and jitter average. Note the jitter
          * must not be less than the system precision.
         if (m == 0)
         etemp = fabs(peer->offset - peer->filter_offset[k]);
         dtemp = sqrt(peer->jitter);
         peer->offset = peer->filter_offset[k];
         peer->delay = peer->filter_delay[k];
         if (m > 1)
                 jit /= m - 1;
         peer->jitter = max(jit, SQUARE(LOGTOD(sys_precision)));


Guess I'd better check that this hasn't been broken in 4.2.4.....

There are quite a lot of changes there, but the basic structure seems to 
be the same, i.e. it is based on distance, not delay, and based on 
sorting the full list.

More information about the questions mailing list