172N/A.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
172N/A.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
172N/A\fB/usr/lib/inet/ntpd\fR [\fB-46aAbdDgLmnNqvx\fR] [\fB-c\fR \fIconffile\fR]
172N/A [\fB-f\fR \fIdriftfile\fR] [\fB-k\fR \fIkeyfile\fR] [\fB-l\fR \fIlogfile\fR] [\fB-p\fR \fIpidfile\fR]
172N/AThe \fBntpd\fR program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. It is a complete implementation of the Network Time Protocol (\fBNTP\fR) version 4, but also retains compatibility with version 3, as defined by \fIRFC 1305\fR, and versions 1 and 2, as defined by \fIRFC 1059\fR and \fIRFC 1119\fR, respectively.
172N/AThe \fBntpd\fR program operates by exchanging messages with one or more configured servers at designated intervals ranging from about one minute to about 17 minutes. When started, the program requires several exchanges while the algorithms accumulate and groom the data before setting the clock. The initial delay to set the clock can be reduced using options as described in the server options page at file:///usr/share/doc/ntp/confopt.html.
3572N/AWhen the machine is booted, the hardware time of day (TOD) chip is used to initialize the operating system time. After the machine has synchronized to a \fBNTP\fR server, the operating system corrects the chip from time to time. During the course of operation if for some reason the system time is more than 1000s offset from the server time, \fBntpd\fR assumes something must be terribly wrong and exits with a panic message to the system log. If it was started via SMF, the ntp service is placed into maintenance mode and must be cleared manually. The -g option overrides this check at startup and allows \fBntpd\fR to set the clock to the server time regardless of the chip time, but only once.
172N/AUnder ordinary conditions, \fBntpd\fR slews the clock so that the time is effectively continuous and never runs backwards. If due to extreme network congestion an error spike exceeds the \fIstep threshold\fR (128ms by default), the spike is discarded. However, if the error persists for more than the \fIstepout threshold\fR (900s by default) the system clock is stepped to the correct value. In practice the need for a step is extremely rare and almost always the result of a hardware failure. With the -x option the step threshold is increased to 600s. Other options are available using the \fItinker\fR command as described in the miscellaneous options page at file:///usr/share/doc/ntp/miscopt.html.
172N/AThe issues should be carefully considered before using these options. The maximum slew rate possible is limited to 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 2000s for each second the clock is outside the acceptable range. During this interval the clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time.
172N/AThe frequency file, usually called ntp.drift, contains the latest estimate of clock frequency. If this file does not exist when ntpd is started, it enters a special mode designed to measure the particular frequency directly. The measurement takes 15 minutes, after which the frequency is set and ntpd resumes normal mode where the time and frequency are continuously adjusted. The frequency file is updated at intervals of an hour or more depending on the measured clock stability.
172N/AThe \fBntpd\fR daemon can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the Association Management page at file:///usr/share/doc/ntp/assoc.html. It normally operates continuously while monitoring for small changes in frequency and trimming the clock for the ultimate precision. However, it can operate in a one-time mode where the time is set from an external server and frequency is set from a previously recorded frequency file. A broadcast/multicast or manycast client can discover remote servers, compute server-client propagation delay correction factors and configure itself automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment.
172N/ABy default, \fBntpd\fR runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate phase/frequency-lock feedback loop. The feedback loop measures the incidental roundtrip delay jitter and oscillator frequency wander and determines the best poll interval using a heuristic algorithm. Ordinarily, and in most operating environments, the state machine will start with 64s intervals and eventually increase in steps to 1024s. A small amount of random variation is introduced in order to avoid bunching at the servers. In addition, should a server become unreachable for some time, the poll interval is increased in steps to 1024s in order to reduce network overhead. In general it is best not to force \fBntpd\fR to use specific poll intervals, allowing it to choose the best intervals based its current needs and the quality of the available servers and the clock.
172N/AIn some cases it may not be practical for \fBntpd\fR to run continuously. In the past a common workaround has been to run the \fBntpdate\fR program from a cron job at designated times. However, \fBntpdate\fR does not have the crafted signal processing, error checking and mitigation algorithms of \fBntpd\fR. The \fBntpd\fR daemon with -q option is intended to replace \fBntpdate\fR when used in this manner. Setting this option will cause \fBntpd\fR to exit just after setting the clock for the first time. The procedure for initially setting the clock is the same as in continuous mode; most applications will probably want to specify the iburst keyword with the server configuration command. With this keyword a volley of messages are exchanged to groom the data and the clock is set in about 10s. If nothing is heard after a couple of minutes, the daemon times out and exits. Eventually the \fBntpdate\fR program may be retired.
172N/AThe kernel supports a method specific to \fBntpd\fR to discipline the clock frequency. First, \fBntpd\fR is run in continuous mode with selected servers in order to measure and record the intrinsic clock frequency offset in the frequency file. It may take some hours for the frequency and offset to settle down. Then \fBntpd\fR is run in normal mode as required. At each startup, the frequency is read from the file and initializes the kernel frequency, thus avoiding the settling period.
172N/AWhen the kernel discipline is in use, the system's clock is adjusted at each system tick and thus the system clock is always as accurate as possible. When the kernel discipline is not used the clock is adjusted once each second. It is important to delete the ntp.drift file before starting \fBntpd\fR if the intrinsic frequency might have changed, such as by a motherboard swap.
172N/Aaccuracy by reducing the interval or to reduce network overhead by increasing it. However, the user is advised to carefully consider the consequences of changing the poll adjustment range from the default. It is not the case that shorter poll intervals will necessarily
172N/Alead to more accuracy. Most device drivers will not operate properly if the poll interval is less than 64 s and that the broadcast server and manycast client associations will also use the default, unless overridden. In general, it is best to let \fBntpd\fR determine the best polling interval.
172N/AIn some cases involving dial up or toll services, it may be useful to increase the minimum interval to a few tens of minutes and maximum interval to a day or so. Under normal operation conditions, once the clock discipline loop has stabilized the interval will be increased in steps from the minimum to the maximum. However, this assumes the intrinsic clock frequency error is small enough for the discipline loop correct it. The capture range of the loop is 500 PPM at an interval of 64s decreasing by a factor of two for each doubling of interval. At a minimum of 1,024 s, for example, the capture range is only 31 PPM.
172N/AIn scenarios where a considerable amount of data are to be downloaded or uploaded over bandwidth limited links, timekeeping quality can be seriously degraded due to the different delays in the two directions. In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer is in progress.
172N/AThe huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation delay when no other traffic is present. The filter maintains a shift register that remembers the minimum delay over the most recent interval measured usually in hours. Under conditions of severe delay, the filter corrects the apparent offset using the sign of the offset and the difference between the apparent delay and minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset.
172N/AThe filter is activated by the tinker command and huffpuff keyword, as described in the Miscellaneous Options page at file:///usr/share/doc/ntp/miscopt.html.
172N/AAs provided by international agreement, an extra second is sometimes inserted in Coordinated Universal Time (UTC) at the end of a selected month, usually June or December. The National Institutes of Standards and Technology (NIST) provides an historic leapseconds file at time.nist.gov for retrieval via FTP. This file, usually called ntp-leapseconds.list, is copied into the /etc/inet directory and the leapfile configuration command then specifies the path to this file. At startup, ntpd reads it and initializes three leapsecond values: the NTP seconds at the next leap event, the offset of UTC relative to International Atomic Time (TAI) after the leap and the NTP seconds when the leapseconds file expires and should be retrieved again.
172N/AIf a host does not have the leapsecond values, they can be obtained over the net using the Autokey security protocol. Ordinarily, the leapseconds file is installed on the primary servers and the values flow from them via secondary servers to the clients. When multiple servers are involved, the values with the latest expiration time are used.
172N/AIf the latest leap is in the past, nothing further is done other than to install the TAI offset. If the leap is in the future less than 28 days, the leap warning bits are set. If in the future less than 23 hours, the kernel is armed to insert one second at the end of the current day. Additional details are in the The NTP Timescale and Leap Seconds white paper at http://www.eecis.udel.edu/~mills/leap.html.
172N/AIf none of the above provisions are available, dsependent servers and clients tally the leap warning bits of surviving servers and reference clocks. When a majority of the survivors show warning, a leap is programmed at the end of the current month. During the month and day of insertion, they operate as above. In this way the leap is is propagated at all dependent servers and clients.
7416N/A/etc/inet/ntp.conf by default. This file must be readable by the user "daemon".
172N/A/var/ntp/ntp.drift by default.
172N/Aexits with a message to the system log if the offset exceeds the panic threshold, which is 1000s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
172N/ARegister as a NTP server with mDNS system. Implies that you are willing to serve time to others.
172N/ASpecify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
172N/ASpecify the directory path for files created by the statistics facility. This is the same operation as the statsdir statsdir command.
172N/AAdd a key number to the trusted key list. This option can occur more than once. This is the same operation as the trustedkey key command.
172N/AFor systems with routing socket support the scans will be performed shortly after the interface change
172N/ANormally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
172N/AThis option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
172N/ANote: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
172N/A svccfg -s svc:/network/ntp:default listprop config
172N/A svccfg -s svc:/network/ntp:default setprop \fIpropname\fP = \fIvalue\fP
172N/AA boolean which when false, prevents ntpd from allowing step larger than 17 minutes except once
172N/Awhen the system boots. The default is true, which allows such a large step once each time ntpd starts.
172N/AAn integer specifying the level of debugging requested. A zero means no debugging. The default is zero.
7416N/AA string specifying the location of the file used for log output. The default is /var/ntp/ntp.log. The
7416N/Alog file must be writable by the user "daemon" andmust be in a directory writeable by that user.
172N/AA boolean which when true, specifies that anonymous servers such as broadcast, multicast and active peers
172N/Acan be accepted without any pre-configured keys. This is very insecure and should only be used if
172N/AA boolean which when true, instructs ntpd to slew the clock as much as possible, instead of stepping the clock. It
172N/Adoes not prevent all stepping, but increases the threshold above which stepping is used. It also disables the use
466N/Aof the kernel \fBNTP\fP facility, which is incompatible with long slew times. The default is false.
4484N/AA boolean which when true, allows ntpd to step the clock once at boot, even if slew_always is true. Normally
4484N/Awhen slew_always is true ntpd will not step the clock except for very large offsets. Since the intial offset
4484N/Awhen the system is booted could be large and no applications will be running yet, this option allows one step
4484N/Aas soon as the offset is determined. If slew_always is false or if the \fBNTP\fP service is being restarted, then
172N/AA boolean which when true, causes the \fBNTP\fP service to delay coming completely on-line until after the first
172N/Atime the system clock is synchronized. This can potetially delay the system start up by a significant amount. The
7416N/AA boolean which when true, causes the \fBNTP\fP service to skip checking for the privileges that allow it to
172N/AA boolean which when true, will cause the daemon to register with the network mDNS system. The default is false.
172N/AThe system clock must be set to within 68 years of the actual time before \fBntpd\fR is started.
5005N/AThe \fBntpd\fR service is managed by the service management facility, \fBsmf\fR(7), under the service identifier:
172N/Asvc:/network/ntp:default
5005N/AAdministrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using \fBsvcadm\fR(8). The service's status can
172N/AIn contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.
172N/AVarious internal \fBntpd\fR variables can be displayed and configuration options altered while the \fBntpd\fR is running using the \fBntpq\fR and \fBntpdc\fR utility programs.
172N/AWhen \fBntpd\fR starts it looks at the value of umask, and if zero \fBntpd\fR will set the umask to 022.
7416N/AThe documentation available at /usr/share/doc/ntp is provided as is from the
7416N/AThere are two example configuration files provided, /etc/inet/ntp.client and
7416N/A/etc/inet/ntp.server. The first provides examples and some discussion around
7416N/Athe configuration information that goes into the /etc/inet/ntp.conf file. The
7416N/Aecho 'server hostname iburst' > /etc/inet/ntp.conf