Network Time Protocol

来源:百度文库 编辑:神马文学网 时间:2024/04/29 09:32:31
From Wikipedia, the free encyclopedia
Jump to:navigation,search
The five-layer TCP/IP model
5. Application layer
DHCP •DNS •FTP •Gopher •HTTP •IMAP4 •IRC •NNTP •XMPP •MIME •POP3 •SIP •SMTP •SNMP •SSH •TELNET •RPC •RTP •RTCP •TLS/SSL •SDP •SOAP •…
4. Transport layer
TCP •UDP •DCCP •SCTP •GTP •…
3. Internet layer
IP (IPv4 •IPv6) •IGMP •ICMP •RSVP •BGP •RIP •OSPF •ISIS •IPsec •ARP •RARP •…
2. Data link layer
802.11 •ATM •DTM •Ethernet •FDDI •Frame Relay •GPRS •EVDO •HSPA •HDLC •PPP •L2TP •PPTP •…
1. Physical layer
Ethernet physical layer •ISDN •Modems •PLC •SONET/SDH •G.709 •WiMAX •…
This box: view • talk • edit
The Network Time Protocol (NTP) is a protocol forsynchronizing the clocks of computer systems overpacket-switched, variable-latency data networks. NTP usesUDPport 123 as itstransport layer. It is designed particularly to resist the effects of variable latency (Jitter).
NTP is one of the oldestInternet protocols still in use (since before 1985). NTP was originally designed byDave Mills of theUniversity of Delaware, who still maintains it, along with a team of volunteers.
NTP is not related to the much simplerDAYTIME (RFC 867) andTIME (RFC 868) protocols.
Contents
[hide]
1 Overview2 Clock strata3 Strata illustration4 NTP timestamps5 References6 Bibliography7 See also8 External links8.1 Other time synchronization protocols
[edit] Overview
NTP usesMarzullo‘s algorithm with theUTC time scale, including support for features such asleap seconds. NTPv4 can usually maintain time to within 10 milliseconds (1/100 s) over the publicInternet, and can achieve accuracies of 200 microseconds (1/5000 s) or better in local area networks under ideal conditions.
The NTP Unixdaemon is a user-level process that runs continuously on a machine that supports NTP, and most of the protocol is implemented in this user process. To get the best performance from NTP, it is important to have the standard NTP clockphase-locked loop implemented in theoperating system kernel, rather than using only the intervention of the external NTP daemon: all recent versions of theLinux andSolaris operating systems have this support.
The operational details of NTP are illustrated inRFC 778,RFC 891,RFC 956,RFC 958, andRFC 1305. The current reference implementation is version 4 (NTPv4); however, as of2005, only versions up to 3 (1992) have been documented inRFCs. TheIETF NTP Working Group has formed to standardize the work of the NTP community sinceRFC 1305 et al.
A less complex form of NTP that does not require storing information about previous communications is known as the Simple Network Time Protocol or SNTP. It is used in some embedded devices and in applications where high accuracy timing is not required. SeeRFC 1361,RFC 1769,RFC 2030 andRFC 4330.
Microsoft Windows 2000 and XP include theWindows Time Service, which has the ability to sync the computer clock to an NTP server. However, the version in Windows 2000 only implements SNTP. As ofWindows Server 2003 Service Pack 1, the Windows Time Service implements the more robust NTPv3 protocol as specified inRFC 1305.
[edit] Clock strata
(Note that this is different from the notion of clock strata used in telecommunications systems.)
NTP uses a hierarchical system of "clock strata". The stratum levels define the distance from the reference clock and the associated accuracy.
Stratum 0These are devices such asatomic (cesium, rubidium) clocks,GPS clocks or otherradio clocks. Stratum-0 devices are not attached to the network; instead they are locally connected to computers (e.g. via an RS-232 connection using aPulse per second signal).Stratum 1These are computers attached to Stratum 0 devices. Normally they act as servers for timing requests from Stratum 2 servers via NTP. These computers are also referred to astime servers. Many Stratum 1 servers (for NTP v3 and earlier versions) may not actually be operating with Stratum 1 precision. As the NTP protocol is developed, it will become less and less possible for misleading Stratum 1 servers to run -- instead the protocol would automatically bump the server Stratum level down accordingly.Stratum 2These are computers that send NTP requests to Stratum 1 servers. Normally a Stratum 2 computer will reference a number of Stratum 1 servers and use the NTP algorithm to gather the best data sample, dropping any Stratum 1 servers that seem obviously wrong. Stratum 2 computers will peer with other Stratum 2 computers to provide more stable and robust time for all devices in the peer group. Stratum 2 computers normally act as servers for Stratum 3 NTP requests.Stratum 3These computers employ exactly the same NTP functions of peering and data sampling as Stratum 2, and can themselves act as servers for higher strata, potentially up to 16 levels. NTP (depending on what version of NTP protocol in use) supports up to 256 strata. It is hoped that in NTP 5 (a protocol still in development) that only 8 or 16 strata will be permitted.
[edit] Strata illustration

