Association Management

giffrom Alice's Adventures in Wonderland, Lewis Carroll

Make sure who your friends are.

Last update: 19:43 UTC Friday, October 19, 2007


Related Links

Table of Contents


Association Modes

This page describes the various modes of operation provided in NTPv4. Details about the configuration commands and options are described on the Configuration Options page. Details about the cryptographic authentication schemes are described on the Authentication Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. While this page outlines the main issues about authenitcaion and server discovery, the details are beyond the scope of the discussion on this page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.

There are three types of associations in NTP: persistent, preemptable and ephemeral. Persistent associations are mobilized by a configuration command and never demobilized. Preemptable associations, which are new to NTPv4, are mobilized by a configuration command which includes the prempt flag and are demobilized by timeout or error or when displaced by a "better" server. Ephemeral associations are mobilized upon arrival of designated messages and demobilized only by timeout or error.

Ordinarily, successful mobilization of ephemeral associations requires the server to be cryptographically authenticated to the client. This can be done using either symmetric key or Autokey public key cryptography, as described in the Authentication Options page.

There are three principal modes of operation in NTP: client/server, symmetric active/passive and broadcast/multicast. There are three automatic server discovery schemes in NTP: broadcast, manycast and pool described on the Automatic Server Discovery Schemes page. In addition, the orphan and burst modes described on this page can be used in appropriate cases. Following is a summary of the operations in each mode.

Client/Server Mode

Client/server mode is the most common configuration in the Internet today. It operates in the classic remote-procedure-call (RPC) paradigm with stateless servers and stateful clients. In this mode a client sends a client (mode 3) request to the specified server and expects a server (mode 4) reply at some future time. In some contexts this would be described as a "pull" operation, in that the client pulls the time and related values from the server.

A client is configured in client mode using the server (sic) command and specifying the server IPv4 or IPv6 DNS name or address; the server requires no prior configuration. The iburst mode described later on this page is recommended for use by clients, as this speeds up initial synchronization from several minutes to several seconds. The burst mode described later on this page is useful to improve jitter on very noisy dial-up or ISDN network links. This mode should always be used when the maximum expected poll interval is above 1024 s.

Symmetric Active/Passive Mode

Symmetric active/passive mode is intended for configurations were a clique of low-stratum peers operate as mutual backups for each other. Each peer operates with one or more primary reference sources, such as a radio clock, or a subset of secondary servers known to be reliable and authentic. Should one of the peers lose all reference sources or simply cease operation, the other peers will automatically reconfigure so that time and related values can flow from the surviving peers to all the others in the clique. In some contexts this would be described as a "push-pull" operation, in that the peer either pulls or pushes the time and related values depending on the particular configuration.

In symmetric mode a persistent peer sends a symmetric active (mode 1) message to a specified peer. If a matching persistent association is available, the peer returns a symetric active message as well. If no matchine association is avaialable, the peer mobilizes a ephemeral associaition and returnes a symmetric passive (mode) message. Since an intruder can impersonate a symmetric active peer and inject false time values, symmetric mode should always be cryptographically validated.

A peer is configured in symmetric active mode using the peer command and specifying the other peer DNS name or IPv4 or IPv6 address. The burst and iburst modes should not be used in symmetric modes, as this can upset the intended symmetry of the protocol and result in spurious duplicate or dropped messages. In symmetric cliques it is generally best to set the maximum poll interval of each member to the same value.

Broadcast Mode

NTP broadcast and multicast modes are intended for configurations involving one or a few servers and a possibly very large client population. Broadcast mode is supported with Ethernet, FDDI and WiFi spans interconnected by hubs or switches. Ordinarily, broadcast mode does not operate beyond a level-3 router. Where service is intended beyond a level-3 router, the multicast mode described in the next section can be used.

A server is configured in broadcast mode using the broadcast command and specifying the broadcast address of a local interface. If two or more local interfaces are installed with different broadcast addresses, a broadcast command is needed for each address. This provides a way to limit exposure in a firewall, for example.

A broadcast client is configured using the broadcastclient command. While a broadcast message can be received on any interface, the restrict command described on the Access Control Options can be used to filter out unwanted addresses. Since an intruder can impersonate a broadcast or multicast server and inject false time values, broadcast mode should always be cryptographically authenticated.

In operation a broadcast server generates messages continuously at intervals by default 64 s and time-to-live by default 127. These defaults can be overriden by the minpoll and ttl commands, respectively. Not all kernels support the ttl command.

A broadcast client responds to the first message received by waiting a randomized interval to avoid implosion at the server. The client then polls the server in client/server and iburst modes in order to quickly authenticate the server, set the host clock and calibrate the broadcast message propagation delay. This normally results in a volley of eight client/server exchanges at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently.

Following the volley, the server continues in listen-only mode and sends no further messages. If for some reason the broadcast server does not respond to client messages, the client will time out and continue in listen-only mode with a default propagation delay.

Multicast Mode

NTP multicast mode can be used to extend the scope of a timekeeping subnet in two ways: multicasting and manycasting. A general discussion of IP multicast technology is beyond the scope of this page. In simple terms a host or router sending to a multicast group address expects all hosts or routers listening on this address to receive the message. There is no intrinsic limit on the number of senders or receivers and senders can be receivers and vice versa.

The IANA has assigned IPv4 multicast address 224.0.1.1 and IPv6 address FF05::101 (site local) to NTP, but these addresses should be used only where the multicast span can be reliably constrained to protect neighbor networks. In general, administratively scoped IPv4 group addresses should be used, as described in RFC-2365, or GLOP group addresses, as described in RFC-2770.

