Ntpd
Encyclopedia
The Network Time Protocol daemon (ntpd) is an operating system daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 program that maintains the system time in synchronization with time servers using the Network Time Protocol
Network Time Protocol
The Network Time Protocol is a protocol and software implementation for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. Originally designed by David L...

 (NTP).

Description

The ntpd program is an operating system daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

 that sets and maintains the system time in synchronization with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but retains compatibility with version 3, as defined by RFC 1305, and version 1 and 2, as defined by RFC 1059 and RFC 1119, respectively. ntpd performs most computations in 64-bit floating point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...

 arithmetic and uses 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 picosecond
Picosecond
A picosecond is 10−12 of a second. That is one trillionth, or one millionth of one millionth of a second, or 0.000 000 000 001 seconds. A picosecond is to one second as one second is to 31,700 years....

s. While the ultimate precision
Precision (computer science)
In computer science, precision of a numerical quantity is a measure of the detail in which the quantity is expressed. This is usually measured in bits, but sometimes in decimal digits. It is related to precision in mathematics, which describes the number of digits that are used to express a...

 is not achievable with ordinary workstations and networks of today, it may be required with future processors and networks.

xntpd is the Network Time Protocol version three daemon software. The "x" was added to the name because the branch of code that eventually became NTPv3 was "experimental". The name of the software was changed back to "ntpd" for version four because the NTP creator, Dave Mills, decided that something probably should not be "experimental" for about twenty years without changing dramatically.

Ntpd uses a single configuration file to run the daemon in server and/or client modes. The configuration file is usually named ntp.conf and is located under the /etc directory. Other important files include the drift file, which is used by ntpd to correct for hardware clock skew in the absence of a connection to a more accurate upstream time server.

Debugging

If ntpd does not work (but is correctly configured) assuming an RFC
Request for Comments
In computer network engineering, a Request for Comments is a memorandum published by the Internet Engineering Task Force describing methods, behaviors, research, or innovations applicable to the working of the Internet and Internet-connected systems.Through the Internet Society, engineers and...

-compliant implementation, your clock may have drifted too far. If you view /var/log/ntp.log, you may see an entry similar to:
18 Aug 21:04:40 ntpd[7220]: time correction of 1738 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.
This sanity check can be overridden by adding the command-line switch "-g" when starting ntpd.
ntpd -g

To manually force the time to synchronize, use:
ntpd -q
or on older systems
ntpdate any.ntpserver.example

Note that switching time settings by large amounts may cause undefined behavior in long-running or complex processes, and is not advised for servers.

The ntpq command can be used to connect to an ntpd daemon and query it for various parameters. To show what peers are available and synchronization status try:

ntpq -p localhost

Complete NTP implementations


Simple NTP (SNTP) implementations

  • OpenNTP – A portable Simple NTPD implementation by the OpenBSD
    OpenBSD
    OpenBSD is a Unix-like computer operating system descended from Berkeley Software Distribution , a Unix derivative developed at the University of California, Berkeley. It was forked from NetBSD by project leader Theo de Raadt in late 1995...

     group
  • clockspeed – A simplest available and secure suite of NTP/SNTP client, clock skew eliminator, and precise time synchronization server and client
  • dntpd – A simple client ntpd in DragonFly BSD
    DragonFly BSD
    DragonFly BSD is a free Unix-like operating system created as a fork of FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and a FreeBSD developer between 1994 and 2003, began work on DragonFly BSD in June 2003 and announced it on the FreeBSD mailing lists on July...


Information and support

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK