[ntp:questions] Using ntpdate -b SERVER shortly after SERVER boots

Steve Kostecke kostecke at ntp.isc.org
Sat Feb 10 02:16:02 UTC 2007


On 2007-02-08, Donald Murray, P.Eng. <donaldm314 at gmail.com> wrote:

> How quickly can an isolated ntp server respond to 'ntpdate' queries
> after the server starts?

Based on the tests I just ran it takes 3 poll periods (i.e. 3 * 64
seconds or 3 minutes and 12 seconds) after ntpd is started. This is with
a "good" drift.file.

BTW: As astute reader will note that this is shorter than the LocalCLK
sync time I've mentioned in the past.

> We have thousands of isolated remote networks which have no reliable
> source of time. At each site we have one Linux machine which acts as
> the ntp server (let's call it SERVER). Our users are able to set the
> clock on this ntp server, based on eyeball-and-wristwatch. Yuck.

Changing the clock while ntpd is running is not a good idea. ntpd will
attempt to "correct" the observed change in the clock.

ntpd should be stopped, the clock adjusted, and then ntpd can be
started.

> SERVER config:
> server  127.127.1.0     # local clock
> fudge   127.127.1.0 stratum 10
> driftfile /etc/ntp/drift
> authenticate no

Disabling authentication makes it possible for anyone with ntpdc to
tinker remotely with this ntpd.

> One of the ntp clients is a second Linux machine (let's call it
> CLIENT), connected to the server via a PPP link over a radio. ...
> Power at these sites is atrocious at best (frequent brown-outs,
> black-outs, etc.), and lightning strikes are not uncommon.
>
> CLIENT config: server 10.0.0.2 # SERVER

You should append 'iburst' to the 'server 10.0.0.2' line. This causes
the first 8 polls to SERVER to be sent at 2 second intervals and will
allow the CLIENT to sync to SERVER in ~ 20 seconds.

> We're running 4.1.0 ntpd on 2.4.22 kernels. Since there are thousands
> of remote sites, upgrading ntpd would be prohibitively expensive.
> Adding a GPS refclock is also out of the question.
>
> When CLIENT's PPP link comes up we run the deprecated 'ntpdate -b
> SERVER'. This works fine as long as ntpd on SERVER has been running
> for a while; otherwise we get the usual:
> no server suitable for synchronization found

Again, you should not change the clock while ntpd is running. When the
ppp link comes up you should stop ntpd, run ntpdate, and then start
ntpd.

> Is there anything I can do to SERVER's ntp config to encourage it to
> respond to remote ntpdate queries more quickly on startup?

As I understand it, there is no configuration setting to do what you
want. You would have to modify ntpd.

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




More information about the questions mailing list