]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Documentation update from Dave Mills
authorHarlan Stenn <stenn@ntp.org>
Thu, 23 Jun 2011 06:47:56 +0000 (02:47 -0400)
committerHarlan Stenn <stenn@ntp.org>
Thu, 23 Jun 2011 06:47:56 +0000 (02:47 -0400)
bk: 4e02e19cr-zjzHzlnQX49qntVTyBOA

ChangeLog
html/warp.html

index c1b29750a473edd43a419b3575466c5b1facf0e6..bc4618e1b4513e6f67948cb46ac2c36c0d1b967c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
+* [Bug 1950] Control installation of event_rpcgen.py.
 * Update the building of OS-specific programs.
 * Finish conversion to genLocInfo.
 * validate MANTAGFMT in genLocInfo.
-* [Bug 1950] Control installation of event_rpcgen.py.
+* Documentation update from Dave Mills.
 (4.2.7p185) 2011/06/21 Released by Harlan Stenn <stenn@ntp.org>
 * ntp_locs.m4: handle the case where . is not in the PATH.
 * More genLocInfo cleanup.
index 512dbbcb78c0fae96217c3d58b2db6e34cb4a106..a6d9bd459c9ee143dd134e134d5223361a577f0a 100644 (file)
@@ -9,18 +9,22 @@
 <body>
 <h3>How NTP Works</h3>
 <p>Last update:
-  <!-- #BeginDate format:En2m -->18-May-2011  18:43<!-- #EndDate -->
+  <!-- #BeginDate format:En2m -->25-May-2011  18:18<!-- #EndDate -->
   UTC</p>
 <h4>Related Links</h4>
 <script type="text/javascript" language="javascript" src="scripts/special.txt"></script>
 <h4>Table of Contents</h4>
 <ul>
   <li class="inline"><a href="#intro">Introduction and Overview</a></li>
+  <li class="inline"><a href="#scale">NTP Timescale and Data Formats</a></li>
   <li class="inline"><a href="#budget">Statistics Budget</a></li>
   <li class="inline"><a href="#quality">Quality of Service</a></li>
 </ul>
 <hr>
 <h4 id="intro">Introduction and Overview</h4>
+<blockquote>
+  <p align="left">Note: This document contains a technical description of the Network Time Protocol (NTP) architecture and operation.  It is intended for  administrators, operators and monitoring personnel. Additional information for nontechnical readers can be found in the white paper  <a href="http://www.eecis.udel.edu/~mills/exec.html">Executive Summary: Computer Network Time Synchronization</a>.</p>
+</blockquote>
 <p>NTP time synchronization services are widely available in the public Internet. The public NTP subnet in early 2011 includes several thousand servers in most countries and on every continent of the globe, including Antarctica, and sometimes in space and on the sea floor. These servers support a total population estimated at over 25 million computers in the global Internet.</p>
 <p> The NTP subnet operates with a hierarchy of levels, where each level is assigned a number called the stratum. Stratum 1 (primary) servers at the lowest level are directly synchronized to national time services via satellite, radio or telephone modem. Stratum 2 (secondary) servers at the next higher level are synchronize to stratum 1 servers and so on. Normally, NTP clients and servers with a relatively small number of clients do not synchronize to public primary servers. There are several hundred public secondary servers operating at higher strata and are the preferred choice.</p>
 <p>This page presents an overview of the NTP daemon included in this software distribution. We refer to this daemon as the <em>reference implementation</em> only because it was  used to test and validate the NTPv4 specification RFC-5905. It is best read in conjunction with the briefings on the <a href="http://www.eecis.udel.edu/~mills/ntp.html">Network Time Synchronization Research Project</a> page.</p>
   <p>Figure 1. NTP Daemon Processes and Algorithms</p>
 </div>
 <p>The overall organization of the NTP daemon is shown in Figure 1. It is useful in this context to consider the daemon as both a client of upstream servers and as a server for downstream clients. It includes a pair of peer/poll processes for each reference clock or remote  server used as a synchronization source. Packets are exchanged between the client and server using the <em>on-wire protocol</em> described in  the white paper NTP  <a href="http://www.eecis.udel.edu/~mills/onwire.html">Analysis and Simulation of the NTP On-Wire Protocols</a>. The protocol is resistant to lost, replayed or spoofed packets.</p>
