[ntp:questions] NTP settings for machine with irregular, short connections to the Net

Steve Kostecke kostecke at ntp.org
Sat Sep 8 14:08:09 UTC 2007


On 2007-09-07, Rikishi 42 <fsck_spam at telenet.be> wrote:

> The precision desired here is one of human scale, not milliseconds (or
> worse).

Please define "human scale".

> Imagine a little network, with only a few machines. This LAN is never
> connected to the Net.

A network connection is not the only way to acquire the time base used
by NTP. Other sources include GPS/WWBV/CHU/MSF/DCF77/etc receivers,
high quality external oscillators, and even a serial link (using the
dumbclock driver).

It is also possible, with a bit of work, to manually adjust the clock
frequency. Depending on your requirements this may be Good Enough (tm).

> Imagine a laptop, connected to the net only once every few (2-3)
> weeks. The connection lasts a few hours, maybe less. It gets it's time
> updated from the NTP server from the ISP.

Ntpd doesn't merely "update" the laptop's clock to the "correct time".

The laptop's clock is disciplined (e.g. steered) to bring it in
synchronization with a time base; in this case the time base is UTC
acquired via the ISP's NTP server. If the laptop's clock is more than
128ms "off" it is stepped to the "correct time". If the laptop's clock
is less than 128ms "off" it is slewed (i.e. the clock frequency is
slightly increased or decreased) to bring it closer to the "correct
time".

The clock frequency needed to keep the laptop's clock synchronized to
the chosen will vary based on a number of factors which include the
laptop's operating environment, system load, and so on.

> This laptop is 'brought back' to that isolated LAN, and subsequently
> used as NTP reference to synchronise and update the time of the other
> machines.

Is the laptop actually moved and is it kept running when it is moved?

> Obviously, the time of that laptop will have shifted in between
> connections to the Net.

That's because the laptop's clock, which is worse than the average wrist
watch, is not being provided with a stable time base.

> What can be done to get it's time sync'ed as fast as possible,

1. You need to have a drift file that contains an accurate frequency.

2. You need to append 'iburst' to the server lines in the laptop's
ntp.conf. 

3. When you connect the laptop to the Intenet:

	* stop ntpd
	* run 'ntpd -gq' or 'ntpdate' (deprecated)
	* start ntpd

This should give you initial synchronization well within 1 minute.

> and then become stable as quickly as possible?

That depends on the factors which can affect the clock.

If the laptop's ambient environment and operating state are largely the
same regardless of which network (i.e. LAN or Internet) it is connected
to AND the drift file contains an accurate frequency THEN you should
have acceptable stability almost immediately.

-- 
Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/




More information about the questions mailing list