NTP Network Time Protocol How To

From RidgeRun Developer Connection
Revision as of 10:04, 8 September 2010 by Tfischer (Talk | contribs)

Jump to: navigation, search

Most of the text in this How to is taken from the massively documented NTP package.


The Network Time Protocol (NTP) is widely used to synchronize a computer to Internet time servers. It can also be used as a server for dependent clients. It provides accuracies typically less than a millisecond on LANs and up to a few milliseconds on WANs.

Client / Server Configuration

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 host 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 host pulls the time and related values from the server.

Server Configuration

For a Ubuntu host acting as an NTP server,


echo "server $NTP_SERVER" > /etc/ntp.conf
echo "statsdir /tmp/ntp_statistics" >> /etc/ntp.conf
echo "driftfile /tmp/ntp_drift" >> /etc/ntp.conf
echo "iburst" >> /etc/ntp.conf

chmod ugo+r /etc/ntp.conf

Client Configuration

A target device is configured in client mode as follows

using the server (sic) command and specifying the server DNS name or IPv4 or IPv6 address; the server requires no prior configuration. The iburst option described later on this page is recommended for clients, as this speeds up initial synchronization from several minutes to several seconds. The burst option described later on this page can be useful to reduce jitter on very noisy dial-up or ISDN network links.

Ordinarily, the program automatically manages the poll interval between the default minimum and maximum values. The minpoll and maxpoll options can be used to bracket the range. Unless noted otherwise, these options should not be used with reference clock drivers.