3. Time Synchronization
ROX™ v2.2 User Guide
60
RuggedBackbone™ RX5000
3. Time Synchronization
ROX™ offers the following timekeeping and time synchronization features:
• Local hardware timekeeping and time zone management
• NTP time synchronization
3.1. NTP Fundamentals
NTP (Network Time Protocol) is an Internet protocol used to synchronize the clocks of computers
to some time reference. Variants of NTP such as SNTP (Simple NTP, a reduced functionality NTP)
and XNTP (Experimental NTP) exist. NTP itself is available in versions 3 and 4 (RuggedBackbone™
includes version 4).
NTP is a fault-tolerant protocol that allows an NTP daemon program to automatically select the best
of several available time sources, or reference clocks, to synchronize to. Multiple candidates can be
combined to minimize the accumulated error. Temporarily or permanently wrong time sources are
detected and avoided.
The NTP daemon achieves synchronization by making small and frequent changes to the router
hardware clock.
The NTP daemon operates in a client-server mode, both synchronizing from servers and providing
synchronization to peers.
If NTP has a number of servers to choose from, it will synchronize with the lowest stratum server. The
stratum is a measure of the number of servers to the (most highly accurate) reference clock. A reference
clock itself appears at stratum 0. A server synchronized to a stratum n server will be running at stratum
n + 1.
You will generally configure lower stratum NTP hosts as servers and other NTP hosts at the same
stratum as peers. If all your configured servers fail, a configured peer will help in providing the NTP
time. It is generally a good idea to configure one at least one server and peer.
The NTP daemon will know about the NTP servers and peers to use in three ways.
• It can be configured manually with a list of servers to poll,
• It can be configured manually with a list of peers to send to,
• It can look at advertisements issued by other servers on multicast or broadcast addresses.
Note that if multicasting or broadcasting is used, it is strongly recommended to enable authentication
unless you trust all hosts on the network.
NTP uses UDP/IP packets for data transfer because of the fast connection setup and response times
UDP offers. The NTP protocol uses port UDP port 123. Note that if your router employs a firewall and
acts as a client it must open UDP port 123. Additionally, if the router acts as a server the firewall must
allow connection requests on port 123 as well.
3.1.1. The NTP Sanity Limit
The NTP daemon corrects the system time through two means, “stepping” and “slewing”. If the
difference between the local clock and the reference clock chosen by NTP (the “offset”) is more than
128ms for a period of more than 900 seconds, NTP will “step” or instantaneously correct the time. If the
time difference is less than 128ms, NTP will “slew” the time by no more than 500 microseconds every
second towards the correct time, in such a way that to an application on the system, the time never
appears to be flowing backwards.