-<p> The poll process sends NTP packets at intervals ranging from 8 s to 36 hr. The peer process receives NTP packets and  performs  the packet sanity tests of the <a href="decode.html#flash">flash status word</a>. The flash status word reports in addition the results of various security checks described on the <a href="http://www.eecis.udel.edu/~mills/security.html">NTP Security Analysis</a> page.</p>
+<p> The poll process sends NTP packets at intervals ranging from 8 s to 36 hr. The peer process receives NTP packets and  performs  the packet sanity tests of the <a href="decode.html#flash">flash status word</a>. The flash status word reports in addition the results of various security checks described in the white paper <a href="http://www.eecis.udel.edu/~mills/security.html">NTP Security Analysis</a>.</p>
 <p>Packets that fail one or more of these tests are summarily discarded. Otherwise, the peer process runs the on-wire protocol that uses four raw timestamps: the <em>origin timestamp</em> <em>T</em><sub>1</sub> upon departure of the client request, the <em>receive timestamp</em> <em>T</em><sub>2</sub> upon arrival at the server, the <em>transmit timestamp</em> <em>T</em><sub>3</sub> upon departure of the server reply, and the <em>destination timestamp</em> <em>T</em><sub>4</sub> upon arrival at the client. These timestamps, which are recorded by the <tt>rawstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command, are used to calculate the clock offset and roundtrip delay samples:</p>
 <div align="center">
   <p>offset = [(<em>T</em><sub>2</sub> -<em> T</em><sub>1</sub>) + (<em>T</em><sub>3</sub> - <em>T</em><sub>4</sub>)] / 2<br>
     delay = (<em>T</em><sub>4</sub> - <em>T</em><sub>1</sub>) - (<em>T</em><sub>3</sub> - <em>T</em><sub>2</sub>).</p>
 </div>
 <p>The  algorithm described on the <a href="filter.html">Clock Filter Algorithm</a> page  selects the    offset  and  delay samples most likely to produce accurate results. Those servers that have passed  the  sanity tests     are declared <em>selectable</em>. From the selectable population the statistics are used by the algorithm described on the <a href="select.html">Clock Select Algorithm</a> page to determine a number of <em>truechimers</em> according to correctness principles. From the truechimer population the algorithm described on the <a href="cluster.html">Clock Cluster Algorithm</a> page determines a number of <em>survivors</em>  on the basis of statistical clustering principles. The algorithms described on the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page combine the survivor offsets, designate one of them as the <em>system peer</em> and produces the final offset used by the algorithm described on the <a href="discipline.html">Clock Discipline Algorithm</a> page to adjust the system clock time and frequency. The clock offset and frequency, are recorded by the <tt>loopstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. For additional details about these algorithms, see the Architecture Briefing on the <a href="http://www.eecis.udel.edu/~mills/ntp.html">Network Time Synchronization Research Project</a> page.</p>