NTP Stratum Levels
[edit] NTP timestamps
The 64-bit timestamps used by NTP consist of a 32-bit seconds part and a 32-bit fractional second part, giving NTP a time scale of 232 seconds (136 years) and a theoretical resolution of 2−32 seconds (0.233 nanoseconds). The NTP timescale wraps around every 232 seconds (136 years). NTP uses an epoch ofJanuary 1,1900, so the first wrap will occur in 2036 , reminiscent of theYear 2038 problem. Implementations should disambiguate NTP time using a knowledge of the approximate time from other sources. Since this only requires time accurate to a few decades, this is unlikely to ever be a problem in general use.
Even so, future versions of NTP will extend the time representation to 128 bits: 64 bits for the second and 64 bits for the fractional-second. According to Mills, "The 64 bit value for the fraction is enough to resolve the amount of time it takes aphoton to pass anelectron at the speed of light. The 64 bit second value is enough to provide unambiguous time representation until theuniverse goes dim."[1] Indeed, 2−64 seconds is about54 zeptoseconds, and 264 seconds is about585 billion years.
[edit] References
^University of Delaware Digital Systems Seminar presentation by David Mills,April 26, 2006
[edit] Bibliography
Computer Network Time Synchronization: The Network Time Protocol, David L. Mills,Taylor & Francis / CRC Press,ISBN 0849358051
[edit] See also
Allan varianceClock synchronizationntpd andOpenNTPDSynchronizationInternational Atomic TimeTime serverNTP server misuse and abuseNTP poolDAYTIME protocol, older time synchronization protocol using TCP or UDP port 13TIME protocol, older time synchronization protocol using TCP or UDP port 37ICMP Timestamp andICMP Timestamp Reply, older time synchronization protocol using ICMPclockdiff
[edit] External links
NTP Public Services Project This is the home for the NTP (Network Time Protocol) Public Services Project which provides public support for the NTP Project and the IETF NTP Working Group. Also a Wiki with lists of NTP servers.IETF NTP working groupDavid Mills‘ NTP project pageNTP version 4 Release NotesTime and NTP paperNTP Survey 2005
[edit] Other time synchronization protocols
Daytime protocolDAYTIME synchronization protocol via TCP or UDP port 13ICMP protocol Time synchronization withICMP timestamps (basis fortimed )HTTP Time Protocol (HTP) Time synchronization withHTTP headersPrecision Time Protocol Time synchronization for wired networks with accuracy at the 10s of nanoseconds rangeReference-Broadcast Synchronization (RBS) Time synchronization for wireless networksTime protocol Time synchronization protocol via TCP or UDP port 37
Retrieved from "http://en.wikipedia.org/wiki/Network_Time_Protocol"