A multicast server is configured using the broadcast command, but specifying a multicast address instead of a broadcast address. A multicast client is configured using the multicastclient command specifying a list of one or more multicast addresses. Note that there is a subtle distinction between the IPv4 and IPv6 address families. The IPv4 broadcast or mulitcast mode is determined by the IPv4 class. For IPv6 the same distinction can be made using the link-local prefix FF02 for each interface and site-local prefix FF05 for all interfacesl.

By design, multicast messages travel from the sender via a shortest-path or shared spanning tree to the receivers, which may require these messages emit from one or more local interfaces. It is possible to configure multiple multicast groups using multiple broadcast or multicastclient commands. Other than these particulars, multicast messages are processed just like broadcast messages. Note that the calibration feature in broadcast mode is extremely important, since IP multicast messages can travel far different paths through the IP routing fabric than ordinary IP unicast messages.

Manycast Mode

Manycasting is a automatic discovery and configuration paradigm new to NTPv4. It is intended as a means for a multicast client to troll the nearby network neighborhood to find cooperating manycast servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. The intended result is that each manycast client mobilizes client associations with some number of the "best" of the nearby anycast servers, yet automatically reconfigures to sustain this number of servers should one or another fail. Additional information is on the Automatic NTP Configuration Options page.

The manycastclient command specifies that the host is to operate in client mode with the remote servers that are discovered as the result of broadcast/multicast messages. The client broadcasts a request message to the group address associated with the specified address and specifically enabled servers respond to these messages. The client selects the servers providing the best time and continues as with the server command. The remaining servers are discarded as if never heard.

Orphan Mode

Sometimes an NTP subnet becomes isolated from all UTC sources such as a local reference clock or Internet time server. In such cases it may be necessary that the subnet servers and clients remain synchronized to a common timescale, not necessarily the UTC timescale. Previously, this function was provided by the local clock driver to simulate a UTC source. A server with this driver could be used to syunchronize other hosts in the subnet directly or indirectly.

There are many disadvantages using the local clock driver, primarily that the subnet is vulnerable to single-point failures and multiple server redundancy is not possible. Orphan mode is intended to replace the local clock driver. It provides a single simulated UTC source with multiple servers and provides seamless switching as servers fail and recover.

A common configuration for private networks that might become isolated from UTC sources is to operate one or more core servers at the same lowest stratum to synchronize other hosts in the subnet. Good practice is to configure each core server as backup for the others using symmetric or broadcast modes. As long as at least one core server can reach a UTC source, the entire subnet can synchronize to it. However, if no UTC source is available, one of the core servers can provide a simulated UTC source for all other hosts in the subnet. However, only one core server can simulate the UTC source and all direct dependents must select the same one, called the orphan parent.

A host is enabled for orphan mode using the tos orphan stratum command, where stratum is some stratum less than 16 and greater than any anticipated stratum that might occur with configured Internet time servers. However, sufficient headroom should remain so every subnet host dependent on the orphan parent has stratum less than 16. These are the same consideration that guides the local clock driver stratum selection.

A server with no sources and operating at the orphan stratum shows offset zero, root dispersion zero and reference ID 127.0.0.1, (Unix loopback address. While primary (stratum 1) servers ordinarily show root delay zero, orphan servers show a value randomized when the association is mobilized. The orphan children; that is, those hosts operating at the orphan stratum plus one, chose the orphan parent as the orphan server with the smallest value.

For orphan mode to work well, each core server with available sources should operate at the same stratum, although the scheme works when they are not. Each potential orphan parent and each orphan child should include the same tos command in the configuration file. Each orphan child should include in the configuration file all root servers.

For example, consider a configuration where several campus secondary (stratum 2) servers are configured to use public Internet primary servers and with each other using symmetric or broadcast modes. For symmetric mode each core server is configured in symmetic-active mode with each other core server. For broadcast mode each core server is configured in both broadcast server and broadcast client modes. Orphan children operate in any mode with all core servers. Only the core servers and potential orphan children need to be enabled for orphan mode.

In normal operation subnet hosts operate below stratum 5, so the subnet is automatically configured as described in the NTP specification. If all UTC sources are lost, all core servers become orphans and the orphan children will select the same core server to become the orphan parent.

Burst Modes

There are two burst modes where a single poll event triggers a burst of eight packets at 2-s intervals instead of the normal one packet. They should be used only with the server and pool commands and not with reference clock drivers. The burst keyword sends a burst when the server is reachable, while the iburst keyword sends a burst when the server is unreachable. Each mode is independently of the other and both can be used at the same time. The calldelay command can be used to increase the interval between the first and second packets of the burst. This may be useful to allow a modem to complete a call.

In both modes received server packets update the clock filter, which select the best (most accurate) time values. When the last packet in the burst is sent, the next received packet updates the system variables and adjusts the system clock as if only a single packet exchange had occurred.

The iburst mode is useful where the system clock must be set quickly or when the network attachment requires an initial calling or training sequence. The burst is initiated only when the server first becomes reachable. This improves accuracy with intermittent connections typical of PPP and ISDN services. Outlyers due to initial dial-up delays, etc., are avoided and the client sets the clock within a few seconds after the first received packet.

The burst mode can be configured in cases of excessive network jitter or when the network attachment requires an initial calling or training sequence. The burst is initiated at each poll interval when the server is reachable. The burst does produce additional network overhead and can cause trouble if used indiscriminately. In general, It should only be used where the minimum poll interval is 10 (1024 s) or greater.