+<h4 id="scale">NTP Timescale and Data Formats</h4>
+<p>NTP clients and servers synchronize to the  Coordinated Universal Time (UTC) timescale used by national laboratories and disseminated by radio, satellite and telephone modem. This is a global timescale independent of geographic position. There are no provisions for local time zone or daylight savings time; however, these functions can be performed by the operating system on a per-user basis.</p>
+<p>  The UT1 timescale, upon which UTC is based, is determined by the rotation of the Earth about its axis, which is gradually slowing down. In order to rationalize  UTC with respect to UT1, a  leap second is inserted  at intervals of about 18 months, as determined by the  International Earth Rotation Service (IERS). The historic insertions are documented in the <tt>leapseconds.txt</tt>  file, which can be downloaded from the NIST FTP server. Leap second warnings are disseminated by the national laboratories in the broadcast timecode format. These warnings are propagated from the NTP primary servers via other server to the clients  by the NTP on-wire protocol. The leap second is implemented by the operating system kernel, as described in  the white  paper <a href="http://www.eecis.udel.edu/~mills/leap.html">The NTP Timescale and Leap Seconds</a>.</p>
+<p>There are two NTP time formats, a 64-bit <em>timestamp</em> format and a `128-bit <em>date</em> format. The date format is used internally, while the timestamp format is used in packet headers exchanged between clients and servers. The timestamp format spans 136 years, called an <em>era</em>. The current era began on 1 January 1900, while  the next one begins in 2036. Details on these formats and conversions between them are  in the white paper <a href="http://www.eecis.udel.edu/~mills/y2k.html">The NTP Era and Era Numbering</a>. However, the NTP protocol will synchronize correctly, regardless of era, as long as  the system clock is set initially within  68 years of the correct time. Further discussion on this issue is in the white paper <a href="http://www.eecis.udel.edu/~mills/time.html">NTP Timestamp Calculations</a>. Ordinarily, these formats are not seen by application programs, which convert these NTP formats to native Unix or Windows formats.</p>
 <h4 id="budget">Statistics Budget</h4>
-<p>Each source is characterized by the   offset and delay samples  measured by the on-wire protocol and the  dispersion and jitter calculated by the clock filter algorithm. In a window of eight samples, this algorithm  selects the offset sample with the lowest  delay, which generally represents the most accurate data. The selected samples become the <em>peer offset</em> and <em>peer delay</em>. The <em>peer dispersion</em>  is determined as a weighted average of the dispersion samples in the window.  It continues to grow at the same  rate as the sample dispersion, 15 <font face="symbol">m</font>s/s. Finally, the <em>peer jitter</em> is determined as the root-mean-square (RMS) average of  the offset samples in the window relative to the selected offset sample. The peer offset, peer delay, peer dispersion and peer jitter are recorded by the <tt>peerstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. Peer variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#peer"><tt>ntpq</tt></a> program.</p>
+<p>Each NTP synchronization source is characterized by the   offset and delay samples  measured by the on-wire protocol and the  dispersion and jitter calculated by the clock filter algorithm. In a window of eight samples, this algorithm  selects the offset sample with the lowest  delay, which generally represents the most accurate data. The selected samples become the <em>peer offset</em> and <em>peer delay</em>. The <em>peer dispersion</em>  is determined as a weighted average of the dispersion samples in the window.  It continues to grow at the same  rate as the sample dispersion, 15 <font face="symbol">m</font>s/s. Finally, the <em>peer jitter</em> is determined as the root-mean-square (RMS) average of  the offset samples in the window relative to the selected offset sample. The peer offset, peer delay, peer dispersion and peer jitter are recorded by the <tt>peerstats</tt> option of the <a href="monopt.html#filegen"><tt>filegen</tt></a> command. Peer variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#peer"><tt>ntpq</tt></a> program.</p>
 <p> The clock filter algorithm continues to process packets in this way until the source is no longer reachable. Reachability is determined by an eight-bit shift register, which is shifted left by one bit as each poll packet is sent, with 0 replacing the vacated rightmost bit. Each time an update is received, the rightmost bit is set to 1. The source is considered reachable if any bit is set to 1 in the register; otherwise, it is considered unreachable.</p>
 <p>A server is considered selectable only if it is reachable and a timing loop would not be created. A timing loop occurs when the server is apparently synchronized to the client or when the server is synchronized to the same server as the client. When a source is unreachable, a  dummy sample with  &quot;infinite&quot; dispersion  is inserted in the shift register at each poll, thus displacing old samples.</p>
 <p>The composition of  the survivor population and the system peer selection is redetermined as each update from each source is received. The system variables are copied from the  system peer variables of the same name and the system stratum set one greater than the system peer stratum. System variables are displayed by the <tt>rv</tt> command of the <a href="ntpq.html#system"><tt>ntpq</tt></a> program.</p>