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

Miroslav Lichvar mlichvar at redhat.com
Tue Jan 28 11:52:38 UTC 2014


On Fri, Jan 24, 2014 at 10:13:15PM +0000, William Unruh wrote:
> On 2014-01-24, David Woolley <david at ex.djwhome.demon.invalid> wrote:
> > 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).

> > 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.

The synchronization distance includes also delay, dispersion and
precision, so it should never be zero and x should be real.

-- 
Miroslav Lichvar


More information about the questions mailing list