[ntp:questions] Sub-millisecond NTP synchronization for local network

Unruh unruh-spam at physics.ubc.ca
Thu Dec 4 21:52:34 UTC 2008


"Richard B. Gilbert" <rgilbert88 at comcast.net> writes:


>There are other tools than NTPD.  One called "chrony" MAY meet your 
>needs, or may not.  NTPD is very good at working over the Internet with 
>its unpredictable queuing delays.  Chrony, as I understand it, is not so 
>good at working over the internet.

No idea where you get this from. chrony works over the internet at least as
well as does ntpd. Its philosophy of dealing with different delays is
different than ntp's( although it can be set up to be virtually identical)


>If you can't keep your machines up 24x7, chrony MAY be a better tool. 
>It's possible that you will need something else entirely.

Possibly true. 


>You may find that a hardware reference clock; e.g. a GPS timing 
>receiver, will help.  With a GPS timing receiver, you will not be 
>dependent on the internet for time sources.  NTPD will still need about 
>thirty minutes to gain really tight synchronization.  Once gained, 
>synchronization should be stable as long as the machine is up.

Actually it is much worse than that. On my system, on bootup the clock
frequency can very by up to about 50PPM due to a Linux bug. In general it
takes ntp about 10 hours to regain tight synchronisation. (In that case it
is microsecond since it is synching to a GPS, but it is also on poll level
4 so it has lots of data and should converge faster than some other system
on poll level 6-10). David Mills has always insisted that ntpd is designed
for stable long time operation, and rapidity of response is a distant 49th
or so in priority. 


>The GPS receiver will require an antenna with an unobstructed view of 
>most of the sky.  At last reports there were something like 27 GPS 
>satellites aloft.

All you need are 3 ( or even 1 if you really know your location on the
earth). A full view is not necessary, but you should be able to see at
least about 1/3-1/2 of the sky.



>The source code for NTPD is available.  It's conceivable that you could 
>modify it to better meet your needs.  The last time I looked there were 
>about 70,000 lines of code involved.  This line count includes 
>accessories such as NTPDATE, NTPQ, etc.  It's not a project for the 
>faint hearted!

The actually meat is contained in a much smaller part-- primarily
ntp_loopfilter.c.






More information about the questions mailing list