### Undisciplined Local Clock

#### Synopsis

Address: 127.127.1.u
Reference ID: `LCL`
Driver ID: `LOCAL`

#### Description

This driver is intended for use in an isolated network where no external source of synchronization such as a radio clock or modem is available. It allows a designated time server to act as a primary server to provide synchronization to other clients on the network. Pick a machine that has a good clock oscillator (Digital machines are good, Sun machines are not) and configure it with this driver. Set the clock using the best means available, like eyeball-and-wristwatch. Then, point all the other machines at this one or use broadcast (not multicast) mode to distribute time.

Another application for this driver is if a particular server clock is to be used as the clock of last resort when all other normal synchronization sources have gone away. This is especially useful if that server has an ovenized oscillator. For this you would configure this driver at a stratum greater than any other likely sources of time (say 3 or 4) to prevent the server taking over when legitimate sources are still available.

A third application for this driver is when an external discipline source is available, such as the NIST `lockclock` program, which synchronizes the local clock via a telephone modem and the NIST Automated Computer Time Service (ACTS), or the Digital Time Synchronization Service (DTSS), which runs on DCE machines. In this case the stratum should be set at zero, indicating a bona fide stratum-1 source. In the case of DTSS, the local clock can have a rather large jitter, depending on the interval between corrections and the intrinsic frequency error of the clock oscillator. In extreme cases, this can cause clients to exceed the 128-ms slew window and drop off the NTP subnet.

In the case where a NTP time server is synchronized to some device or protocol that is not external to the NTP daemon itself, some means should be provided to pass such things as error and health values to the NTP daemon for dissemination to its clients. If this is not done, there is a very real danger that the device or protocol could fail and with no means to tell NTP clients of the mishap. When ordinary Unix system calls like `adjtime()` are used to discipline the kernel clock, there is no obvious way this can be done without modifying the code for each case. However, when a modified kernel with the `ntp_adjtime()` system call is available, that routine can be used for the same purpose as the `adjtime()` routine and in addition provided with the estimated error, maximum error, and leap-indicator values. This is the preferred way to synchronize the kernel clock and pass information to the NTP clients.

In the default mode the behavior of the clock selection algorithm is modified when this driver is in use. The algorithm is designed so that this driver will never be selected unless no other discipline source is available. This can be overridden with the `prefer` keyword of the `server` configuration command, in which case only this driver will be selected for synchronization and all other discipline sources will be ignored. This behavior is intended for use when an external discipline source controls the system clock. See the Mitigation Rules and the `prefer` Keyword page for a detailed description of the exact behavior.

The stratum for this driver is set at 5 by default, but can be changed by the `fudge` configuration command and/or the `ntpdc` utility. The reference ID is `LCL` by default, but can be changed using the same mechanisms. *NEVER* configure this driver to operate at a stratum which might possibly disrupt a client with access to a bona fide primary server, unless the local clock oscillator is reliably disciplined by another source. *NEVER NEVER* configure a server which might devolve to an undisciplined local clock to use multicast mode.

This driver provides a mechanism to trim the local clock in both time and frequency, as well as a way to manipulate the leap bits. The `fudge time1` parameter adjusts the time (in seconds) and the `fudge time2` parameter adjusts the frequency (in parts per million). Both parameters are additive and operate only once; that is, each command (as from `ntpdc`) adds signed increments in time or frequency to the nominal local clock time and frequency.

#### Operation with an External Reference Source

There are special provisions for this driver to operate in conjunction with an external reference source, such as the `LOCKCLOCK` scheme used by the NIST time servers. In such schemes the system clock is disciplined by a source external to NTP, in the `LOCKCLOCK` case an ACTS telephone modem. To support `LOCKCLOCK` the NTP distribution should be built with the `--enable-nist` parameter in the configuration phase of the build procedure. This changes the system behavior as follows:

1. The system clock is not disciplined in any way other than to call the `ntp_adjtime()` system call to obtain the kernel leap code, which becomes the driver leap code and. If the kernel leap code is 11 (not synchronized), the driver stratum is infinity; otherwise the stratum is set by the `stratum` subcommand on the `fudge` command applying to the driver.
2. The NTP algorithms operate in the normal fashion with this driver and possibly other drivers and servers; however, the local clock driver as the `prefer` peer will always be selected, even if declared falseticker by the selection algorithm or fails to survive the clustering algorithm.
3. If the driver leap code is 11, the system leap code is 11, system stratum infinity and system reference identifier `DOWN`. This provides a definitive status condition to dependent clients.

The local clock driver should be configured something like this:

`server 127.127.1.1 prefer`

`fudge 127.127.1.1 stratum 0 refid NIST`

The `prefer` keyword forces the driver to discipline the clock, even if other servers are configured and running correctly. This is convenient when a number of servers watch each other for monitoring and statistics gathering. In particular, the `peerstats` data and `sysstats` data can be collected at each server, aggregated for daily or weekly reports and sent by electric mail to a monitoring site. In addition, the full suite of cryptographic authentication algorithms is avialable to other servers and dependent clients.

#### Monitor Data

No `filegen clockstats` monitor data are produced by this driver.

#### Fudge Factors

`time1 time`
  Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
`time2 time`
  Specifies the frequency offset calibration factor, in parts per million, with default 0.0.
`stratum number`
  Specifies the driver stratum, in decimal from 0 to 15, with default 3.
`refid string`
  Specifies the driver reference identifier, an ASCII string from one to four characters, with default `LCL`.
`flag1 0 | 1`
  Not used by this driver.
`flag2 0 | 1`
  Not used by this driver.
`flag3 0 | 1`
  Not used by this driver.
`flag4 0 | 1`
  Not used by this driver.

#### Additional Information

Reference Clock Drivers