Process Flow (Computer Network Time Synchronization)

The NTP daemon itself is an intricate, complex, real-time system program. It usually operates simultaneously with multiple servers and may have multiple clients of its own.

Process organization.

FIGURE 3.1

Process organization.

The overall organization of the processes is illustrated in Figure 3.1. For every server, there are two processes a peer process that receives and processes each packet and a companion poll process that sends packets to the server at programmed intervals. State variables and data measurements are maintained separately for each pair of processes in a block of memory containing the peer state variables. The peer and poll processes together with their variables collectively belong to an association.

We speak of mobilizing an association when it begins life and demobilizing it when its life is over. An association is mobilized either by prior configuration or by a network event, such as the arrival of an unsolicited packet or as the result of a server discovery scheme. Associations that live forever are called persistent, while others mobilized and demobilized as life continues are called preemptable or ephemeral. A careful distinction is made between the last two in how they are demobilized. A preemptable association is demobilized when discarded by the cluster algorithm, described further in this topic, after time-out. An ephemeral association is demobilized when the server has been unreachable after time-out. Note that the designations of preemptable and ephemeral are not mutually exclusive and can be applied to configured associations as well.


As each packet arrives, the server time is compared to the system clock and an offset specific to that server is determined. The system process grooms these offsets using the select, cluster, and combine algorithms and delivers a correction to the discipline process, which functions as a low-pass filter to smooth the data and close the feedback loop. The clock adjust process runs at 1-s intervals to amortize the corrections in small adjustments that approximate a continuous, monotonic clock.

The following sections describe how an NTP packet navigates these algorithms.

Next post:

Previous post: