[ntp:questions] Re: ntpd transmit timestamp precision

Brian Utterback brian.utterback at sun.removeme.com
Mon Feb 13 16:11:41 UTC 2006


Damion de Soto wrote:
> Hi,
> I was wondering if anyone knew if ntpd contained code to do this (from 
> RFC2030):
> 
>       It is advisable to fill the non-significant low order bits of the
>       timestamp with a random, unbiased bitstring, both to avoid
>       systematic roundoff errors and as a means of loop detection and
>       replay detection (see below). One way of doing this is to generate
>       a random bitstring in a 64-bit word, then perform an arithmetic
>       right shift a number of bits equal to the number of significant
>       bits of the timestamp, then add the result to the original
>       timestamp.
> 
> The ntp packets from my platform all have the same fractional seconds, 
> so I'm guessing it does not.  Is there any reason why not?
> It seems a fairly trivial change in a couple of places in ntpd/ntp_proto.c

Yes and no. If your system supports either clock_gettime or getclock,
then the code does not bother with the random bitstring, since there
are only two unused bits to set. Not worth the trouble.


-- 
blu

Quidquid latine dictum sit, altum sonatur.
----------------------------------------------------------------------
Brian Utterback - OP/N1 RPE, Sun Microsystems, Inc.
Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom




More information about the questions mailing list