[ntp:questions] simple nt.conf cases for ntp-client

William Unruh unruh at invalid.ca
Fri Jan 24 22:13:15 UTC 2014

On 2014-01-24, David Woolley <david at ex.djwhome.demon.invalid> wrote:
> On 24/01/14 17:42, William Unruh wrote:
>> Does it use the time from that one, or some sort of "average"? Since the
>> queries of the different servers occur at different times (separated by
>> about and hour, given the initial filter  at poll 10) how does it take the averagei
>> if it uses the average?
> If there is a prefer peer and it survives, it uses that one, otherwise 
> as per clock_combine in ntp_proto.c, i.e. weighted by synchronisation 
> distance (which grows with time).
> 8,000 seconds is more like two hours.  If that poll interval is being 
> used, it is assumed that time errors don't vary much over  period 
> several times that.
I took half of that as on average the that will be the delay. 
Since the time error can certainly vary over that time, especially if
the clock drift is changing (temperature, etc) this helps make ntpd as
slow as it is in response to changes. 

> The weighting may change between versions.  This is 4.2.7p333.
>          y = z = 0;
>          for (i = 0; i < npeers; i++) {
>                  x = 1. / peers[i].synch;
>                  y += x;
>                  z += x * peers[i].peer->offset;
>          }
>          sys_offset = z / y;

So, if this is calculated immediately after a new selected-by-filter reading
comes in, x is infinity and only the latest one is used.


> Jitter code removed.

More information about the questions mailing list