Time of Day (NTP) on Lab Solaris Computers

General Introduction

The time of day clocks on piemonte, cumiana, and monviso are maintained via NTP, the network time protocol. NTP can keep time with great accuracy and is used to synchronize time throughout much of the net.

NTP is capable of estimating network delays, compensating for drift in the local computer's clock, and behaving in a number of sophisticated ways to keep time service running and accurate.

NTP daemons on your machines can function as both clients (obtaining the current time of day from elsewhere, and updating your machine's clock) and servers (sending the current time to other clients).

In order to prevent looping conditions, the NTP demon always has a stratum number. Its stratum number is one plus its predecessor's number, to a maximum of 14 or so. Stratum 1 is usually a root node, a machine receiving its time stamp from NTIS directly, often by a special radio. There are many public stratum 2 time servers.

Stratum 15 is reserved for demons that have not initialized the time from an external source. For some time after reboot, the NTP demon is often in this state.

Configuration of NTP on our Lab Machines

Here is typical dump of time service strata, starting from monviso:

monviso.eecs.uic.edu: stratum 4
dcsgws.cs.uiuc.edu: stratum 3
ntp-0.gw.uiuc.edu: stratum 2

The NTP demon starts with a list of available time servers, specified in its configuration file /etc/inet/ntp.conf . In the above case, monviso found a suitable stratum 3 server at UIUC, which is obtaining its time from a public stratum 2 server at the same institution.

Here is a typical configuration file on one of our machines:

server systems-fe.gw.uic.edu
server ntp-2.cs.uiuc.edu
server piemonte.eecs.uic.edu

When NTP demon loses contact with (or is refused by) its chosen server, it will try the others, settling on the lowest stratum number server that works. This happens with some frequency, so the stratum number of a machine can change dynamically.

The NTP demon on piemonte is configured to be both a client (to maintain piemonte's time) and a server (to feed the time to other lab machines). Typically the other lab machines do not use piemonte, except in a pinch. But if you maintain the configuration file on piemonte then the other machines can always obtain the time there, even if their own files become obsolete.

Starting, Stopping, Tracing the NTP Demon

Solaris 7 ships with the daemon xntpd enabled. In order to enable time services on your machine, you only need to make sure there are some genuine time servers in /etc/inet/ntp.conf , then restart the demon or reboot the machine.

To restart the demon, you can log in as root then type:

# cd /etc/init.d
# ./xntpd stop
# ./xntpd start

On some machines, the ntptrace program is available. It will tell you the status of the time demon on any machine. Just type:

# ntptrace hostname

To check your own machine, the host name can be localhost

You can view NTP's activity in /var/adm/messages .

Links

To learn more about NTP and to fetch free software for various environments, you can check the NTP home page at Delaware or the time service department at the US Naval Observatory. The latter page also tells you the current time.

If NTP Is So Marvelous, Why Is The Time Wrong?

Unfortunately, due to some operating system bug, the combination of xntpd and Solaris 7 is known to often produce clock drift of several seconds per month. The demon always thinks the machine's clock is drifting, so it applies an ever-increasing correction until the next reboot.

Out of curiosity I installed ntpd (another version of the demon) on monviso. It works without drifting. However since the original xntpd is good enough for our purposes, I did not update all machines.

Home

Last Revised: 10 June 2002
Michael Glass