NTPD(8) Clockwatcher's Programming Manual NTPD(8)
NAME
ntpd - time synchronization daemon implementing NTP
SYNOPSIS
/usr/libexec/ntpd [-a threshold] [-c file] [-d] [-D level]
[-l] [-n] [-s] [-t]
OPTIONS
-a threshold is used to set the threshold which limits how
far ntpd will change the system clock. Its used as a sort
of ultimate sanity check to prevent your system time from
being changed a great deal. By default, the threshold is
1000 seconds. threshold is to be specified in units of
seconds, or the string any to defeat the sanity check.
-c config-file can be used to specify the location of the
ntpd configuration file. By default, /etc/ntp.conf is
used.
-d will bump the debug level by one. May be specified
more than once to increment debug level by one each time.
Has no effect if ntpd has not been compiled with DEBUG
defined.
-D level will set the debug level to the value specified.
-l will cause ntpd to log a message each time the logical
clock is changed. Normally, you would not specify this
option unless you wanted to gather statistical informa-
tion to analyze the logical clock behavior. If the -l
option is specified, a message will be logged approxi-
mately every 2 minutes.
-n will, on Ultrix systems, inhibit the ntpd program from
being swapped. This is a desirable thing to do when in
the diskless workstation environment.
-s will cause ntpd to never adjust the the local clock.
-t will cause ntpd to modify the value of tickadj in your
kernel. This will have no effect unless ntpd was compiled
with SETTICKADJ defined. This is an ugly thing to do, and
idealy you should set the value of tickadj in your kernel
configuration to the correct value.
DESCRIPTION
NTPD is the network time synchronization daemon and is
normally invoked at boot time from the /etc/rc(8) file.
It implements a new revision of the Network Time Protocol
first described in RFC-958. It maintains the host's time
synchronized with a set of distributed time servers, each
with varying accurracy and reliability. Multiple time
server masters may exist, but there is no requirement for
LOCAL 9 December 1988 1
NTPD(8) Clockwatcher's Programming Manual NTPD(8)
election of a single master.
Ntpd uses the adjtime(2) system call to slew the clock of
the host by small amount in order to keep the clock syn-
chronized. If the local clock exceeds the ``correct''
time by some threshold, then settimeofday(2) is used to
make a step adjustment of the local clock.
When ntpd(8) is started on the machine, it reads configu-
ration information from /etc/ntpd.conf which contains
information about other ntp time servers and host specific
information. Configuration information is listed one
entry per line, with fields separated by whitespace.
Lines which begin with a ``#'' character are treated as
comments. Here is a sample configuration file:
#
# Local clock parameters
#
# Precision of the local clock to the nearest power of 2
# ex.
# 60-HZ = 2**-6
# 100-HZ = 2**-7
# 1000-HZ = 2**-10
precision -7
#
tickadj 5
#
peer foo.umd.edu
peer 192.5.39.94
peer bar.arpa
server bogon.umd.edu
passive bozo.umd.edu
#
# Configure a reference clock.
# device refid stratum precision type
# ------- ----- ------- --------- ----
peer /dev/tty03 WWV 1 -5 psti
# peer /dev/null LOCL 1 -5 local
There are two major types of information specified in the
configuration file: local host information, and remote
timer server specification. The local host information is
used to describe the intrinsic properties of the local
host's timekeeping machinary. The commands in this group
are precision, and tickadj.
The precision command takes a number which describes the
resolution of the local clock, as a power of two. For
example, a VAX system typically has a 100 HZ clock and
thus a precision of -7. If the symbol hz is defined in
the namelist of /bsd, this value is automatically set
based on the value of hz.
LOCAL 9 December 1988 2
NTPD(8) Clockwatcher's Programming Manual NTPD(8)
The tickadj command is used to specify the granularity of
clock adjustment done by the adjtime(2) system call. If
the -t option is specified when ntpd is invoked, the ker-
nel variable _tickadj is modified via /dev/kmem. The pre-
ferred method of setting tickadj is by changing the value
in the kernel file conf.c instead of having ntpd set in
this rude fashion. On a VAX, a value of 1 is usually
used. See the README file for typical values of tickadj on
various hardware platforms.
The driftfile command can be used to specify the name of
the file that the drift compensation register will be
loaded from at initialization time and that updated values
will be written into. The drift compensation value
describes the intrinsic drift of your host's clock. By
default, the file /etc/ntp.drift will be used.
Currently three time server specifications are supported.
They are peer, server and passive. Each command takes
either a dotted-quad internet address or a host name.
Each host specified in any one of the three commands is
elligable to be synchronized to, while random hosts which
set up a peer relationship are not. The peer and server
commands create an active polling situation; in the case
of peer, the NTP packets are sourced in Symmetric-Active
mode, while using server causes the packets to be in
Client mode. When reachability is lost with a configured
host in either of these two cases, the daemon will con-
tinue to poll to re-acquire that host. A host specified
in the passive command will not continue to be polled. If
that host begins to poll us, it will be eligable as to be
synchronized but will not be polled if reachability is
lost.
It is recommended that the bulk of the peers configured
should be specified with the client keyword; this will
minimize resource usage on the remote NTP server. If your
host will be serving as a redistribution point for a clus-
ter of hosts, you should set up peer relationships with
higher quality clocks (lower stratums) and other equal
stratum clocks. In other words, if you are not redis-
tributing time to others, you shouldn't need to configure
any peers in your NTP configuration; client specifications
are more appropriate.
To configure a reference clock, you should use something
like the example above. The first field after the peer
keyword is the name of the file that the clock is con-
nected to. This must be a complete path name with a lead-
ing / character. The next field is the reference-id that
will be inserted into the packets generated from this NTP
daemon. For a PSTI clock, this should be WWV. The next
field is the stratum of the clock. Actually, it is really
the stratum that will be placed in the packet if this
LOCAL 9 December 1988 3
NTPD(8) Clockwatcher's Programming Manual NTPD(8)
clock is selected by the local NTP daemon as the reference
clock. Following that is the precision that will be
inserted into the packet when this clock is selected. The
final field is the type of the clock. Currently, two
types are supported: psti for the Precision Standard Time,
Inc WWV clock (RIP) and local for the local time of the
system. The local type of clock can be used to declare
one host in an isolated network as having the "correct"
time and then the other hosts on that network can synchro-
nized to it.
The reference clock feature is new and will probably be
enhanced in the future.
NOTES
Please choose your NTP peers carefully; send mail to
ntp@TRANTOR.UMD.EDU for assitance.
BUGS
No doubt.
FILES
/etc/ntp.conf NTP daemon configuration file
SEE ALSO
adjtime(2), settimeofday(2), RFC-958, Network Time Proto-
col (Version 2) Specification and Implementation, Revised
15 April 1988, David L. Mills, University of Delaware
AUTHORS
Louis A. Mamakos, louie@TRANTOR.UMD.EDU
Michael G. Petry, petry@TRANTOR.UMD.EDU
The University of Maryland, Computer Science Center.
LOCAL 9 December 1988 4