diff options
Diffstat (limited to 'contrib/ntp/html')
134 files changed, 12218 insertions, 0 deletions
diff --git a/contrib/ntp/html/accopt.html b/contrib/ntp/html/accopt.html new file mode 100644 index 0000000..be8a5bb --- /dev/null +++ b/contrib/ntp/html/accopt.html @@ -0,0 +1,73 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Access Control Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Access Control Options</h3> + <img src="pic/pogo6.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>The skunk watches for intruders and sprays.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:35</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#acx">Access Control Support</a> + <li class="inline"><a href="#kiss">The Kiss-of-Death Packet</a> + <li class="inline"><a href="#cmd">Access Control Commands</a> + </ul> + <hr> + <h4 id="acx">Access Control Support</h4> + The<tt> ntpd</tt> daemon implements a general purpose address/mask based restriction list. The list contains address/match entries sorted first by increasing address values and and then by increasing mask values. A match occurs when the bitwise AND of the mask and the packet source address is equal to the bitwise AND of the mask and address in the list. The list is searched in order with the last match found defining the restriction flags associated with the entry. Additional information and examples can be found in the <a href="notes.html">Notes on Configuring NTP and Setting up a NTP Subnet</a> page. + <p>The restriction facility was implemented in conformance with the access policies for the original NSFnet backbone time servers. Later the facility was expanded to deflect cryptographic and clogging attacks. While this facility may be useful for keeping unwanted or broken or malicious clients from congesting innocent servers, it should not be considered an alternative to the NTP authentication facilities. Source address based restrictions are easily circumvented by a determined cracker.</p> + <p>Clients can be denied service because they are explicitly included in the restrict list created by the <tt>restrict</tt> command or implicitly as the result of cryptographic or rate limit violations. Cryptographic violations include certificate or identity verification failure; rate limit violations generally result from defective NTP implementations that send packets at abusive rates. Some violations cause denied service only for the offending packet, others cause denied service for a timed period and others cause the denied service for an indefinate period. When a client or network is denied access for an indefinate period, the only way at present to remove the restrictions is by restarting the server.</p> + <h4 id="kiss">The Kiss-of-Death Packet</h4> + <p>Ordinarily, packets denied service are simply dropped with no further action except incrementing statistics counters. Sometimes a more proactive response is needed, such as a server message that explicitly requests the client to stop sending and leave a message for the system operator. A special packet format has been created for this purpose called the "kiss-o'-death" (KoD) packet. KoD packets have the leap bits set unsynchronized and stratum set to zero and the reference identifier field set to a four-byte ASCII code. If the <tt>noserve</tt> or <tt>notrust</tt> flag of the matching restrict list entry is set, the code is "DENY"; if the <tt>limited</tt> flag is set and the rate limit is exceeded, the code is "RATE". Finally, if a cryptographic violation occurs, the code is "CRYP".</p> + <p>A client receiving a KoD performs a set of sanity checks to minimize security exposure, then updates the stratum and reference identifier peer variables, sets the access denied (TEST4) bit in the peer flash variable and sends a message to the log. As long as the TEST4 bit is set, the client will send no further packets to the server. The only way at present to recover from this condition is to restart the protocol at both the client and server. This happens automatically at the client when the association times out. It will happen at the server only if the server operator cooperates.</p> + <h4 id="cmd">Access Control Commands</h4> + <dl> + <dt><tt>discard [ average <i>avg</i> ][ minimum <i>min</i> ] [ monitor <i>prob</i> ]</tt> + <dd>Set the parameters of the <tt>limited</tt> facility which protects the server from client abuse. The <tt>average</tt> subcommand specifies the minimum average packet spacing, while the <tt>minimum</tt> subcommand specifies the minimum packet spacing. Packets that violate these minima are discarded and a kiss-o'-death packet returned if enabled. The default minimum average and minimum are 5 and 2, respectively. The monitor subcommand specifies the probability of discard for packets that overflow the rate-control window. + <dt><tt>restrict <i>address</i> [mask <i>mask</i>] [<i>flag</i>][...]</tt> + <dd>The <i><tt>address</tt></i> argument expressed in dotted-quad form is the address of a host or network. Alternatively, the <tt><i>address</i></tt> argument can be a valid host DNS name. The <i><tt>mask</tt></i> argument expressed in dotted-quad form defaults to <tt>255.255.255.255</tt>, meaning that the <i><tt>address</tt></i> is treated as the address of an individual host. A default entry (address <tt>0.0.0.0</tt>, mask <tt>0.0.0.0</tt>) is always included and is always the first entry in the list. Note that text string <tt>default</tt>, with no mask option, may be used to indicate the default entry. + <dd>In the current implementation, <i><tt>flag</tt></i> always restricts access, i.e., an entry with no flags indicates that free access to the server is to be given. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags can generally be classed into two catagories, those which restrict time service and those which restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified: + <dl> + <dt><tt>ignore</tt> + <dd>Deny packets of all kinds, including <tt>ntpq</tt> and <tt>ntpdc</tt> queries. + <dt><tt>kod</tt> + <dd>If this flag is set when an access violation occurs, a kiss-o'-death (KoD) packet is sent. KoD packets are rate limited to no more than one per second. If another KoD packet occurs within one second after the last one, the packet is dropped + <dt><tt>limited</tt> + <dd>Deny service if the packet spacing violates the lower limits specified in the <tt>discard</tt> command. A history of clients is kept using the monitoring capability of <tt>ntpd</tt>. Thus, monitoring is always active as long as there is a restriction entry with the <tt>limited</tt> flag. + <dt><tt>lowpriotrap</tt> + <dd>Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps. + <dt><tt>nomodify</tt> + <dd>Deny <tt>ntpq</tt> and <tt>ntpdc</tt> queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. + <dt><tt>noquery</tt> + <dd>Deny <tt>ntpq</tt> and <tt>ntpdc</tt> queries. Time service is not affected. + <dt><tt>nopeer</tt> + <dd>Deny packets which would result in mobilizing a new association. This includes broadcast, symmetric-active and manycast client packets when a configured association does not exist. + <dt><tt>noserve</tt> + <dd>Deny all packets except <tt>ntpq</tt> and <tt>ntpdc</tt> queries. + <dt><tt>notrap</tt> + <dd>Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the <tt>ntpdq</tt> control message protocol which is intended for use by remote event logging programs. + <dt><tt>notrust</tt> + <dd>Deny packets unless the packet is cryptographically authenticated. + <dt><tt>ntpport</tt> + <dd>This is actually a match algorithm modifier, rather than a restriction flag. Its presence causes the restriction entry to be matched only if the source port in the packet is the standard NTP UDP port (123). Both <tt>ntpport</tt> and <tt>non-ntpport</tt> may be specified. The <tt>ntpport</tt> is considered more specific and is sorted later in the list. + <dt><tt>version</tt> + <dd>Deny packets that do not match the current NTP version. + </dl> + <dd>Default restriction list entries with the flags <tt>ignore, interface, ntpport</tt>, for each of the local host's interface addresses are inserted into the table at startup to prevent the server from attempting to synchronize to its own time. A default entry is also always present, though if it is otherwise unconfigured; no flags are associated with the default entry (i.e., everything besides your own NTP server is unrestricted). + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/assoc.html b/contrib/ntp/html/assoc.html new file mode 100644 index 0000000..0ca1426 --- /dev/null +++ b/contrib/ntp/html/assoc.html @@ -0,0 +1,59 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Association Management</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Association Management</h3> + <img src="pic/alice51.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Make sure who your friends are.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:35</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#modes">Association Modes</a> + <li class="inline"><a href="#client">Client/Server Mode</a> + <li class="inline"><a href="#symact">Symmetric Active/Passive Mode</a> + <li class="inline"><a href="#broad">Broadcast/Multicast Modes</a> + <li class="inline"><a href="#umlt">Multicasting</a> + <li class="inline"><a href="#umlt">Multicasting</a> + <li class="inline"><a href="#burst">Burst Modes</a> + </ul> + <hr> + <h4 id="modes">Association Modes</h4> + <p>NTP Version 4 (NTPv4) incorporates new features and refinements to the NTP Version 3 (NTPv3) algorithms; however, it continues the tradition of backwards compatibility with older versions. A number of new operating modes for automatic server discovery and improved accuracy in occasionally connected networks are provided. Following is an overview of the new features; additional information is available on the <a href="confopt.html">Configuration Options</a> and <a href="authopt.html">Authentication Options</a> pages and in the papers, reports, memoranda and briefings at <a href="http://www.ntp.org">www.ntp.org</a>.</p> + <p>There are two types of associations: persistent associations, which result from configuration file commands, and ephemeral associations, which result from protocol operations described below. A persistent association is never demobilized, although it may become dormant when the associated server becomes unreachable. An ephemeral association is mobilized when a message arrives from a server; for instance, a symmetric passive association is mobilized upon arrival of a symmetric active message. A broadcast client association is mobilized upon arrival of a broadcast server message, while a Manycast client association is mobilized upon arrival of a Manycast server message.</p> + <p>Ordinarily, successful mobilization of an ephemeral association requires the server to be cryptographically authenticated to the dependent client. This can be done using either symmetric-key or public-key cryptography, as described in the <a href="authopt.html">Authentication Options</a> page. The cryptographic means insure an unbroken chain of trust between the dependent client and the primary servers at the root of the synchronization subnet. We call this chain the <i>provenance</i> of the client and define new vocabulary as to proventicate a client or provide proventic credentials. Once mobilized, ephemeral associations are demobilized when either (a) the server becomes unreachable or (b) the server refreshes the key media without notifying the client.</p> + <p>There are three principal modes of operation: client/server, symmetric active/passive and broadcast. In addition, there are two modes using IP multicast support: multicast and manycast. These modes are selected based on the scope of service, intended flow of time and proventic values and means of configuration. Following is a summary of the operations in each mode.</p> + <h4 id="client">Client/Server Mode</h4> + <p>Client/server mode is probably the most common configuration in the Internet today. It operates in the classic remote-procedure-call (RPC) paradigm with stateless servers. In this mode a client sends a request to the server and expects a reply at some future time. In some contexts this would be described as a "pull" operation, in that the client pulls the time and proventic values from the server. A client is configured in client mode using the <tt>server</tt> (sic) command and specifying the server IPv4 or IPv6 DNS name or address; the server requires no prior configuration. The original NTPv3 authentication scheme is applicable in this mode, as well as the new NTPv4 Autokey proventication scheme. In addition, two burst modes described below can be used in appropriate cases.</p> + <h4 id="symact">Symmetric Active/Passive Mode</h4> + <p>Symmetric active/passive mode is intended for configurations were a clique of low-stratum peers operate as mutual backups for each other. Each peer operates with one or more primary reference sources, such as a radio clock, or a subset of secondary servers known to be reliable and proventicated. Should one of the peers lose all reference sources or simply cease operation, the other peers will automatically reconfigure so that time and proventication values can flow from the surviving peers to all the others in the clique. In some contexts this would be described as a "push-pull" operation, in that the peer either pulls or pushes the time and proventic values depending on the particular configuration.</p> + <p>Symmetric peers operate with their sources in some NTP mode and with each other in symmetric mode. A peer is configured in symmetric active mode using the <tt>peer</tt> command and specifying the other peer IPv4 or IPv6 DNS name or address. The other peer can also be configured in symmetric active mode in a similar way. However, if the other peer is not specifically configured in this way, a symmetric passive association is mobilized upon arrival of a symmetric active message. Since an intruder can impersonate a symmetric active peer and inject false time values, symmetric mode should always be cryptographically validated. The original NTPv3 authentication scheme is applicable in this mode, as well as the new NTPv4 Autokey proventication scheme.</p> + <h4 id="broad">Broadcast/Multicast Modes</h4> + <p>IPv4 broadcast mode in both NTPv3 and NTPv4 is limited to directly connected subnets such as Ethernets which support broadcast technology. Ordinarily, this technology does not operate beyond the first hop router or gateway. In IPv6 and where service is intended beyond the local subnet, IP multicasting can be used where supported by the operating system and the routers support the Internet Group Management Protocol (IGMP). Most current kernels and available routers do support IP multicast technology, although service providers are sometimes reluctant to deploy it.</p> + <p>IPv4 broadcast mode is intended for configurations involving one or a few servers and a possibly very large client population on the same subnet. A broadcast server is configured using the <tt>broadcast</tt> command and a IPv4 local subnet broadcast address. A broadcast client is configured using the <tt>broadcastclient</tt> command, in which case it responds to broadcast messages received on any interface. Since an intruder can impersonate a broadcast server and inject false time values, this mode should always be cryptographically validated. The original NTPv3 authentication scheme is applicable in this mode, as well as the new NTPv4 Autokey proventication scheme.</p> + <p>The server generates broadcast messages continuously at intervals specified by the <tt>minpoll</tt> keyword and with a time-to-live span specified by the <tt>ttl</tt> keyword. A broadcast client responds to the first message received by waiting a short interval to avoid implosion at the server. Then, the client polls the server in burst mode in order to quickly set the host clock and validate the source. This normally results in a volley of eight client/server cycles at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently. Following the volley, the client computes the offset between the apparent broadcast time and the (unicast) client time. This offset is used to compensate for the propagation time between the broadcast server and client. Once the offset is computed, the server continues as before and the client sends no further messages. If for some reason the broadcast server does not respond to client messages, the client will time out the volley and continue in listen-only mode with a default propagation delay.</p> + <h4 id="umlt">Multicasting</h4> + <p>Multicasting can be used to extend the scope of a timekeeping subnet in two ways: multicasting and manycasting. A general discussion of IP multicast technology is beyond the scope of this page. In simple terms a host or router sending to a IPv4 or IPv6 multicast group address expects all hosts or routers listening on this address to receive the message. There is no intrinsic limit on the number of senders or receivers and senders can be receivers and vice versa. The IANA has assigned multicast group address IPv4 224.0.1.1 and IPv6 FF05::101 (site local) to NTP, but these addresses should be used only where the multicast span can be reliably constrained to protect neighbor networks. In general, administratively scoped IPv4 group addresses should be used, as described in RFC-2365, or GLOP group addresses, as described in RFC-2770.</p> + <p>A multicast server is configured using the <tt>broadcast</tt> command, but with a multicast group address instead of a broadcast address. A multicast client is configured using the <tt>multicastclient</tt> command with a multicast group address. However, there is a subtle difference between IPv4 broadcasting and multicasting. IPv4 broadcasting is specific to each interface and local subnet address. If more than one interface is attached to a machine, a separate <tt>broadcast</tt> command applies to each one separately. This provides a way to limit exposure in a firewall, for example. For IPv6 the same distinction can be made using link-local prefix FF02 for each interface and site-local FF05 for all interfacesl.</p> + <p>IP multicasting is a different paradigm. By design, multicast messages travel from the sender via a shortest-path or shared tree to the receivers, which may require these messages emit from one or all interfaces, but carry a common source address. However, it is possible to configure multiple multicast group addresses using multiple <tt>broadcast</tt> or <tt>multicastclient</tt> commands. Other than these particulars, multicast messages are processed just like broadcast messages. Note that the calibration feature in broadcast mode is extremely important, since IP multicast messages can travel far different paths through the IP routing fabric than ordinary IP unicast messages.</p> + <h4 id="many">Manycasting</h4> + <p>Manycasting is a automatic discovery and configuration paradigm new to NTPv4. It is intended as a means for a multicast client to troll the nearby network neighborhood to find cooperating manycast servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. The intended result is that each manycast client mobilizes client associations with some number of the "best" of the nearby anycast servers, yet automatically reconfigures to sustain this number of servers should one or another fail. Additional information is on the <a href="manyopt.html">Automatic NTP Configuration Options</a> page.</p> + <h4 id="burst">Burst Modes</h4> + <p>There are two burst modes where a single poll event triggers a burst of eight packets at 2-s intervals instead of the usual one. The <tt>burst</tt> mode sends a burst when the server is reachable, while the <tt>iburst</tt> mode sends a burst when the server is unreachable. Each mode is independently of the other and both can be used if necessary. The <tt>calldelay</tt> command can be used to increase the interval between the first and second packets in the burst in order to allow a modem to complete a call. Received server packets update the clock filter, which selects the best (most accurate) time values. When the last packet in the burst is sent, the next received packet updates the system variables and sets the system clock in the usual manner, as if only a single client/server cycle had occurred. The result is not only a rapid and reliable setting of the system clock, but a considerable reduction in network jitter.</p> + <p>The <tt>iburst</tt> keyword is used where it is important to set the clock quickly when an association is first mobilized or first becomes reachable or when the network attachment requires an initial calling or training procedure. The burst is initiated only when the server first becomes reachable and results in good accuracy with intermittent connections typical of PPP and ISDN services. Outlyers due to initial dial-up delays, etc., are avoided and the client sets the clock within a few seconds after the first message.</p> + <p>The <tt>burst</tt> keyword can be configured in cases of excessive network jitter or when the network attachment requires an initial calling or training procedure. The burst is initiated at each poll interval when the server is reachable. The burst does produce additional network overhead and can cause trouble if used indiscriminately. It should only be used where the poll interval is expected to settle to values at or above 1024 s.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/audio.html b/contrib/ntp/html/audio.html new file mode 100644 index 0000000..9cea273 --- /dev/null +++ b/contrib/ntp/html/audio.html @@ -0,0 +1,148 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Reference Clock Audio Drivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Reference Clock Audio Drivers</h3> + <img src="pic/radio2.jpg" alt="jpg" align="left">ICOM R-72 shortwave receiver and Sure audio mixer + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:36</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links8.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#sound">Sound Card Drivers</a> + <li class="inline"><a href="#short">Shortwave Radio Drivers</a> + <li class="inline"><a href="#setup">Setup and Debugging Aids</a> + </ul> + <hr> + <h4 id="sound">Sound Card Drivers</h4> + <p>There are some applications in which the computer time can be disciplined to an audio signal, rather than a serial timecode and communications port or special purpose bus peripheral. This is useful in such cases where the audio signal is sent over a telephone circuit, for example, or received directly from a shortwave receiver. In such cases the audio signal can be connected via an ordinary sound card or baseboard audio codec. The suite of NTP reference clock drivers currently includes three drivers suitable for these applications. They include a driver for the Inter Range Instrumentation Group (IRIG) signals produced by many radio clocks and timing devices, another for the Canadian time/frequency radio station CHU and a third for the NIST time/frequency radio stations WWV and WWVH. The radio drivers are designed to work with ordinary inexpensive shortwave radios and may be one of the least expensive ways to build a good primary time server.</p> + <p>All three drivers make ample use of sophisticated digital signal processing algorithms designed to efficiently extract timing signals from noise and interference. The radio station drivers in particular implement optimum linear demodulation and decoding techniques, including maximum likelihood and soft-decision methods. The documentation page for each driver contains an in-depth discussion on the algorithms and performance expectations. In some cases the algorithms are further analyzed, modelled and evaluated in a technical report.</p> + <p>Currently, the audio drivers work with with Sun operating systems and audio codecs, including SunOS 4.1.3 and Solaris from 2.6 and probably all others in between. They also work with FreeBSD from 4.1 with compatible sound card. In fact, the interface is quite generic and support for other systems, in particular the various Unix generics, should not be difficult. Volunteers are solicited.</p> + <p>The audio drivers include a number of common features designed to groom input signals, suppress spikes and normalize signal levels. An automatic gain control (AGC) feature provides protection against overdriven or underdriven input signals. It is designed to maintain adequate demodulator signal amplitude while avoiding occasional noise spikes. In order to assure reliable operation, the signal level must be in the range where the audio gain control is effective. In general, this means the input signal level must be such as to cause the AGC to set the gain somewhere in the middle of the range from 0 to 255, as indicated in the timecode displayed by the <tt>ntpq</tt> program.</p> + <p>The drivers operate by disciplining a logical clock based on the codec sample clock to the audio signal as received. This is done by stuffing or slipping samples as required to maintain exact frequency to the order of 0.1 PPM. In order for the driver to reliably lock on the audio signal, the sample clock frequency tolerance must be less than 250 PPM (.025 percent) for the IRIG driver and half that for the radio drivers. The largest error observed so far is about 60 PPM, but it is possible some sound cards or codecs may exceed that value.</p> + <p>The drivers include provisions to select the input port and to monitor the input signal. The <tt>fudge flag 2</tt> selects the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port. The <tt>fudge flag 3</tt> enables the input signal monitor using the previously selected output port and output gain. Both of these flags can be set in the configuration file or remotely using the <tt>ntpdc</tt> utility program.</p> + <h4 id="short">Shortwave Radio Drivers</h4> + <p>The WWV/H and CHU audio drivers require an external shortwave radio with the radio output - speaker or headphone jack - connected to either the microphone or line-in port on the computer. There is some degree of art in setting up the radio and antenna and getting the setup to work. While the drivers are highly sophisticated and efficient in extracting timing signals from noise and interference, it always helps to have as clear a signal as possible.</p> + <p>The most important factor affecting the radio signal is the antenna. It need not be long - even 15 feet is enough if it is located outside of a metal frame building, preferably on the roof, and away from metallic objects. An ordinary CB whip mounted on a PVC pipe and wooden X-frame on the roof should work well with most portable radios, as they are optimized for small antennas.</p> + <p>The radio need not be located near the computer; in fact, it generally works better if the radio is outside the near field of computers and other electromagnetic noisemakers. It can be in the elevator penthouse connected by house wiring, which can also be used to power the radio. A couple of center-tapped audio transformers will minimize noise pickup and provide phantom power to the radio with return via the building ground.</p> + <p>The WWV/H and CHU transmitters operate on several frequencies simultaneously, so that in most parts of North America at least one frequency supports propagation to the receiver location at any given hour. While both drivers support the ICOM CI-V radio interface and can tune the radio automatically, computer-tunable radios are expensive and probably not cost effective compared to a GPS receiver. So, the radio frequency must usually be fixed and chosen by compromise.</p> + <p>Shortwave (3-30 MHz) radio propagation phenomena are well known to shortwave enthusiasts. The phenomena generally obey the following rules:</p> + <ul> + <li>The optimum frequency is higher in daytime than nighttime, stays high longer on summer days and low longer on winter nights. + <li>Transitions between daytime and nightime conditions generally occur somewhat after sunrise and sunset at the midpoint of the path from transmitter to receiver. + <li>Ambient noise (static) on the lower frequencies follows the thunderstorm season, so is higher on summer afternoons and evenings. + <li>The lower frequency bands are best for shorter distances, while the higher bands are best for longer distances. + <li>The optimum frequencies are higher at the peak of the 11-year sunspot cycle and lower at the trough. The current sunspot cycle should peak in the first couple of years beginning the century. + </ul> + <p>The best way to choose a frequency is to listen at various times over the day and determine the best highest (daytime) and lowest (nighttime) frequencies. Then, assuming one is available, choose the highest frequency between these frequencies. This strategy assumes that the high frequency is more problematic than the low, that the low frequency probably comes with severe multipath and static, and insures that probably twice a day the chosen frequency will work. For instance, on the east coast the best compromise CHU frequency is probably 7335 kHz and the best WWV frequency is probably 15 MHz.</p> + <h4>Autotune Modes</h4> + <p>The shortwave drivers include support for an optional autotune function compatible with ICOM receivers and transceivers. The <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies the ICOM ID select code in decimal. A missing or zero argument disables the CI-V interface. Since all ICOM select codes are less than 128, the high order bit of the code is used by the driver to specify the baud rate. If this bit is not set, the rate is 9600 bps for the newer radios; if set, the rate is 1200 bps for the older radios. Following are the ID select codes for the known radios.</p> + <table width="100%" cols="6"> + <tr> + <td>Radio</td> + <td>Hex</td> + <td>Decimal</td> + <td>Radio</td> + <td>Hex</td> + <td>Decimal</td> + </tr> + <tr> + <td>706</td> + <td>0x4e</td> + <td>78</td> + <td>775</td> + <td>0x46</td> + <td>70</td> + </tr> + <tr> + <td>706MKIIG</td> + <td>0x58</td> + <td>88</td> + <td>781</td> + <td>0x26</td> + <td>38</td> + </tr> + <tr> + <td>725</td> + <td>0x28</td> + <td>40</td> + <td>970</td> + <td>0x2e</td> + <td>46</td> + </tr> + <tr> + <td>726</td> + <td>0x30</td> + <td>48</td> + <td>R71</td> + <td>0x1A</td> + <td>26</td> + </tr> + <tr> + <td>735</td> + <td>0x04</td> + <td>4</td> + <td>R72</td> + <td>0x32</td> + <td>50</td> + </tr> + <tr> + <td>746</td> + <td>0x66</td> + <td>102</td> + <td>R75</td> + <td>0x5a</td> + <td>90</td> + </tr> + <tr> + <td>751</td> + <td>0x1c</td> + <td>28</td> + <td>R7000</td> + <td>0x08</td> + <td>8</td> + </tr> + <tr> + <td>756PROII</td> + <td>0x64</td> + <td>100</td> + <td>R7100</td> + <td>0x34</td> + <td>52</td> + </tr> + <tr> + <td>761</td> + <td>0x1e</td> + <td>30</td> + <td>R8500</td> + <td>0x4a</td> + <td>74</td> + </tr> + <tr> + <td>765</td> + <td>0x2c</td> + <td>44</td> + <td>R9000</td> + <td>0x2a</td> + <td>42</td> + </tr> + </table> + <h4 id="setup">Setup and Debugging Aids</h4> + <p>The audio drivers include extensive setup and debugging support to help hook up the audio signals and monitor the driver operations. The documentation page for each driver describes the various messages that can be produced either in real time or written to the <tt>clockstats</tt> file for later analysis. Of particular help in verifying signal connections and compatibility is a provision to monitor the signal via headphones or speaker.</p> + <p>Connecting radios and IRIG devices to the computer and verifying correct configuration is somewhat of a black art. The signals have to be connected to the correct ports and the signal level maintained within tolerances. Some radios have recorder outputs which produce a line level signal not affected by the volume control. These signals can be connected to the line-in port on the computer. If the level is too low, connect to the microphone-in port instead. If the radio does not have a recorder output, connect the headphone or speaker output to the line-in port and adjust the volume control so the driver indicates comfortably above the minimum specified and the AGC level somewhere in the middle of the range 0-255. IRIG signals are usually much larger than radio outputs, usually in the range to several volts and may even overload the line-in port. In such cases an attenuator must be used to reduce the signal level below the overload point.</p> + <p>It is very easy to underdrive or overdrive the audio codec, in which case the drivers will not synchronize to the signal. The drivers use <tt>fudge flag2</tt> to enable audio monitoring of the input signal. This is useful during setup to confirm the signal is actually reaching the audio codec and generally free of hum and interference. This feature is not intended for regular use, since it does increase the processor load on the system. Note that the speaker volume must be set before the driver is started.</p> + <p>The drivers write a synthesized timecode to the <tt>clockstats</tt> file each time the clock is set or verified and at other times if verbose monitoring is enabled. The format includes several fixed-length fields defining the UTC time to the millisecond, together with additional variable-length fields specific to each driver. The data include the intervals since the clock was last set or verified, the audio gain and various state variables and counters specific to each driver.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/authopt.html b/contrib/ntp/html/authopt.html new file mode 100644 index 0000000..5f67b3c --- /dev/null +++ b/contrib/ntp/html/authopt.html @@ -0,0 +1,155 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Authentication Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Authentication Options</h3> + <img src="pic/alice44.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Our resident cryptographer; now you see him, now you don't.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">01:29</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="338">Wednesday, September 13, 2006</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links9.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#auth">Authentication Support</a> + <li class="inline"><a href="#symm">Symmetric Key Cryptography</a> + <li class="inline"><a href="#pub">Public Key Cryptography</a> + <li class="inline"><a href="#cfg">Configuration</a> + <li class="inline"><a href="#inter">Operation</a> + <li class="inline"><a href="#key">Key Management</a> + <li class="inline"><a href="#cmd">Authentication Commands</a> + <li class="inline"><a href="#err">Error Codes</a> + <li class="inline"><a href="#file">Files</a> + </ul> + <hr> + <h4 id="auth">Authentication Support</h4> + <p>Authentication support allows the NTP client to verify that the server is in fact known and trusted and not an intruder intending accidentally or on purpose to masquerade as that server. The NTPv3 specification RFC-1305 defines a scheme which provides cryptographic authentication of received NTP packets. Originally, this was done using the Data Encryption Standard (DES) algorithm operating in Cipher Block Chaining (CBC) mode, commonly called DES-CBC. Subsequently, this was replaced by the RSA Message Digest 5 (MD5) algorithm using a private key, commonly called keyed-MD5. Either algorithm computes a message digest, or one-way hash, which can be used to verify the server has the correct private key and key identifier.</p> + <p>NTPv4 retains the NTPv3 scheme, properly described as symmetric key cryptography, and, in addition, provides a new Autokey scheme based on public key cryptography. Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on a private value which is generated by each host and never revealed. With the exception of the group key described later, all key distribution and management functions involve only public values, which considerably simplifies key distribution and storage. Public key management is based on X.509 certificates, which can be provided by commercial services or produced by utility programs in the OpenSSL software library or the NTPv4 distribution.</p> + <p>While the algorithms for symmetric key cryptography are included in the NTPv4 distribution, public key cryptography requires the OpenSSL software library to be installed before building the NTP distribution. This library is available from <a href="http://www.openssl.org">http://www.openssl.org</a> and can be installed using the procedures outlined in the <a href="build/build.html">Building and Installing the Distribution</a> page. Once installed, the configure and build process automatically detects the library and links the library routines required.</p> + <p>Authentication is configured separately for each association using the <tt>key</tt> or <tt>autokey</tt> subcommand on the <tt>peer</tt>, <tt>server</tt>, <tt>broadcast</tt> and <tt>manycastclient</tt> configuration commands as described in the <a href="confopt.html">Configuration Options</a> page. The authentication options described below specify the locations of the key files, if other than default, which symmetric keys are trusted and the interval between various operations, if other than default.</p> + <p>Authentication is always enabled, although ineffective if not configured as described below. If a NTP packet arrives including a message authentication code (MAC), it is accepted only if it passes all cryptographic checks. The checks require correct key ID, key value and message digest. If the packet has been modified in any way or replayed by an intruder, it will fail one or more of these checks and be discarded. Furthermore, the Autokey scheme requires a preliminary protocol exchange to obtain the server certificate, verify its credentials and initialize the protocol</p> + <p>The <tt>auth</tt> flag controls whether new associations or remote configuration commands require cryptographic authentication. This flag can be set or reset by the <tt>enable</tt> and <tt>disable</tt> commands and also by remote configuration commands sent by a <tt>ntpdc</tt> program running on another machine. If this flag is enabled, which is the default case, new broadcast/manycast client and symmetric passive associations and remote configuration commands must be cryptographically authenticated using either symmetric key or public key cryptography. If this flag is disabled, these operations are effective even if not cryptographic authenticated. It should be understood that operating with the <tt>auth</tt> flag disabled invites a significant vulnerability where a rogue hacker can masquerade as a truechimer and seriously disrupt system timekeeping. It is important to note that this flag has no purpose other than to allow or disallow a new association in response to new broadcast and symmetric active messages and remote configuration commands and, in particular, the flag has no effect on the authentication process itself.</p> + <p>The security model and protocol schemes for both symmetric key and public key cryptography are summarized below; further details are in the briefings, papers and reports at the NTP project page linked from <a href="http://www.ntp.org">www.ntp.org</a>.</p> + <h4 id="symm">Symmetric Key Cryptography</h4> + + The original RFC-1305 specification allows any one of possibly 65,534 keys, each distinguished by a 32-bit key identifier, to authenticate an association. The servers and clients involved must agree on the key and key identifier to authenticate NTP packets. Keys and related information are specified in a key file, usually called <tt>ntp.keys</tt>, which must be distributed and stored using secure means beyond the scope of the NTP protocol itself. Besides the keys used for ordinary NTP associations, additional keys can be used as passwords for the <tt><a href="ntpq.html">ntpq</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> utility programs. Ordinarily, the <tt>ntp.keys</tt> file is generated by the <tt><a href="keygen.html">ntp-keygen</a></tt> program. + <p>When <tt>ntpd</tt> is first started, it reads the key file specified in the <tt>keys</tt> configuration command and installs the keys in the key cache. However, individual keys must be activated with the <tt>trustedkey</tt> command before use. This allows, for instance, the installation of possibly several batches of keys and then activating or deactivating each batch remotely using <tt>ntpdc</tt>. This also provides a revocation capability that can be used if a key becomes compromised. The <tt>requestkey</tt> command selects the key used as the password for the <tt>ntpdc</tt> utility, while the <tt>controlkey</tt> command selects the key used as the password for the <tt>ntpq</tt> utility.</p> + <h4 id="pub">Public Key Cryptography</h4> + <p>NTPv4 supports the original NTPv3 symmetric key scheme described in RFC-1305 and in addition the Autokey protocol, which is based on public key cryptography. The Autokey Version 2 protocol described on the <a href="http://www.eecis.udel.edu/%7emills/proto.html">Autokey Protocol</a> page verifies packet integrity using MD5 message digests and verifies the source with digital signatures and any of several digest/signature schemes. Optional identity schemes described on the <a href="http://www.eecis.udel.edu/%7emills/ident.html">Identity Schemes</a> page and based on cryptographic challenge/response algorithms are also available. Using these schemes provides strong security against replay with or without modification, spoofing, masquerade and most forms of clogging attacks.</p> + <p>The Autokey protocol has several modes of operation corresponding to the various NTP modes supported. Most modes use a special cookie which can be computed independently by the client and server, but encrypted in transmission. All modes use in addition a variant of the S-KEY scheme, in which a pseudo-random key list is generated and used in reverse order. These schemes are described along with an executive summary, current status, briefing slides and reading list on the <a href="http://www.eecis.udel.edu/%7emills/autokey.html">Autonomous Authentication</a> page.</p> + <p>The specific cryptographic environment used by Autokey servers and clients is determined by a set of files and soft links generated by the <a href="keygen.html"><tt>ntp-keygen</tt></a> program. This includes a required host key file, required host certificate file and optional sign key file, leapsecond file and identity scheme files. The digest/signature scheme is specified in the X.509 certificate along with the matching sign key. There are several schemes available in the OpenSSL software library, each identified by a specific string such as <tt>md5WithRSAEncryption</tt>, which stands for the MD5 message digest with RSA encryption scheme. The current NTP distribution supports all the schemes in the OpenSSL library, including those based on RSA and DSA digital signatures.</p> + <p>NTP secure groups can be used to define cryptographic compartments and security hierarchies. It is important that every host in the group be able to construct a certificate trail to one or more trusted hosts in the same group. Each group host runs the Autokey protocol to obtain the certificates for all hosts along the trail to one or more trusted hosts. This requires the configuration file in all hosts to be engineered so that, even under anticipated failure conditions, the NTP subnet will form such that every group host can find a trail to at least one trusted host.</p> + <h4>Naming and Addressing</h4> + <p>It is important to note that Autokey does not use DNS to resolve addresses, since DNS can't be completely trusted until the name servers have synchronized clocks. The cryptographic name used by Autokey to bind the host identity credentials and cryptographic values must be independent of interface, network and any other naming convention. The name appears in the host certificate in either or both the subject and issuer fields, so protection against DNS compromise is essential.</p> + <p>By convention, the name of an Autokey host is the name returned by the Unix <tt>gethostname()</tt> system call or equivalent in other systems. By the system design model, there are no provisions to allow alternate names or aliases. However, this is not to say that DNS aliases, different names for each interface, etc., are constrained in any way.</p> + <p>It is also important to note that Autokey verifies authenticity using the host name, network address and public keys, all of which are bound together by the protocol specifically to deflect masquerade attacks. For this reason Autokey includes the source and destinatino IP addresses in message digest computations and so the same addresses must be available at both the server and client. For this reason operation with network address translation schemes is not possible. This reflects the intended robust security model where government and corporate NTP servers are operated outside firewall perimeters.</p> + <h4 id="cfg">Configuration</h4> + <p>Autokey has an intimidating number of options, most of which are not necessary in typical scenarios. The simplest configuration consists of a subnet with one or more servers at the same low stratum acting as trusted hosts and with dependent clients at higher strata and sharing a single secure group and identity scheme. Each trusted host generates a host key, trusted certificate and group key. Each client generates a host key, normal certificate and installs the group key of each trusted host using secure means and renames it as the name of the trusted host.</p> + <p>For example, trusted host Alice generates keys using</p> + <p><tt>ntp-keygen -H -T -I -p xyz</tt></p> + <p>where H specifies a new host key, T the trusted certificate, I the IFF identity scheme and p the password used to encrypt the private key files. The group key file is <tt>ntpkey_IFFpar_alice.<i>filestamp</i></tt><i>, </i>where <i>filestamp </i>represents the NTP time in seconds when the file was generated.</p> + <p>Host Bob generate keys using</p> + <p><tt>ntp-keygen -H -p abc</tt></p> + <p>where <tt>abc</tt> is different for each group host. The trusted host generates a password-protected group key using</p> + <p><tt>ntp-keygen -q xyz -p abc -e ><i>temp</i></tt></p> + <p>where <tt>xyz</tt> is the trusted host password, <tt>abc</tt> is the password supplied by the client and <i><tt>temp</tt></i> is a temporary file. This file is transmitted to Bob using secure means and renamed to the fully qualified host name for Alice preceded by the string <tt>ntpkey_iff_</tt>.</p> + <h4>Operation</h4> + <p>A specific combination of authentication scheme (none, symmetric key, public key) and identity scheme is called a cryptotype, although not all combinations are compatible. There may be management configurations where the clients, servers and peers may not all support the same cryptotypes. A secure NTPv4 subnet can be configured in many ways while keeping in mind the principles explained above and in this section. Note however that some cryptotype combinations may successfully interoperate with each other, but may not represent good security practice.</p> + <p>The cryptotype of an association is determined at the time of mobilization, either at configuration time or some time later when a message of appropriate cryptotype arrives. When mobilized by a <tt>server</tt> or <tt>peer</tt> configuration command and no <tt>key</tt> or <tt>autokey</tt> subcommands are present, the association is not authenticated; if the <tt>key</tt> subcommand is present, the association is authenticated using the symmetric key ID specified; if the <tt>autokey</tt> subcommand is present, the association is authenticated using Autokey.</p> + <h4 id="key">Key Management</h4> + <p>The cryptographic values used by the Autokey protocol are incorporated as a set of files generated by the <a href="keygen.html"><tt>ntp-keygen</tt></a> utility program, including symmetric key, host key and public certificate files, as well as sign key, identity parameters and leapseconds files. Alternatively, host and sign keys and certificate files can be generated by the OpenSSL utilities and certificates can be imported from public certificate authorities. Note that symmetric keys are necessary for the <tt>ntpq</tt> and <tt>ntpdc</tt> utility programs. The remaining files are necessary only for the Autokey protocol.</p> + <p>Certificates imported from OpenSSL or public certificate authorities have certian limitations. The certificate should be in ASN.1 syntax, X.509 Version 3 format and encoded in PEM, which is the same format used by OpenSSL. The overall length of the certificate encoded in ASN.1 must not exceed 1024 bytes. The subject distinguished name field (<tt>CN</tt>) is the fully qualified name of the host on which it is used; the remaining subject fields are ignored. The certificate extension fields must not contain either a subject key identifier or a issuer key identifier field; however, an extended key usage field for a trusted host must contain the value <tt>trustRoot</tt>;. Other extension fields are ignored.</p> + <h4 id="cmd">Authentication Commands</h4> + <dl> + <dt><tt>autokey [<i>logsec</i>]</tt> + <dd>Specifies the interval between regenerations of the session key list used with the Autokey protocol. Note that the size of the key list for each association depends on this interval and the current poll interval. The default value is 12 (4096 s or about 1.1 hours). For poll intervals above the specified interval, a session key list with a single entry will be regenerated for every message sent. + <dt><tt>controlkey <i>key</i></tt> + <dd>Specifies the key identifier to use with the <a href="ntpq.html"><tt>ntpq</tt></a> utility, which uses the standard protocol defined in RFC-1305. The <tt><i>key</i></tt> argument is the key identifier for a trusted key, where the value can be in the range 1 to 65,534, inclusive. + <dt><tt>crypto [cert <i>file</i>] [leap <i>file</i>] [randfile <i>file</i>] [host <i>file</i>] [sign <i>file</i>] [ident <i>scheme</i>] [iffpar <i>file</i>] [gqpar <i>file</i>] [mvpar <i>file</i>] [pw <i>password</i>]</tt> + <dd>This command requires the OpenSSL library. It activates public key cryptography, selects the message digest and signature encryption scheme and loads the required private and public values described above. If one or more files are left unspecified, the default names are used as described above. Unless the complete path and name of the file are specified, the location of a file is relative to the keys directory specified in the <tt>keysdir</tt> command or default <tt>/usr/local/etc</tt>. Following are the subcommands: + <dl> + <dt><tt>cert <i>file</i></tt> + <dd>Specifies the location of the required host public certificate file. This overrides the link <tt>ntpkey_cert_<i>hostname</i></tt> in the keys directory. + + <dt><tt>gqpar <i>file</i></tt> + <dd>Specifies the location of the client GQ parameters file. This overrides the link <tt>ntpkey_gq_<i>hostname</i></tt> in the keys directory. + + <dt><tt>host <i>file</i></tt> + <dd>Specifies the location of the required host key file. This overrides the link <tt>ntpkey_key_<i>hostname</i></tt> in the keys directory. + <dt><tt>ident <i>scheme</i></tt> + <dd>Requests the server identity <i><tt>scheme</tt></i>, which can be <tt>IFF</tt>, <tt>GQ</tt> or <tt>MV</tt>. This is used when the host will not be a server for a dependent client.<dt><tt>iffpar <i>file</i></tt> + <dd>Specifies the location of the optional IFF parameters file.This overrides the link <tt>ntpkey_iff_<i>hostname</i></tt> in the keys directory. + <dt><tt>leap <i>file</i></tt> + <dd>Specifies the location of the client leapsecond file. This overrides the link <tt>ntpkey_leap</tt> in the keys directory. + <dt><tt>mv</tt> + <dd>Requests the MV server identity scheme. + <dt><tt>mvpar <i>file</i></tt> + <dd>Specifies the location of the client MV parameters file. This overrides the link <tt>ntpkey_mv_<i>hostname</i></tt> in the keys directory. + <dt><tt>pw <i>password</i></tt> + <dd>Specifies the password to decrypt files containing private keys and identity parameters. This is required only if these files have been encrypted. + <dt><tt>randfile <i>file</i></tt> + <dd>Specifies the location of the random seed file used by the OpenSSL library. The defaults are described in the main text above. + <dt><tt>sign <i>file</i></tt> + <dd>Specifies the location of the optional sign key file. This overrides the link <tt>ntpkey_sign_<i>hostname</i></tt> in the keys directory. If this file is not found, the host key is also the sign key. + </dl> + <dt><tt>keys <i>keyfile</i></tt> + <dd>Specifies the complete path and location of the MD5 key file containing the keys and key identifiers used by <tt>ntpd</tt>, <tt>ntpq</tt> and <tt>ntpdc</tt> when operating with symmetric key cryptography. This is the same operation as the <tt>-k </tt>command line option. + <dt><tt>keysdir <i>path</i></tt> + <dd>This command specifies the default directory path for cryptographic keys, parameters and certificates. The default is <tt>/usr/local/etc/</tt>. + <dt><tt>requestkey <i>key</i></tt> + <dd>Specifies the key identifier to use with the <a href="ntpdc.html"><tt>ntpdc</tt></a> utility program, which uses a proprietary protocol specific to this implementation of <tt>ntpd</tt>. The <tt><i>key</i></tt> argument is a key identifier for the trusted key, where the value can be in the range 1 to 65,534, inclusive. + <dt><tt>revoke [<i>logsec</i>]</tt> + <dd>Specifies the interval between re-randomization of certain cryptographic values used by the Autokey scheme, as a power of 2 in seconds. These values need to be updated frequently in order to deflect brute-force attacks on the algorithms of the scheme; however, updating some values is a relatively expensive operation. The default interval is 16 (65,536 s or about 18 hours). For poll intervals above the specified interval, the values will be updated for every message sent. + <dt><tt>trustedkey <i>key</i> [...]</tt> + <dd>Specifies the key identifiers which are trusted for the purposes of authenticating peers with symmetric key cryptography, as well as keys used by the <tt>ntpq</tt> and <tt>ntpdc</tt> programs. The authentication procedures require that both the local and remote servers share the same key and key identifier for this purpose, although different keys can be used with different servers. The <tt><i>key</i></tt> arguments are 32-bit unsigned integers with values from 1 to 65,534. + </dl> + <h4 id="err">Error Codes</h4> + <p>Errors can occur due to mismatched configurations, unexpected restarts, expired certificates and unfriendly people. In most cases the protocol state machine recovers automatically by retransmission, timeout and restart, where necessary. Some errors are due to mismatched keys, digest schemes or identity schemes and must be corrected by installing the correct media and/or correcting the configuration file. One of the most common errors is expired certificates, which must be regenerated and signed at least once per year using the <tt><a href="keygen.html">ntp-keygen</a></tt> program.</p> + <p>The following error codes are reported via the NTP control and monitoring protocol trap mechanism.</p> + <dl> + <dt>101 (bad field format or length) + <dd>The packet has invalid version, length or format. + <dt>102 (bad timestamp) + <dd>The packet timestamp is the same or older than the most recent received. This could be due to a replay or a server clock time step. + <dt>103 (bad filestamp) + <dd>The packet filestamp is the same or older than the most recent received. This could be due to a replay or a key file generation error. + <dt>104 (bad or missing public key) + <dd>The public key is missing, has incorrect format or is an unsupported type. + <dt>105 (unsupported digest type) + <dd>The server requires an unsupported digest/signature scheme. + <dt>106 (unsupported identity type)<dd>The client or server has requested an identity scheme the other does not support.<dt>107 (bad signature length) + <dd>The signature length does not match the current public key. + <dt>108 (signature not verified) + <dd>The message fails the signature check. It could be bogus or signed by a different private key. + <dt>109 (certificate not verified) + <dd>The certificate is invalid or signed with the wrong key.<dt>110 (host certificate expired)<dd>The old server certificate has expired.<dt>111 (bad or missing cookie) + <dd>The cookie is missing, corrupted or bogus. + <dt>112 (bad or missing leapseconds table) + <dd>The leapseconds table is missing, corrupted or bogus. + <dt>113 (bad or missing certificate) + <dd>The certificate is missing, corrupted or bogus. + <dt>114 (bad or missing group key)<dd>The identity key is missing, corrupt or bogus. + + <dt>115 (protocol error) + <dd>The protocol state machine has wedged due to unexpected restart + <dt>116 (server certificate expired) + <dd>The old server certificate has expired. + </dl> + <h4 id="file">Files</h4> + <p>See the <a href="keygen.html"><tt>ntp-keygen</tt></a> page.</p> + <h4 id="leap">Leapseconds Table</h4> + <p>The NIST provides a file documenting the epoch for all historic occasions of leap second insertion since 1972. The leapsecond table shows each epoch of insertion along with the offset of International Atomic Time (TAI) with respect to Coordinated Universal Time (UTC), as disseminated by NTP. The table can be obtained directly from NIST national time servers using <tt>ftp</tt> as the ASCII file <tt>pub/leap-seconds</tt>.</p> + <p>While not strictly a security function, the Autokey protocol provides means to securely retrieve the leapsecond table from a server or peer. Servers load the leapsecond table directly from the file specified in the <tt>crypto</tt> command, with default <tt>ntpkey_leap</tt>, while clients can obtain the table indirectly from the servers using the Autokey protocol. Once loaded, the table can be provided on request to other clients and servers.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/build.html b/contrib/ntp/html/build/build.html new file mode 100644 index 0000000..0bb49af --- /dev/null +++ b/contrib/ntp/html/build/build.html @@ -0,0 +1,83 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Building and Installing the Distribution</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Building and Installing the Distribution</h3> + <img src="../pic/beaver.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>For putting out compiler fires.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">03:06 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="270">Monday, October 13, 2003</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#build">Building and Installing the Distribution</a> + <li class="inline"><a href="#unix">Building and Installing under Unix</a> + <li class="inline"><a href="#comp">Compilation</a> + <li class="inline"><a href="#install">Installation</a> + <li class="inline"><a href="#config">Configuration</a> + <li class="inline"><a href="#prob">If You Have Problems</a> + <li class="inline"><a href="#win">Building and Installing under Windows NT</a> + </ul> + <hr> + <h4 id="build">Building and Installing the Distribution</h4> + <p>As a practical matter, every computer architecture and operating system version seems to be different than any other. The device drivers may be different, the input/output system may be idiosyncratic and the libraries may have different semantics. It is not possible in a software distribution such as this one to support every individual system with a common set of binaries, even with the same system but different versions. Therefore, it is necessary to individually configure the software build for each system and version, both at compile time and at run time. In almost all cases, these procedures are completely automatic and all the newbie user need do is type "configure", "make" and "install" in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the <a href="hints.html">Hints and Kinks</a> page.</p> + <p>If available, the OpenSSL library from <a href="http://www.openssl.org">http://www.openssl.org</a> is used to support public key cryptography. The library must be built and installed prior to building NTPv4. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTPv4 configure phase and the interface routines compiled automatically. Only the <tt>libcrypto.a</tt> library and associated header files are used. If the library is not available or disabled, this step is not required.</p> + <h4 id="unix">Building and Installing under Unix</h4> + <p>Make sure that you have all necessary tools for building executables. These tools include <tt>cc/gcc, make, awk, sed, tr, sh, grep, egrep</tt> and a few others. Not all of these tools exist in the standard distribution of modern Unix versions (compilers are likely to be an add-on product). If this is the case, consider using the GNU tools and <tt>gcc</tt> compiler. For a successful build, all of these tools should be accessible via the current path.</p> + <p>The first thing to do is uncompress the distribution and extract the source tree. In the distribution base directory use the <tt>./configure</tt> command to perform an automatic configuration procedure. This command inspects the hardware and software environment and tests for the presence of system header files and the contents of these files to determine if certain features are present. When one or more of these features are present, the code is compiled to use them; if not, no special code is compiled. However, even if the code is compiled to use these features, the code does a special test at run time to see if one or more are actually present and avoids using them if not present. In such cases a warning message is sent to the system log, but the daemon should still work properly.</p> + <p>The default build normally includes the debugging code, which can be useful in diagnosing problems found in initial test, and all reference clock drivers known to work with each machine and operating system. Unless memory space is at a premium, this is a sensible strategy and greatly simplifies debugging and support. If you need to delete either the debugging code or one or all reference clock drivers to save space, see the <a href="config.html">Configuration Options</a> page.</p> + <p>If your site supports multiple architectures and uses NFS to share files, you can use a single source tree to compile executables for all architectures. While running on a target architecture machine and in the distribution base directory create a subdirectory using a command like <tt>mkdir A.`config.guess`</tt>, which will create an architecture-specific directory with name peculiar to the architecture and operating system. Then change to this directory and emit a <tt>../configure</tt> command. The remaining steps are the same whether building in the base directory or in the subdirectory.</p> + <h4 id="comp">Compilation</h4> + <p>Use the <tt>make</tt> command to compile all source modules, construct the libraries and link the distribution. Expect few or no warnings using <tt>cc</tt> and a moderate level of warnings using <tt>gcc</tt>. Note: On some Unix platforms <tt>gcc</tt> may show quite a few complaints about system header files and type inconsistencies, especially with pointer variables. This is usually the case when the system header files are not up to ANSI standards or <tt>gcc </tt>expectations, when <tt>gcc</tt> is not installed properly, or when operating system updates and patches are applied and <tt>gcc</tt> is not reinstalled. While the autoconfigure process is quite thorough, the Unix programming cultures of the various workstation makers still remain idiosyncratic.</p> + <h4 id="install">Installation</h4> + <p>As root, use the <tt>make install</tt> command to install the binaries in the destination directory. Most commonly, these programs are installed in <tt>/usr/local/bin</tt>, but this can be overridden during configuration. You must of course have write permission on the install in the destination directory. This includes the following programs:</p> + <ul> + <li><a href="../ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> + <li><a href="../ntpq.html"><tt>ntpq</tt> - standard NTP query program</a> + <li><a href="../ntpdc.html"><tt>ntpdc</tt> - special NTP query program</a> + <li><a href="../ntpdate.html"><tt>ntpdate</tt> - set the date and time via NTP</a> + <li><a href="../ntptrace.html"><tt>ntptrace</tt> - trace a chain of NTP servers back to the primary source</a> + </ul> + <p>If the precision time kernel modifications are present, the following program is installed:</p> + <ul> + <li><a href="../ntptime.html"><tt>ntptime</tt> - read kernel time variables</a> + </ul> + <p>If the public key authentication functions are present, the following program is installed:</p> + <ul> + <li><a href="../keygen.html"><tt>ntp-keygen</tt> - generate public and private keys</a> + </ul> + <p>In some systems that include the capability to edit kernel variables, the following program is installed:</p> + <ul> + <li><a href="../tickadj.html"><tt>tickadj</tt> - set time-related kernel variables</a> + </ul> + <p>Cryptographic support, both symmetric and public key, requires one or more key files, commonly installed in <tt>/usr/local/etc</tt>. Public key cryptography requires a random seed file, usually called <tt>.rnd</tt>, installed in a dark place such as the root directory or <tt>/etc</tt>. Directions for generating keys is on the <a href="../authopt.html">Authentication Options</a> page.</p> + <h4 id="config">Configuration</h4> + <p>You are now ready to configure the daemon and start it. You will need to create a NTP configuration file <tt>ntp.conf</tt> and a cryptographic key file <tt>ntp.keys</tt>. The latter file is necessary only for remote configuration support, if needed. Newbies should see the <a href="quick.html">Quick Start</a> page for orientation. Seasoned veterans can start with the <a href="../ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page and move on to the specific configuration option pages from there. A tutorial on NTP subnet design and configuration options is in the <a href="../notes.html">Notes on Configuring NTP and Setting up a NTP Subnet</a> page.</p> + <h4 id="prob">If You Have Problems</h4> + <p>If you have problems peculiar to the particular hardware and software environment (e.g. operating system-specific issues), browse the <a href="hints.html">Hints and Kinks</a> page. For other problems a tutorial on debugging technique is in the <a href="../debug.html">NTP Debugging Technique</a> page. As always, the first line of general assistance is the NTP web site <a href="http://www.ntp.org">www.ntp.org</a> and the FAQ resident there. Requests for assistance of a general nature and of interest to other timekeepers should be sent to the NTP newsgroup comp.protocols.time.ntp. Bug reports of a specific nature should be sent to <a href="mailto:bugs@mail.ntp.org">bugs@ntp.org</a>. Bug reports of a specific nature on features implemented by the programmer corps mentioned in the <a href="../copyright.html">Copyright</a> page should be sent directly to the implementor listed in that page, with copy to bugs@ntp.org.</p> + <p>Please include the version of the source distribution (e.g., ntp-4.0.70a) in your bug report, as well as billboards from the relevant utility programs and debug trace, if available. Please include the output of <tt>config.guess</tt> in your bug report. It will look something like:</p> + <p><tt>pdp11-dec-fuzzos3.4</tt></p> + <h4>Additional <tt>make</tt> commands</h4> + <dl> + <dt><tt>make clean</tt> + <dd>Cleans out object files, programs and temporary files. + <dt><tt>make distclean</tt> + <dd>Does the work of <tt>clean</tt>, but cleans out all directories in preparation for a new distribution release. + <dt><tt>make dist</tt> + <dd>Does the work of <tt>make distclean</tt>, but constructs compressed tar files for distribution. You must have GNU automake to perform this function. + </dl> + <h4 id="win">Building and Installing under Windows NT</h4> + <p>See <tt><a href="hints/winnt.html">hints/winnt.htm</a></tt> for directions to compile the sources and install the executables.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/config.html b/contrib/ntp/html/build/config.html new file mode 100644 index 0000000..961779d --- /dev/null +++ b/contrib/ntp/html/build/config.html @@ -0,0 +1,168 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Configuration Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Configuration Options</h3> + <img src="../pic/pogo3a.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>Gnu autoconfigure tools are in the backpack.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">12:56 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="266">Saturday, March 20, 2004</csobj></p> + <br clear="left"> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#basic">Basic Configuration Options - the <tt>configure</tt> utility</a> + <li class="inline"><a href="#opt">Options</a> + <li class="inline"><a href="#dir">Directory and File Names</a> + <li class="inline"><a href="#host">Host Type</a> + <li class="inline"><a href="#pkg">Optional Packages</a> + <li class="inline"><a href="#feat">Optional Features</a> + <li class="inline"><a href="#radio">Radio Clocks</a> + <li class="inline"><a href="#parse">PARSE Clocks</a> + </ul> + <hr> + <h4 id="basic">Basic Configuration Options - the <tt>configure</tt> utility</h4> + <p>The following options are for compiling and installing a working version of the NTP distribution. In most cases, the build process is completely automatic. In some cases where memory space is at a premium, or the binaries are to be installed in a different place, it is possible to tailor the configuration to remove such features as reference clock driver support, debugging support, and so forth.</p> + <p>Configuration options are specified as arguments to the <tt>configure</tt> script. Following is a summary of the current options, as of the 4.0.99m version:</p> + <p>Usage: <tt>configure [options] [host]</tt><br> + </p> + <h4 id="opt">Options</h4> + <p><tt>[defaults in brackets after descriptions]</tt> Configuration:</p> + <pre> + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print `checking...' messages + --version print the version of autoconf that created +configure +</pre> + <h4 id="dir">Directory and File Names</h4> + <pre> + --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +</pre> + <h4 id="host">Host Type</h4> + <pre> + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +</pre> + <h4 id="pkg">Optional Packages</h4> + <pre> + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + + openssl-libdir=DIR OpenSSL object code libraries in DIR [/usr/lib/usr/local/lib/usr/local/ssl/lib] + openssl-incdir=DIR OpenSSL header files in DIR [/usr/include/usr/local/include/usr/local/ssl/include] + crypto=autokey Use autokey cryptography + crypto=rsaref Use the RSAREF library + electricfence Compile with ElectricFence malloc debugger +</pre> + <h4 id="feat">Optional Features</h4> + <pre> + --disable-FEATURE do not include FEATURE (same as + --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + + accurate-adjtime The adjtime() call is accurate + clockctl use /dev/clockctl (non root control of system clock) + debugging Include debugging code [enable] + des Include support for DES keys [enable] + dst-minutes=VALUE Minutes per DST adjustment [60] + gdt-surveying Include GDT survey code [disable] + hourly-todr-sync If we should sync TODR hourly + kernel-fll-bug If we should avoid a (Solaris) kernel FLL bug + kmem Read /dev/kmem for 'tick' and/or 'tickadj' + md5 Include support for MD5 keys [enable] + ntpdate-step If ntpdate should step the time + slew-always Always slew the time + step-slew Step and slew the time + tick=VALUE Force a value for 'tick' + tickadj=VALUE Force a value for 'tickadj' + udp-wildcard Use UDP wildcard delivery +</pre> + <h4 id="radio">Radio Clocks</h4> + <p>(these are ordinarily enabled, if supported by the machine and operating system):</p> + <pre> + all-clocks Include drivers for all suitable non-PARSE clocks [enable] + ACTS NIST dialup clock + ARBITER Arbiter 1088A/B GPS receiver + ARCRON_MSF Arcron MSF receiver + AS2201 Austron 2200A or 2201A GPS receiver + ATOM ATOM PPS interface + AUDIO-CHU CHU audio decoder + BANCOMM Datum/Bancomm BC635/VME interface (requires an explicit --enable-BANCOMM request) + CHRONOLOG Chrono-log K-series WWVB receiver + CHU CHU modem decoder + DATUM Datum Programmable Time System + DUMBCLOCK Dumb generic hh:mm:ss local clock + FG Forum Graphic GPS + GPSVME TrueTime GPS receiver with VME interface (requires an explicit --enable-GPSVME request) + HEATH HeathKit GC-1000 Most Accurate Clock + HOPFPCI HOPF 6039 PCI board + HOPFSERIAL HOPF serial clock device + HPGPS HP 58503A GPS Time & Frequency receiver + IRIG IRIG (Audio) Clock + JUPITER Rockwell Jupiter GPS receiver + LEITCH Leitch CSD 5300 Master Clock System Driver + LOCAL-CLOCK Local clock driver + MSFEES EES M201 MSF receiver + MX4200 Magnavox MX4200 GPS receiver + NMEA NMEA GPS receiver + ONCORE Motorola VP/UT Oncore GPS receiver + PALISADE Palisade clock + PCF Conrad parallel port radio clock + PST PST/Traconex 1020 WWV/H receiver + PTBACTS PTB dialup clock support + SHM Clock attached through shared memory (requires an explicit --enable-SHM request) + SPECTRACOM Spectracom 8170/Netclock/2 WWVB receiver + TRAK TRAK 8810 GPS station clock + TPRO KSI/Odetics TPRO/S IRIG Interface + TRUETIME Kinemetrics/TrueTime (generic) receiver + ULINK Ultralink WWVB receiver + USNO US Naval Observatory dialup clock + WWV WWV audio receiver +</pre> + <h4 id="parse">PARSE Clocks</h4> + <pre> + parse-clocks Include drivers for all suitable PARSE clocks [enable] + COMPUTIME Diem Computime Radio Clock + DCF7000 ELV/DCF7000 Clock + HOPF6021 HOPF 6021 Radio Clock support + MEINBERG Meinberg clocks + RAWDCF DCF77 raw time code + RCC8000 RCC 8000 Radio Clock support + SCHMID SCHMID DCF77 clock support + TRIMTAIP Trimble GPS/TAIP Protocol + TRIMTSIP Trimble GPS/TSIP Protocol + VARITEXT VARITEXT clock + WHARTON Wharton 400A Series clock +</pre> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/hints.html b/contrib/ntp/html/build/hints.html new file mode 100644 index 0000000..b9e230b --- /dev/null +++ b/contrib/ntp/html/build/hints.html @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <title>Hints and Kinks</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Hints and Kinks</h3> + <img src="../pic/alice35.gif" align="left" alt="gif"><a href="http://www.eecis.udel.edu/%7emills/pictures.html"> from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Mother in law has all the answers.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">12:56 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="266">Saturday, March 20, 2004</csobj></p> + <br clear="left"> + <hr> + <p>This is an index for a set of troubleshooting notes contained in individual text files in the <tt>./hints</tt> directory. They were supplied by various volunteers in the form of mail messages, patches or just plain word of mouth. Each note applies to a specific computer and operating system and gives information found useful in setting up the NTP distribution or site configuration. The notes are very informal and subject to errors; no attempt has been made to verify the accuracy of the information contained in them.</p> + <p>Additions or corrections to this list or the information contained in the notes is solicited. The most useful submissions include the name of the computer manufacturer (and model numbers where appropriate), operating system (specific version(s) where appropriate), problem description, problem solution and submitter's name and electric address. If the submitter is willing to continue debate on the problem, please so advise. See the <a href="hints/">directory listing</a>.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/hints/a-ux b/contrib/ntp/html/build/hints/a-ux new file mode 100644 index 0000000..f8c26d2 --- /dev/null +++ b/contrib/ntp/html/build/hints/a-ux @@ -0,0 +1,195 @@ +------------- +INTRODUCTION: +------------- +Last revision: 06-Jul-1994 + +Included in this distribution of XNTP V3 is a configuration file suitable +for use under Apple's A/UX Version 3.x.x There is also one for A/UX 2.0.1 +but it has not been fully tested. To make the executables follow the steps +outlined below. + +*** NOTE: You must have gcc installed to successfully compile the current +distribution; the native cc supplied with A/UX will NOT correctly compile +this source. See the FAQ in comp.unix.aux for places to obtain gcc from +and how to install it. + +---------------------- +MAKING XNTPD FOR A/UX: +---------------------- + +First, you need to create the makefiles (after you've downloaded the +source, of course): + + % make clean + % make refconf + +After that, you should edit Config.local to make sure that BINDIR is +correct for where you wish the programs to be "installed". The default +(and what I use) is /usr/local/etc. Make sure that DEFS_LOCAL and +CLOCKDEFS are commented out! Presently, only the LOCAL_CLOCK/REFCLOCK +clock is used and supported. + + +After this is done (you should be told that your system is A/UX 3), make +'xntpd' (the options to 'gcc' are held in compilers/aux3.gcc): + + % make + +I do not normally use the `make install' option and so have not verified its +compatibility with A/UX. Rather, I pull out each of the executables and +place them in the locally appropriate locations. + +--------------- +STARTING XNTPD: +--------------- + +At this point you need to set things up so that 'xntpd' is started upon +boot-up. You can do this in 1 of 2 ways: either add entries in /etc/inittab +or, more ideally, create and use an /etc/rc.local file. Since rc.local is +what I recommend, here's how you do it: + +By default, A/UX doesn't have rc.local, so you'll need to add the following to +/etc/inittab: + + net6:2:wait:/etc/syslogd # set to "wait" to run a syslog daemon ++ jmj0:2:wait:/etc/rc.local 1>/dev/syscon 2>&1 # Local stuff + dbg2::wait:/etc/telinit v # turn off init's verbose mode + +Now, the look of a sample /etc/rc.local is as follows: + + #!/bin/sh + : + : rc.local + : + # @(#)Copyright Apple Computer 1987 Version 1.17 of rc.sh on 91/11/08 15:56:21 (ATT 1.12) + + + # Push line discipline/set the device so it will print + /etc/line_sane 1 + echo " " + echo "Entering rc.local..." + + set `/bin/who -r` + if [ "$7" = 2 ] + then + /bin/echo " now setting the time..." + /usr/local/etc/ntpdate -s -b <host.domain> + sleep 5 + # + # start up 'xntpd' if we want + # + if [ -f /etc/ntp.conf ] + then + /bin/echo " setting tick and tickadj..." + /usr/local/etc/tickadj -t 16672 -a 54 + sleep 5 + /bin/echo " starting xntpd..." + /usr/local/etc/xntpd <&- > /dev/null 2>&1 + sleep 5 + fi + # + fi + + echo "Leaving rc.local..." + +There are a few things to notice about the above: + + o When run, 'ntpdate' forces your clock to the time returned by the + host(s) specified by <host.domain> (you'll need to replace this + be the IP address(es) of your timehosts. This is good since it gets + things close to start off with. You can use more than one time + server. + + o 'tickadj' is also called. This does two things: changes the + default value of 'tick' (which the the amount of time, in ms, that + is added to the clock every 1/60 seconds) and changes the value + of 'tickadj' which the the amount that is added or subtracted + from 'tickadj' when adjtime() is called. + + Now Mac clocks are pretty bad and tend to be slow. Sooo, instead of + having A/UX add the default of 16666ms every 1/60th of a second, you + may want it to add more (or less) so that it keeps better time. The + above value works for me but your "best" value may be different and + will likely require some fooling around to find the best value. As a + general rule of thumb, if you see 'xntpd' make a lot of negative clock + adjustments, then your clock is fast and you'll need to _decrease_ + the value of 'tick'. If your adjustments are positive, then you need + to increase 'tick'. To make a guess on how fast/slow your clock is, + use 'ntpdate' to sync your clock. Now watch 'xntpd' and see how it + operates. If, for example, it resets your clock by 1 second every 30 + minutes, then your clock is (1/(30*60)) is about 0.056% off and you'll + need to adjust 'tick' by 16666*0.00056 or about 9 (i.e. 'tick' should + be ~16675 if slow or ~16657 if fast) + + A/UX's default value of 'tickadj' is 1666 which is too big for + 'xntpd'... so it also needs to be adjusted. I like using larger + values then the recommended value of 9 for 'tickadj' (although not + anything near as big as 1666) since this allows for quick slews + when adjusting the clock. Even with semi-large values of 'tickadj' + (~200), getting 5ms (1/200 s) accuracy is easy. + + +Finally, before A/UX and 'xntpd' will work happily together, you need to +patch the kernel. This is due to the fact that A/UX attempts to keep the +UNIX-software clock and the Mac-hardware clock in sync. Neither the h/w or +the s/w clock are too accurate. Also, 'xntpd' will be attempting to adjust +the software clock as well, so having A/UX muck around with it is asking +for headaches. What you therefore need to do is tell the kernel _not_ to +sync the s/w clock with the h/w one. This is done using 'adb'. The +following is a shell script that will do the patch for you: + + #! /bin/sh + adb -w /unix <<! + init_time_fix_timeout?4i + init_time_fix_timeout?w 0x4e75 + init_time_fix_timeout?4i + $q + ! + +This must be done _every_ time you create a new kernel (via newconfig or +newunix) or else 'xntpd' will go crazy. + +-------- +HISTORY: +-------- + +John Dundas was the original porter of 'xntpd' and a lot of the additions +and A/UX-ports are from him. I got involved when I wanted to run 'xntpd' +on jagubox. It was also around this time that the base-patchlevel of +'xntpd' changed relatively (the so-called "jones" version). Since then, +I've been maintaining 'xntpd' for A/UX for the xntp development team + +The original kernel patch (which patched 'time_fix_timeout') was from +Richard Todd. I suggest patching 'init_time_fix_timeout' which prevents +'time_fix_timeout' from even being called. + +---------------- +TECHNICAL NOTES: +---------------- + + o As configured (see machines/aux3), 'xntpd' will log messages via syslogd + using the LOC_LOCAL1 facility. I would suggest the following in + /etc/syslog.conf: + + local1.notice /usr/adm/ntpd-syslog + + o As mentioned above, the clocks on A/UX and Macs are kinda bad. Not + only that, but logging in and out of the MacOS mode as well as + extensive floppy use causes A/UX to drop and lose clock interupts + (these are sent every 1/60th of a second). So, if you do these + activities a lot, you find out that you lose about 300ms of time + (i.e., you become 300ms slow). 'xntpd' default way of handling this + is to called 'settimeofday()' and step the clock to the correct + time. I prefer having 'xntpd' slew the clock back into line by + making gradual adjustments to the clock over a coupla minutes + or so. It's for this reason that SLEWALWAYS is defined in + include/ntp_machine.h for SYS_AUX3. It's also for this reason than + I like larger values of 'tickadj'. + +Good luck! If you have problems under A/UX feel free to contact me (e-mail +is preferred). +-- + Jim Jagielski | "That is no ordinary rabbit... 'tis the + jim@jagubox.gsfc.nasa.gov | most foul, cruel and bad-tempered + NASA/GSFC, Code 734.4 | rodent you ever set eyes on" + Greenbelt, MD 20771 | Tim the Enchanter diff --git a/contrib/ntp/html/build/hints/aix b/contrib/ntp/html/build/hints/aix new file mode 100644 index 0000000..e53beff --- /dev/null +++ b/contrib/ntp/html/build/hints/aix @@ -0,0 +1,76 @@ +Problem with recent ANSI compilers + +On some systems, including AIX, the compiler quits on the ntp_refclock.c +file when processing the refclock_report() routine. The problem, which +is eithre a feature or a bug, has to do with an unwanted promotion of +the u_char argument to an int and a failure of the compiler to recognize +the preceding prototype. A workaround is to use ANSI syntax to delare +the arguments. Since ANSI compilers are not universally available, this +syntax can't be used in the stock distribution. + +(Message # 60: 2884 bytes, New) +Date: Sat, 19 Aug 1995 13:20:50 -0400 +From: "R. Bernstein" <rocky@panix.com> +Newsgroups: comp.protocols.time.ntp +to: mills@udel.edu +return-receipt-to: rocky@panix.com +Subject: time and AIX 3.2.5 raw tty bug + +This posting isn't strictly about NTP, any program that may stop the +clock or set the clock backwards is subject to the AIX 3.2.5 bug. + +On AIX 3.2.5, there is a bug in the tty driver for a raw device which +may crash the box under certain conditions: basically a read() on a +raw tty in effect, a character was read but not as many as specified +by VMIN when a read timeout occurred. VTIME specifies the timeout. See +the AIX manual page on termios.h or that include file. for Information +on VMIN (or MIN) VTIME (or TIME). + +A remedy other than to not use raw tty's is to apply patch U435110. + +Details of the problem report follow. + +> ABSTRACT: +> IX43779: TRAP IN PSX_TIMEO +> +> ORIGINATING DETAILS: +> Stacktrace shows: +> IAR: 01460214 posixdd:psx_timeo + 8bf4: ti 4,r12,0x0 +> *LR: 014601a0 posixdd:psx_timeo + 8b80 +> 00212c60: 014604f4 posixdd:psx_timer + 8ed4 +> 00212cc0: 0144b74c ttydd:tty_do_offlevel + 4284 +> 00212d20: 000216fc .i_offlevel + 8c +> 00212d70: 00021d78 .i_softint + c8 +> 00001004: 00008714 .finish_interrupt + 80 +> +> RESPONDER SUMMARY: +> AIX asserted in psx_timeo(). Reason for the assert was that +> the current time was behind psx_ctime. Since this state +> can occur when the current time is changed after a character +> is received but before the VTIME interbyte timer pops, we +> should not assert on this. +> +> RESPONDER CONCLUSION: +> Removed the requirement that current time > psx_ctime by +> adding a new L_ntimersub macro that is used instead of the +> ntimersub macro in time.h. Also added a test for (current +> time - psx_ctime) being negative, in that case we do not +> adjust the new timeout. +> +> Reported to Correct a PTF in Error: NO +> Reported as a Highly pervasive problem: NO +> +> PE Apar?: NoPE +> Hiper Apar?: NoHiper +> Status: CLOSED PER +> Component Name: AIX V3 FOR RS/6 +> Version: 320 +> Component ID: 575603001 +> Submitted: 94/05/03 +> Closed: 94/05/05 +> ChangeTeam: TX2527 +> +> APAR FIXED BY: U431696 U432151 U432844 U432870 U432979 +> U433049 U433081 U433459 U433876 U433906 U434598 U434453 +> U434672 U434737 U435110 + diff --git a/contrib/ntp/html/build/hints/bsdi b/contrib/ntp/html/build/hints/bsdi new file mode 100644 index 0000000..3b8bc38 --- /dev/null +++ b/contrib/ntp/html/build/hints/bsdi @@ -0,0 +1,65 @@ +hints/bsdi + +Author: Bdale Garbee, bdale@gag.com +Last revision: 27Oct94 (Paul Vixie) + +Included in this distribution of XNTP is a configuration file suitable +for use with BSDI's BSD/OS 1.1 (formerly BSD/386 1.1). On this system, +the "cc" command is GCC 1.4x rather than PCC or GCC 2.x. It is imperative +that "cc" be used since it predefines the symbol __bsdi__; if you want to +use another compiler you will need to add -D__bsdi__ to catch the various +#ifdef's required for this system. + +The Kinemetrics/Truetime GPS-TM/TMD driver is known to work on this system. +The GPS-805 and GOES should also work fine. Hell, they should all work fine +but it's hard to test very many locally. + +Due to BNR2's strict interpretation of POSIX and XNTP's use of SIGIO, BSD/OS +can only handle one refclock per daemon. We're working this out with the +system architects. + +The config file is machine/bsdi, and the following steps should be all that +are required to install and use the bits. + +Note that you will need GNU sed; the version supplied with BSD/OS 1.1 loops +endlessly during "make refconf". Likewise you should get GNU make, which +the instructions below assume that you have put in /usr/local/bin/gnumake. + +To build the software: + + rm -f Config.local + gnumake refconf + gnumake MAKE=gnumake + +To install the software: + + gnumake install + + This will place all of the executables in /usr/local/etc. The config + file is expected to be /usr/local/etc/xntp.conf and the key file for + the optional authentication is /etc/ntp.keys. + + Craft a config file and a key file, and put them in the right places. + There is information on how to do this elsewhere in the documentation, + the only thing I'll mention is that I put the drift file in + /var/log/ntp.drift, and the authdelay on my 486DX/50 system is + 0.000064. Your mileage will vary, learn to use the authspeed tools + if you're going to authenticate. + + In the file /etc/rc.local, make sure that the invocation of ntpd is + commented out, and add an invocation of xntpd. Here's what I'm using: + + echo -n 'starting local daemons:' + + if [ -f /etc/ntp.keys -a -f /usr/local/etc/xntp.conf ]; then + echo -n ' xntpd'; /usr/local/etc/xntpd + fi + + #XXX# echo -n ' ntpd'; /usr/libexec/ntpd -t + +At this point, you should be good to go. Try running /usr/local/etc/xntpd and +using ntpq or xntpdc to see if things are working, then pay attention the next +time you reboot to make sure that xntpd is being invoked, and use ntpq or +xntpdc again to make sure all is well. + +Enjoy! diff --git a/contrib/ntp/html/build/hints/changes b/contrib/ntp/html/build/hints/changes new file mode 100644 index 0000000..177e562 --- /dev/null +++ b/contrib/ntp/html/build/hints/changes @@ -0,0 +1,13 @@ +Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (xntpd/refclock_parse.c): + - Added support to supply power from RS232 with CLOCK_RAWDCF. + Known to work with Linux 1.2. + - Made Linux ignore parity errors with CLOCK_RAWDCF. + +Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/dcfd.c): + - Removed conflicting prototype for Linux (sscanf) + - Corrected spelling error + - Made Linux ignore parity errors. + - Added support to supply power from RS232 with CLOCK_RAWDCF. + +Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> (parse/util/testdcf.c): + - Made Linux ignore parity errors. diff --git a/contrib/ntp/html/build/hints/decosf1 b/contrib/ntp/html/build/hints/decosf1 new file mode 100644 index 0000000..bc4ce0b --- /dev/null +++ b/contrib/ntp/html/build/hints/decosf1 @@ -0,0 +1,40 @@ +Some major changes were necessary to make xntp v3 run on the DEC Alpha +hardware running DEC OSF/1. All "long" and "u_long" declarations and +casts in the code were changed to "LONG" and "U_LONG" and a new header +file (include/ntp_types.h) was added. The new header file defines +LONG as int and U_LONG as u_int for the Alpha hardware and as long +and u_long for anything else. A couple of #ifs where changed in +ntpq and xntpdc to get the result of a signal defined correctly. The +Config.decosf1 file built the programs here with no problems. + +I don't have a radio clock here, so none of that code has been tested. +I have run xntpd, xntpdc, xntpres, ntpq, ntpdate, and tickadj under +DEC OSF/1 v1.2-2 (BL10). + +Mike Iglesias Internet: iglesias@draco.acs.uci.edu +University of California, Irvine BITNET: iglesias@uci +Office of Academic Computing uucp: ...!ucbvax!ucivax!iglesias +Distributed Computing Support phone: (714) 856-6926 + +Support for NTP Version 2 is included with the current OSF/1 release. If +you are upgrading to NTP Version 3 with this distribution, you should not +use the xntpd or ntpq programs that come with the OSF/1 release. The +older programs should be replaced by the newer programs of the same name, +either in situ or via a link to a tranquil spot like /usr/local/bin. The +make install script in the this distribution don't work due to a silly +install program incompatibility, so you will need to copy the programs by +hand. + +Don't use the setup utility to install or configure the xntpd installation, +as it will cheerfully clobber your painstakingly crafted ntp.conf program. +However, assuming you put this file in /etc/ntp.conf, you can use the +/sbin/init.d/xntpd script to start and stop the daemon. + +This distribution compiles with nominal mumur with the stock cc compiler +that comes with OSF/1. + +Dave Mills +Electrical Engineering Department +Unibergisty of Delabunch +mills@udel.edu + diff --git a/contrib/ntp/html/build/hints/decosf2 b/contrib/ntp/html/build/hints/decosf2 new file mode 100644 index 0000000..e4a8828 --- /dev/null +++ b/contrib/ntp/html/build/hints/decosf2 @@ -0,0 +1,54 @@ +Problems with DEC OSF/1 V2.0 + +Compilation using gcc fails with ntp_config.c. The problem is an apparent +error in the /usr/include/sys/procset.h and /usr/include/sys/wait.h +include files. + +cowbird:/usr/include/sys# diff -c wait.h.orig wait.h +*** wait.h.orig Tue Feb 22 02:41:38 1994 +--- wait.h Thu Aug 25 14:52:57 1994 +*************** +*** 298,304 **** + #else + + _BEGIN_CPLUSPLUS +! extern int waitid(idtype_t, id_t, siginfo_t *, int); + _END_CPLUSPLUS + #endif /* _NO_PROTO */ + +--- 298,304 ---- + #else + + _BEGIN_CPLUSPLUS +! extern int waitid(idtype_t, pid_t, siginfo_t *, int); + _END_CPLUSPLUS + #endif /* _NO_PROTO */ + +cowbird:/usr/include/sys# diff -c procset.h.orig procset.h +*** procset.h.orig Tue Feb 22 02:41:44 1994 +--- procset.h Thu Aug 25 14:43:52 1994 +*************** +*** 86,95 **** + */ + + idtype_t p_lidtype; /* The id type for the left set. */ +! id_t p_lid; /* The id for the left set. */ + + idtype_t p_ridtype; /* The id type of for right set. */ +! id_t p_rid; /* The id of the right set. */ + } procset_t; + + +--- 86,95 ---- + */ + + idtype_t p_lidtype; /* The id type for the left set. */ +! pid_t p_lid; /* The id for the left set. */ + + idtype_t p_ridtype; /* The id type of for right set. */ +! pid_t p_rid; /* The id of the right set. */ + } procset_t; + +Also, if using gcc from the freeware disk, either replace syscall.h +in the directory /usr/local/lib/gcc-lib/alpha-dec-osf1/2.3.3/include +or replace with a link to /usr/include/sys/syscall.h. diff --git a/contrib/ntp/html/build/hints/freebsd b/contrib/ntp/html/build/hints/freebsd new file mode 100644 index 0000000..ef84732 --- /dev/null +++ b/contrib/ntp/html/build/hints/freebsd @@ -0,0 +1,15 @@ +If you are compiling under FreeBSD and see messages in the syslogs that +indicate that the ntpd process is trying to use unavailable sched_ +calls, it means you are running a kernel that does not have the POSIX +scheduling calls enabled. + +You have two choices: + +- Ignore the messages + +- Generate a new kernel, where the kernel configuration file contains + the lines: + + options "P1003_1B" + options "_KPOSIX_PRIORITY_SCHEDULING" + options "_KPOSIX_VERSION=199309L" diff --git a/contrib/ntp/html/build/hints/hpux b/contrib/ntp/html/build/hints/hpux new file mode 100644 index 0000000..1640d05 --- /dev/null +++ b/contrib/ntp/html/build/hints/hpux @@ -0,0 +1,158 @@ +Last update: Sun Mar 13 15:05:31 PST 1994 + +This file hopefully describes the whatever and however of how to get xntp +running on hpux 7.0 and later s300. s400, s700, and s800. + +First off, all the standard disclaimers hold here ... HP doesn't have anthing +to do with this stuff. I fool with it in my spare time because we use it and +because I like to. We just happen to have a lot of HP machines around here :-) +Xntpd has been in use here for several years and has a fair amount of mileage +on various HP platforms within the company. I can't really guarantee bug fixes +but I'd certainly like to hear about bugs and I won't hestitate to look at +any fixes sent to me. + +Now lets talk OS. If you don't have 7.0 or later, pretty much hang it up now. +This stuff has run here on pretty much everything from 8.0 upward on s300, +s700, and s800. It is known to run on 7.0 s300/s400 but all reports are +from the field and not my personal experience. + +If you are lucky enough to have a s300 or s400 with 9.03, then you no longer +have to worry about adjtimed as HP-UX now has adjtime(2). The rest of you +will have to wait on 10.0 which will have adjtime(2) and a supported though +a bit older version of xntpd. + +Next, let me explain a bit about how this stuff works on HP-UX's that do not +have adjtime(2). The directory adjtime contains libadjtime.a and the adjtimed +daemon. Instead of the adjtime(2) system call, we use a library routine to +talk to adjtimed thru message queues. Adjtimed munges into /dev/kmem and +causes the clock to skew properly as needed. PLEASE NOTE that the adjtime +code provided here is NOT a general replacement for adjtime(2) ... use of +this adjtime(3)/adjtimed(8) other than with xntpd may yield very odd results. + +What to do to get this stuff running ? + + * If you are running an OS less than 10.0 or do not have a s300/s400 + with 9.03 or better + -> cd machines + -> vi hpux + -> (change -DSYS_HPUX=? to match whatever you are running [7,8,9]) + -> cd .. + + * Say "make makeconfig" + + * Say "make", sit back for a few minutes. + + * cd authstuff + * Say "./authcert < certdata" and check the output. Every line should + end with "OK" ... if not, we got trouble. + * Now try "./authspeed auth.samplekeys". What we want to + remember here is the "authentication delay in CPU time" + * cd .. + + * Say "make install" + + * I'd suggest reading the xntp docs about now :-) ... seriously !! + + * One thing I have added to this version of xntpd is a way to select + config files if you are sharing /usr/local thru NFS or whatever. + If the file /usr/local/etc/xntp.conf happens to be a directory, the + files in that directory are searched until a match is found. The + rules for a match are: + + 1. Our hostname + 2. default.<machine id> (as in default.375 or default.850) + 3. default + + * Ok, make sure adjtimed is running (just start it up for now with + "/usr/local/etc/adjtimed"). Using -z as an option will get you + a usage message. + + * Now start up xntpd and watch it work. + + * Make sure that adjtimed gets started at boot right before xntpd. + We do this in /etc/netbsdsrc. They must both run as root !! + +Possible problems ? + + * On some 320's and 835's we have had to run adjtimed with "-p 45" or + so to get rid of syslog messages about "last adjust did not finish". + + * At 9.0, there is a problem with DIAGMON (patch available from the + response center) which causes it to delete the message queue that + adjtimed/xntpd use to communicate. (see next note for result) + + * Xntpd has been known to get really ticked off when adjtime() fails + which is usually only while running the emulation code on HP-UX. + When it gets mad, it usually jumps the clock into never never land. + Possible reasons for this are adjtimed being killed or just never + started or adjtimed being completely swapped out on a really busy + machine (newer adjtimed try to lock themselves in memory to prevent + this one). + +Anything else ... just drop me a line at ken@sdd.hp.com + +Received: from louie.udel.edu by huey.udel.edu id aa14418; 15 Jun 95 9:19 EDT +Received: from host5.colby.edu (host-05.colby.edu) by host-04.colby.edu with ESMTP (1.37.109.15/Colby 1.1) + id AA165442355; Thu, 15 Jun 1995 09:19:16 -0400 +Received: by host5.colby.edu (1.37.109.15/Colby 1.1) + id AA056252339; Thu, 15 Jun 1995 09:18:59 -0400 +Date: Thu, 15 Jun 1995 09:18:59 -0400 (EDT) +From: "Jeff A. Earickson" <jaearick@colby.edu> +To: Mills@huey.udel.edu +Subject: More minor bugs in xntp3.4s +In-Reply-To: <9506150022.aa12727@huey.udel.edu> +Message-Id: <Pine.HPP.3.91.950615083549.4557A-100000@host5.colby.edu> +Mime-Version: 1.0 +Content-Type: TEXT/PLAIN; charset=US-ASCII + +Dave, + After reading the hpux hints file, I realized I didn't install or +start adjtimed. In the course of doing this, I discovered that: + +--> $(TOP) is not defined in adjtime/Makefile, so "make install" can't + find the install.sh script. + +--> "make install" from the main Makefile never goes into the adjtime + directory, so I added the following two lines into the install + target of the main Makefile: + + @echo installing from adjtime + @cd adjtime && $(MAKE) $(MFLAGS) MFLAGS="$(MFLAGS)" MAKE="$(MAKE)" install + +This twiddle may not be right for all systems, but it got adjtimed +installed for me. + + You might also want to add to the hpux hints file that one way to +fire things up at boot time is to add the following lines to the localrc +function of /etc/rc: + + #---daemons for Network Time Protocol (version 3.4s) + #---note that adjtimed is only needed for HP-UX 9.X, not 10.0 + #---adjtimed must be running or xntpd won't work right... + if [ -x /usr/local/bin/adjtimed ]; then + /usr/local/bin/adjtimed -r & echo -n ' adjtimed' + if [ -x /usr/local/bin/xntpd ]; then + /usr/local/bin/xntpd & echo -n ' xntpd' + fi + fi + +I discovered that the "-r" option of adjtimed is needed to clear out any +trash from a previous execution of it. Otherwise adjtimed quietly dies +and leaves xntpd in the lurch... + +Thanks for the help. + +** Jeff A. Earickson, Ph.D PHONE: 207-872-3659 +** Senior UNIX Sysadmin, Information Technology EMAIL: jaearick@colby.edu +** Colby College, 4214 Mayflower Hill, FAX: 207-872-3555 +** Waterville ME, 04901-8842 + +On Thu, 15 Jun 1995 Mills@huey.udel.edu wrote: + +> Jeff, +> +> Read the hpux file in the hints directory. +> +> Dave +> + diff --git a/contrib/ntp/html/build/hints/linux b/contrib/ntp/html/build/hints/linux new file mode 100644 index 0000000..b06a36a --- /dev/null +++ b/contrib/ntp/html/build/hints/linux @@ -0,0 +1,5 @@ +The kernel PLL interface is broken, I know. +Update RSN. + + Torsten + (duwe@informatik.uni-erlangen.de) diff --git a/contrib/ntp/html/build/hints/mpeix b/contrib/ntp/html/build/hints/mpeix new file mode 100644 index 0000000..83c7241e --- /dev/null +++ b/contrib/ntp/html/build/hints/mpeix @@ -0,0 +1,50 @@ +HP e3000 MPE/iX NTP Hints - May 29, 2001 +---------------------------------------- + +NTP was first ported to MPE several years ago, but those diffs were never +submitted back to the official NTP distribution. For more information about +that deprecated port, please see http://www.bixby.org/mark/xntpix.html. + +NTP was re-ported to MPE in May 2001. What follows are hints learned from +working with NTP 4.0.99k23. For additional information about NTP on MPE, +please see http://jazz.external.hp.com/src/hp_freeware/ntp/. + +MPE lacks the clock-related APIs expected by NTP, so adjtime(), gettimeofday(), +and settimeofday() all had to be implemented from scratch by calling +privileged, undocumented internal OS functions. + +Unfortunately the implementation of adjtime() has exposed a sub-second accuracy +bug when slewing the system time. This bug is documented in SR 5003462838, and +exists on all current versions of MPE. It has not been fixed at the time of +this writing. The adjtime() code may possibly need to be altered if/when this +bug is fixed. + +This bug has a side-effect whereby the ntpd daemon will screw up the hardware +PDC clock time by many minutes if used for continuous clock adjustments or in +the one-time -q mode. But note that you can safely run ntpd in order to become +a time server if you include "disable ntp" in the ntp.conf configuration file. + +The one-time clock adjustment functionality of ntpdate and ntp_timeset is not +affected by this bug side-effect. You can safely use these commands to alter +your system time with reasonable accuracy. + +The only reference clock that has been tested on MPE is the local clock. So +building NTP with --disable-all-clocks --enable-LOCAL_CLOCK is strongly +recommended. + +NTP makes use of Privileged Mode (PM) capability in order to bind to the NTP +network port (123) and to access the low-level clock functions. + +NTP was ported using the gcc compiler. Attempting to use the HP C/iX compiler +is not recommended and has not been tested. + +Please note that NTP is not an HP product and is NOT supported by HP. The best +place for asking MPE-specific questions about NTP is the HP3000-L mailing list +at http://raven.utc.edu/Archives/hp3000-l.html or the associated Usenet +newsgroup of comp.sys.hp.mpe. + +The original author of this port is: + +Mark Bixby +HP CSY MPE Internet & Interoperability Engineer +mark_bixby@hp.com diff --git a/contrib/ntp/html/build/hints/netbsd b/contrib/ntp/html/build/hints/netbsd new file mode 100644 index 0000000..f5f628d --- /dev/null +++ b/contrib/ntp/html/build/hints/netbsd @@ -0,0 +1,37 @@ +Starting with NetBSD-1.6, it is possible to delegate the system clock +control to a non root user. This enable running ntpd in a chroot +jail under a non privilegied UID/GID, using ntpd -i and -u flags. + +The delegation is done through the clockctl(4) pseudodevice driver. +This driver makes privilegied system calls such as ntp_adjtime(2) +available through ioctl(2) on the /dev/clockctl device. If a user +is able to write to /dev/clockctl, then (s)he can control the system +clock. + +In order to use this feature, make sure that: + +1) Your kernel is compiled with the following option: +pseudo-device clockctl +This is true for GENERIC kernels on most ports. Please check +http://wwW.netbsd.org/Documentation/kernel/ +if you need information about building a kernel. + +2) You have a ntpd user on your system. Here is the /etc/master.passwd +entry for ntpd user on NetBSD-1.6: +ntpd:*:15:15::0:0:& pseudo-user:/var/chroot/ntpd:/sbin/nologin +And here is the /etc/group entry for group 15: +ntpd:*:15: + +3) /dev/clockctl exists and is writtable by user ntpd. Default +NetBSD-1.6 setting is: +crw-rw---- 1 root ntpd 61, 0 Apr 1 2002 /dev/clockctl +Major device number and date is likely to be different on your system. +If you need to create the device, issue the following command: +cd /dev && ./MAKEDEV clockctl + +Here is an example of how to run ntpd chrooted in /var/chroot/ntpd, +running with ntpd UID and ntpd GID: +ntpd -i /var/chroot/ntpd -u ntpd:ntpd +Note that -i and -u options are enabled at configure time if your +system supports system clock control by an unprivilegied user. If this +is not the case, then the -i and -u options will not be available. diff --git a/contrib/ntp/html/build/hints/notes-xntp-v3 b/contrib/ntp/html/build/hints/notes-xntp-v3 new file mode 100644 index 0000000..ba027f2 --- /dev/null +++ b/contrib/ntp/html/build/hints/notes-xntp-v3 @@ -0,0 +1,119 @@ +Notes for NTP Version 3 + +This version operates in much the same manner as Version 2 with the +following changes and additions: + +1. The protocol machinery operates in conformance with the RFC1305 NTP + Version 3 specification. The most visible characteristic of this + version is that the poll intervals for all polls, even selected + ones, is significantly increased. This is especially desirable when + serving a large client population. This implementation supports + previous versions as non-configured peers; for version-2 configured + peers a "version 2" keyword should be included on the "peer" line. + +2. The configuration file has a new keyword: statfile <file>, where + <file> is the name of a statistics file." When present, each clock + update generates an entry of the form: + + <day> <sec>.<frac> <addr> <status> <offset> <delay> <disp> + + where <day> is the modified Julian day, <sec>.<frac> is the time of + day, <addr> is the peer address and <status> is the peer status. + The <offset>, <delay> and <disp> are the measured offset, delay and + dispersion, respectively, of the peer clock relative to the local + clock. About once per day the current file is closed and a new one + created with names <file>.<gen>, where <gen> starts at one and + increments for each new generation. + +3. A number of additional platforms are supported. See ./Config file + for details. + +4. A driver for the TrueTime 468DC GOES Synchronized Clock is + included. This driver (refclock_goes.c) should also work for other + TrueTime radio clocks, since all use the same format. + +5. A replacement driver for the Spectracom 8170 WWVB Synchronized + Clock is included. This driver (refclock_wwvb.c) (a) does not + require a 1-pulse-per-second signal, (b) supports both format 0 + (original 8170) and format 2 (Netclock/2 and upgraded 8170), (c) + can be connected to more than one computer and (d) automatically + compensates for all serial baud rates. + +6. A driver for the German time/frequency station DCF77 is included. + This requires a special STREAMS module. + +7. In Version 2 special line-discipline modules were required for the + CHU and WWVB drivers. This code continues to work in Version 3, + although it is no longer needed for the WWVB driver. However, this + code does not work under STREAMS, as used in SunOS 4.1.1. + Equivalent STREAMS modules are supplied with Version 3. + +8. Support for an external 1-pulse-per-second (pps) signal is + provided. The signal is connected to a serial port (see + xntpd/ntp_loopfilter.c for details). When present the leading edge + of the pulse establishes the on-time epoch within an interval + established by the selected radio clock or other NTP time server. + Use of the pps is indicated when the tattletale displayed by ntpq + changes from "*" to "o". + +9. The clock-selection and poll-update procedures have been modified + slightly in order to achieve better performance on high speed LANs + with compromise in performance on typical WANs. + +10. In order to comply with U.S. Commerce Department regulations, the DES + encryption routine lib/authdes.c cannot be exported. For exportable + versions of this distribution a DES-encrypted version of this routine + lib/authdes.c.des is included along with an unencrypted version + lib/authdes.c.export, which allows normal operation, but without the + NTP authentication feature. Further information is available in the + lib/authdes.c.export file. + +11. As an alternative to the DES-based authentication mechanism, an + implementation of the RSA Message Digest 5 algorithm is provided. + (see applicable copyright information in the library files). + +12. A driver for the Magnavox MX4200 GPS clock. + +13. A STREAMS module which captures carrier-detect data-lead transitions to + connect a precision source of 1-pps, yet avoid the ugly overhead in the + usual STREAMS processing. See the ppsclock subdirectory. + +14. Support for the Apple A/UX operating system and enhanced support for the + Hewlet-Packard HP/UX operating system. See the various README and Config + files for further information. + +See the COPYRIGHT file for authors and copyright information. Note that some +modules in this distribution contain copyright information that supersedes +the copyright information in that file. + +If I missed something or neglected to give due credit, please advise. + +David L. Mills +University of Delaware +31 May 1992, amended 23 July 1992, 25 October 1992 + +Bugs and notes + +A bug in the original tty_clk_STREAMS.c module has been fixed. + +The poll-interval randomization feature of poll_update (in +xntpd/ntp_proto.c) has been extended to apply when the poll interval is +increased, as well as reduced. This spreads the update messages in time +and helps avoid unpleasant bursts of messages. + +In the clock_select algorithm the peers selected for combining are +limited to those survivors at the lowest stratum, not the entire list. +This helps avoid whiplash when large numbers of peers are at the same +stratum. + +The number formerly displayed by ntpq as "compliance" is now the time +constant of integration. + +The DNS resolver xntpd/ntp_intres.c is now integrated into xntpd, making +configuration of multiple hosts easier. + +System and peer event are now written to the system log at priority +LOG_INFO. + +The leap-second code was fixed to avoid broadcasting leap warnings on +all except the last day of June and December. diff --git a/contrib/ntp/html/build/hints/parse b/contrib/ntp/html/build/hints/parse new file mode 100644 index 0000000..07fbc6b --- /dev/null +++ b/contrib/ntp/html/build/hints/parse @@ -0,0 +1,105 @@ +Compilation: + Usual thing: rm -f Config.local ; make for vanilla + make refconf for reference clock (e. g. DCF77) + +Directory contents: + + hints/PARSE - this file + + xntpd/refclock_parse.c + - reference clock support for DCF77/GPS in xntp + parse/parse.c + - Reference clock data parser framework + parse/parse_conf.c + - parser configuration (clock types) + parse/clk_meinberg.c + - Meinberg clock formats (DCF U/A 31, PZF 535, GPS166) + parse/clk_schmid.c + - Schmid receiver (DCF77) + parse/clk_rawdcf.c + - 100/200ms pulses via 50 Baud line (DCF77) + parse/clk_dcf7000.c + - ELV DCF7000 (DCF77) + parse/clk_trimble.c + - Trimble SV6 GPS receiver + + If you want to add new clock types please check + with kardel <AT> informatik.uni-erlangen.de. These files + implement the conversion of RS232 data streams into + timing information used by refclock_parse.c which is + mostly generic except for NTP configuration constants. + + parse/Makefile.kernel + - *SIMPLE* makefile to build a loadable STREAMS + module for SunOS 4.x / SunOS 5.x systems + + parse/parsestreams.c + - SUN Streams module (loadable) for radio clocks + This streams module is designed for SunOS 4.1.X. + + parse/parsesolaris.c + - SUN Streams module (loadable) for radio clocks. + This streams module is designed for SunOS 5.x + Beware this is still new - so it might crash + your machine (we have seen it working, though). + + parse/parsetest.c + - simple test program for STREAMS module. Its so simple, + that it doesn't even set TTY-modes, thus they got to + be correct on startup - works for Meinberg receivers + + parse/testdcf.c + - test program for raw DCF77 (100/200ms pulses) + receivers + + include/parse.h - interface to "parse" module and more + include/parse_conf.h + - interface to "parse" configuration + + include/sys/parsestreams.h + - STREAMS specific definitions + + scripts/support + - scripts (perl & sh) for statistics and rc startup + the startup scripts are used in Erlangen for + starting the daemon on a variety of Suns and HPs + and for Reference Clock startup on Suns + These scripts may or may not be helpful to you. + +Supported clocks: + Meinberg DCF U/A 31 + Meinberg PZF535/TCXO (Software revision PZFUERL 4.6) + Meinberg PZF535/OCXO (Software revision PZFUERL 4.6) + Meinberg GPS166 (Software version for Uni-Erlangen) + ELV DCF7000 (not recommended - casual/emergency use only) + Conrad DCF77 receiver (email: time@informatik.uni-erlangen.de) + + level converter + TimeBrick (email: time@informatik.uni-erlangen.de) + Schmid Receiver Kit + Trimble SV6 GPS receiver + +Addresses: + Meinberg Funkuhren + Auf der Landwehr 22 + 31812 Bad Pyrmont + Germany + Tel.: 05281/20 18 + FAX: 05281/60 81 80 + + ELV Kundenservice + Postfach 1000 + 26787 Leer + Germany + Tel.: 0491/60 08 88 + + Walter Schmidt + Eichwisrain 14 + 8634 Hombrechtikon + Switzerland + +If you have problems mail to: + + time@informatik.uni-erlangen.de + +We'll help (conditions permitting) + diff --git a/contrib/ntp/html/build/hints/refclocks b/contrib/ntp/html/build/hints/refclocks new file mode 100644 index 0000000..17e7643 --- /dev/null +++ b/contrib/ntp/html/build/hints/refclocks @@ -0,0 +1,35 @@ +This is a short overview for the reference clocks currently supported +by xntp V3. (Ultimate wisdom can be obtained from xntpd/refclock_*.c +this file was derived from that information - unfortunately some comments +in the files tend to get stale - so use with caution) + +Refclock address Type +127.127.0.x no clock (fails to configure) +127.127.1.x local clock - use local clock as reference +127.127.2.x no clock (fails to configure) +127.127.3.x PSTI 1010/1020 WWV Clock +127.127.4.x SPECTRACOM WWVB receiver 8170 and Netclock/2 +127.127.5.x Kinimetric Truetime 468-DC GOES receiver +127.127.6.x IRIG audio decode (Sun & modified BSD audio driver) +127.127.7.x CHU Timecode (via normal receiver & Bell 103 modem) +127.127.8.x PARSE (generic driver for a bunch of DCF/GPS clocks + can be extended for other clocks too) + 8.0-3 Meinberg PZF535/TCXO + 8.4-7 Meinberg PZF535/OCXO + 8.8-11 Meinberg DCF U/A 31 + 8.12-15 ELV DCF7000 + 8.16-19 Walter Schmid DCF receiver (Kit) + 8.20-23 Conrad DCF77 receiver module + level converter (Kit) + 8.24-27 TimeBrick (limited availability ask + time@informatik.uni-erlangen.de) + 8.28-31 Meinberg GPS166 + 8.32-35 Trimble SV6 GPS receiver +127.127.9.x MX4200 GPS receiver +127.127.10.x Austron 2201A GPS Timing Receiver +127.127.11.x Kinemetrics Truetime OM-DC OMEGA Receiver +127.127.12.x KSI/Odetecs TPRO-S IRIG-B / TPRO-SAT GPS +127.127.13.x Leitch: CSD 5300 Master Clock System Driver +127.127.14.x MSFEES +127/127.15.x TrueTime GPS/TM-TMD +127.127.16.x Bancomm GPS/IRIG Ticktock +127.127.17.x Datum Programmable Time System diff --git a/contrib/ntp/html/build/hints/rs6000 b/contrib/ntp/html/build/hints/rs6000 new file mode 100644 index 0000000..8561ac2 --- /dev/null +++ b/contrib/ntp/html/build/hints/rs6000 @@ -0,0 +1,56 @@ +15.7.1993 +xntp3 compiles now again on AIX. I have disabled prototyping and added +the switch -D_NO_PROTO which disables prototyping in the system include +files. + +Matthias Ernst maer@nmr.lpc.ethz.ch +-------------------------------------------------------------------------------- +Xntp version 3 now support the cc compiler for AIX. +The Config.aix will now use cc by default. You can still compile xntp +with the bsd compiler by changing "COMP= cc" to "COMP= bsdcc" and +and removing the "-DSTUPID_SIGNAL" option from the "DEFS" option. + +xntp and tickadj was also modified so that the value of tickadj is read +form the kernel and can be set by tickadj. For now I would not set +tickadj below 40 us. + +Bill Jones +jones@chpc.utexas.edu +------------------------------------------------------------------------------- + +This is a modified version of xntp version 3 for the RS6000. It works for +AIX 3.2 and these are the same changes as have been applied tothe version 2 +implementation of xntp. It works fine for us but I have not tested all of +the features, especially the local clock support for the RS6000 is not tested +at all. + +Matthias Ernst, ETH-Zuerich, Switzerland - maer@nmr.lpc.ethz.ch + +-------------------------------------------------------------------------------- + +Here the original README.rs6000 for the version 2 implementation: + +A hacked version of xntp for the IBM RS/6000 under AIX 3.1 can be found +in xntp.rs6000.tar.Z. [ if still available at all - Frank Kardel 93/12/3 ] + +This will not work on older versions of AIX due to a kernel bug; to find +out whether you have the kernel bug, compile and run testrs6000.c (see +comments in the code for instructions). + +xntp and testrs6000 require "bsdcc" to compile. This is simply another +entry point into the xlc compiler with various options set for BSD +compatibility. If your system does not have bsdcc, do the following: + +link /bin/bsdcc to /bin/xlc + +put the following into /etc/xlc.cfg: + +* BSD compatibility +bsdcc: use = DEFLT + crt = /lib/crt0.o + mcrt = /lib/mcrt0.o + gcrt = /lib/gcrt0.o + libraries = -lbsd, -lc + proflibs = -L/lib/profiled,-L/usr/lib/profiled + options = -H512,-T512, -qlanglvl=extended, -qnoro, -D_BSD, -D_NONSTD_TYPES, -D_NO_PROTO, -tp,-B/lib/ + diff --git a/contrib/ntp/html/build/hints/sco.html b/contrib/ntp/html/build/hints/sco.html new file mode 100644 index 0000000..bd08e98 --- /dev/null +++ b/contrib/ntp/html/build/hints/sco.html @@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <title>SCO Unix hints</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h1>SCO Unix hints</h1> + <h2>Older SCO Unix versions</h2> + <p>NTP 4.0.x does not run on SCO Unix prior to version 3.2.5.0.0. If you need NTP on an older SCO Unix system and don't mind to modify your kernel, use 3.5.91 which has patches for SCO Unix 3.2.4.x. Apply the kernel modifications as described in <a href="http://www.echelon.nl/en/ntp/sco3-recipe.html">XNTP on SCO 3.2.4.2</a>.</p> + <h2>Compiling NTP</h2> + <p>Delete the old SCO supplied NTP programs using the "custom" utility. Run the NTP configure program with CFLAGS="-b elf -K <i>processor-type</i>" for best results.</p> + <h2>Running NTP</h2> + <p>Run "tickadj -As" after every reboot to set the variables "clock_drift" and "track_rtc" to the right values.</p> + <p>Run "ntpd" with a high negative nice-value, i.e. "nice --19 ntpd" for best results.</p> + <h2>More information</h2> + <p>More information on the way SCO Unix and NTP interact can be found in <a href="http://www.echelon.nl/en/ntp/ntp-on-sco.html">NTP on SCO Unix</a>, which includes links to precompiled versions of NTP.</p> + <p><a href="mailto:kees@echelon.nl">Kees Hendrikse</a>, January 1999</p> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/hints/sgi b/contrib/ntp/html/build/hints/sgi new file mode 100644 index 0000000..5e4f7de --- /dev/null +++ b/contrib/ntp/html/build/hints/sgi @@ -0,0 +1,74 @@ +adjtime, tick and tickadj: +-------------------------- + +The SGI value for HZ is 100 under Irix 4, with the system clock running +in nominal mode (ftimer off), so the value for tick is 10000 usec. +Tickadj is a bit more tricky because of the behaviour of adjtime(), +which seems to try to perform the correction over 100-200 seconds, with +a rate limit of 0.04 secs/sec for large corrections. Corrections of +less than 0.017 seconds generally complete in less than a second, +however. + +Some measured rates are as follows: + + Delta Rate (sec/sec) + + > 1 0.04 + 0.75 0.04 + 0.6 0.004 + 0.5 0.004 + 0.4 0.0026 + 0.3 0.0026 + 0.2 0.0013 + 0.1 0.0015 + 0.05 0.0015 + 0.02 0.0003 + 0.01 0.015 +Strange. Anyway, since adjtime will complete adjustments of less than +17msec in less than a second, whether the fast clock is on or off, I +have used a value of 150usec/tick for the tickadj value. + +Fast clock: +----------- + +I get smoother timekeeping if I turn on the fast clock, thereby making +the clock tick at 1kHz rather than 100Hz. With the fast clock off, I +see a sawtooth clock offset with an amplitude of 5msec. With it on, +the amplitude drops to 0.5msec (surprise!). This may be a consequence +of having a local reference clock which spits out the time at exactly +one-second intervals - I am probably seeing sampling aliasing between +that and the machine clock. This may all be irrelevant for machines +without a local reference clock. Fiddling with the fast clock doesn't +seem to compromise the above choices for tick and tickadj. + +I use the "ftimer" program to switch the fast clock on when the system +goes into multiuser mode, but you can set the "fastclock" flag in +/usr/sysgen/master.d/kernel to have it on by default. See ftimer(1). + +timetrim: +--------- + +Irix has a kernel variable called timetrim which adjusts the system +time increment, effectively trimming the clock frequency. Xntpd could +use this rather than adjtime() to do it's frequency trimming, but I +haven't the time to explore this. There is a utility program, +"timetrim", in the util directory which allows manipulation of the +timetrim value in both SGI and xntpd native units. You can fiddle with +default timetrim value in /usr/sysgen/master.d/kernel, but I think +that's ugly. I just use xntpd to figure out the right value for +timetrim for a particular CPU and then set it using "timetrim" when +going to multiuser mode. + +Serial I/O latency: +------------------- + +If you use a local clock on an RS-232 line, look into the kernel +configuration stuff with regard to improving the input latency (check +out /usr/sysgen/master.d/[sduart|cdsio]). I have a Kinemetrics OM-DC +hooked onto /dev/ttyd2 (the second CPU board RS-232 port) on an SGI +Crimson, and setting the duart_rsrv_duration flag to 0 improves things +a bit. + + +12 Jan 93 +Steve Clift, CSIRO Marine Labs, Hobart, Australia (clift@ml.csiro.au) diff --git a/contrib/ntp/html/build/hints/solaris-dosynctodr.html b/contrib/ntp/html/build/hints/solaris-dosynctodr.html new file mode 100644 index 0000000..fc7fae9 --- /dev/null +++ b/contrib/ntp/html/build/hints/solaris-dosynctodr.html @@ -0,0 +1,321 @@ + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> + + +<!-- Sun Template V4.0 9/9/98 --> +<HTML> +<HEAD> +<TITLE>Symptoms and Resolutions Article 19195</title><link href="scripts/style.css" type="text/css" rel="stylesheet"> + +<META NAME="GENERATOR" CONTENT="Sun Microsystems, Inc."> +<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1"> + +<!-- INSERT YOUR META TAGS HERE --> + +<META NAME="PUBLISHED_DATE" CONTENT=""> +<META NAME="KEYWORDS" CONTENT=""> +<META NAME="DESCRIPTION" CONTENT=""> + +<!-- END META TAGS --> + +<LINK REL="Stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style"> + +</HEAD> +<!--stopindex--> +<BODY BGCOLOR="#FFFFFF" LINK="#666699" ALINK="#FFFFFF"> + + +<TABLE WIDTH="623" BORDER="0"> + <TR> + <TD COLSPAN="2" VALIGN="TOP" WIDTH="623"> + <IMG BORDER="0" SRC="/images/homebuy.gif" WIDTH="149" HEIGHT="32" ALT="Home * Buy * My Sun(sm)" USEMAP="#lefttop"><IMG BORDER="0" SRC="/images/globalnavbar.gif" WIDTH="474" HEIGHT="32" ALT="sun.com Global Sections" USEMAP="#topnav"></TD> + </TR> + <TR> + <TD COLSPAN="2" VALIGN="TOP" WIDTH="623"> + + <!-- TITLEBAR IMAGE: INSERT CUSTOMIZED TITLEBAR IMAGE BELOW --> + + <A HREF="http://www.sun.com/"><IMG BORDER="0" SRC="/images/sunlogo.gif" WIDTH="149" HEIGHT="72" ALT="Sun Microsystems"></A><IMG BORDER="0" SRC="/images/titlebar/doc.title.gif" alt="gif" WIDTH="474" HEIGHT="72"></TD> + </TR> + <!-- Begin Search Elements --> + <TR VALIGN="top"> + <TD BGCOLOR="#666699"> + <TABLE> + <TR> + <TD BGCOLOR="#666699" COLSPAN="2" WIDTH="157" VALIGN="TOP"><IMG BORDER="0" SRC="/images/search/contract/search1.gif" WIDTH="157" HEIGHT="16" ALT="Search SunSolve"></TD> + </TR> + <TR> + <TD VALIGN="top" ALIGN="center" WIDTH="141" BGCOLOR="#666699"><FORM ACTION="search.pl" METHOD="POST"><FONT SIZE="2"><INPUT TYPE="text" NAME="zone_32" SIZE="14"></FONT><input type=hidden name=mode value=results><BR> +<INPUT TYPE="image" SRC="/images/search/contract/search5.gif" BORDER="0" NAME="Search"><IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="2" HEIGHT="1" BORDER="0" HSPACE="29" VSPACE="0"><BR> + +<A HREF="search.pl?mode=advanced"><IMG BORDER="0" SRC="/images/search/contract/search3.gif" WIDTH="144" HEIGHT="16" ALT="Advanced Search"></A><BR> + +<A HREF="search.pl?mode=product"><IMG SRC="/images/search/contract/search4.gif" BORDER="0" ALT="Product Search" WIDTH="144" HEIGHT="19"></A><BR> + +<A HREF="show.pl?target=help/search_tips"><IMG SRC="/images/search/contract/search6.gif" BORDER="0" ALT="Search Tips" WIDTH="144" HEIGHT="27"></A></TD> + <TD ALIGN="right"><IMG SRC="/images/search/contract/search2.gif" ALT="" WIDTH="13" HEIGHT="117" BORDER="0"></TD> + </TR> + <!-- End Search Elements --> + <!-- Begin User Personalization (Must limit to 10 Characters)--> + <TR> + <TD COLSPAN="2"><TABLE><TR><TD COLSPAN="3" ALIGN="right"><IMG SRC="/images/home_con/welcom_1.gif" ALT="" WIDTH="156" HEIGHT="4" BORDER="0"></TD></TR> + <TR><TD BGCOLOR="#333366"><IMG SRC="/images/home_con/welcom_2.gif" ALT="" WIDTH="17" HEIGHT="19" BORDER="0"></TD><TD BGCOLOR="#333366" VALIGN="middle"><NOBR><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#99CC33" SIZE="-2">sopko</FONT></NOBR></TD><TD BGCOLOR="#333366" ALIGN="right"><A HREF="edit-user-form.pl?viewmode=contractuser"><IMG SRC="/images/home_con/welcom_3.gif" ALT="Edit" WIDTH="45" HEIGHT="19" BORDER="0"></A></TD></TR> + </TABLE> + </TD> + </TR> + <!-- End User Personalization --> + + <TR> + <TD COLSPAN="2" ALIGN="right" VALIGN="top" WIDTH="157" BGCOLOR="#666699"><IMG BORDER="0" SRC="/images/ssolvecontents.gif" WIDTH="157" HEIGHT="37" ALT="Contents Of SunSolve"><BR> + + + + + + <!-- PILLS: CHANGE THE PILL FOR CURRENT SECTION TO THE HIGHLIGHTED PILL --> + <!-- Beginning of Nav area --> +<A HREF="show.pl?target=patches/patch-access" onmouseover="window.status='All Public Patches'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/p1.gif" WIDTH="157" HEIGHT="19" ALT="All Public Patches"></A><BR> +<A HREF="suncourier.pl" onmouseover="window.status='Submit a Service Order'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/p5.gif" WIDTH="157" HEIGHT="19" ALT="Submit a Service Order"></A><BR> +<A HREF="show.pl?target=resources/tools" onmouseover="window.status='Diagnostic Tools'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/p4.gif" WIDTH="157" HEIGHT="19" ALT="Diagnostic Tools"></A><BR> +<A HREF="show.pl?target=help/collections" onmouseover="window.status='Support Docs.'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/cp2.gif" WIDTH="157" HEIGHT="19" ALT="Support Docs."></A><BR> +<A HREF="show.pl?target=resources/y2k" onmouseover="window.status='Y2K Central'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/p3.gif" WIDTH="157" HEIGHT="19" ALT="Y2K Central"></A><BR> +<A HREF="show.pl?target=security/sec" onmouseover="window.status='Security Information'; return true" onmouseout="window.status=''; return true"> +<IMG BORDER="0" SRC="/images/nav/p2.gif" WIDTH="157" HEIGHT="19" ALT="Security Information"></A><BR> +<br><table width="157"> +<tr><td width="8"> </td><td width="149"> +<table> +<BR><tr><td><BR><img src="/images/line.gif" alt="------" width="140" height="11" border="0"><br> + <A HREF="mark.pl" + onmouseover="window.status='Marked Docs.';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Marked Docs.</FONT></A><BR> + <A HREF="notify.pl" + onmouseover="window.status='Notifications';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Notifications</FONT></A><BR> + <A HREF="/plain-cgi/show.pl?target=home_con" + onmouseover="window.status='Low Graphics';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Low Graphics</FONT></A><BR> + <A HREF="show.pl?target=link" + onmouseover="window.status='SunSolve Servers';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">SunSolve Servers</FONT></A><BR> + <A HREF="show.pl?target=about_sunsolve" + onmouseover="window.status='About SunSolve';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">About SunSolve</FONT></A><BR> + <A HREF="feedback.pl" + onmouseover="window.status='Contact Us';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Contact Us</FONT></A><BR> + <A HREF="show.pl?target=help/sitemap" + onmouseover="window.status='Site Map';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Site Map</FONT></A><BR> + <A HREF="show.pl?target=article/article" + onmouseover="window.status='Articles';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Articles</FONT></A><BR> + <A HREF="show.pl?target=home_con" + onmouseover="window.status='Home';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Home</FONT></A><BR> + <A HREF="show.pl?target=help/faq" + onmouseover="window.status='Help';return true" + onmouseout="window.status='';return true"> + <font class="locallink" color="#dddddd">Help</FONT></A><BR> +<br></td></tr></table></td></tr></table> +<!-- End of Nav area --> + + </FORM> + <br><br><!-- some spacers --> + </TD> + </TR> + </TABLE> + </TD> + <TD VALIGN="TOP" WIDTH="466"> + + + <!--startindex--> + <!-- ============ --> + <!-- MAIN CONTENT --> + <!-- ============ --> + + + +<table width=100%> + <tr> +<td width=100% valign=top> +<CENTER><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2"> +[ <a href="retrieve.pl?type=0&doc=srdb%2F19195&display=plain">Printer Friendly Page</a> ] +[ <b>Was this document useful? <a href="retrieve.pl?type=0&doc=srdb/19195&vote=yes">Yes</a> or <a href="retrieve.pl?type=0&doc=srdb/19195&vote=no">No</a></b> ]<br>[ <a href="notify.pl?action=add&doc=srdb%2F19195&type=synopsis">Notify if Document Changes</a> ] +[ <a href="mark.pl?action=add&doc=srdb%2F19195&type=0">Mark Document for Download</a> ]<br>[ <a href="notify.pl">View/Edit Notifications</a> ] +[ <a href="mark.pl">View/Edit Marked Documents</a> ]<br></FONT></CENTER><br> + <SCRIPT Language="JavaScript"> + <!-- Hide javascript from older browsers + function jump() + { + var ctl = document.docform.jumplist; + location.href = ctl.options[ctl.selectedIndex].value; + } + // End hiding contents --> + </SCRIPT> +<a name="top"> +<form name="docform"><div align=center><font size=2> Jump to <select name="jumplist" size=1 onchange="jump();"></font><option value="#Hardware">Hardware</option> +<option value="#Product">Product</option> +<option value="#Product-Area">Product Area</option> +<option value="#Synopsis">Synopsis</option> +<option value="#Problem-Description">Problem Description</option> +<option value="#Document-Content">Document Content</option> +<option value="#Problem-Solution">Problem Solution</option> +<option value="#SRDB-ID">SRDB ID</option> +<option value="#OS">OS</option> +</select></div></form> +<table width=100%> +<tr bgcolor=#666699><td><font size=2 color=#ffffff><b>SRDB ID</b></font></td> +<td bgcolor=#ffffff><font size=2> </font></td> +<td><font size=2 color=#ffffff><b>Synopsis</b></font></td> +<td bgcolor=#ffffff><font size=2> </font></td> +<td><font size=2 color=#ffffff><b>Date</b></font></td> +</tr> +<tr bgcolor=#CCCCE7><td><font size=2><b>19195</b></font></td> +<td bgcolor=#ffffff><font size=2> </font></td> +<td><font size=2><b>Upgraded to 2.6, using xntpd, but the system clock is drifting. Worked fine</b></font></td> +<td bgcolor=#ffffff><font size=2> </font></td> +<td><font size=2><b>4 Sep 1999</b></font></td> +</tr> +</table><br clear> +<table width=100%><tr bgcolor=#999999> +<td><font size=2 color=#ffffff><b><a name=Problem-Description>Problem Description</a></b></font></td> +<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table> +<pre>Ever since upgrading to Solaris 2.6, the system clock has been drifting and +there are messages like 'synchronisation lost', 'Previous time adjustment +didn''t complete' and 'time reset (step)' a lot in the /var/adm/messages +file. The system either was previously working fine with the freeware +xntpd or the configuration was copied from another system that was +using the freeware version. +-- 23-Apr-99 08:22 US/Eastern --</pre><table width=100%><tr bgcolor=#999999> +<td><font size=2 color=#ffffff><b><a name=Problem-Solution>Problem Solution</a></b></font></td> +<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table> +<pre>The common lore for setting up xntpd on Solaris using +the freeware version included the warning to set the +kernel variable <font color=red>dosynctodr</font> to 0 in the /etc/system +file thus: set <font color=red>dosynctodr</font>=0 + +When using NTP on Solaris 2.6 or later, the kernel +variable MUST be left at the default value of 1. Prior +to 2.6 this variable controlled whether or not to rein +in the softclock using the hardware clock, with the result +that NTP and the hardware clock would fight for control of +the soft clock; thus before 2.6 you had to set <font color=red>dosynctodr</font> +to 0. At 2.6, every system call that adjusts the softclock +also sets the hard clock, thus while NTP controls the soft +clock, the hard clock is also controlled. Setting +<font color=red>dosynctodr</font> to 0 reverts the behavior back to the pre 2.6 +defaulkt behavior, having exactly the opposite effect +as that intended. + +Do not set <font color=red>dosynctodr</font> to 0.</pre><table width=100%> +<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product-Area>Product Area</a></b></font></td> +<td bgcolor=#cccccc valign=top width=75%><font size=2>Bundled Network</font></td></tr> +<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product>Product</a></b></font></td> +<td bgcolor=#cccccc valign=top width=75%><font size=2>NTP</font></td></tr> +<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=OS>OS</a></b></font></td> +<td bgcolor=#cccccc valign=top width=75%><font size=2>Solaris 2.6</font></td></tr> +<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Hardware>Hardware</a></b></font></td> +<td bgcolor=#cccccc valign=top width=75%><font size=2>Ultra 2</font></td></tr> +<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Document-Content>Document Content</a></b></font></td> +<td bgcolor=#cccccc valign=top width=75%><font size=2>with freeware xntpd.</font></td></tr> +</table><br clear> +<font size=2><a href="#top">Top</a></font><br><br> +</td></tr></table> + + <!-- =================== --> + <!-- END OF MAIN CONTENT --> + <!-- =================== --> + <!--stopindex--> + + <!-- DON'T CHANGE INFORMATION OTHER THAN titlebar BELOW THIS LINE --> + + <!-- Altered Table Structure from Template to format properly with new design --> + </TD> + </TR> + <TR> + <TD> </TD> + <TD VALIGN="top"> + <center> + <IMG SRC="/images/cg_grey_line.gif" ALT="" WIDTH="466" HEIGHT="2" BORDER="0"><BR> + <IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="1" HEIGHT="2" BORDER="0" HSPACE="0" VSPACE="4"> + </center> + <CENTER> + <FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2"> + [ <A HREF="edit-user-form.pl?viewmode=contractuser">Edit Account</A> ] + [ <A HREF="show.pl?target=patches/patch-access">Patches</A> ] + [ <A HREF="suncourier.pl">Submit a Service Order</A> ]<br> + [ <A HREF="show.pl?target=resources/tools">Diagnostic Tools</A> ] + [ <A HREF="show.pl?target=help/collections">Support Docs.</A> ] + [ <A HREF="show.pl?target=resources/y2k">Y2K Central</A> ] + [ <A HREF="show.pl?target=security/sec">Security Information</A> ] <br> + [ <A HREF="show.pl?target=link">SunSolve Servers </A> ] + [ <A HREF="show.pl?target=about_sunsolve">About SunSolve</A> ] + [ <A HREF="feedback.pl">Contact Us</A> ] + [ <A HREF="show.pl?target=help/sitemap">Site Map</A> ] + [ <A HREF="show.pl?target=article/article">Articles</A> ] + [ <A HREF="show.pl?target=home_con">Home</A> ] + [ <A HREF="show.pl?target=help/faq">Help</A> ] + </FONT> + </CENTER> + +<!-- MAPS --> +<MAP NAME="lefttop"> +<AREA SHAPE="rect" HREF="http://www.sun.com/MySun/" ALT="My Sun" COORDS="89,0 149,32"> +<AREA SHAPE="rect" HREF="show.pl?target=home_con" ALT="Home" COORDS="0,0 42,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/sales/" ALT="Buy" COORDS="54,0 78,32"> +</MAP> + + +<MAP NAME="topnav"> +<AREA SHAPE="rect" HREF="http://www.sun.com/java/" ALT="Java Technologies" COORDS="4,0,67,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/products-n-solutions/" ALT="Products and Solutions" COORDS="74,0,141,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/service/" ALT="Support, Education, and Consulting" COORDS="148,0,249,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/tech/" ALT="Technology and Research" COORDS="261,0,324,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/developers/developers.html" ALT="For Developers" COORDS="334,0,396,32"> +<AREA SHAPE="rect" HREF="http://www.sun.com/corporateoverview/" ALT="Corporate Information" COORDS="406,0,482,32"> +</MAP> + +<!-- INSERT titlebar HREFS BELOW --> +<MAP NAME="titlebar"> +<!-- LINK TO SEC HOME Removed because no longer needed on this template --> +<AREA SHAPE="rect" HREF="/visual/home/" ALT="SunSolve Online(tm)" COORDS="0,21,215,51"> <!-- LINK TO CURRENT PILL HOME --> +</MAP> + + +<!-- begin copyright notice --> + +<BR> +<CENTER> +<FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#999999" SIZE="2"> +<br> +Copyright 1994-1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA. +<br> +All rights reserved. +<a href="http://www.sun.com/share/text/SMICopyright.html">Legal Terms</a>. +<a href="http://www.sun.com/privacy/">Privacy Policy</a>. +</font> +</CENTER> + +<!-- end copyright notice --> + + </TD> + </TR> +</TABLE> + +</BODY> +</HTML> + diff --git a/contrib/ntp/html/build/hints/solaris.html b/contrib/ntp/html/build/hints/solaris.html new file mode 100644 index 0000000..9dc2ab1 --- /dev/null +++ b/contrib/ntp/html/build/hints/solaris.html @@ -0,0 +1,144 @@ +<HTML> +<HEAD> +<TITLE>Solaris hints and kinks</title><link href="scripts/style.css" type="text/css" rel="stylesheet"> + +</HEAD> +<BODY> +Information on compiling and executing ntpd under Solaris. +<BR> +Last Updated: Sun Jun 21 01:32:18 EDT 1998, +John Hawkinson, +<! -- This is deliberately not a mailto -- > <jhawk@MIT.EDU> +<P> +If you're not running Solaris 2.5.1 or later, it is likely +that you will have problems; upgrading would be a really good plan. +<P> +<H3>All Solaris versions</H3> +<P> + We have a report that says starting with Solaris 2.6 we should leave + <I>dosynctodr</I> alone. + <A HREF="solaris-dosynctodr.html">Here is the report</A>. +<P> +Proper operation of ntp under Solaris may require setting the kernel +variable <I>dosynctodr</I> to zero (meaning "do not synchronize the clock +to the hardware time-of-day clock"). This can be done with the +tickadj utility: +<BLOCKQUOTE><TT> +tickadj -s +</TT></BLOCKQUOTE> +If you prefer, it can also be done with the native Solaris kernel debugger: +<BLOCKQUOTE><TT> +echo dosynctodr/W0 | adb -k -w /dev/ksyms /dev/mem +</BLOCKQUOTE></TT> +<P> +Or, it can also be set by adding a line to /etc/system: +<BLOCKQUOTE><TT> +set dosynctodr = 0 +</BLOCKQUOTE></TT> +<P> +Instead of the <I>tick</I> kernel variable, which many operating +systems use to control microseconds added to the system time every +clock tick (c.f. <A HREF="../../notes.html#frequency_tolerance">Dealing +with Frequency Tolerance Violations</A>), Solaris has the variables +<I>nsec_per_tick</I> and <I>usec_per_tick</I>. +<P> +<I>nsec_per_tick</I> and <I>usec_per_tick</I> control the number of +nanoseconds and microseconds, respectively, added to the system clock +each clock interrupt. Enterprising souls may set these based on +information collected by ntpd in the <CODE>/etc/ntp.drift</CODE> file +to correct for individual hardware variations. +<P> +On UltraSPARC systems, <I>nsec_per_tick</I> and <I>usec_per_tick</I> +are ignored in favor of the <I>cpu_tick_freq</I> variable, which +should be automatically be determined by the PROM in an accurate +fashion. +<P> +In general, the same ntp binaries should not be used across multiple +operating system releases. There is enough variation in the core operating +system support for timekeeping that a rebuild of ntpd for the idiosyncracies +of your specific operating system version is advisable. +<P> +It is recommended that ntp be started via a script like <A +HREF="solaris.xtra.S99ntpd">this one</A>, installed in +<CODE>/etc/init.d/ntpd</CODE> with a symbol link from +<CODE>/etc/rc2.d/S99ntpd</CODE>. + +<H3>Solaris 2.6</H3> +<P> +Solaris 2.6 adds support for kernel PLL timekeeping, but breaks this +support in such a fashion that using it worse than not. This is <A +HREF="solaris.xtra.4095849"> SUN Bug ID 4095849</A>, and it is not yet +fixed as of June 1998. +<P> +<H3>Solaris 2.5 and 2.5.1</H3> +<P> +On UltraSPARC systems, calculation of <I>cpu_tick_freq</I> is broken +such that values that are off by significant amounts may be used +instead. This unfortunately means that ntpd may have severe problems +keeping synchronization. This is <A HREF="solaris.xtra.4023118"> SUN Bug ID +4023118</A>. Bryan Cantrill <! -- <bmc@eng.sun.com> --> of Sun +posted <A HREF="solaris.xtra.patchfreq">patchfreq</A>, a workaround script, +to comp.protocols.time.ntp in March of 1997. +<P> +<HR> +<H2>OLD DATA</H2> +<STRONG>I can't vouch for the accuracy the information below this +rule. It may be significantly dated or incorrect.</STRONG> +<P> +<P> +<H3>Solaris 2.2</H3> +<P> +Solaris 2.2 and later contain completely re-written clock code to +provide high resolution microsecond timers. A benefit of the +re-written clock code is that adjtime does not round off its +adjustments, so ntp does not have to compensate for this +rounding. Under Solaris 2.2 and later, ntp #define's +<CODE>ADJTIME_IS_ACCURATE</CODE>, and does not look for the <I>tickadj</I> +kernel variable. +<P> +<H3>Solaris 2.1</H3> +(This originally written by William L. Jones <jones@chpc.utexas.edu>) +<P> +Solaris 2.1 contains fairly traditional clock code, with <I>tick</I> +and <I>tickadj</I>. +<P> +Since settimeofday under Solaris 2.1 only sets the seconds part of timeval +care must be used in starting xntpd. I suggest the following start +up script: +<BLOCKQUOTE><TT> +tickadj -s -a 1000 +<BR>ntpdate -v server1 server2 +<BR>sleep 20 +<BR>ntpdate -v server1 server2 +<BR>sleep 20 +<BR>tickadj -a 200 +<BR>xntpd +</TT></BLOCKQUOTE> + +The first tickadj turns of the time of day clock and sets the tick +adjust value to 1 millisecond. This will insure that an adjtime value +of at most 2 seconds will complete in 20 seconds. +<P> +The first ntpdate will set the time to within two seconds +using settimeofday or it will adjust time using adjtime. +<P> +The first sleep insures the adjtime has completed for the first ntpdate. +<P> +The second ntpdate will use adjtime to set the time of day since the +clock should be within 2 seconds of the correct time. +<P> +The second tickadj set the tick adjust system value to 5 microseconds. +<P> +The second sleeps insure that adjtime will complete before starting +the next xntpd. +<P> +I tried running with a tickadj of 5 microseconds with out much success. +200 microseconds seems to work well. +<P> +<HR> +Prior versions of this file had major text contributed by: +<MENU> +<LI>Denny Gentry <denny@eng.sun.com> +</MENU> +<BODY> +</HTML> diff --git a/contrib/ntp/html/build/hints/solaris.xtra.4023118 b/contrib/ntp/html/build/hints/solaris.xtra.4023118 new file mode 100644 index 0000000..84c5d15 --- /dev/null +++ b/contrib/ntp/html/build/hints/solaris.xtra.4023118 @@ -0,0 +1,36 @@ + Bug Id: 4023118 + Category: kernel + Subcategory: other + State: integrated + Synopsis: sun4u doesn't keep accurate time + Description: + +[ bmc, 12/20/96 ] + +The clock on a sun4u drifts unacceptably. On a typical 143 mHz Ultra, +the clock took 1.0001350 seconds to count 1 second. While this may seem +trivial, it adds up quickly. In this case, the TOD chip will have to +pull the clock forward by 2 seconds every 4 hours and 7 minutes. +This drift rate is so high, that the clock is close to being too broken +for NTP to guarantee correctness (in order for NTP's mechanism to work, +it must be assured that the local clock drifts no more than 20 ms in 64 +seconds; this particular 143 mHz Ultra will drift by nearly 9 ms in that +period). This problem has been reproduced on virtually all sun4u +classes. + +The fundamental problem lies in the kernel's perception of ticks per +second. The PROM is responsible for determining this figure exactly, +and the kernel extracts it into the variable cpu_tick_freq. On sun4u's, +this number is disconcertingly round: 143000000, 167000000, 248000000, +etc. Indeed, a simple experiment revealed that these numbers were +quite far from the actual ticks per second. Typical was the 143 mHz +Ultra which was discovered to tick around 142,980,806 (+/- 10) times +per second. + + Work around: + + Integrated in releases: s297_27 + Duplicate of: + Patch id: + See also: + Summary: diff --git a/contrib/ntp/html/build/hints/solaris.xtra.S99ntpd b/contrib/ntp/html/build/hints/solaris.xtra.S99ntpd new file mode 100644 index 0000000..d8058fd --- /dev/null +++ b/contrib/ntp/html/build/hints/solaris.xtra.S99ntpd @@ -0,0 +1,21 @@ +#!/bin/sh +if [ $1 = "start" ]; then + if [ -x /usr/local/bin/xntpd ]; then + echo "Starting NTP daemon, takes about 1 minute... " + # dosynctodr may need to be left alone as of with Solaris 2.6 + # The following line is unnecessary if you turn off + # dosynctodr in /etc/system. + /usr/local/bin/tickadj -s + /usr/local/bin/ntpdate -v server1 server2 + sleep 5 + /usr/local/bin/xntpd + fi +else + if [ $1 = "stop" ]; then + pid=`/usr/bin/ps -e | /usr/bin/grep xntpd | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` + if [ "${pid}" != "" ]; then + echo "Stopping Network Time Protocol daemon " + /usr/bin/kill ${pid} + fi + fi +fi diff --git a/contrib/ntp/html/build/hints/solaris.xtra.patchfreq b/contrib/ntp/html/build/hints/solaris.xtra.patchfreq new file mode 100644 index 0000000..9600881 --- /dev/null +++ b/contrib/ntp/html/build/hints/solaris.xtra.patchfreq @@ -0,0 +1,85 @@ +#!/bin/ksh + +# +# File: patchfreq +# Author: Bryan Cantrill (bmc@eng.sun.com), Solaris Performance +# Modified: Sat Apr 26 04:00:59 PDT 1997 +# +# This is a little script to patch a 5.5 or 5.5.1 kernel to get around +# the cpu_tick_freq inaccuracy. Before running this script, one must +# know the true frequency of one's CPU; this can be derived by NTP, +# or by observing the clock relative to the time-of-day chip over a +# long period of time (the TOD will pull system time when it drifts +# by more than two seconds). +# +# Patching a kernel can render a machine unbootable; do not run this +# script unless you are prepared to accept that possibility. It +# is advisable to have a backout path (e.g. net booting, an alternate +# boot disk, an installation CD) should your machine fail to boot. +# +# This is not a product of Sun Microsystems, and is provided "as is", +# without warranty of any kind expressed or implied including, but not +# limited to, the suitability of this script for any purpose. +# + +if [ $# -eq 0 ]; then + echo "Usage: $0 cpu_tick_freq [ alternate_kernel ]" + exit 1 +fi + +cpu_tick_freq=$1 +kernel=/platform/sun4u/kernel/unix + +if [ $# -eq 2 ]; then + kernel=$2 +fi + +if [ ! -w $kernel ]; then + echo "$0: Cannot open $kernel for writing." + exit 1 +fi + +arch=`echo utsname+404?s | adb $kernel | cut -d: -f2` + +if [ ! $arch = "sun4u" ]; then + echo "Patch only applies to sun4u" + exit 1 +fi + +rel=`echo utsname+202?s | adb $kernel | cut -d: -f2` + +if [ ! $rel = "5.5" ] && [ ! $rel = "5.5.1" ]; then + echo "Patch only applies to 5.5 or 5.5.1..." + exit 1 +fi + +nop="1000000" # nop +store_mask="ffffe000" # mask out low 13 bits +store="da256000" # st %o5, [%l5 + offset] + +instr=`echo setcpudelay+34?X | adb $kernel | cut -d: -f 2 | nawk '{ print $1 }'` + +if [ $instr = $nop ]; then + echo "Instruction already patched..." +else + let masked="(16#$store_mask & 16#$instr) - 16#$store" + if [ $masked -ne 0 ]; then + echo "Couldn't find instruction to patch; aborting." + exit 1 + fi + + if ! echo setcpudelay+34?W $nop | adb -w $kernel 1> /dev/null + then + echo "adb returned an unexpected error; aborting." + fi +fi + +echo "Patching cpu_tick_freq to $cpu_tick_freq..." + +if ! echo cpu_tick_freq?W 0t$cpu_tick_freq | adb -w $kernel 1> /dev/null; then + echo "adb returned an unexpected error; aborting." + exit 1 +fi + +echo "$kernel successfully patched." +exit 0 diff --git a/contrib/ntp/html/build/hints/sun4 b/contrib/ntp/html/build/hints/sun4 new file mode 100644 index 0000000..424fa18 --- /dev/null +++ b/contrib/ntp/html/build/hints/sun4 @@ -0,0 +1,15 @@ +Notes on CPU clock oscillator tolerance with SunOS 4.1.1 and 4.1.3 + +A bug in SunOS 4.1.1 results in the kernel time losing 1 microsecond +per tick of the system clock. The bug was fixed (bugid 1094383) for +SunOS 4.1.1 and corrected in SunOS 4.1.3. The easiest way to fix this +is to replace the 4.1.1 binary clock.o with the corresponding 4.1.3 +binary. Without this change it is necessary to use the tickadj program +included in this distribution with the -t 9999 option. + +The tickadj option will work in all cases except when the kernel has +been modified to correct the CPU clock oscillator frequency using a +1-pps signal from a precision source. The bugfix must be installed for +this wrinkle to work properly. + +Dave Mills (mills@udel.edu) diff --git a/contrib/ntp/html/build/hints/svr4-dell b/contrib/ntp/html/build/hints/svr4-dell new file mode 100644 index 0000000..2c92f8a --- /dev/null +++ b/contrib/ntp/html/build/hints/svr4-dell @@ -0,0 +1,8 @@ +Notes on the DELL SVR4. + +You should use -DSETTIMEOFDAY_BROKEN. + +Philip.Gladstone@mail.citicorp.com + +(XXX But there is no checking for SETTIMEOFDAY_BROKEN in the code) + diff --git a/contrib/ntp/html/build/hints/svr4_package b/contrib/ntp/html/build/hints/svr4_package new file mode 100644 index 0000000..b9f5ca3 --- /dev/null +++ b/contrib/ntp/html/build/hints/svr4_package @@ -0,0 +1,33 @@ +Date: Wed, 12 Apr 1995 12:42:03 +0100 +Message-ID: <513.797686923@concurrent.co.uk> +From: Andy Chittenden <asc@concurrent.co.uk> + +Dave + +Here is a uuencoded, compressed tar file. The only file I've +changed is Makefile - I've included the full file rather than diffs. +There are some new files as well: + + xntp shell script that starts up ntp during boot up + (the packaging stuff creates links to it so it comes + up at run level 2). As with all svr4 start/stop + scripts, it takes one parameter which is either + start or stop. It assumes that ntp.conf is in + /etc/inet/ntp.conf (where it should be on svr4 + machines). + prototype describes the file contents of the package. + You might like to review its contents to + see whether you want to include any other + files or remove some. NB I've made the man + pages go into 1m as they should on svr4. + preinstall runs before installation takes place. It + ensures that ntp is down if it is up before + installing a replacement package + postinstall starts up ntp after package installation. + preremove brings down ntp before removing the package. + +You create a package using "make package". This creates a file +called xntp.pkg. To install this package, you use +"pkgadd -d `pwd`/xntp.pkg xntp". This will start up ntp if +/etc/inet/ntp.conf exists. If you don't want the package anymore, use +"pkgrm xntp". I have tested this on Solaris 2.4. diff --git a/contrib/ntp/html/build/hints/todo b/contrib/ntp/html/build/hints/todo new file mode 100644 index 0000000..e0e5ffa --- /dev/null +++ b/contrib/ntp/html/build/hints/todo @@ -0,0 +1,4 @@ +Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>: + Any change in a source file in the lib directory causes all files to + be recompiled (because the objects are removed). Add a better rule for + make to update the library. Maybe just remove "-rm -f $?". diff --git a/contrib/ntp/html/build/hints/vxworks.html b/contrib/ntp/html/build/hints/vxworks.html new file mode 100644 index 0000000..95ad222 --- /dev/null +++ b/contrib/ntp/html/build/hints/vxworks.html @@ -0,0 +1,82 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <title>vxWorks Port of NTP</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body link="#00008B" vlink="#8B0000"> + <h1>VxWorks port of NTP</h1> + <p>Creating a port for vxWorks posed some problems. This port may help as a starting point for similar ports to real-time OS's and other embeddable kernels, particularly where main() is not allowed, and where the configure scripts need to be altered.</p> + <h1><b>Configuration issues</b></h1> + <p>I decided to do as little invasive surgery as possible on the NTP code, so I brought the vxWorks header tree in line with the standard unix tree. The following changes were needed, as a side effect these changes will allow for easy porting of other autoconfigure enabled code.</p> + <p>Where I have 386 you will need to put in your target type. The vxWorks tree entry point is /usr/wind. If these are the same for your system, you should be able to cut and paste the changes.</p> + <p><blink>WARNING: Check you are not overwriting files, before entering the following: there should be no conflict, but check first... </blink></p> + <p>export CC="cc386 -nostdlib -m486 -DCPU=I80486 -I/usr/wind/target/h"<br> + export RANLIB=ranlib386<br> + export AR=ar386<br> + export VX_KERNEL=/usr/wind/target/config/ims_std_bsp/vxWorks<br> + cd /usr/wind/target/sys<br> + ln -s ../signal.h<br> + ln -s ../time.h<br> + ln -s socket.h sockio.h<br> + ln -s ../selectLib.h select.h<br> + ln -s ../timers.h<br> + touch file.h param.h resource.h utsname.h var.h ../netdb.h ../a.out.h ../termios.h<br> + echo " ******ADD #include \"sys/times.h\" to sys/time.h "</p> + <p>The configure script must be changed in the following way to get the linking tests to work, once in the correct directory issue the following commands:<br> + sed -e 's%main.*()%vxmain()%' configure > configure.vxnew<br> + mv configure.vxnew configure<br> + chmod 755 configure</p> + <p>The new version 4 of NTP requires some maths functions so it links in the maths library (-lm) in the ntpd <a href="../../ntpd/Makefile.am">Makefile.am</a> change the line "ntpd_LDADD = $(LDADD) -lm" by removing the "-lm".<br> + You are now ready to compile</p> + <p><br> + The <a href="../../configure.in">configure.in </a>file needed to be altered to allow for a host-target configuration to take place.</p> + <ul> + <li>The define SYS_VXWORKS was added to the compilation flags. + <li>Little endianess is set if the target is of type iX86. + <li>The size of char, integer, long values are all set. If Wind River ever changes these values they will need to be updated. + <li>clock_settime() is defined to be used for setting the clock. + <li>The Linking flags have -r added to allow for relinking into the vxWorks kernel + </ul> + <p>Unfortunately I have had to make use of the <a href="../../include/ntp_machine.h">ntp_machine.h </a>file to add in the checks that would have been checked at linking stage by autoconf, a better method should be devised.</p> + <ul> + <li>There is now a NO_MAIN_ALLOWED define that simulates command line args, this allows the use of the normal startup sysntax. + <li>POSIX timers have been added. + <li>Structures normally found in netdb.h have been added with, the corresponding code is in <a href="../../libntp/machines.c">machines.c </a>. Where possible the defines for these have been kept non-vxWorks specific. + </ul> + <p>Unfortunately there are still quite a few SYS_VXWORKS type defines in the source, but I have eliminated as many as possible. You have the choice of using the usrtime.a library avaliable from the vxworks archives or forgoing adjtime() and using the clock_[get|set]time().The <a href="../../include/ntp_machine.h">ntp_machine.h </a>file clearly marks how to do this.</p> + <h1><b>Compilation issues</b></h1> + <p>You will need autoconf and automake ... available free from the gnu archives worldwide.</p> + <p>The variable arch is the target architecture (e.g. i486)</p> + <p>mkdir A.vxworks (or whatever....)<br> + cd A.vxworks<br> + ../configure --target=arch-wrs-vxworks [any other options]<br> + make</p> + <p>Options I normally use are the --disable-all-clocks --enable-LOCAL-CLOCK flags. The program should proceed to compile without problem. The daemon ntpd, ntpdate, ntptrace, ntpdc, ntpq programs and of course the libraries are all fully ported. The other utilities are not, but they should be easy to port.</p> + <h1>Running the software</h1> + <p>Load in the various files, call them in the normal vxWorks function type manner. Here are some examples. Refer to the man pages for further information.</p> + <p>ld < ntpdate/ntpdate<br> + ld < ntpd/ntpd<br> + ld < ntptrace/ntptrace<br> + ld < ntpq/ntpq<br> + ld < ntpdc/ntpdc<br> + ntpdate ("-b", "192.168.0.245")<br> + sp(ntpd, "-c", "/export/home/casey/ntp/ntp.conf")<br> + ntpdc("-c", "monlist", "192.168.0.244")<br> + ntpq("-c", "peers", "192.168.0.244")<br> + ntptrace("192.168.0.244")<br> + </p> + <h1>Bugs and such</h1> + <p>Should you happen across any bugs, please let me know, or better yet fix them and submit a patch. Remember to make you patch general for Vxworks, not just for your particular architecture. <a href="http://www.ccii.co.za">CCII Systems (Pty) Ltd</a>, my ex employers, sponsored the time to this port. Please let me know how it goes, I would be most interested in offsets and configurations.</p> + <p><br> + </p> + <p>Casey Crellin<br> + <a href="mailto:casey@csc.co.za">casey@csc.co.za</a></p> + <p><br> + </p> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/hints/winnt.html b/contrib/ntp/html/build/hints/winnt.html new file mode 100644 index 0000000..78de15d --- /dev/null +++ b/contrib/ntp/html/build/hints/winnt.html @@ -0,0 +1,281 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <title>NTP on Windows NT</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h1>NTP 4.x for Windows NT</h1> + + <h2>Introduction</h2> + The NTP 4 distribution runs as service on Windows NT 4.0, Windows 2000, Windows XP, + Windows .NET Server 2003. It will NOT run on Windows 95, 98, ME, etc. + The binaries work on multi-processor systems. This port has not been tested + on the Alpha platform. This release now uses OpenSSL for authentication. + IPv6 is not implemented yet for Win32 platforms. + <h2>Authentication Keys</h2> + With this release ntp-keygen is supported. See the <a href="../../keygen.html"> + ntp keygen documentation</a> for details on how to use ntp-keygen. + <p> + ntpd can now use the generated keys in the same way as on Unix platforms. Please + refer to the <a href="../../authopt.html">Authentication Options</a> for details + on how to use these. + <p><B>NOTE:</B> ntpd and ntp-keygen both use OpenSSL which requires a random + character file called .rnd by default. Both of these programs will automatically + generate this file if they are not found. The programs will look for an + environmental variable called RANDFILE and use that for the name of the + random character file if the variable exists. If it does not exist it will look for an environmental + variable called HOME and use that directory to search for a filed called .rnd + in that directory. Finally, if neither RANDFILE nor HOME exists it will look + in C:\ for a .rnd file. In each case it will search for and create the file + if the environmental variable exists or in the C:\ directory if it doesn't. + Note that ntpd normally runs as a service so that the only way that it will + have either RANDFILE or HOME defined is if it is a System environmental + variable or if the service is run under a specific account name and that + account has one of those variables defined. Otherwise it will use the file + "c:\.rnd". This was done so that OpenSSL will work normally on Win32 systems. + This obviates the need to ship the OpenSSL.exe file and explain how to + generate the .rnd file. A future version may change this behavior. + + <p>Refer to <a href="#Compiling">Compiling Requirements</a> and Instructions for how to compile the program.</p> + <h2>Reference Clocks</h2> + Reference clock support under Windows NT is tricky because the IO functions are + so much different. Some of the clock types have been built into the ntpd executable + and should work but have not been tested by the ntp project. If you have a clock + that runs on Win32 and the driver is there but not implemented on Win32 you will have + make the required configuration changes in config.h and then build ntpd from source + and test it. The following reference clocks are known to work and are supported + by Windows NT: + <p><a href="../../driver1.html">Type 1</a> Undisciplined Local Clock (LOCAL)<br> + <a href="../../driver29.html">Type 29</a> Trimble Navigation Palisade GPS (GPS_PALISADE)</p> + <h2>Functions Supported</h2> + All NTP functions are supported with some constraints. See the <a href="#ToDo">TODO list</a> below. + Note that the ntptrace executable is not supported and you should use the PERL script + version instead. + <h2>Accuracy</h2> + Greg Brackley has implemented a fantastic interpolation scheme that improves the precision of the NTP clock + using a realtime thread (is that poetic or what!) which captures a tick count from the 8253 counter after each + OS tick. The count is used to interpolate the time between operating system ticks. + <p>On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds and synchronizes the clock + to +/-500 microseconds using the <a href="http://www.trimble.com/products/ntp">Trimble Palisade</a> as UTC reference. + This allows distributed applications to use the 10 milliseconds ticks available to them with high confidence.</p> + <h2>Binaries</h2> + Recent InstallShield based executable versions of NTP for Windows NT (intel) are available from: + <ul> + <li><a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a> + <li><a href="http://www.five-ten-sg.com/">http://www.five-ten-sg.com/</a> + <li><a href="http://www.meinberg.de/english/sw/ntp.htm">http://www.meinberg.de/english/sw/ntp.htm</a> + </ul> + <a name="ToDo"><h2>ToDo</h2></a> + These tasks are in no particular order of priority. + <ul> + <li>Create a proper install/uninstall program + <li>Add sntp to the list of supported programs + <li>Add support for Visual C++ 7.0 or later (.NET) + <li>Add IPv6 support + <li>See if precision can be improved by using CPU cycle counter for tick interpolation. + <li>Make precision time available to applications using NTP_GETTIME API + </ul> + <h2>Compiling Requirements</h2> + <ul> + <li>Windows NT 4.0 Windows 2000, Windows XP, or Windows.NET Server 2003 + <li>Microsoft Visual C++ 6.0. <B>NOTE:</B> VC++ 7.0 (aka .NET) is not yet supported + but will probably work fine. + <li>Some way of uncompressing and untarring the gzipped tar file. + <li>OpenSSL must be built on the box before building NTP. Additional steps would + be required to not use OpenSSL. + </ul> + <a name="Compiling"><h2>Compiling Instructions</h2></a> + <ol> + <li>Unpack and build OpenSSL according to the OpenSSL instructions for building on + Windows. An environment variable named OPENSSL must be set up to specify the base path + of the OpenSSL directory to be used to build the NTP package + (e.g. <code>OPENSSL=C:\openssl-0.9.8b</code>). + <li>Unpack the ntp-*.tar.gz archive using utilities such as WinZip. + <li>Open the .\ports\winnt\ntp.dsw Visual C workspace + <li>Batch build all projects + <li>The built binaries can be found in the port\winnt\bin\Release subdirectory + <li>In addition you will need to install the OpenSSL libeay32.dll + <li>If you are shipping binaries in a kit it is strongly recommended that you + ship this file (winnt.html) along with the binaries. + </ol> + <h2>Configuration File</h2> + The default NTP configuration file path is %SystemRoot%<tt>\system32\drivers\etc\. </tt>(%SystemRoot% + is an environmental variable that can be determined by typing "set" at the "Command Prompt" + or from the "System" icon in the "Control Panel").<br> + Refer to your system environment and <tt>c</tt>reate your<tt> ntp.conf</tt> file in the directory + corresponding to your system installation.<br> + <tt>The older <WINDIR>\ntp.conf </tt>is still supported but you will get a log entry reporting that + the first file wasn't found. + <h2>Installation Instructions</h2> + The <tt>instsrv</tt> program in the instsrv subdirectory of the distribution can be used to install 'ntpd' as + a service and start automatically at boot time. Instsrv is automatically compiled with the rest of the distribution + if you followed the steps above. + <ol> + <li>Start a command prompt and enter "instsrv.exe <pathname_for_ntpd.exe>" + <li>Clicking on the "Services" icon in the "Control Panel" will display the list of + currently installed services in a dialog box. The NetworkTimeProtocol service should show up in this list. + Select it in the list and hit the "Start" button in the dialog box. The NTP service should start. + <li>You can also stop and start the service by typing net start|stop NetworkTimeProtocol at the DOS prompt. + <li>View the event log by clicking on the "Event Viewer" icon in the "Administrative Tools" + group, there should be several successful startup messages from NTP. NTP will keep running and restart + automatically when the machine is rebooted. + </ol> + You can change the start mode (automatic/manual) and other startup parameters corresponding to the NTP service + in the "Services" dialog box if you wish. + <h2>Removing NTP</h2> + You can also use <tt>instsrv</tt> to delete the NTP service by entering: "instsrv.exe remove" + <h2>Command Line Parameters and Registry Entries</h2> + Unlike the Unix environment, there is no clean way to run 'ntpdate' and reset the clock before starting 'ntpd' at boot time.<br> + NTP will step the clock up to 1000 seconds by default. While there is no reason that the system clock should be that much off + during bootup if 'ntpd' was running before, you may wish to override this default and/or pass other command line directives. + <p>Use the registry editor to edit the value for the ntpd executable under LocalMachine\System\CurrentControlSet\Services\NTP.</p> + <p>Add the -g option to the ImagePath key, behind "%INSTALLDIR>\ntpd.exe". This will force NTP to accept + large time errors (including 1.1.1980 00:00)</p> + <h2>Bug Reports</h2> + Send questions to <a href="news://comp.protocols.time.ntp">news://comp.protocols.time.ntp</a> + and bug reports should be entered in <a href="http://bugzilla.ntp.org/">Bugzilla</a> on the + NTP Web site. + <h2>Change Log</h2> + <h3>Last revision 2 July 2003 Version 4.2.0</h3> + <b>by Danny Mayer (mayer@ntp.org>)</b> + <h3>Significant Changes:</h3> + This latest release of NTP constitutes a major upgrade to its ability to build and + run on Windows platforms and should now build and run cleanly. More importantly it + is now able to support all authentication in the same way as Unix boxes. This does + require the usage of OpenSSL which is now a prerequisite for build on Windows. + ntp-keygen is now supported and builds on Win32 platforms. + + <h3>Last revision 16 February 1999 Version 4.0.99e.</h3> + <b>by Sven Dietrich (sven_dietrich@trimble.com)</b> + <p><b>Significant Changes:</b></p> + <ul> + <li>Perl 5 is no longer needed to compile NTP. The configuration script which creates version.c + with the current date and time was modified by Frederick Czajka [w2k@austin.rr.com] so that Perl + is no longer required. + </ul> + <h3>Last revision 15 November 1999 Version 4.0.98f.</h3> + <b>by Sven Dietrich (sven_dietrich@trimble.com)</b> + <p><b>Significant Changes:</b></p> + <ul> + <li>Fixed I/O problem delaying packet responses which resulted in no-replys to NTPQ and others. + <li>The default configuration file path is <tt><WINDIR>\system32\drivers\etc\ntp.conf. + The old <WINDIR>\ntp.conf </tt>is still supported but you will get a log entry reporting + that the first file wasn't found. The NTP 3.x legacy <tt>ntp.ini</tt> file is no longer supported. + </ul> + <b>Known Problems / TODO:</b> + <ul> + <li>MD5 and name resolution do not yet get along. If you define MD5, you cannot use DNS names, only IP numbers. + </ul> + <h3>Last revision 27 July 1999 Version 4.0.95.</h3> + This version compiles under WINNT with Visual C 6.0. + <p>Greg Brackley and Sven Dietrich</p> + <p>Significant changes:<br> + -Visual Studio v6.0 support<br> + -Winsock 2.0 support<br> + -Use of I/O completion ports for sockets and comm port I/O<br> + -Removed the use of multimedia timers (from ntpd, others need removing)<br> + -Use of waitable timers (with user mode APC) and performance counters to fake getting a better time<br> + -Trimble Palisade NTP Reference Clock support<br> + -General cleanup, prototyping of functions<br> + -Moved receiver buffer code to a separate module (removed unused members from the recvbuff struct)<br> + -Moved io signal code to a separate module</p> + <h3>Last revision: 20-Oct-1996</h3> + This version corrects problems with building the XNTP<br> + version 3.5-86 distribution under Windows NT. + <p>The following files were modified:<br> + blddbg.bat<br> + bldrel.bat<br> + include\ntp_machine.h<br> + xntpd\ntp_unixclock.c<br> + xntpd\ntp_refclock.c<br> + scripts\wininstall\build.bat<br> + scripts\wininstall\setup.rul<br> + scripts\wininstall\readme.nt<br> + scripts\wininstall\distrib\ntpog.wri<br> + html\hints\winnt (this file)</p> + <p>In order to build the entire Windows NT distribution you<br> + need to modify the file scripts\wininstall\build.bat<br> + with the installation directory of the InstallShield<br> + software. Then, simply type "bldrel" for non-debug<br> + or "blddbg" for debug executables.</p> + <p>Greg Schueman<br> + <schueman@acm.org></p> + <h3>Last revision: 07-May-1996</h3> + This set of changes fixes all known bugs, and it includes<br> + several major enhancements. + <p>Many changes have been made both to the build environment as<br> + well as the code. There is no longer an ntp.mak file, instead<br> + there is a buildntall.bat file that will build the entire<br> + release in one shot. The batch file requires Perl. Perl<br> + is easily available from the NT Resource Kit or on the Net.</p> + <p>The multiple interface support was adapted from Larry Kahn's<br> + work on the BIND NT port. I have not been able to test it<br> + adequately as I only have NT servers with one network<br> + interfaces on which to test.</p> + <p>Enhancements:<br> + * Event Logging now works correctly.<br> + * Version numbers now work (requires Perl during build)<br> + * Support for multiple network interface cards (untested)<br> + * NTP.CONF now default, but supports ntp.ini if not found<br> + * Installation procedure automated.<br> + * All paths now allow environment variables such as %windir%</p> + <p>Bug fixes:<br> + * INSTSRV replaced, works correctly<br> + * Cleaned up many warnings<br> + * Corrected use of an uninitialized variable in XNTPD<br> + * Fixed ntpdate -b option<br> + * Fixed ntpdate to accept names as well as IP addresses<br> + (Winsock WSAStartup was called after a gethostbyname())<br> + * Fixed problem with "longjmp" in xntpdc/ntpdc.c that<br> + caused a software exception on doing a Control-C in xntpdc.<br> + A Cntrl-C now terminates the program.</p> + <p>See below for more detail:</p> + <p> Note: SIGINT is not supported for any Win32 application including<br> + Windows NT and Windows 95. When a CTRL+C interrupt occurs, Win32<br> + operating systems generate a new thread to specifically handle that<br> + interrupt. This can cause a single-thread application such as UNIX,<br> + to become multithreaded, resulting in unexpected behavior.<br> + </p> + <p>Possible enhancements and things left to do:<br> + * Reference clock drivers for NT (at least Local Clock support)<br> + * Control Panel Applet<br> + * InstallShield based installation, like NT BIND has<br> + * Integration with NT Performance Monitor<br> + * SNMP integration<br> + * Fully test multiple interface support<br> + </p> + <p>Known problems:<br> + * bug in ntptrace - if no Stratum 1 servers are available,<br> + such as on an + IntraNet, the application crashes.</p> + <h3>Last revision: 12-Apr-1995</h3> + This NTPv3 distribution includes a sample configuration file and the project<br> + makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0 compiler.<br> + Also included is a small routine to install the NTP daemon as a "service"<br> + on a WindowsNT box. Besides xntpd, the utilities that have been ported are<br> + ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using a Bancomm<br> + TimeServe2000 GPS receiver clock that acts as a strata 1 NTP server with no<br> + authentication (it has not been tested with any refclock drivers compiled in).<br> + Following are the known flaws in this port:<br> + 1) currently, I do not know of a way in NT to get information about multiple<br> + network interface cards. The current port uses just one socket bound to<br> + INADDR_ANY address. Therefore when dealing with a multihomed NT time server,<br> + clients should point to the default address on the server (otherwise the<br> + reply is not guaranteed to come from the same interface to which the<br> + request was sent). Working with Microsoft to get this resolved.<br> + 2) There is some problem with "longjmp" in xntpdc/ntpdc.c that causes a<br> + software exception on doing a Control-C in xntpdc. Be patient!<br> + 3) The error messages logged by xntpd currently contain only the numerical<br> + error code. Corresponding error message string has to be looked up in<br> + "Books Online" on Visual C++ 2.0 under the topic "Numerical List of Error<br> + Codes". + <p>Last HTML Update: November 17, 1999<br> + <a href="mailto://sven_dietrich@trimble.com">Sven_Dietrich@Trimble.COM</a></p> + </body> + +</html> diff --git a/contrib/ntp/html/build/patches.html b/contrib/ntp/html/build/patches.html new file mode 100644 index 0000000..00b2923 --- /dev/null +++ b/contrib/ntp/html/build/patches.html @@ -0,0 +1,36 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <title>Patching Procedures</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Patching Procedures</h3> + <img src="../pic/alice38.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html"> rom <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The Mad Hatter needs patches.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">12:56 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="266">Saturday, March 20, 2004</csobj></p> + <br clear="left"> + <hr> + <p>A distribution so widely used as this one eventually develops numerous barnacles as the result of <a href="porting.html">porting</a> to new systems, idiosyncratic new features and just plain bugs. In order to help keep order and make maintenance bearable, we ask that proposed changes to the distribution be submitted in the following form.</p> + <ol> + <li>Please submit patches to <a href="mailto:bugs@mail.ntp.org">bugs@mail.ntp.org</a> in the form of either unified-diffs (<tt>diff -u</tt>) or context-diffs (<tt>diff -c</tt>). + <li>Please include the <strong>output</strong> from <tt>config.guess</tt> in the description of your patch. If <tt>config.guess</tt> does not produce any output for your machine, please fix that, too! + <li>Please base the patch on the root directory of the distribution. The preferred procedure here is to copy your patch to the root directory and mumble + <p><tt>patch -p <your_patch></tt></p> + <li>Please avoid patching the RCS subdirectories; better yet, clean them out before submitting patches. + <li>If you have whole new files, as well as patches, wrap the files and patches in a shell script. If you need to compress it, use either GNU <tt>gzip</tt> or the stock Unix <tt>compress</tt> utility. + <li>Don't forget the documentation that may be affected by the patch. Send us patches for the <tt>./htm</tt> files as well. + <li>We would be glad to include your name, electric address and descriptive phrase in the <a href="../copyright.html">Copyright</a> page, if you wish. + </ol> + <p>Prior to ntp3-5.83 (releases up to and including ntp3.5f) a complete patch history back to the dark ages was kept in the <tt>./patches</tt> directory, which might have been helpful to see if the same problem occurred in another port, etc. Patches were saved in that directory with file name in the form <tt>patch.<i>nnn</i></tt>, where <i>nnn</i> was approaching 200. All patches in that directory have been made; so, if yours was there, it was in the distribution.</p> + <p>Since we have been getting multple patches for some bugs, plus many changes are implemented locally, no two maintainers here use the same tools, and since we're not using any bug-tracking software or even source code control, there is currently no tracking of specific changes.</p> + <p>The best way to see what's changed between two distributions is to run a <tt>diff</tt> against them.</p> + <p>Thanks for your contribution and happy chime.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/build/porting.html b/contrib/ntp/html/build/porting.html new file mode 100644 index 0000000..976cc66 --- /dev/null +++ b/contrib/ntp/html/build/porting.html @@ -0,0 +1,40 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <title>Porting Hints</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Porting Hints</h3> + <img src="../pic/wingdorothy.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a> + <p>Porting Dorothy in Oz + </p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">12:56 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="266">Saturday, March 20, 2004</csobj></p> + <br clear="left"> + <hr> + <p>NOTE: The following procedures have been replaced by GNU <tt>automake</tt> and <tt>autoconfigure</tt>. This page is to be updated in the next release.</p> + <p>Porting to a new machine or operating system ordinarily requires updating the <tt>./machines</tt> directory and the <tt>./compilers</tt> directories in order to define the build environment and autoconfigure means. You will probably have to modify the <tt>ntp_machines.h</tt> file and <tt>"l_stdlib.h"</tt> files as well. The two most famous trouble spots are the I/O code in <tt>./ntpd/ntp_io.c</tt> and the clock adjustment code in <tt>./ntpd/ntp_unixclock.c</tt>.</p> + <p>These are the rules so that older bsd systems and the POSIX standard system can coexist together.</p> + <ol> + <li>If you use <tt>select</tt> then include <tt>"ntp_select.h"</tt>. <tt>select</tt> is not standard, since it is very system dependent as to where it is defined. The logic to include the right system dependent include file is in <tt>"ntp_select.h"</tt>. + <li>Always use POSIX definition of strings. Include <tt>"ntp_string.h"</tt> instead of <tt><string.h></tt>. + <li>Always include <tt>"ntp_malloc.h"</tt> if you use <tt>malloc</tt>. + <li>Always include <tt>"ntp_io.h"</tt> instead of <tt><sys/file.h></tt> or <tt><fnctl.h></tt> to get <tt>O_*</tt> flags. + <li>Always include <tt>"ntp_if.h"</tt> instead of <tt><net/if.h></tt>. + <li>Always include <tt>"ntp_stdlib.h"</tt> instead of <tt><stdlib.h></tt>. + <li>Define any special defines needed for a system in <tt>./include/ntp_machine.h</tt> based on system identifier. This file is included by the <tt>"ntp_types.h"</tt> file and should always be placed first after the <tt><></tt> defines. + <li>Define any special library prototypes left over from the system library and include files in the <tt>"l_stdlib.h"</tt> file. This file is included by the <tt>"ntp_stdlib.h"</tt> file and should ordinarily be placed last in the includes list. + <li>Don't define a include file by the same name as a system include file. + </ol> + <p><tt>"l_stdlib.h"</tt> can contain any extra definitions that are needed so that <tt>gcc</tt> will shut up. They should be controlled by a system identifier and there should be a separate section for each system. Really this will make it easier to maintain.</p> + <p>See <tt>include/ntp_machines.h</tt> for the various compile time options.</p> + <p>When you are satisfied the port works and that other ports are not adversely affected, please send <a href="patches.html">patches</a> for the system files you have changed, as well as any documentation that should be updated, including the advice herein.</p> + <p>Good luck.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/quick.html b/contrib/ntp/html/build/quick.html new file mode 100644 index 0000000..1693b5d --- /dev/null +++ b/contrib/ntp/html/build/quick.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Quick Start</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Quick Start</h3> + <img src="../pic/panda.gif" alt="gif" align="left">FAX test image for SATNET (1979). + <p>The baby panda was scanned at University College London and used as a FAX test image for a demonstration of the DARPA Atlantic SATNET Program and the first transatlantic Internet connection in 1978. The computing system used for that demonstration was called the <a href="http://www.eecis.udel.edu/%7emills/database/papers/fuzz.pdf">Fuzzball</a> . As it happened, this was also the first Internet multimedia presentation and the first to use NTP in regular operation. The image was widely copied and used for testing purpose throughout much of the 1980s.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">01:01 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="266">Saturday, March 20, 2004</csobj></p> + <br clear="left"> + <hr> + <p>For the rank amateur the sheer volume of the documentation collection must be intimidating. However, it doesn't take much to fly the <tt>ntpd</tt> daemon with a simple configuration where a workstation needs to synchronize to some server elsewhere in the Internet. The first thing that needs to be done is to build the distribution for the particular workstation and install in the usual place. The <a href="build.html">Building and Installing the Distribution</a> page describes how to do this.</p> + <p>While it is possible that certain configurations do not need a configuration file, most do require one. The file, called by default <tt>/etc/ntp.conf</tt>, need only contain one line specifying a remote server, for instance</p> + <p><tt>server foo.bar.com</tt></p> + <p>Choosing an appropriate remote server is somewhat of a black art, but a suboptimal choice is seldom a problem. There are about two dozen public time servers operated by National Institutes of Science and Technology (NIST), US Naval Observatory (USNO), Canadian Metrology Centre (CMC) and many others available on the Internet. Lists of public primary and secondary NTP servers maintained on the <a href="http://www.eecis.udel.edu/%7emills/ntp/servers.html">Public NTP TIme Servers</a> page, which is updated frequently.The lists are sorted by country and, in the case of the US, by state. Usually, the best choice is the nearest in geographical terms, but the terms of engagement specified in each list entry should be carefully respected.</p> + <p>During operation <tt>ntpd</tt> measures and corrects for incidental clock frequency error and writes the current value to a file called by default <tt>/etc/ntp.drift</tt>. If <tt>ntpd</tt> is stopped and restarted, it initializes the frequency from this file. In this way the potentially lengthy interval to relearn the frequency error is avoided.</p> + <p>That's all there is to it, unless some problem in network connectivity or local operating system configuration occurs. The most common problem is some firewall between the workstation and server. System administrators should understand NTP uses UDP port 123 as both the source and destination port and that NTP does not involve any operating system interaction other than to set the system clock. While almost all modern Unix systems have included NTP and UDP port 123 defined in the services file, this should be checked if <tt>ntpd</tt> fails to come up at all.</p> + <p>The best way to confirm NTP is working is using the <a href="../ntpq.html"><tt>ntpq</tt></a> utility, although the <a href="../ntpdc.html"><tt>ntpdc</tt></a> utility may be useful in extreme cases. See the documentation pages for further information. In the most extreme cases the <tt>-d</tt> option on the <tt>ntpd</tt> command line results in a blow-by-blow trace of the daemon operations. While the trace output can be cryptic, to say the least, it gives a general idea of what the program is doing and, in particular, details the arriving and departing packets and detected errors, if present.</p> + <p>Sometimes the <tt>ntpd</tt>. behavior may seem to violate the Principle of Least Astonishment, but there are good reasons for this. See the <a href="../ntpd.html">Network Time Protocol (NTP) daemon</a> page for revealing insights. See this page and its dependencies for additional configuration and control options. The <a href="../notes.html">Notes on Configuring NTP and Setting up a NTP Subnet</a> page contains an extended discussion of these options.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/footer.txt b/contrib/ntp/html/build/scripts/footer.txt new file mode 100644 index 0000000..89216ce --- /dev/null +++ b/contrib/ntp/html/build/scripts/footer.txt @@ -0,0 +1,7 @@ +document.write("\ +<table><tr>\ +<td width='50%' ><img src='../icons/home.gif' align='middle' alt='gif'>\ +<a href='../index.html'>Home Page</a></td>\ +<td width='50%' ><img src='../icons/mail2.gif' align='middle' alt='gif'>\ +<a href='http://www.ntp.org/contact.html'>Contacts</a></i></td>\ +</tr></table>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links10.txt b/contrib/ntp/html/build/scripts/links10.txt new file mode 100644 index 0000000..7bf9d06 --- /dev/null +++ b/contrib/ntp/html/build/scripts/links10.txt @@ -0,0 +1,5 @@ +document.write("<ul>\ +<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\ +<li class='inline'><a href='prefer.html'>Mitigation Rules and the <tt>prefer</tt> Keyword</a><br>\ +<li class='inline'><a href='howto.html'>How to Write a Reference Clock Driver</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links11.txt b/contrib/ntp/html/build/scripts/links11.txt new file mode 100644 index 0000000..1fce362 --- /dev/null +++ b/contrib/ntp/html/build/scripts/links11.txt @@ -0,0 +1,5 @@ +document.write("<ul>\ +<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\ +<li class='inline'><a href='pps.html'>Pulse-per-second (PPS) Signal Interfacing</a><br>\ +<li class='inline'><a href='ldisc.html'>Line Disciplines and Streams Modules</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links12.txt b/contrib/ntp/html/build/scripts/links12.txt new file mode 100644 index 0000000..512cbcf --- /dev/null +++ b/contrib/ntp/html/build/scripts/links12.txt @@ -0,0 +1,5 @@ +document.write("<ul>\ +<li class='inline'><a href='debug.html'>NTP Debugging Techniques</a><br>\ +<li class='inline'><a href='rdebug.html'>Debugging Reference Clock Drivers</a><br>\ +<li class='inline'><a href='msyslog.html'><tt>ntpd</tt> System Log Messages</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links7.txt b/contrib/ntp/html/build/scripts/links7.txt new file mode 100644 index 0000000..4a6f186 --- /dev/null +++ b/contrib/ntp/html/build/scripts/links7.txt @@ -0,0 +1,5 @@ +document.write("<ul>\ +<li class='inline'><a href='../confopt.html'>Server Options</a><br>\ +<li class='inline'><a href='../authopt.html'>Authentication Options</a><br>\ +<li class='inline'><a href='../monopt.html'>Monitoring Options</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links8.txt b/contrib/ntp/html/build/scripts/links8.txt new file mode 100644 index 0000000..af33dca --- /dev/null +++ b/contrib/ntp/html/build/scripts/links8.txt @@ -0,0 +1,6 @@ +document.write("<ul>\ +<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\ +<li class='inline'><a href='drivers/driver7.html'>Radio CHU Audio Demodulator/Decoder</a><br>\ +<li class='inline'><a href='drivers/driver36.html'>Radio WWV/H Audio Demodulator/Decoder</a><br>\ +<li class='inline'><a href='drivers/driver6.html'>IRIG Audio Decoder</a>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/links9.txt b/contrib/ntp/html/build/scripts/links9.txt new file mode 100644 index 0000000..38ffe90 --- /dev/null +++ b/contrib/ntp/html/build/scripts/links9.txt @@ -0,0 +1,7 @@ +document.write("<ul>\ +<li class='inline'><a href='authopt.html'>Authentication Options</a><br>\ +<li class='inline'><a href='manyopt.html'>Automatic NTP Configuration Options</a><br>\ +<li class='inline'><a href='confopt.html'>Server Options</a><br>\ +<li class='inline'><a href='keygen.html'><tt>ntp-keygen</tt> - generate public and private keys</a>\ +<li class='inline'><a href='http://www.eecis.udel.edu/~mills/autokey.html'>Autonomous Authentication</a>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/build/scripts/style.css b/contrib/ntp/html/build/scripts/style.css new file mode 100644 index 0000000..096b18a --- /dev/null +++ b/contrib/ntp/html/build/scripts/style.css @@ -0,0 +1,64 @@ +body {background: #FDF1E1; + color: #006600; + font-family: "verdana", sans-serif; + text-align: justify; + margin-left: 5px;} + +p, h4, hr, li {margin-top: .6em; margin-bottom: .6em} +li.inline {text-align: left; margin-top: 0; margin-bottom: 0} + +ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em} + +dt {margin-top: .6em} +dd {margin-bottom: .6em} + +div.header {text-align: center; + font-style: italic;} + +div.footer {text-align: center; + font-size: 60%;} + +img.cell {align: left;} + +td.sidebar {width: 40px; align: center; valign: top;} +img.sidebar {align: center; margin-top: 5px;} +h4.sidebar {align: center;} + +p.top {background: #FDF1E1; + color: #006600; + position: absolute; + margin-left: -90px; + text-align: center;} + +a:link.sidebar {background: transparent; + color: #990033; + font-weight: bold;} + +a:visited.sidebar {background: transparent; + color: #990033; + font-weight: bold;} + +a:hover.sidebar {background: #FDF1E1; + color: #006600;} + +img {margin: 5px;} + +div {text-align: center;} + +h1 {text-align: center; + font-size: 250%;} + +caption {background: #EEEEEE; + color: #339999;} + +tx {text-align: center;} + +th {background: #FFFFCC; + color: #006600; + text-align: center; + text-decoration: underline; + padding-top: 5px;} + +th.caption {background: #EEEEEE; + color: #006600; + text-align: center;}
\ No newline at end of file diff --git a/contrib/ntp/html/clockopt.html b/contrib/ntp/html/clockopt.html new file mode 100644 index 0000000..c4690a3 --- /dev/null +++ b/contrib/ntp/html/clockopt.html @@ -0,0 +1,68 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Reference Clock Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Reference Clock Options</h3> + <img src="pic/stack1a.jpg" alt="gif" align="left"> + <p>See the radios, all in a row.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:37</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#ref">Reference Clock Support</a> + <li class="inline"><a href="#cmd">Reference Clock Commands</a> + </ul> + <hr> + <h4 id="ref">Reference Clock Support</h4> + <p>The NTP Version 4 daemon supports some three dozen different radio, satellite and modem reference clocks plus a special pseudo-clock used for backup or when no other clock source is available. Detailed descriptions of individual device drivers and options can be found in the <a href="refclock.html">Reference Clock Drivers</a> page. Additional information can be found in the pages linked there, including the <a href="rdebug.html">Debugging Hints for Reference Clock Drivers</a> and <a href="howto.html">How To Write a Reference Clock Driver</a> pages. In addition, support for a PPS signal is available as described in <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. Many drivers support special line discipline/streams modules which can significantly improve the accuracy using the driver. These are described in the <a href="ldisc.html">Line Disciplines and Streams Drivers</a> page.</p> + <p>A reference clock will generally (though not always) be a radio timecode receiver which is synchronized to a source of standard time such as the services offered by the NRC in Canada and NIST and USNO in the US. The interface between the computer and the timecode receiver is device dependent, but is usually a serial port. A device driver specific to each reference clock must be selected and compiled in the distribution; however, most common radio, satellite and modem clocks are included by default. Note that an attempt to configure a reference clock when the driver has not been compiled or the hardware port has not been appropriately configured results in a scalding remark to the system log file, but is otherwise non hazardous.</p> + <p>For the purposes of configuration, <tt>ntpd</tt> treats reference clocks in a manner analogous to normal NTP peers as much as possible. Reference clocks are identified by a syntactically correct but invalid IP address, in order to distinguish them from normal NTP peers. Reference clock addresses are of the form <tt>127.127.<i>t.u</i></tt>, where <i><tt>t</tt></i> is an integer denoting the clock type and <i><tt>u</tt></i> indicates the unit number in the range 0-3. While it may seem overkill, it is in fact sometimes useful to configure multiple reference clocks of the same type, in which case the unit numbers must be unique.</p> + <p>The <tt>server</tt> command is used to configure a reference clock, where the <i><tt>address</tt></i> argument in that command is the clock address. The <tt>key</tt>, <tt>version</tt> and <tt>ttl</tt> options are not used for reference clock support. The <tt>mode</tt> option is added for reference clock support, as described below. The <tt>prefer</tt> option can be useful to persuade the server to cherish a reference clock with somewhat more enthusiasm than other reference clocks or peers. Further information on this option can be found in the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The <tt>minpoll</tt> and <tt>maxpoll</tt> options have meaning only for selected clock drivers. See the individual clock driver document pages for additional information.</p> + <p>The <tt>fudge</tt> command is used to provide additional information for individual clock drivers and normally follows immediately after the <tt>server</tt> command. The <i><tt>address</tt></i> argument specifies the clock address. The <tt>refid</tt> and <tt>stratum</tt> options control can be used to override the defaults for the device. There are two optional device-dependent time offsets and four flags that can be included in the <tt>fudge</tt> command as well.</p> + <p>The stratum number of a reference clock is by default zero. Since the <tt>ntpd</tt> daemon adds one to the stratum of each peer, a primary server ordinarily displays an external stratum of one. In order to provide engineered backups, it is often useful to specify the reference clock stratum as greater than zero. The <tt>stratum</tt> option is used for this purpose. Also, in cases involving both a reference clock and a pulse-per-second (PPS) discipline signal, it is useful to specify the reference clock identifier as other than the default, depending on the driver. The <tt>refid</tt> option is used for this purpose. Except where noted, these options apply to all clock drivers.</p> + <h4 id="cmd">Reference Clock Commands</h4> + <dl> + <dt><tt>server 127.127.<i>t.u</i> [prefer] [mode <i>int</i>] [minpoll <i>int</i>] [maxpoll <i>int</i>]</tt> + <dd>This command can be used to configure reference clocks in special ways. The options are interpreted as follows: + <dl> + <dt><tt>prefer</tt> + <dd>Marks the reference clock as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for further information. + <dt><tt>mode <i>int</i></tt> + <dd>Specifies a mode number which is interpreted in a device-specific fashion. For instance, it selects a dialing protocol in the ACTS driver and a device subtype in the <tt>parse</tt> drivers. + <dt><tt>minpoll <i>int</i></tt> + <dt><tt>maxpoll <i>int</i></tt> + <dd>These options specify the minimum and maximum polling interval for reference clock messages in seconds, interpreted as dual logarithms (2 ^ x). For most directly connected reference clocks, both <tt>minpoll</tt> and <tt>maxpoll</tt> default to 6 (2^16 = 64 s). For modem reference clocks, <tt>minpoll</tt> defaults to 10 (2^10 = 1024 s = 17.1 m) and <tt>maxpoll</tt> defaults to 14 (2^14 = 16384 s = 4.5 h). The allowable range is 4 (16 s) to 17 (36.4 h) inclusive. + </dl> + <dt><tt>fudge 127.127.<i>t.u</i> [time1 <i>sec</i>] [time2 <i>sec</i>] [stratum <i>int</i>] [refid <i>string</i>] [mode <i>int</i>] [flag1 0|1] [flag2 0|1] [flag3 0|1] [flag4 0|1]</tt> + <dd>This command can be used to configure reference clocks in special ways. It must immediately follow the <tt>server</tt> command which configures the driver. Note that the same capability is possible at run time using the <tt><a href="ntpdc.html">ntpdc</a></tt> program. The options are interpreted as follows: + <dl> + <dt><tt>time1 <i>sec</i></tt> + <dd>Specifies a constant to be added to the time offset produced by the driver, a fixed-point decimal number in seconds. This is used as a calibration constant to adjust the nominal time offset of a particular clock to agree with an external standard, such as a precision PPS signal. It also provides a way to correct a systematic error or bias due to serial port or operating system latencies, different cable lengths or receiver internal delay. The specified offset is in addition to the propagation delay provided by other means, such as internal DIPswitches. Where a calibration for an individual system and driver is available, an approximate correction is noted in the driver documentation pages. + <dd>Note: in order to facilitate calibration when more than one radio clock or PPS signal is supported, a special calibration feature is available. It takes the form of an argument to the <tt>enable</tt> command described in the <a href="miscopt.html">Miscellaneous Options</a> page and operates as described in the <a href="refclock.html">Reference Clock Drivers</a> page. + <dt><tt>time2 <i>secs</i></tt> + <dd>Specifies a fixed-point decimal number in seconds, which is interpreted in a driver-dependent way. See the descriptions of specific drivers in the <a href="refclock.html">reference clock drivers</a> page. + <dt><tt>stratum <i>int</i></tt> + <dd>Specifies the stratum number assigned to the driver, an integer between 0 and 15. This number overrides the default stratum number ordinarily assigned by the driver itself, usually zero. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies an ASCII string of from one to four characters which defines the reference identifier used by the driver. This string overrides the default identifier ordinarily assigned by the driver itself. + <dt><tt>mode <i>int</i></tt> + <dd>Specifies a mode number which is interpreted in a device-specific fashion. For instance, it selects a dialing protocol in the ACTS driver and a device subtype in the <tt>parse</tt> drivers. + <dt><tt>flag1 flag2 flag3 flag4</tt> + <dd>These four flags are used for customizing the clock driver. The interpretation of these values, and whether they are used at all, is a function of the particular clock driver. However, by convention <tt>flag4</tt> is used to enable recording monitoring data to the <tt>clockstats</tt> file configured with the <tt>filegen</tt> command. Further information on the <tt>filegen</tt> command can be found in the <a href="monopt.html">Monitoring Options</a> page. + </dl> + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/confopt.html b/contrib/ntp/html/confopt.html new file mode 100644 index 0000000..e2a04c4 --- /dev/null +++ b/contrib/ntp/html/confopt.html @@ -0,0 +1,82 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Server Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Server Options</h3> + <img src="pic/boom3a.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>The chicken is getting configuration advice.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">20:57</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="270">Monday, October 10, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#cfg">Configuration Commands</a> + <li class="inline"><a href="#opt">Command Options</a> + <li class="inline"><a href="#aux">Auxilliary Commands</a> + <li class="inline"><a href="#bug">Bugs</a> + </ul> + <hr> + <p>Following is a description of the configuration commands in NTPv4. There are two classes of commands, configuration commands that configure an association with a remote server, peer or reference clock, and auxilliary commands that specify environmental variables that control various related operations.</p> + <h4 id="cfg">Configuration Commands</h4> + <p>The various modes are determined by the command keyword and the required IP address. Addresses are classed by type as (s) a remote server or peer (IPv4 class A, B and C), (b) the broadcast address of a local interface, (m) a multicast address (IPv4 class D), or (r) a reference clock address (127.127.x.x). The options that can be used with these commands are listed below.</p> + <p>If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default support of the IPv4 address family. IPv6 addresses can be identified by the presence of colons ":" in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p> + <p>There are three types of associations: persistent, preemptable and ephemeral. Persistent associations are mobilized by a configuration command and never demobilized. Preemptable associations, which are new to NTPv4, are mobilized by a configuration command which includes the <tt>prempt</tt> flag and are demobilized by timeout or error. Ephemeral associations are mobilized upon arrival of designated messages and demobilized by timeout or error.</p> + <dl> + <dt><tt>server <i>address</i> [options ...]</tt><br> + <tt>peer <i>address</i> [</tt><tt>options ...]<br> + broadcast <i>address</i> [options ...]</tt><br> + <tt>manycastclient <i>address</i> [options ...]</tt> + <dd>These four commands specify the time server name or address to be used and the mode in which to operate. The <i>address</i> can be either a DNS name or a IP address in dotted-quad notation. Additional information on association behavior can be found in the <a href="assoc.html">Association Management</a> page. + <dl> + <dt><tt>server</tt> + <dd>For type s and r addresses (only), this command normally mobilizes a persistent client mode association with the specified remote server or local reference clock. If the <tt>preempt</tt> flag is specified, a preemptable association is mobilized instead. In client mode the client clock can synchronize to the remote server or local reference clock, but the remote server can never be synchronized to the client clock. This command should NOT be used for type <tt>b</tt> or <tt>m</tt> addresses. <dt><tt>peer</tt> + <dd>For type s addresses (only), this command mobilizes a persistent symmetric-active mode association with the specified remote peer. In this mode the local clock can be synchronized to the remote peer or the remote peer can be synchronized to the local clock. This is useful in a network of servers where, depending on various failure scenarios, either the local or remote peer may be the better source of time. This command should NOT be used for type <tt>b</tt>, <tt>m</tt> or <tt>r</tt> addresses. + <dt><tt>broadcast</tt> + <dd>For type <tt>b</tt> and <tt>m</tt> addresses (only), this command mobilizes a persistent broadcast mode association. Multiple commands can be used to specify multiple local broadcast interfaces (subnets) and/or multiple multicast groups. Note that local broadcast messages go only to the interface associated with the subnet specified, but multicast messages go to all interfaces. + <dd>In broadcast mode the local server sends periodic broadcast messages to a client population at the <i><tt>address</tt></i> specified, which is usually the broadcast address on (one of) the local network(s) or a multicast address assigned to NTP. The IANA has assigned the multicast group address IPv4 224.0.1.1 and IPv6 ff05::101 (site local) exclusively to NTP, but other nonconflicting addresses can be used to contain the messages within administrative boundaries. Ordinarily, this specification applies only to the local server operating as a sender; for operation as a broadcast client, see the <tt>broadcastclient</tt> or <tt>multicastclient</tt> commands below. + <dt><tt>manycastclient</tt> + <dd>For type <tt>m</tt> addresses (only), this command mobilizes a preemptable manycast client mode association for the multicast group address specified. In this mode a specific address must be supplied which matches the address used on the <tt>manycastserver</tt> command for the designated manycast servers. The NTP multicast address 224.0.1.1 assigned by the IANA should NOT be used, unless specific means are taken to avoid spraying large areas of the Internet with these messages and causing a possibly massive implosion of replies at the sender. + <dd>The <tt>manycastclient</tt> command specifies that the host is to operate in client mode with the remote servers that are discovered as the result of broadcast/multicast messages. The client broadcasts a request message to the group address associated with the specified <i><tt>address</tt></i> and specifically enabled servers respond to these messages. The client selects the servers providing the best time and continues as with the <tt>server </tt>command. The remaining servers are discarded as if never heard. + </dl> + </dl> + <h4 id="opt">Command Options</h4> + <dl> + <dt><tt>autokey</tt> + <dd>All packets sent to and received from the server or peer are to include authentication fields encrypted using the autokey scheme described in the <a href="authopt.html">Authentication Options</a> page. This option is valid with all commands.<dt><tt>burst</tt> + <dd>When the server is reachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the <a href="miscopt.html"><tt>calldelay</tt></a> command to allow additional time for a modem or ISDN call to complete. This option is valid with only the <tt>server</tt> command and is a recommended option with this command when the <tt>maxpoll</tt> option is 11 or greater. <dt><tt>iburst</tt> + <dd>When the server is unreachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the <a href="miscopt.html"><tt>calldelay</tt></a> command to allow additional time for a modem or ISDN call to complete. This option is valid with only the <tt>server</tt> command and is a recommended option with this command.<dt><tt>key</tt> <i><tt>key</tt></i> + <dd>All packets sent to and received from the server or peer are to include authentication fields encrypted using the specified <i><tt>key</tt></i> identifier with values from 1 to 65534, inclusive. The default is to include no encryption field. This option is valid with all commands.<dt><tt>minpoll <i>minpoll</i></tt><br> + <tt>maxpoll <i>maxpoll</i></tt> + <dd>These options specify the minimum and maximum poll intervals for NTP messages, in seconds as a power of two. The maximum poll interval defaults to 10 (1,024 s), but can be increased by the <tt>maxpoll</tt> option to an upper limit of 17 (36.4 h). The minimum poll interval defaults to 6 (64 s), but can be decreased by the <tt>minpoll</tt> option to a lower limit of 4 (16 s). These option are valid only with the <tt>server</tt> and <tt>peer</tt> commands.<dt><tt>noselect</tt> + <dd>Marks the server as unused, except for display purposes. The server is discarded by the selection algorithm. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.<dt><tt>preempt</tt> + <dd>Specifies the association as preemptable rather than the default persistent. This option is valied only with the <tt>server</tt> command.<dt><tt>prefer</tt> + <dd>Marks the server as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for further information. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.<dt><tt>true</tt> + <dd>Force the association to assume truechimer status; that is, always survive the selection and clustering algorithms. This option can be used with any association, but is most useful for reference clocks with large jitter on the serial port and precision pulse-per-second (PPS) signals. Caution: this option defeats the algorithms designed to cast out falsetickers and can allow these sources to set the system clock. This option is valid only with the <tt>server</tt> and <tt>peer</tt> commands.<dt><tt>ttl <i>ttl</i></tt> + <dd>This option is used only with broadcast server and manycast client modes. It specifies the time-to-live <i><tt>ttl</tt></i> to use on broadcast server and multicast server and the maximum <i><tt>ttl</tt></i> for the expanding ring search with manycast client packets. Selection of the proper value, which defaults to 127, is something of a black art and should be coordinated with the network administrator. + <dt><tt>version <i>version</i></tt> + <dd>Specifies the version number to be used for outgoing NTP packets. Versions 1-4 are the choices, with version 4 the default. This option is valid only with the <tt>server,</tt> <tt>peer</tt> and <tt>broadcast</tt> commands. + </dl> + <h4 id="aux">Auxilliary Commands</h4> + <dl> + <dt><tt>broadcastclient [novolley]</tt> + <dd>This command enables reception of broadcast server messages to any local interface (type <tt>b</tt>) address. Ordinarily, upon receiving a message for the first time, the broadcast client measures the nominal server propagation delay using a brief client/server exchange with the server, after which it continues in listen-only mode. If the <tt>novolley</tt> keyword is present, the exchange is not used and the value specified in the <tt>broadcastdelay</tt> command is used or, if the <tt>broadcastdelay</tt> command is not used, the default 4.0 ms. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. Note that the <tt>novolley</tt> keyword is incompatible with public key authentication.<dt><tt>manycastserver <i>address</i> [...]</tt> + <dd>This command enables reception of manycast client messages to the multicast group address(es) (type <tt>m</tt>) specified. At least one address is required. The NTP multicast address 224.0.1.1 assigned by the IANA should NOT be used, unless specific means are taken to limit the span of the reply and avoid a possibly massive implosion at the original sender. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. + <dt><tt>multicastclient <i>address</i> [...]</tt> + <dd>This command enables reception of multicast server messages to the multicast group address(es) (type <tt>m</tt>) specified. Upon receiving a message for the first time, the multicast client measures the nominal server propagation delay using a brief client/server exchange with the server, then enters the broadcast client mode, in which it synchronizes to succeeding multicast messages. Note that, in order to avoid accidental or malicious disruption in this mode, both the server and client should operate using symmetric key or public key authentication as described in the <a href="authopt.html">Authentication Options</a> page. + </dl> + <h4 id="bug">Bugs</h4> + <p>The syntax checking is not picky; some combinations of ridiculous and even hilarious options and modes may not be detected.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/copyright.html b/contrib/ntp/html/copyright.html new file mode 100644 index 0000000..471069a --- /dev/null +++ b/contrib/ntp/html/copyright.html @@ -0,0 +1,96 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Copyright Notice</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Copyright Notice</h3> + <img src="pic/sheepb.jpg" alt="jpg" align="left"> "Clone me," says Dolly sheepishly + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">20:31</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="285">Saturday, January 06, 2007</csobj></p> + <br clear="left"> + <hr> + <p>The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file.<br> + </p> + <pre> +*********************************************************************** +* * +* Copyright (c) David L. Mills 1992-2008 * +* * +* Permission to use, copy, modify, and distribute this software and * +* its documentation for any purpose with or without fee is hereby * +* granted, provided that the above copyright notice appears in all * +* copies and that both the copyright notice and this permission * +* notice appear in supporting documentation, and that the name * +* University of Delaware not be used in advertising or publicity * +* pertaining to distribution of the software without specific, * +* written prior permission. The University of Delaware makes no * +* representations about the suitability this software for any * +* purpose. It is provided "as is" without express or implied * +* warranty. * +* * +*********************************************************************** +</pre> + <p>The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work.</p> + <ol> + <li class="inline"><a href="mailto:%20mark_andrews@isc.org">Mark Andrews <mark_andrews@isc.org></a> Leitch atomic clock controller + <li class="inline"><a href="mailto:%20altmeier@atlsoft.de">Bernd Altmeier <altmeier@atlsoft.de></a> hopf Elektronik serial line and PCI-bus devices + <li class="inline"><a href="mailto:%20vbais@mailman1.intel.co">Viraj Bais <vbais@mailman1.intel.com></a> and <a href="mailto:%20kirkwood@striderfm.intel.com">Clayton Kirkwood <kirkwood@striderfm.intel.com></a> port to WindowsNT 3.5 + <li class="inline"><a href="mailto:%20michael.barone@lmco.com">Michael Barone <michael,barone@lmco.com></a> GPSVME fixes + <li class="inline"><a href="mailto:%20Jean-Francois.Boudreault@viagenie.qc.ca">Jean-Francois Boudreault <Jean-Francois.Boudreault@viagenie.qc.ca></a>IPv6 support + <li class="inline"><a href="mailto:%20karl@owl.HQ.ileaf.com">Karl Berry <karl@owl.HQ.ileaf.com></a> syslog to file option + <li class="inline"><a href="mailto:%20greg.brackley@bigfoot.com">Greg Brackley <greg.brackley@bigfoot.com></a> Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules. + <li class="inline"><a href="mailto:%20Marc.Brett@westgeo.com">Marc Brett <Marc.Brett@westgeo.com></a> Magnavox GPS clock driver + <li class="inline"><a href="mailto:%20Piete.Brooks@cl.cam.ac.uk">Piete Brooks <Piete.Brooks@cl.cam.ac.uk></a> MSF clock driver, Trimble PARSE support + <li class="inline"><a href="mailto:%20reg@dwf.com">Reg Clemens <reg@dwf.com></a> Oncore driver (Current maintainer) + <li class="inline"><a href="mailto:%20clift@ml.csiro.au">Steve Clift <clift@ml.csiro.au></a> OMEGA clock driver + <li class="inline"><a href="mailto:casey@csc.co.za">Casey Crellin <casey@csc.co.za></a> vxWorks (Tornado) port and help with target configuration + <li class="inline"><a href="mailto:%20Sven_Dietrich@trimble.COM">Sven Dietrich <sven_dietrich@trimble.com></a> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port. + <li class="inline"><a href="mailto:%20dundas@salt.jpl.nasa.gov">John A. Dundas III <dundas@salt.jpl.nasa.gov></a> Apple A/UX port + <li class="inline"><a href="mailto:%20duwe@immd4.informatik.uni-erlangen.de">Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de></a> Linux port + <li class="inline"><a href="mailto:%20dennis@mrbill.canet.ca">Dennis Ferguson <dennis@mrbill.canet.ca></a> foundation code for NTP Version 2 as specified in RFC-1119 + <li class="inline"><a href="mailto:%20jhay@icomtek.csir.co.za">John Hay <jhay@@icomtek.csir.co.za></a> IPv6 support and testing + <li class="inline"><a href="mailto:%20glenn@herald.usask.ca">Glenn Hollinger <glenn@herald.usask.ca></a> GOES clock driver + <li class="inline"><a href="mailto:%20iglesias@uci.edu">Mike Iglesias <iglesias@uci.edu></a> DEC Alpha port + <li class="inline"><a href="mailto:%20jagubox.gsfc.nasa.gov">Jim Jagielski <jim@jagubox.gsfc.nasa.gov></a> A/UX port + <li class="inline"><a href="mailto:%20jbj@chatham.usdesign.com">Jeff Johnson <jbj@chatham.usdesign.com></a> massive prototyping overhaul + <li class="inline"><a href="mailto:Hans.Lambermont@nl.origin-it.com">Hans Lambermont <Hans.Lambermont@nl.origin-it.com></a> or <a href="mailto:H.Lambermont@chello.nl"><H.Lambermont@chello.nl></a> ntpsweep + <li class="inline"><a href="mailto:%20phk@FreeBSD.ORG">Poul-Henning Kamp <phk@FreeBSD.ORG></a> Oncore driver (Original author) + <li class="inline"><a href="http://www4.informatik.uni-erlangen.de/%7ekardel">Frank Kardel</a> <a href="mailto:%20kardel (at) ntp (dot) org"><kardel (at) ntp (dot) org></a> PARSE <GENERIC> driver (>14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup, dynamic interface handling + <li class="inline"><a href="mailto:%20jones@hermes.chpc.utexas.edu">William L. Jones <jones@hermes.chpc.utexas.edu></a> RS/6000 AIX modifications, HPUX modifications + <li class="inline"><a href="mailto:%20dkatz@cisco.com">Dave Katz <dkatz@cisco.com></a> RS/6000 AIX port + <li class="inline"><a href="mailto:%20leres@ee.lbl.gov">Craig Leres <leres@ee.lbl.gov></a> 4.4BSD port, ppsclock, Magnavox GPS clock driver + <li class="inline"><a href="mailto:%20lindholm@ucs.ubc.ca">George Lindholm <lindholm@ucs.ubc.ca></a> SunOS 5.1 port + <li class="inline"><a href="mailto:%20louie@ni.umd.edu">Louis A. Mamakos <louie@ni.umd.edu></a> MD5-based authentication + <li class="inline"><a href="mailto:%20thorinn@diku.dk">Lars H. Mathiesen <thorinn@diku.dk></a> adaptation of foundation code for Version 3 as specified in RFC-1305 + <li class="inline"><a href="mailto:%20mayer@ntp.org">Danny Mayer <mayer@ntp.org></a>Network I/O, Windows Port, Code Maintenance + <li class="inline"><a href="mailto:%20mills@udel.edu">David L. Mills <mills@udel.edu></a> Version 4 foundation: clock discipline, authentication, precision kernel; clock drivers: Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics; audio clock drivers: CHU, WWV/H, IRIG + <li class="inline"><a href="mailto:%20moeller@gwdgv1.dnet.gwdg.de">Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de></a> VMS port + <li class="inline"><a href="mailto:%20mogul@pa.dec.com">Jeffrey Mogul <mogul@pa.dec.com></a> ntptrace utility + <li class="inline"><a href="mailto:%20tmoore@fievel.daytonoh.ncr.com">Tom Moore <tmoore@fievel.daytonoh.ncr.com></a> i386 svr4 port + <li class="inline"><a href="mailto:%20kamal@whence.com">Kamal A Mostafa <kamal@whence.com></a> SCO OpenServer port + <li class="inline"><a href="mailto:%20derek@toybox.demon.co.uk">Derek Mulcahy <derek@toybox.demon.co.uk></a> and <a href="mailto:%20d@hd.org">Damon Hart-Davis <d@hd.org></a> ARCRON MSF clock driver + <li class="inline"><a href="mailto:%20Rainer.Pruy@informatik.uni-erlangen.de">Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de></a> monitoring/trap scripts, statistics file handling + <li class="inline"><a href="mailto:%20dirce@zk3.dec.com">Dirce Richards <dirce@zk3.dec.com></a> Digital UNIX V4.0 port + <li class="inline"><a href="mailto:%20wsanchez@apple.com">Wilfredo Sánchez <wsanchez@apple.com></a> added support for NetInfo + <li class="inline"><a href="mailto:%20mrapple@quack.kfu.com">Nick Sayer <mrapple@quack.kfu.com></a> SunOS streams modules + <li class="inline"><a href="mailto:%20jack@innovativeinternet.com">Jack Sasportas <jack@innovativeinternet.com></a> Saved a Lot of space on the stuff in the html/pic/ subdirectory + <li class="inline"><a href="mailto:%20schnitz@unipress.com">Ray Schnitzler <schnitz@unipress.com></a> Unixware1 port + <li class="inline"><a href="mailto:%20shields@tembel.org">Michael Shields <shields@tembel.org></a> USNO clock driver + <li class="inline"><a href="mailto:%20pebbles.jpl.nasa.gov">Jeff Steinman <jss@pebbles.jpl.nasa.gov></a> Datum PTS clock driver + <li class="inline"><a href="mailto:%20harlan@pfcs.com">Harlan Stenn <harlan@pfcs.com></a> GNU automake/autoconfigure makeover, various other bits (see the ChangeLog) + <li class="inline"><a href="mailto:%20ken@sdd.hp.com">Kenneth Stone <ken@sdd.hp.com></a> HP-UX port + <li class="inline"><a href="mailto:%20ajit@ee.udel.edu">Ajit Thyagarajan <ajit@ee.udel.edu></a>IP multicast/anycast support + <li class="inline"><a href="mailto:%20tsuruoka@nc.fukuoka-u.ac.jp">Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp></a>TRAK clock driver + <li class="inline"><a href="mailto:%20vixie@vix.com">Paul A Vixie <vixie@vix.com></a> TrueTime GPS driver, generic TrueTime clock driver + <li class="inline"><a href="mailto:%20Ulrich.Windl@rz.uni-regensburg.de">Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de></a> corrected and validated HTML documents according to the HTML DTD + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/debug.html b/contrib/ntp/html/debug.html new file mode 100644 index 0000000..c732c42 --- /dev/null +++ b/contrib/ntp/html/debug.html @@ -0,0 +1,172 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>NTP Debugging Techniques</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>NTP Debugging Techniques</h3> + <img src="pic/pogo.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>We make house calls and bring our own bugs.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:38</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>More Help</h4> + <script type="text/javascript" language="javascript" src="scripts/links12.txt"></script> + <hr> + <p>Once the NTP software distribution has been compiled and installed and the configuration file constructed, the next step is to verify correct operation and fix any bugs that may result. Usually, the command line that starts the daemon is included in the system startup file, so it is executed only at system boot time; however, the daemon can be stopped and restarted from root at any time. Usually, no command-line arguments are required, unless special actions described in the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page are required. Once started, the daemon will begin sending and receiving messages, as specified in the configuration file.</p> + <h4>Initial Startup</h4> + <p>When started for the first time, the frequency file, usually called <tt>ntp.drift</tt>, has not yet been created. The daemon switches to a special training routine designed to quickly determine the system clock frequency offset of the particular machine. The routine first measures the current clock offset and sets the clock, then continues for up to twenty minutes before measuring the clock offset, which might involve setting the clock again. The two measurements are used to compute the initial frequency offset and the daemon continues in regular operation, during which the frequency offset is continuously updated. Once each hour the daemon writes the current frequency offset to the <tt>ntp.drift</tt> file. When restarted after that, the daemon reads the frequency offset from the <tt>ntp.drift</tt> file and avoids the training routine.</p> + <p>Note that the daemon requires at least four packet exchanges when first started in any case. This is required in order for the mitigation algorithms to insure valid and accurate measurements and defend against network delay spikes and accidental or malicious errors induced by the servers selected in the configuration file. It normally takes less than four minutes to set the clock when first started, but this can be reduced to less than ten seconds with the <tt>iburst</tt> configuration option.</p> + <p>The best way to verify correct operation is using the <a href="ntpq.html"><tt>ntpq</tt> - standard NTP query program</a> and <a href="ntpdc.html"><tt>ntpdc</tt> - special NTP query program</a> utility programs, either on the server itself or from another machine elsewhere in the network. The <tt>ntpq</tt> program implements the management functions specified in the NTP specification <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305c.ps">RFC-1305, Appendix A</a>. The <tt>ntpdc</tt> program implements additional functions not provided in the standard. Both programs can be used to inspect the state variables defined in the specification and, in the case of <tt>ntpdc</tt>, additional ones intended for serious debugging. In addition, the <tt>ntpdc</tt> program can be used to selectively reconfigure and enable or disable some functions while the daemon is running.</p> + <p>In extreme cases with elusive bugs, the daemon can operate in two modes, depending on the presence of the <tt>-d</tt> command-line debug switch. If not present, the daemon detaches from the controlling terminal and proceeds autonomously. If one or more <tt>-d</tt> switches are present, the daemon does not detach and generates special output useful for debugging. In general, interpretation of this output requires reference to the sources. However, a single <tt>-d</tt> does produce only mildly cryptic output and can be very useful in finding problems with configuration and network troubles. With a little experience, the volume of output can be reduced by piping the output to <tt>grep</tt> and specifying the keyword of the trace you want to see.</p> + <p>Some problems are immediately apparent when the daemon first starts running. The most common of these are the lack of a UDP port for NTP (123) in the Unix <tt>/etc/services</tt> file (or equivalent in some systems). <b>Note that NTP does not use TCP in any form. Also note that NTP requires 123 for both source and destination ports.</b> These facts should be pointed out to firewall administrators.</p> + <p>Other problems are apparent in the system log, which ordinarily shows the startup banner, some cryptic initialization data and the computed precision value. Error messages at startup and during regular operation are sent to the system log. In real emergencies the daemon will sent a terminal error message to the system log and then cease operation.</p> + <p>The next most common problem is incorrect DNS names. Check that each DNS name used in the configuration file exists and that the address responds to the Unix <tt>ping</tt> command. The Unix <tt>traceroute</tt> or Windows <tt>tracert</tt> utility can be used to verify a partial or complete path exists. Most problems reported to the NTP newsgroup are not NTP problems, but problems with the network or firewall configuration.</p> + <p>When first started, the daemon polls the servers listed in the configuration file at 64-s intervals. In order to allow a sufficient number of samples for the NTP algorithms to reliably discriminate between truechimer servers and possible falsetickers, at least four valid messages from at least one server or peer listed in the configuration file is required before the daemon can set the clock. However, if the difference between the client time and server time is greater than the panic threshold, which defaults to 1000 s, the daemon sends a message to the system log and shuts down without setting the clock. It is necessary to set the local clock to within the panic threshold first, either manually by eyeball and wristwatch and the Unix <tt>date</tt> command, or by the <tt>ntpdate</tt> or <tt>ntpd -q</tt> commands. The panic threshold can be changed by the <tt>tinker panic</tt> command discribed on the <a href="miscopt.html">Miscellaneous Options</a> page. The panic threshold can be disabled for the first measurement by the <tt>-g</tt> command line option described on the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page.</p> + <p>If the difference between local time and server time is less than the panic threshold but greater than the step threshold, which defaults to 128 ms, the daemon will perform a step adjustment; otherwise, it will gradually slew the clock to the nominal time. Step adjustments are extremely rare in ordinary operation, usually as the result of reboot or hardware failure. The step threshold can be changed to 300 s using the <tt>-x</tt> command line option described on the <tt>ntpd</tt> page. This is usually sufficient to avoid a step after reboot or when the operator has set the system clock to within five minutes by eyeball-and-wristwatch. In extreme cases the step threshold can be changed by the <tt>tinker step</tt> command discribed on the <a href="miscopt.html">Miscellaneous Options</a> page. If set to zero, the clock will never be stepped; however, users should understand the implications for doing this in a distributed data network where all processing must be tightly synchronized. See the <a href="http://www.eecis.udel.edu/%7emills/leap.html">NTP Timescale and Leap Seconds</a> page for further information. If a step adjustment is made, the clock discipline algorithm will start all over again, requiring another round of at least four messages as before. This is necessary so that all servers and peers operate on the same set of time values.</p> + <p>The clock discipline algorithm is designed to avoid large noise spikes that might occur on a congested network or access line. If an offset sample exceeds the step threshold, it is ignored and a timer started. If a later sample is below the step threshold, the counter is reset and operation continues normally. However, if the counter is greater than the stepout interval, which defaults to 900 s, the next sample will step the time as directed. The stepout threshold can be changed by the <tt>tinker stepout</tt> command discribed on the Miscellaneous Options page.</p> + <p>If for some reason the hardware clock oscillator frequency error is very large, say over 400 PPM, the time offset when the daemon is started for the first time may increase over time until exceeding the step threshold, which requires a frequency adjustment and another step correction. However, due to provisions that reduce vulnerability to noise spikes, the second correction will not be done until after the stepout threshold. When the frequency error is very large, it may take a number of cycles like this until converging to the nominal frequency correction and writing the <tt>ntp.drift</tt> file. If the frequency error is over 500 PPM, convergence will never occur and occasional step adjustments will occur indefinitely.</p> + <h4>Verifying Correct Operation</h4> + <p>After starting the daemon, run the <tt>ntpq</tt> program using the <tt>-n</tt> switch, which will avoid possible distractions due to name resolution problems. Use the <tt>pe</tt> command to display a billboard showing the status of configured peers and possibly other clients poking the daemon. After operating for a few minutes, the display should be something like:</p> + <pre> +ntpq> pe + remote refid st t when poll reach delay offset jitter +===================================================================== +-isipc6.cairn.ne .GPS1. 1 u 18 64 377 65.592 -5.891 0.044 ++saicpc-isiepc2. pogo.udel.edu 2 u 241 128 370 10.477 -0.117 0.067 ++uclpc.cairn.net pogo.udel.edu 2 u 37 64 177 212.111 -0.551 0.187 +*pogo.udel.edu .GPS1. 1 u 95 128 377 0.607 0.123 0.027 +</pre> + <p>The host names or addresses shown in the <tt>remote</tt> column correspond to the server and peer entries listed in the configuration file; however, the DNS names might not agree if the names listed are not the canonical DNS names. IPv4 addresses are shown in dotted quad notation, while IPv6 addresses are shown alarmingly. The <tt>refid</tt> column shows the current source of synchronization, while the <tt>st</tt> column reveals the stratum, <tt>t</tt> the type (<tt>u</tt> = unicast, <tt>m</tt> = multicast, <tt>l</tt> = local, <tt>-</tt> = don't know), and <tt>poll</tt> the poll interval in seconds. The <tt>when</tt> column shows the time since the peer was last heard in seconds, while the <tt>reach</tt> column shows the status of the reachability register (see RFC-1305) in octal. The remaining entries show the latest delay, offset and jitter in milliseconds. Note that in NTP Version 4 what used to be the <tt>dispersion</tt> column has been replaced by the <tt>jitter</tt> column.</p> + <p>As per the NTP specification RFC-1305, when the <tt>stratum</tt> is between 0 and 15 for a NTP server, the <tt>refid</tt> field shows the server DNS name or, if not found, the IP address in dotted-quad. When the <tt>stratum</tt> is any value for a reference clock, this field shows the identification string assigned to the clock. However, until the client has synchronized to a server, or when the <tt>stratum</tt> for a NTP server is 0 (appears as 16 in the billboards), the status cannot be determined. As a help in debugging, the <tt>refid</tt> field is set to a four-character string called the kiss code. The current kiss codes are as as follows.</p> + <p>Peer Kiss Codes</p> + <p><tt>ACST</tt></p> + <dl> + <dd>The association belongs to a anycast server. + <dt><tt>AUTH</tt> + <dd>Server authentication failed. Please wait while the association is restarted. + <dt><tt>AUTO</tt> + <dd>Autokey sequence failed. Please wait while the association is restarted. + <dt><tt>BCST</tt> + <dd>The association belongs to a broadcast server. + <dt><tt>CRYP</tt> + <dd>Cryptographic authentication or identification failed. The details should be in the system log file or the <tt>cryptostats</tt> statistics file, if configured. No further messages will be sent to the server. + <dt><tt>DENY</tt> + <dd>Access denied by remote server. No further messages will be sent to the server. + <dt><tt>DROP</tt> + <dd>Lost peer in symmetric mode. Please wait while the association is restarted. + <dt><tt>RSTR</tt> + <dd>Access denied due to local policy. No further messages will be sent to the server. + <dt><tt>INIT</tt> + <dd>The association has not yet synchronized for the first time. + <dt><tt>MCST</tt> + <dd>The association belongs to a manycast server. + <dt><tt>NKEY</tt> + <dd>No key found. Either the key was never installed or is not trusted. + <dt><tt>RATE</tt> + <dd>Rate exceeded. The server has temporarily denied access because the client exceeded the rate threshold. + <dt><tt>RMOT</tt> + <dd>Somebody is tinkering with the association from a remote host running <tt>ntpdc</tt>. Not to worry unless some rascal has stolen your keys. + <dt><tt>STEP</tt> + <dd>A step change in system time has occurred, but the association has not yet resynchronized. + </dl> + <p>System Kiss Codes</p> + <dl> + <dt><tt>INIT</tt> + <dd>The system clock has not yet synchronized for the first time. + <dt><tt>STEP</tt> + <dd>A step change in system time has occurred, but the system clock has not yet resynchronized. + </dl> + <p>The tattletale symbol at the left margin displays the synchronization status of each peer. The currently selected peer is marked <tt>*</tt>, while additional peers designated acceptable for synchronization are marked <tt>+</tt>. Peers marked <tt>*</tt> and <tt>+</tt> are included in the weighted average computation to set the local clock; the data produced by peers marked with other symbols are discarded. See the <tt>ntpq</tt> page for the meaning of these symbols.</p> + <p>Additional details for each peer separately can be determined by the following procedure. First, use the <tt>as</tt> command to display an index of association identifiers, such as</p> + <pre> +ntpq> as +ind assID status conf reach auth condition last_event cnt +=========================================================== + 1 50252 f314 yes yes ok outlyer reachable 1 + 2 50253 f414 yes yes ok candidat reachable 1 + 3 50254 f414 yes yes ok candidat reachable 1 + 4 50255 f614 yes yes ok sys.peer reachable 1 +</pre> + <p>Each line in this billboard is associated with the corresponding line in the <tt>pe</tt> billboard above. The <tt>assID</tt> shows the unique identifier for each mobilized association, while the <tt>status</tt> column shows the peer status word in hex, as defined in the NTP specification. Next, use the <tt>rv</tt> command and the respective <tt>assID</tt> identifier to display a detailed synopsis for the selected peer, such as</p> + <pre> +ntpq> rv 50253 +status=f414 reach, conf, auth, sel_candidat, 1 event, event_reach, +srcadr=saicpc-isiepc2.cairn.net, srcport=123, dstadr=140.173.1.46, +dstport=123, keyid=3816249004, stratum=2, precision=-27, +rootdelay=10.925, rootdispersion=12.848, refid=pogo.udel.edu, +reftime=bd11b225.133e1437 Sat, Jul 8 2000 13:59:01.075, delay=10.550, +offset=-1.357, jitter=0.074, dispersion=1.444, reach=377, valid=7, +hmode=1, pmode=1, hpoll=6, ppoll=7, leap=00, flash=00 ok, +org=bd11b23c.01385836 Sat, Jul 8 2000 13:59:24.004, +rec=bd11b23c.02dc8fb8 Sat, Jul 8 2000 13:59:24.011, +xmt=bd11b21a.ac34c1a8 Sat, Jul 8 2000 13:58:50.672, +filtdelay= 10.45 10.50 10.63 10.40 10.48 10.43 10.49 11.26, +filtoffset= -1.18 -1.26 -1.26 -1.35 -1.35 -1.42 -1.54 -1.81, +filtdisp= 0.51 1.47 2.46 3.45 4.40 5.34 6.33 7.28, +hostname="miro.time.saic.com", signature=md5WithRSAEncryption, flags=0x83f01, initsequence=61, initkey=0x287b649c, +timestamp=3172053041 +</pre> + <p>A detailed explanation of the fields in this billboard are beyond the scope of this discussion; however, most variables defined in the NTP Version 3 specification RFC-1305 are available along with others defined for NTPv4 on the <tt>ntpq</tt> page. This particular example was chosen to illustrate probably the most complex configuration involving symmetric modes and public-key cryptography. As the result of debugging experience, the names and values of these variables may change from time to time.</p> + <p>A useful indicator of miscellaneous problems is the <tt>flash</tt> value, which reveals the state of the various sanity tests on incoming packets. There are currently 12 bits, one for each test, numbered from the right, which is for test 1. If the test fails, the corresponding bit is set to one and zero otherwise. If any bit is set following each processing step, the packet is discarded. The meaning of each test is described on the <tt>ntpq</tt> page.</p> + <p>The three lines identified as <tt>filtdelay</tt>, <tt>filtoffset</tt> and <tt>filtdisp</tt> reveal the roundtrip delay, clock offset and dispersion for each of the last eight measurement rounds, all in milliseconds. Note that the dispersion, which is an estimate of the error, increases as the age of the sample increases. From these data, it is usually possible to determine the incidence of severe packet loss, network congestion, and unstable local clock oscillators. There are no hard and fast rules here, since every case is unique; however, if one or more of the rounds show large values or change radically from one round to another, the network is probably congested or lossy.</p> + <p>Once the daemon has set the local clock, it will continuously track the discrepancy between local time and NTP time and adjust the local clock accordingly. There are two components of this adjustment, time and frequency. These adjustments are automatically determined by the clock discipline algorithm, which functions as a hybrid phase/frequency feedback loop. The behavior of this algorithm is carefully controlled to minimize residual errors due to network jitter and frequency variations of the local clock hardware oscillator that normally occur in practice. However, when started for the first time, the algorithm may take some time to converge on the intrinsic frequency error of the host machine.</p> + <p>The state of the local clock itself can be determined using the <tt>rv</tt> command (without the argument), such as</p> + <pre> +ntpq> rv +status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg, +version="ntpd 4.0.99j4-r Fri Jul 7 23:38:17 GMT 2000 (1)", +processor="i386", system="FreeBSD3.4-RELEASE", leap=00, stratum=2, +precision=-27, rootdelay=0.552, rootdispersion=12.532, peer=50255, +refid=pogo.udel.edu, +reftime=bd11b220.ac89f40a Sat, Jul 8 2000 13:58:56.673, poll=6, +clock=bd11b225.ee201472 Sat, Jul 8 2000 13:59:01.930, state=4, +phase=0.179, frequency=44.298, jitter=0.022, stability=0.001, +hostname="barnstable.udel.edu", signature=md5WithRSAEncryption, +flags=0x80011, hostkey=3171372095, refresh=3172016539 +cert="grundoon.udel.edu grundoon.udel.edu 0x3 3233600829" +cert="whimsy.udel.edu whimsy.udel.edu 0x5 3233682156" +</pre> + <p>An explanation about most of these variables is in the RFC-1305 specification. The most useful ones include <tt>clock</tt>, which shows when the clock was last adjusted, and <tt>reftime</tt>, which shows when the server clock of <tt>refid</tt> was last adjusted. The <tt>version</tt>, <tt>processor</tt> and <tt>system</tt> values are very helpful when included in bug reports. The mean millisecond time offset (<tt>phase</tt>) and deviation (<tt>jitter</tt>) monitor the clock quality, while the mean PPM frequency offset (<tt>frequency</tt>) and deviation (<tt>stability</tt>) monitor the clock stability and serve as a useful diagnostic tool. It has been the experience of NTP operators over the years that these data represent useful environment and hardware alarms. If the motherboard fan freezes up or some hardware bit sticks, the system clock is usually the first to notice it.</p> + <p>Among the new variables added for NTP Version 4 are the <tt>hostname</tt>, <tt>signature</tt>, <tt>flags, hostkey, refresh </tt>and<tt> cert</tt>, which are used for the Autokey public-key cryptography described on the <a href="authopt.html">Authentication Options</a> page. The numeric values show the filestamps, in NTP seconds, that the associated media files were created. These are useful in diagnosing problems with cryptographic key consistency and ordering principles.</p> + <p>When nothing seems to happen in the <tt>pe</tt> billboard after some minutes, there may be a network problem. One common network problem is an access controlled router on the path to the selected peer or an access controlled server using methods described on the <a href="accopt.html">Access Control Options</a> page. Another common problem is that the server is down or running in unsynchronized mode due to a local problem. Use the <tt>ntpq</tt> program to spy on the server variables in the same way you can spy on your own.</p> + <p>Normally, the daemon will adjust the local clock in small steps in such a way that system and user programs are unaware of its operation. The adjustment process operates continuously unless the apparent clock error exceeds the step threshold for a period longer than the stepout threshold, which for most Internet paths is a very rare event. If the event is simply an outlyer due to an occasional network delay spike, the correction is simply discarded; however, if the apparent time error persists for longer than the stepout threshold of about 17 minutes, the local clock is stepped or slewed to the new value as directed. This behavior is designed to resist errors due to severely congested network paths, as well as errors due to confused radio clocks upon the epoch of a leap second.</p> + <h4>Large Frequency Errors</h4> + <p>The frequency tolerance of computer clock oscillators can vary widely, which can put a strain on the daemon's ability to compensate for the intrinsic frequency error. While the daemon can handle frequency errors up to 500 parts-per-million (PPM), or 43 seconds per day, values much above 100 PPM reduce the headroom and increase the time to learn the particular value and record it in the <tt>ntp.drift</tt> file. In extreme cases before the particular oscillator frequency error has been determined, the residual system time offsets can sweep from one extreme to the other of the 128-ms tracking window only for the behavior to repeat at 900-s intervals until the measurements have converged.</p> + <p>In order to determine if excessive frequency error is a problem, observe the nominal <tt>filtoffset</tt> values for a number of rounds and divide by the poll interval. If the result is something approaching 500 PPM, there is a good chance that NTP will not work properly until the frequency error is reduced by some means. A common cause is the hardware time-of-year (TOY) clock chip, which must be disabled when NTP disciplines the software clock. For some systems this can be done using the <tt><a href="tickadj.html">tickadj</a></tt> utility and the <tt>-s</tt> command line argument. For other systems this can be done using a command in the system startup file.</p> + <p>If the TOY chip is not the cause, the problem may be that the hardware clock frequency may simply be too slow or two fast. In some systems this might require tweaking a trimmer capacitor on the motherboard. For other systems the clock frequency can be adjusted in increments of 100 PPM using the <tt>tickadj</tt> utility and the <tt>-t</tt> command line argument. Note that the <tt>tickadj</tt> alters certain kernel variables and, while the utility attempts to figure out an acceptable way to do this, there are many cases where <tt>tickadj</tt> is incompatible with a running kernel.</p> + <h4>Access Controls</h4> + <p>Provisions are included in <tt>ntpd</tt> for access controls which deflect unwanted traffic from selected hosts or networks. The controls described on the <a href="accopt.html">Access Control Options</a> include detailed packet filter operations based on source address and address mask. Normally, filtered packets are dropped without notice other than to increment tally counters. However, the server can be configured to send a "kiss-o'-death" (KOD) packet to the client either when explicitly configured or when cryptographic authentication fails for some reason. The client association is permanently disabled, the access denied bit (TEST4) is set in the flash variable and a message is sent to the system log.</p> + <p>The access control provisions include a limit on the packet rate from a host or network. If an incoming packet exceeds the limit, it is dropped and a KOD sent to the source. If this occurs after the client association has synchronized, the association is not disabled, but a message is sent to the system log. See the <a href="accopt.html">Access Control Options</a> page for further informatin.</p> + <h4>Large Delay Variations</h4> + <p>In some reported scenarios an access line may show low to moderate network delays during some period of the day and moderate to high delays during other periods. Often the delay on one direction of transmission dominates, which can result in large time offset errors, sometimes in the range up to a few seconds. It is not usually convenient to run <tt>ntpd</tt> throughout the day in such scenarios, since this could result in several time steps, especially if the condition persists for greater than the stepout threshold.</p> + <p>Specific provisions have been built into <tt>ntpd</tt> to cope with these problems. The scheme is called "huff-'n-puff and is described on the <a href="miscopt.html">Miscellaneous Options</a> page. An alternative approach in such scenarios is first to calibrate the local clock frequency error by running <tt>ntpd</tt> in continuous mode during the quiet interval and let it write the frequency to the <tt>ntp.drift</tt> file. Then, run <tt>ntpd -q</tt> from a cron job each day at some time in the quiet interval. In systems with the nanokernel or microkernel performance enhancements, including Solaris, Tru64, Linux and FreeBSD, the kernel continuously disciplines the frequency so that the residual correction produced by <tt>ntpd</tt> is usually less than a few milliseconds.</p> + <h4>Cryptographic Authentication</h4> + <p>Reliable source authentication requires the use of symmetric key or public key cryptography, as described on the <a href="authopt.html">Authentication Options</a> page. In symmetric key cryptography servers and clients share session keys contained in a secret key file In public key cryptography, which requires the OpenSSL software library, the server has a private key, never shared, and a public key with unrestricted distribution. The cryptographic media required are produced by the <a href="keygen.html"><tt>ntp-keygen</tt></a> program.</p> + <p>Problems with symmetric key authentication are usually due to mismatched keys or improper use of the <tt>trustedkey</tt> command. A simple way to check for problems is to use the trace facility, which is enabled using the <tt>ntpd -d</tt> command line. As each packet is received a trace line is displayed which shows the authentication status in the <tt>auth</tt> field. A status of 1 indicates the packet was successful authenticated; otherwise it has failed.</p> + <p>A common misconception is the implication of the <tt>auth</tt> bit in the <tt>enable</tt> and <tt>disable</tt> commands. <b>This bit does not affect authentication in any way other than to enable or disable mobilization of a new persistent association in broadcast/multicast client, manycast client or symmetric passive modes.</b> If enabled, which is the default, these associations require authentication; if not, an association is mobilized even if not authenticated. Users are cautioned that running with authentication disabled is very dangerous, since an intruder can easily strike up an association and inject false time values.</p> + <p>Public key cryptography is supported in NTPv4 using the Autokey protocol, which is described in briefings on the NTP Project page linked from www.ntp.org. Development of this protocol is mature and the <tt>ntpd</tt> implementation is basically complete. Autokey version 2, which is the latest and current version, includes provisions to hike certificate trails, operate as certificate authorities and verify identity using challenge/response identification schemes. Further details of the protocol are on the <a href="authopt.html">Authentication Options</a> page. Common problems with configuration and key generation are mismatched key files, broken links and missing or broken random seed file.</p> + <p>As in the symmetric key cryptography case, the trace facility is a good way to verify correct operation. A statistics file <tt>cryptostats</tt> records protocol transactions and error messages. The daemon requires a random seed file, public/private key file and a valid certificate file; otherwise it exits immediately with a message to the system log. As each file is loaded a trace message appears with its filestamp. There are a number of checks to insure that only consistent data are used and that the certificate is valid. When the protocol is in operation a number of checks are done to verify the server has the expected credentials and its filestamps and timestamps are consistent. Errors found are reported using NTP control and monitoring protocol traps with extended trap codes shown in the Authentication Options page.</p> + <p>To assist debugging every NTP extension field is displayed in the trace along with the Autokey operation code. Every extension field carrying a verified signature is identified and displayed along with filestamp and timestamp where meaningful. In all except broadcast/multicast client mode, correct operation of the protocol is confirmed by the absence of extension fields and an <tt>auth</tt> value of one. It is normal in broadcast/multicast client mode that the broadcast server use one extension field to show the host name, status word and association ID.</p> + <h4>Debugging Checklist</h4> + <p>If the <tt>ntpq</tt> or <tt>ntpdc</tt> programs do not show that messages are being received by the daemon or that received messages do not result in correct synchronization, verify the following:</p> + <ol> + <li>Verify the <tt>/etc/services</tt> file host machine is configured to accept UDP packets on the NTP port 123. NTP is specifically designed to use UDP and does not respond to TCP. + <li>Check the system log for <tt>ntpd</tt> messages about configuration errors, name-lookup failures or initialization problems. Common system log messages are summarized on the <a href="msyslog.html"><tt>ntpd</tt> System Log Messages</a> page. Check to be sure that only one copy of <tt>ntpd</tt> is running. + <li>Verify using <tt>ping</tt> or other utility that packets actually do make the round trip between the client and server. Verify using <tt>nslookup</tt> or other utility that the DNS server names do exist and resolve to valid Internet addresses. + <li>Check that the remote NTP server is up and running. The usual evidence that it is not is a <tt>Connection refused</tt> message. + <li>Using the <tt>ntpdc</tt> program, verify that the packets received and packets sent counters are incrementing. If the sent counter does not increment and the configuration file includes configured servers, something may be wrong in the host network or interface configuration. If this counter does increment, but the received counter does not increment, something may be wrong in the network or the server NTP daemon may not be running or the server itself may be down or not responding. + <li>If both the sent and received counters do increment, but the <tt>reach</tt> values in the <tt>pe</tt> billboard with <tt>ntpq</tt> continues to show zero, received packets are probably being discarded for some reason. If this is the case, the cause should be evident from the <tt>flash</tt> variable as discussed above and on the <tt>ntpq</tt> page. It could be that the server has disabled access for the client address, in which case the refid field in the <tt>ntpq pe</tt> billboard will show a kiss code. See earlier on this page for a list of kiss codes and their meaning. + <li>If the <tt>reach</tt> values in the <tt>pe</tt> billboard show the servers are alive and responding, note the tattletale symbols at the left margin, which indicate the status of each server resulting from the various grooming and mitigation algorithms. The interpretation of these symbols is discussed on the <tt>ntpq</tt> page. After a few minutes of operation, one or another of the reachable server candidates should show a * tattletale symbol. If this doesn't happen, the intersection algorithm, which classifies the servers as truechimers or falsetickers, may be unable to find a majority of truechimers among the server population. + <li>If all else fails, see the FAQ and/or the discussion and briefings at the NTP Project page. + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver1.html b/contrib/ntp/html/drivers/driver1.html new file mode 100644 index 0000000..afd85d2 --- /dev/null +++ b/contrib/ntp/html/drivers/driver1.html @@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Undisciplined Local Clock</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Undisciplined Local Clock</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.1.<i>u</i><br> + Reference ID: <tt>LCL</tt><br> + Driver ID: <tt>LOCAL</tt></p> + <h4>Description</h4> + <p>This driver is intended for use in an isolated network where no external source of synchronization such as a radio clock or modem is available. It allows a designated time server to act as a primary server to provide synchronization to other clients on the network. Pick a machine that has a good clock oscillator (Digital machines are good, Sun machines are not) and configure it with this driver. Set the clock using the best means available, like eyeball-and-wristwatch. Then, point all the other machines at this one or use broadcast (not multicast) mode to distribute time.</p> + <p>Another application for this driver is if a particular server clock is to be used as the clock of last resort when all other normal synchronization sources have gone away. This is especially useful if that server has an ovenized oscillator. For this you would configure this driver at a stratum greater than any other likely sources of time (say 3 or 4) to prevent the server taking over when legitimate sources are still available.</p> + <p>A third application for this driver is when an external discipline source is available, such as the NIST <tt>lockclock</tt> program, which synchronizes the local clock via a telephone modem and the NIST Automated Computer Time Service (ACTS), or the Digital Time Synchronization Service (DTSS), which runs on DCE machines. In this case the stratum should be set at zero, indicating a bona fide stratum-1 source. In the case of DTSS, the local clock can have a rather large jitter, depending on the interval between corrections and the intrinsic frequency error of the clock oscillator. In extreme cases, this can cause clients to exceed the 128-ms slew window and drop off the NTP subnet.</p> + <p>In the case where a NTP time server is synchronized to some device or protocol that is not external to the NTP daemon itself, some means should be provided to pass such things as error and health values to the NTP daemon for dissemination to its clients. If this is not done, there is a very real danger that the device or protocol could fail and with no means to tell NTP clients of the mishap. When ordinary Unix system calls like <tt>adjtime()</tt> are used to discipline the kernel clock, there is no obvious way this can be done without modifying the code for each case. However, when a modified kernel with the <tt>ntp_adjtime()</tt> system call is available, that routine can be used for the same purpose as the <tt>adjtime()</tt> routine and in addition provided with the estimated error, maximum error, and leap-indicator values. This is the preferred way to synchronize the kernel clock and pass information to the NTP clients.</p> + <p>In the default mode the behavior of the clock selection algorithm is modified when this driver is in use. The algorithm is designed so that this driver will never be selected unless no other discipline source is available. This can be overridden with the <tt>prefer</tt> keyword of the <tt>server</tt> configuration command, in which case only this driver will be selected for synchronization and all other discipline sources will be ignored. This behavior is intended for use when an external discipline source controls the system clock. See the <a href="../prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for a detailed description of the exact behavior.</p> + <p>The stratum for this driver is set at 5 by default, but can be changed by the <tt>fudge</tt> configuration command and/or the <tt>ntpdc</tt> utility. The reference ID is <tt>LCL</tt> by default, but can be changed using the same mechanisms. <b>*NEVER*</b> configure this driver to operate at a stratum which might possibly disrupt a client with access to a bona fide primary server, unless the local clock oscillator is reliably disciplined by another source. <b>*NEVER NEVER*</b> configure a server which might devolve to an undisciplined local clock to use multicast mode.</p> + <p>This driver provides a mechanism to trim the local clock in both time and frequency, as well as a way to manipulate the leap bits. The <tt>fudge time1</tt> parameter adjusts the time (in seconds) and the <tt>fudge time2</tt> parameter adjusts the frequency (in parts per million). Both parameters are additive and operate only once; that is, each command (as from <tt>ntpdc</tt>) adds signed increments in time or frequency to the nominal local clock time and frequency.</p> + <h4>Operation with an External Reference Source</h4> + <p>There are special provisions for this driver to operate in conjunction with an external reference source, such as the <tt>LOCKCLOCK</tt> scheme used by the NIST time servers. In such schemes the system clock is disciplined by a source external to NTP, in the <tt>LOCKCLOCK</tt> case an ACTS telephone modem. To support <tt>LOCKCLOCK</tt> the NTP distribution should be built with the <tt>--enable-nist</tt> parameter in the configuration phase of the build procedure. This changes the system behavior as follows:</p> + <ol> + <li>The system clock is not disciplined in any way other than to call the <tt>ntp_adjtime()</tt> system call to obtain the kernel leap code, which becomes the driver leap code and. If the kernel leap code is 11 (not synchronized), the driver stratum is infinity; otherwise the stratum is set by the <tt>stratum</tt> subcommand on the <tt>fudge</tt> command applying to the driver. + <li>The NTP algorithms operate in the normal fashion with this driver and possibly other drivers and servers; however, the local clock driver as the <tt>prefer</tt> peer will always be selected, even if declared falseticker by the selection algorithm or fails to survive the clustering algorithm. + <li>If the driver leap code is 11, the system leap code is 11, system stratum infinity and system reference identifier <tt>DOWN</tt>. This provides a definitive status condition to dependent clients. + </ol> + <p>The local clock driver should be configured something like this:</p> + <p><tt>server 127.127.1.1 prefer</tt></p> + <p><tt>fudge 127.127.1.1 stratum 0 refid NIST</tt></p> + <p>The <tt>prefer</tt> keyword forces the driver to discipline the clock, even if other servers are configured and running correctly. This is convenient when a number of servers watch each other for monitoring and statistics gathering. In particular, the <tt>peerstats</tt> data and <tt>sysstats</tt> data can be collected at each server, aggregated for daily or weekly reports and sent by electric mail to a monitoring site. In addition, the full suite of cryptographic authentication algorithms is avialable to other servers and dependent clients.</p> + <h4>Monitor Data</h4> + <p>No <tt>filegen clockstats</tt> monitor data are produced by this driver.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Specifies the frequency offset calibration factor, in parts per million, with default 0.0. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 3. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>LCL</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver10.html b/contrib/ntp/html/drivers/driver10.html new file mode 100644 index 0000000..97b0495 --- /dev/null +++ b/contrib/ntp/html/drivers/driver10.html @@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Austron 2200A/2201A GPS Receivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Austron 2200A/2201A GPS Receivers</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.10.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_AS2201</tt><br> + Serial Port: <tt>/dev/gps<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt></p> + <h4>Description</h4> + <p>This driver supports the Austron 2200A/2201A GPS/LORAN Synchronized Clock and Timing Receiver connected via a serial port. It supports several special features of the clock, including the Input Buffer Module, Output Buffer Module, IRIG-B Interface Module and LORAN Assist Module. It requires the RS232 Buffered Serial Interface module for communication with the driver. For operation with multiple computers, it requires the <tt>ppsclock</tt> streams module described in the <a href="../ldisc.html">Line Disciplines and Streams Modules</a> page. The streams module requires a gadget box and 1-PPS level converter, such as described in the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page.</p> + <p>For use with a single computer, the receiver can be connected directly to the receiver. For use with multiple computers, one of them is connected directly to the receiver and generates the polling messages. The other computers just listen to the receiver output directly or through a buffer amplifier. For computers that just listen, <tt>fudge flag2</tt> must be set and the <tt>ppsclock </tt>streams module configured on each of them.</p> + <p>This receiver is capable of a comprehensive and large volume of statistics and operational data. The specific data collection commands and attributes are embedded in the driver source code; however, the collection process can be enabled or disabled using the flag4 flag. If set, collection is enabled; if not, which is the default, it is disabled. A comprehensive suite of data reduction and summary scripts is in the ./scripts/stats directory</p> + of the ntp3 distribution. + <h4>Monitor Data</h4> + <p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Set for computers that listen-only. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver11.html b/contrib/ntp/html/drivers/driver11.html new file mode 100644 index 0000000..b36f7f3 --- /dev/null +++ b/contrib/ntp/html/drivers/driver11.html @@ -0,0 +1,87 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Arbiter 1088A/B GPS Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Arbiter 1088A/B GPS Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.11.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_ARBITER</tt><br> + Serial Port: <tt>/dev/gps<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt></p> + <h4> + <p>Description</p> + </h4> + <p>This driver supports the Arbiter 1088A/B Satellite Controlled Clock. The claimed accuracy of this clock is 100 ns relative to the PPS output when receiving four or more satellites.</p> + <p>The receiver should be configured before starting the NTP daemon, in order to establish reliable position and operating conditions. It does not initiate surveying or hold mode. For use with NTP, the daylight savings time feature should be disables (<tt>D0</tt> command) and the broadcast mode set to operate in UTC (<tt>BU</tt> command).</p> + <p>The timecode format supported by this driver is selected by the poll sequence <tt>B5</tt>, which initiates a line in the following format to be repeated once per second until turned off by the <tt>B0</tt> command.</p> + <p>Format <tt>B5</tt> (24 ASCII printing characters):</p> + <pre><cr><lf>i yy ddd hh:mm:ss.000bbb + +on-time = <cr> +i = synchronization flag (' ' = locked, '?' = unlocked) +yy = year of century +ddd = day of year +hh:mm:ss = hours, minutes, seconds +.000 = fraction of second (not used) +bbb = tailing spaces for fill</pre> + <p>The alarm condition is indicated by a '?' at i, which indicates the receiver is not synchronized. In normal operation, a line consisting of the timecode followed by the time quality character (TQ) followed by the receiver status string (SR) is written to the clockstats file.</p> + <p>The time quality character is encoded in IEEE P1344 standard:</p> + <p>Format <tt>TQ</tt> (IEEE P1344 estimated worst-case time quality)</p> + <pre>0 clock locked, maximum accuracy +F clock failure, time not reliable +4 clock unlocked, accuracy < 1 us +5 clock unlocked, accuracy < 10 us +6 clock unlocked, accuracy < 100 us +7 clock unlocked, accuracy < 1 ms +8 clock unlocked, accuracy < 10 ms +9 clock unlocked, accuracy < 100 ms +A clock unlocked, accuracy < 1 s +B clock unlocked, accuracy < 10 s</pre> + <p>The status string is encoded as follows:</p> + <p>Format <tt>SR</tt> (25 ASCII printing characters)</p> + <pre>V=vv S=ss T=t P=pdop E=ee + +vv = satellites visible +ss = relative signal strength +t = satellites tracked +pdop = position dilution of precision (meters) +ee = hardware errors</pre> + <p>A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself.</p> + <h4>Monitor Data</h4> + <p>When enabled by the <tt>flag4</tt> fudge flag, an additional line containing the latitude, longitude, elevation and optional deviation data is written to the <tt>clockstats</tt> file. The deviation data operates with an external pulse-per-second (PPS) input, such as a cesium oscillator or another radio clock. The PPS input should be connected to the B event channel and the radio initialized for deviation data on that channel. The deviation data consists of the mean offset and standard deviation of the external PPS signal relative the GPS signal, both in microseconds over the last 16 seconds.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver12.html b/contrib/ntp/html/drivers/driver12.html new file mode 100644 index 0000000..6d0b38a --- /dev/null +++ b/contrib/ntp/html/drivers/driver12.html @@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>KSI/Odetics TPRO/S IRIG Interface</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>KSI/Odetics TPRO/S IRIG Interface</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.12.<i>u</i><br> + Reference ID: <tt>IRIG</tt><br> + Driver ID: <tt>IRIG_TPRO</tt><br> + TPRO Device: <tt>/dev/tpro<i>u</i></tt><br> + Requires: KSI/Odetics device driver, <tt>/usr/include/sys/tpro.h</tt> header file</p> + <h4>Description</h4> + <p>This driver supports the KSI/Odetics TPRO and TPRO-SAT IRIG-B Decoder, which is a module connected directly to the SBus of a Sun workstation. The module works with the IRIG-B signal generated by several radio clocks, including those made by Arbiter, Austron, Odetics, Spectracom and TrueTime, among others, although it is generally an add- on option. In the case of the TPRO-SAT, the module is an integral part of a GPS receiver, which serves as the primary timing source.</p> + <p>Using the TPRO interface as a NTP reference clock provides precision time only to ntpd and its clients. With suitable kernel modifications, it is possible to use the TPRO as the CPU system clock, avoiding errors introduced by the CPU clock oscillator wander. See the <a href="../kern.html">A Kernel Model for Precision Timekeeping </a>page for further details.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>IRIG</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver16.html b/contrib/ntp/html/drivers/driver16.html new file mode 100644 index 0000000..95308ba --- /dev/null +++ b/contrib/ntp/html/drivers/driver16.html @@ -0,0 +1,31 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.6 [en] (Win95; U) [Netscape]"> + <meta name="Author" content="Ganesh Ramasivan"> + <title>Bancomm bc635VME Time and Frequency Processor</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>bc635VME/bc350VXI Time and Frequency Processor</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.16.<i>u</i><br> + Reference ID: BTFP<br> + Driver ID: GPS_BANCOMM<br> + Bancomm Device <tt>/dev/btfp0</tt><br> + Requires: Bancomm bc635 TFP device module driver for SunOS 4.x/SunOS 5.x</p> + <h4>Description</h4> + <p>This is the clock driver for the Bancomm bc635VME Time and Frequency Processor. It requires the BANCOMM bc635VME bc350VXI Time and Frequency Processor Module Driver for SunOS 4.x/SunOS 5.x UNIX Systems.</p> + <p>Most of this code is originally from refclock_bancomm.c with thanks. It has been modified and tested on an UltraSparc IIi-cEngine running Solaris 2.6. A port for HPUX is not available henceforth.</p> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver18.html b/contrib/ntp/html/drivers/driver18.html new file mode 100644 index 0000000..6acf5f2 --- /dev/null +++ b/contrib/ntp/html/drivers/driver18.html @@ -0,0 +1,82 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>NIST Modem Time Service</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Automated Computer Time Service (ACTS)</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.18.<i>u</i><br> + Reference ID: <tt>NIST | USNO | PTB | WWVB</tt><br> + Driver ID: <tt>ACTS_MODEM</tt><br> + Serial Port: <tt>/dev/acts<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt><br> + Requires: <tt>/usr/include/sys/termios.h</tt> header file with modem control and a dial-out (cua) device.</p> + <h4>Description</h4> + <p>This driver supports the US (NIST and USNO) and European (PTB (Germany), NPL (UK), etc.) modem time services, as well as Spectracom GPS and WWVB receivers connected via a modem. The driver periodically dials a number from a telephone list, receives the timecode data and calculates the local clock correction. It is designed primarily for backup when neither a radio clock nor connectivity to Internet time servers are available. It can also be configured to operate full period.</p> + <p>For best results the indicated time must be corrected for the modem and telephone circuit propagation delays, which can reach 200 ms or more. For the NIST service, corrections are determined automatically by measuring the roundtrip delay of echoed characters. With this service the absolute accuracy is typically a millisecond or two. Corrections for the other services must be determined by other means. With these services variations from call to call and between messages during a call are typically a few milliseconds, occasionally higher.</p> + <p>This driver requires a 9600-bps modem with a Hayes-compatible command set and control over the modem data terminal ready (DTR) control line. The actual line speed ranges from 1200 bps with USNO to 14,400 bps with NIST. The modem setup string is hard-coded in the driver and may require changes for nonstandard modems or special circumstances.</p> + <p>There are three modes of operation selected by the <tt>mode</tt> keyword in the <tt>server</tt> configuration command. In manual mode (2) the calling program is initiated by setting fudge <tt>flag1</tt>. This can be done manually using <tt>ntpdc</tt>, or by a cron job. In auto mode (0) <tt>flag1</tt> is set at each poll event. In backup mode (1) <tt>flag1</tt> is set at each poll event, but only if no other synchronization sources are available.</p> + <p>When <tt>flag1</tt> is set, the calling program dials the first number in the list specified by the <tt>phone</tt> command. If the call fails for any reason, the program dials the second number and so on. The phone number is specified by the Hayes ATDT prefix followed by the number itself, including the prefix and long-distance digits and delay code, if necessary. The <tt>flag1</tt> is reset and the calling program terminated if (a) valid clock update has been determined, (b) no more numbers remain in the list, (c) a device fault or timeout occurs or (d) fudge <tt>flag1</tt> is reset manually using <tt>ntpdc</tt>.</p> + <p>The driver automatically recognizes the message format of each modem time service. It selects the parsing algorithm depending on the message length. There is some hazard should the message be corrupted. However, the data format is checked carefully and only if all checks succeed is the message accepted. Corrupted lines are discarded without complaint. Once the service is known, the reference identifier for the driver is set to NIST, USNO, PTB or WWVB as appropriate.</p> + <p>Ordinarily, the serial port is connected to a modem; however, if fudge <tt>flag3</tt> is set, it can be connected directly to a Spectracom WWV or GPS radio for testing or calibration. The Spectracom radio can be connected via a modem if the radio is connfigured to send time codes continuoulsly at 1-s intervals. In principle, fudge <tt>flag2</tt> enables port locking, allowing the modem to be shared when not in use by this driver. At least on Solaris with the current NTP I/O routines, this results in lots of ugly error messages.</p> + <p>The <tt>minpoll</tt> and <tt>maxpoll</tt> keywords of the server configuration command can be used to limit the intervals between calls. The recommended settings are 12 (1.1 hours) for <tt>minpoll</tt> and 17 (36 hours) for <tt>maxpoll</tt>. Ordinarily, the poll interval will start at <tt>minpoll</tt> and ramp up to <tt>maxpoll</tt> in a day or two.</p> + <h4>US Phone Numbers and Formats</h4> + <p>Note: Phone numbers include the entire Hayes modem command, including the <tt>ATDT</tt> and other control codes as may be necessary. For most cases only the <tt>ATDT</tt> may be necessary.</p> + <p><a href="http://www.boulder.nist.gov/timefreq">National Institute of Science and Technology (NIST)</a></p> + <p>Phone: (303) 494-4774 (Boulder, CO); (808) 335-4721 (Hawaii)</p> + <p><a href="http://www.boulder.nist.gov/timefreq/service/acts.htm">Data Format</a></p> + <p><tt>National Institute of Standards and Technology<br> + Telephone Time Service, Generator 3B<br> + Enter question mark "?" for HELP<br> + MJD YR MO DA H M S ST S UT1 msADV <OTM><br> + 47999 90-04-18 21:39:15 50 0 +.1 045.0 UTC(NIST) *<br> + 47999 90-04-18 21:39:16 50 0 +.1 045.0 UTC(NIST) #<br> + ...</tt></p> + <p><tt>MJD</tt>, <tt>YR</tt>, <tt>ST</tt>, <tt>UT1</tt> and <tt>UTC(NIST)</tt> are not used by this driver. The <tt><OTM></tt> on-time character "<tt>*</tt>" changes to "<tt>#</tt>" when the delay correction is valid.</p> + <p><a href="http://tycho.usno.navy.mil">US Naval Observatory (USNO)</a></p> + <p>Phone: (202) 762-1594 (Washington, DC); (719) 567-6742 (Boulder, CO)</p> + <p><a href="http://tycho.usno.navy.mil/modem_time.html">Data Format</a> (two lines, repeating at one-second intervals)</p> + <p><tt>jjjjj nnn hhmmss UTC</tt></p> + <p>* on-time character for previous timecode message<br> + jjjjj modified Julian day number (not used)<br> + nnn day of year<br> + hhmmss second of day</p> + <p><a href="tf582_4.html">European Phone Numbers and Formats</a></p> + <p><a href="http://www.spectracomcorp.com">Spectracom GPS and WWVB Receivers</a></p> + <p>If a modem is connected to a Spectracom receiver, this driver will call it and retrieve the time in one of two formats, 0 and 2. Ordinarily, the receiver requires a <tt>T</tt> in order to return the timecode. As this driver does not send data via the modem, it must either be configured in continuous mode or be polled by another local driver.</p> + <h4>Monitor Data</h4> + <p>The received timecode is written as-is to the <tt>clockstats</tt> file along with the Hayes connection and hangup commands and result codes.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Set by the driver to (one of) <tt>NIST</tt>, <tt>USNO</tt>, <tt>PTB</tt> or <tt>WWVB</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Initiate a call if 1. Automatically reset by program. + <dt><tt>flag2 0 | 1</tt> + <dd>Enables port locking if 1, disables if 0 (default). + <dt><tt>flag3 0 | 1</tt> + <dd>Enables direct connection if 1, or modem if 0 (default). If set, the driver will send a single character 'T' at every poll event. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a> </p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver19.html b/contrib/ntp/html/drivers/driver19.html new file mode 100644 index 0000000..961ca09 --- /dev/null +++ b/contrib/ntp/html/drivers/driver19.html @@ -0,0 +1,59 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Heath WWV/WWVH Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Heath WWV/WWVH Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.19.<i>u</i><br> + Reference ID: <tt>WWV</tt><br> + Driver ID: <tt>WWV_HEATH</tt><br> + Serial Port: <tt>/dev/heath<i>u</i></tt>; 1200 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt><br> + Requires: <tt>/usr/include/sys/termios.h</tt> header file with modem control</p> + <h4>Description</h4> + <p>This driver supports the Heath GC-1000 Most Accurate Clock, with RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less robust than other supported receivers. Its claimed accuracy is 100 ms when actually synchronized to the broadcast signal, but this doesn't happen even most of the time, due to propagation conditions, ambient noise sources, etc. When not synchronized, the accuracy is at the whim of the internal clock oscillator, which can wander into the sunset without warning. Since the indicated precision is 100 ms, expect a host synchronized only to this thing to wander to and fro, occasionally being rudely stepped when the offset exceeds the default CLOCK_MAX of 128 ms.</p> + <p>The internal DIPswitches should be set to operate at 1200 baud in MANUAL mode and the current year. The external DIPswitches should be set to GMT and 24-hour format. It is very important that the year be set correctly in the DIPswitches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year.</p> + <p>In MANUAL mode the clock responds to a rising edge of the request to send (RTS) modem control line by sending the timecode. Therefore, it is necessary that the operating system implement the <tt>TIOCMBIC</tt> and <tt>TIOCMBIS</tt> ioctl system calls and <tt>TIOCM_RTS</tt> control bit. Present restrictions require the use of a POSIX-compatible programming interface, although other interfaces may work as well.</p> + <p>The clock message consists of 23 ASCII printing characters in the following format:</p> + <pre>hh:mm:ss.f dd/mm/yr<cr> + +hh:mm:ss.f = hours, minutes, seconds +f = deciseconds ('?' when out of spec) +dd/mm/yr = day, month, year</pre> + <p>The alarm condition is indicated by '?', rather than a digit, at A. Note that 0?:??:??.? is displayed before synchronization is first established and hh:mm:ss.? once synchronization is established and then lost again for about a day.</p> + <p>A fudge time1 value of .07 s appears to center the clock offset residuals.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWV</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver + </dl> + Additional Information + <p><a href="../refclock.html">Reference Clock Drivers</a> </p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver2.html b/contrib/ntp/html/drivers/driver2.html new file mode 100644 index 0000000..20bad64 --- /dev/null +++ b/contrib/ntp/html/drivers/driver2.html @@ -0,0 +1,67 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Trak 8820 GPS Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Trak 8820 GPS Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.2.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_TRAK</tt><br> + Serial Port: <tt>/dev/trak<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt></p> + <h4>Description</h4> + <p>This driver supports the Trak 8820 GPS Station Clock. The claimed accuracy at the 1-PPS output is 200-300 ns relative to the broadcast signal; however, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.</p> + <p>For best accuracy, this radio requires the <tt>tty_clk</tt> line discipline, which captures a timestamp at the <tt>*</tt> on-time character of the timecode. Using this discipline the jitter is in the order of 1 ms and systematic error about 0.5 ms. If unavailable, the buffer timestamp is used, which is captured at the <tt>\r</tt> ending the timecode message. This introduces a systematic error of 23 character times, or about 24 ms at 9600 bps, together with a jitter well over 8 ms on Sun IPC-class machines.</p> + <p>Using the menus, the radio should be set for 9600 bps, one stop bit and no parity. It should be set to operate in computer (no echo) mode. The timecode format includes neither the year nor leap-second warning.</p> + <p>In operation, this driver sends a <tt>RQTS\r</tt> request to the radio at initialization in order to put it in continuous time output mode. The radio then sends the following message once each second:</p> + <pre>*RQTS U,ddd:hh:mm:ss.0,q<cr><lf> +on-time = '*' +ddd = day of year +hh:mm:ss = hours, minutes, seconds +q = quality indicator (phase error), 0-6: + 0 > 20 us + 6 > 10 us + 5 > 1 us + 4 > 100 ns + 3 > 10 ns + 2 < 10 ns</pre> + The alarm condition is indicated by <tt>0</tt> at <tt>Q</tt>, which means the radio has a phase error greater than 20 us relative to the broadcast time. The absence of year, DST and leap-second warning in this format is also alarmed. + <p>The continuous time mode is disabled using the <tt>RQTX\r</tt> request, following which the radio sends a <tt>RQTX DONE<cr><lf></tt> response. In the normal mode, other control and status requests are effective, including the leap-second status request <tt>RQLS<cr></tt>. The radio responds with <tt>RQLS yy,mm,dd<cr><lf></tt>, where <tt>yy,mm,dd</tt> are the year, month and day. Presumably, this gives the epoch of the next leap second, <tt>RQLS 00,00,00</tt> if none is specified in the GPS message. Specified in this form, the information is generally useless and is ignored by the driver.</p> + <h4>Monitor Data</h4> + <p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p> + <h4>Fudge Factors</h4> + <p></p> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + <p>Additional Information</p> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver20.html b/contrib/ntp/html/drivers/driver20.html new file mode 100644 index 0000000..17be32c --- /dev/null +++ b/contrib/ntp/html/drivers/driver20.html @@ -0,0 +1,91 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22 i586) [Netscape]"> + <title>Generic NMEA GPS Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Generic NMEA GPS Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.20.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_NMEA</tt><br> + Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 baud, 8-bits, no parity<br> + Serial Port: <tt>/dev/gps<i>u</i></tt>; symlink to server:port (for nmead) Features: <tt>tty_clk</tt></p> + <h4>Description</h4> + <p>This driver supports GPS receivers with the <tt>$GPRMC</tt> NMEA output string by default. Alternately the <tt>$GPGGA</tt> or <tt>$GPGLL </tt>may be selected.</p> + <p>The driver expects the receiver to be set up to transmit a <tt>$GPRMC</tt> message every second.</p> + <p>The accuracy depend on the receiver used. Inexpesive GPS models are available with a claimed PPS signal accuracy of 1 <font face="Symbol">m</font>s or better relative to the broadcast signal. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.</p> + <p>If the Operating System supports the PPSAPI, RFC-2783, it will be used.<br> </p> + <p>The various GPS sentences that this driver recognises look like this:<br> + (others quietly ignored)</p> + <pre><tt>$GPRMC,POS_UTC,POS_STAT,LAT,LAT_REF,LON,LON_REF,SPD,HDG,DATE,MAG_VAR,MAG_REF*CC<cr><lf> +$GPGLL,LAT,LAT_REF,LONG,LONG_REF,POS_UTC,POS_STAT*CC<cr><lf> +$GPGGA,POS_UTC,LAT,LAT_REF,LONG,LONG_REF,FIX_MODE,SAT_USED,HDOP,ALT,ALT_UNIT,GEO,G_UNIT,D_AGE,D_REF*CC<cr><lf> + + POS_UTC - UTC of position. Hours, minutes and seconds [fraction (opt.)]. (hhmmss[.fff]) + POS_STAT - Position status. (A = Data valid, V = Data invalid) + LAT - Latitude (llll.ll) + LAT_REF - Latitude direction. (N = North, S = South) + LON - Longitude (yyyyy.yy) + LON_REF - Longitude direction (E = East, W = West) + SPD - Speed over ground. (knots) (x.x) + HDG - Heading/track made good (degrees True) (x.x) + DATE - Date (ddmmyy) + MAG_VAR - Magnetic variation (degrees) (x.x) + MAG_REF - Magnetic variation (E = East, W = West) + FIX_MODE - Position Fix Mode ( 0 = Invalid, >0 = Valid) + SAT_USED - Number Satellites used in solution + HDOP - Horizontal Dilution of Precision + ALT - Antenna Altitude + ALT_UNIT - Altitude Units (Metres/Feet) + GEO - Geoid/Elipsoid separation + G_UNIT - Geoid units (M/F) + D_AGE - Age of last DGPS Fix + D_REF - Reference ID of DGPS station + CC - Checksum (optional) + <cr><lf> - Sentence terminator.</tt></pre> + Alternate GPS sentences (other than <tt>$GPRMC</tt> - the default) may be enabled by setting the relevent bits of 'mode' in the server configuration line<br> * server 127.127.20.x mode X<br> bit 0 - enables RMC ( value = 1)<br> bit 1 - enables GGA ( value = 2)<br> bit 2 - enables GLL ( value = 4)<br> + multiple sentences may be selected<br> + <p>The driver will send a <tt>$PMOTG,RMC,0000*1D<cr><lf></tt> message each time a <tt>$GPRMC</tt> string is needed. This is not needed on most GPS receivers because they automatically send the <tt>$GPRMC</tt> string every second and will only work on GPS receivers that understand the <tt>$PMOTG</tt> string. Others will just ignore it.</p> + <h4>Setting up the Garmin GPS-25XL</h4> + Switch off all output with by sending it the following string. + <pre>"$PGRMO,,2<cr><lf>"</pre> + <p>Now switch only $GPRMC on by sending it the following string.</p> + <pre>"$PGRMO,GPRMC,1<cr><lf>"</pre> + <p>On some systems the PPS signal isn't switched on by default. It can be switched on by sending the following string.</p> + <pre>"$PGRMC,,,,,,,,,,,,2<cr><lf>"</pre> + <h4>Monitor Data</h4> + <p>The GPS sentence(s) that is used is written to the clockstats file.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Specifies the PPS signal on-time edge: 0 for assert (default), 1 for clear. + <dt><tt>flag3 0 | 1</tt> + <dd>Controls the kernel PPS discipline: 0 for disable (default), 1 for enable. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <p>Additional Information</p> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver22.html b/contrib/ntp/html/drivers/driver22.html new file mode 100644 index 0000000..e1ed132 --- /dev/null +++ b/contrib/ntp/html/drivers/driver22.html @@ -0,0 +1,60 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>PPS Clock Discipline</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>PPS Clock Discipline</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.22.<i>u</i><br> + Reference ID: <tt>PPS</tt><br> + Driver ID: <tt>PPS</tt><br> + Serial or Parallel Port: <tt>/dev/pps<i>u</i></tt><br> + Requires: PPSAPI interface</p> + <p>Note: This driver supersedes an older one of the same name. The older driver operated with several somewhat archaic signal interface devices, required intricate configuration and was poorly documented. This driver operates only with the PPSAPI interface proposed as an IETF standard. Note also that the <tt>pps</tt> configuration command has been obsoleted by this driver.</p> + <h4>Description</h4> + <p>This driver furnishes an interface for the pulse-per-second (PPS) signal produced by a cesium clock, radio clock or related devices. It can be used to augment the serial timecode generated by a GPS receiver, for example. It can be used to remove accumulated jitter and re-time a secondary server when synchronized to a primary server over a congested, wide-area network and before redistributing the time to local clients. The driver includes extensive signal sanity checks and grooming algorithms. A range gate and frequency discriminator reject noise and signals with incorrect frequency. A multiple-stage median filter rejects jitter due to hardware interrupt and operating system latencies. A trimmed-mean algorithm determines the best time samples. With typical workstations and processing loads, the incidental jitter can be reduced to a few microseconds.</p> + <p>While this driver can discipline the time and frequency relative to the PPS source, it cannot number the seconds. For this purpose an auxiliary source is required, ordinarily a radio clock operated as a primary reference (stratum 1) source; however, another NTP time server can be used as well. For this purpose, the auxiliary source should be specified as the prefer peer, as described in the <a href="../prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page.</p> + <p>The driver requires the PPSAPI interface<sup>1</sup>, which is a proposed IETF standard. The interface consists of the <tt>timepps.h</tt> header file and associated kernel support. Support for this interface is included in current versions of Solaris, FreeBSD and Linux and proprietary versions of Tru64 (Alpha) and SunOS. See the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page for further information.</p> + <p>The PPS source can be connected via a serial or parallel port, depending on the hardware and operating system. A serial port can be dedicated to the PPS source or shared with another device; however, if dedicated the data leads should not be connected, as noise or unexpected signals can cause <tt>ntpd</tt> to exit.</p> + <p>A radio clock is usually connected via a serial port and the PPS source connected via a level converter to the data carrier detect (DCD) pin (DB-9 pin 1, DB-25 pin 8) of the same connector. In some systems where a parallel port and driver are available, the PPS signal can be connected directly to the ACK pin (pin 10) of the connector. Whether the PPS signal is connected via a dedicated port or shared with another device, the driver opens the device <tt>/dev/pps%d</tt>, where <tt>%d</tt> is the unit number. As with other drivers, links can be used to redirect the logical name to the actual physical device.</p> + <p>The driver normally operates like any other driver and uses the same mitigation algorithms and PLL/FLL clock discipline incorporated in the daemon. If kernel PLL/FLL support is available, the kernel PLL/FLL clock discipline can be used instead. The default behavior is not to use the kernel PPS clock discipline, even if present. This driver incorporates a good deal of signal processing to reduce jitter using the median filter and trimmed average algorithms in the driver interface. As the result, performance with minpoll and maxpoll configured at the minimum 4 (16s) is generally better than the kernel PPS discipline. However, fudge flag 3 can be used to enable the kernel PPS discipline if necessary.</p> + <p>Note that the PPS source is considered valid only if the auxiliary source is the prefer peer, is reachable and is selectable to discipline the system clock. By default the stratum assigned to the PPS source is automatically determined. If the auxiliary source is unreachable or inoperative, the stratum is set to 16. Otherwise it is set to the stratum specified by the <tt>fudge stratum</tt> command, if present, or the auxiliary source stratum if not present. Please note the temptation to masquerade as a primary server by forcing the stratum to zero is decidedly dangerous, as it invites timing loops.</p> + <p>The <tt>mode</tt> keyword of the <tt>server</tt> command can be used to set the PPSAPI mode bits which determine the capture edge and echo options. See the <tt>/usr/include/sys/timepps.h</tt> header file for the bit definitions, which must be converted to their decimal equivalents. This overrides the fudge <tt>flag2</tt> option.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>PPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Specifies the PPS signal on-time edge: 0 for assert (default), 1 for clear. + <dt><tt>flag3 0 | 1</tt> + <dd>Controls the kernel PPS discipline: 0 for disable (default), 1 for enable. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <p>Reference</p> + <ol> + <li>Mogul, J., D. Mills, J. Brittenson, J. Stone and U. Windl. Pulse-per-second API for Unix-like operating systems, version 1. Request for Comments RFC-2783, Internet Engineering Task Force, March 2000, 31 pp. + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver26.html b/contrib/ntp/html/drivers/driver26.html new file mode 100644 index 0000000..f840a03 --- /dev/null +++ b/contrib/ntp/html/drivers/driver26.html @@ -0,0 +1,53 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Hewlett Packard 58503A GPS Receiver and HP Z3801A</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Hewlett Packard 58503A GPS Receiver and HP Z3801A</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.26.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_HP</tt><br> + Serial Port: <tt>/dev/hpgps<i>u</i></tt>; 9600 baud, 8-bits, no parity, 19200 baud 7-bits, odd parity for the HP Z3801A</p> + <h4>Description</h4> + <p>This driver supports the HP 58503A Time and Frequency Reference Receiver and HP Z3801A GPS Receiver. They use HP SmartClock (TM) to implement an Enhanced GPS receiver. The receiver accuracy when locked to GPS in normal operation is better than 1 usec. The accuracy when operating in holdover is typically better than 10 us per day. It receiver should be operated with factory default settings. Initial driver operation: expects the receiver to be already locked to GPS, configured and able to output timecode format 2 messages.</p> + <p>The driver uses the poll sequence <tt>:PTIME:TCODE?</tt> to get a response from the receiver. The receiver responds with a timecode string of ASCII printing characters, followed by a <cr><lf>, followed by a prompt string issued by the receiver, in the following format:</p> + <pre>T#yyyymmddhhmmssMFLRVcc<cr><lf>scpi ></pre> + The driver processes the response at the <cr> and <lf>, so what the driver sees is the prompt from the previous poll, followed by this timecode. The prompt from the current poll is (usually) left unread until the next poll. So (except on the very first poll) the driver sees this: + <pre>scpi >T#yyyymmddhhmmssMFLRVcc<cr><lf></pre> + <p>The T is the on-time character, at 980 msec. before the next 1PPS edge. The # is the timecode format type. We look for format 2. Without any of the CLK or PPS stuff, then, the receiver buffer timestamp at the <cr> is 24 characters later, which is about 25 msec. at 9600 bps, so the first approximation for fudge time1 is nominally -0.955 seconds. This number probably needs adjusting for each machine / OS type, so far: -0.955000 on an HP 9000 Model 712/80 HP-UX 9.05 -0.953175 on an HP 9000 Model 370 HP-UX 9.10</p> +This driver will probably work with the 58503B and 59551A if they are setup appropriately.<P> +To use an HP Z3801A, specify <tt>mode 1</tt> on the server config line to setup the right line paramters.<P> +The timekeeping portion of HP's business has been sold to <a href="http://www.symmetricom.com/">Symmetricom</a>.<P> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/drivers/driver27.html b/contrib/ntp/html/drivers/driver27.html new file mode 100644 index 0000000..8c2633c --- /dev/null +++ b/contrib/ntp/html/drivers/driver27.html @@ -0,0 +1,247 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Arcron MSF Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Arcron MSF Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.27.<i>u</i><br> + Reference ID: <tt>MSFa</tt> / <tt>MSF</tt> / <tt>DCF</tt> / <tt>WWVB</tt><br> + Driver ID: <tt>MSF_ARCRON</tt><br> + Serial Port: <tt>/dev/arc<i>u</i></tt>; 300 baud, 8-bits, 2-stop, no parity<br> + Features: <tt>tty_clk</tt></p> + <h4>Description</h4> + <p>This driver supports the Arcron MSF, DCF and WWVB receivers. The clock reports its ID as "<tt>MSFa</tt>'', "<tt>MSF</tt>'', "<tt>DCF</tt>'' or "<tt>WWVB</tt>'' to indicate the time source.</p> + <p>This documentation describes v1.3 (2003/2/21) of the source and has been tested against ntpd 4.1.0 on linux x86. Changes from v1.1 and v1.2 include patches to work with the new ntp-4 code, clock support for DCF and WWVB configurable via mode flag, an option to ignore resync request (for those of us at the fringes of the WWVB signal, for instance), averaging of the signal quality poll and several bug fixes, code cleanup and standardizations. In all other respects, the driver works as per v1.1 if a mode is not specified.</p> + <p>To use the alternate modes, the mode flag must be specified. If the mode flag is 0, or unspecified, the original MSF version is assumed. This should assure backwards compatibility and should not break existing setups.</p> + <p>The previous documentation described version V1.1 (1997/06/23) of the source and had been tested (amongst others) against ntpd3-5.90 on Solaris-1 (SunOS 4.1.3_U1 on an SS1 serving as a router and firewall) and against ntpd3-5.90 on Solaris-2.5 (on a SS1+ and TurboSPARC 170MHz). That code will claimed increased stability, reduced jitter and more efficiency (fewer context switches) with the <tt>tty_clk</tt> discipline/STREAMS module installed, but this has not been tested. For a to-do list see the comments at the start of the code.</p> + <p>This code has been significantly slimmed down since the V1.0 version, roughly halving the memory footprint of its code and data.</p> + <p>This driver is designed to allow the unit to run from batteries as designed, for something approaching the 2.5 years expected in the usual stand-alone mode, but no battery-life measurements have been taken.</p> + <p>Much of this code is originally from the other refclock driver files with thanks. The code was originally made to work with the clock by <a href="mailto:derek@toybox.demon.co.uk">Derek Mulcahy</a>, with modifications by <a href="mailto:d@hd.org">Damon Hart-Davis</a>. Thanks also to <a href="mailto:lyndond@sentinet.co.uk">Lyndon David</a> for some of the specifications of the clock. <a href="mailto:palfille@partners.org">Paul Alfille</a> added support for the WWVB clock. <a href="mailto:cprice@cs-home.com">Christopher Price</a> added enhanced support for the MSF, DCF and WWVB clocks.</p> + <p>There is support for a Tcl/Tk monitor written by Derek Mulcahy that examines the output stats; see the <a href="http://www2.exnet.com/NTP/ARC/ARC.html">ARC Rugby MSF Receiver</a> page for more details and the code. Information on the WWVB version is available from <a href="http://www.arctime.com">Atomic Time</a> as their <a href="http://www.atomictime.com/Product17.html">Atomic Time PC</a>.</p> + <p>Look at the notes at the start of the code for further information; some of the more important details follow.</p> + <p>The driver interrogates the clock at each poll (ie every 64s by default) for a timestamp. The clock responds at the start of the next second (with the start bit of the first byte being on-time). In the default or original MSF mode, the time is in `local' format, including the daylight savings adjustment when it is in effect. The driver code converts the time back to UTC. In modes 1-3 the driver can be configured for UTC or local time depending on the setting of flag1.</p> + <p>The clock claims to be accurate to within about 20ms of the broadcast time, and given the low data transmission speed from clock to host, and the fact that the clock is not in continuous sync with MSF, it seems sensible to set the `precision' of this clock to -5 or -4, -4 being used in this code, which builds in a reported dispersion of over 63ms (ie says ``This clock is not very good.''). You can improve the reported precision to -4 (and thus reduce the base dispersion to about 31ms) by setting the fudge <tt>flag3</tt> to <tt>1</tt>.</p> + <p>Even a busy and slow IP link can yield lower dispersions than this from polls of primary time servers on the Internet, which reinforces the idea that this clock should be used as a backup in case of problems with such an IP link, or in the unfortunate event of failure of more accurate sources such as GPS.</p> + <p>By default this clock reports itself to be at stratum 2 rather than the usual stratum 0 for a refclock, because it is not really suited to be used as other than a backup source. The stratum reported can be changed with the <tt>stratum</tt> directive to be whatever you like. After careful monitoring of your clock, and appropriate choice of the <tt>time1</tt> fudge factor to remove systematic errors in the clock's reported time, you might fudge the clock to stratum 1 to allow a stratum-2 secondary server to sync to it.</p> + <p>In default mode, the driver code arranges to resync the clock to MSF at intervals of a little less than an hour (deliberately avoiding the same time each hour to avoid any systematic problems with the signal or host). Whilst resyncing, the driver supplements the normal polls for time from the clock with polls for the reception signal quality reported by the clock. If the signal quality is too low (0--2 out of a range of 0--5), we chose not to trust the clock until the next resync (which we bring forward by about half an hour). If we don't catch the resync, and so don't know the signal quality, we do trust the clock (because this would generally be when the signal is very good and a resync happens quickly), but we still bring the next resync forward and reduce the reported precision (and thus increase reported dispersion).</p> + <p>If we force resyncs to MSF too often we will needlessly exhaust the batteries the unit runs from. During clock resync this driver tries to take enough time samples to avoid <tt>ntpd</tt> losing sync in case this clock is the current peer. By default the clock would only resync to MSF about once per day, which would almost certainly not be acceptable for NTP purposes.</p> + <p>The driver does not force an immediate resync of the clock to MSF when it starts up to avoid excessive battery drain in case <tt>ntpd</tt> is going to be repeatedly restarted for any reason, and also to allow enough samples of the clock to be taken for <tt>ntpd</tt> to sync immediately to this clock (and not remain unsynchronised or to sync briefly to another configured peer, only to hop back in a few poll times, causing unnecessary disturbance). This behaviour should not cause problems because the driver will not accept the timestamps from the clock if the status flag delivered with the time code indicates that the last resync attempt was unsuccessful, so the initial timestamps will be close to reality, even if with up to a day's clock drift in the worst case (the clock by default resyncs to MSF once per day).</p> + <p>When alternate modes 1-3 are selected, the driver can be configured to ignore the resync requests by setting <tt>flag2</tt> to 1. This allows clocks at the fringe of the signal to resync at night when signals are stronger.</p> + <p>The clock has a peculiar RS232 arrangement where the transmit lines are powered from the receive lines, presumably to minimise battery drain. This arrangement has two consequences:</p> + <ul> + <li>Your RS232 interface must drive both +ve and -ve + <li>You must (in theory) wait for an echo and a further 10ms between characters + </ul> + <p>This driver, running on standard Sun and x86 hardware, seems to work fine; note the use of the <tt>send_slow()</tt> routine to queue up command characters to be sent once every two seconds.</p> + <p>Three commands are sent to the clock by this driver. Each command consists of a single letter (of which only the bottom four bits are significant), followed by a CR (ASCII 13). Each character sent to the clock should be followed by a delay to allow the unit to echo the character, and then by a further 10ms. Following the echo of the command string, there may be a response (ie in the case of the <tt>g</tt> and <tt>o</tt> commands below), which in the case of the <tt>o</tt> command may be delayed by up to 1 second so as the start bit of the first byte of the response can arrive on time. The commands and their responses are:</p> + <dl> + <dt><tt>g</tt> CR + <dd>Request for signal quality. Answer only valid during (late part of) resync to MSF signal. The response consists of two characters as follows: + <ol> + <dl compact> + <dt>bit 7 + <dd>parity + <dt>bit 6 + <dd>always 0 + <dt>bit 5 + <dd>always 1 + <dt>bit 4 + <dd>always 1 + <dt>bit 3 + <dd>always 0 + <dt>bit 2 + <dd>always 0 + <dt>bit 1 + <dd>always 1 + <dt>bit 0 + <dd>= 0 if no reception attempt at the moment, = 1 if reception attempt (ie resync) in progress + </dl> + <dl compact> + <dt>bit 7 + <dd>parity + <dt>bit 6 + <dd>always 0 + <dt>bit 5 + <dd>always 1 + <dt>bit 4 + <dd>always 1 + <dt>bit 3 + <dd>always 0 + <dt>bit 2--0 + <dd>reception signal quality in the range 0--5 (very poor to very good); if in the range 0--2 no successful reception is to be expected. The reported value drops to zero when not resyncing, ie when first returned byte is not `3'. + </dl> + </ol> + <dt><tt>h</tt> CR + <dd>Request to resync to signal. Can take up from about 30s to 360s. Drains batteries so should not be used excessively. After this the clock time and date should be correct and the phase within 20ms of time as transmitted from the source signal (remember to allow for propagation time). By default the clock resyncs once per day in the late evening/early morning (presumably to catch transitions to/from daylight saving time quickly). This driver code, by default, resyncs at least once per hour to minimise clock wander. + <dt><tt>o</tt> CR + <dd>Request timestamp. Start bit of first byte of response is on-time, so may be delayed up to 1 second. Note that the driver will convert time to GMT, if required. The response data is as follows: + <ol> + <li>hours tens (hours range from 00 to 23) + <li>hours units + <li>minutes tens (minutes range from 00 to 59) + <li>minutes units + <li>seconds tens (seconds presumed to range from 00 to 60 to allow for leap second) + <li>seconds units + <li>day of week 1 (Monday) to 7 (Sunday) + <li>day of month tens (day ranges from 01 to 31) + <li>day of month units + <li>month tens (months range from 01 to 12) + <li>month units + <li>year tens (years range from 00 to 99) + <li>year units + <li>BST/UTC status (Ignored in WWVB version) + <dl compact> + <dt>bit 7 + <dd>parity + <dt>bit 6 + <dd>always 0 + <dt>bit 5 + <dd>always 1 + <dt>bit 4 + <dd>always 1 + <dt>bit 3 + <dd>(MSF) always 0<br> + (WWVB) Leap year indicator bit<br> + 0 = non-leap year<br> + 1 = leap year + <dt>bit 2 + <dd>= (MSF) 1 if UTC is in effect (reverse of bit 1)<br> + (WWVB) Leap second warning bit + <dt>bit 1 + <dd>= (MSF)1 if BST is in effect (reverse of bit 2)<br> + = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 1 if transition from ST with bit 0 is set to 0 + <dt>bit 0 + <dd>= (MSF)1 if BST/UTC change pending<br> + = (WWVB) 0 if ST is in effect, 1 if DST is in effect, 0 if transition from DST with bit 1 is set to 0 + </dl> + <li>clock status + <dl compact> + <dt>bit 7 + <dd>parity + <dt>bit 6 + <dd>always 0 + <dt>bit 5 + <dd>always 1 + <dt>bit 4 + <dd>always 1 + <dt>bit 3 + <dd>= 1 if low battery is detected + <dt>bit 2 + <dd>= 1 if last resync failed (though officially undefined for the MSF clock, officially defined for WWVB) + <dt>bit 1 + <dd>= 1 if at least one reception attempt was successful<br> + (MSF) since 0230<br> + (DCF) since 0300<br> + (WWVB) resets if not successful between 0300-0400 + <dt>bit 0 + <dd>= 1 if the clock has valid time---reset to zero when clock is reset (eg at power-up), and set to 1 after first successful resync attempt. + </dl> + </ol> + <p>The driver only accepts time from the clock if the bottom three bits of the status byte are <tt>011</tt> or <tt>flag2</tt> is set to 1 to ignore resync requests. For the MSF clock, if the UK parliament decides to move us to +0100/+0200 time as opposed to the current +0000/+0100 time, it is not clear what effect that will have on the time broadcast by MSF, and therefore on this driver's usefulness.</p> + </dl> + <p>A typical <tt>ntp.conf</tt> configuration file for this driver might be:</p> + <pre># hostname(n) means we expect (n) to be the stratum at which hostname runs. + +#------------------------------------------------------------------------------ +# SYNCHRONISATION PARTNERS +# ======================== + +# Default configuration (Original MSF mode)s... +server 127.127.27.0 mode 333 # ARCRON MSF radio clock +# Fudge stratum and other features as required. +# ADJUST time1 VALUE FOR YOUR HOST, CLOCK AND LOCATION! +fudge 127.127.27.0 stratum 1 time1 0.016 flag3 1 +# WWVB users should change that line to: +server 127.127.27.0 mode 3 # ARCRON WWVB radio clock +fudge 127.127.27.0 stratum 1 time1 0.030 flag1 1 flag3 1 + +peer 11.22.33.9 # tick(1--2). +peer 11.22.33.4 # tock(3), boot/NFS server. + +# This shouldn't get swept away unless left untouched for a long time. +driftfile /var/tmp/ntp.drift + +#------------------------------------------------------------------------------ +# RESTRICTIONS +# ============ + +# By default, don't trust and don't allow modifications. Ignore in fact. +restrict default ignore notrust nomodify + +# Allow others in our subnet to check us out... +restrict 11.22.33.0 mask 255.255.255.0 nomodify notrust + +# Trust our peers for time. Don't trust others in case they are insane. +restrict 127.127.27.0 nomodify +restrict 11.22.33.4 nomodify +restrict 11.22.33.9 nomodify + +# Allow anything from the local host. +restrict 127.0.0.1</pre> + There are a few <tt>#define</tt>s in the code that you might wish to play with: + <dl> + <dt><tt>ARCRON_KEEN</tt> + <dd>With this defined, the code is relatively trusting of the clock, and assumes that you will have the clock as one of a few time sources, so will bend over backwards to use the time from the clock when available and avoid <tt>ntpd</tt> dropping sync from the clock where possible. You may wish to undefine this, especially if you have better sources of time or your reception is ropey. However, there are many checks built in even with this flag defined. + <dt><tt>ARCRON_MULTIPLE_SAMPLES</tt> + <dd>When is defined, we regard each character in the returned timecode as at a known delay from the start of the second, and use the smallest (most negative) offset implied by any such character, ie with the smallest kernel-induced display, and use that. This helps to reduce jitter and spikes. + <dt><tt>ARCRON_LEAPSECOND_KEEN</tt> + <dd>When is defined, we try to do a resync to MSF as soon as possible in the first hour of the morning of the first day of the first and seventh months, ie just after a leap-second insertion or deletion would happen if it is going to. This should help compensate for the fact that this clock does not continuously sample MSF, which compounds the fact that MSF itself gives no warning of an impending leap-second event. This code did not seem functional at the leap-second insertion of 30th June 1997 so is by default disabled. + <dt><tt>PRECISION</tt> + <dd>Currently set to <tt>-4</tt>, but you may wish to set it to <tt>-5</tt> if you are more conservative, or to <tt>-6</tt> if you have particularly good experience with the clock and you live on the edge. Note that the <tt>flag3</tt> fudge value will improve the reported dispersion one notch if clock signal quality is known good. So maybe just leave this alone. + </dl> + <h4>Monitor Data</h4> + <p>Each timecode is written to the <tt>clockstats</tt> file with a signal quality value appended (`0'--`5' as reported by the clock, or `6' for unknown).</p> + <p>Each resync and result (plus gaining or losing MSF sync) is logged to the system log at level <tt>LOG_NOTICE</tt>; note that each resync drains the unit's batteries, so the syslog entry seems justified.</p> + <p>Syslog entries are of the form:</p> + <pre>May 10 10:15:24 oolong ntpd[615]: ARCRON: unit 0: sending resync command +May 10 10:17:32 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock +May 10 11:13:01 oolong ntpd[615]: ARCRON: unit 0: sending resync command +May 10 11:14:06 oolong ntpd[615]: ARCRON: sync finished, signal quality -1: UNKNOWN, will use clock anyway +May 10 11:41:49 oolong ntpd[615]: ARCRON: unit 0: sending resync command +May 10 11:43:57 oolong ntpd[615]: ARCRON: sync finished, signal quality 5: OK, will use clock +May 10 12:39:26 oolong ntpd[615]: ARCRON: unit 0: sending resync command +May 10 12:41:34 oolong ntpd[615]: ARCRON: sync finished, signal quality 3: OK, will use clock</pre> + <h4>Fudge Factors</h4> + <p></p> + <dl> + <dt><tt>mode 0 | 1 | 2 | 3</tt> + <dd>Specifies the clock hardware model. This parameter is optional, it defaults to the original mode of operation. + <dd>Supported modes of operation: + <dd>0 - Default, Original MSF + <dd>1 - Updated MSF + <dd>2 - New DCF77 + <dd>3 - New WWVB + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. On a Sun SparcStation 1 running SunOS 4.1.3_U1, with the receiver in London, a value of 0.020 (20ms) seems to be appropriate. + <dt><tt>time2 <i>time</i></tt> + <dd>Not currently used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 2. It is suggested that the clock be not be fudged higher than stratum 1 so that it is used a backup time source rather than a primary when more accurate sources are available. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>MSFa</tt>. When used in modes 1-3, the driver will report either <tt>MSF</tt>, <tt>DCF</tt>, or <tt>WWVB</tt> respectively. + <dt><tt>flag1 0 | 1</tt> + <dd>(Modes 1-3) If set to 0 (the default), the clock is set to UTC time. If set to 1, the clock is set to localtime. + <dt><tt>flag2 0 | 1</tt> + <dd>(Modes 1-3) If set to 0 (the default), the clock will be forced to resync approximately every hour. If set to 1, the clock will resync per normal operations (approximately midnight). + <dt><tt>flag3 0 | 1</tt> + <dd>If set to 1, better precision is reported (and thus lower dispersion) while clock's received signal quality is known to be good. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a><br> + <a href="http://www2.exnet.com/NTP/ARC/ARC.html">ARC Rugby MSF Receiver</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver28.html b/contrib/ntp/html/drivers/driver28.html new file mode 100644 index 0000000..244de1a --- /dev/null +++ b/contrib/ntp/html/drivers/driver28.html @@ -0,0 +1,76 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Shared memoy Driver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Shared Memory Driver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.28.<i>u</i><br> + Reference ID: <tt>SHM</tt><br> + Driver ID: <tt>SHM</tt></p> + <h4>Description</h4> + <p>This driver receives its reference clock info from a shared memory-segment. The shared memory-segment is created with owner-only access for unit 0 and 1, and world access for unit 2 and 3</p> + <h4>Structure of shared memory-segment</h4> + <pre>struct shmTime { + int mode; /* 0 - if valid set + * use values, + * clear valid + * 1 - if valid set + * if count before and after read of + * values is equal, + * use values + * clear valid + */ + int count; + time_t clockTimeStampSec; /* external clock */ + int clockTimeStampUSec; /* external clock */ + time_t receiveTimeStampSec; /* internal clock, when external value was received */ + int receiveTimeStampUSec; /* internal clock, when external value was received */ + int leap; + int precision; + int nsamples; + int valid; + int dummy[10]; +};</pre> + <h4>Operation mode=0</h4> + <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> + <p>If set, the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are passed to ntp, and the valid-flag is cleared.</p> + <p>If not set, a timeout is reported to ntp, nothing else happend</p> + <h4>Operation mode=1</h4> + <p>When the poll-method of the driver is called, the valid-flag of the shared memory-segment is checked:</p> + <p>If set, the count-field of the record is remembered, and the values in the record (clockTimeStampSec, clockTimeStampUSec, receiveTimeStampSec, receiveTimeStampUSec, leap, precision) are read. Then, the remembered count is compared to the count now in the record. If both are equal, the values read from the record are passed to ntp. If they differ, another process has modified the record while it was read out (was not able to produce this case), and failure is reported to ntp. The valid flag is cleared.</p> + <p>If not set, a timeout is reported to ntp, nothing else happend</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>SHM</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver29.html b/contrib/ntp/html/drivers/driver29.html new file mode 100644 index 0000000..479978f --- /dev/null +++ b/contrib/ntp/html/drivers/driver29.html @@ -0,0 +1,776 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>Trimble Palisade Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> + <h1><font size="+2">Trimble Palisade Receiver</font> + <hr> + </h1> + <h2><img src="../pic/driver29.gif" alt="gif" nosave height="100" width="420"></h2> + <h2><font size="+1">Synopsis</font></h2> + <table> + <tr> + <td> + <div align="right"> + <tt>Address: </tt></div> + </td> + <td><b>127.127.29.<i>u</i></b></td> + </tr> + <tr> + <td> + <div align="right"> + <tt>Reference ID:</tt></div> + </td> + <td><a name="REFID"></a><b>GPS</b></td> + </tr> + <tr> + <td> + <div align="right"> + <tt>Driver ID:</tt></div> + </td> + <td><b>GPS_PALISADE</b></td> + </tr> + <tr> + <td> + <div align="right"> + <tt>Serial Port:</tt></div> + </td> + <td><b>/dev/palisade<i>u</i></b></td> + </tr> + <tr> + <td> + <div align="right"> + <tt><font size="+1">Serial I/O:</font></tt></div> + </td> + <td><b>9600 baud, 8-bits, 1-stop, odd parity</b></td> + </tr> + </table> + <h2><font size="+1">Description</font></h2> + The <b>refclock_palisade</b> driver supports <a href="http://www.trimble.com/products/ntp">Trimble Navigation's Palisade Smart Antenna GPS receiver</a>.<br> + Additional software and information about the Palisade GPS is available from: <a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a>.<br> + Latest NTP driver source, executables and documentation is maintained at: <a href="ftp://ftp.trimble.com/pub/ntp">ftp://ftp.trimble.com/pub/ntp</a> + <p>This documentation describes version 7.12 of the GPS Firmware and version 2.46 (July 15, 1999) and later, of the driver source.<br> </p> + <h2><font size="+1">Operating System Compatibility</font></h2> + The Palisade driver has been tested on the following software and hardware platforms:<br> + <center> + <table> + <tr> + <td valign="CENTER" width="23%">Platform</td> + <td valign="CENTER">Operating System</td> + <td>NTP Sources</td> + <td>Accuracy</td> + </tr> + <tr> + <td valign="CENTER" width="23%">i386 (PC) </td> + <td valign="CENTER">Linux</td> + <td>NTP Distribution</td> + <td>10 us</td> + </tr> + <tr> + <td>i386 (PC) </td> + <td>Windows NT</td> + <td><a href="ftp://ftp.trimble.com/pub/ntp">ftp://ftp.trimble.com/pub/ntp</a></td> + <td>1 ms</td> + </tr> + <tr> + <td valign="CENTER" width="23%">SUN</td> + <td valign="CENTER">Solaris 2.x</td> + <td>NTP Distribution</td> + <td>50 us</td> + </tr> + <tr> + <td valign="CENTER" width="23%">Hewlett-Packard</td> + <td valign="CENTER">HPUX 9, 10, 11</td> + <td><a href="http://us-support.external.hp.com">http://us-support.external.hp.com</a></td> + <td>50 us</td> + </tr> + <tr> + <td>Various</td> + <td>Free BSD</td> + <td>NTP Distribution</td> + <td>20 us</td> + </tr> + </table> + </center> + <h2><font size="+1">GPS Receiver</font></h2> + The Palisade GPS receiver is an 8-channel smart antenna, housing the GPS receiver, antenna and interface in a single unit, and is designed for rooftop deployment in static timing applications. + <p>Palisade generates a PPS synchronized to UTC within +/- 100 ns. The Palisade's external event input with 40 nanosecond resolution is utilized by the Palisade NTP driver for asynchronous precision time transfer.</p> + <p>No user initialization of the receiver is required. This driver is compatible with the following versions of Palisade:<br> </p> + <center> + <table> + <tr> + <td valign="CENTER"> + <center> + Version</center> + </td> + <td valign="TOP"> + <center> + Event Input</center> + </td> + <td valign="CENTER"> + <center> + Trimble Part Number</center> + </td> + </tr> + <tr> + <td valign="CENTER"> + <center> + 7.02</center> + </td> + <td valign="TOP"> + <center> + No</center> + </td> + <td valign="CENTER"> + <center> + 26664-00</center> + </td> + </tr> + <tr> + <td align="CENTER" valign="CENTER"> + <center> + 7.02E</center> + </td> + <td valign="TOP"> + <center> + Yes</center> + </td> + <td valign="CENTER"> + <center> + 26664-10</center> + </td> + </tr> + <tr> + <td valign="CENTER"> + <center> + 7.12</center> + </td> + <td valign="TOP"> + <center> + Yes</center> + </td> + <td valign="CENTER"> + <center> + 38158-00</center> + </td> + </tr> + </table> + </center> + <dl> + <dl> + Note: When using Palisade 26664-00, you must set fudge flag2 to 1 in <b>ntp.conf</b>. See <a href="#Configuration">configuration</a>. + </dl> + <dl> + <h3><font size="+1">GPS <a name="Installation"></a>Installation</font></h3> + A location with unobstructed view of the horizon is recommended. Palisade is designed to be securely mounted atop standard 3/4 inch threaded pipe. + <p>The 12 conductor (dia. 10 mm) power and I/O cable must be routed from the rooftop site to the NTP server and properly strain relieved.</p> + <h3><font size="+1">GPS <a name="Connection"></a>Connection</font></h3> + The Palisade is equipped with dual (A & B) RS-422 serial interfaces and a differential TTL PPS output. An RS-232 / RS-422 Interface Module is supplied with the Palisade NTP Synchronization Kit. Palisade <a href="#PortA">port A</a> must be connected to the NTP host server. Maximum antenna cable length is 500 meters. See the <a href="#Pinouts">pinouts</a> table for detailed connection Information. + <p>Palisade's <a href="#PortB">port B</a> provides a TSIP (Trimble Standard Interface Protocol) interface for diagnostics, configuration, and monitoring. Port B and the PPS output are not currently used by the Palisade NTP reference clock driver.<br> </p> + </dl> + </dl> + <h2><font size="+1">O/S Serial Port Configuration</font></h2> + The driver attempts to open the device <b><tt><a href="#REFID">/dev/palisade<i>u</i></a></tt></b> where <b><i>u</i></b> is the NTP refclock unit number as defined by the LSB of the refclock address. Valid refclock unit numbers are 0 - 3. + <p>The user is expected to provide a symbolic link to an available serial port device. This is typically performed by a command such as:</p> + <blockquote> + <tt>ln -s /dev/ttyS0 /dev/palisade0</tt></blockquote> + Windows NT does not support symbolic links to device files. COM<b>x</b>: is used by the driver, based on the refclock unit number, where unit 1 corresponds to COM<b>1</b>: and unit 3 corresponds to COM3:<br> + <h2><a name="Configuration"></a><font size="+1">NTP Configuration</font></h2> + Palisade NTP configuration file <b><tt>"ntp.conf"</tt></b> with event polling:<br> + <tt>#------------------------------------------------------------------------------</tt><br> + <tt># The Primary reference</tt><br> + <tt>server 127.127.29.0 # Trimble Palisade GPS Refclock Unit #0</tt><br> + <tt>peer terrapin.csc.ncsu.edu # internet server</tt><br> + <tt># Drift file for expedient re-synchronization after downtime or reboot.</tt><br> + <tt>driftfile /etc/ntp.drift</tt><br> + <tt>#------------------------------------------------------------------------------</tt> + <p>Configuration without event polling:<br> + <tt>#------------------------------------------------------------------------------</tt><br> + <tt># The Primary reference</tt><br> + <tt>server 127.127.29.0 # Trimble Palisade GPS (Stratum 1).</tt><br> + <tt># Set packet delay</tt><br> + <tt><a href="#time1">fudge 127.127.29.0 time1 0.020</a></tt><br> + <tt># and set flag2 to turn off event polling.</tt><br> + <tt><a href="#flag2">fudge 127.127.29.0 flag2 1</a></tt><br> + <tt>#------------------------------------------------------------------------------</tt><br> </p> + <h2><a name="TimeTransfer"></a><font size="+1">Time Transfer and Polling</font></h2> + Time transfer to the NTP host is performed via the Palisade's comprehensive time packet output. The time packets are output once per second, and whenever an event timestamp is requested. + <p>The driver requests an event time stamp at the end of each polling interval, by pulsing the RTS (request to send) line on the serial port. The Palisade GPS responds with a time stamped event packet.</p> + <p>Time stamps are reported by the Palisade with respect to UTC time. The GPS receiver must download UTC offset information from GPS satellites. After an initial UTC download, the receiver will always start with correct UTC offset information.<br> </p> + <h2><font size="+1">Run NTP in Debugging Mode</font></h2> + The following procedure is recommended for installing and testing a Palisade NTP driver: + <ol> + <li>Perform initial checkout procedures. Place the GPS receiver outdoors; with clear view of the sky. Allow the receiver to obtain an UTC almanac. + <li>Verify presence of timing packets by observing the 1 Hz (PPS) led on the interface module. It should flash once per second. + <li>Connect Palisade's port A to the NTP host. + <li>Configure NTP and the serial I/O port on the host system. + <li>Initially use <tt><a href="#flag2">fudge flag2</a></tt> in <b><a href="#Configuration">ntp.conf</a>,</b> to disable event polling (see configuration). + <li>Run NTP in debug mode (-d -d), to observe Palisade_receive events. + <li>The driver reports the <a href="#TrackingStatus">tracking status of the receiver</a>. Make sure it is tracking several satellites. + <li>Remove fudge flag2 and restart <b>ntpd</b> in debug mode to observe palisade_receive events. + <li>If event polling fails, verify the <a href="#Pinouts">connections</a> and that the host hardware supports RTS control. + </ol> + <h2><font size="+1">Event Logging</font></h2> + System and Event log entries are generated by NTP to report significant system events. Administrators should monitor the system log to observe NTP error messages. Log entries generated by the Palisade NTP reference clock driver will be of the form: + <blockquote> + <pre>Nov 14 16:16:21 terrapin ntpd[1127]: Palisade #0: <i>message</i></pre> + </blockquote> + <h2><font size="+1">Fudge Factors</font></h2> + <dl> + <dt><a name="time1"></a><tt><font size="+1"><a href="#Configuration">time1 <i>time</i></a></font></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. If event capture is not used, time1 should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets. + <dt><tt><font size="+1">stratum <i>number</i></font></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt><font size="+1"><a href="#REFID">refid <i>string</i></a></font></tt> + <dd>Specifies the driver reference identifier, <b>GPS</b>. + <dt><a name="flag2"></a><tt><font size="+1"><a href="#Configuration">flag2 0 | 1</a></font></tt> + <dd>When set to 1, driver does not use hardware event capture. The synchronous packet output by the receiver at the beginning of each second is time stamped by the driver. If triggering the event pulse fails, the driver falls back to this mode automatically. + </dl> + <h2><font size="+1">Mode Parameter</font></h2> + <dl> + <dt><tt><font size="+1">mode <i>number</i></font></tt> + <dd>The mode parameter to the server command specifies the specific hardware this driver is for. The default is 0 for a normal Trimble Palisade. The only other option at this time is 1 for a Endrun Praecis in Trimble emulation mode. + </dl> + <h2><font size="+1">DEFINEs</font></h2> + The following constants are defined in the driver source code. These defines may be modified to improve performance or adapt to new operating systems.<br> + <center> + <table border> + <tr> + <td><b>Label</b></td> + <td>Definition</td> + <td>Default Value</td> + </tr> + <tr> + <td>DEVICE</td> + <td>The serial port device to be used by the driver</td> + <td>/dev/palisade<b><i>u</i></b></td> + </tr> + <tr> + <td>PRECISION</td> + <td>Accuracy of time transfer</td> + <td>1 microsecond</td> + </tr> + <tr> + <td>CURRENT_UTC</td> + <td>Valid GPS - UTC offset</td> + <td>13</td> + </tr> + <tr> + <td>SPEED232</td> + <td>Host RS-232 baud rate</td> + <td>B9600</td> + </tr> + <tr> + <td>TRMB_MINPOLL </td> + <td>Minimum polling interval</td> + <td>5 (32 seconds)</td> + </tr> + <tr> + <td>TRMB_MAXPOLL</td> + <td>Maximum interval between polls</td> + <td>7 (128 seconds)</td> + </tr> + </table> + </center> + <h2><a name="DataFormat"></a><font size="+1">Data Format</font></h2> + Palisade port A can output two synchronous time packets. The NTP driver can use either packet for synchronization. Packets are formatted as follows: + <h3><b><font size="+0">Packet 8F-AD (Primary NTP Packet)</font></b></h3> + <center> + <table> + <tr> + <td>Byte</td> + <td>Item</td> + <td>Type</td> + <td>Meaning</td> + </tr> + <tr> + <td>0</td> + <td>Sub-Packet ID</td> + <td>BYTE</td> + <td>Subcode 0xAD</td> + </tr> + <tr> + <td>1 - 2</td> + <td>Event Count</td> + <td>INTEGER</td> + <td>External event count recorded (0 = PPS)</td> + </tr> + <tr> + <td>3 - 10</td> + <td>Fractional Second</td> + <td>DOUBLE</td> + <td>Time elapsed in current second (s)</td> + </tr> + <tr> + <td>11</td> + <td>Hour</td> + <td>BYTE</td> + <td>Hour (0 - 23)</td> + </tr> + <tr> + <td>12</td> + <td>Minute</td> + <td>BYTE</td> + <td>Minute (0 - 59)</td> + </tr> + <tr> + <td>13</td> + <td>Second</td> + <td>BYTE</td> + <td>Second (0 - 59; 60 = leap)</td> + </tr> + <tr> + <td>14</td> + <td>Day</td> + <td>BYTE</td> + <td>Date (1 - 31)</td> + </tr> + <tr> + <td>15</td> + <td>Month</td> + <td>BYTE</td> + <td>Month (1 - 12)</td> + </tr> + <tr> + <td>16 - 17</td> + <td>Year</td> + <td>INTEGER</td> + <td>Year (4 digit)</td> + </tr> + <tr> + <td>18</td> + <td>Receiver Status</td> + <td>BYTE</td> + <td>Tracking Status</td> + </tr> + <tr> + <td>19</td> + <td>UTC Flags</td> + <td>BYTE</td> + <td>Leap Second Flags</td> + </tr> + <tr> + <td>20</td> + <td>Reserved</td> + <td>BYTE</td> + <td>Contains 0xFF</td> + </tr> + <tr> + <td>21</td> + <td>Reserved</td> + <td>BYTE</td> + <td>Contains 0xFF</td> + </tr> + </table> + </center> + <blockquote> + <h4>Leap Second Flag Definition:</h4>Bit 0: (1) UTC Time is available<br> + Bits 1 - 3: Undefined<br>Bit 4: (1) Leap Scheduled: Leap second pending asserted by GPS control segment.<br>Bit 5: (1) Leap Pending: set 24 hours before, until beginning of leap second.<br>Bit 6: (1) GPS Leap Warning: 6 hours before until 6 hours after leap event<br>Bit 7: (1) Leap In Progress. Only set during the leap second. + <h4><a name="TrackingStatus"></a>Tracking Status Flag Definitions:</h4> + </blockquote> + <center> + <table width="712" border="0" cellspacing="0"> + <tr> + <td valign="CENTER" width="5%">Code</td> + <td valign="CENTER" width="59%">Meaning</td> + <td>Accuracy</td> + <td>Receiver Mode</td> + </tr> + <tr> + <td>0</td> + <td>Receiver is Navigating</td> + <td>+/- 1 us</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">1</td> + <td valign="CENTER" width="59%">Static 1 Sat. Timing Mode </td> + <td>+/- 1 us</td> + <td>1-D Timing</td> + </tr> + <tr> + <td valign="CENTER" width="5%">2</td> + <td valign="CENTER" width="59%">Approximate Time</td> + <td>20 - 50 ms</td> + <td>Acquisition</td> + </tr> + <tr> + <td valign="CENTER" width="5%">3</td> + <td valign="CENTER" width="59%">Startup</td> + <td>N/A</td> + <td>Initialization</td> + </tr> + <tr> + <td valign="CENTER" width="5%">4</td> + <td valign="CENTER" width="59%">Startup</td> + <td>N/A</td> + <td>Initialization</td> + </tr> + <tr> + <td valign="CENTER" width="5%">5</td> + <td valign="CENTER" width="59%">Dilution of Position too High </td> + <td>5 ppm</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">6</td> + <td valign="CENTER" width="59%">Static 1 Sat. Timing: Sat. not usable</td> + <td>5 ppm</td> + <td>1-D Timing</td> + </tr> + <tr> + <td valign="CENTER" width="5%">7</td> + <td valign="CENTER" width="59%">No Satellites Usable</td> + <td>N/A</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">8</td> + <td valign="CENTER" width="59%">Only 1 Satellite Usable</td> + <td>20 - 50 ms</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">9</td> + <td valign="CENTER" width="59%">Only 2 Satellite Usable</td> + <td>20 - 50 ms</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">10</td> + <td valign="CENTER" width="59%">Only 3 Satellites Usable</td> + <td>20 - 50 ms</td> + <td>Self Survey</td> + </tr> + <tr> + <td valign="CENTER" width="5%">11</td> + <td valign="CENTER" width="59%">Invalid Solution</td> + <td>N/A</td> + <td>Error</td> + </tr> + <tr> + <td valign="CENTER" width="5%">12</td> + <td valign="CENTER" width="59%">Differential Corrections </td> + <td>N/A</td> + <td>N/A</td> + </tr> + <tr> + <td valign="CENTER" width="5%">13</td> + <td valign="CENTER" width="59%">Overdetermined Fixes</td> + <td>+/- 100 ns</td> + <td>Timing Steady State</td> + </tr> + </table> + </center> + <h3><b><font size="+0">Packet 8F-0B (Comprehensive Timing Packet)</font></b></h3> + <center> + <table border="0" cellspacing="0"> + <tr> + <td valign="CENTER" width="9%">Byte</td> + <td valign="CENTER" width="27%">Item</td> + <td valign="CENTER" width="16%">Type</td> + <td valign="CENTER" width="48%">Meaning</td> + </tr> + <tr> + <td valign="CENTER" width="9%">0</td> + <td valign="CENTER" width="27%">Sub-Packet ID</td> + <td valign="CENTER" width="16%">BYTE</td> + <td valign="CENTER" width="48%">Subcode 0x0B</td> + </tr> + <tr> + <td valign="TOP" width="9%">1 - 2</td> + <td valign="TOP" width="27%">Event Count</td> + <td valign="TOP" width="16%">INTEGER</td> + <td valign="TOP" width="48%">External event count recorded (0 = PPS)</td> + </tr> + <tr> + <td valign="TOP" width="9%">3 - 10</td> + <td valign="TOP" width="27%">UTC / GPS TOW</td> + <td valign="TOP" width="16%">DOUBLE</td> + <td valign="TOP" width="48%">UTC / GPS time of week (seconds)</td> + </tr> + <tr> + <td valign="CENTER" width="9%">11</td> + <td valign="CENTER" width="27%">Date</td> + <td valign="CENTER" width="16%">BYTE</td> + <td valign="CENTER" width="48%">Day of Month</td> + </tr> + <tr> + <td valign="CENTER" width="9%">12</td> + <td valign="CENTER" width="27%">Month</td> + <td valign="CENTER" width="16%">BYTE</td> + <td valign="CENTER" width="48%">Month of Event</td> + </tr> + <tr> + <td valign="CENTER" width="9%">13 - 14</td> + <td valign="CENTER" width="27%">Year</td> + <td valign="CENTER" width="16%">INT</td> + <td valign="CENTER" width="48%">Year of event</td> + </tr> + <tr> + <td valign="TOP" width="9%">15</td> + <td valign="TOP" width="27%">Receiver Mode</td> + <td valign="TOP" width="16%">BYTE</td> + <td valign="TOP" width="48%">Receiver operating dimensions: <br>0: Horizontal (2D) <br>1: Full Position (3D) <br>2: Single Satellite (0D) <br>3: Automatic (2D / 3D) <br>4: DGPS reference <br>5: Clock hold (2D) <br> + 6: Over determined Clock</td> + </tr> + <tr> + <td valign="CENTER" width="9%">15 - 17</td> + <td valign="CENTER" width="27%">UTC Offset</td> + <td valign="CENTER" width="16%">INTEGER</td> + <td valign="CENTER" width="48%">UTC Offset value (seconds)</td> + </tr> + <tr> + <td valign="CENTER" width="9%">18 - 25</td> + <td valign="CENTER" width="27%">Oscillator Bias</td> + <td valign="CENTER" width="16%">DOUBLE</td> + <td valign="CENTER" width="48%">Oscillator BIAS (meters)</td> + </tr> + <tr> + <td valign="TOP" width="9%">26 - 33</td> + <td valign="TOP" width="27%">Oscillator Drift Rate</td> + <td valign="TOP" width="16%">DOUBLE</td> + <td valign="TOP" width="48%">Oscillator Drift (meters / second)</td> + </tr> + <tr> + <td valign="CENTER" width="9%">34 - 37</td> + <td valign="CENTER" width="27%">Bias Uncertainty</td> + <td valign="CENTER" width="16%">SINGLE</td> + <td valign="CENTER" width="48%">Oscillator bias uncertainty (meters)</td> + </tr> + <tr> + <td valign="CENTER" width="9%">38 - 41</td> + <td valign="CENTER" width="27%">Drift Uncertainty</td> + <td valign="CENTER" width="16%">SINGLE</td> + <td valign="CENTER" width="48%">Oscillator bias rate uncertainty (m / sec)</td> + </tr> + <tr> + <td valign="CENTER" width="9%">42 - 49</td> + <td valign="CENTER" width="27%">Latitude</td> + <td valign="CENTER" width="16%">DOUBLE</td> + <td valign="CENTER" width="48%">Latitude in radians</td> + </tr> + <tr> + <td valign="CENTER" width="9%">50 - 57</td> + <td valign="CENTER" width="27%">Longitude</td> + <td valign="CENTER" width="16%">DOUBLE</td> + <td valign="CENTER" width="48%">Longitude in radians</td> + </tr> + <tr> + <td valign="CENTER" width="9%">58 - 65</td> + <td valign="CENTER" width="27%">Altitude</td> + <td valign="CENTER" width="16%">DOUBLE</td> + <td valign="CENTER" width="48%">Altitude above mean sea level, in meters</td> + </tr> + <tr> + <td valign="CENTER" width="9%">66 - 73</td> + <td valign="CENTER" width="27%">Satellite ID</td> + <td valign="CENTER" width="16%">BYTE</td> + <td valign="CENTER" width="48%">SV Id No. of tracked satellites</td> + </tr> + </table> + </center> + <h2><a name="Pinouts"></a><font size="+1">Pinouts</font></h2> + <a href="#Connection">The following connections are required when connecting Palisade with a host:</a><br> <br> + <center> + <table> + <tr> + <td><u>Description</u></td> + <td><b>Host</b></td> + <td></td> + <td></td> + <td><b>Palisade </b></td> + <td></td> + <td></td> + </tr> + <tr> + <td><a name="PortA"></a><b>Port A</b></td> + <td><u>DB-9</u></td> + <td><u>DB-25</u></td> + <td></td> + <td><u>RS-232</u></td> + <td><u>RS-422</u></td> + <td><u>Palisade Pin</u></td> + </tr> + <tr> + <td>Receive Data </td> + <td>2</td> + <td>3</td> + <td><--></td> + <td>Green</td> + <td>Green / Blue</td> + <td>8 (T-) & 10 (T+)</td> + </tr> + <tr> + <td>Request to Send</td> + <td>7</td> + <td>4</td> + <td><--></td> + <td>Gray</td> + <td>Gray / White</td> + <td>6 (R-) & 7 (R+)</td> + </tr> + <tr> + <td>Signal Ground</td> + <td>5</td> + <td>7</td> + <td><--></td> + <td>Black</td> + <td>Black</td> + <td>9 (GND)</td> + </tr> + <tr> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> + <tr> + <td><a name="PortB"></a><b>Port B</b></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> + <tr> + <td>Receive Data </td> + <td>2</td> + <td>3</td> + <td><--></td> + <td>Brown</td> + <td>Brown / Yellow</td> + <td>4 (T-) & 5 (T+)</td> + </tr> + <tr> + <td>Transmit Data</td> + <td>3</td> + <td>2</td> + <td><--></td> + <td>Violet</td> + <td>Orange/ Violet</td> + <td>2 (R-) & 3 (R+)</td> + </tr> + <tr> + <td>Signal Ground</td> + <td>5</td> + <td>7</td> + <td><--></td> + <td>Black</td> + <td>Black</td> + <td>9 (GND)</td> + </tr> + </table> + </center> + <blockquote> + Note: If driving the RS-422 inputs on the Palisade single ended, i.e. using the Green and Gray connections only, does not work on all serial ports. Use of the Palisade NTP Synchronization Interface Module is recommended.</blockquote> + <blockquote> + The 12 pin connector pinout definition:<br> + Face the round 12 pin connector at the end of the cable, with the notch turned upwards.<br> + Pin 1 is to the left of the notch. Pins 2 - 8 wrap around the bottom, counterclockwise to pin 9 on the right of the notch. Pin 10 is just below the notch. Pins 10 (top), 11 (bottom left) and 12 (bottom right) form a triangle in the center of the connector.</blockquote> + <blockquote> + <a name="SIM"></a>Pinouts for the Palisade NTP host adapter (Trimble PN 37070) DB-25 M connector are as follows:</blockquote> + <center> + <table width="682" border="0" cellspacing="0"> + <tr> + <td valign="CENTER" width="12%">DB-25M</td> + <td valign="CENTER" width="31%">Conductor </td> + <td valign="CENTER" width="16%">Palisade</td> + <td valign="CENTER" width="41%">Description</td> + </tr> + <tr> + <td valign="CENTER" width="12%">1 </td> + <td valign="CENTER" width="31%">Red</td> + <td valign="CENTER" width="16%">1</td> + <td valign="CENTER" width="41%">Power</td> + </tr> + <tr> + <td valign="CENTER" width="12%">7 </td> + <td valign="CENTER" width="31%">Black</td> + <td valign="CENTER" width="16%">9</td> + <td valign="CENTER" width="41%">Ground</td> + </tr> + <tr> + <td valign="CENTER" width="12%">9</td> + <td valign="CENTER" width="31%">Black/White</td> + <td valign="CENTER" width="16%">12</td> + <td valign="CENTER" width="41%">PPS -</td> + </tr> + <tr> + <td valign="CENTER" width="12%">10 </td> + <td valign="CENTER" width="31%">Green</td> + <td valign="CENTER" width="16%">8</td> + <td valign="CENTER" width="41%">Transmit Port A (T-)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">11 </td> + <td valign="CENTER" width="31%">Brown</td> + <td valign="CENTER" width="16%">4</td> + <td valign="CENTER" width="41%">Transmit Port B (T-)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">12 </td> + <td valign="CENTER" width="31%">Gray</td> + <td valign="CENTER" width="16%">7</td> + <td valign="CENTER" width="41%">Receive Port A (R+)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">13</td> + <td valign="CENTER" width="31%">Orange</td> + <td valign="CENTER" width="16%">3</td> + <td valign="CENTER" width="41%">Receive Port B (R+)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">21</td> + <td valign="CENTER" width="31%">Orange/White</td> + <td valign="CENTER" width="16%">11</td> + <td valign="CENTER" width="41%">PPS +</td> + </tr> + <tr> + <td valign="CENTER" width="12%">22</td> + <td valign="CENTER" width="31%">Blue</td> + <td valign="CENTER" width="16%">10</td> + <td valign="CENTER" width="41%">Transmit Port A (T+)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">23</td> + <td valign="CENTER" width="31%">Yellow</td> + <td valign="CENTER" width="16%">5</td> + <td valign="CENTER" width="41%">Transmit Port B (T+)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">24</td> + <td valign="CENTER" width="31%">White</td> + <td valign="CENTER" width="16%">6</td> + <td valign="CENTER" width="41%">Receive Port A (R-)</td> + </tr> + <tr> + <td valign="CENTER" width="12%">25</td> + <td valign="CENTER" width="31%">Violet</td> + <td valign="CENTER" width="16%">2</td> + <td valign="CENTER" width="41%">Receive Port B (R-)</td> + </tr> + </table> + </center> + <p></p> + <hr> + <p>Questions or Comments:<br> + <a href="mailto:sven_dietrich@trimble.com">Sven Dietrich</a><br> + <a href="http://www.trimble.com/">Trimble Navigation Ltd.</a></p> + <p>(last updated July 29, 1999)</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + ; + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver3.html b/contrib/ntp/html/drivers/driver3.html new file mode 100644 index 0000000..e5a06be --- /dev/null +++ b/contrib/ntp/html/drivers/driver3.html @@ -0,0 +1,76 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>PSTI/Traconex 1020 WWV/WWVH Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>PSTI/Traconex 1020 WWV/WWVH Receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.3.<i>u</i><br> + Reference ID: <tt>WWV</tt><br> + Driver ID: <tt>WWV_PST</tt><br> + Serial Port: <tt>/dev/wwv<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt></p> + <h4>Description</h4> + <p>This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH Receivers. No specific claim of accuracy is made for these receiver, but actual experience suggests that 10 ms would be a conservative assumption.</p> + <p>The dipswitches should be set for 9600 bps line speed, 24-hour day-of-year format and UTC time zone. Automatic correction for DST should be disabled. It is very important that the year be set correctly in the DIP-switches; otherwise, the day of year will be incorrect after 28 April of a normal or leap year. As the there are only four dipswitches to set the year and the base value of zero correspondes to 1986, years beyond 2001 recycle with the value of zero corresponding to 2002. The propagation delay DIP-switches should be set according to the distance from the transmitter for both WWV and WWVH, as described in the instructions. While the delay can be set only to within 11 ms, the fudge time1 parameter can be used for vernier corrections.</p> + <p>Using the poll sequence <tt>QTQDQM</tt>, the response timecode is in three sections totalling 50 ASCII printing characters, as concatenated by the driver, in the following format:</p> + <pre> +ahh:mm:ss.fffs<cr> yy/dd/mm/ddd<cr> +frdzycchhSSFTttttuuxx<cr> + +on-time = first <cr> +hh:mm:ss.fff = hours, minutes, seconds, milliseconds +a = AM/PM indicator (' ' for 24-hour mode) +yy = year (from DIPswitches) +dd/mm/ddd = day of month, month, day of year +s = daylight-saving indicator (' ' for 24-hour mode) +f = frequency enable (O = all frequencies enabled) +r = baud rate (3 = 1200, 6 = 9600) +d = features indicator (@ = month/day display enabled) +z = time zone (0 = UTC) +y = year (5 = 91) +cc = WWV propagation delay (52 = 22 ms) +hh = WWVH propagation delay (81 = 33 ms) +SS = status (80 or 82 = operating correctly) +F = current receive frequency (4 = 15 MHz) +T = transmitter (C = WWV, H = WWVH) +tttt = time since last update (0000 = minutes) +uu = flush character (03 = ^c) +xx = 94 (unknown)</pre> + <p>The alarm condition is indicated by other than <tt>8</tt> at <tt>a</tt>, which occurs during initial synchronization and when received signal is lost for an extended period; unlock condition is indicated by other than <tt>0000</tt> in the <tt>tttt</tt> subfield.</p> + <h4>Monitor Data</h4> + <p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWV</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver30.html b/contrib/ntp/html/drivers/driver30.html new file mode 100644 index 0000000..d29dbcf --- /dev/null +++ b/contrib/ntp/html/drivers/driver30.html @@ -0,0 +1,83 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.06 [en] (X11; I; FreeBSD 3.0-CURRENT i386) [Netscape]"> + <title>Motorola Oncore GPS Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Motorola Oncore GPS receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.30.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: ONCORE<br> + Serial Port: <tt>/dev/oncore.serial.</tt><i>u</i>; 9600 baud, 8-bits, no parity.<br> + PPS Port: <tt>/dev/oncore.pps.</tt><i>u</i>; <tt>PPS_CAPTUREASSERT</tt> required, <tt>PPS_OFFSETASSERT</tt> supported.<br> + Configuration File: <tt>ntp.oncore</tt>, or <tt>ntp.oncore.</tt><i>u</i>, or <tt>ntp.oncore</tt><i>u</i>, in <tt>/etc/ntp</tt> or <tt>/etc</tt>.</p> + <h4>Description</h4> + <p>This driver supports most models of the <a href="http://www.mot.com/AECS/PNSB/products">Motorola Oncore GPS receivers</a> (Basic, PVT6, VP, UT, UT+, GT, GT+, SL, M12, M12+T), as long as they support the <i>Motorola Binary Protocol</i>.</p> + <p>The interesting versions of the Oncore are the VP, the UT+, the "Remote" which is a prepackaged UT+, and the M12 Timing. The VP is no longer available new, and the UT, GT, and SL are at end-of-life. The Motorola evaluation kit can be recommended. It interfaces to a PC straightaway, using the serial (DCD) or parallel port for PPS input and packs the receiver in a nice and sturdy box. Less expensive interface kits are available from <a href="http://www.tapr.org">TAPR</a> and <a href="http://www.synergy-gps.com">Synergy</a>.<br> </p> + <center> + <table> + <tr> + <td><img src="../pic/oncore_utplusbig.gif" alt="gif" height="124" width="210"></td> + <td><img src="../pic/oncore_evalbig.gif" alt="gif" height="124" width="182"></td> + <td><img src="../pic/oncore_remoteant.jpg" alt="gif" height="188" width="178"></td> + </tr> + <tr> + <td> + <center> + UT+ oncore</center> + </td> + <td> + <center> + Evaluation kit</center> + </td> + <td> + <center> + Oncore Remote</center> + </td> + </tr> + </table> + </center> + <p>The driver requires a standard <tt>PPS</tt> interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps (0-50msec variance, according to the manual), whereas the PPS output is precise down to 50 nsec (1 sigma) for the VP/UT models and 25 nsec for the M12 Timing. If you do not have the PPS signal available, then you should probably be using the NMEA driver rather than the Oncore driver. Most of these are available on-line</p> + <p>The driver will use the "position hold" mode with user provided coordinates, the receivers built-in site-survey, or a similar algorithm implemented in this driver to determine the antenna position.</p> + <h4>Monitor Data</h4> + The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly. + <p>In addition, on platforms supporting Shared Memory, all of the messages received from the Oncore receiver are made available in shared memory for use by other programs. See the <a href="oncore-shmem.html">Oncore-SHMEM</a> manual page for information on how to use this option. For either debugging or using the SHMEM option, an Oncore Reference Manual for the specific receiver in use will be required.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p>The driver was initially developed on FreeBSD, and has since been tested on Linux, SunOS and Solaris.</p> + <p><b>Configuration</b></p> + <p>There is a driver specific configuration file <tt>ntp.oncore</tt> (or <tt>ntp.oncore.</tt><i>u</i> or <tt>ntp.oncore</tt><i>u</i> if you must distinguish between more than one Oncore receiver) that contains information on the startup mode, the location of the GPS receiver, an offset of the PPS signal from zero, and the cable delay. The offset shifts the PPS signal to avoid interrupt pileups `on' the second, and adjusts the timestamp accordingly. See the driver source for information on this file. The default with no file is: no delay, no offset, and a site survey is done to get the location of the gps receiver.</p> + <p>The following three options can be set in the driver specific configuration file only if the driver is using the PPSAPI. The edge of the PPS signal that is `on-time' can be set with the keywords [ASSERT/CLEAR] and the word HARDPPS will cause the PPS signal to control the kernel PLL.</p> + <p><b>Performance</b></p> + <p>Really good. With the VP/UT+, the generated PPS pulse is referenced to UTC(GPS) with better than 50 nsec (1 sigma) accuracy. The limiting factor will be the timebase of the computer and the precision with which you can timestamp the rising flank of the PPS signal. Using FreeBSD, a FPGA based Timecounter/PPS interface, and an ovenized quartz oscillator, that performance has been reproduced. For more details on this aspect: <a href="http://phk.freebsd.dk/rover.html">Sub-Microsecond timekeeping under FreeBSD</a>.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver31.html b/contrib/ntp/html/drivers/driver31.html new file mode 100644 index 0000000..aff093c --- /dev/null +++ b/contrib/ntp/html/drivers/driver31.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.06 [en] (X11; I; FreeBSD 3.0-CURRENT i386) [Netscape]"> + <title>Rockwell Jupiter GPS Receiver</title> + <link href="../scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Rockwell Jupiter GPS receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.31.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: JUPITER<br> + Serial Port: <tt>/dev/gps</tt><i>u</i>; 9600 baud, 8-bits, no parity.</p> + <h4>Description</h4> + <p>This driver supports at least some models of the <a href="http://www.navman.com/oem/products/receivers/jupiter/">Rockwell Jupiter <tt>GPS</tt> receivers</a> (Jupiter 11, Jupiter-T), they must at least support the <i>Zodiac Binary Protocol</i>.</p> + <p>The driver requires a standard <tt>PPS</tt> interface for the pulse-per-second output from the receiver. The serial data stream alone does not provide precision time stamps, whereas the PPS output is precise down to 40 ns (1 sigma) for the Jupiter 11 and 25 ns (1 sigma) for Jupiter-T according to the documentation. If you do not have the PPS signal available, then you should probably not be using the Jupiter receiver as a time source. This driver requires a <tt>PPS</tt> signal and the time output from Jupiter receivers is not predictable in <tt>NMEA</tt> mode; the reported time can take one second steps.</p> + <h4>Monitor Data</h4> + <p>The driver always puts a lot of useful information on the clockstats file, and when run with debugging can be quite chatty on stdout. When first starting to use the driver you should definitely review the information written to the clockstats file to verify that the driver is running correctly.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. Should be left at zero. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an <tt>ASCII</tt> string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Specifies the mobility of the <tt>GPS</tt> receiver: 0 for walking (default), 1 for driving. + <dt><tt>flag3 0 | 1</tt> + <dd>Specifies the <tt>PPS</tt> signal on-time edge: 0 for assert (default), 1 for clear. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p>The driver was resurrected from a sorry state using the Windows NT port and a Jupiter 11, and has since seen little testing on other platforms. On Windows there exist a barrier though, as there is no publicly available <tt>PPSAPI</tt> implementation, at least not to my knowledge. However, there has been one success report using Linux 2.4.20 and PPSkit 2.1.1.</p> + <p>The Jupiter receivers seem to have quite a few names. They are referred to at least as Rockwell receivers, Navman receivers, Zodiac receivers, Conexant receivers and SiRF Technology receivers. Rockwell seems to be the original and most commonly used name and Navman seems to be the current supplier.</p> + <p><b>Configuration</b></p> + <p>The edge of the <tt>PPS</tt> signal that is `on-time' can be set with <tt>flag2</tt>. There is currently no way to cause the <tt>PPS</tt> signal to control the kernel <tt>PLL</tt>.</p> + <p><b>Performance</b></p> + <p>The performance is largely unexplored. I have achieved submillisecond stability using a Jupiter 11, but the poor result is more than likely due to the proprietary <tt>PPSAPI</tt> implementation or Windows itself.</p> + <p>This driver does not handle leap seconds.</p> + <hr> + <script type="text/javascript" language="javascript" src="../scripts/footer.txt"></script> + </body> + +</html> + +=
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver32.html b/contrib/ntp/html/drivers/driver32.html new file mode 100644 index 0000000..9479248 --- /dev/null +++ b/contrib/ntp/html/drivers/driver32.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>Chrono-log K-series WWVB receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Chrono-log K-series WWVB receiver</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.32.<i>u</i><br> + Reference ID: <tt>CHRONOLOG</tt><br> + Driver ID: <tt>CHRONOLOG</tt><br> + Serial Port: <tt>/dev/chronolog<i>u</i></tt>; 2400 bps, 8-bits, no parity<br> + <br> + Features: <tt>(none)</tt></p> + <h4>Description</h4> + <p>This driver supports the Chrono-log K-series WWVB receiver. This is a very old receiver without provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC. There is a hack in the driver for permitting UTC, but it has not been tested.</p> + <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p> + <pre> +Timecode format: Y yy/mm/ddCLZhh:mm:ssCL +Y - year/month/date line indicator +yy/mm/dd -- two-digit year/month/day +C - \r (carriage return) +L - \n (newline) +Z - timestamp indicator +hh:mm:ss - local time +</pre> + <!-- hhmts start -->Last modified: Sun Feb 14 11:57:27 EST 1999 <!-- hhmts end --> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver33.html b/contrib/ntp/html/drivers/driver33.html new file mode 100644 index 0000000..f50dfb63 --- /dev/null +++ b/contrib/ntp/html/drivers/driver33.html @@ -0,0 +1,35 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>Dumb Clock</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Dumb Clock</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.33.<i>u</i><br> + Reference ID: <tt>DUMBCLOCK</tt><br> + Driver ID: <tt>DUMBCLOCK</tt><br> + Serial Port: <tt>/dev/dumbclock<i>u</i></tt>; 9600 bps, 8-bits, no parity<br> + Features: <tt>(none)</tt></p> + <h4>Description</h4> + <p>This driver supports a dumb ASCII clock that only emits localtime at a reliable interval. This has no provisions for leap seconds, quality codes, etc. It assumes output in the local time zone, and that the C library mktime()/localtime() routines will correctly convert back and forth between local and UTC.</p> + <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p> + <pre> +Timecode format: hh:mm:ssCL +hh:mm:ss - local time +C - \r (carriage return) +L - \n (newline) +</pre> + <hr> + <!-- hhmts start -->Last modified: Sun Feb 14 12:07:01 EST 1999 <!-- hhmts end --> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver34.html b/contrib/ntp/html/drivers/driver34.html new file mode 100644 index 0000000..a98fad8 --- /dev/null +++ b/contrib/ntp/html/drivers/driver34.html @@ -0,0 +1,117 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> + +<html> + + <head> + <title>Ultralink Clock</title> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <link <link href="scripts/style.css" type="text/css" rel="stylesheet"> </HEAD> <BODY> <H3> Ultralink Clock</H3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.34.<i>u</i><br> + Reference ID: <tt>WWVB</tt><br> + Driver ID: <tt>ULINK</tt><br> + Serial Port: <tt>/dev/wwvb<i>u</i></tt>; 9600 bps, 8-bits, no parity<br> + <br> + Features: <tt>(none)</tt> + <h4>Description</h4> + <p>This driver supports the Ultralink Model 325 (replacement for Model 320) RS-232 powered WWVB receiver. PDF specs available on <a href="http://www.ulio.com/">http://www.ulio.com/</a>. This driver also supports the Model 320, 330,331,332 decoders in both polled or continous time code mode.<br> + Leap second and quality are supported.</p> + <p>Most of this code is originally from refclock_wwvb.c with thanks. Any mistakes are mine. Any improvements are welcome.</p> + <hr> + <pre> The Model 325 timecode format is: + + <cr><lf>RQ_1C00LYYYY+DDDUTCS_HH:MM:SSL+5 + + where: + + R = Signal readability indicator, ranging from R1 to R5 + Q R1 is unreadable, R5 is best reception + _ = Space + 1 = prev. received data bit, values: 0, 1 ,M or ? unknown + C = Signal reception from (C)olorado or (H)awaii + 0 = Hours since last WWVB time and flag code update, values + 0 00 to 99 (hopefully always 00) + L = HEX A5 if receiver is locked to WWVB, Space if not + YYYY = Year from 2000 to 2099 + + = '+' if current year is a leap year, else ' ' + DDD = current day in the year from 1 to 365/366 + UTC = timezone (always UTC) + S = Daylight savings indicator, (S)TD, (D)ST, (O) transition + into DST, (I) transition out of DST + _ = Space + HH = UTC hour 0 to 23 + : = Time delimiter, ':' if synced, Space if not + MM = Minutes of current hour from 0 to 59 + : = Time delimiter, ':' if synced, Space if not + SS = Seconds of current minute from 0 to 59 + mm = 10's milliseconds of the current second from 00 to 99 + L = Leap second pending at end of month, (I)nsert, (D)elete + or Space + +5 = UT1 correction, +/- .1 sec increments + </pre> + <p>Note that Model 325 reports a very similar output like Model 33X series. The driver for this clock is similar to Model 33X behavior. On a unmodified new ULM325 clock, the polling flag (flag1 =1) needs to be set.</p> + <hr> + <pre> The Model 320 timecode format is: + + <cr><lf>SQRYYYYDDD+HH:MM:SS.mmLT<cr> + + where: + + S = 'S' -- sync'd in last hour, '0'-'9' - hours x 10 since last update, else '?' + Q = Number of correlating time-frames, from 0 to 5 + R = 'R' -- reception in progress, 'N' -- Noisy reception, ' ' -- standby mode + YYYY = year from 1990 to 2089 + DDD = current day from 1 to 366 + + = '+' if current year is a leap year, else ' ' + HH = UTC hour 0 to 23 + MM = Minutes of current hour from 0 to 59 + SS = Seconds of current minute from 0 to 59 + mm = 10's milliseconds of the current second from 00 to 99 + L = Leap second pending at end of month -- 'I' = inset, 'D'=delete + T = DST <-> STD transition indicators + </pre> + <p>Note that this driver does not do anything with the T flag.</p> + <p>The M320 also has a 'U' command which returns UT1 correction information. It is not used in this driver.</p> + <hr> + <pre> The Model 33x timecode format is: + + S9+D 00 YYYY+DDDUTCS HH:MM:SSl+5 + + Where: + + S = sync indicator S insync N not in sync + the sync flag is WWVB decoder sync + nothing to do with time being correct + 9+ = signal level 0 thru 9+ If over 9 indicated as 9+ + D = data bit ( fun to watch but useless ;-) + space + 00 = hours since last GOOD WWVB frame sync + space + YYYY = current year + + = leap year indicator + DDD = day of year + UTC = timezone (always UTC) + S = daylight savings indicator + space + HH = hours + : = This is the REAL in sync indicator (: = insync) + MM = minutes + : = : = in sync ? = NOT in sync + SS = seconds + L = leap second flag + +5 = UT1 correction (sign + digit )) + </pre> + <p>This driver ignores UT1 correction,DST indicator,Leap year and signal level.</p> + <hr> + <h4>Fudge factors</h4> + <p>flag1 polling enable (1=poll 0=no poll)</p> + <hr> + <address><a href="mailto:frank.migge@oracle.com">mail</a></address> + <!-- hhmts start -->Last modified: Mon Mar 8 10:12:08 PST 2004<!-- hhmts end --> + <hr> + <script type="text/javascript" language="javascript" src="Ultralink Clock_files/footer.txt"></script> + </BODY> + </head> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver35.html b/contrib/ntp/html/drivers/driver35.html new file mode 100644 index 0000000..78a0881 --- /dev/null +++ b/contrib/ntp/html/drivers/driver35.html @@ -0,0 +1,48 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Conrad parallel port radio clock</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Conrad parallel port radio clock</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.35.<i>u</i><br> + Reference ID: <tt>PCF</tt><br> + Driver ID: <tt>PCF</tt><br> + Parallel Port: <tt>/dev/pcfclocks/<i>u</i></tt> or <tt>/dev/pcfclock<i>u</i></tt></p> + <h4>Description</h4> + <p>This driver supports the parallel port radio clock sold by <a href="http://www.conrad-electronic.com/">Conrad Electronic</a> under order numbers 967602 and 642002. This clock is put between a parallel port and your printer. It receives the legal German time, which is either CET or CEST, from the DCF77 transmitter and uses it to set its internal quartz clock. The DCF77 transmitter is located near to Frankfurt/Main and covers a radius of more than 1500 kilometers.</p> + <p>The pcfclock device driver is required in order to use this reference clock driver. Currently device drivers for <a href="http://home.pages.de/%7evoegele/pcf.html">Linux</a> and <a href="http://schumann.cx/pcfclock/">FreeBSD</a> are available.</p> + <p>This driver uses C library functions to convert the received timecode to UTC and thus requires that the local timezone be CET or CEST. If your server is not located in Central Europe you have to set the environment variable TZ to CET before starting <tt>ntpd</tt>.</p> + <h4>Monitor Data</h4> + <p>Each timecode is written to the <tt>clockstats</tt> file in the format <tt>YYYY MM DD HH MI SS</tt>.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.1725. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>PCF</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>If set to 1, the radio clock's synchronisation status bit is ignored, ie the timecode is used without a check. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver36.html b/contrib/ntp/html/drivers/driver36.html new file mode 100644 index 0000000..72fa665 --- /dev/null +++ b/contrib/ntp/html/drivers/driver36.html @@ -0,0 +1,146 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Radio WWV/H Audio Demodulator/Decoder</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Radio WWV/H Audio Demodulator/Decoder</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.36.<i>u</i><br> + Reference ID: <tt>WV<i>f</i></tt> or <tt>WH<i>f</i></tt><br> + Driver ID: <tt>WWV_AUDIO</tt><br> + Autotune Port: <tt>/dev/icom</tt>; 1200/9600 baud, 8-bits, no parity<br> + Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt> + <h4>Description</h4> + This driver synchronizes the computer time using data encoded in shortwave radio transmissions from NIST time/frequency stations <a href="http://www.bldrdoc.gov/timefreq/stations/wwv.html">WWV</a> in Ft. Collins, CO, and <a href="http://www.bldrdoc.gov/timefreq/stations/wwvh.htm">WWVH</a> in Kauai, HI. Transmissions are made continuously on 2.5, 5, 10 and 15 MHz from both stations and on 20 MHz from WWV. An ordinary shortwave receiver can be tuned manually to one of these frequencies or, in the case of ICOM receivers, the receiver can be tuned automatically by the driver as propagation conditions change throughout the day and season. The performance of this driver when tracking one of the stations is ordinarily better than 1 ms in time with frequency drift less than 0.1 PPM when not tracking any station.<p>The demodulation and decoding algorithms used by this driver are based on a machine language program developed for the TAPR DSP93 DSP unit, which uses the TI 320C25 DSP chip. The analysis, design and performance of the program running on this unit is described in: Mills, D.L. A precision radio clock for WWV transmissions. Electrical Engineering Report 97-8-1, University of Delaware, August 1997, 25 pp. Available from <a href="http://www.eecis.udel.edu/%7emills/reports.html">www.eecis.udel.edu/~mills/reports.htm</a>. For use in this driver, the original program was rebuilt in the C language and adapted to the NTP driver interface. The algorithms have been modified to improve performance, especially under weak signal conditions and to provide an automatic frequency and station selection feature.</p> + <p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver7.html">Radio CHU Audio Demodulator/Decoder</a> and the <a href="driver6.html">IRIG Audio Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p> + <p>The WWV signal format is described in NIST Special Publication 432 (Revised 1990). It consists of three elements, a 5-ms, 1000-Hz pulse, which occurs at the beginning of each second, a 800-ms, 1000-Hz pulse, which occurs at the beginning of each minute, and a pulse-width modulated 100-Hz subcarrier for the data bits, one bit per second. The WWVH format is identical, except that the 1000-Hz pulses are sent at 1200 Hz. Each minute encodes nine BCD digits for the time of century plus seven bits for the daylight savings time (DST) indicator, leap warning indicator and DUT1 correction.</p> + <h4>Program Architecture</h4> + <p>As in the original program, the clock discipline is modelled as a Markov process, with probabilistic state transitions corresponding to a conventional clock and the probabilities of received decimal digits. The result is a performance level which results in very high accuracy and reliability, even under conditions when the minute beep of the signal, normally its most prominent feature, can barely be detected by ear using a communications receiver.</p> + <p>The analog audio signal from the shortwave radio is sampled at 8000 Hz and converted to digital representation. The 1000/1200-Hz pulses and 100-Hz subcarrier are first separated using two IIR filters, a 600-Hz bandpass filter centered on 1100 Hz and a 150-Hz lowpass filter. The minute synch pulse is extracted using an 800-ms synchronous matched filter and pulse grooming logic which discriminates between WWV and WWVH signals and noise. The second synch pulse is extracted using a 5-ms FIR matched filter and 8000-stage comb filter.</p> + <p>The phase of the 100-Hz subcarrier relative to the second synch pulse is fixed at the transmitter; however, the audio stage in many radios affects the phase response at 100 Hz in unpredictable ways. The driver adjusts for each radio using two 170-ms synchronous matched filters. The I (in-phase) filter is used to demodulate the subcarrier envelope, while the Q (quadrature-phase) filter is used in a tracking loop to discipline the codec sample clock and thus the demodulator phase.</p> + <p>A bipolar data signal is determined from the matched filter I and Q channels using a pulse-width discriminator. The discriminator samples the I channel at 15 ms (<i>n</i>), 200 ms (<i>s</i><sub>1</sub>) and 500 ms (<i>s</i><sub>0</sub>), and the envelope (RMS I and Q channels) at 200 ms (<i>e</i><sub>1</sub>) and the end of the second (<i>e</i><sub>0</sub>). The bipolar data signal is expressed <i>s</i><sub>1</sub> - 2<i>s</i><sub>0 </sub>- <i>n.</i> Note that, since the signals <i>s</i><sub>0</sub> and <i>s</i><sub>1</sub> include the noise <i>n</i>, this term cancels out. The data bit SNR is calculated as 20 log<sub>10</sub>(<i>e</i><sub>1</sub> / <i>e</i><sub>0</sub>). If the driver has not synchronized to the minute pulse, or if the data bit amplitude <i>e</i><sub>1</sub> or SNR are below thresholds, the bit is considered invalid and the bipolar signal is forced to zero.</p> + <p>The bipolar signal is exponentially averaged in a set of 60 accumulators, one for each second, to determine the semi-static miscellaneous bits, such as DST indicator, leap second warning and DUT1 correction. In this design a data average value larger than a positive threshold is interpreted as +1 (hit) and a value smaller than a negative threshold as a -1 (miss). Values between the two thresholds, which can occur due to signal fades, are interpreted as an erasure and result in no change of indication.</p> + <p>The BCD digit in each digit position of the timecode is represented as four data bits. The bits are correlated with the bits corresponding to each of the valid decimal digits in this position. If any of the four bits are invalid, the correlated value for all digits in this position is assumed zero. In either case, the values for all digits are exponentially averaged in a likelihood vector associated with this position. The digit associated with the maximum over all averaged values then becomes the maximum likelihood selection for this position and the ratio of the maximum over the next lower value represents the digit SNR.</p> + <p>The decoding matrix contains nine row vectors, one for each digit position. Each row vector includes the maximum likelihood digit, likelihood vector and other related data. The maximum likelihood digit for each of the nine digit positions becomes the maximum likelihood time of the century. A built-in transition function implements a conventional clock with decimal digits that count the minutes, hours, days and years, as corrected for leap seconds and leap years. The counting operation also rotates the likelihood vector corresponding to each digit as it advances. Thus, once the clock is set, each clock digit should correspond to the maximum likelihood digit as transmitted.</p> + <p>Each row of the decoding matrix also includes a compare counter and the most recently determined maximum likelihood digit. If a digit likelihood exceeds the decision level and compares with previous digits for a number of successive minutes in any row, the maximum likelihood digit replaces the clock digit in that row. When this condition is true for all rows and the second epoch has been reliably determined, the clock is set (or verified if it has already been set) and delivers correct time to the integral second. The fraction within the second is derived from the logical master clock, which runs at 8000 Hz and drives all system timing functions.</p> + <p>The logical master clock is derived from the audio codec clock. Its frequency is disciplined by a frequency-lock loop (FLL) which operates independently of the data recovery functions. At averaging intervals determined by the measured jitter, the frequency error is calculated as the difference between the most recent and the current second epoch divided by the interval. The sample clock frequency is then corrected by this amount. When first started, the frequency averaging interval is eight seconds, in order to compensate for intrinsic codec clock frequency offsets up to 125 PPM. Under most conditions, the averaging interval doubles in stages from the initial value to over 1000 seconds, which results in an ultimate frequency precision of 0.125 PPM, or about 11 ms/day.</p> + <p>It is important that the logical clock frequency is stable and accurately determined, since in most applications the shortwave radio will be tuned to a fixed frequency where WWV or WWVH signals are not available throughout the day. In addition, in some parts of the US, especially on the west coast, signals from either or both WWV and WWVH may be available at different times or even at the same time. Since the propagation times from either station are almost always different, each station must be reliably identified before attempting to set the clock.</p> + <p>Reliable station identification requires accurate discrimination between very weak signals in noise and noise alone. The driver very aggresively soaks up every scrap of signal information, but has to be careful to avoid making pseudo-sense of noise alone. The signal quality metric depends on the minute pulse amplitude and SNR measured in second 0 of the minute, together with the data subcarrier amplitude and SNR measured in second 1. If all four values are above defined thresholds a hit is declared, otherwise a miss. The number of hits declared in the last six minutes by each station represents the high order bits of the metric value, while the current minute pulse amplitude repressents the low order bits. The resulting value is then scaled from zero to 100 for use as a quality indicator. It is used by the autotune function described below and reported in the timecode string.</p> + <h4>Performance</h4> + <p>It is the intent of the design that the accuracy and stability of the indicated time be limited only by the characteristics of the ionospheric propagation medium. Conventional wisdom is that synchronization via the HF medium is good only to a millisecond under the best propagation conditions. The performance of the NTP daemon disciplined by the driver is clearly better than this, even under marginal conditions. Ordinarily, with marginal to good signals and a frequency averaging interval of 1024 s, the frequency is stabilized within 0.1 PPM and the time within 0.5 ms. The frequency stability characteristic is highly important, since the clock may have to free-run for several hours before reacquiring the WWV/H signal.</p> + <p>The expected accuracy over a typical day was determined using the DSP93 and an oscilloscope and cesium oscillator calibrated with a GPS receiver. With marginal signals and allowing 15 minutes for initial synchronization and frequency compensation, the time accuracy determined from the WWV/H second synch pulse was reliably within 125 <font face="Symbol">m</font>s. In the particular DSP93 used for program development, the uncorrected CPU clock frequency offset was 45.8±0.1 PPM. Over the first hour after initial synchronization, the clock frequency drifted about 1 PPM as the frequency averaging interval increased to the maximum 1024 s. Once reaching the maximum, the frequency wandered over the day up to 1 PPM, but it is not clear whether this is due to the stability of the DSP93 clock oscillator or the changing height of the ionosphere. Once the frequency had stabilized and after loss of the WWV/H signal, the frequency drift was less than 0.5 PPM, which is equivalent to 1.8 ms/h or 43 ms/d. This resulted in a step phase correction up to several milliseconds when the signal returned.</p> + <p>The measured propagation delay from the WWV transmitter at Boulder, CO, to the receiver at Newark, DE, is 23.5±0.1 ms. This is measured to the peak of the pulse after the second synch comb filter and includes components due to the ionospheric propagation delay, nominally 8.9 ms, communications receiver delay and program delay. The propagation delay can be expected to change about 0.2 ms over the day, as the result of changing ionosphere height. The DSP93 program delay was measured at 5.5 ms, most of which is due to the 400-Hz bandpass filter and 5-ms matched filter. Similar delays can be expected of this driver.</p> + <h4>Program Operation</h4>The driver begins operation immediately upon startup. It first searches for one or both of the stations WWV and WWVH and attempts to acquire minute synch. This may take some fits and starts, as the driver expects to see several consecutive minutes with good signals and low jitter. If the autotune function is active, the driver will rotate over all five frequencies and both WWV and WWVH stations until at least three good minutes are found.<p>When a minute synch candidate has been found, the driver acquires second synch, which can take up to several minutes, depending on signal quality. At the same time the driver accumulates likelihood values for the unit (seconds) digit of the nine digits of the timecode, plus the seven miscellaneous bits included in the WWV/H transmission format. When a good unit digit has been found, the driver accumlates likelihood values for the remaining eight digits of the timecode. When three repetitions of all nine digits have decoded correctly, which normally takes 15 minutes with good signals, and up to 40 minutes when buried in noise, and the second synch has been acquired, the clock is set (or verified) and is selectable to discipline the system clock.</p> + <p>Once the clock is set, it continues to provide correct timecodes, even if all signals are losst. The time is considered correct as long as the second synch amplitude and SNR are above specified thresholds and jitter is below threshold. As long as the clock is set or verified, the system clock offsets are provided once each minute to the reference clock interface, where they are processed using the same algorithms used with other local reference clocks and remote servers. Using these algorithms, the system clock can in principle be disciplined to a much finer resolution than the 125-<font face="Symbol">m</font>s sample interval would suggest, although the ultimate accuracy is probably limited by propagation delay variations as the ionspheric height varies throughout the day and night.</p> + <p>The codec clock frequency is disciplined during times when WWV/H signals are available. The algorithm refines the frequency offset using increasingly longer averaging intervals to 1024 s, where the precision is about 0.1 PPM. With good signals, it takes well over two hours to reach this degree of precision; however, it can take many more hours than this in case of marginal signals. Once reaching the limit, the algorithm will follow frequency variations due to temperature fluctuations and ionospheric height variations.</p> + <p>It may happen as the hours progress around the clock that WWV and WWVH signals may appear alone, together or not at all. When the driver has mitigated which station and frequency is best, it sets the reference identifier to the string WV<i>f</i> for WWV and WH<i>f</i> for WWVH, where <i>f</i> is the frequency in megahertz. If the propagation delays have been properly set with the <tt>fudge time1</tt> (WWV) and <tt>fudge time2</tt> (WWVH) commands in the configuration file, handover from one station to the other is seamless.</p> + <p>Once the clock has been set for the first time, it will appear reachable and selectable to discipline the system clock. Operation continues as long as the signal quality from at least one station on at least one frequency is acceptable. A consequence of this design is that, once the clock is set, the time and frequency are disciplined only by the second synch pulse and the clock digits themselves are driven by the clock state machine. If for some reason the state machine drifts to the wrong second, it would never reresynchronize. To protect against this most unlikely situation, if after two days with no signals, the clock is considered unset and resumes the synchronization procedure from the beginning.</p> + <p>However, as long as the clock has once been set correctly and allowed to converge to the intrinsic codec clock frequency, it will continue to read correctly even during the holdover interval, but with increasing dispersion. Assuming the clock frequency can be disciplined within 1 PPM, it can coast without signals for several days without exceeding the NTP step threshold of 128 ms. During such periods the root dispersion increases at 5 <font face="Symbol">m</font>s per second, which makes the driver appear less likely for selection as time goes on. Eventually, when the dispersion due all causes exceeds 1 s, it is no longer suitable for synchronization.</p> + <p>To work well, the driver needs a shortwave receiver with good audio response at 100 Hz. Most shortwave and communications receivers roll off the audio response below 250 Hz, so this can be a problem, especially with receivers using DSP technology, since DSP filters can have very fast rolloff outside the passband. Some DSP transceivers, in particular the ICOM 775, have a programmable low frequency cutoff which can be set as low as 80 Hz. However, this particular radio has a strong low frequency buzz at about 10 Hz which appears in the audio output and can affect data recovery under marginal conditions. Although not tested, it would seem very likely that a cheap shortwave receiver could function just as well as an expensive communications receiver.</p> + <h4>Autotune</h4> + <p>The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a serial port using a level converter such as the CT-17.</p> + <p>Each ICOM radio is assigned a unique 8-bit ID select code, usually expressed in hex format. To activate the CI-V interface, the <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies a nonzero select code in decimal format. A table of ID select codes for the known ICOM radios is given on the <a href="../audio.html">Reference Clock Audio Drivers</a> page. A missing <tt>mode</tt> keyword or a zero argument leaves the interface disabled.</p> + <p>If specified, the driver will attempt to open the device <tt>/dev/icom</tt> and, if successful will activate the autotune function and tune the radio to each operating frequency in turn while attempting to acquire minute synch from either WWV or WWVH. However, the driver is liberal in what it assumes of the configuration. If the <tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus or radio is inoperative, the driver quietly gives up with no harm done.</p> + <p>Once acquiring minute synch, the driver operates as described above to set the clock. However, during seconds 59, 0 and 1 of each minute it tunes the radio to one of the five broadcast frequencies to measure the minute synch pulse amplitude and SNR in second 0 and data pulse amplitude and SNR in second 1 to update the signal metric. In principle, the data pulse in second 58 is usable, but the AGC in most radios is not fast enough for a reliable measurement. Each of the five frequencies are probed in a five-minute rotation to build a database of current propagation conditions for all signals that can be heard at the time. At the end of each probe a mitigation procedure scans the database and retunes the radio to the best frequency and station found. For this to work well, the radio should be set for a fast AGC recovery time. This is most important while tracking a strong signal, which is normally the case, and then probing another frequency, which may have much weaker signals.</p> + <p>At the end of each probe, the frequency and station with the maximum metric is chosen, with ties going first to the highest frequency and then to WWV in order. A station is considered valid only if the metric is above a specified threshold' if below, the rotating probes continue until a valid station is found.</p> + <dl> + </dl> + <h4>Diagnostics</h4> + <p>The autotune process produces diagnostic information along with the timecode. This is very useful for evaluating the performance of the algorithms, as well as radio propagation conditions in general. The message is produced once each minute for each frequency in turn after minute synch has been acquired.</p> + <p><tt>wwv5 status agc epoch secamp/secsnr datamp/datsnr wwv wwvh</tt></p> + <p>where the fields after the <tt>wwv5</tt> identifier are: <tt>status</tt> contains status bits, <tt>agc</tt> audio gain, <tt>epoch </tt>second epoch, <tt>secamp/secsnr </tt>second pulse ampliture/SNR, and <tt>wwv</tt> and <tt>wwvh</tt> are two sets of fields, one each for WWV and WWVH. Each of the two fields has the format</p> + <p><tt>ident score metric minamp/minsnr</tt></p> + <p>where <tt>ident </tt>encodes the station (<tt>WV</tt> for WWV, <tt>WH</tt> for WWVH) and frequency (2, 5, 10, 15 or 20), <tt>score</tt> 32-bit shift register recording the hits (1) and misses (0) of the last 32 probes (hits and misses enter from the right), <tt>metric</tt> is described above, and <tt>minamp/minsnr</tt> minute pulse ampliture/SNR. An example is:</p> + <p><tt>wwv5 000d 111 5753 3967/20.1 3523/10.2 WV20 bdeff 100 8348/30.0 WH20 0000 1 22/-12.4</tt></p> + <p>There are several other messages that can occur; these are documented in the source listing.</p> + <h4>Debugging Aids</h4> + <p>The most convenient way to track the driver status is using the <tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays the last determined timecode and related status and error counters, even when the driver is not disciplining the system clock. If the debugging trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line)is enabled, the driver produces detailed status messages as it operates. If the <tt>fudge flag 4</tt> is set, these messages are written to the <tt>clockstats</tt> file. All messages produced by this driver have the prefix <tt>wwv</tt> for convenient filtering with the Unix <tt>grep</tt> command.</p> + <h4>Monitor Data</h4> + + When enabled by the <tt>filegen</tt> facility, every received timecode is written to the <tt>clockstats</tt> file in the following format: + <p><tt>sq yyyy ddd hh:mm:ss ld du lset agc ident metric errs freq avg<br> + s</tt> synch indicator (<tt>?</tt> or space) + <tt>q </tt>quality character (see below) + <tt>yyyy </tt>Gregorian year + <tt>ddd </tt>day of year + <tt>hh </tt>hour of day + <tt>mm </tt>minute of hour + <tt>l </tt>leap second warning <tt>L</tt> + <tt>d </tt>DST state <tt>S, D, I, O</tt><br> + <tt>dut </tt>DUT sign and magnitude + <tt>lset </tt>minutes since last set + <tt>agc </tt>audio gain + <tt>ident </tt>station identifier and frequency + <tt>metric </tt>signal metric (0-100) + <tt>errs </tt>data bit errors in last minute + <tt>freq </tt>codec frequency offset (PPM) + <tt>avg </tt>frequency averaging interval (s) +</p> + The fields beginning with <tt>year</tt> and extending through <tt>dut</tt> are decoded from the received data and are in fixed-length format. The <tt>agc</tt> and <tt>lset</tt> fields, as well as the following driver-dependent fields, are in variable-length format. + <dl> + <dt><tt>s</tt> + <dd>The synch indicator is initially <tt>?</tt> before the clock is set, but turns to space when all nine digits of the timecode are correctly set and the decoder is synchronized to the station within 125 <font face="Symbol">m</font>s. + <dt><tt>q</tt> + <dd>The quality character is a four-bit hexadecimal code showing which alarms have been raised. Each bit is associated with a specific alarm condition according to the following: + <dl> + <dt><tt>0x8</tt> + <dd>synch alarm. The decoder is not synchronized to the station within 125 <font face="Symbol">m</font>s. + <dt><tt>0x4</tt> + <dd>Digit error alarm. Less than nine decimal digits were found in the last minute.<dt><tt>0x2</tt> + <dd>Error alarm. More than 40 data bit errors were found in the last minute.<dt><tt>0x1</tt> + <dd>Compare alarm. A maximum likelihood digit failed to agree with the current associated clock digit in the last minute.</dl>It is important to note that one or more of the above alarms does not necessarily indicate a clock error, but only that the decoder has detected a condition that may result in an error. However, the local clock update is not suppressed if any alarm bits are set other than a synch alarm.<dt><tt>yyyy ddd hh:mm:ss</tt> + <dd>The timecode format itself is self explanatory. Since the driver latches the on-time epoch directly from the second synch pulse, the seconds fraction is always zero. Although the transmitted timecode includes only the year of century, the Gregorian year is augmented by 2000.<dt><tt>l</tt> + <dd>The leap second warning is normally space, but changes to <tt>L</tt> if a leap second is to occur at the end of the month of June or December. + <dt><tt>d</tt> + <dd>The DST state is <tt>S</tt> or <tt>D</tt> when standard time or daylight time is in effect, respectively. The state is <tt>I</tt> or <tt>O</tt> when daylight time is about to go into effect or out of effect, respectively. + <dt><tt>dut</tt> + <dd>The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds. + <dt><tt>lset</tt> + <dd>Before the clock is set, the interval since last set is the number of minutes since the driver was started; after the clock is set, this is number of minutes since the decoder was last synchronized to the station within 125 <font face="Symbol">m</font>s. + <dt><tt>agc</tt> + <dd>The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control should be set for a value midway in this range. + <dt><tt>ident</tt> + <dd>The station identifier shows the station, <tt>WV<i>f</i></tt> for WWV or <tt>WH<i>f</i></tt> for WWVH, and frequency <i><tt>f</tt></i> being tracked. If neither station is heard on any frequency, the reference identifier shows <tt>NONE</tt>. + <dt><tt>metric</tt> + <dd>The signal metric described above from 0 (no signal) to 100 (best). + <dt><tt>errs</tt> + <dd>The bit error counter is useful to determine the quality of the data signal received in the most recent minute. It is normal to drop a couple of data bits under good signal conditions and increasing numbers as conditions worsen. While the decoder performs moderately well even with half the bits are in error in any minute, usually by that point the metric drops below threshold and the decoder switches to a different frequency.<dt><tt>freq</tt> + <dd>The frequency offset is the current estimate of the codec frequency offset to within 0.1 PPM. This may wander a bit over the day due to local temperature fluctuations and propagation conditions. + <dt><tt>avgt</tt> + <dd>The averaging time is the interval between frequency updates in powers of two to a maximum of 1024 s. Attainment of the maximum indicates the driver is operating at the best possible resolution in time and frequency. + </dl> + <p>An example timecode is:</p> + <p><tt>0 2000 006 22:36:00 S +3 1 115 WV20 86 5 66.4 1024</tt></p> + <p>Here the clock has been set and no alarms are raised. The year, day and time are displayed along with no leap warning, standard time and DUT +0.3 s. The clock was set on the last minute, the AGC is safely in the middle ot the range 0-255, and the receiver is tracking WWV on 20 MHz. Good receiving conditions prevail, as indicated by the metric 86 and 5 bit errors during the last minute. The current frequency is 66.4 PPM and the averaging interval is 1024 s, indicating the maximum precision available.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the propagation delay for WWV (40:40:49.0N 105:02:27.0W), in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Specifies the propagation delay for WWVH (21:59:26.0N 159:46:00.0W), in seconds and fraction, with default 0.0. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Ordinarily, this field specifies the driver reference identifier; however, the driver sets the reference identifier automatically as described above. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port. + <dt><tt>flag3 0 | 1</tt> + <dd>Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver37.html b/contrib/ntp/html/drivers/driver37.html new file mode 100644 index 0000000..3bd5085 --- /dev/null +++ b/contrib/ntp/html/drivers/driver37.html @@ -0,0 +1,51 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Forum Graphic GPS Dating station</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Forum Graphic GPS Dating station</h3> + <hr> + <h4>Synopsis</h4> + <p>Address: 127.127.37.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS</tt><br> + Parallel Port: <tt>/dev/fgclock<i>u</i></tt></p> + <h4>Description</h4> + <p>This driver supports the Forum Graphic GPS Dating station sold by <a href="http://www.emr.fr/gpsclock.html">EMR company</a>.</p> + <p>Unfortunately sometime FG GPS start continues reporting of the same date. The only way to fix this problem is GPS power cycling and ntpd restart after GPS power-up.</p> + <p>After Jan,10 2000 my FG GPS unit start send a wrong answer after 10:00am till 11:00am. It repeat hour value in result string twice. I wroite a small code to avoid such problem. Unfortunately I have no second FG GPS unit to evaluate this problem. Please let me know if your GPS has no problems after Y2K.</p> + <p></p> + <h4>Monitor Data</h4> + <p>Each timecode is written to the <tt>clockstats</tt> file in the format <tt>YYYY YD HH MI SS</tt>.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>FG</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <hr> + <address>Dmitry Smirnov (das@amt.ru)</address> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver38.html b/contrib/ntp/html/drivers/driver38.html new file mode 100644 index 0000000..283e38f --- /dev/null +++ b/contrib/ntp/html/drivers/driver38.html @@ -0,0 +1,131 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>hopf clock drivers by ATLSoft</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> + <h1><font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2"> </font><font size="3">Serial Line Receivers (6021 and kompatible)</font></font></h1> + <hr> + <h2><font size="+1">Synopsis</font></h2> + <table width="100%"> + <tr> + <td> + <table bgcolor="#C0C0C0"> + <tr> + <td height="21"> + <div align="right"> + <tt>Address: </tt></div> + </td> + <td><b>127.127.38.<i>X</i></b></td> + </tr> + <tr> + <td height="1"> + <div align="right"> + <tt>Reference ID: </tt></div> + </td> + <td height="1"><a name="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td> + </tr> + <tr> + <td height="21"> + <div align="right"> + <tt>Driver ID: </tt></div> + </td> + <td height="21"><b>HOPF_S</b></td> + </tr> + <tr> + <td height="16"> + <div align="right"> + <tt>Serial Port: </tt></div> + </td> + <td height="16"><b>/dev/hopfclock<i>X</i></b></td> + </tr> + <tr> + <td height="23"> + <div align="right"> + <tt><font size="+1">Serial I/O</font>: </tt></div> + </td> + <td height="23"><b>9600 baud, 8-bits, 1-stop, no parity</b></td> + </tr> + </table> + </td> + <td align="center"><img src="../pic/fg6021.gif" alt="gif" height="207" width="238" border="0"></td> + </tr> + </table> + <hr> + <h2><font size="+1">Description</font></h2> + <p>The <b>refclock_hopf_serial</b> driver supports <a href="http://www.hopf.com">hopf electronic receivers</a> with serial Interface kompatibel 6021.<br> + </p> + <p>Additional software and information about the software drivers is available from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.<br> + </p> + <p>Latest NTP driver source, executables and documentation is maintained at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a></p> + <hr> + <h2><font size="+1">Operating System Compatibility</font></h2> + <p align="left">The hopf clock driver has been tested on the following software and hardware platforms:<br> </p> + <table bgcolor="#C0C0C0"> + <tr> + <td valign="CENTER" nowrap width="23%"> + <p align="left"><b>Platform</b></p> + </td> + <td valign="CENTER" nowrap> + <p align="left"><b>Operating System</b></p> + </td> + </tr> + <tr> + <td valign="CENTER" nowrap width="23%"> + <p align="left">i386 (PC) </p> + </td> + <td valign="CENTER" nowrap> + <p align="left">Linux</p> + </td> + </tr> + <tr> + <td nowrap> + <p align="left">i386 (PC) </p> + </td> + <td nowrap> + <p align="left">Windows NT</p> + </td> + </tr> + <tr> + <td nowrap> + <p align="left">i386 (PC) </p> + </td> + <center> + <td nowrap>Windows 2000</td> + </center> + </tr> + </table> + <hr> + <h2><font size="+1">O/S Serial Port Configuration</font></h2> + The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopfclock<i>X</i></a></tt></b> where <i><b>X</b></i> is the NTP refclock unit number as defined by the LSB of the refclock address. Valid refclock unit numbers are 0 - 3. + <p>The user is expected to provide a symbolic link to an available serial port device. This is typically performed by a command such as:</p> + <blockquote> + <tt>ln -s /dev/ttyS0 /dev/hopfclock0</tt></blockquote>Windows NT does not support symbolic links to device files. <br> + <b>COMx</b>: is used by the driver, based on the refclock unit number, where <b>unit 1</b> corresponds to <b>COM1</b>: and <b>unit 3</b> corresponds to <b>COM3</b>:<br> + <hr> + <h2><font size="+1">Fudge Factors</font></h2> + <dl> + <dt><b><a name="time1"></a><tt><font size="+1"><a href="#Configuration">time1 <i>time</i></a></font></tt></b> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. Should be set to 20 milliseconds to correct serial line and operating system delays incurred in capturing time stamps from the synchronous packets. + <dt><tt><font size="+1"><a href="#REFID"><b>refid <i>string</i></b></a></font></tt> + <dd>Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b>DCF</b>. + <dt><tt><font size="+1"><b>flag1 0 | 1</b></font></tt> + <dd>When set to 1, driver sync's even if only crystal driven. + </dl> + <hr> + <h2><a name="DataFormat"></a><font size="+1">Data Format</font></h2> + <p>as specified in clock manual under pt. <u>[ <span style="font-size:10.0pt;font-family: Arial;mso-fareast-font-family:"Times New Roman";mso-bidi-font-family:"Times New Roman"; mso-ansi-language:EN-GB;mso-fareast-language:DE;mso-bidi-language:AR-SA" lang="EN-GB"><b>Data String for NTP</b> ( <b><i>Network Time Protocol </i></b>) </span>]</u></p> + <hr> + <h3>Questions or Comments:</h3> + <p><a href="mailto:altmeier@atlsoft.de">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>Ing.-Büro für Software www.ATLSoft.de</a></p> + <p>(last updated 02/28/2001)<br> </p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver39.html b/contrib/ntp/html/drivers/driver39.html new file mode 100644 index 0000000..482134e --- /dev/null +++ b/contrib/ntp/html/drivers/driver39.html @@ -0,0 +1,113 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>hopf clock drivers by ATLSoft</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> + <h1><font face="Arial"><i><blink><font size="5">hopf</font></blink></i><font size="+2"> </font><font size="3">PCI-Bus Receiver (6039 GPS/DCF77)</font></font></h1> + <hr> + <div align="center"> + <center> + <table width="100%"> + <tr> + <td width="50%"> + <h2><font size="+1">Synopsis</font></h2> + <table bgcolor="#C0C0C0"> + <tr> + <td height="21"> + <div align="right"> + <tt>Address: </tt></div> + </td> + <td height="21"><b>127.127.39.<i>X</i></b></td> + </tr> + <tr> + <td height="21"> + <div align="right"> + <tt>Reference ID: </tt></div> + </td> + <td height="21"><a name="REFID"></a><b>.hopf. </b>(default)<b>, GPS, DCF</b></td> + </tr> + <tr> + <td height="21"> + <div align="right"> + <tt>Driver ID: </tt></div> + </td> + <td height="21"><b>HOPF_P</b></td> + </tr> + </table> + </td> + <td align="center" valign="middle"><font face="Arial"><i><blink><font size="5"><img src="../pic/fg6039.jpg" alt="gif" height="140" width="141" border="0"></font></blink></i></font></td> + </tr> + </table> + </center> + </div> + <hr> + <h2><font size="+1">Description</font></h2> + The <b>refclock_hopf_pci </b>driver supports the <a href="http://www.hopf.com">hopf</a> PCI-bus interface 6039 GPS/DCF77.<br> + Additional software and information about the software drivers maybe available from: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a>.<br> + Latest NTP driver source, executables and documentation is maintained at: <a href="http://www.ATLSoft.de/ntp">http://www.ATLSoft.de/ntp</a> + <hr> + <h2><font size="+1">Operating System Compatibility</font></h2> + <p align="left">The hopf clock driver has been tested on the following software and hardware platforms:<br> </p> + <table bgcolor="#C0C0C0"> + <tr> + <td valign="CENTER" nowrap width="23%"> + <p align="left"><b>Platform</b></p> + </td> + <td valign="CENTER" nowrap> + <p align="left"><b>Operating System</b></p> + </td> + </tr> + <tr> + <td valign="CENTER" nowrap width="23%"> + <p align="left">i386 (PC) </p> + </td> + <td valign="CENTER" nowrap> + <p align="left">Linux</p> + </td> + </tr> + <tr> + <td nowrap> + <p align="left">i386 (PC) </p> + </td> + <td nowrap> + <p align="left">Windows NT</p> + </td> + </tr> + <tr> + <td nowrap> + <p align="left">i386 (PC) </p> + </td> + <center> + <td nowrap>Windows 2000</td> + </center> + </tr> + </table> + <hr> + <h2><font size="+1">O/S System Configuration</font></h2> + <p><b>UNIX</b></p> + The driver attempts to open the device <b><tt><a href="#REFID">/dev/hopf6039</a></tt></b> . The device entry will be made by the installation process of the kernel module for the PCI-bus board. The driver sources belongs to the delivery equipment of the PCI-board. + <p><b>Windows NT/2000</b></p> + <p>The driver attempts to open the device by calling the function "OpenHopfDevice()". This function will be installed by the Device Driver for the PCI-bus board. The driver belongs to the delivery equipment of the PCI-board.</p> + <hr> + <h2><font size="+1">Fudge Factors</font></h2> + <dl> + <dt><tt><font size="+1"><a href="#REFID"><b>refid <i>string</i></b></a></font></tt> + <dd>Specifies the driver reference identifier, <b>GPS </b><i>or</i> <b>DCF</b>. + <dt><tt><font size="+1"><b>flag1 0 | 1</b></font></tt> + <dd>When set to 1, driver sync's even if only crystal driven. + </dl> + <hr> + <h3>Questions or Comments:</h3> + <p><a href="mailto:altmeier@atlsoft.de">Bernd Altmeier</a><a href="http://www.ATLSoft.de"><br>Ing.-Büro für Software www.ATLSoft.de</a></p> + <p>(last updated 03/02/2001)<br> </p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver4.html b/contrib/ntp/html/drivers/driver4.html new file mode 100644 index 0000000..bda4a10 --- /dev/null +++ b/contrib/ntp/html/drivers/driver4.html @@ -0,0 +1,66 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Spectracom 8170 and Netclock/2 WWVB Receivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Spectracom 8170 and Netclock/2 WWVB Receivers</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.4.<i>u</i><br> + Reference ID: <tt>WWVB</tt><br> + Driver ID: <tt>WWVB_SPEC</tt><br> + Serial Port: <tt>/dev/wwvb<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt> + <h4>Description</h4> + <p>This driver supports all known Spectracom radio and satellite clocks, including the Model 8170 and Netclock/2 WWVB Synchronized Clocks and the Netclock/GPS GPS Master Clock. The claimed accuracy of the WWVB clocks is 100 usec relative to the broadcast signal. These clocks have proven a reliable source of time, except in some parts of the country with high levels of conducted RF interference. WIth the GPS clock the claimed accuracy is 130 ns. However, in most cases the actual accuracy is limited by the precision of the timecode and the latencies of the serial interface and operating system.</p> + <p>The DIPswitches on these clocks should be set to 24-hour display, AUTO DST off, data format 0 or 2 (see below) and baud rate 9600. If this clock is used as the source for the IRIG Audio Decoder (<tt>refclock_irig.c</tt> in this distribution), set the DIPswitches for AM IRIG output and IRIG format 1 (IRIG B with signature control).</p> + <p>There are two timecode formats used by these clocks. Format 0, which is available with all clocks, and format 2, which is available with all clocks except the original (unmodified) Model 8170.</p> + <p>Format 0 (22 ASCII printing characters):<br> + <cr><lf>i ddd hh:mm:ss TZ=zz<cr><lf></p> + <p>on-time = first <cr><br> + i = synchronization flag (' ' = in synch, '?' = out synch)<br> + hh:mm:ss = hours, minutes, seconds</p> + <p>The alarm condition is indicated by other than ' ' at <tt>i</tt>, which occurs during initial synchronization and when received signal is lost for about ten hours.</p> + <p>Format 2 (24 ASCII printing characters):<br> + lt;cr>lf>iqyy ddd hh:mm:ss.fff ld</p> + <p>on-time = <cr><br> + i = synchronization flag (' ' = in synch, '?' = out synch)<br> + q = quality indicator (' ' = locked, 'A'...'D' = unlocked)<br> + yy = year (as broadcast)<br> + ddd = day of year<br> + hh:mm:ss.fff = hours, minutes, seconds, milliseconds</p> + <p>The alarm condition is indicated by other than ' ' at <tt>i</tt>, which occurs during initial synchronization and when received signal is lost for about ten hours. The unlock condition is indicated by other than ' ' at <tt>q</tt>.</p> + <p>The <tt>q</tt> is normally ' ' when the time error is less than 1 ms and a character in the set <tt>A...D</tt> when the time error is less than 10, 100, 500 and greater than 500 ms respectively. The <tt>l</tt> is normally ' ', but is set to <tt>L</tt> early in the month of an upcoming UTC leap second and reset to ' ' on the first day of the following month. The <tt>d</tt> is set to <tt>S</tt> for standard time <tt>S</tt>, <tt>I</tt> on the day preceding a switch to daylight time, <tt>D</tt> for daylight time and <tt>O</tt> on the day preceding a switch to standard time. The start bit of the first <cr> is synchronized to the indicated time as returned.</p> + <p>This driver does not need to be told which format is in use - it figures out which one from the length of the message. A three-stage median filter is used to reduce jitter and provide a dispersion measure. The driver makes no attempt to correct for the intrinsic jitter of the radio itself, which is a known problem with the older radios.</p> + <h4>Monitor Data</h4> + <p>The driver writes each timecode as received to the <tt>clockstats</tt> file. When enabled by the <tt>flag4</tt> fudge flag, a table of quality data maintained internally by the Netclock/2 is retrieved and written to the <tt>clockstats</tt> file when the first timecode message of a new dayis received.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>WWVB</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver40.html b/contrib/ntp/html/drivers/driver40.html new file mode 100644 index 0000000..54e1747 --- /dev/null +++ b/contrib/ntp/html/drivers/driver40.html @@ -0,0 +1,134 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html lang="en"> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>JJY Receivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>JJY Receivers</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.40.<i>u</i><br> + Reference ID: <tt>JJY</tt><br> + Driver ID: <tt>JJY</tt><br> + Serial Port: <tt>/dev/jjy<i>u</i></tt>; 9600 baud, 8-bits, no parity, 1 stop bit + <h4>Description</h4> + <p>This driver supports the following JJY receivers sold in Japan.</p> + <ul> + <li>Tristate Ltd. JJY01 <a href="http://www.tristate.ne.jp/">http://www.tristate.ne.jp/</a> (Japanese only)<br> + <dl> + <dt>Time code format + <dd><br> + <table> + <tr> + <td>Command</td> + <td> </td> + <td>Reply</td> + </tr> + <tr> + <td><tt>date<CR><LF></tt></td> + <td> </td> + <td><tt>YYYY/MM/DD WWW<CR><LF></tt></td> + </tr> + <tr> + <td><tt>stim<CR><LF></tt></td> + <td> </td> + <td><tt>HH:MM:SS<CR><LF></tt></td> + </tr> + </table> + <br> + <dt>NTP configuration ( ntp.conf ) + <dd> + <p>server 127.127.40.X mode 1</p> + <br> + </dl> + <li>C-DEX Co.,Ltd. JST2000 <a href="http://www.c-dex.co.jp/">http://www.c-dex.co.jp/</a> (Japanese only)<br> + <dl> + <dt>Time code format + <dd><br> + <table> + <tr> + <td>Command</td> + <td> </td> + <td>Reply</td> + </tr> + <tr> + <td><tt><ENQ>1J<ETX></tt></td> + <td> </td> + <td><tt><STX>JYYMMDD HHMMSSS<ETX></tt></td> + </tr> + </table> + <br> + <dt>NTP configuration ( ntp.conf ) + <dd> + <p>server 127.127.40.X mode 2</p> + <br> + </dl> + <li> + <p>Echo Keisokuki Co.,Ltd. LT-2000 <a href="http://www.clock.co.jp/">http://www.clock.co.jp/</a> (Japanese only)</p> + <dl> + <dt>Time code format + <dd><br> + <table summary="CommandAndReply"> + <tr> + <td>Command</td> + <td> </td> + <td>Reply</td> + </tr> + <tr> + <td><code>C</code></td> + <td></td> + <td>( Mode 2 : Continuous )</td> + </tr> + <tr> + <td></td> + <td></td> + <td><code>YYMMDDWHHMMSS<ST1><ST2><ST3><ST4><CR></code></td> + </tr> + <tr> + <td><code>#</code></td> + <td></td> + <td>( Mode 1 : Request&Send )</td> + </tr> + </table> + <br> + <dt>NTP configuration ( ntp.conf ) + <dd> + <p>server 127.127.40.X mode 3</p> + </dl> + </ul> + <p>JJY is the radio station which transmites the JST (Japan Standard Time) in long wave radio. The station JJY is operated by the National Institute of Information and Communications Technology. An operating announcement and some information are avaiable from <a href="http://www.nict.go.jp/">http://www.nict.go.jp/</a> (English and Japanese) and <a href="http://jjy.nict.go.jp/">http://jjy.nict.go.jp/</a> (English and Japanese)</p> + <p>The user is expected to provide a symbolic link to an available serial port device. This is typically performed by a command such as:</p> + <p><tt>ln -s /dev/ttyS0 /dev/jjy0</tt></p> + <p>Windows NT does not support symbolic links to device files. COM<i>X</i>: is the unit used by the driver, based on the refclock unit number, where unit 1 corresponds to COM1: and unit 3 corresponds to COM3:</p> + <h4>Monitor Data</h4> + <p>The driver writes each timecode as received to the <tt>clockstats</tt> file.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>JJY</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver42.html b/contrib/ntp/html/drivers/driver42.html new file mode 100644 index 0000000..7082050 --- /dev/null +++ b/contrib/ntp/html/drivers/driver42.html @@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Zyfer GPStarplus Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Zyfer GPStarplus Receiver</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.42.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>Zyfer GPStarplus</tt><br> + Serial Port: <tt>/dev/zyfer<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>(none)</tt> + <h4>Description</h4> + <p>This driver supports the <a href="http://www.zyfer.com/">Zyfer GPStarplus</a> receiver.</p> + <p>The receiver has a DB15 port on the back which has input TxD and RxD lines for configuration and control, and a separate TxD line for the once-per-second timestamp.</p> + <p>Additionally, there are BNC connectors on the back for things like PPS and IRIG output.</p> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver43.html b/contrib/ntp/html/drivers/driver43.html new file mode 100644 index 0000000..0e1553f --- /dev/null +++ b/contrib/ntp/html/drivers/driver43.html @@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>RIPE NCC interface for Trimble Palisade</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>RIPE NCC interface for Trimble Palisade</h3> + <hr> + <img src="../pic/driver43_2.jpg" alt="Trimble Acutime 2000" align="right"> + <h4>Synopsis</h4> + Address: 127.127.43.<i>u</i><br> + Reference ID: <tt>RIPENCC</tt><br> + Driver ID: <tt>RIPENCC</tt> + <h4>Description</h4> + <p>This is a special driver developed to be used in conjuction with the RIPE NCC clock card in the RIPE NCC Test Traffic Measurements project.</p> + <h4>Why this driver?</h4> + <p>The reason why we created a seperated driver for an antenna for which already a (vendor supplied) driver exist is a design decision. To be more specific, the standard Trimble interface uses a 12 pin connector. The cable sold by Trimble to connect to this wire is a very thick cable. Certainly not something you wish to run for several 100 meters through your building. And if you wanted to run it for 100 meters, you always would have to really run the cable, and didn't have the option to use existing wiring.<br> + </p> + <p>This is where we wanted more flexibility. We wanted to be able to use existing wiring in buildings. That leaded us to CAT-5(UTP) which only gives us 8 wires. Therefor we decided to redesing the use of the Trimble antenna. The Trimble supports two modes: EVENT driver and PPS mode. The default is to use the EVENT mode which needs all 12 wires. We only use the PPS timestamps for which we have enough with 8 wires. For our purposes this is more than fine.</p> + More information about the project can be found on the <a href="http://www.ripe.net/test-traffic" target="_new">Test Traffic Measurements</a> website. <img src="../pic/driver43_1.gif" alt="RIPE NCC clock card" align="right"> + <h4>RIPE NCC clock card</h4> + <p>The card is very a simple PCI card. The only feature on the bus it uses is the power supply. It uses this power supply to power the Trimble GPS antenna.</p> + <p>The card basicly just is a RS422 to RS232 converter. It gets the Trimble's RS422 signal on a RJ45 connector and transforms that to RS232 on a DIN9 connector. This connector should be loopbacked on the back of the machine to the serial port. As said, the card doesn't do any PCI data transfers.</p> + <p>The schematics of the interface card is available here: <a href="http://www.ripe.net/projects/ttm/Host_testbox/gps_if.pdf">gps_interface_schematic.pdf</a>. You are free to create this card yourself as long as you give some credit or reference to us. Note that we don't sell these cards on a commercial basis, but for interested parties we do have some spares to share.</p> + <p></p> + <h4>Monitor Data</h4> + <p>In the <tt>filegen clockstats</tt> file the following (example) data is collected:</p> + <pre> +52445 41931.275 127.127.40.0 U1 20.6.2002 11:38:51 13 11 +52445 41931.395 127.127.40.0 C1 20062002 113851 6 364785 110.2 450 6.7 13 5222.374737 N 0453.268013 E 48 7 11 0 1 -14 20 0 -25 +52445 41931.465 127.127.40.0 S1 07 1 1 02 59.3 291.5 39.3 +52445 41931.485 127.127.40.0 S1 11 2 1 02 59.9 138.0 60.2 +52445 41931.525 127.127.40.0 S1 01 4 1 02 48.4 185.7 28.3 +52445 41931.555 127.127.40.0 S1 14 5 2 02 32.7 41.0 15.4 +52445 41931.585 127.127.40.0 S1 20 6 1 02 59.9 256.6 78.0 +52445 41931.615 127.127.40.0 S1 25 8 2 00 0.0 86.6 20.1 +</pre> + <p>This is in the form of:</p> + <pre> +All output lines consist of a prefix and a message, the prefix is: +[days since epoch] [sec.ms since start of day] [peer address] + +And all individual messages: + +*Primary UTC time packet: +U1 [date] [time] [trackstat] [utcflags] + +*Comprehensive time packet: +C1 [date] [time] [mode] [bias] [biasunc] [rate] [rateunc] [utcoff] [latitude] [longtitude] [alt] [vis sat](x8) + +*Tracking status packet: +S1 [prn] [channel] [aqflag] [ephstat] [snr] [azinuth] [elevation] +</pre> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver44.html b/contrib/ntp/html/drivers/driver44.html new file mode 100755 index 0000000..d2cddb9 --- /dev/null +++ b/contrib/ntp/html/drivers/driver44.html @@ -0,0 +1,88 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+ +<html>
+ + <head> + <title>NeoClock4X</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + </head> + + <body> + <h1>NeoClock4X - DCF77 / TDF serial line receiver<br> + </h1> + <hr size="2" width="100%"> + <h2>Synopsis</h2> + <table width="100%"> + <tbody> + <tr> + <td valign="top"> + <table width="100%"> + <tbody> + <tr> + <td valign="top">Adress<br> + </td> + <td valign="top">127.127.44.u<br> + </td> + </tr> + <tr> + <td valign="top">Reference ID<br> + </td> + <td valign="top">neol<br> + </td> + </tr> + <tr> + <td valign="top">Driver ID<br> + </td> + <td valign="top">NEOCLK4X<br> + </td> + </tr> + <tr> + <td valign="top">Serial Port<br> + </td> + <td valign="top">/dev/neoclock4x-u<br> + </td> + </tr> + </tbody> + </table> + <br> + </td> + <td align="right" valign="top"><a href="http://www.linum.com"><img src="../pic/neoclock4x.gif" alt="NeoClock4X - DCF77 receiver" height="195" width="150"> </a><br> + </td> + </tr> + </tbody> + </table> + <hr size="2" width="100%"> + <h2>Description</h2> + The refclock_neoclock4x driver supports the NeoClock4X receiver available from <a href="http://www.linum.com">Linum Software GmbH</a>. The receiver is available as a <a href="http://www.dcf77.de">DCF77</a> or TDF receiver. Both receivers have the same output string. For more information about the NeoClock4X receiver please visit <a href="http://www.linux-funkuhr.de">http://www.linux-funkuhr.de</a>. + <hr size="2" width="100%"> + <h2>Fudge Factors</h2> + <dl> + <dt><b><a href="../clockopt.html">time1 time</a></b> + <dd>Specifies the time offset calibration factor with the default value off 0.16958333 seconds. This offset is used to correct serial line and operating system delays incurred in capturing time stamps. If you want to fudge the time1 offset <b>ALWAYS</b> add a value off 0.16958333. This is neccessary to compensate to delay that is caused by transmit the timestamp at 2400 Baud. If you want to compensate the delay that the DCF77 or TDF radio signal takes to travel to your site simply add the needed millisecond delay to the given value. Note that the time here is given in seconds. + <dd>Default setting is 0.16958333 seconds.<br> + </dl> + <dl> + <dt><b><a href="../clockopt.html">time2 time</a></b> + <dd>Not used by this driver. + </dl> + <dl> + <dt><a href="../clockopt.html"><b>flag1 0 | 1</b></a> + <dd>When set to 1 the driver will feed ntp with timestampe even if the radio signal is lost. In this case an internal backup clock generates the timestamps. This is ok as long as the receiver is synced once since the receiver is able to keep time for a long period. + <dd>Default setting is 0 = don't synchronize to CMOS clock. + <dt><a href="../clockopt.html"><b>flag2 0 | 1</b></a> + <dd>You can allow the NeoClock4X driver to use the quartz clock even if it is never synchronized to a radio clock. This is usally not a good idea if you want preceise timestamps since the CMOS clock is maybe not adjusted to a dst status change. So <b>PLEASE</b> switch this only on if you now what you're doing. + <dd>Default setting is 0 = don't synchronize to unsynchronized CMOS clock. + <dt><a href="../clockopt.html"><b>flag3 0 | 1</b></a> + <dd>Not used by this driver. + <dt><a href="../clockopt.html"><b>flag4 0 | 1</b></a> + <dd>It is recommended to allow extensive logging while you setup the NeoClock4X receiver. If you activate flag4 every received data is logged. You should turn off flag4 as soon as the clock works as expected to reduce logfile cluttering. + <dd>Default setting is 0 = don't log received data and converted utc time. + </dl> + <hr size="2" width="100%"> + Please send any comments or question to <a href="mailto:neoclock4@linum.com">neoclock4x@linum.com</a>. + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver5.html b/contrib/ntp/html/drivers/driver5.html new file mode 100644 index 0000000..1b539ac --- /dev/null +++ b/contrib/ntp/html/drivers/driver5.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <title>TrueTime GPS/GOES/OMEGA Receivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>TrueTime GPS/GOES/OMEGA Receivers</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.5.<i>u</i><br> + Reference ID: <tt>GPS, OMEGA, GOES</tt><br> + Driver ID: <tt>TRUETIME</tt><br> + Serial Port: <tt>/dev/true<i>u</i></tt>; 9600 baud, 8-bits, no parity<br> + Features: <tt>tty_clk</tt> + <h4>Description</h4> + <p>This driver supports several models models of Kinemetrics/TrueTime timing receivers, including 468-DC MK III GOES Synchronized Clock, GPS- DC MK III and GPS/TM-TMD GPS Synchronized Clock, XL-DC (a 151-602-210, reported by the driver as a GPS/TM-TMD), GPS-800 TCU (an 805-957 with the RS232 Talker/Listener module), OM-DC OMEGA Synchronized Clock, and very likely others in the same model family that use the same timecode formats.</p> + <p>Most of this code is originally from refclock_wwvb.c with thanks. It has been so mangled that wwvb is not a recognizable ancestor.</p> + <p>Timcode format: <tt>ADDD:HH:MM:SSQCL</tt> A - control A (this is stripped before we see it) Q - Quality indication (see below) C - Carriage return L - Line feed Quality codes indicate possible error of</p> + <dl> + <dt>468-DC GOES Receiver<br> + GPS-TM/TMD Receiver + <dd>? +/- 500 milliseconds # +/- 50 milliseconds<br> + * +/- 5 milliseconds . +/- 1 millisecond<br> + space less than 1 millisecond + <dt>OM-DC OMEGA Receiver: + <dd>> +/- 5 seconds<br> + ? +/- 500 milliseconds # +/- 50 milliseconds<br> + * +/- 5 milliseconds . +/- 1 millisecond<br> + A-H less than 1 millisecond. Character indicates which station is being received as follows<br> + A = Norway, B = Liberia, C = Hawaii, D = North Dakota, E = La Reunion, F = Argentina, G = Australia, H = Japan<br> + The carriage return start bit begins on 0 seconds and extends to 1 bit time. + </dl> + <h4>Notes on 468-DC and OMEGA receiver:</h4> + <p>Send the clock a <tt>R</tt> or <tt>C</tt> and once per second a timestamp will appear. Send a <tt>R</tt> to get the satellite position once (GOES only).</p> + <h4>Notes on the 468-DC receiver:</h4> + <p>Since the old east/west satellite locations are only historical, you can't set your clock propagation delay settings correctly and still use automatic mode. The manual says to use a compromise when setting the switches. This results in significant errors. The solution; use fudge time1 and time2 to incorporate corrections. If your clock is set for 50 and it should be 58 for using the west and 46 for using the east, use the line</p> + <p><tt>fudge 127.127.5.0 time1 +0.008 time2 -0.004</tt></p> + <p>This corrects the 4 milliseconds advance and 8 milliseconds retard needed. The software will ask the clock which satellite it sees.</p> + <p>The PCL720 from PC Labs has an Intel 8253 look-alike, as well as a bunch of TTL input and output pins, all brought out to the back panel. If you wire a PPS signal (such as the TTL PPS coming out of a GOES or other Kinemetrics/Truetime clock) to the 8253's GATE0, and then also wire the 8253's OUT0 to the PCL720's INPUT3.BIT0, then we can read CTR0 to get the number of microseconds since the last PPS upward edge, mediated by reading OUT0 to find out if the counter has wrapped around (this happens if more than 65535us (65ms) elapses between the PPS event and our being called.)</p> + <h4>Monitor Data</h4> + <p>When enabled by the <tt>flag4</tt> fudge flag, every received timecode is written as-is to the <tt>clockstats</tt> file.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, to be used for the West satellite, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>. Specifies the time offset calibration factor, in seconds and fraction, to be used for the East satellite, with default 0.0. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>TRUE</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Silence the clock side of ntpd, just reading the clock without trying to write to it. + <dt><tt>flag2 0 | 1</tt> + <dd>Generate a debug file /tmp/true%d. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver6.html b/contrib/ntp/html/drivers/driver6.html new file mode 100644 index 0000000..8a51f16 --- /dev/null +++ b/contrib/ntp/html/drivers/driver6.html @@ -0,0 +1,92 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>IRIG Audio Decoder</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>IRIG Audio Decoder</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.6.<i>u</i><br> + Reference ID: <tt>IRIG</tt><br> + Driver ID: <tt>IRIG_AUDIO</tt><br> + Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt> + <p>Note: This driver supersedes an older one of the same name, address and ID which required replacing the original kernel audio driver with another which worked only on older Sun SPARC architectures and SunOS operating systems. The new driver requires no modification of the operating system and works on FreeBSD, SunOS and Solaris. While it is generic and likely portable to other systems, it is somewhat slower than the original, since the extensive signal conditioning, filtering and decoding is done in user space, not kernel space.</p> + <h4>Description</h4> + <p>This driver supports the Inter-Range Instrumentation Group (IRIG) standard time distribution signal using the audio codec native to some workstations. This signal is generated by several radio clocks, including those made by Arbiter, Austron, Bancomm, Odetics, Spectracom and TrueTime, among others, although it is often an add-on option. The signal is connected via an optional attenuator box and cable to either the microphone or line-in port. The driver receives, demodulates and decodes the IRIG-B and IRIG-E signal formats using internal filters designed to reduce the effects of noise and interference.</p> + <p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver7.html">Radio CHU Audio Demodulator/Decoder</a> and the <a href="driver36.html">Radio WWV/H Audio Demodulator/Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p> + <p>The IRIG signal format uses an amplitude-modulated carrier with pulse-width modulated data bits. For IRIG-B, the carrier frequency is 1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is 100 Hz and bit rate 10 b/s. While IRIG-B provides the best accuracy, generally within a few tens of microseconds relative to IRIG time, it can also generate a significant load on the processor with older workstations. Generally, the accuracy with IRIG-E is about ten times worse than IRIG-B, but the processor load is ten times less.</p> + <p>The program processes 8000-Hz <font face="symbol">m</font>-law companded samples using separate signal filters for IRIG-B and IRIG-E, a comb filter, envelope detector and automatic threshold corrector. Cycle crossings relative to the corrected slice level determine the width of each pulse and its value - zero, one or position identifier. The data encode 20 BCD digits which determine the second, minute, hour and day of the year and sometimes the year and synchronization condition. The comb filter exponentially averages the corresponding samples of successive baud intervals in order to reliably identify the reference carrier cycle. A type-II phase-lock loop (PLL) performs additional integration and interpolation to accurately determine the zero crossing of that cycle, which determines the reference timestamp. A pulse-width discriminator demodulates the data pulses, which are then encoded as the BCD digits of the timecode. The timecode and reference timestamp are updated once each second with IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved for later processing. At poll intervals of 64 s, the saved samples are processed by a trimmed-mean filter and used to update the system clock.</p> + <p>Infinite impulse response (IIR) filters are used with both IRIG-B and IRIG-E formats. An 800-Hz highpass filter is used for IRIG-B and a 130-Hz lowpass filter for IRIG-E. These are intended for use with noisy signals, such as might be received over a telephone line or radio circuit, or when interfering signals may be present in the audio passband. The driver determines which IRIG format is in use by sampling the amplitude of each filter output and selecting the one with maximum signal. An automatic gain control feature provides protection against overdriven or underdriven input signal amplitudes. It is designed to maintain adequate demodulator signal amplitude while avoiding occasional noise spikes. In order to assure reliable capture, the decompanded input signal amplitude must be greater than 100 units and the codec sample frequency error less than 250 PPM (.025 percent).</p> + <p>The program performs a number of error checks to protect against overdriven or underdriven input signal levels, incorrect signal format or improper hardware configuration. The specific checks are detailed later in this page. Note that additional checks are done elsewhere in the reference clock interface routines.</p> + <p>Unlike other drivers, which can have multiple instantiations, this one supports only one. It does not seem likely that more than one audio codec would be useful in a single machine. More than one would probably chew up too much CPU time anyway.</p> + <h4>IRIG-B Timecode Format</h4> + <p>The 100 elements of the IRIG timecode are numbered from 0 through 99. Position identifiers occur at elements 0, 9, 19 and every ten thereafter to 99. The control function (CF) elements begin at element 50 (CF 1) and extend to element 78 (CF 27). The straight-binary-seconds (SBS) field, which encodes the seconds of the UTC day, begins at element 80 (CF 28) and extends to element 97 (CF 44). The encoding of elements 50 (CF 1) through 78 (CF 27) is device dependent. This driver presently decodes the CF elements, but does nothing with them.</p> + <p>Where feasible, the IRIG signal source should be operated with signature control so that, if the signal is lost or mutilated, the source produces an unmodulated signal, rather than possibly random digits. The driver will automatically reject the data and declare itself unsynchronized in this case. Some devices, in particular Spectracom radio/satellite clocks, provide additional year and status indication in the format:</p> + <pre> + Element CF Function + ------------------------------------- + 55 6 time sync status + 60-63 10-13 BCD year units + 65-68 15-18 BCD year tens +</pre> + Other devices set these elements to zero. + <h4>Performance and Horror Stories</h4> + <p>The <font face="symbol">m</font>-law companded data format allows considerable latitude in signal levels; however, an automatic gain control (AGC) function is implemented to further compensate for varying input signal levels and to avoid signal distortion. For proper operation, the IRIG signal source should be configured for analog signal levels, NOT digital TTL levels.</p> + <p>The accuracy of the system clock synchronized to the IRIG-B source with this driver and the <tt>ntpd</tt> daemon is 10-20 <font face="symbol">m</font>s with a Sun UltraSPARC II running Solaris 2.6 and maybe twice that with a Sun SPARC IPC running SunOS 4.1.3. Be however acutely aware that the accuracy with Solaris 2.8 and presumably beyond has seriously degraded to the order of several milliseconds. The Sun kernel driver has a sawtooth modulation with amplitude over 5 ms peak-peak and period 5.5 s. The crafty IRIG driver uses a transverse filter to remove the modulation and something called a botttom-fisher to remove incidental positive spikes especially prevalent with Sun Blade 1000 and possibly other systems. The result is nominal accuracy and jitter something less than 0.5 ms, but the this is still far inferior to the performance with older systems.</p> + <p>The processor resources consumed by the daemon can be significant, ranging from about 1.2 percent on the faster UltraSPARC II to 38 percent on the slower SPARC IPC. However, the overall timing accuracy is limited by the resolution and stability of the CPU clock oscillator and the interval between clock corrections, which is 64 s with this driver. This performance, while probably the best that can be achieved by the daemon itself, can be improved with assist from the PPS discipline as described elsewhere in this documentation.</p> + <h4>Autotune</h4> + <p>The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a serial port using a level converter such as the CT-17.</p> + <p>Each ICOM radio is assigned a unique 8-bit ID select code, usually expressed in hex format. To activate the CI-V interface, the <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies a nonzero select code in decimal format. A table of ID select codes for the known ICOM radios is given on the <a href="../audio.html">Reference Clock Audio Drivers</a> page. A missing <tt>mode</tt> keyword or a zero argument leaves the interface disabled.</p> + <p>If specified, the driver will attempt to open the device <tt>/dev/icom</tt> and, if successful will activate the autotune function and tune the radio to each operating frequency in turn while attempting to acquire minute sync from CHU. However, the driver is liberal in what it assumes of the configuration. If the <tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus or radio is inoperative, the driver quietly gives up with no harm done.</p> + <h4>Monitor Data</h4> + The timecode format used for debugging and data recording includes data helpful in diagnosing problems with the IRIG signal and codec connections. With debugging enabled (-d on the ntpd command line), the driver produces one line for each timecode in the following format: + <p><tt>00 1 98 23 19:26:52 721 143 0.694 47 20 0.083 66.5 3094572411.00027</tt></p> + <p>The first field containes the error flags in hex, where the hex bits are interpreted as below. This is followed by the IRIG status indicator, year of century, day of year and time of day. The status indicator and year are not produced by some IRIG devices. Following these fields are the carrier amplitude (0-8100), codec gain (0-255), field phase (0-79), time constant (2-20), modulation index (0-1), carrier phase error (0±0.5) and carrier frequency error (PPM). The last field is the on-time timestamp in NTP format. The fraction part is a good indicator of how well the driver is doing. With an UltrSPARC 30, this is normally within a few tens of microseconds relative to the IRIG-B signal and within a few hundred microseconds with IRIG-E.</p> + <p>The error flags are defined as follows in hex:</p> + <dl> + <dt><tt>x01</tt> + <dd>Low signal. The carrier amplitude is less than 100 units. This is usually the result of no signal or wrong input port. + <dt><tt>x02</tt> + <dd>Frequency error. The codec frequency error is greater than 250 PPM. This may be due to wrong signal format or (rarely) defective codec. + <dt><tt>x04</tt> + <dd>Modulation error. The IRIG modulation index is less than 0.5. This is usually the result of an overdriven codec, wrong signal format or wrong input port. + <dt><tt>x08</tt> + <dd>Frame synch error. The decoder frame does not match the IRIG frame. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal. It may also be the result of an IRIG signature check which indicates a failure of the IRIG signal synchronization source. + <dt><tt>x10</tt> + <dd>Data bit error. The data bit length is out of tolerance. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal. + <dt><tt>x20</tt> + <dd>Seconds numbering discrepancy. The decoder second does not match the IRIG second. This is usually the result of an overdriven codec, wrong signal format or noisy IRIG signal. + <dt><tt>x40</tt> + <dd>Codec error (overrun). The machine is not fast enough to keep up with the codec. + </dl> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>IRIG</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Specifies the microphone port if set to zero or the line-in port if set to one. It does not seem useful to specify the compact disc player port. + <dt><tt>flag3 0 | 1</tt> + <dd>Enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver7.html b/contrib/ntp/html/drivers/driver7.html new file mode 100644 index 0000000..8e050e7 --- /dev/null +++ b/contrib/ntp/html/drivers/driver7.html @@ -0,0 +1,234 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Radio CHU Audio Demodulator/Decoder</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Radio CHU Audio Demodulator/Decoder</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.7.<i>u</i><br> + Reference ID: <tt>CHU</tt><br> + Driver ID: <tt>CHU</tt><br> + Modem Port: <tt>/dev/chu<i>u</i></tt>; 300 baud, 8-bits, no parity<br> + Autotune Port: <tt>/dev/icom</tt>; 1200/9600 baud, 8-bits, no parity<br> + Audio Device: <tt>/dev/chu_audio</tt> and <tt>/dev/audioctl</tt> + <h4>Description</h4> + <p>This driver synchronizes the computer time using data encoded in radio transmissions from Canadian time/frequency station CHU in Ottawa, Ontario. It replaces an earlier one, built by Dennis Ferguson in 1988, which required a special line discipline to preprocessed the signal. The new driver includes more powerful algorithms implemented directly in the driver and requires no preprocessing.</p> + <p>CHU transmissions are made continuously on 3330 kHz, 7335 kHz and 14670 kHz in upper sideband, compatible AM mode. An ordinary shortwave receiver can be tuned manually to one of these frequencies or, in the case of ICOM receivers, the receiver can be tuned automatically as propagation conditions change throughout the day and night. The performance of this driver when tracking the station is ordinarily better than 1 ms in time with frequency drift less than 0.5 PPM when not tracking the station.</p> + <p>While there are currently no known commercial CHU receivers, a simple but effective receiver/demodulator can be constructed from an ordinary shortwave receiver and Bell 103 compatible, 300-b/s modem or modem chip, as described on the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. The driver can use the modem to receive the radio signal and demodulate the data or, if available, the driver can use the audio codec of the Sun workstation or another with compatible audio interface. In the latter case, the driver implements the modem using DSP routines, so the radio can be connected directly to either the microphone or line input port.</p> + <p>This driver incorporates several features in common with other audio drivers such as described in the <a href="driver36.html">Radio WWV/H Audio Demodulator/Decoder</a> and the <a href="driver6.html">IRIG Audio Decoder</a> pages. They include automatic gain control (AGC), selectable audio codec port and signal monitoring capabilities. For a discussion of these common features, as well as a guide to hookup, debugging and monitoring, see the <a href="../audio.html">Reference Clock Audio Drivers</a> page.</p> + <p>Ordinarily, the driver poll interval is set to 14 (about 4.5 h), although this can be changed with configuration commands. As long as the clock is set or verified at least once during this interval, the NTP algorithms will consider the source reachable and selectable to discipline the system clock. However, if this does not happen for eight poll intervals, the algorithms will consider the source unreachable and some other source will be chosen (if available) to discipline the system clock.</p> + <p>The decoding algorithms process the data using maximum-likelihood techniques which exploit the considerable degree of redundancy available in each broadcast message or burst. As described below, every character is sent twice and, in the case of format A bursts, the burst is sent eight times every minute. In the case of format B bursts, which are sent once each minute, the burst is considered correct only if every character matches its repetition in the burst. In the case of format A messages, a majority decoder requires at least six repetitions for each digit in the timecode and more than half of the repetitions decode to the same digit. Every character in every burst provides an independent timestamp upon arrival with a potential total of over 60 timestamps for each minute.</p> + <p>A timecode in the format described below is assembled when all bursts have been received in the minute. The timecode is considered valid and the clock set when at least one valid format B burst has been decoded and the above requirements are met. The <tt>yyyy</tt> year field in the timecode indicates whether a valid format B burst has been received. Upon startup, this field is initialized at zero; when a valid format B burst is received, it is set to the current Gregorian year. The <tt>q</tt> quality character field in the timecode indicates whether a valid timecode has been determined. If any of the high order three bits of this character are set, the timecode is invalid.</p> + <p>Once the clock has been set for the first time, it will appear reachable and selectable to discipline the system clock, even if the broadcast signal is lost. Since the signals are almost always available during some period of the day and the NTP clock discipline algorithms are designed to work well even in this case, it is unlikely that the system clock could drift more than a few tens of milliseconds during periods of signal loss. To protect against this most unlikely situation, if after four days with no signals, the clock is considered unset and resumes the synchronization procedure from the beginning.</p> + <p>The last three fields in the timecode are useful in assessing the quality of the radio channel during the most recent minute bursts were received. The <tt>bcnt</tt> field shows the number of format A bursts in the range 1-8. The <tt>dist</tt> field shows the majority decoder distance, or the minimum number of sample repetitions for each digit of the timecode in the range 0-16. The <tt>tsmp</tt> field shows the number of timestamps determined in the range 0-60. For a valid timecode, <tt>bcnt</tt> must be at least 3, <tt>dist</tt> must be greater than <tt>bcnt</tt> and <tt>tsmp</tt> must be at least 20.</p> + <h4>Program Operation</h4> + <p>The program consists of four major parts: the DSP modem, maximum likelihood UART, burst assembler and majority decoder. The DSP modem demodulates Bell 103 modem answer-frequency signals; that is, frequency-shift keyed (FSK) tones of 2225 Hz (mark) and 2025 Hz (space). This is done using a 4th-order IIR filter and limiter/discriminator with 500-Hz bandpass centered on 2125 Hz and followed by a FIR raised-cosine lowpass filter optimized for the 300-b/s data rate. Alternately, the driver can be compiled to delete the modem and input 300 b/s data directly from an external modem via a serial port.</p> + <p>The maximum likelihood UART is implemented using a set of eight 11-stage shift registers, one for each of eight phases of the 300-b/s bit clock. At each phase a new baseband signal value from the DSP modem is shifted into the corresponding register and the maximum and minimum over all 11 samples computed. This establishes a slice level midway between the maximum and minimum over all stages. For each stage, a signal level above this level is a mark (1) and below is a space (0). A quality metric is calculated for each register with respect to the slice level and the a-priori signal consisting of a mark bit (previous stop bit), space (start) bit, eight arbitrary information bits and the first of the two mark (stop) bits.</p> + <p>The shift registers are processed in round-robin order as each modem value arrives until one of them shows a valid framing pattern consisting of a mark bit, space bit, eight arbitrary data bits and a mark bit. When found, the data bits from the register with the best metric is chosen as the maximum likelihood character and the UART begins to process the next character.</p> + <p>The burst assembler processes characters either from the maximum likelihood UART or directly from the serial port as configured. A burst begins when a character is received and is processed after a timeout interval when no characters are received. If the interval between characters is greater than two characters, but less than the timeout interval, the burst is rejected as a runt and a new burst begun. As each character is received, a timestamp is captured and saved for later processing.</p> + <p>A valid burst consists of ten characters in two replicated five-character blocks. A format B block contains the year and other information in ten hexadecimal digits. A format A block contains the timecode in ten decimal digits, the first of which is a framing code (6). The burst assembler must deal with cases where the first character of a format A burst is lost or is noise. This is done using the framing code to correct the phase, either one character early or one character late.</p> + <p>The burst distance is incremented by one for each bit in the first block that matches the corresponding bit in the second block and decremented by one otherwise. In a format B burst the second block is bit-inverted relative to the first, so a perfect burst of five 8-bit characters has distance -40. In a format A block the two blocks are identical, so a perfect burst has distance +40. Format B bursts must be perfect to be acceptable; however, format A bursts, which are further processed by the majority decoder, are acceptable if the distance is at least 28.</p> + <p>Each minute of transmission includes eight format A bursts containing two timecodes for each second from 31 through 39. The majority decoder uses a decoding matrix of ten rows, one for each digit position in the timecode, and 16 columns, one for each 4-bit code combination that might be decoded at that position. In order to use the character timestamps, it is necessary to reliably determine the second number of each burst. In a valid burst, the last digit of the two timecodes in the block must match and the value must be in the range 2-9 and greater than in the previous burst.</p> + <p>As each hex digit of a valid burst is processed, the value at the row corresponding to the digit position in the timecode and column corresponding to the code found at that position is incremented. At the end of each minute of transmission, each row of the decoding matrix encodes the number of occurrences of each code found at the corresponding position of the timecode. However, the first digit (framing code) is always 6, the ninth (second tens) is always 3 and the last (second units) changes for each burst, so are not used.</p> + <p>The maximum over all occurrences at each timecode digit position is the distance for that position and the corresponding code is the maximum likelihood candidate. If the distance is zero, the decoder assumes a miss; if the distance is not more than half the total number of occurrences, the decoder assumes a soft error; if two different codes with the same distance are found, the decoder assumes a hard error. In all these cases the decoder encodes a non-decimal character which will later cause a format error when the timecode is reformatted. The decoding distance is defined as the minimum distance over the first nine digits; the tenth digit varies over the seconds and is uncounted.</p> + <p>The result of the majority decoder is a nine-digit timecode representing the maximum likelihood candidate for the transmitted timecode in that minute. Note that the second and fraction within the minute are always zero and that the actual reference point to calculate timestamp offsets is backdated to the first second of the minute. At this point the timecode block is reformatted and the year, days, hours and minutes extracted along with other information from the format B burst, including DST state, DUT1 correction and leap warning. The reformatting operation checks the timecode for invalid code combinations that might have been left by the majority decoder and rejects the entire timecode if found.</p> + <p>If the timecode is valid, it is passed to the reference clock interface along with the backdated timestamp offsets accumulated over the minute. A perfect set of nine bursts could generate as many as 90 timestamps, but the maximum the interface can handle is 60. These are processed by the interface using a median filter and trimmed-mean average, so the resulting system clock correction is usually much better than would otherwise be the case with radio noise, UART jitter and occasional burst errors.</p> + <h4>Autotune</h4> + <p>The driver includes provisions to automatically tune the radio in response to changing radio propagation conditions throughout the day and night. The radio interface is compatible with the ICOM CI-V standard, which is a bidirectional serial bus operating at TTL levels. The bus can be connected to a standard serial port using a level converter such as the CT-17.</p> + <p>Each ICOM radio is assigned a unique 8-bit ID select code, usually expressed in hex format. To activate the CI-V interface, the <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies a nonzero select code in decimal format. A table of ID select codes for the known ICOM radios is given below. Since all ICOM select codes are less than 128, the high order bit of the code is used by the driver to specify the baud rate. If this bit is not set, the rate is 9600 bps for the newer radios; if set, the rate is 1200 bps for the older radios. A missing <tt>mode</tt> keyword or a zero argument leaves the interface disabled.</p> + <p>If specified, the driver will attempt to open the device <tt>/dev/icom</tt> and, if successful will tune the radio to 3.330 MHz. If after five minutes at this frequency not more than two format A bursts have been received for any minute, the driver will tune to 7.335 MHz, then to 14.670 MHz, then return to 3.330 MHz and continue in this cycle. However, the driver is liberal in what it assumes of the configuration. If the <tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus or radio is inoperative, the driver quietly gives up with no harm done.</p> + <h4>Radio Broadcast Format</h4> + <p>The CHU time broadcast includes an audio signal compatible with the Bell 103 modem standard (mark = 2225 Hz, space = 2025 Hz). It consist of nine, ten-character bursts transmitted at 300 b/s and beginning each second from second 31 to second 39 of the minute. Each character consists of eight data bits plus one start bit and two stop bits to encode two hex digits. The burst data consist of five characters (ten hex digits) followed by a repeat of these characters. In format A, the characters are repeated in the same polarity; in format B, the characters are repeated in the opposite polarity.</p> + <p>Format A bursts are sent at seconds 32 through 39 of the minute in hex digits</p> + <p><tt>6dddhhmmss6dddhhmmss</tt></p> + <p>The first ten digits encode a frame marker (<tt>6</tt>) followed by the day (<tt>ddd</tt>), hour (<tt>hh</tt>), minute (<tt>mm</tt>) and second (<tt>ss</tt>). Since format A bursts are sent during the third decade of seconds the tens digit of <tt>ss</tt> is always 3. The driver uses this to determine correct burst synchronization. These digits are then repeated with the same polarity.</p> + <p>Format B bursts are sent at second 31 of the minute in hex digits</p> + <p><tt>xdyyyyttaaxdyyyyttaa</tt></p> + <p>The first ten digits encode a code (<tt>x</tt> described below) followed by the DUT1 (<tt>d</tt> in deciseconds), Gregorian year (<tt>yyyy</tt>), difference TAI - UTC (<tt>tt</tt>) and daylight time indicator (<tt>aa</tt>) peculiar to Canada. These digits are then repeated with inverted polarity.</p> + <p>The <tt>x</tt> is coded</p> + <dl> + <dt><tt>1</tt> + <dd>Sign of DUT (0 = +)/dd> + <dt><tt>2</tt> + <dd>Leap second warning. One second will be added. + <dt><tt>4</tt> + <dd>Leap second warning. One second will be subtracted. This is not likely to happen in our universe. + <dt><tt>8</tt> + <dd>Even parity bit for this nibble. + </dl> + <p>By design, the last stop bit of the last character in the burst coincides with 0.5 second. Since characters have 11 bits and are transmitted at 300 b/s, the last stop bit of the first character coincides with 0.5 - 10 * 11/300 = 0.133 second. Depending on the UART, character interrupts can vary somewhere between the beginning of bit 9 and end of bit 11. These eccentricities can be corrected along with the radio propagation delay using the <tt>fudge time1</tt> variable.</p> + <h4>Debugging Aids</h4> + <p>The most convenient way to track the program status is using the <tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays the last determined timecode and related status and error counters, even when the program is not discipline the system clock. If the debugging trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line)is enabled, the program produces detailed status messages as it operates. If the <tt>fudge flag 4</tt> is set, these messages are written to the <tt>clockstats</tt> file. All messages produced by this driver have the prefix <tt>chu</tt> for convenient filtering with the Unix <tt>grep</tt> command.</p> + <p>With debugging enabled the driver produces messages in the following formats:</p> + <p>A format <tt>chuA</tt> message is produced for each format A burst received in seconds 32 through 39 of the minute:</p> + <p><tt>chuA n b s code</tt></p> + <p>where <tt>n</tt> is the number of characters in the burst (0-11), <tt>b</tt> the burst distance (0-40), <tt>s</tt> the synchronization distance (0-40) and <tt>code</tt> the burst characters as received. Note that the hex digits in each character are reversed and the last ten digits inverted, so the burst</p> + <p><tt>11 40 1091891300ef6e76ecff</tt></p> + <p>is interpreted as containing 11 characters with burst distance 40. The nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI -UTC 31 seconds.</p> + <p>A format <tt>chuB</tt> message is produced for each format B burst received in second 31 of the minute:</p> + <p><tt>chuB n b f s m code</tt></p> + <p>where <tt>n</tt> is the number of characters in the burst (0-11), <tt>b</tt> the burst distance (0-40), <tt>f</tt> the field alignment (-1, 0, 1), <tt>s</tt>the synchronization distance (0-16), <tt>m</tt>the burst number (2-9) and <tt>code</tt> the burst characters as received. Note that the hex digits in each character are reversed, so the burst</p> + <p><tt>10 38 0 16 9 06851292930685129293</tt></p> + <p>is interpreted as containing 11 characters with burst distance 38, field alignment 0, synchronization distance 16 and burst number 9. The nibble-swapped timecode shows day 58, hour 21, minute 29 and second 39.</p> + <p>If the CI-V interface for ICOM radios is active, a debug level greater than 1 will produce a trace of the CI-V command and response messages. Interpretation of these messages requires knowledge of the CI-V protocol, which is beyond the scope of this document.</p> + <h4>Monitor Data</h4> + When enabled by the <tt>filegen</tt> facility, every received timecode is written to the <tt>clockstats</tt> file in the following format: + <pre> + sq yy ddd hh:mm:ss.fff ld dut lset agc rfrq bcnt dist tsmp + + s sync indicator + q quality character + yyyy Gregorian year + ddd day of year + hh hour of day + mm minute of hour + ss second of minute + fff millisecond of second + l leap second warning + d DST state + dut DUT sign and magnitude in deciseconds + lset minutes since last set + agc audio gain (0-255) + rfrq radio frequency + bcnt burst count + dist decoding distance + tsmp timestamps captured +</pre> + The fields beginning with <tt>year</tt> and extending through <tt>dut</tt> are decoded from the received data and are in fixed-length format. The <tt>agc</tt> and <tt>lset</tt> fields, as well as the following driver-dependent fields, are in variable-length format. + <dl> + <dt><tt>s</tt> + <dd>The sync indicator is initially <tt>?</tt> before the clock is set, but turns to space when the clock is correctly set. + <dt><tt>q</tt> + <dd>The quality character is a four-bit hexadecimal code showing which alarms have been raised during the most recent minute. Each bit is associated with a specific alarm condition according to the following: + <dl> + <dt><tt>8</tt> + <dd>Decoder alarm. A majority of repetitions for at least one digit of the timecode fails to agree. + <dt><tt>4</tt> + <dd>Timestamp alarm. Fewer than 20 timestamps have been determined. + <dt><tt>2</tt> + <dd>Format alarm. The majority timecode contains invalid bit combinations. + <dt><tt>1</tt> + <dd>Frame alarm. A framing or format error occurred on at least one burst during the minute. + </dl> + <p>It is important to note that one or more of the above alarms does not necessarily indicate a clock error, but only that the decoder has detected a condition that may in future result in an error.</p> + <dt><tt>yyyy ddd hh:mm:ss.fff</tt> + <dd>The timecode format itself is self explanatory. Note that the Gregorian year is decoded directly from the transmitted timecode. + <dt><tt>l</tt> + <dd>The leap second warning is normally space, but changes to <tt>L</tt> if a leap second is to occur at the end of the month of June or December. + <dt><tt>d</tt> + <dd>The DST code for Canada encodes the state for all provinces. + <dt><tt>dut</tt> + <dd>The DUT sign and magnitude shows the current UT1 offset relative to the displayed UTC time, in deciseconds. + <dt><tt>lset</tt> + <dd>Before the clock is set, the interval since last set is the number of minutes since the program was started; after the clock is set, this is number of minutes since the time was last verified relative to the broadcast signal. + <dt><tt>agc</tt> + <dd>The audio gain shows the current codec gain setting in the range 0 to 255. Ordinarily, the receiver audio gain control or IRIG level control should be set for a value midway in this range. + <dt><tt>rfrq</tt> + <dd>The current radio frequency, if the CI-V interface is active, or 'X' if not. + <dt><tt>bcnt</tt> + <dd>The number of format A bursts received during the most recent minute bursts were received. + <dt><tt>dist</tt> + <dd>The minimum decoding distance determined during the most recent minute bursts were received. + <dt><tt>tsmp</tt> + <dd>The number of timestamps determined during the most recent minute bursts were received. + </dl> + <h4>Modes</h4> + <p>The <tt>mode</tt> keyword of the <tt>server</tt> configuration command specifies the ICOM ID select code. A missing or zero argument disables the CI-V interface. Following are the ID select codes for the known radios.</p> + <table width="100%" cols="6"> + <tr> + <td>Radio</td> + <td>Hex</td> + <td>Decimal</td> + <td>Radio</td> + <td>Hex</td> + <td>Decimal</td> + </tr> + <tr> + <td>IC725</td> + <td>0x28</td> + <td>40</td> + <td>IC781</td> + <td>0x26</td> + <td>38</td> + </tr> + <tr> + <td>IC726</td> + <td>0x30</td> + <td>48</td> + <td>R7000</td> + <td>0x08</td> + <td>8</td> + </tr> + <tr> + <td>IC735</td> + <td>0x04</td> + <td>4</td> + <td>R71</td> + <td>0x1A</td> + <td>26</td> + </tr> + <tr> + <td>IC751</td> + <td>0x1c</td> + <td>28</td> + <td>R7100</td> + <td>0x34</td> + <td>52</td> + </tr> + <tr> + <td>IC761</td> + <td>0x1e</td> + <td>30</td> + <td>R72</td> + <td>0x32</td> + <td>50</td> + </tr> + <tr> + <td>IC765</td> + <td>0x2c</td> + <td>44</td> + <td>R8500</td> + <td>0x4a</td> + <td>74</td> + </tr> + <tr> + <td>IC775</td> + <td>0x46</td> + <td>68</td> + <td>R9000</td> + <td>0x2a</td> + <td>42</td> + </tr> + </table> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the propagation delay for CHU (45:18N 75:45N), in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>CHU</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>When the audio driver is compiled, this flag selects the audio input port, where 0 is the mike port (default) and 1 is the line-in port. It does not seem useful to select the compact disc player port. + <dt><tt>flag3 0 | 1</tt> + <dd>When the audio driver is compiled, this flag enables audio monitoring of the input signal. For this purpose, the speaker volume must be set before the driver is started. + <dt><tt>flag4 0 | 1</tt> + <dd>Enable verbose <tt>clockstats</tt> recording if set. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/driver8.html b/contrib/ntp/html/drivers/driver8.html new file mode 100644 index 0000000..fc12f33 --- /dev/null +++ b/contrib/ntp/html/drivers/driver8.html @@ -0,0 +1,279 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Generic Reference Driver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Generic Reference Driver</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.8.<i>u</i><br> + Reference ID: <tt>PARSE</tt><br> + Driver ID: <tt>GENERIC</tt><br> + Serial Port: <tt>/dev/refclock-<i>u</i></tt>; TTY mode according to clock type<br> + PPS device: <tt>/dev/refclockpps-<i>u</i></tt>; alternate PPS device (if not available via the serial port) + <h4>Description</h4> + The PARSE driver supports 20 different clock types/configurations. PARSE is actually a multi-clock driver.<br> + <br> + <p>The actual receiver status is mapped into various synchronization states generally used by receivers. The driver is configured to interpret the time codes of Meinberg DCF77 AM receivers, DCF77 FM receivers, Meinberg GPS16x/17x receivers, Trimble SV6 GPS, ELV DCF7000, Schmid, Wharton 400A and low cost receivers (see <a href="#clocklist">list below</a>).</p> + <p>The reference clock support in NTP contains the necessary configuration tables for those receivers. In addition to supporting several different clock types and up to 4 devices, the processing of a PPS signal is also provided as a configuration option. The PPS configuration option uses the receiver-generated time stamps for feeding the PPS loopfilter control for much finer clock synchronization.</p> + <p>CAUTION: The PPS configuration option is different from the hardware PPS signal, which is also supported (see below), as it controls the way ntpd is synchronized to the reference clock, while the hardware PPS signal controls the way time offsets are determined.</p> + <p>The use of the PPS option requires receivers with an accuracy of better than 1ms.</p> + <h4>Timecode variables listed by ntpq (8)</h4> + <p>The ntpq program can read and display several clock variables. These hold the following information:</p> + <dl> + <dt><tt>refclock_format</tt></dt> + <dd>A qualification of the decoded time code format.</dd> + <dt><tt>refclock_states</tt></dt> + <dd>The overall running time and the accumulated times for the clock event states.</dd> + <dt><tt>refclock_status</tt></dt> + <dd>Lists the currently active receiver flags. Additional feature flags for the receiver are optionally listed in parentheses.</dd> + <dt><tt>refclock_time</tt></dt> + <dd>The local time with the offset to UTC (format HHMM).</dd> + <dt><tt>timecode</tt></dt> + <dd>The actual time code.</dd> + </dl> + <p>If PPS information is present, additional variables are available:</p> + <dl> + <dt><tt>refclock_ppsskew</tt></dt> + <dd>The difference between the RS-232-derived timestamp and the PPS timestamp.</dd> + <dt><tt>refclock_ppstime</tt></dt> + <dd>The PPS timestamp.</dd> + </dl> + <h4>Supported Devices</h4> + <p>Currently, nineteen clock types (devices /dev/refclock-0 - /dev/refclock-3) are supported by the PARSE driver.<br> + A note on the implementations:</p> + <ul> + <li>These implementations were mainly done without actual access to the hardware, thus not all implementations provide full support. The development was done with the help of many kind souls who had the hardware and kindly lent me their time and patience during the development and debugging cycle. Thus for continued support and quality, direct access to the receivers is a big help. Nevertheless I am not prepared to buy these reference clocks - donations to (<a href="mailto:kardel <AT> ntp.org">kardel <AT> ntp.org</a>) are welcome as long as they work within Europe 8-). + <p>Verified implementations are:</p> + <ul> + <li>RAWDCF variants + <p>These variants have been tested for correct decoding with my own homegrown receivers. Interfacing with specific commercial products may involve some fiddling with cables. In particular, commercial RAWDCF receivers have a seemingly unlimited number of ways to draw power from the RS-232 port and to encode the DCF77 datastream. You are mainly on your own here unless I have a sample of the receiver.</p> + <li><a href="http://www.meinberg.de">Meinberg clocks</a> + <p>These implementations have been verified by the Meinberg people themselves and I have access to one of these clocks.</p> + </ul> + </ul> + <p>The pictures below have been taken from and are linked to the vendors' web pages.</p> + <a name="clocklist"></a> + <ul> + <li><b><tt>server 127.127.8.0-3 mode 0</tt></b> + <p><b><tt><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#dcf---freq_sync">PZF5xx receiver family</a> (FM demodulation/TCXO / 50μs)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 1</tt></b> + <p><b><tt><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#dcf---freq_sync">PZF5xx receiver family</a> (FM demodulation/OCXO / 50μs)</tt></b><br> + <a href="http://www.meinberg.de/english/products/pzf-eurocard.htm"><img src="../pic/pzf511.jpg" alt="Image PZF511" height="300" width="260" align="top" border="0"></a><br> + <br></p> + + <li><a name="mode2"></a><b><tt>server 127.127.8.0-3 mode 2</tt></b> + <p><b><tt><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/c51.htm">DCF C51 receiver and similar</a> (AM demodulation / 4ms)</tt></b><br> + <a href="http://www.meinberg.de/english/products/c51.htm"><img src="../pic/c51.jpg" alt="Image C51" height="239" width="330" align="top" border="0"></a><br> + </p> + <p>This mode expects the Meinberg standard time string format with 9600/7E2.</p> + <p><b>Note:</b> mode 2 must also be used for <a href="http://www.meinberg.de/english/products/formfactor.htm#slot_card">Meinberg PCI cards</a> under Linux, e.g. <a href="http://www.meinberg.de/english/products/gps-pcicard.htm">the GPS PCI card</a> or <a href="http://www.meinberg.de/english/products/dcf-pcicard.htm">the DCF77 PCI card</a>. Please note the <a href="http://www.meinberg.de/english/sw/#linux">Meinberg Linux driver</a> must be installed. That driver emulates a refclock device in order to allow ntpd to access those cards. For details, please refer to the README file that comes with the Meinberg driver package.<br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 3</tt></b> + <p><b><tt><a href="http://www.elv.de">ELV</a> DCF7000 (sloppy AM demodulation / 50ms)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 4</tt></b> + <p><b><tt>Walter Schmid DCF receiver Kit (AM demodulation / 1ms)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 5</tt></b> + <p><b><tt>RAW DCF77 100/200ms pulses (Conrad DCF77 receiver module / 5ms)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 6</tt></b> + <p><b><tt>RAW DCF77 100/200ms pulses (TimeBrick DCF77 receiver module / 5ms)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 7</tt></b> + <p><b><tt><a href="http://www.meinberg.de">Meinberg</a> <a href="http://www.meinberg.de/english/products/timesource.htm#gps---freq_sync">GPS16x/GPS17x receivers</a> (GPS / <<1μs)</tt></b><br> + <a href="http://www.meinberg.de/english/products/gps-eurocard.htm"><img src="../pic/gps167.jpg" alt="Image GPS167" height="300" width="280" align="top" border="0"></a><br> + </p> + <p>This mode expects either the University of Erlangen time string format or the Meinberg standard time string format at 19200/8N1.</p> + <p>The University of Erlangen format is preferred. Newer Meinberg GPS receivers can be configured to transmit that format; for older devices, a special firmware version may be available.</p> + <p>In this mode some additional GPS receiver status information is also read. However, this requires a point-to-point connection. <a href="#mode18">Mode 18</a> should be used if the device is accessed by a multidrop connection.</p> + <p><b>Note:</b> mode 7 must not be used with Meinberg PCI cards; use <a href="#mode2">mode 2</a> instead.<br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 8</tt></b> + <p><b><tt><a href="http://www.igel.de">IGEL</a> <a href="http://www.igel.de/eigelmn.html">clock</a></tt></b><br> + <a href="http://www.igel.de/eigelmn.html"><img src="../pic/igclock.gif" alt="Image IGEL clock" height="174" width="200" border="0"></a><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 9</tt></b> + <p><b><tt><a href="http://www.trimble.com">Trimble</a> <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html">SVeeSix GPS receiver</a> TAIP protocol (GPS / <<1μs)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 10</tt></b> + <p><b><tt><a href="http://www.trimble.com">Trimble</a> <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html">SVeeSix GPS receiver</a> TSIP protocol (GPS / <<1μs) (no kernel support yet)</tt></b><br> + <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om011.html"><img src="../pic/pd_om011.gif" alt="Image SVeeSix-CM3" height="100" width="420" align="top" border="0"></a><br> + <a href="http://www.trimble.com/cgi/omprod.cgi/pd_om006.html"><img src="../pic/pd_om006.gif" alt="Image Lassen-SK8" height="100" width="420" border="0"></a><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 11</tt></b> + <p><b><tt>Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support </tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 12</tt></b> + <p><b><tt><a href="http://www.hopf-time.com">HOPF</a> <a href="http://www.hopf-time.com/kart6021.html">Funkuhr 6021</a></tt></b><br> + <a href="http://www.hopf-time.com/engl/kart6021.html"><img src="../pic/fg6021.gif" alt="Image DCF77 Interface Board" height="207" width="238" align="top" border="0"></a><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 13</tt></b> + <p><b><tt>Diem's Computime Radio Clock</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 14</tt></b> + <p><b><tt>RAWDCF receiver (DTR=high/RTS=low)</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 15</tt></b> + <p><b><tt>WHARTON 400A Series Clocks with a 404.2 Serial Interface</tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 16</tt></b> + <p><b><tt>RAWDCF receiver (DTR=low/RTS=high) </tt></b><br> + <br></p> + + <li><b><tt>server 127.127.8.0-3 mode 17</tt></b> + <p><b><tt>VARITEXT Receiver (MSF) </tt></b><br> + <br></p> + + <li><a name="mode18"></a><b><tt>server 127.127.8.0-3 mode 18</tt></b> + <p><b><tt><a href="http://www.meinberg.de">Meinberg </a><a href="http://www.meinberg.de/english/products/timesource.htm#gps---freq_sync">GPS16x/GPS17x receivers</a> (GPS / <<1μs)</tt></b><br> + </p> + <p>This mode works without additional data communication (version, GPS status etc.) and thus should be used with multidrop, heterogeneous multiclient operation.</p> + <p><b>Note:</b> mode 18 must not be used with Meinberg PCI cards, use mode 2 instead.<br> + <br></p> + <li><b><tt>server 127.127.8.0-3 mode 19</tt></b> + <p><b><tt>Gude Analog- und Digitalsystem GmbH 'Expert mouseCLOCK USB v2.0'</tt></b><br> + <br></p> + + </ul> + <p>Actual data formats and setup requirements of the various clocks can be found in <a href="../parsedata.html">NTP PARSE clock data formats</a>.</p> + <h4>Operation</h4> + <p>The reference clock support software carefully monitors the state transitions of the receiver. All state changes and exceptional events (such as loss of time code transmission) are logged via the syslog facility. Every hour a summary of the accumulated times for the clock states is listed via syslog.</p> + <p>PPS support is only available when the receiver is completely synchronized. The receiver is believed to deliver correct time for an additional period of time after losing synchronization, unless a disruption in time code transmission is detected (possible power loss). The trust period is dependent on the receiver oscillator and thus is a function of clock type.</p> + <p>Raw DCF77 pulses can be fed via a level converter to the RXD pin of an RS-232 serial port (pin 3 of a 25-pin connector or pin 2 of a 9-pin connector). The telegrams are decoded and used for synchronization. DCF77 AM receivers can be bought for as little as $25. The accuracy is dependent on the receiver and is somewhere between 2ms (expensive) and 10ms (cheap). Synchronization ceases when reception of the DCF77 signal deteriorates, since no backup oscillator is available as usually found in other reference clock receivers. So it is important to have a good place for the DCF77 antenna. During transmitter shutdowns you are out of luck unless you have other NTP servers with alternate time sources available.</p> + <p>In addition to the PPS loopfilter control, a true PPS hardware signal can be utilized via the PPSAPI interface. PPS pulses are usually fed via a level converter to the DCD pin of an RS-232 serial port (pin 8 of a 25-pin connector or pin 1 of a 9-pin connector). To select PPS support, the mode parameter is the mode value as above plus 128. If 128 is not added to the mode value, PPS will be detected to be available but will not be used. + </p> + <h4>Hardware PPS support<br> + </h4> + <p>For PPS to be used, add 128 to the mode parameter.</p> + <p>If the PPS signal is fed in from a device different from the device providing the serial communication (/dev/refclock-{0..3}), this device is configured as /dev/refclockpps-{0..3}. This allows the PPS information to be fed in e.g. via the parallel port (if supported by the underlying operation system) and the date/time telegrams to be handled via the serial port.</p> + <h4>Monitor Data</h4> + <p>Clock state statistics are written hourly to the syslog service. Online information can be found by examining the clock variables via the <code>ntpq cv</code> command.<br> + Some devices have quite extensive additional information (GPS16x/GPS17x, Trimble). The driver reads out much of the internal GPS data + and makes it accessible via clock variables. To find out about additional variable names, query for the clock_var_list variable on + a specific clock association as shown below. + </p> + <p>First let <code>ntpq</code> display the table of associations:</p> + <pre> + ntpq> as + ind assID status conf reach auth condition last_event cnt + =========================================================== + 1 19556 9154 yes yes none falsetick reachable 5 + 2 19557 9435 yes yes none candidat clock expt 3 + 3 19558 9714 yes yes none pps.peer reachable 1 + </pre> + <p>Then switch to raw output. This may be required because of display limitations in ntpq/ntpd - so large lists need to be retrieved in several queries.</p> + <pre> + ntpq> raw + Output set to raw + </pre> + <p>Use the cv command to read the list of clock variables of a selected association:</p> + <pre> + ntpq> cv 19557 clock_var_list + </pre> + <p>The long output of the command above looks similar to:</p> + <pre> + assID=19557 status=0x0000, + clock_var_list="type,timecode,poll,noreply,badformat,baddata,fudgetime1, + fudgetime2,stratum,refid,flags,device,clock_var_list,refclock_time,refclock_status, + refclock_format,refclock_states,refclock_id,refclock_iomode,refclock_driver_version, + meinberg_gps_status,gps_utc_correction,gps_message,meinberg_antenna_status,gps_tot_51, + gps_tot_63,gps_t0a,gps_cfg[1],gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3], + gps_health[3],gps_cfg[4],gps_health[4],gps_cfg[5]" + </pre> + <p>Then use the cv command again to list selected clock variables. The following command must be entered as a single line:</p> + <pre> + ntpq> cv 19557 refclock_status,refclock_format,refclock_states,refclock_id, + refclock_iomode,refclock_driver_version,meinberg_gps_status,gps_utc_correction, + gps_message,meinberg_antenna_status,gps_tot_51,gps_tot_63,gps_t0a,gps_cfg[1], + gps_health[1],gps_cfg[2],gps_health[2],gps_cfg[3],gps_health[3],gps_cfg[4], + gps_health[4],gps_cfg[5] + </pre> + <p>The output of the command above is wrapped around depending on the screen width and looks similar to:</p> + <pre> + status=0x0003, + refclock_status="UTC DISPLAY; TIME CODE; PPS; POSITION; (LEAP INDICATION; + PPS SIGNAL; POSITION)", + refclock_format="Meinberg GPS Extended", + refclock_states="*NOMINAL: 21:21:36 (99.99%); FAULT: 00:00:03 (0.00%); + running time: 21:21:39", + refclock_id="GPS", refclock_iomode="normal", + refclock_driver_version="refclock_parse.c,v 4.77 2006/08/05 07:44:49 + kardel RELEASE_20060805_A", + meinberg_gps_status="[0x0000] <OK>", + gps_utc_correction="current correction 14 sec, last correction + on c7619a00.00000000 Sun, Jan 1 2006 0:00:00.000", + gps_message="/PFU3SOP-4WG14EPU0V1KA", + meinberg_antenna_status="RECONNECTED on 2006-07-18 08:13:20.0000000 (+0000) + UTC CORR, LOCAL TIME, reconnect clockoffset +0.0000000 s, + disconnect time 0000-00-00 00:00:00.0000000 (+0000) ", + gps_tot_51="week 1400 + 3 days + 42300.0000000 sec", + gps_tot_63="week 1400 + 3 days + 42294.0000000 sec", + gps_t0a="week 1400 + 5 days + 71808.0000000 sec", + gps_cfg[1]="[0x9] BLOCK II", gps_health[1]="[0x0] OK;SIGNAL OK", + gps_cfg[2]="[0x0] BLOCK I", gps_health[2]="[0x3f] PARITY;MULTIPLE ERRS", + gps_cfg[3]="[0x9] BLOCK II", gps_health[3]="[0x0] OK;SIGNAL OK", + gps_cfg[4]="[0x9] BLOCK II", gps_health[6]="[0x0] OK;SIGNAL OK", + gps_cfg[5]="[0x9] BLOCK II" + </pre> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction. The default value depends on the clock type. + <dt><tt>time2 <i>time</i></tt> + <dd> + If flag1 is 0, time2 specifies the offset of the PPS signal from the actual time (PPS fine tuning). + <dd> + If flag1 is 1, time2 specifies the number of seconds a receiver with a premium local oscillator can be trusted after losing synchronisation. + <dt><tt>stratum <i>stratum</i></tt> + <dd>The stratum for this reference clock. + <dt><tt>refid <i>refid</i></tt> + <dd>The refid for this reference clock. + </dl> + <dl> + <dt><tt>flag1 { 0 | 1 }</tt> + <dd>If 0, the fudge factor <tt>time2</tt> refers to the PPS offset. + <dd>If 1, <tt>time2</tt> refers to the TRUST TIME. + <dt><tt>flag2 { 0 | 1 }</tt> + <dd>If <tt>flag2</tt> is 1, sample PPS on CLEAR instead of on ASSERT. + <dt><tt>flag3 { 0 | 1 }</tt> + <dd>If <tt>flag3</tt> is 1, link kernel PPS tracking to this refclock instance. + <dt><tt>flag4 { 0 | 1 }</tt> + <dd>Delete next leap second instead of adding it. (You'll need to wait a bit for that to happen 8-) + </dl> + <span style="font-weight: bold;">Note about auxiliary Sun STREAMS modules (SunOS and Solaris):</span><br> + <dl> + <dt>The timecode of these receivers can be sampled via a STREAMS module in the kernel. (The STREAMS module has been designed for use with Sun systems under SunOS 4.1.x or Solaris 2.3 - 2.8. It can be linked directly into the kernel or loaded via the loadable driver mechanism.) This STREAMS module can be adapted to convert different time code formats. Nowadays the PPSAPI mechanism is usually used. + </dl> + <h4>Making your own PARSE clocks</h4> + <p>The parse clock mechanism deviates from the way other NTP reference clocks work. For a short description of how to build parse reference clocks, see <a href="../parsenew.html">making PARSE clocks</a>.</p> + <p>Additional Information</p> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/drivers/driver9.html b/contrib/ntp/html/drivers/driver9.html new file mode 100644 index 0000000..112f2d7 --- /dev/null +++ b/contrib/ntp/html/drivers/driver9.html @@ -0,0 +1,58 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <meta name="GENERATOR" content="Mozilla/4.01 [en] (Win95; I) [Netscape]"> + <title>Magnavox MX4200 GPS Receiver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Magnavox MX4200 GPS Receiver</h3> + <hr> + <h4>Synopsis</h4> + Address: 127.127.9.<i>u</i><br> + Reference ID: <tt>GPS</tt><br> + Driver ID: <tt>GPS_MX4200</tt><br> + Serial Port: <tt>/dev/gps<i>u</i></tt>; 4800 baud, 8-bits, no parity<br> + Features: <tt>ppsclock</tt> (required) + <h4>Description</h4> + <p>This driver supports the Magnavox MX4200 Navigation Receiver adapted to precision timing applications. It requires the <tt>ppsclock</tt> line discipline or streams module described in the <a href="../ldisc.html">Line Disciplines and Streams Modules</a> page. It also requires a level converter such as described in the <a href="../pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page.</p> + <p>This driver supports all compatible receivers such as the 6-channel MX4200, MX4200D, and the 12-channel MX9212, MX9012R, MX9112.</p> + <p><a href="http://www.leica-gps.com/"><img src="../pic/9400n.jpg" alt="Leica MX9400N Navigator" height="143" width="180" align="left"></a> <a href="http://www.leica-gps.com/">Leica Geosystems</a> acquired the Magnavox commercial GPS technology business in February of 1994. They now market and support former Magnavox GPS products such as the MX4200 and its successors.</p> + <br clear="LEFT"> + <p>Leica MX9400N Navigator.</p> + <h4>Operating Modes</h4> + <p>This driver supports two modes of operation, static and mobile, controlled by clock flag 2.</p> + <p>In static mode (the default) the driver assumes that the GPS antenna is in a fixed location. The receiver is initially placed in a "Static, 3D Nav" mode, where latitude, longitude, elevation and time are calculated for a fixed station. An average position is calculated from this data. After 24 hours, the receiver is placed into a "Known Position" mode, initialized with the calculated position, and then solves only for time.</p> + <p>In mobile mode, the driver assumes the GPS antenna is mounted on a moving platform such as a car, ship, or aircraft. The receiver is placed in "Dynamic, 3D Nav" mode and solves for position, altitude and time while moving. No position averaging is performed.</p> + <h4>Monitor Data</h4> + <p>The driver writes each timecode as received to the <tt>clockstats</tt> file. Documentation for the <cite>NMEA-0183</cite> proprietary sentences produced by the MX4200 can be found in <a href="../mx4200data.html">MX4200 Receiver Data Format</a>.</p> + <h4>Fudge Factors</h4> + <dl> + <dt><tt>time1 <i>time</i></tt> + <dd>Specifies the time offset calibration factor, in seconds and fraction, with default 0.0. + <dt><tt>time2 <i>time</i></tt> + <dd>Not used by this driver. + <dt><tt>stratum <i>number</i></tt> + <dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0. + <dt><tt>refid <i>string</i></tt> + <dd>Specifies the driver reference identifier, an ASCII string from one to four characters, with default <tt>GPS</tt>. + <dt><tt>flag1 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag2 0 | 1</tt> + <dd>Assume GPS receiver is on a mobile platform if set. + <dt><tt>flag3 0 | 1</tt> + <dd>Not used by this driver. + <dt><tt>flag4 0 | 1</tt> + <dd>Not used by this driver. + </dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a> </p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/icons/home.gif b/contrib/ntp/html/drivers/icons/home.gif Binary files differnew file mode 100644 index 0000000..e181298 --- /dev/null +++ b/contrib/ntp/html/drivers/icons/home.gif diff --git a/contrib/ntp/html/drivers/icons/mail2.gif b/contrib/ntp/html/drivers/icons/mail2.gif Binary files differnew file mode 100644 index 0000000..21bc1c4 --- /dev/null +++ b/contrib/ntp/html/drivers/icons/mail2.gif diff --git a/contrib/ntp/html/drivers/oncore-shmem.html b/contrib/ntp/html/drivers/oncore-shmem.html new file mode 100644 index 0000000..8942927 --- /dev/null +++ b/contrib/ntp/html/drivers/oncore-shmem.html @@ -0,0 +1,161 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>ONCORE - SHMEM</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Motorola ONCORE - The Shared Memory Interface</h3> + <hr> + <h4>Introduction</h4> + <p>In NMEA mode, the Oncore GPS receiver provides the user with the same information as other GPS receivers. In BINARY mode, it can provide a lot of additional information.</p> + <p>In particular, you can ask for satellite positions, satellite health, signal levels, the ephemeris and the almanac, and you can set many operational parameters. In the case of the VP, you can get the pseudorange corrections necessary to act as a DGPS base station, and you can see the raw satellite data messages themselves.</p> + <p>When using the Oncore GPS receiver with NTP, this additional information is usually not available since the receiver is only talking to the oncore driver in NTPD. To make this information available for use in other programs, (say graphic displays of satellites positions, plots of SA, etc.), a shared memory interface (SHMEM) has been added to the refclock_oncore driver on those operating systems that support shared memory.</p> + <p>To make use of this information you will need an Oncore Reference Manual for the Oncore GPS receiver that you have. The Manual for the VP only exists as a paper document, the UT+/GT+/M12 manuals are available as a pdf documents at <a href="http://www.synergy-gps.com/Mot_Manuals.html">Synergy</a> .</p> + <p>This interface was written by Poul-Henning Kamp (phk@FreeBSD.org), and modified by Reg Clemens (reg@dwf.com). The interface is known to work in FreeBSD, Linux, and Solaris.</p> + <h4>Activating the Interface</h4> + <p>Although the Shared Memory Interface will be compiled into the Oncore driver on those systems where Shared Memory is supported, to activate this interface you must include a <b>STATUS</b> or <b>SHMEM</b> line in the <tt>/etc/ntp.oncore</tt> data file that looks like</p> + <pre> + STATUS < file_name ><br> + + or<br> + + SHMEM < file_name > +</pre> + Thus a line like + <pre> + SHMEM /var/adm/ntpstats/ONCORE +</pre> + <p>would be acceptable. This file name will be used to access the Shared Memory.</p> + <p>In addition, one the two keywords <b>Posn2D</b> and <b>Posn3D</b> can be added to see @@Ea records containing the 2D or 3D position of the station (see below). Thus to activate the interface, and see 3D positions, something like</p> + <pre> + SHMEM /var/adm/ntpstats/ONCORE + Posn3D +</pre> + <p>would be required.</p> + <h4>Storage of Messages in Shared Memory</h4> + <p>With the shared memory interface, the oncore driver (refclock_oncore) allocates space for all of the messages that it is configured to receive, and then puts each message in the appropriate slot in shared memory as it arrives from the receiver. Since there is no easy way for a client program to know when the shared memory has been updated, a sequence number is associated with each message, and is incremented when a new message arrives. With the sequence number it is easy to check through the shared memory segment for messages that have changed.</p> + <p>The Oncore binary messages are kept in their full length, as described in the Reference manual, that is everything from the @@ prefix thru the <checksum><CR><LF>.</p> + <p>The data starts at location ONE of SHMEM (NOT location ZERO).</p> + <p>The messages are stacked in a series of variable length structures, that look like</p> + <pre> + struct message { + u_int length; + u_char sequence; + u_char message[length]; + } +</pre> + <p>if something like that were legal. That is, there are two bytes (caution, these may NOT be aligned with word boundaries, so the field needs to be treated as a pair of u_char), that contains the length of the next message. This is followed by a u_char sequence number, that is incremented whenever a new message of this type is received. This is followed by 'length' characters of the actual message.</p> + <p>The next structure starts immediately following the last char of the previous message (no alignment). Thus, each structure starts a distance of 'length+3' from the previous structure.</p> + <p>Following the last structure, is a u_int containing a zero length to indicate the end of the data.</p> + <p>The messages are recognized by reading the headers in the data itself, viz @@Ea or whatever.</p> + <p>There are two special cases.</p> + <p>(1) The almanac takes a total of 34 submessages all starting with @@Cb.<br> + 35 slots are allocated in shared memory. Each @@Cb message is initially placed in the first of these locations, and then later it is moved to the appropriate location for that submessage. The submessages can be distinguished by the first two characters following the @@Cb header, and new data is received only when the almanac changes.</p> + <p>(2) The @@Ea message contains the calculated location of the antenna, and is received once per second. However, when in timekeeping mode, the receiver is normally put in 0D mode, with the position fixed, to get better accuracy. In 0D mode no position is calculated.</p> + <p>When the SHMEM option is active, and if one of <b>Posn2D</b> or <b>Posn3D</b> is specified, one @@Ea record is hijacked each 15s, and the receiver is put back in 2D/3D mode so the the current location can be determined (for position determination, or for tracking SA). The timekeeping code is careful NOT to use the time associated with this (less accurate) 2D/3D tick in its timekeeping functions.</p> + <p>Following the initial @@Ea message are 3 additional slots for a total of four. As with the almanac, the first gets filled each time a new record becomes available, later in the code, the message is distributed to the appropriate slot. The additional slots are for messages containing 0D, 2D and 3D positions. These messages can be distinguished by different bit patterns in the last data byte of the record.</p> + <h4>Opening the Shared Memory File</h4> + <p>The shared memory segment is accessed through a file name given on a <b>SHMEM</b> card in the <tt>/etc/ntp.oncore</tt> input file. The following code could be used to open the Shared Memory Segment:</p> + <pre> + char *Buf, *file; + int size, fd; + struct stat statbuf; + + file = "/var/adm/ntpstats/ONCORE"; /* the file name on my ACCESS card */ + if ((fd=open(file, O_RDONLY)) < 0) { + fprintf(stderr, "Cant open %s\n", file); + exit(1); + } + + if (stat(file, &statbuf) < 0) { + fprintf(stderr, "Cant stat %s\n", file); + exit(1); + } + + size = statbuf.st_size; + if ((Buf=mmap(0, size, PROT_READ, MAP_SHARED, fd, (off_t) 0)) < 0) { + fprintf(stderr, "MMAP failed\n"); + exit(1); + } +</pre> + <h4>Accessing the data</h4> + <p>The following code shows how to get to the individual records.</p> + <pre> + void oncore_msg_Ea(), oncore_msg_As(), oncore_msg_Bb(); + + struct Msg { + char c[5]; + unsigned int seq; + void (*go_to)(uchar *); + }; + + struct Msg Hdr[] = { {"@@Bb", 0, &oncore_msg_Bb}, + {"@@Ea", 0, &oncore_msg_Ea}, + {"@@As", 0, &oncore_msg_As}}; + + void + read_data() + { + int i, j, k, n, iseq, jseq; + uchar *cp, *cp1; + + + for(cp=Buf+1; (n = 256*(*cp) + *(cp+1)) != 0; cp+=(n+3)) { + for (k=0; k < sizeof(Hdr)/sizeof(Hdr[0]); k++) { + if (!strncmp(cp+3, Hdr[k].c, 4)) { /* am I interested? */ + iseq = *(cp+2); + jseq = Hdr[k].seq; + Hdr[k].seq = iseq; + if (iseq > jseq) { /* has it changed? */ + /* verify checksum */ + j = 0; + cp1 = cp+3; /* points to start of oncore response */ + for (i=2; i < n-3; i++) + j ^= cp1[i]; + if (j == cp1[n-3]) { /* good checksum */ + Hdr[k].go_to(cp1); + } else { + fprintf(stderr, "Bad Checksum for %s\n", Hdr[k].c); + break; + } + } + } + } + if (!strncmp(cp+3, "@@Ea", 4)) + cp += 3*(n+3); + if (!strncmp(cp+3, "@@Cb", 4)) + cp += 34*(n+3); + } + } + + oncore_msg_Bb(uchar *buf) + { + /* process Bb messages */ + } + + oncore_msg_Ea(uchar *buf) + { + /* process Ea messages */ + } + + oncore_msg_As(uchar *buf) + { + /* process As messages */ + } +</pre> + <p>The structure Hdr contains the Identifying string for each of the messages that we want to examine, and the name of a program to call when a new message of that type is arrives. The loop can be run every few seconds to check for new data.</p> + <h4>Examples</h4> + <p>There are two complete examples available. The first plots satellite positions and the station position as affected by SA, and keeps track of the mean station position, so you can run it for periods of days to get a better station position. The second shows the effective horizon by watching satellite tracks. The examples will be found in the GNU-zipped tar file <a href="ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz">ftp://ftp.udel.edu/pub/ntp/software/OncorePlot.tar.gz</a>.</p> + <p>Try the new interface, enjoy.</p> + <hr> + <address>Reg.Clemens (reg@dwf.com), Poul-Henning Kamp (phk@FreeBSD.org)</address> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/scripts/footer.txt b/contrib/ntp/html/drivers/scripts/footer.txt new file mode 100644 index 0000000..89216ce --- /dev/null +++ b/contrib/ntp/html/drivers/scripts/footer.txt @@ -0,0 +1,7 @@ +document.write("\ +<table><tr>\ +<td width='50%' ><img src='../icons/home.gif' align='middle' alt='gif'>\ +<a href='../index.html'>Home Page</a></td>\ +<td width='50%' ><img src='../icons/mail2.gif' align='middle' alt='gif'>\ +<a href='http://www.ntp.org/contact.html'>Contacts</a></i></td>\ +</tr></table>")
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/scripts/style.css b/contrib/ntp/html/drivers/scripts/style.css new file mode 100644 index 0000000..096b18a --- /dev/null +++ b/contrib/ntp/html/drivers/scripts/style.css @@ -0,0 +1,64 @@ +body {background: #FDF1E1; + color: #006600; + font-family: "verdana", sans-serif; + text-align: justify; + margin-left: 5px;} + +p, h4, hr, li {margin-top: .6em; margin-bottom: .6em} +li.inline {text-align: left; margin-top: 0; margin-bottom: 0} + +ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em} + +dt {margin-top: .6em} +dd {margin-bottom: .6em} + +div.header {text-align: center; + font-style: italic;} + +div.footer {text-align: center; + font-size: 60%;} + +img.cell {align: left;} + +td.sidebar {width: 40px; align: center; valign: top;} +img.sidebar {align: center; margin-top: 5px;} +h4.sidebar {align: center;} + +p.top {background: #FDF1E1; + color: #006600; + position: absolute; + margin-left: -90px; + text-align: center;} + +a:link.sidebar {background: transparent; + color: #990033; + font-weight: bold;} + +a:visited.sidebar {background: transparent; + color: #990033; + font-weight: bold;} + +a:hover.sidebar {background: #FDF1E1; + color: #006600;} + +img {margin: 5px;} + +div {text-align: center;} + +h1 {text-align: center; + font-size: 250%;} + +caption {background: #EEEEEE; + color: #339999;} + +tx {text-align: center;} + +th {background: #FFFFCC; + color: #006600; + text-align: center; + text-decoration: underline; + padding-top: 5px;} + +th.caption {background: #EEEEEE; + color: #006600; + text-align: center;}
\ No newline at end of file diff --git a/contrib/ntp/html/drivers/tf582_4.html b/contrib/ntp/html/drivers/tf582_4.html new file mode 100644 index 0000000..6b0ce0a --- /dev/null +++ b/contrib/ntp/html/drivers/tf582_4.html @@ -0,0 +1,71 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta name="GENERATOR" content="Adobe PageMill 3.0 per Windows"> + <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> + <title>PTB Modem Time Service</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>European Automated Computer Time Services</h3> + <hr> + <p>Several European countries use the following message data format:</p> + <p><font size="-1" face="Courier New">Data format<br> + 0000000000111111111122222222223333333333444444444455555555556666666666777777777 7<br> + 0123456789012345678901234567890123456789012345678901234567890123456789012345678 9<br> + 1995-01-23 20:58:51 MEZ 10402303260219950123195849740+40000500 *<br> + A B C D EF G H IJ K L M N O P Q R S T U V W XY Z<CR><LF><br> + A year<br> + B month<br> + C day<br> + D hour<br> + E : normally<br> + A for DST to ST switch first hour<br> + B for DST to ST switch second hour if not marked in H<br> + F minute<br> + G second<br> + H timezone<br> + I day of week<br> + J week of year<br> + K day of year<br> + L month for next ST/DST changes<br> + M day<br> + N hour<br> + O UTC year<br> + P UTC month<br> + Q UTC day<br> + R UTC hour<br> + S UTC minute<br> + T modified julian day (MJD)<br> + U DUT1<br> + V direction and month if leap second<br> + W signal delay (assumed/measured)<br> + X sequence number for additional text line in Y<br> + Y additional text<br> + Z on time marker (* - assumed delay / # measured delay)<br> + <CR>!<LF> ! is second change !<br> + </font></p> + <p>This format is an ITU-R Recommendation (ITU-R TF583.4) and is now available from the primary timing centres of the following countries: Austria, Belgium, Germany, Italy, The Netherlands, Poland, Portugal, Romania, Spain, Sweden, Switzerland, Turkey and United Kingdom. Some examples are:</p> + <ul> + <li>In Germany by Physikalisch-Technische Bundesanstalt (PTB)'s timecode service. Phone number: +49 5 31 51 20 38. + <p>For more detail, see <a href="http://www.ptb.de/english/org/4/43/433/disse.html">http://www.ptb.de/english/org/4/43/433/disse.htm</a></p> + <li>In the UK by National Physical Laboratory (NPL)'s TRUETIME service. Phone number: 0891 516 333 + <p>For more detail, see <a href="http://www.npl.co.uk/npl/ctm/truetime.html">http://www.npl.co.uk/npl/ctm/truetime.html</a></p> + <li>In Italy by Istituto Elettrotecnico Nazionale "Galileo Ferrais" (IEN)'s CTD service. Phone number: 166 11 46 15 + <p>For more detail, see <a href="http://www.ien.it/tf/time/Pagina42.html">http://www.ien.it/tf/time/Pagina42.html</a></p> + <li>In Switzerland by Swiss Federal Office of Metrology's timecode service. Phone number: 031 323 32 25 + <p>For more detail, see <a href="http://www.metas.ch/en/labors/official-time/modem/index.html">http://www.ofmet.admin.ch/de/labors/4/Zeitvert.html </a></p> + <li>In Sweden by SP Swedish National Testing and Research Institute 's timecode service. Phone number: +46 33 415783. + <p>For more detail, see <a href="http://www.sp.se/metrology/timefreq/eng/tandf.htm">http://www.sp.se/metrology/timefreq/eng/tandf.htm</a></p> + </ul> + <dl></dl> + <h4>Additional Information</h4> + <p><a href="../refclock.html">Reference Clock Drivers</a></p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/extern.html b/contrib/ntp/html/extern.html new file mode 100644 index 0000000..3245fca --- /dev/null +++ b/contrib/ntp/html/extern.html @@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>External Clock Discipline and the Local Clock Driver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>External Clock Discipline and the Local Clock Driver</h3> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:38</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <hr> + <p>The NTPv4 implementation includes provisions for an external clock, where the system clock is implemented by some external hardware device. One implementation might take the form of a bus peripheral with a high resolution counter disciplined by a GPS receiver, for example. Another implementation might involve another synchronization protocol, such as the Digital Time Synchronization Service (DTSS), where the system time is disciplined to this protocol and NTP clients of the server obtain synchronization indirectly via the server. A third implementation might be a completely separate clock discipline algorithm and synchronization protocol, such as the <tt>Lockclock</tt> algorithm used with NIST Automated Computer Time Service (ACTS) modem synchronized time.</p> + <p>When external clocks are used in conjunction with NTP service, some way needs to be provided for the external clock driver and NTP daemon <tt>ntpd</tt> to communicate and determine which discipline is in control. This is necessary in order to provide backup, for instance if the external clock or protocol were to fail and synchronization service fall back to other means, such as a local reference clock or another NTP server. In addition, when the external clock and driver are in control, some means needs to be provided for the clock driver to pass on status information and error statistics to the NTP daemon.</p> + <p>Control and monitoring functions for the external clock and driver are implemented using the <a href="drivers/driver1.html">Local Clock (type 1) driver</a> and the <tt>ntp_adjtime()</tt> system call. This system call is implemented by special kernel provisions included in the kernel of several operating systems, including Solaris, Tru64, FreeBSD and Linux, and possibly others. When the external clock is disabled or not implemented, the system call is used to pass time and frequency information, as well as error statistics, to the kernel. Besides disciplining the system time, the same interface can be used by other applications to determine the operating parameters of the discipline.</p> + <p>When the external clock is enabled, <tt>ntpd</tt> does not discipline the system clock, nor does it maintain the error statistics. In this case, the external clock and driver do this using mechanisms unknown to <tt>ntpd</tt>; however, in this case the kernel state variables are retrieved at 64-s intervals by the Local Clock driver and used by the clock selection and mitigation algorithms to determine the system variables presented to other NTP clients and peers. In this way, downstream clients and servers in the NTP subnet can make an intelligent choice when more than one server is available.</p> + <p>In order to implement a reliable mitigation between ordinary NTP sources and the external clock source, a protocol is necessary between the local clock driver and the external clock driver. This is implemented using Boolean variables and certain bits in the kernel clock status word. The Boolean variables include the following:</p> + <p><tt>ntp_enable</tt>. set/reset by the <tt>enable</tt> command. enables ntp clock discipline</p> + <p><tt>ntp_contro</tt>l. set during initial configuration if kernel support is available</p> + <p><tt>kern_enable</tt> Set/reset by the <tt>enable</tt> command</p> + <p>If the <tt>kern_enable</tt> switch is set, the daemon computes the offset, frequency, maximum error, estimated error, time constand and status bits, then provides them to the kernel via <tt>ntp_adjtime()</tt>. If this switch is not set, these values are not passed to the kernel; however, the daemon retrieves their present values and uses them in place of the values computed by the daemon.</p> + <p>The <tt>pps_update</tt> bit set in the protocol routine if the prefer peer has survived and has offset less than 128 ms; otherwise set to zero.</p> + <p>The <tt>pps_contro</tt>l Updated to the current time by kernel support if the PPS signal is enabled and working correctly. Set to zero in the adjust routine if the interval since the last update exceeds 120 s.</p> + <p>The <tt>ntp_enable</tt> and <tt>kern_enable</tt> are set by the configuration module. Normally, both switches default on, so the daemon can control the time and the kernel discipline can be used, if available. The <tt>pps_update</tt> switch is set by the protocol module when it believes the PPS provider source is legitimate and operating within nominals. The <tt>ntp_control</tt> switch is set during configuration by interrogating the kernel. If both the <tt>kern_enable</tt> and <tt>ntp_control</tt> switches are set, the daemon disciplines the clock via the kernel and the internal daemon discipline is disabled.</p> + <p>The external clock driver controls the system time and clock selection in the following way. Normally, the driver adjusts the kernel time using the <tt>ntp_adjtime()</tt> system call in the same way as the daemon. In the case where the kernel discipline is to be used intact, the clock offset is provided in this call and the loop operates as specified. In the case where the driver steers only the frequency, the offset is specified as zero.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/gadget.html b/contrib/ntp/html/gadget.html new file mode 100644 index 0000000..b13fe08 --- /dev/null +++ b/contrib/ntp/html/gadget.html @@ -0,0 +1,33 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Gadget Box PPS Level Converter and CHU Modem</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Gadget Box PPS Level Converter and CHU Modem</h3> + <img src="pic/gadget.jpg" alt="gif" align="left">A Gadget Box built by Chuck Hanavin + <h4>Related Links</h4> + <p> + <script type="text/javascript" language="javascript" src="scripts/links11.txt"></script> + <br clear="left"> + </p> + <h4>table of Contents</h4> + <ul> + <li class="inline"><a href="#intro">Introduction</a> + <li class="inline"><a href="#ckt">Circuit Description</a> + <li class="inline"><a href="#file">Files</a> + </ul> + <hr> + <h4 id="intro">Introduction</h4> + <p>Many radio clocks used as a primary reference source for NTP servers produce a pulse-per-second (PPS) signal that can be used to improve accuracy to a high degree. However, the signals produced are usually incompatible with the modem interface signals on the serial ports used to connect the signal to the host. The gadget box consists of a handful of electronic components assembled in a small aluminum box. It includes level converters and a optional radio modem designed to decode the radio timecode signals transmitted by the Canadian time and frequency station CHU. A complete set of schematics, PCB artwork, drill templates can be obrtained via the web from ftp.udel.edu as <a href="ftp://ftp.udel.edu/pub/ntp/hardware/gadget.tar.Z">gadget.tar.Z</a>.</p> + <p>The gadget box is assembled in a 5"x3"x2" aluminum minibox containing the level converter and modem circuitry. It includes two subcircuits. One of these converts a TTL positive edge into a fixed-width pulse at EIA levels and is for use with a timecode receiver or oscillator including a TTL PPS output. The other converts the timecode modulation broadcast by Canadian time/frequency standard station CHU into a 300-bps serial character stream at EIA levels and is for use with the <a href="drivers/driver7.html">Radio CHU Audio Demodulator/Decoder</a> driver.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/groups.html b/contrib/ntp/html/groups.html new file mode 100644 index 0000000..7f6d14b --- /dev/null +++ b/contrib/ntp/html/groups.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Trusted Hosts and Groups</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Trusted Hosts and Groups</h3> + <img src="pic/alice23.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Alice holds the key.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">00:12</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="299">Tuesday, November 08, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links9.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#idexp">Identity Schemes</a> + <li class="inline"><a href="#exam">Example</a> + <li class="inline"><a href="#cmd">Command Line Options</a> + <li class="inline"><a href="#rand">Random Seed File</a> + <li class="inline"><a href="#fmt">Cryptographic Data Files</a> + <li class="inline"><a href="#bug">Bugs</a> + </ul> + <hr> + <h4 id="synop">Trusted Hosts and Groups</h4> + <p>Each cryptographic configuration involves selection of a signature scheme and identification scheme, called a cryptotype, as explained in the <a href="authopt.html">Authentication Options</a> page. The default cryptotype uses RSA encryption, MD5 message digest and TC identification. First, configure a NTP subnet including one or more low-stratum trusted hosts from which all other hosts derive synchronization directly or indirectly. Trusted hosts have trusted certificates; all other hosts have nontrusted certificates. These hosts will automatically and dynamically build authoritative certificate trails to one or more trusted hosts. A trusted group is the set of all hosts that have, directly or indirectly, a certificate trail ending at a trusted host. The trail is defined by static configuration file entries or dynamic means described on the <a href="manyopt.html">Automatic NTP Configuration Options</a> page.</p> + <p>On each trusted host as root, change to the keys directory. To insure a fresh fileset, remove all <tt>ntpkey</tt> files. Then run <tt>ntp-keygen -T</tt> to generate keys and a trusted certificate. On all other hosts do the same, but leave off the <tt>-T</tt> flag to generate keys and nontrusted certificates. When complete, start the NTP daemons beginning at the lowest stratum and working up the tree. It may take some time for Autokey to instantiate the certificate trails throughout the subnet, but setting up the environment is completely automatic.</p> + <p>If it is necessary to use a different sign key or different digest/signature scheme than the default, run <tt>ntp-keygen</tt> with the <tt>-S</tt><i><tt> type</tt></i> option, where <i><tt>type</tt></i> is either <tt>RSA</tt> or <tt>DSA</tt>. The most often need to do this is when a DSA-signed certificate is used. If it is necessary to use a different certificate scheme than the default, run <tt>ntp-keygen</tt> with the <tt>-c <i>scheme</i></tt> option and selected <i><tt>scheme</tt></i> as needed. If <tt>ntp-keygen</tt> is run again without these options, it generates a new certificate using the same scheme and sign key.</p> + <p>After setting up the environment it is advisable to update certificates from time to time, if only to extend the validity interval. Simply run <tt>ntp-keygen</tt> with the same flags as before to generate new certificates using existing keys. However, if the host or sign key is changed, <tt>ntpd</tt> should be restarted. When ntpd is restarted, it loads any new files and restarts the protocol. Other dependent hosts will continue as usual until signatures are refreshed, at which time the protocol is restarted.</p> + <h4 id="idexp">Identity Schemes</h4> + <p>As mentioned on the Autonomous Authentication page, the default TC identity scheme is vulnerable to a middleman attack. However, there are more secure identity schemes available, including PC, IFF, GQ and MV described on the <a href="http://www.eecis.udel.edu/%7emills/keygen.html">Identification Schemes</a> page. These schemes are based on a TA, one or more trusted hosts and some number of nontrusted hosts. Trusted hosts prove identity using values provided by the TA, while the remaining hosts prove identity using values provided by a trusted host and certificate trails that end on that host. The name of a trusted host is also the name of its sugroup and also the subject and issuer name on its trusted certificate. The TA is not necessarily a trusted host in this sense, but often is.</p> + <p>In some schemes there are separate keys for servers and clients. A server can also be a client of another server, but a client can never be a server for another client. In general, trusted hosts and nontrusted hosts that operate as both server and client have parameter files that contain both server and client keys. Hosts that operate only as clients have key files that contain only client keys.</p> + <p>The PC scheme supports only one trusted host in the group. On trusted host <i>alice</i> run <tt>ntp-keygen -P -p <i>password</i></tt> to generate the host key file <tt>ntpkey_RSAkey_<i>alice.filestamp</i></tt> and trusted private certificate file <tt>ntpkey_RSA-MD5_cert_<i>alice.filestamp</i></tt>. Copy both files to all group hosts; they replace the files which would be generated in other schemes. On each host <i>bob</i> install a soft link from the generic name <tt>ntpkey_host_<i>bob</i></tt> to the host key file and soft link <tt>ntpkey_cert_<i>bob</i></tt> to the private certificate file. Note the generic links are on <i>bob</i>, but point to files generated by trusted host <i>alice</i>. In this scheme it is not possible to refresh either the keys or certificates without copying them to all other hosts in the group.</p> + <p>For the IFF scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host <i>alice</i> run <tt>ntp-keygen -T </tt><tt>-I -p <i>password</i></tt> to produce her parameter file <tt>ntpkey_IFFpar_<i>alice.filestamp</i></tt>, which includes both server and client keys. Copy this file to all group hosts that operate as both servers and clients and install a soft link from the generic <tt>ntpkey_iff_<i>alice</i></tt> to this file. If there are no hosts restricted to operate only as clients, there is nothing further to do. As the IFF scheme is independent of keys and certificates, these files can be refreshed as needed.</p> + <p>If a rogue client has the parameter file, it could masquerade as a legitimate server and present a middleman threat. To eliminate this threat, the client keys can be extracted from the parameter file and distributed to all restricted clients. After generating the parameter file, on <i>alice</i> run <tt>ntp-keygen</tt> <tt>-e</tt> and pipe the output to a file or mail program. Copy or mail this file to all restricted clients. On these clients install a soft link from the generic <tt>ntpkey_iff_<i>alice</i></tt> to this file. To further protect the integrity of the keys, each file can be encrypted with a secret password.</p> + <p>For the GQ scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host <i>alice</i> run <tt>ntp-keygen -T </tt><tt>-G -p <i>password</i></tt> to produce her parameter file <tt>ntpkey_GQpar_<i>alice.filestamp</i></tt>, which includes both server and client keys. Copy this file to all group hosts and install a soft link from the generic <tt>ntpkey_gq_<i>alice</i></tt> to this file. In addition, on each host <i>bob</i> install a soft link from generic <tt>ntpkey_gq_<i>bob</i></tt> to this file. As the GQ scheme updates the GQ parameters file and certificate at the same time, keys and certificates can be regenerated as needed.</p> + <p>For the MV scheme, proceed as in the TC scheme to generate keys and certificates for all group hosts. For illustration assume <i>trish</i> is the TA, <i>alice</i> one of several trusted hosts and <i>bob</i> one of her clients. On TA <i>trish</i> run <tt>ntp-keygen </tt><tt>-V <i>n</i> -p <i>password</i></tt>, where <i>n</i> is the number of revokable keys (typically 5) to produce the parameter file <tt>ntpkeys_MVpar_<i>trish.filestamp </i></tt>and client key files <tt>ntpkeys_MVkey<i>d</i>_<i>trish.filestamp</i></tt> where <i><tt>d</tt></i> is the key number (0 < <i><tt>d</tt></i> < <i>n</i>). Copy the parameter file to <i>alice</i> and install a soft link from the generic <tt>ntpkey_mv_<i>alice</i></tt> to this file. Copy one of the client key files to <i>alice</i> for later distribution to her clients. It doesn't matter which client key file goes to <i>alice</i>, since they all work the same way. <i>Alice</i> copies the client key file to all of her cliens. On client <i>bob</i> install a soft link from generic <tt>ntpkey_mvkey_<i>bob </i></tt>to the client key file. As the MV scheme is independent of keys and certificates, these files can be refreshed as needed.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/howto.html b/contrib/ntp/html/howto.html new file mode 100644 index 0000000..3a1007f --- /dev/null +++ b/contrib/ntp/html/howto.html @@ -0,0 +1,109 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>How to Write a Reference Clock Driver</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>How to Write a Reference Clock Driver</h3> + <img src="pic/pogo4.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>You need a little magic.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:39</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links10.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#desc">Description</a> + <li class="inline"><a href="#file">Files Which Need to be Changed</a> + <li class="inline"><a href="#intf">Interface Routine Overview</a> + </ul> + <hr> + <h4 id="desc">Description</h4> + <p>NTP reference clock support maintains the fiction that the clock is actually an ordinary peer in the NTP tradition, but operating at a synthetic stratum of zero. The entire suite of algorithms used to filter the received data, select the best clocks or peers and combine them to produce a system clock correction operate just like ordinary NTP peers. In this way, defective clocks can be detected and removed from the peer population. As no packets are exchanged with a reference clock; however, the transmit, receive and packet procedures are replaced with separate code to simulate them.</p> + <p>It is important to understand how the NTP clock driver interface works. The driver assumes three timescales: standard time maintained by a distant laboratory such as USNO or NIST, reference time maintained by the external radio and the system time maintained by NTP. The radio synchronizes reference time and frequency to standard time via radio, satellite or modem. As the transmission means may not always be reliable, most radios continue to provide clock updates for some time after signal loss using an internal reference oscillator. In such cases the radio may or may not reveal the time since last synchronized and/or the estimated time error.</p> + <p>All three timescales run <i>only</i> in Coordinated Universal Time (UTC), 24-hour format, and are not adjusted for local timezone or standard/daylight time. The local timezone, standard/daylight indicator and year, if provided, are ignored. However, it is important to determine whether a leap second is to be inserted in the UTC timescale in the near future so NTP can insert it in the system timescale at the appropriate epoch.</p> + <p>The NTP clock driver synchronizes the system time and frequency to the radio via serial or parallel port, PPS signal or other means. The driver routinely checks the radio timecode string or status indicators to determine whether it is operating correctly or not. If it is, the driver decodes the radio timecode in days, hours, minutes, seconds and nanoseconds and provides these data with the NTP receive timestamp corresponding to the on-time epoch of the timecode. The driver interface computes the difference between the timecode time and NTP timestamp and saves the difference in a circular buffer for later processing. Once each poll interval, usually 64 s, the driver provides ancillary data including leap bits and last reference time to the interface. The interface processes the circular buffer using a median/trimmed mean algorithm to extract the best estimate and provides this and the ancillary data to the clock filter as with ordinary NTP peers.</p> + <p>The audio drivers are designed to look like a typical external radio in that the reference oscillator is derived from the audio codec oscillator and separate from the system clock oscillator. In the WWV and IRIG drivers, the codec oscillator is disciplined in frequency to the standard timescale via radio or local sources and can be assumed to have the same reliability and accuracy as an external radio. In these cases the driver continues to provide updates to the clock filter even if the WWV or IRIG signals are lost. However, the interface is provided the last reference time when the signals were received and increases the dispersion as expected with an ordinary peer.</p> + <p>The best way to understand how the clock drivers work is to study the <tt>ntp_refclock.c</tt> module and one of the drivers already implemented, such as <tt>refclock_wwvb.c</tt>. Routines <tt>refclock_transmit()</tt> and <tt>refclock_receive()</tt> maintain the peer variables in a state analogous to a network peer and pass received data on through the clock filters. Routines <tt>refclock_peer()</tt> and <tt>refclock_unpeer()</tt> initialize and terminate reference clock associations, should this ever be necessary. A set of utility routines is included to open serial devices, process sample data, edit input lines to extract embedded timestamps and to perform various debugging functions.</p> + <p>The main interface used by these routines is the <tt>refclockproc</tt> structure, which contains for most drivers the decimal equivalents of the year, day, month, hour, second and nanosecond decoded from the radio timecode. Additional information includes the receive timestamp, reference timestamp, exception reports, statistics tallies, etc. The support routines are passed a pointer to the <tt>peer</tt> structure, which is used for all peer-specific processing and contains a pointer to the <tt>refclockproc</tt> structure, which in turn contains a pointer to the unit structure, if used. For legacy purposes, a table <tt>typeunit[type][unit]</tt> contains the peer structure pointer for each configured clock type and unit. This structure should not be used for new implementations.</p> + <p>The reference clock interface supports auxiliary functions to support in-stream timestamping, pulse-per-second (PPS) interfacing and precision time kernel support. In most cases the drivers do not need to be aware of them, since they are detected at autoconfigure time and loaded automatically when the device is opened. These include the <tt>tty_clk</tt> STREAMS module and <tt>ppsapi</tt> PPS interface described in the <a href="ldisc.html">Line Disciplines and Streams Modules</a> page. The <tt>tty_clk</tt> module reduces latency errors due to the operating system and serial port code in slower systems. The <tt>ppsapi</tt> PPS interface replaces the <tt>ppsclock</tt> STREAMS module and is expected to become the IETF standard cross-platform interface for PPS signals. In either case, the PPS signal can be connected via a level converter/pulse generator described in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page.</p> + <p>Radio and modem reference clocks by convention have addresses in the form <tt>127.127.<i>t</i>.<i>u</i></tt>, where <i>t</i> is the clock type and <i>u</i> in the range 0-3 is used to distinguish multiple instances of clocks of the same type. Most clocks require a serial or parallel port or special bus peripheral. The particular device is normally specified by adding a soft link <tt>/dev/device<i>d</i>d</tt> to the particular hardware device involved, where <tt><i>d</i></tt> corresponds to the unit number.</p> + <p>By convention, reference clock drivers are named in the form <tt>refclock_<i>xxxx</i>.c</tt>, where <i>xxxx</i> is a unique string. Each driver is assigned a unique type number, long-form driver name, short-form driver name and device name. The existing assignments are in the <a href="refclock.html">Reference Clock Drivers</a> page and its dependencies. All drivers supported by the particular hardware and operating system are automatically detected in the autoconfigure phase and conditionally compiled. They are configured when the daemon is started according to the configuration file, as described in the <a href="build/config.html">Configuration Options</a> page.</p> + <p>The standard clock driver interface includes a set of common support routines some of which do such things as start and stop the device, open the serial port, and establish special functions such as PPS signal support. Other routines read and write data to the device and process time values. Most drivers need only a little customizing code to, for instance, transform idiosyncratic timecode formats to standard form, poll the device as necessary, and handle exception conditions. A standard interface is available for remote debugging and monitoring programs, such as <tt>ntpq</tt> and <tt>ntpdc</tt>, as well as the <tt>filegen</tt> facility, which can be used to record device status on a continuous basis.</p> + <p>The general organization of a typical clock driver includes a receive-interrupt routine to read a timecode from the I/O buffer and convert to internal format, generally in days, hours, minutes, seconds and fraction. Some timecode formats include provisions for leap-second warning and determine the clock hardware and software health. The interrupt routine then calls <tt>refclock_process()</tt> with these data and the timestamp captured at the on-time character of the timecode. This routine saves each sample as received in a circular buffer, which can store from a few up to 60 samples, in cases where the timecodes arrive one per second.</p> + <p>The <tt>refclock_transmit()</tt> routine in the interface is called by the system at intervals defined by the poll interval in the peer structure, generally 64 s. This routine in turn calls the transmit poll routine in the driver. In the intended design, the driver calls the <tt>refclock_receive()</tt> to process the offset samples that have accumulated since the last poll and produce the final offset and variance. The samples are processed by recursively discarding median outlyers until about 60 percent of samples remain, then averaging the surviving samples. When a reference clock must be explicitly polled to produce a timecode, the driver can reset the poll interval so that the poll routine is called a specified number of times at 1-s intervals.</p> + <p>The interface code and this documentation have been developed over some time and required not a little hard work converting old drivers, etc. Should you find success writing a driver for a new radio or modem service, please consider contributing it to the common good. Send the driver file itself and patches for the other files to Dave Mills (mills@udel.edu).</p> + <h4>Conventions, Fudge Factors and Flags</h4> + <p>Most drivers support manual or automatic calibration for systematic offset bias using values encoded in the <tt>fudge</tt> configuration command. By convention, the <tt>time1</tt> value defines the calibration offset in seconds. For those drivers that support statistics collection using the <tt>filegen</tt> utility and the <tt>clockstats</tt> file, the <tt>flag4</tt> switch enables the utility. When a PPS signal is available, a special automatic calibration facility is provided. If the <tt>flag1</tt> switch is set and the PPS signal is actively disciplining the system time, the calibration value is automatically adjusted to maintain a residual offset of zero. Should the PPS signal or the prefer peer fail, the adjustment is frozen and the remaining drivers continue to discipline the system clock with a minimum of residual error.</p> + <h4 id="file">Files Which Need to be Changed</h4> + <p>A new reference clock implementation needs to supply, in addition to the driver itself, several changes to existing files.</p> + <dl> + <dt><tt>./include/ntp.h</tt> + <dd>The reference clock type defines are used in many places. Each driver is assigned a unique type number. Unused numbers are clearly marked in the list. A unique <tt>REFCLK_<i>xxxx</i></tt> identification code should be recorded in the list opposite its assigned type number. + <dt><tt>./libntp/clocktypes.c</tt> + <dd>The <tt>./libntp/clktype</tt> array is used by certain display functions. A unique short-form name of the driver should be entered together with its assigned identification code. + <dt><tt>./ntpd/ntp_control.c</tt> + <dd>The <tt>clocktypes</tt> array is used for certain control message displays functions. It should be initialized with the reference clock class assigned to the driver, as per the NTP specification RFC-1305. See the <tt>./include/ntp_control.h</tt> header file for the assigned classes. + <dt><tt>./ntpd/refclock_conf.c</tt> + <dd>This file contains a list of external structure definitions which are conditionally defined. A new set of entries should be installed similar to those already in the table. The <tt>refclock_conf</tt> array is a set of pointers to transfer vectors in the individual drivers. The external name of the transfer vector should be initialized in correspondence with the type number. + <dt><tt>./configure.in</tt> + <dd>This is a configuration file used by the autoconfigure scheme. Add lines similar to the following: + <pre> + AC_MSG_CHECKING(FOO clock_description) + AC_ARG_ENABLE(FOO, + AC_HELP_STRING([--enable-FOO], [x clock_description]), + [ntp_ok=$enableval], [ntp_ok=$ntp_eac]) + if test "$ntp_ok" = "yes"; then + ntp_refclock=yes + AC_DEFINE(CLOCK_FOO, 1, [Foo clock?]) + fi + AC_MSG_RESULT($ntp_ok) +</pre> + <dd>(Note that <tt>$ntp_eac</tt> is the value from <tt>--{dis,en}able-all-clocks</tt> for non-PARSE clocks and <tt>$ntp_eacp</tt> is the value from <tt>--{dis,en}able-parse-clocks</tt> for PARSE clocks. See the documentation on the autoconf and automake tools from the GNU distributions.) + <dt><tt>./ntpd/Makefile.am</tt> + <dd>This is the makefile prototype used by the autoconfigure scheme. Add the driver file name to the entries already in the <tt>ntpd_SOURCES</tt> list. + <dd>Do the following sequence of commands: + <pre> + autoreconf + configure +</pre> + <dd>or simply run <tt>make</tt>, which will do this command sequence automatically. + </dl> + <h4 id="intf">Interface Routine Overview</h4> + <dl> + <dt><tt>refclock_newpeer</tt> - initialize and start a reference clock + <dd>This routine allocates and initializes the interface structure which supports a reference clock in the form of an ordinary NTP peer. A driver-specific support routine completes the initialization, if used. Default peer variables which identify the clock and establish its reference ID and stratum are set here. It returns one if success and zero if the clock address is invalid or already running, insufficient resources are available or the driver declares a bum rap. + <dt><tt>refclock_unpeer</tt> - shut down a clock + <dd>This routine is used to shut down a clock and return its resources to the system. + <dt><tt>refclock_transmit</tt> - simulate the transmit procedure + <dd>This routine implements the NTP transmit procedure for a reference clock. This provides a mechanism to call the driver at the NTP poll interval, as well as provides a reachability mechanism to detect a broken radio or other madness. + <dt><tt>refclock_sample</tt> - process a pile of samples from the clock + <dd>This routine converts the timecode in the form days, hours, minutes, seconds, milliseconds/microseconds to internal timestamp format. It then calculates the difference from the receive timestamp and assembles the samples in a shift register. It implements a recursive median filter to suppress spikes in the data, as well as determine a rough dispersion estimate. A configuration constant time adjustment <tt>fudgetime1</tt> can be added to the final offset to compensate for various systematic errors. The routine returns one if success and zero if failure due to invalid timecode data or very noisy offsets. + <dd>Note that no provision is included for the year, as provided by some (but not all) radio clocks. Ordinarily, the year is implicit in the Unix file system and hardware/software clock support, so this is ordinarily not a problem. Nevertheless, the absence of the year should be considered more a bug than a feature and may be supported in future. + <dt><tt>refclock_receive</tt> - simulate the receive and packet procedures + <dd>This routine simulates the NTP receive and packet procedures for a reference clock. This provides a mechanism in which the ordinary NTP filter, selection and combining algorithms can be used to suppress misbehaving radios and to mitigate between them when more than one is available for backup. + <dt><tt>refclock_gtlin</tt> - groom next input line and extract timestamp + <dd>This routine processes the timecode received from the clock and removes the parity bit and control characters. If a timestamp is present in the timecode, as produced by the <tt>tty_clk</tt> line discipline/streams module, it returns that as the timestamp; otherwise, it returns the buffer timestamp. The routine return code is the number of characters in the line. + <dt><tt>refclock_open</tt> - open serial port for reference clock + <dd>This routine opens a serial port for I/O and sets default options. It returns the file descriptor if success and zero if failure. + <dt><tt>refclock_ioctl</tt> - set serial port control functions + <dd>This routine attempts to hide the internal, system-specific details of serial ports. It can handle POSIX (<tt>termios</tt>), SYSV (<tt>termio</tt>) and BSD (<tt>sgtty</tt>) interfaces with varying degrees of success. The routine sets up the <tt>tty_clk, chu_clk</tt> and <tt>ppsclock</tt> streams module/line discipline, if compiled in the daemon and requested in the call. The routine returns one if success and zero if failure. + <dt><tt>refclock_control</tt> - set and/or return clock values + <dd>This routine is used mainly for debugging. It returns designated values from the interface structure that can be displayed using ntpdc and the clockstat command. It can also be used to initialize configuration variables, such as <tt>fudgetimes, fudgevalues,</tt> reference ID and stratum. + <dt><tt>refclock_buginfo</tt> - return debugging info + <dd>This routine is used mainly for debugging. It returns designated values from the interface structure that can be displayed using <tt>ntpdc</tt> and the <tt>clkbug</tt> command. + </dl> + <hr> + <center> + <img src="pic/pogo1a.gif" alt="gif"></center> + <br> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/icons/home.gif b/contrib/ntp/html/icons/home.gif Binary files differnew file mode 100644 index 0000000..e181298 --- /dev/null +++ b/contrib/ntp/html/icons/home.gif diff --git a/contrib/ntp/html/icons/mail2.gif b/contrib/ntp/html/icons/mail2.gif Binary files differnew file mode 100644 index 0000000..21bc1c4 --- /dev/null +++ b/contrib/ntp/html/icons/mail2.gif diff --git a/contrib/ntp/html/index.html b/contrib/ntp/html/index.html new file mode 100644 index 0000000..5c19313 --- /dev/null +++ b/contrib/ntp/html/index.html @@ -0,0 +1,101 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>The Network Time Protocol (NTP) Distribution</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>The Network Time Protocol (NTP) Distribution</h3> + <img src="pic/barnstable.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html"><i>P.T. Bridgeport Bear</i>; from <i>Pogo</i>, Walt Kelly</a> + <p>Pleased to meet you.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:39</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <br clear="left"> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#intro">Introduction</a> + <li class="inline"><a href="#build">Building and Installing NTP</a> + <li class="inline"><a href="#conf">Configuring Clients and Servers</a> + <li class="inline"><a href="#prog">Program Manual Pages</a> + <li class="inline"><a href="#docs">Supporting Documentation</a> + <li class="inline"><a href="#back">Background Information</a> + <li class="inline"><a href="#app">Application Notes</a> + </ul> + <hr> + <h4 id="intro">Introduction</h4> + <p>Note: The software contained in this distribution is available without charge under the conditions set forth in the <a href="copyright.html">Copyright Notice</a>.</p> + <p>The Network Time Protocol (NTP) is used to synchronize the time of a computer client or server to another server or reference time source, such as a radio or satellite receiver or modem. It provides accuracies typically within a millisecond on LANs and up to a few tens of milliseconds on WANs relative to Coordinated Universal Time (UTC) via a Global Positioning Service (GPS) receiver, for example. Typical NTP configurations utilize multiple redundant servers and diverse network paths in order to achieve high accuracy and reliability.</p> + <p>This software release implements NTP Version 4 (NTPv4), but is in general backwards compatible with previous versions except NTP Version 1, support for which is no longer viable. NTPv4 includes support for both symmetric key and public key cryptography to prevent accidental or malicious protocol attacks, as well as automatic server discovery using IP multicast means. This release includes full support for the IPv6 address family, where the operating system supports it, as well as the default IPv4 address family. Either or both families can be used at the same time on the same machine.</p> + <p>Background information on computer network time synchronization can be found on the <a href="http://www.eecis.udel.edu/%7emills/exec.html">Executive Summary - Computer Network Time Synchronization</a> page. Discussion on protocol conformance issues and interoperability with previous NTP versions can be found on the <a href="http://www.eecis.udel.edu/%7emills/biblio.html">Protocol Conformance Statement</a> page. Discussion on how NTP reckons the time can be found on the <a href="http://www.eecis.udel.edu/%7emills/leap.html">NTP Timescale and Leap Seconds</a> page. Background information, bibliography and briefing slides suitable for presentations can be found on the <a href="http://www.eecis.udel.edu/%7emills/ntp.html">Network Time Synchronization Project</a> page. Additional information can be found at the NTP web site <a href="http://www.ntp.org">www.ntp.org</a>. Please send bug reports to <a href="mailto:bugs@mail.ntp.org"><bugs@mail.ntp.org></a>.</p> + <h4 id="build">Building and Installing NTP</h4> + <p>NTP supports Unix and Windows (XP, NT4 and 2000) systems. The <a href="build/build.html">Building and Installing the Distribution</a> page presents an overview of the procedures for compiling the distribution and installing it on a typical client or server. The build procedures inspect the system hardware and software environment and automatically select the appropriate options for that environment. While these procedures work with most computers and operating systems marketed today, exceptions requiring manual intervention do exist, as documented on the <a href="build/config.html">Configuration Options</a> and <a href="release.html">Release Notes</a> pages.</p> + <p>Bringing up a NTP primary server requires a radio or satellite receiver or modem. The distribution includes hardware drivers for some forty radio and satellite clocks and modem services. A list of supported drivers is given on the <a href="refclock.html">Reference Clock Drivers</a> page. It is also possible to use an otherwise undisciplined machine as a primary or backup server, as described on the <a href="drivers/driver1.html">Undisciplined Local Clock</a> page. For most popular workstations marketed by Sun, Silicon Graphics and Hewlett Packard, as well as widely available Unix clones such as FreeBSD and Linux, the automatic build procedures select all drivers that run on the target machine. While this increases the size of the executable binary somewhat, individual drivers can be included or excluded using the configure utility documented in the Configuration Options page.</p> + <p>Some programs included in this distribution use cryptographic algorithms to verify authenticity and credentials. Where local security policy permits relatively weak symmetric key cryptography, the required software is included in this distribution. However, where local policy requires stronger public key cryptography, additional software not in this distribution is required. This distribution uses the OpenSSL library available from <a href="http://www.openssl.org">http://www.openssl.org</a>. This library is also used by the Secure Shell facility, so is often already installed on Unix workstations and servers. It includes support for most message digest and digital signature algorithms used in the industry, as well as X.509 certificate generation, signing and verification.</p> + <p>While public key cryptography is optional but highly recommended for all NTP operations, it is required for the NTPv4 Autokey protocol described on the <a href="http://www.eecis.udel.edu/%7emills/autokey.html">Autonomous Authentication</a> page and is an integral component of the generic automatic configuration scheme described on the <a href="http://www.eecis.udel.edu/%7emills/autocfg.html">Autonomous Configuration</a> page. In addition, access can be restricted in various ways described on the <a href="accopt.html">Access Control Options</a> page.</p> + <h4 id="conf">Configuring Clients and Servers</h4> + <p>NTP is by its very nature a complex distributed network application and can be configured and used for a great many widely divergent timekeeping scenarios. The documentation presented on these pages attempts to cover the entire suite of configuration, operation and maintenance facilities which this distribution supports. However, most applications will need only a few of these facilities. If this is the case, the <a href="build/quick.html">Quick Start</a> page may be useful to get a simple workstation on the air with an existing server.</p> + <p>However, in order to participate in the existing NTP synchronization subnet and obtain accurate, reliable time, it is usually necessary to construct an appropriate configuration file, commonly called <tt>ntp.conf</tt>, which establishes the servers and/or external receivers or modems to be used by this particular machine. Directions for constructing this file are in the <a href="notes.html">Notes on Configuring NTP and Setting up a NTP Subnet</a> page. However, in many common cases involving simple network topologies and workstations, the configuration data can be specified entirely on the command line for the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a>.</p> + <p>The most important factor in providing accurate, reliable time is the selection of modes and servers to be used in the configuration file. A discussion on the available modes is on the <a href="assoc.html">Association Management</a> page. NTP support for one or more computers is normally engineered as part of the existing public NTP synchronization subnet. The public subnet consists of a multiply redundant hierarchy of servers and clients, with each level in the hierarchy identified by stratum number. Primary servers operate at stratum one and provide synchronization to secondary servers operating at stratum two and so on to higher strata. In this hierarchy, clients are simply servers that have no dependents.</p> + <p>Configuring a corporate or campus NTP subnet can be an engineering challenge. NTP contains many features designed to survive system and network failures, software bugs, clock errors and hacker attacks. Surviving these hazards requires intricate design of the timekeeping network using good principles of server redundancy and path diversity. The Manycast mode, new to NTPv4, is designed to track the current server and network states and adjust the client/server configuration for the best available accuracy and reliability. More information on the Manycast mode is on the <a href="authopt.html">Athentication Options</a> and <a href="manyopt.html">Automatic NTP Configuration Options</a> pages.</p> + <p>The NTP subnet in early 2003 includes well over a hundred public primary (stratum 1) servers synchronized directly to UTC by radio, satellite or modem and located in every continent of the globe, including Antarctica. Normally, client workstations and servers with a relatively small number of clients do not synchronize to primary servers. There are well over a hundred public secondary (stratum 2) servers synchronized to the primary servers and providing synchronization to a total well over 100,000 clients and servers in the Internet. The current lists are maintained on the <a href="http://www.eecis.udel.edu/%7emills/ntp/index.html">Information on Time and Frequency Services</a> page, which is updated frequently. There are thousands upon thousands of private primary and secondary servers not normally available to the public, many hiding behind firewalls. Clients are strongly discouraged against using these servers, since they sometimes hide in little ghettos behind dinky links to the outside world and unwanted traffic can bring up expensive ISDN lines, causing much grief and frustration. There are defensive means described on the Access Control Options page, including the Kiss-of-Death packet.</p> + <h4 id="prob">Resolving Problems</h4> + <p>Like other things Internet, the NTP synchronization subnets tend to be large and devilishly intricate, with many opportunities for misconfiguration and network problems. The NTP engineering model is specifically designed to help isolate and repair such problems using an integrated management protocol, together with a suite of monitoring and debugging tools. There is an optional statistics data recording facility which can be used to record normal and aberrant operation, log problems to the system log facility, and retain records of client access. The <a href="debug.html">NTP Debugging Techniques</a> and <a href="build/hints.html">Hints and Kinks</a> pages contain useful information for identifying problems and devising solutions. In extreme cases, problems can be detected through the use of the <a href="ntpdsim.html"><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</a> included in this software distribution.</p> + <p>Users are requested to report bugs, offer suggestions and contribute additions to this distribution. The <a href="build/patches.html">Patching Procedures</a> page suggests procedures which greatly simplify distribution updates, while the <a href="build/porting.html">Porting Hints</a> page suggest ways to make porting this code to new hardware and operating systems easier. Additional information on reference clock driver construction and debugging can be found in the <a href="rdebug.html">Debugging Hints for Reference Clock Drivers</a> page.</p> + <h4 id="prog">Program Manual Pages</h4> + <ul> + <li class="inline"><a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> + <li class="inline"><a href="ntpq.html"><tt>ntpq</tt> - standard NTP query program</a> + <li class="inline"><a href="ntpdc.html"><tt>ntpdc</tt> - special NTP query program</a> + <li class="inline"><a href="ntpdate.html"><tt>ntpdate</tt> - set the date and time via NTP</a> + <li class="inline"><a href="ntptrace.html"><tt>ntptrace</tt> - trace a chain of NTP servers back to the primary source</a> + <li class="inline"><a href="tickadj.html"><tt>tickadj</tt> - set time-related kernel variables</a> + <li class="inline"><a href="ntptime.html"><tt>ntptime</tt> - read kernel time variables</a> + <li class="inline"><a href="keygen.html"><tt>ntp-keygen</tt> - generate public and private keys</a> + <li class="inline"><a href="ntpdsim.html"><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</a> + </ul> + <h4 id="docs">Supporting Documentation</h4> + <ul> + <li class="inline"><a href="copyright.html">Copyright Notice</a> + <li class="inline"><a href="notes.html">Notes on Configuring NTP and Setting up a NTP Subnet</a> + <li class="inline"><a href="release.html">NTP Version 4 Release Notes</a> + <li class="inline"><a href="build/build.html">Building and Installing the Distribution</a> + <li class="inline"><a href="build/config.html">Configuration Options</a> + <li class="inline"><a href="refclock.html">Reference Clock Drivers</a> + <li class="inline"><a href="debug.html">NTP Debugging Techniques</a> + <li class="inline"><a href="rdebug.html">Debugging Reference Clock Drivers</a> + <li class="inline"><a href="msyslog.html"><tt>ntpd</tt> System Log Messages</a> + <li class="inline"><a href="build/patches.html">Patching Procedures</a> + <li class="inline"><a href="build/hints.html">Hints and Kinks</a> + <li class="inline"><a href="build/porting.html">Porting Hints</a> + </ul> + <h4 id="back">Background Information</h4> + <ul> + <li class="inline"><a href="http://www.eecis.udel.edu/%7emills/ntp.html">NTP Project and Reference Library</a> + <li class="inline"><a href="http://www.eecis.udel.edu/%7emills/exec.html">Executive Summary - Computer Network Time Synchronization</a> + <li class="inline"><a href="http://www.eecis.udel.edu/%7emills/y2k.html">The Network Time Protocol Timescale and Era Numbering</a> + <li class="inline"><a href="http://www.eecis.udel.edu/%7emills/leap.html">NTP Timescale and Leap Seconds</a> + <li class="inline"><a href="http://www.eecis.udel.edu/%7emills/biblio.html">Protocol Conformance Statement</a> + </ul> + <h4 id="app">Application Notes</h4> + <ul> + <li class="inline"><a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> + <li class="inline"><a href="assoc.html">Association Management</a> + <li class="inline"><a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> + <li class="inline"><a href="measure.html">Time and Time Interval Measurement with Application to Computer and Network Performance Evaluation</a> + <li class="inline"><a href="kern.html">Kernel Model for Precision Timekeeping</a> + </ul> + <hr> + <div align="center"> + <img src="pic/pogo1a.gif" alt="gif"></div> + <br> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/kern.html b/contrib/ntp/html/kern.html new file mode 100644 index 0000000..cc23504 --- /dev/null +++ b/contrib/ntp/html/kern.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Kernel Model for Precision Timekeeping</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Kernel Model for Precision Timekeeping</h3> + <p><img src="pic/alice61.gif" alt="gif" align="left"> <a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a></p> + <p>Alice touched the kernel and it exploded.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:40</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links11.txt"></script> + <hr> + <p>The technical report [2], which is a major revision and update of RFC-1589 [3], describes an engineering model for a precision time-of-day function for a generic operating system. The model is based on the principles of disciplined oscillators using phase-lock loops (PLL) and frequency-lock loops (FLL) often found in the engineering literature. The model uses a hybrid PLL/FLL discipline algorithm implemented in the kernel. The algorithm, which is very similar to the algorithm implemented in the NTP daemon, provides automatic time and frequency steering with update intervals from a few seconds to tens of minutes.</p> + <p>The hybrid PLL/FLL code described in [2] is included in Solaris and Digital/Compaq/HP Tru64. It includes two system calls <tt>ntp_gettime()</tt> and <tt>ntp_adjtime()</tt> and can discipline the system clock with microsecond resolution. However, newer hardware and kernels with the same system calls can discipline the clock with nanosecond resolution. The new code described in [1] is available for Linux, FreeBSD, SunOS and Tru64; however, only the Linux and FreeBSD implementations, which do not include licensed code, are readily available. The software and documentation, including a simulator used to verify correct behavior, but not involving licensed code, is available at <a href="ftp://ftp.udel.edu/pub/ntp/software/nanokernel.tar.gz">nanokernel.tar.gz</a>.</p> + <p>The model also changes the way the system clock is adjusted in time and frequency relative to an external precision timing source, such as described in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. The NTP software daemon uses the PPS to provide synchronization limited in principle only by the accuracy and stability of the external timing source.</p> + <h4>References</h4> + <ol> + <li>Mills, D.L., and P.-H. Kamp. The nanokernel. <i>Proc. Precision Time and Time Interval (PTTI) Applications and Planning Meeting</i> (Reston VA, November 2000). Paper: <a href="http://www.eecis.udel.edu/%7emills/database/papers/nano/nano2.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/papers/nano/nano2.pdf">PDF</a>, Slides: <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.html">HTML</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.pdf">PDF</a> | <a href="http://www.eecis.udel.edu/%7emills/database/brief/nano/nano.ppt">PowerPoint</a> + <li>Mills, D.L. Unix kernel modifications for precision time synchronization. Electrical Engineering Department Report 94-10-1, University of Delaware, October 1994, 24 pp. Abstract: <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kerna.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kerna.pdf">PDF</a>, Body: <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kernb.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/reports/kern/kernb.pdf">PDF</a> + <li>Mills, D.L. A kernel model for precision timekeeping. Network Working Group Report RFC-1589, University of Delaware, March 1994. 31 pp. <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1589.txt">ASCII</a> + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/keygen.html b/contrib/ntp/html/keygen.html new file mode 100644 index 0000000..7953eb1 --- /dev/null +++ b/contrib/ntp/html/keygen.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntp-keygen - generate public and private keys</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntp-keygen</tt> - generate public and private keys</h3> + <img src="pic/alice23.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Alice holds the key.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">22:32</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="294">Monday, November 07, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links9.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#synop">Synopsis</a> + <li class="inline"><a href="#descrip">Description</a> + <li class="inline"><a href="#run">Running the program</a> + <li class="inline"><a href="#trust">Trusted Hosts and Groups</a> + <li class="inline"><a href="#idexp">Identity Schemes</a> + <li class="inline"><a href="#exam">Example</a> + <li class="inline"><a href="#cmd">Command Line Options</a> + <li class="inline"><a href="#rand">Random Seed File</a> + <li class="inline"><a href="#fmt">Cryptographic Data Files</a> + <li class="inline"><a href="#bug">Bugs</a> + </ul> + <hr> + <h4 id="synop">Synopsis</h4> + <p id="intro"><tt>ntp-keygen [ -deGgHIMnPT ] [ -c [RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ] ] [ -i <i>name</i> ] [ -p <i>password</i> ] [ -S [ RSA | DSA ] ] [ -s <i>name</i> ] [ -v <i>nkeys</i> ]</tt></p> + <h4 id="descrip">Description</h4> + <p>This program generates cryptographic data files used by the NTPv4 authentication and identification schemes. It generates MD5 key files used in symmetric key cryptography. In addition, if the OpenSSL software library has been installed, it generates keys, certificate and identity files used in public key cryptography. These files are used for cookie encryption, digital signature and challenge/response identification algorithms compatible with the Internet standard security infrastructure.</p> + <p>By default, files are not encrypted by <tt>ntp-keygen</tt>. The <tt>-p <i>password</i></tt> option specifies the write password and <tt>-q <i>password</i></tt> option the read password for previously encrypted files. The <tt>ntp-keygen</tt> program prompts for the password if it reads an encrypted file and the password is missing or incorrect. If an encrypted file is read successfully and no write password is specified, the read password is used as the write password by default.</p> + <p>The <tt>ntpd</tt> configuration command <tt>crypto pw <i>password</i></tt> specifies the read password for previously encrypted files. The daemon expires on the spot if the password is missing or incorrect. For convenience, if a file has been previously encrypted, the default read password is the name of the host running the program. If the previous write password is specified as the host name, these files can be read by that host with no explicit password.</p> + <p>All files are in PEM-encoded printable ASCII format, so they can be embedded as MIME attachments in mail to other sites and certificate authorities. File names begin with the prefix <tt>ntpkey_</tt> and end with the postfix <tt><i>_hostname.filestamp</i></tt>, where <tt><i>hostname</i></tt> is usually the string returned by the Unix <tt>gethostname()</tt> routine, and <tt><i>filestamp</i></tt> is the NTP seconds when the file was generated, in decimal digits. This both guarantees uniqueness and simplifies maintenance procedures, since all files can be quickly removed by a <tt>rm ntpkey*</tt> command or all files generated at a specific time can be removed by a <tt>rm *<i>filestamp</i></tt> command. To further reduce the risk of misconfiguration, the first two lines of a file contain the file name and generation date and time as comments.</p> + <p>All files are installed by default in the keys directory <tt>/usr/local/etc</tt>, which is normally in a shared filesystem in NFS-mounted networks. The actual location of the keys directory and each file can be overridden by configuration commands, but this is not recommended. Normally, the files for each host are generated by that host and used only by that host, although exceptions exist as noted later on this page.</p> + <p>Normally, files containing private values, including the host key, sign key and identification parameters, are permitted root read/write-only; while others containing public values are permitted world readable. Alternatively, files containing private values can be encrypted and these files permitted world readable, which simplifies maintenance in shared file systems. Since uniqueness is insured by the hostname and file name extensions, the files for a NFS server and dependent clients can all be installed in the same shared directory.</p> + <p>The recommended practice is to keep the file name extensions when installing a file and to install a soft link from the generic names specified elsewhere on this page to the generated files. This allows new file generations to be activated simply by changing the link. If a link is present, <tt>ntpd</tt> follows it to the file name to extract the filestamp. If a link is not present, <tt>ntpd</tt> extracts the filestamp from the file itself. This allows clients to verify that the file and generation times are always current. The <tt>ntp-keygen</tt> program uses the same extension for all files generated at one time, so each generation is distinct and can be readily recognized in monitoring data.</p> + <h4 id="run">Running the program</h4> + <p>The safest way to run the <tt>ntp-keygen</tt> program is logged in directly as root. The recommended procedure is change to the keys directory, usually <tt>/ust/local/etc</tt>, then run the program. When run for the first time, or if all <tt>ntpkey</tt> files have been removed, the program generates a RSA host key file and matching RSA-MD5 certificate file, which is all that is necessary in many cases. The program also generates soft links from the generic names to the respective files. If run again, the program uses the same host key file, but generates a new certificate file and link.</p> + <p>The host key is used to encrypt the cookie when required and so must be RSA type. By default, the host key is also the sign key used to encrypt signatures. When necessary, a different sign key can be specified and this can be either RSA or DSA type. By default, the message digest type is MD5, but any combination of sign key type and message digest type supported by the OpenSSL library can be specified, including those using the MD2, MD5, SHA, SHA1, MDC2 and RIPE160 message digest algorithms. However, the scheme specified in the certificate must be compatible with the sign key. Certificates using any digest algorithm are compatible with RSA sign keys; however, only SHA and SHA1 certificates are compatible with DSA sign keys.</p> + <p>Private/public key files and certificates are compatible with other OpenSSL applications and very likely other libraries as well. Certificates or certificate requests derived from them should be compatible with extant industry practice, although some users might find the interpretation of X509v3 extension fields somewhat liberal. However, the identification parameter files, although encoded as the other files, are probably not compatible with anything other than Autokey.</p> + <p>Running the program as other than root and using the Unix <tt>su</tt> command to assume root may not work properly, since by default the OpenSSL library looks for the random seed file <tt>.rnd</tt> in the user home directory. However, there should be only one <tt>.rnd</tt>, most conveniently in the root directory, so it is convenient to define the <tt>$RANDFILE</tt> environment variable used by the OpenSSL library as the path to <tt>/.rnd</tt>.</p> + <p>Installing the keys as root might not work in NFS-mounted shared file systems, as NFS clients may not be able to write to the shared keys directory, even as root. In this case, NFS clients can specify the files in another directory such as <tt>/etc</tt> using the <tt>keysdir</tt> command. There is no need for one client to read the keys and certificates of other clients or servers, as these data are obtained automatically by the Autokey protocol.</p> + <p>Ordinarily, cryptographic files are generated by the host that uses them, but it is possible for a trusted agent (TA) to generate these files for other hosts; however, in such cases files should always be encrypted. The subject name and trusted name default to the hostname of the host generating the files, but can be changed by command line options. It is convenient to designate the owner name and trusted name as the subject and issuer fields, respectively, of the certificate. The owner name is also used for the host and sign key files, while the trusted name is used for the identity files.</p> + <h4 id="trust">Trusted Hosts and Groups</h4> + <p>Each cryptographic configuration involves selection of a signature scheme and identification scheme, called a cryptotype, as explained in the <a href="authopt.html">Authentication Options</a> page. The default cryptotype uses RSA encryption, MD5 message digest and TC identification. First, configure a NTP subnet including one or more low-stratum trusted hosts from which all other hosts derive synchronization directly or indirectly. Trusted hosts have trusted certificates; all other hosts have nontrusted certificates. These hosts will automatically and dynamically build authoritative certificate trails to one or more trusted hosts. A trusted group is the set of all hosts that have, directly or indirectly, a certificate trail ending at a trusted host. The trail is defined by static configuration file entries or dynamic means described on the <a href="manyopt.html">Automatic NTP Configuration Options</a> page.</p> + <p>On each trusted host as root, change to the keys directory. To insure a fresh fileset, remove all <tt>ntpkey</tt> files. Then run <tt>ntp-keygen -T</tt> to generate keys and a trusted certificate. On all other hosts do the same, but leave off the <tt>-T</tt> flag to generate keys and nontrusted certificates. When complete, start the NTP daemons beginning at the lowest stratum and working up the tree. It may take some time for Autokey to instantiate the certificate trails throughout the subnet, but setting up the environment is completely automatic.</p> + <p>If it is necessary to use a different sign key or different digest/signature scheme than the default, run <tt>ntp-keygen</tt> with the <tt>-S</tt><i><tt> type</tt></i> option, where <i><tt>type</tt></i> is either <tt>RSA</tt> or <tt>DSA</tt>. The most often need to do this is when a DSA-signed certificate is used. If it is necessary to use a different certificate scheme than the default, run <tt>ntp-keygen</tt> with the <tt>-c <i>scheme</i></tt> option and selected <i><tt>scheme</tt></i> as needed. If <tt>ntp-keygen</tt> is run again without these options, it generates a new certificate using the same scheme and sign key.</p> + <p>After setting up the environment it is advisable to update certificates from time to time, if only to extend the validity interval. Simply run <tt>ntp-keygen</tt> with the same flags as before to generate new certificates using existing keys. However, if the host or sign key is changed, <tt>ntpd</tt> should be restarted. When ntpd is restarted, it loads any new files and restarts the protocol. Other dependent hosts will continue as usual until signatures are refreshed, at which time the protocol is restarted.</p> + <h4 id="idexp">Identity Schemes</h4> + <p>As mentioned on the Autonomous Authentication page, the default TC identity scheme is vulnerable to a middleman attack. However, there are more secure identity schemes available, including PC, IFF, GQ and MV described on the <a href="http://www.eecis.udel.edu/%7emills/keygen.html">Identification Schemes</a> page. These schemes are based on a TA, one or more trusted hosts and some number of nontrusted hosts. Trusted hosts prove identity using values provided by the TA, while the remaining hosts prove identity using values provided by a trusted host and certificate trails that end on that host. The name of a trusted host is also the name of its sugroup and also the subject and issuer name on its trusted certificate. The TA is not necessarily a trusted host in this sense, but often is.</p> + <p>In some schemes there are separate keys for servers and clients. A server can also be a client of another server, but a client can never be a server for another client. In general, trusted hosts and nontrusted hosts that operate as both server and client have parameter files that contain both server and client keys. Hosts that operate only as clients have key files that contain only client keys.</p> + <p>The PC scheme supports only one trusted host in the group. On trusted host <i>alice</i> run <tt>ntp-keygen -P -p <i>password</i></tt> to generate the host key file <tt>ntpkey_RSAkey_<i>alice.filestamp</i></tt> and trusted private certificate file <tt>ntpkey_RSA-MD5_cert_<i>alice.filestamp</i></tt>. Copy both files to all group hosts; they replace the files which would be generated in other schemes. On each host <i>bob</i> install a soft link from the generic name <tt>ntpkey_host_<i>bob</i></tt> to the host key file and soft link <tt>ntpkey_cert_<i>bob</i></tt> to the private certificate file. Note the generic links are on <i>bob</i>, but point to files generated by trusted host <i>alice</i>. In this scheme it is not possible to refresh either the keys or certificates without copying them to all other hosts in the group.</p> + <p>For the IFF scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host <i>alice</i> run <tt>ntp-keygen -T </tt><tt>-I -p <i>password</i></tt> to produce her parameter file <tt>ntpkey_IFFpar_<i>alice.filestamp</i></tt>, which includes both server and client keys. Copy this file to all group hosts that operate as both servers and clients and install a soft link from the generic <tt>ntpkey_iff_<i>alice</i></tt> to this file. If there are no hosts restricted to operate only as clients, there is nothing further to do. As the IFF scheme is independent of keys and certificates, these files can be refreshed as needed.</p> + <p>If a rogue client has the parameter file, it could masquerade as a legitimate server and present a middleman threat. To eliminate this threat, the client keys can be extracted from the parameter file and distributed to all restricted clients. After generating the parameter file, on <i>alice</i> run <tt>ntp-keygen</tt> <tt>-e</tt> and pipe the output to a file or mail program. Copy or mail this file to all restricted clients. On these clients install a soft link from the generic <tt>ntpkey_iff_<i>alice</i></tt> to this file. To further protect the integrity of the keys, each file can be encrypted with a secret password.</p> + <p>For the GQ scheme proceed as in the TC scheme to generate keys and certificates for all group hosts, then for every trusted host in the group, generate the IFF parameter file. On trusted host <i>alice</i> run <tt>ntp-keygen -T </tt><tt>-G -p <i>password</i></tt> to produce her parameter file <tt>ntpkey_GQpar_<i>alice.filestamp</i></tt>, which includes both server and client keys. Copy this file to all group hosts and install a soft link from the generic <tt>ntpkey_gq_<i>alice</i></tt> to this file. In addition, on each host <i>bob</i> install a soft link from generic <tt>ntpkey_gq_<i>bob</i></tt> to this file. As the GQ scheme updates the GQ parameters file and certificate at the same time, keys and certificates can be regenerated as needed.</p> + <p>For the MV scheme, proceed as in the TC scheme to generate keys and certificates for all group hosts. For illustration assume <i>trish</i> is the TA, <i>alice</i> one of several trusted hosts and <i>bob</i> one of her clients. On TA <i>trish</i> run <tt>ntp-keygen </tt><tt>-V <i>n</i> -p <i>password</i></tt>, where <i>n</i> is the number of revokable keys (typically 5) to produce the parameter file <tt>ntpkeys_MVpar_<i>trish.filestamp </i></tt>and client key files <tt>ntpkeys_MVkey<i>d</i>_<i>trish.filestamp</i></tt> where <i><tt>d</tt></i> is the key number (0 < <i><tt>d</tt></i> < <i>n</i>). Copy the parameter file to <i>alice</i> and install a soft link from the generic <tt>ntpkey_mv_<i>alice</i></tt> to this file. Copy one of the client key files to <i>alice</i> for later distribution to her clients. It doesn't matter which client key file goes to <i>alice</i>, since they all work the same way. <i>Alice</i> copies the client key file to all of her cliens. On client <i>bob</i> install a soft link from generic <tt>ntpkey_mvkey_<i>bob </i></tt>to the client key file. As the MV scheme is independent of keys and certificates, these files can be refreshed as needed.</p> + <h4 id="cmd">Command Line Options</h4> + <dl> + <dt><tt>-c [ RSA-MD2 | RSA-MD5 | RSA-SHA | RSA-SHA1 | RSA-MDC2 | RSA-RIPEMD160 | DSA-SHA | DSA-SHA1 ]</tt> + <dd>Select certificate message digest/signature encryption scheme. Note that RSA schemes must be used with a RSA sign key and DSA schemes must be used with a DSA sign key. The default without this option is <tt>RSA-MD5</tt>. + <dt><tt>-d</tt> + <dd>Enable debugging. This option displays the cryptographic data produced in eye-friendly billboards. + <dt><tt>-e</tt> + <dd>Write the IFF client keys to the standard output. This is intended for automatic key distribution by mail. + <dt><tt>-G</tt> + <dd>Generate parameters and keys for the GQ identification scheme, obsoleting any that may exist. + <dt><tt>-g</tt> + <dd>Generate keys for the GQ identification scheme using the existing GQ parameters. If the GQ parameters do not yet exist, create them first. + <dt><tt>-H</tt> + <dd>Generate new host keys, obsoleting any that may exist. + <dt><tt>-I</tt> + <dd>Generate parameters for the IFF identification scheme, obsoleting any that may exist. + <dt><tt>-i <i>name</i></tt> + <dd>Set the suject name to <i>name</i>. This is used as the subject field in certificates and in the file name for host and sign keys. + <dt><tt>-M</tt> + <dd>Generate MD5 keys, obsoleting any that may exist. + <dt><tt>-P</tt> + <dd>Generate a private certificate. By default, the program generates public certificates. + <dt><tt>-p <i>password</i></tt> + <dd>Encrypt generated files containing private data with <tt><i>password</i></tt> and the DES-CBC algorithm. + <dt><tt>-q</tt> + <dd>Set the password for reading files to <tt><i>password</i></tt>. + <dt><tt>-S [ RSA | DSA ]</tt> + <dd>Generate a new sign key of the designated type, obsoleting any that may exist. By default, the program uses the host key as the sign key. + <dt><tt>-s <i>name</i></tt> + <dd>Set the issuer name to <i>name</i>. This is used for the issuer field in certificates and in the file name for identity files. + <dt><tt>-T</tt> + <dd>Generate a trusted certificate. By default, the program generates a non-trusted certificate. + <dt><tt>-V <i>nkeys</i></tt> + <dd>Generate parameters and keys for the Mu-Varadharajan (MV) identification scheme. + </dl> + <h4 id="rand">Random Seed File</h4> + <p>All cryptographically sound key generation schemes must have means to randomize the entropy seed used to initialize the internal pseudo-random number generator used by the library routines. The OpenSSL library uses a designated random seed file for this purpose. The file must be available when starting the NTP daemon and <tt>ntp-keygen</tt> program. If a site supports OpenSSL or its companion OpenSSH, it is very likely that means to do this are already available.</p> + <p>It is important to understand that entropy must be evolved for each generation, for otherwise the random number sequence would be predictable. Various means dependent on external events, such as keystroke intervals, can be used to do this and some systems have built-in entropy sources. Suitable means are described in the OpenSSL software documentation, but are outside the scope of this page.</p> + <p>The entropy seed used by the OpenSSL library is contained in a file, usually called <tt>.rnd</tt>, which must be available when starting the NTP daemon or the <tt>ntp-keygen</tt> program. The NTP daemon will first look for the file using the path specified by the <tt>randfile</tt> subcommand of the <tt>crypto</tt> configuration command. If not specified in this way, or when starting the <tt>ntp-keygen</tt> program, the OpenSSL library will look for the file using the path specified by the <tt>RANDFILE</tt> environment variable in the user home directory, whether root or some other user. If the <tt>RANDFILE</tt> environment variable is not present, the library will look for the <tt>.rnd</tt> file in the user home directory. If the file is not available or cannot be written, the daemon exits with a message to the system log and the program exits with a suitable error message.</p> + <h4 id="priv">Cryptographic Data Files</h4> + <p>All other file formats begin with two lines. The first contains the file name, including the generated host name and filestamp. The second contains the datestamp in conventional Unix <tt>date</tt> format. Lines beginning with <tt>#</tt> are considered comments and ignored by the <i><tt>ntp-keygen </tt></i>program and <tt>ntpd</tt> daemon. Cryptographic values are encoded first using ASN.1 rules, then encrypted if necessary, and finally written PEM-encoded printable ASCII format preceded and followed by MIME content identifier lines.</p> + <p id="symkey">The format of the symmetric keys file is somewhat different than the other files in the interest of backward compatibility. Since DES-CBC is deprecated in NTPv4, the only key format of interest is MD5 alphanumeric strings. Following hte heard the keys are entered one per line in the format</p> + <p><i><tt>keyno type key</tt></i></p> + <p>where <i><tt>keyno</tt></i> is a positive integer in the range 1-65,535, <i><tt>type</tt></i> is the string <tt>MD5</tt> defining the key format and <i><tt>key</tt></i> is the key itself, which is a printable ASCII string 16 characters or less in length. Each character is chosen from the 93 printable characters in the range 0x21 through 0x7f excluding space and the '#' character.</p> + <p>Note that the keys used by the <tt>ntpq</tt> and <tt>ntpdc</tt> programs are checked against passwords requested by the programs and entered by hand, so it is generally appropriate to specify these keys in human readable ASCII format.</p> + <p>The <tt>ntp-keygen</tt> program generates a MD5 symmetric keys file <tt>ntpkey_MD5key_<i>hostname.filestamp</i></tt>. Since the file contains private shared keys, it should be visible only to root and distributed by secure means to other subnet hosts. The NTP daemon loads the file <tt>ntp.keys</tt>, so <tt>ntp-keygen</tt> installs a soft link from this name to the generated file. Subsequently, similar soft links must be installed by manual or automated means on the other subnet hosts. While this file is not used with the Autokey Version 2 protocol, it is needed to authenticate some remote configuration commands used by the <a href="ntpdc.html"><tt>ntpq</tt></a> and <a href="ntpq.html"><tt>ntpdc</tt></a> utilities.</p> + <h4 id="bug">Bugs</h4> + <p>It can take quite a while to generate some cryptographic values, from one to several minutes with modern architectures such as UltraSPARC and up to tens of minutes to an hour with older architectures such as SPARC IPC.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/ldisc.html b/contrib/ntp/html/ldisc.html new file mode 100644 index 0000000..428a251 --- /dev/null +++ b/contrib/ntp/html/ldisc.html @@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Line Disciplines and Streams Modules</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Line Disciplines and Streams Modules</h3> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:40</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links11.txt"></script> + <hr> + <h4>Description</h4> + <p>Most radio and modem clocks used for a primary (stratum-1) NTP server utilize serial ports operating at speeds of 9600 baud or greater. The intrinsic delay and jitter contributed by the serial port hardware and software driver can accumulate up to a millisecond in newer Unix systems and tens of milliseconds in older ones. In order to reduce the effects of delay and jitter, a set of special line disciplines, stream modules and operating system calls (<tt>ioctls</tt>) can be configured in some Unix kernels. These routines intercept special characters or signals provided by the radio or modem clock and save a timestamp for later processing.</p> + <p>The routines provide two important functions. Some insert a timestamp in the receive data stream upon occurance of a designated character or characters at the serial interface. This can be used to timestamp an on-time character produced by a radio clock, for example. Other routines support an application program interface for pulse-per-second (PPS) signals generated by some radio clocks and laboratory instruments. These routines are normally accessed through the PPSAPI application program interface described below.</p> + <p>The routines can be compiled in the kernel in older BSD-derived systems, or installed as System V streams modules and either compiled in the kernel or dynamically loaded when required. In either case, they require minor changes in some kernel files and in the NTP daemon <tt>ntpd</tt>. The streams modules can be pushed and popped from the streams stack using conventional System V streams program primitives. Note that some Unix kernels do not support line disciplines and some do not support System V streams. The routines described here are known to work correctly with the Unix kernels called out in the descriptions, but have not been tested for other kernels.</p> + <h4><tt>tty_clk</tt> Line Discipline/Streams Module</h4> + <p>This routine intercepts characters received from the serial port and passes unchanged all except a set of designated characters to the generic serial port discipline. For each of the exception characters, the character is inserted in the receiver buffer followed by a local timestamp in Unix <tt>timeval</tt> format. Both <tt>select()</tt> and <tt>SIGIO</tt> are supported by the routine. Support for this routine is automatically detected during the NTP build process and interface code compiled as necessary.</p> + <p>There are two versions of the <tt>tty_clk</tt> routine. The <tt>tty_clk.c</tt> line discipline is designed for older BSD systems and is compiled in the kernel. The <tt>tty_clk_STREAMS.c</tt> is designed for System V streams, in which case it can be either compiled in the kernel or dynamically loaded. Since these programs are small, unobtrusive, and do nothing unless specifically enabled by an application program, it probably doesn't matter which version is chosen. Instructions on how to configure and build a kernel supporting either of these routines is in the <tt>README</tt> file in the <tt>./kernel</tt> directory.</p> + <p>The <tt>tty_clk</tt> routine defines a new ioctl <tt>CLK_SETSTR</tt>, which takes a pointer to a string of no more than 32 characters. Until the first <tt>CLK_SETSTR</tt> is performed, the routine will simply pass through characters. Once it is passed a string by <tt>CLK_SETSTR</tt>, any character in that string will be immediately followed by a timestamp in Unix <tt>timeval</tt> format. You can change the string whenever you want by doing another <tt>CLK_SETSTR</tt>. The character must be an exact, 8 bit match. The character '\000' cannot, be used, as it is the string terminator. Passing an empty string to <tt>CLK_SETSTR</tt> turns off timestamping. Passing <tt>NULL</tt> may produce surprising results.</p> + <h4><tt>TIOCDCDTIMESTAMP</tt> ioctl in FreeBSD</h4> + <p>This ioctl is included in FreeBSD 2.2 and later. It causes a timestamp to be inserted in the serial port receive data stream when the data carrier detect (DCD) signal is asserted. This is useful for those radio clocks that indicate the on-time epoch by means of a modem control signal. It is not recommended that this be used for PPS timestamps, as this function is available using the PPS application program interface included in FreeBSD 3.4 and later.</p> + <p>The <tt>TIOCDCDTIMESTAMP</tt> ioctl() is detected and compiled automatically on FreeBSD systems if available. With FreeBSD 2.2 the measured delay between activation of the DCD signal and the time the timestamp is captured on a 66MHz 486DX2 is 19 <font face="Symbol">m</font>s and on a 100MHz Pentium is 6 <font face="Symbol">m</font>s.</p> + <h4><tt>ppsclock</tt>Streams Module (depredated)</h4> + <p>This routine is a streams module which causes a timestamp to be captured when the DCD signal is asserted. It is normally used in connection with a PPS signal generated by some radio clocks. However, it is normally used only by the PPSAPI interface and SunOS 4.1.3 and should be avoided in other contexts. Instructions on how to configure and build a kernel supporting either of these routines is in the <tt>README</tt> file in the <tt>./kernel</tt> directory.</p> + <p>The ppsclock streams module implements the <tt>CIOGETEV</tt> ioctl, which takes a pointer to the structure</p> + <pre> +struct ppsclockev { + struct timeval tv; + u_int serial; +}; +</pre> + <p>The <tt>ppsclock</tt> module is pushed on the streams stack of the serial port connected to the DCD line. At each positive-going edge of the PPS signal, the routine latches the current local timestamp and increments a counter. At each <tt>CIOGETEV</tt> ioctl call, the current values of the timestamp and counter are returned in the <tt>ppsclockev</tt> structure.</p> + <h4><tt>TIOCSPPS</tt> and <tt>TIOCGETPPSEV</tt> ioctls in Solaris</h4> + <p>These ioctls are included in Solaris 2.4 and later. They implement the same function as the <tt>ppsclock</tt> streams module, but are implemented as integrated system calls independent of the streams facility. They are normally used in connection with a pulse-per-second (PPS) signal generated by some radio clocks. However, these ioctls are normally used only by the PPSAPI interface and should be avoided in other contexts. See the Sun documentation for the calling sequence and return values.</p> + <p>Users are cautioned that these ioctls function improperly in Solaris versions prior to 2.8 with patch Generic_108528-02.</p> + <h4><tt>tty_chu</tt> Line Discipline/Streams Module (depredated)</h4> + <p>This routine is a special purpose line discipline for receiving a special timecode broadcast by Canadian time and frequency standard station CHU. It has been removed from the distribution since its function has been replaced by the <a href="drivers/driver7.html">Radio CHU Audio Demodulator/Decoder (type 7)</a> clock driver.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/manyopt.html b/contrib/ntp/html/manyopt.html new file mode 100644 index 0000000..83869ca --- /dev/null +++ b/contrib/ntp/html/manyopt.html @@ -0,0 +1,83 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Automatic NTP Configuration Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Automatic NTP Configuration Options</h3> + <img src="pic/alice51.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Make sure who your friends are.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">20:55</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="275">Tuesday, October 11, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links9.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#bcst">Broadcasting</a> + <li class="inline"><a href="#mcst">Manycasting</a> + <li class="inline"><a href="#orphan">Orphan Mode</a> + <li class="inline"><a href="#opt">Server Discovery Options</a> + </ul> + <hr> + <h4 id="bcst">Broadcasting</h4> + <p>Broadcasting is the simplest way to provide automatic server discovery. It uses the multi-destination paradigm, where the subnet spanning tree is constructed automatically, either by the switches in an Ethernet LAN or the DVMRP or PIM protocols when spanning multiple networks.</p> + <p>A broadcast or multicast server is mobilized by the broadcast configuration command. The addresses can be either from the IPv4 broadcast/mulitcast address family or the IPv6 address family. Multiple broadcast server associations can be specified for a single host.</p> + <p>A host is enabled for broadcast reception using the <tt>broadcastclient</tt> configuration command, with or without the <tt>novolley</tt> option. Upon receiving the first message from a broadcast server, the client mobilizes an ephemeral client association and exchanges a volley of client/server messages in order to quickly authenticate the source, set the clock and measure the propagation delay, then reverts to listen-only mode. A multicast client is mobilized in the same way using the <tt>multicastclient</tt> configuration command and specified multicast group address.</p> + <p>Broadcasting can be used with either symmetric key or public key cryptography. Public key cryptography offers the best protection against compromised keys and is generally considered stronger. By default, either of these two means is required, but this can be overridden by the <tt>disable auth</tt> command.</p> + <p>In both broadcast and multicast client operations the client association is demobilized in case of error or timeout due to loss of server or connectivity. </p> + <h4 id="mcst">Manycasting</h4> + <p>Manycasting is a automatic discovery and configuration paradigm new to NTPv4. It is intended as a means for a client to troll the nearby network neighborhood to find cooperating servers, validate them using cryptographic means and evaluate their time values with respect to other servers that might be lurking in the vicinity. The intended result is that each client mobilizes associations with a given number of the "best" nearby servers, yet automatically reconfigures to sustain this number of servers should one or another fail.</p> + <p>Note that the manycast paradigm does not coincide with the anycast paradigm described in RFC-1546, which is designed to find a single server from a clique of servers providing the same service. The manycast paradigm is designed to find a plurality of redundant servers satisfying defined optimality criteria.</p> + <p>Manycasting can be used with either symmetric key or public key cryptography. Public key cryptography offers the best protection against compromised keys and is generally considered stronger. By default, either of these two means is required, but this can be overridden by the <tt>disable auth</tt> command.</p> + <p>A manycast client association is configured using the <tt>manycastclient</tt> configuration command, which is similar to the <tt>server</tt> configuration command, but with a broadcast or multicast address. Depending on address family. The manycast client sends ordinary client mode messages, but with a broadcast address rather than a unicast address. It sends only if less than a given threshold of servers have been found and then only at the minimum feasible rate and minimum feasible time-to-live (TTL) hops. There can be as many manycast client associations as different broadcast addresses, each one serving as a template for a future unicast client/server association.</p> + <p>Manycast servers configured with the <tt>manycastserver</tt> command listen on the specified broadcast address for manycast client messages. If a manycast server is in scope of the current TTL and is itself synchronized to a valid source and operating at a stratum level equal to or lower than the manycast client, it replies to the manycast client message with an ordinary unicast server message.</p> + <p>The manycast client receiving this message mobilizes a preemptable client association according to the matching manycast client template, but only if cryptographically authenticated and the server stratum is less than or equal to the client stratum. The client runs the NTP mitigation algorithms, which act to demobilize all but a threshold number of associations according to stratum and synchronization distance. The surviving associations then continue in ordinary client/server mode.</p> + <p>If for some reason the number of available servers falls below the threshold, the manycast client resumes sending broadcast messages. The polling strategy is designed to reduce as much as possible the volume of broadcast messages and the effects of implosion due to near-simultaneous arrival of manycast server messages. The strategy is determined by the <tt>tos</tt> and <tt>ttl</tt> configuration commands described below.</p> + <p>It is possible and frequently useful to configure a host as both manycast client and manycast server. A number of hosts configured this way and sharing a common group address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.</p> + <p>For example, consider an NTP subnet of two primary servers and several secondary servers and a number of dependent clients. With twoAll servers and clients have identical configuration files including both <tt>multicastclient</tt> and <tt>multicastserver</tt> commands using, for instance, multicast group address 239.1.1.1. Each primary server configuration file must include commands for the primary reference source such as a GPS receiver.</p> + <p>The remaining configuration files for all secondary servers and clients have the same contents, except for the <tt>tos</tt> command, which is specific for each stratum level. For stratum 1 and stratum 2 servers, that command is not necessary. For stratum 3 and above servers the <tt>tos floor</tt> value is set to the intended stratum number. Thus, all stratum 3 configuration files use <tt>tos floor 3</tt>, all stratum 4 files use <tt>tos floor 4</tt> and so forth.</p> + <p>Once operations have stabilized, the primary servers will find the primary reference source and each other, since they both operate at the same stratum (1), but not with any secondary server or client, since these operate at a higher stratum. The secondary servers will find the servers at the same stratum level. If one of the primary servers loses its GPS receiver, it will continue to operate as a client and other clients will time out the corresponding association and re-associate accordingly.</p> + <h4 id="orphan">Orphan Mode</h4> + <p>Sometimes it is necessary to operate an NTP subnet in isolation, because a local reference clock is unavailable or connectivity to the Internet is not provided. In such cases it may be necessary that the subnet servers and clients remain synchronized to a common timescale, not necessarily the UTC timescale. Previously, this function was provided by the local clock driver, which could be configured for a server that could be reached, directly or indirectly from all other servers and clients in the subnet.</p> + <p>There are many disadvantages using the local clock driver: multiple source redundancy is not possible and the subnet is vulnerable to single-point failures. Orphan mode is intended to replace the need for the local clock driver. It operates in subnet configurations in all modes, including broadcast, and multiple servers and clients and handles seamless switching as primary sources fail and recover.</p> + <p>A server or client is enabled for orphan mode using the <tt>tos orphan <i>stratum</i></tt> command, where <tt><i>stratum</i></tt> is some stratum less than 16 and greater than any anticipated stratum that might occur with ordinary Internet servers. This is the same consideration that guides the local clock driver stratum.</p> + <p>As long as the stratum of any orphan is less than the orphan stratum, the servers and clients operate in the normal way. However, if the stratum equals or exceeds this stratum, the server or client is considered an orphan. If under these conditions a host has no sources of the same or lower stratum, it is designated an orphan parent; otherwise, it is considered an orphan child. Orphan parents show offset zero, root delay zero and reference ID 127.0.0.1, which of course is the Unix loopback address. Orphan children show the mitigated offset of their servers, root delay randomized over a moderate range and reference ID of their system peer. An important distinction is that the entire subnet operates at the same orphan stratum and that the order of preference is the root delay, not the stratum and root distance as usual.</p> + <p>For the most flexible and reliable operation, all servers and clients in the subnet should include the <tt>orphan</tt> command in the configuration file and with the same orphan stratum. This provides mutual redundancy and diversity for all NTP modes of operation, including broadcast.</p> + <p>For example, consider the case where several campus secondary (stratum 2) servers are configured for public Internet primary servers and with each other using symmetric modes. These servers provide synchronization with a number of department servers using broadcast mode, where each of these servers is configured as both a broadcast server and broadcast client. Individual workstations on the department LAN are configured as broadcast clients only. All servers (not necessarily the clients) have the <tt>orphan 5</tt> command, for example.</p> + <p>In normal operation all servers and clients operate below stratum 5, so operate with the subnet configuration determined by stratum and root distance. If all sources are lost at any stratum level, the server or client continues operation as orphan parent. However, if sources at the orphan stratum are found, the host synchronizes to the source with lowest root delay. Since orphan root delay is determined randomly at startup, loops are avoided, even in broadcast modes where multiple servers are available.</p> + <h4 id="opt">Server Discovery Options</h4> + <dl> + <dt><tt>tos [ ceiling <i>ceiling</i> | cohort {0 | 1} | floor <i>floor</i> | orphan <i>orphan</i> | maxdistance <i>maxdistance</i> | minclock <i>minclock</i> | minsane <i>minsane</i> ]</tt> + <dd>This command affects the clock selection and clustering algorithms. It can be used to select the quality and quantity of peers used to synchronize the system clock and is most useful in manycast mode. The variables operate as follows: + <dl> <dt><tt>beacon <i>beacon</i></tt> + <dd>The manycast server sends packets at intervals of 64 s if less than <i><tt>maxclock</tt></i> servers are available. Otherwise, it sends packets at the <i><tt>beacon</tt></i> interval in seconds. The default is 3600 s.<dt><tt>ceiling <i>ceiling</i></tt> + <dd>Servers with stratum at or above <i>ceiling</i> will be discarded if there are at least <i><tt>minclock</tt></i> peers remaining. This value defaults to 15, but can be changed to any number from 1 to 15. + <dt><tt>cohort { 0 | 1 }</tt> + <dd>This is a binary flag which enables (0) or disables (1) manycast server replies to manycast clients with the same stratum level. This is useful to reduce implosions where large numbers of clients with the same stratum level are present. The default is to enable these replies. + <dt><tt>floor <i>floor</i></tt> + <dd>Peers with strata below <i>floor</i> will be discarded if there are at least <i>minclock</i> peers remaining. This value defaults to 1, but can be changed to any number from 1 to 15. + <dt><tt>orphan <i>stratum</i></tt> + <dd>If <tt><i>stratum</i></tt> is set at some value less than 16 a special orphan mode is enterred when no outside source of synchronization is available. To use orphan mode a number of participants are identically configured both as broadcast client and as broadcast server. One or more participants are configured to use an outside source, either a reference clock or another Internet server. When the source or sources fail, the system stratum is set at <tt><i>stratum</i></tt> and a leader is elected to serve as the reference source. When an outside source of synchronization is again available, the orphan mode is disabled.<dt><tt>mindist <i>mindistance</i></tt> + <dd>The slection algorithm normally pads each intersection a minimum of one millisecond to avoid needless classification. In some cases, such as reference clocks with high jitter and a PPS signal, it is useful to increase the padding. This command can be used for that purpose. As a general rule, set the mindistance to the maximum expected offset plus the maxiumum expected jitter, in seconds. + <dt><tt>maxdist <i>maxdistance</i></tt> + <dd>The selection algorithm accumulates a number of packets before setting the clock in order to use the best data available. The number is determined by the synchronization distance for each association and a limit called the distance threshold. The synchronization distance starts at 16, then drops by a factor of about two as each packet is received. The default distance threshold is 1.0, which usually results in four packets. Setting maxdistance to some value between 1 and 16 can be used to change the number of packets required. For instance, setting it to 16 will set the clock on the first packet received; howver, setting it to this value essentially disables the mitigation and grooming algorithms. + <dt><tt>minclock <i>minclock</i></tt> + <dd>The clustering algorithm repeatedly casts out outlyer associations until no more than <i>minclock</i> associations remain. This value defaults to 3, but can be changed to any number from 1 to the number of configured sources. + <dt><tt>minsane <i>minsane</i></tt> + <dd>This is the minimum number of candidates available to the clock selection algorithm in order to produce one or more truechimers for the clustering algorithm. If fewer than this number are available, the clock is undisciplined and allowed to run free. The default is 1 for legacy purposes. However, according to principles of Byzantine agreement, <i>minsane</i> should be at least 4 in order to detect and discard a single falseticker. + </dl> + + <dt><tt>ttl <i>hop</i> ...</tt> + <dd>This command specifies a list of TTL values in increasing order. up to 8 values can be specified. In manycast mode these values are used in turn in an expanding-ring search. The default is eight multiples of 32 starting at 31. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/measure.html b/contrib/ntp/html/measure.html new file mode 100644 index 0000000..9cce97a --- /dev/null +++ b/contrib/ntp/html/measure.html @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Time and Time Interval Measurement with Application to Computer and Network Performance Evaluation</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Time and Time Interval Measurement with Application to Computer and Network Performance Evaluation</h3> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:41</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <hr> + <p>The technical memorandum: <cite>Time and Time Interval Measurement with Application to Computer and Network Performance Evaluation</cite><a href="http://www.eecis.udel.edu/%7emills/database/memos/memo96a.ps">(PostScript) </a>describes a number of techniques for conducting experiments typical of computer network and transmission systems engineering.</p> + <p>In most experiments in which time is involved, it is necessary to develop estimates of time, frequency and measurement errors from a series of time measurements between the clocks of a number of computers and ancillary devices interconnected by some kind of computer network. However, time is not a physical quantity, such as mass, nor can it be measured relative to an absolute frame of reference, such as velocity. The only way to measure time in our universe is to compare the reading of one clock, which runs according to its own timescale, with another clock, which runs according to a given timescale, at some given instant or epoch. The errors arise from the precision of time comparisons and the accuracy of frequency estimates between the timescales involved.</p> + <p>The usual data collected during a performance run of some experiment might include time offsets, time delays, frequency offsets and various error statistics. While time offsets between two clocks can be measured directly, frequency offsets can be estimated only from two or more time offsets made over some time interval in the experiment. In practice, a sequence of time comparisons can be performed over the lifetime of the experiment and the instantaneous frequency estimated either in real time with a recurrence relation, or retrospectively with a polynomial fit to the data.</p> + <p>Estimating time and frequency errors in real time has been studied by a distinct subspecies of physicists who have made a career of the technology involved. Various means including autoregressive models, Kalman filters and simple weighted-average algorithms are used extensively by national standards laboratories to model cesium-clock ensembles. These techniques have been adapted to computer network and transmission engineering problems as well. This memorandum explores issues in performing experiments of this type and summarizes various techniques found useful in practice.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/miscopt.html b/contrib/ntp/html/miscopt.html new file mode 100644 index 0000000..54041b1 --- /dev/null +++ b/contrib/ntp/html/miscopt.html @@ -0,0 +1,123 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Miscellaneous Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Miscellaneous Options</h3> + <img src="pic/boom3.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>We have three, now looking for more.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:50</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="271">Monday, January 09, 2006</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <hr> + <dl> + <dt><tt>broadcastdelay <i>seconds</i></tt> + <dd>The broadcast and multicast modes require a special calibration to determine the network delay between the local and remote servers. Ordinarily, this is done automatically by the initial protocol exchanges between the client and server. In some cases, the calibration procedure may fail due to network or server access controls, for example. This command specifies the default delay to be used under these circumstances. Typically (for Ethernet), a number between 0.003 and 0.007 seconds is appropriate. The default when this command is not used is 0.004 seconds. + <dt><tt>calldelay <i>delay</i></tt> + <dd>This option controls the delay in seconds between the first and second packets sent in burst or iburst mode to allow additional time for a modem or ISDN call to complete. + <dt><tt>driftfile <i>driftfile</i> [<i> + minutes </i> [<i> tolerance </i>] ]</tt> + <dd>This command specifies the complete path and name of the file used to record the frequency of the local clock oscillator. This is the same operation as the <tt>-f</tt> command linke option. If the file exists, it is read at startup in order to set the initial frequency and then updated once per hour with the current frequency computed by the daemon. If the file name is specified, but the file itself does not exist, the starts with an initial frequency of zero and creates the file when writing it for the first time. If this command is not given, the daemon will always start with an initial frequency of zero. + <p>The file format consists of a single line containing a single floating point number, which records the frequency offset measured in parts-per-million (PPM). The file is updated by first writing the current drift value into a temporary file and then renaming this file to replace the old version. This implies that <tt>ntpd</tt> must have write permission for the directory the drift file is located in, and that file system links, symbolic or otherwise, should be avoided.</p> + +<p>The two optional values determine how often the file is written, and +are particuarly useful when is it desirable to avoid spinning up the +disk unnecessarily. The parameter <tt>minutes</tt> is how often the file will be written. If omitted or less +than 1, the interval will be 60 minutes (one hour). The parameter <tt>tolerance</tt> is the +threshold to skip writing the new value. If the new value is within +<tt>tolerance</tt> percent of the last value written (compared out to 3 +decimal places), the write will be +skipped. The default is 0.0, which means that the write will occur +unless the current and previous values are the same. A tolerance of +.1 equates roughly to a difference in the 2nd decimal place.</p> +<dt><tt>enable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]</tt><br> + <tt>disable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats ]</tt> + <dd>Provides a way to enable or disable various system options. Flags not mentioned are unaffected. Note that all of these flags can be controlled remotely using the <a href="ntpdc.html"><tt>ntpdc</tt></a> utility program. + <dl> + <dt><tt>auth</tt> + <dd>Enables the server to synchronize with unconfigured peers only if the peer has been correctly authenticated using either public key or private key cryptography. The default for this flag is enable. + <dt><tt>bclient</tt> + <dd>Enables the server to listen for a message from a broadcast or multicast server, as in the <tt>multicastclient</tt> command with default address. The default for this flag is disable. + <dt><tt>calibrate</tt> + <dd>Enables the calibrate feature for reference clocks. The default for this flag is disable. + <dt><tt>kernel</tt> + <dd>Enables the kernel time discipline, if available. The default for this flag is enable if support is available, otherwise disable. + <dt><tt>monitor</tt> + <dd>Enables the monitoring facility. See the <tt>ntpdc</tt> program and the <tt>monlist</tt> command or further information. The default for this flag is enable. + <dt><tt>ntp</tt> + <dd>Enables time and frequency discipline. In effect, this switch opens and closes the feedback loop, which is useful for testing. The default for this flag is enable. + <dt><tt>pps</tt> + <dd>Enables the pulse-per-second (PPS) signal when frequency and time is disciplined by the precision time kernel modifications. See the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page for further information. The default for this flag is disable. + <dt><tt>stats</tt> + <dd>Enables the statistics facility. See the <a href="monopt.html">Monitoring Options</a> page for further information. The default for this flag is disable + </dl> + <dt><tt>includefile <i>includefile</i></tt> + <dd>This command allows additional configuration commands to be included from a separate file. Include files may be nested to a depth of five; upon reaching the end of any include file, command processing resumes in the previous configuration file. This option is useful for sites that run <tt>ntpd</tt> on multiple hosts, with (mostly) common options (e.g., a restriction list). + <dt><tt>logconfig <i>configkeyword</i></tt> + <dd>This command controls the amount and type of output written to the system <tt>syslog</tt> facility or the alternate <tt>logfile</tt> log file. All <i><tt>configkeyword</tt></i> keywords can be prefixed with <tt>=</tt>, <tt>+</tt> and <tt>-</tt>, where <tt>=</tt> sets the <tt>syslogmask</tt>, <tt>+</tt> adds and <tt>-</tt> removes messages. <tt>syslog messages</tt> can be controlled in four classes (<tt>clock</tt>, <tt>peer</tt>, <tt>sys</tt> and <tt>sync</tt>). Within these classes four types of messages can be controlled: informational messages (<tt>info</tt>), event messages (<tt>events</tt>), statistics messages (<tt>statistics</tt>) and status messages (<tt>status</tt>). + <p>Configuration keywords are formed by concatenating the message class with the event class. The <tt>all</tt> prefix can be used instead of a message class. A message class may also be followed by the <tt>all</tt> keyword to enable/disable all messages of the respective message class. By default, <tt>logconfig</tt> output is set to <tt>allsync</tt>. + <p>Thus, a minimal log configuration could look like this:</p> + <p><tt>logconfig=syncstatus +sysevents</tt></p> + <dl> + <dd> + <p>This would just list the synchronizations state of <tt>ntpd</tt> and the major system events. For a simple reference server, the following minimum message configuration could be useful:</p> + + </dl> + + <dd> + <p><tt>logconfig=allsync +allclock</tt></p> + <dl> + <dd> + <p>This configuration will list all clock information and synchronization information. All other events and messages about peers, system events and so on is suppressed.</p> + + </dl> + <dt><tt>logfile <i>logfile</i></tt> + <dl> + <dd> + <p>This command specifies the location of an alternate log file to be used instead of the default system <tt>syslog</tt> facility. This is the same operation as the <tt>-l </tt>command line option.</p> + + </dl> + <dt><tt>phone <i>dial</i>1 <i>dial</i>2 ...</tt> + <dl> + <dd>This command is used in conjunction with the ACTS modem driver (type 18). The arguments consist of a maximum of 10 telephone numbers used to dial USNO, NIST or European time services. The Hayes command ATDT is normally prepended to the number, which can contain other modem control codes as well. + </dl> + <dt><tt>setvar <i>variable</i> [default]</tt> + <dd>This command adds an additional system variable. These variables can be used to distribute additional information such as the access policy. If the variable of the form <tt><i>name</i> = <i>value</i></tt> is followed by the <tt>default</tt> keyword, the variable will be listed as part of the default system variables (<tt>ntpq rv</tt> command). These additional variables serve informational purposes only. They are not related to the protocol other that they can be listed. The known protocol variables will always override any variables defined via the <tt>setvar</tt> mechanism. There are three special variables that contain the names of all variable of the same group. The <tt>sys_var_list</tt> holds the names of all system variables. The <tt>peer_var_list</tt> holds the names of all peer variables and the <tt>clock_var_list</tt> holds the names of the reference clock variables. + <dt><tt>tinker [ allan <i>allan</i> | dispersion <i>dispersion</i> | freq <i>freq</i> | huffpuff <i>huffpuff</i> | panic <i>panic</i> | step <i>step</i> | stepout <i>stepout</i> ]</tt> + <dd>This command can be used to alter several system variables in very exceptional circumstances. It should occur in the configuration file before any other configuration options. The default values of these variables have been carefully optimized for a wide range of network speeds and reliability expectations. In general, they interact in intricate ways that are hard to predict and some combinations can result in some very nasty behavior. Very rarely is it necessary to change the default values; but, some folks can't resist twisting the knobs anyway and this command is for them. Emphasis added: twisters are on their own and can expect no help from the support group. + <p>The variables operate as follows:</p> + <dl> + <dt><tt>allan <i>allan</i></tt> + <dd>The argument becomes the new value for the Allan intercept, which is a parameter of the PLL/FLL clock discipline algorithm. The value is in seconds with default 1500 s, which is appropriate for most computer clocks.<dt><tt>dispersion <i>dispersion</i></tt> + <dd>The argument becomes the new value for the dispersion increase rate, normally .000015 s/s. + <dt><tt>freq <i>freq</i></tt> + <dd>The argument becomes the initial value of the frequency offset in parts-per-million. This overrides the value in the frequency file, if present, and avoids the initial training state if it is not. + <dt><tt>huffpuff <i>huffpuff</i></tt> + <dd>The argument becomes the new value for the experimental huff-n'-puff filter span, which determines the most recent interval the algorithm will search for a minimum delay. The lower limit is 900 s (15 m), but a more reasonable value is 7200 (2 hours). There is no default, since the filter is not enabled unless this command is given. + <dt><tt>panic <i>panic</i></tt> + <dd>The argument is the panic threshold, by default 1000 s. If set to zero, the panic sanity check is disabled and a clock offset of any value will be accepted. + <dt><tt>step <i>step</i></tt> + <dd>The argument is the step threshold, by default 0.128 s. It can be set to any positive number in seconds. If set to zero, step adjustments will never occur. Note: The kernel time discipline is disabled if the step threshold is set to zero or greater than the default. + <dt><tt>stepout <i>stepout</i></tt> + <dd>The argument is the stepout timeout, by default 900 s. It can be set to any positive number in seconds. If set to zero, the stepout pulses will not be suppressed. + </dl> + <dt><tt>trap <i>host_address</i> [port <i>port_number</i>] [interface <i>interface_address</i>]</tt> + <dd>This command configures a trap receiver at the given host address and port number for sending messages with the specified local interface address. If the port number is unspecified, a value of 18447 is used. If the interface address is not specified, the message is sent with a source address of the local interface the message is sent through. Note that on a multihomed host the interface used may vary from time to time with routing changes. + <p>The trap receiver will generally log event messages and other information from the server in a log file. While such monitor programs may also request their own trap dynamically, configuring a trap receiver will ensure that no messages are lost when the server is started.</p> + <dt><tt>ttl <i>hop</i> ...</tt> + <dd>This command specifies a list of TTL values in increasing order. up to 8 values can be specified. In manycast mode these values are used in turn in an expanding-ring search. The default is eight multiples of 32 starting at 31. + </dl> + <h4>Files</h4> + <tt>ntp.drift</tt> frequency compensation (PPM) + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/monopt.html b/contrib/ntp/html/monopt.html new file mode 100644 index 0000000..a4c073a --- /dev/null +++ b/contrib/ntp/html/monopt.html @@ -0,0 +1,132 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Monitoring Options</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Monitoring Options</h3> + <img src="pic/pogo8.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>The pig watches the logs.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">00:40</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="290">Sunday, December 24, 2006</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <hr> + <tt>ntpd</tt> includes a comprehensive monitoring facility suitable for continuous, long term recording of server and client timekeeping performance. See the <tt>statistics</tt> command below for a listing and example of each type of statistics currently supported. Statistic files are managed using file generation sets and scripts in the <tt>./scripts</tt> directory of this distribution. Using these facilities and Unix <tt>cron</tt> jobs, the datacan be automatically summarized and archived for retrospective analysis. + <h4>Monitoring Commands</h4> + <dl> + <dt><tt>statistics <i>name</i> [...]</tt> + <dd>Enables writing of statistics records. Currently, six kinds of <i><tt>name</tt></i>statistics are supported. + <dl> + <dt><tt>clockstats</tt> + <dd>Enables recording of clock driver statistics information. Each update received from a clock driver appends a line of the following form to the file generation set named <tt>clockstats</tt>: + <dd><tt>49213 525.624 127.127.4.1 93 226 00:08:29.606 D</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next field shows the clock address in dotted-quad notation, The final field shows the last timecode received from the clock in decoded ASCII format, where meaningful. In some clock drivers a good deal of additional information can be gathered and displayed as well. See information specific to each clock for further details. + <dt><tt>cryptostats</tt> + <dd>This option requires the OpenSSL cryptographic software library. It enables recording of cryptographic public key protocol information. Each message received by the protocol module appends a line of the following form to the file generation set named <tt>cryptostats</tt>: + <dd><tt>49213 525.624 127.127.4.1 <i>message</i></tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next field shows the peer address in dotted-quad notation, The final <tt><i>message</i></tt> field includes the message type and certain ancillary information. See the <a href="authopt.html">Authentication Options</a> page for further information. + <dt><tt>loopstats</tt> + <dd>Enables recording of loop filter statistics information. Each update of the local clock outputs a line of the following form to the file generation set named <tt>loopstats</tt>: + <dd><tt>50935 75440.031 0.000006019 13.778190 0.000351733 0.0133806 6</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next five fields show time offset (seconds), frequency offset (parts per million - PPM), RMS jitter (seconds), Allan deviation (PPM) and clock discipline time constant. + <dt><tt>peerstats</tt> + <dd>Enables recording of peer statistics information. This includes statistics records of all peers of a NTP server and of special signals, where present and configured. Each valid update appends a line of the following form to the current element of a file generation set named <tt>peerstats</tt>: + <dt><tt>48773 10847.650 127.127.4.1 9714 -0.001605376 0.000000000 0.001424877 0.000958674</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next two fields show the peer address in dotted-quad notation and status, respectively. The status field is encoded in hex in the format described in Appendix B of the NTP specification RFC 1305. The final four fields show the offset, delay, dispersion and RMS jitter, all in seconds. + <dt><tt>rawstats</tt> + <dd>Enables recording of raw-timestamp statistics information. This includes statistics records of all peers of a NTP server and of special signals, where present and configured. Each NTP message received from a peer or clock driver appends a line of the following form to the file generation set named <tt>rawstats</tt>: + <dt><tt>50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031 02453332.540806000 3102453332.541458000</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next two fields show the remote peer or clock address followed by the local address in dotted-quad notation, The final four fields show the originate, receive, transmit and final NTP timestamps in order. The timestamp values are as received and before processing by the various data smoothing and mitigation algorithms. + <dt><tt>sysstats</tt> + <dd>Enables recording of <tt>ntpd</tt> statistics counters on a periodic basis. Each hour a line of the following form is appended to the file generation set named <tt>sysstats</tt>: + <dd><tt>50928 2132.543 36000 81965 0 9546 56 71793 512 540 10 147</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The remaining ten fields show the statistics counter values accumulated since the last generated line. + <dl> + <dt>Time since restart <tt>36000</tt> + <dd>Time in hours since the system was last rebooted. + <dt>Packets received <tt>81965</tt> + <dd>Total number of packets received. + <dt>Packets processed <tt>0</tt> + <dd>Number of packets received in response to previous packets sent + <dt>Current version <tt>9546</tt> + <dd>Number of packets matching the current NTP version. + <dt>Previous version <tt>56</tt> + <dd>Number of packets matching the previous NTP version. + <dt>Bad version <tt>71793</tt> + <dd>Number of packets matching neither NTP version. + <dt>Access denied <tt>512</tt> + <dd>Number of packets denied access for any reason. + <dt>Bad length or format <tt>540</tt> + <dd>Number of packets with invalid length, format or port number. + <dt>Bad authentication <tt>10</tt> + <dd>Number of packets not verified as authentic. + <dt>Rate exceeded <tt>147</tt> + <dd>Number of packets discarded due to rate limitation. + </dl> + <dt><tt>timingstats</tt> + <dd><b>ONLY</b> available when the deamon is compiled with process time debugging support (--enable-debug-timing - costs performance). Enables recording of <tt>ntpd</tt> processing time information for various selected code paths: + <dd><tt>53876 36.920 10.0.3.5 1 0.000014592 input processing delay</tt> + <dd>The first two fields show the date (Modified Julian Day) and time (seconds and fraction past UTC midnight). The next field is a potential <tt>peer address</tt>, <tt>-</tt> or <tt>-REFCLOCK-</tt> depending on the associated io source. Then an event count for the number of processed events in the code path follows. The fifth field is the total time spend for the events. The rest of the line denotes the code path description (see source for more information). + <dt><tt>statsdir <i>directory_path</i></tt> + <dd>Indicates the full path of a directory where statistics files should be created (see below). This keyword allows the (otherwise constant) <tt>filegen</tt> filename prefix to be modified for file generation sets, which is useful for handling statistics logs. + <dt><tt>filegen <i>name</i> [file <i>filename</i>] [type <i>typename</i>] [link | nolink] [enable | disable]</tt> + <dd>Configures setting of generation file set <i>name</i>. Generation file sets provide a means for handling files that are continuously growing during the lifetime of a server. Server statistics are a typical example for such files. Generation file sets provide access to a set of files used to store the actual data. At any time at most one element of the set is being written to. The type given specifies when and how data will be directed to a new element of the set. This way, information stored in elements of a file set that are currently unused are available for administrational operations without the risk of disturbing the operation of <tt>ntpd</tt>. (Most important: they can be removed to free space for new data produced.) + <dd>Note that this command can be sent from the <tt>ntpdc</tt> program running at a remote location. + <dl> + <dt><i><tt>name</tt></i> + <dd>This is the type of the statistics records, as shown in the <tt>statistics</tt> command. + </dl> + <dd><tt>file <i>filename</i></tt> + <dl> + <dd>This is the file name for the statistics records. Filenames of set members are built from three concatenated elements <i><tt>prefix</tt></i>, <i><tt>filename</tt></i> and <i><tt>suffix</tt></i>: + <dl> + <dt><i><tt>prefix</tt></i> + <dd>This is a constant filename path. It is not subject to modifications via the <tt>filegen</tt> option. It is defined by the server, usually specified as a compile-time constant. It may, however, be configurable for individual file generation sets via other commands. For example, the prefix used with <tt>loopstats</tt> and <tt>peerstats</tt> generation can be configured using the <tt>statsdir</tt> option explained above. + <dt><i><tt>filename</tt></i> + <dd>This string is directly concatenated to the prefix mentioned above (no intervening <tt>/</tt> (slash)). This can be modified using the <tt>file</tt> argument to the <tt>filegen</tt> statement. No <tt>..</tt> elements are allowed in this component to prevent filenames referring to parts outside the filesystem hierarchy denoted by <tt>prefix</tt>. + <dt><i><tt>suffix</tt></i> + <dd>This part is reflects individual elements of a file set. It is generated according to the type of a file set. + </dl> + </dl> + <dd><tt>type <i>typename</i></tt> + <dl> + <dd>A file generation set is characterized by its type. The following types are supported: + <dl> + <dt><tt>none</tt> + <dd>The file set is actually a single plain file. + <dt><tt>pid</tt> + <dd>One element of file set is used per incarnation of a <tt>ntpd</tt> server. This type does not perform any changes to file set members during runtime, however it provides an easy way of separating files belonging to different <tt>ntpd</tt> server incarnations. The set member filename is built by appending a <tt>.</tt> (dot) to concatenated <i>prefix</i> and <i>filename</i> strings, and appending the decimal representation of the process ID of the <tt>ntpd</tt> server process. + <dt><tt>day</tt> + <dd>One file generation set element is created per day. A day is defined as the period between 00:00 and 24:00 UTC. The file set member suffix consists of a <tt>.</tt> (dot) and a day specification in the form <tt>YYYYMMdd. YYYY</tt> is a 4-digit year number (e.g., 1992). <tt>MM</tt> is a two digit month number. <tt>dd</tt> is a two digit day number. Thus, all information written at 10 December 1992 would end up in a file named <tt><i>prefix filename</i>.19921210</tt>. + <dt><tt>week</tt> + <dd>Any file set member contains data related to a certain week of a year. The term week is defined by computing day-of-year modulo 7. Elements of such a file generation set are distinguished by appending the following suffix to the file set filename base: A dot, a 4-digit year number, the letter <tt>W</tt>, and a 2-digit week number. For example, information from January, 10th 1992 would end up in a file with suffix <tt>.1992W1</tt>. + <dt><tt>month</tt> + <dd>One generation file set element is generated per month. The file name suffix consists of a dot, a 4-digit year number, and a 2-digit month. + <dt><tt>year</tt> + <dd>One generation file element is generated per year. The filename suffix consists of a dot and a 4 digit year number. + <dt><tt>age</tt> + <dd>This type of file generation sets changes to a new element of the file set every 24 hours of server operation. The filename suffix consists of a dot, the letter <tt>a</tt>, and an 8-digit number. This number is taken to be the number of seconds the server is running at the start of the corresponding 24-hour period. Information is only written to a file generation by specifying <tt>enable</tt>; output is prevented by specifying <tt>disable</tt>. + </dl> + </dl> + <dd><tt>link | nolink</tt> + <dl> + <dd>It is convenient to be able to access the current element of a file generation set by a fixed name. This feature is enabled by specifying <tt>link</tt> and disabled using <tt>nolink</tt>. If <tt>link</tt> is specified, a hard link from the current file set element to a file without suffix is created. When there is already a file with this name and the number of links of this file is one, it is renamed appending a dot, the letter <tt>C</tt>, and the pid of the <tt>ntpd</tt> server process. When the number of links is greater than one, the file is unlinked. This allows the current file to be accessed by a constant name. + </dl> + <dd><tt>enable | disable</tt> + <dl> + <dd>Enables or disables the recording function. + </dl> + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </dl> + </body> + +</html> diff --git a/contrib/ntp/html/msyslog.html b/contrib/ntp/html/msyslog.html new file mode 100644 index 0000000..9e03cf8 --- /dev/null +++ b/contrib/ntp/html/msyslog.html @@ -0,0 +1,122 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpd System Log Messages</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + <body> + <h3><tt>ntpd</tt> System Log Messages</h3> + <img src="pic/alice47.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The mushroom knows all the error codes, which is more than most of us do.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">19:24</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="284">Saturday, October 01, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <p><script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + </p> + <hr> + <p>You have come here because you found a cryptic message in the system log. This page by no means lists all messages that might be found, since new ones come and old ones go. Generally, however, the most common ones will be found here. They are listed by program module and log severity code in bold: <tt><b>LOG_ERR</b></tt>, <b><tt>LOG_NOTICE</tt></b> and <tt><b>LOG_INFO</b></tt>.</p> + <p>Most of the time <b><tt>LOG_ERR</tt></b> messages are fatal, but often <tt>ntpd</tt> limps onward in the hopes of discovering more errors. The <tt><b>LOG_NOTICE</b></tt> messages usually mean the time has changed or some other condition that probably should be noticed. The <tt><b>LOG_INFO</b></tt> messages usually say something about the system operations, but do not affect the time.</p> + <p>In the following a '?' character stands for text in the message. The meaning should be clear from context.</p> + <h4>Protocol Module</h4> + <p><tt><b>LOG_ERR</b></tt></p> + <dl> + <dt><tt>buffer overflow ? + </tt> + <dd>Fatal error. An input packet is too long for processing. + </dl> + <p><tt><b>LOG_NOTICE</b></tt></p> + <dl> + <dt><tt>no reply; clock not set</tt> + <dd>In <tt>ntpdate</tt> mode no servers have been found. The server(s) and/or network may be down. Standard debugging procedures apply. + <p><tt><b>LOG_INFO</b></tt></p> + <dt><tt>proto_config: illegal item ?, value ?</tt> + <dd>Program error. Please report to bugs@ntp.org. + <dt><tt>pps sync enabled</tt> + <dd>The PPS signal has been detected and enabled. + <dt><tt>transmit: encryption key ? not found</tt> + <dd>The encryption key is not defined or not trusted. + <dt><tt>precision = ? usec </tt> + <dd>This reports the precision measured for this machine. + <dt><tt>using 10ms tick adjustments</tt> + <dd>Gotcha for some machines with dirty rotten clock hardware. + <dt><tt>no servers reachable</tt> + <dd>The system clock is running on internal batteries. The server(s) and/or network may be down. + </dl> + <h4>Clock Discipline Module</h4> + <p><tt><b>LOG_ERR</b></tt></p> + <dl> + <dt><tt>time correction of ? seconds exceeds sanity limit (?); set clock manually to the correct UTC time</tt>. + <dd>Fatal error. Better do what it says, then restart the daemon. Be advised NTP and Unix know nothing about local time zones. The clock must be set to Coordinated Universal Time (UTC). Believe it; by international agreement abbreviations are in French and descriptions are in English. + <dt><tt>sigaction() fails to save SIGSYS trap: ?<br> + </tt><tt>sigaction() fails to restore SIGSYS trap: ?</tt> + <dt>Program error. Please report to bugs@ntp.org. + </dl> + <p><tt><b>LOG_NOTICE</b></tt></p> + <dl> + <dt><tt>frequency error ? exceeds tolerance 500 PPM</tt> + <dd>The hardware clock frequency error exceeds the rate the kernel can correct. This could be a hardware or a kernel problem. + <dt><tt>time slew ? s</tt> + <dd>The time error exceeds the step threshold and is being slewed to the correct time. You may have to wait a very long time. + <dt><tt>time reset ? s</tt> + <dd>The time error exceeds the step threshold and has been reset to the correct time. Computer scientists don't like this, but they can set the <tt>ntpd -x</tt> option and wait forever. + <dt><tt>kernel time sync disabled ?</tt> + <dd>The kernel reports an error. See the codes in the <tt>timex.h</tt> file. + <dt><tt>pps sync disabled</tt> + <dd>The PPS signal has died, probably due to a dead radio, broken wire or loose connector. + </dl> + <p><tt><b>LOG_INFO</b></tt></p> + <dl> + <dt><tt>kernel time sync status ? </tt> + <dd>For information only. See the codes in the <tt>timex.h</tt> file. + </dl> + <h4>Cryptographic Module</h4> + <p><tt><b>LOG_ERR</b></tt></p> + <dl> + <dt><tt>cert_parse ?<br> + </tt><tt>cert_sign ?<br> + </tt><tt>crypto_cert ?<br> + </tt><tt>crypto_encrypt ?<br> + </tt><tt>crypto_gq ?<br> + </tt><tt>crypto_iff ?<br> + </tt><tt>crypto_key ?<br> + </tt><tt>crypto_mv ?<br> + </tt><tt>crypto_setup ?<br> + </tt><tt>make_keys ?</tt> + <dd>Usually fatal errors. These messages display error codes returned from the OpenSSL library. See the OpenSSL documentation for explanation. + <dt><tt>crypto_setup: certificate ? is trusted, but not self signed.<br> + </tt><tt>crypto_setup: certificate ? not for this host<br> + </tt><tt>crypto_setup: certificate file ? not found or corrupt<br> + </tt><tt>crypto_setup: host key file ? not found or corrupt<br> + </tt><tt>crypto_setup: host key is not RSA key type<br> + </tt><tt>crypto_setup: random seed file ? not found<br> + </tt><tt>rypto_setup: random seed file not specified</tt> + <dd>Fatal errors. These messages show problems during the initialization procedure. + </dl> + <p><tt><b>LOG_INFO</b></tt></p> + <dl> + <dt><tt>cert_parse: expired ?<br> + </tt><tt>cert_parse: invalid issuer ?<br> + </tt><tt>cert_parse: invalid signature ?<br> + </tt><tt>cert_parse: invalid subject ?</tt> + <dd>There is a problem with a certificate. Operation cannot proceed untill the problem is fixed. If the certificate is local, it can be regenerated using the <tt>ntp-keygen</tt> program. If it is held somewhere else, it must be fixed by the holder. + <dt><tt>crypto_?: defective key<br> + </tt><tt>crypto_?: invalid filestamp<br> + </tt><tt>crypto_?: missing challenge<br> + </tt><tt>crypto_?: scheme unavailable</tt> + <dd>There is a problem with the identity scheme. Operation cannot proceed untill the problem is fixed. Usually errors are due to misconfiguration or an orphan association. If the latter, <tt>ntpd</tt> will usually time out and recover by itself. + <dt><tt>crypto_cert: wrong PEM type ?</tt> + <dd>The certificate does not have MIME type <tt>CERTIFICATE</tt>. You are probably using the wrong type from OpenSSL or an external certificate authority. + <dt><tt>crypto_ident: no compatible identity scheme found</tt> + <dd>Configuration error. The server and client identity schemes are incompatible. + <dt><tt>crypto_tai: kernel TAI update failed</tt> + <dd>The kernel does not support this function. You may need a new kernel or patch. + <dt><tt>crypto_tai: leapseconds file ? error ?</tt> + <dd>The leapseconds file is corrupt. Obtain the latest file from <tt>time.nist.gov</tt>. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/mx4200data.html b/contrib/ntp/html/mx4200data.html new file mode 100644 index 0000000..7bf66b1 --- /dev/null +++ b/contrib/ntp/html/mx4200data.html @@ -0,0 +1,1074 @@ +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>MX4200 Receiver Data Format</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h1>MX4200 Receiver Data Format</h1> + <hr> + <h2>Table of Contents</h2> + <ul> + <li><a href="#control">Control Port Sentences</a> + <li><a href="#input">Control Port Input Sentences</a> + <ul> + <li><a href="#input_000">$PMVXG,000</a> Initialization/Mode Control - Part A + <li><a href="#input_001">$PMVXG,001</a> Initialization/Mode Control - Part B + <li><a href="#input_007">$PMVXG,007</a> Control Port Configuration + <li><a href="#input_023">$PMVXG,023</a> Time Recovery Configuration + <li><a href="#input_gpq">$CDGPQ,YYY</a> Query From a Remote Device / Request to Output a Sentence + </ul> + <li><a href="#output">Control Port Output Sentences</a> + <ul> + <li><a href="#output_000">$PMVXG,000</a> Receiver Status + <li><a href="#output_021">$PMVXG,021</a> Position, Height, Velocity + <li><a href="#output_022">$PMVXG,022</a> DOPs + <li><a href="#output_030">$PMVXG,030</a> Software Configuration + <li><a href="#output_101">$PMVXG,101</a> Control Sentence Accept/Reject + <li><a href="#output_523">$PMVXG,523</a> Time Recovery Configuration + <li><a href="#output_830">$PMVXG,830</a> Time Recovery Results + </ul> + </ul> + <hr> + <h2><a name="control">Control Port Sentences</a></h2> + <p>The Control (CDU) Port is used to initialize, monitor, and control the receiver. The structure of the control port sentences is based on the <cite>NMEA-0183</cite> Standard for Interfacing Marine Electronics Navigation Devices (version 1.5). For more details, please refer to the <cite>NMEA-0183</cite> Specification available from the <a href="http://www.nmea.org/">National Marine Electronics Association</a>.</p> + <p>Reserved characters are used to indicate the beginning and the end of records in the data stream, and to delimit data fields within a sentence. Only printable ASCII characters (Hex 20 through 7F) may be used in a sentence. <a href="#table_2">Table 2</a> lists the reserved characters and defines their usage. <a href="#table_1">Table 1</a> illustrates the general Magnavox proprietary NMEA sentence format.</p> + <h4><a name="table_1">Table 1. Magnavox Proprietary NMEA Sentence Format</a></h4> + <code>$PMVXG,XXX,...................*CK </code> + <p></p> + <table border> + <tr> + <th>Character</th> + <th>Meaning</th> + </tr> + <tr> + <td><code>$</code></td> + <td>Sentence Start Character</td> + </tr> + <tr> + <td><code>P</code></td> + <td>Special ID (P = Proprietary)</td> + </tr> + <tr> + <td><code>MVX</code></td> + <td>Originator ID (MVX = Magnavox)</td> + </tr> + <tr> + <td><code>G</code></td> + <td>Interface ID (G = GPS)</td> + </tr> + <tr> + <td><code>XXX</code></td> + <td>Sentence Type</td> + </tr> + <tr> + <td><code>...</code></td> + <td>Data</td> + </tr> + <tr> + <td><code>*</code></td> + <td>Optional Checksum Field Delimiter</td> + </tr> + <tr> + <td><code>CK</code></td> + <td>Optional Checksum</td> + </tr> + </table> + <h4><a name="table_2">Table 2. NMEA Sentence Reserved Characters</a></h4> + <table border> + <tr> + <th>Character</th> + <th>Hex Value</th> + <th>Usage</th> + </tr> + <tr> + <td><code>$</code></td> + <td>24</td> + <td>Start of Sentence Identifier</td> + </tr> + <tr> + <td><code>{cr}{lf}</code></td> + <td>0D 0A</td> + <td>End of Sentence Identifier</td> + </tr> + <tr> + <td><code>,</code></td> + <td>2C</td> + <td>Sentence Delimiter</td> + </tr> + <tr> + <td><code>*</code></td> + <td>2A</td> + <td>Optional Checksum Field Delimiter</td> + </tr> + </table> + <p>Following the start character <code>$</code>, are five characters which constitute the block label of the sentence. For Magnavox proprietary sentences, this label is always <code>PMVXG</code>. The next field after the block label is the sentence type, consisting of three decimal digits.</p> + <p>The data, delimited by commas, follows the sentence type. Note that the receiver uses a free-format parsing algorithm, so you need not send the exact number of characters shown in the examples. You will need to use the commas to determine how many bytes of data need to be retrieved.</p> + <p>The notation <code>CK</code> shown in <a href="#table_1">Table 1</a> symbolically indicates the optional checksum in the examples. The checksum is computed by exclusive-ORing all of the bytes between the <code>$</code> and the <code>*</code> characters. The <code>$</code>, <code>*</code> and the checksum are not included in the checksum computation.</p> + <p>Checksums are optional for Control Port input sentences, but are highly recommended to limit the effects of communication errors. Magnavox receivers always generate checksums for Control Port output sentences.</p> + <p>ASCII data characters are transmitted in the following format:</p> + <table border> + <tr> + <td>Data Bits</td> + <td>8 (msb always 0)</td> + </tr> + <tr> + <td>Parity</td> + <td>None</td> + </tr> + <tr> + <td>Stop Bits</td> + <td>1</td> + </tr> + </table> + <p>NULL fields are fields which do not contain any data. They would appear as two commas together in the sentence format, except for the final field. Some Magnavox proprietary sentences require that the format contain NULL fields. mandatory NULL fields are identified by an '*' next to the respective field.</p> + <hr> + <h2><a name="input">Control Port Input Sentences</a></h2> + These are the subset of the MX4200 control port input sentences sent by the NTP driver to the GPS receiver. + <hr> + <h3><a name="input_000">$PMVXG,000</a></h3> + <h4>Initialization/Mode Control - Part A</h4> + Initializes the time, position and antenna height of the MX4200. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Default</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Day</td> + <td> </td> + <td>Int</td> + <td> </td> + <td>1-31</td> + </tr> + <tr> + <td>2</td> + <td>Month</td> + <td> </td> + <td>Int</td> + <td> </td> + <td>1-12</td> + </tr> + <tr> + <td>3</td> + <td>Year</td> + <td> </td> + <td>Int</td> + <td> </td> + <td>1991-9999</td> + </tr> + <tr> + <td>4</td> + <td>GMT Time</td> + <td>HHMMSS</td> + <td>Int</td> + <td> </td> + <td>000000-235959</td> + </tr> + <tr> + <td>5</td> + <td>WGS-84 Latitude</td> + <td>DDMM.MMMM</td> + <td>Float</td> + <td>0.0</td> + <td>0 - 8959.9999</td> + </tr> + <tr> + <td>6</td> + <td>North/South Indicator</td> + <td> </td> + <td>Char</td> + <td>N</td> + <td>N,S</td> + </tr> + <tr> + <td>7</td> + <td>WGS-84 Longitude</td> + <td>DDDMM.MMMM</td> + <td>Float</td> + <td>0.0</td> + <td>0 - 17959.9999</td> + </tr> + <tr> + <td>8</td> + <td>East/West Indicator</td> + <td> </td> + <td>Char</td> + <td>E</td> + <td>E,W</td> + </tr> + <tr> + <td>9</td> + <td>Altitude (height above Mean Sea Level) in meters (WGS-84)</td> + <td>Meters</td> + <td>Float</td> + <td>0.0</td> + <td>+/-99999.0</td> + </tr> + <tr> + <td>10</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + </table> + Example:<br> + <code>$PMVXG,000,,,,,,,,,,*48</code><br> + <code>$PMVXG,000,,,,,5128.4651,N,00020.0715,W,58.04,*4F</code> + <hr> + <h3><a name="input_001">$PMVXG,001</a></h3> + <h4>Initialization/Mode Control - Part B</h4> + Specifies various navigation parameters: Altitude aiding, acceleration DOP limits, and satellite elevation limits. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Default</th> + <th>Range</th> + </tr> + <tr> + <td>*1</td> + <td>Constrain Altitude</td> + <td> </td> + <td>Int</td> + <td>1</td> + <td>0=3D Only<br> + 1=Auto<br> + 2=2D Only</td> + </tr> + <tr> + <td>2</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td>*3</td> + <td>Horizontal Acceleration Factor</td> + <td>m/sec^2</td> + <td>Float</td> + <td>1.0</td> + <td>0.5-10.0</td> + </tr> + <tr> + <td>*4</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td>*5</td> + <td>VDOP Limit</td> + <td> </td> + <td>Int</td> + <td>10</td> + <td>1-9999</td> + </tr> + <tr> + <td>*6</td> + <td>HDOP Limit</td> + <td> </td> + <td>Int</td> + <td>10</td> + <td>1-9999</td> + </tr> + <tr> + <td>7</td> + <td>Elevation Limit</td> + <td>Deg</td> + <td>Int</td> + <td>5</td> + <td>0-90</td> + </tr> + <tr> + <td>8</td> + <td>Time Output Mode</td> + <td> </td> + <td>Char</td> + <td>U</td> + <td>U=UTC<br> + L=Local Time</td> + </tr> + <tr> + <td>9</td> + <td>Local Time Offset</td> + <td>HHMM</td> + <td>Int</td> + <td>0</td> + <td>+/- 0-2359</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,001,3,,0.1,0.1,10,10,5,U,0*06</code> + <hr> + <h3><a name="input_007">$PMVXG,007</a></h3> + <h4>Control Port Output Configuration</h4> + This message enables or disables output of the specified sentence and defines the output rate. The user sends this message for each sentence that the receiver is to output. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Default</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Control Port Output Block Label</td> + <td> </td> + <td>Char</td> + <td> </td> + <td> </td> + </tr> + <tr> + <td>2</td> + <td>Clear Current Output List</td> + <td> </td> + <td>Int</td> + <td> </td> + <td>0=No<br> + 1=Yes</td> + </tr> + <tr> + <td>3</td> + <td>Add/Delete Sentence from List</td> + <td> </td> + <td>Int</td> + <td> </td> + <td>1=Append<br> + 2=Delete</td> + </tr> + <tr> + <td>4</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td>5</td> + <td>Sentence Output Rate</td> + <td>Sec</td> + <td>Int</td> + <td> </td> + <td>1-9999</td> + </tr> + <tr> + <td>6</td> + <td># digits of Precision for CGA and GLL sentences</td> + <td> </td> + <td>Int</td> + <td>2</td> + <td>2-4</td> + </tr> + <tr> + <td>7</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + <tr> + <td>8</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + <td> </td> + </tr> + </table> + Example:<br> + <code>$PMVXG,007,022,0,1,,1,,,*4F</code> + <hr> + <h3><a name="input_023">$PMVXG,023</a></h3> + <h4>Time Recovery Configuration</h4> + This message is used to enable/disable the time recovery feature of the receiver. The time synchronization for the 1PPS output is specified in addition to a user time bias and an error tolerance for a valid pulse. This record is accepted in units configured for time recovery. If the back panel contains a 1PPS outlet, the receiver is a time recovery unit. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Default</th> + <th>Range</th> + </tr> + <tr> + <td>*1</td> + <td>Time Recovery Mode</td> + <td> </td> + <td>Char</td> + <td>D</td> + <td>D=Dynamic<br> + S=Static<br> + K=Known Position<br> + N=No Time Recovery</td> + </tr> + <tr> + <td>2</td> + <td>Time Synchronization</td> + <td> </td> + <td>Char</td> + <td>G</td> + <td>U=UTC<br> + G=GPS</td> + </tr> + <tr> + <td>3</td> + <td>Time Mark Mode</td> + <td> </td> + <td>Char</td> + <td>A</td> + <td>A=Always<br> + V=Valid Pulses Only</td> + </tr> + <tr> + <td>4</td> + <td>Maximum Time Error</td> + <td>Nsec</td> + <td>Int</td> + <td>100</td> + <td>50-1000</td> + </tr> + <tr> + <td>5</td> + <td>User Time Bias</td> + <td>Nsec</td> + <td>Int</td> + <td>0</td> + <td>+/- 99999</td> + </tr> + <tr> + <td>6</td> + <td>ASCII Time Message Control</td> + <td> </td> + <td>Int</td> + <td>0</td> + <td>0=No Output<br> + 1=830 to Control Port<br> + 2=830 to Equipment Port</td> + </tr> + <tr> + <td>7</td> + <td>Known Pos PRN</td> + <td> </td> + <td>Int</td> + <td>0</td> + <td>1-32<br> + 0=Track All Sats</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,023,S,U,A,500,0,1,*16</code> + <hr> + <h3><a name="input_gpq">$CDGPQ,YYY</a></h3> + <h4>Query From a Remote Device / Request to Output a Sentence</h4> + Enables the controller to request a one-time transmission of a specific block label. To output messages at a periodic rate, refer to input sentence <a href="#input_007">$PMVXG,007</a>. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Default</th> + <th>Range</th> + </tr> + <tr> + <td>1:CD</td> + <td>ID of Remote Device</td> + <td> </td> + <td>Char</td> + <td> </td> + <td>(See <cite>NMEA-0183</cite>)</td> + </tr> + <tr> + <td>2:GP</td> + <td>GPS</td> + <td> </td> + <td>Char</td> + <td> </td> + <td>(See <cite>NMEA-0183</cite>)</td> + </tr> + <tr> + <td>3:Q</td> + <td>Query</td> + <td> </td> + <td>Char</td> + <td> </td> + <td>(See <cite>NMEA-0183</cite>)</td> + </tr> + <tr> + <td>4:YYY</td> + <td>Label of Desired Sentence</td> + <td> </td> + <td>Char</td> + <td> </td> + <td>Any Valid NMEA or Magnavox Sentence Type</td> + </tr> + </table> + Example:<br> + <code>$CDGPQ,030*5E</code> + <hr> + <h2><a name="output">Control Port Output Sentences</a></h2> + These are the subset of the MX4200 control port output sentences recognized by the NTP driver. + <hr> + <h3><a name="output_000">$PMVXG,000</a></h3> + <h4>Receiver Status</h4> + Returns the current status of the receiver including the operating mode, number of satellites visible, and the number of satellites being tracked. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Current Receiver Status</td> + <td> </td> + <td>Char</td> + <td>ACQ=Reacquisition<br> + ALT=Constellation Selection<br> + IAC=Initial Acquisition<br> + IDL=Idle, No Satellites<br> + NAV=Navigating<br> + STS=Search The Sky<br> + TRK=Tracking</td> + </tr> + <tr> + <td>2</td> + <td>Number of Satellites that should be Visible</td> + <td> </td> + <td>Int</td> + <td>0-12</td> + </tr> + <tr> + <td>3</td> + <td>Number of Satellites being Tracked</td> + <td> </td> + <td>Int</td> + <td>0-12</td> + </tr> + <tr> + <td>4</td> + <td>Time since Last Navigation</td> + <td>HHMM</td> + <td>Int</td> + <td>0-2359</td> + </tr> + <tr> + <td>5</td> + <td>Initialization Status</td> + <td> </td> + <td>Int</td> + <td>0=Waiting for Initialization<br> + 1=Initialization Complete</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,000,TRK,3,3,0122,1*19</code> + <hr> + <h3><a name="output_021">$PMVXG,021</a></h3> + <h4>Position, Height, Velocity</h4> + This sentence gives the receiver position, height, navigation mode and velocity north/east. <em>This sentence is intended for post analysis applications.</em> + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>UTC Measurement Time</td> + <td>Seconds into the week</td> + <td>Float</td> + <td>0-604800.00</td> + </tr> + <tr> + <td>2</td> + <td>WGS-84 Latitude</td> + <td>DDMM.MMMM</td> + <td>Float</td> + <td>0-89.9999</td> + </tr> + <tr> + <td>3</td> + <td>North/South Indicator</td> + <td> </td> + <td>Char</td> + <td>N, S</td> + </tr> + <tr> + <td>4</td> + <td>WGS-84 Longitude</td> + <td>DDDMM.MMMM</td> + <td>Float</td> + <td>0-179.9999</td> + </tr> + <tr> + <td>5</td> + <td>East/West Indicator</td> + <td> </td> + <td>Char</td> + <td>E, W</td> + </tr> + <tr> + <td>6</td> + <td>Altitude (MSL)</td> + <td>Meters</td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>7</td> + <td>Geoidal Height</td> + <td>Meters</td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>8</td> + <td>Velocity East</td> + <td>M/Sec</td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>9</td> + <td>Velocity North</td> + <td>M/Sec</td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>10</td> + <td>Navigation Mode</td> + <td> </td> + <td>Int</td> + <td><em>Navigating</em><br> + 1=Position From a Remote Device<br> + 2=2D<br> + 3=3D<br> + 4=2D differential<br> + 5=3D differential<br> + <em>Not Navigating</em><br> + 51=Too Few Satellites<br> + 52=DOPs too large<br> + 53=Position STD too large<br> + 54=Velocity STD too large<br> + 55=Too many iterations for velocity<br> + 56=Too many iterations for position<br> + 57=3 Sat Startup failed</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,021,142244.00,5128.4744,N,00020.0593,W,00054.4,0047.4,0000.1,-000.2,03*66</code> + <hr> + <h3><a name="output_022">$PMVXG,022</a></h3> + <h4>DOPs</h4> + This sentence reports the DOP (Dilution Of Precision) values actually used in the measurement processing corresponding to the satellites listed. The satellites are listed in receiver channel order. Fields 11-16 are output only on 12-channel receivers. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>UTC Measurement Time</td> + <td>Seconds into the week</td> + <td>Float</td> + <td>0-604800.00</td> + </tr> + <tr> + <td>2</td> + <td>East DOP (EDOP)</td> + <td> </td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>3</td> + <td>North DOP (NDOP)</td> + <td> </td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>4</td> + <td>Vertical DOP (VDOP)</td> + <td> </td> + <td>Float</td> + <td> </td> + </tr> + <tr> + <td>5</td> + <td>PRN on Channel #1</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>6</td> + <td>PRN on Channel #2</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>7</td> + <td>PRN on Channel #3</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>8</td> + <td>PRN on Channel #4</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>9</td> + <td>PRN on Channel #5</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>10</td> + <td>PRN on Channel #6</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>11</td> + <td>PRN on Channel #7</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>12</td> + <td>PRN on Channel #8</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>13</td> + <td>PRN on Channel #9</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>14</td> + <td>PRN on Channel #10</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>15</td> + <td>PRN on Channel #11</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + <tr> + <td>16</td> + <td>PRN on Channel #12</td> + <td> </td> + <td>Int</td> + <td>1-32</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,022,142243.00,00.7,00.8,01.9,27,26,10,09,13,23*77</code> + <hr> + <h3><a name="output_030">$PMVXG,030</a></h3> + <h4>Software Configuration</h4> + This sentence contains the navigation processor and baseband firmware version numbers. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Nav Processor Version Number</td> + <td> </td> + <td>Char</td> + <td> </td> + </tr> + <tr> + <td>2</td> + <td>Baseband Firmware Version Number</td> + <td> </td> + <td>Char</td> + <td> </td> + </tr> + </table> + Example:<br> + <code>$PMVXG,030,DA35,015</code> + <hr> + <h3><a name="output_101">$PMVXG,101</a></h3> + <h4>Control Sentence Accept/Reject</h4> + This sentence is returned (on the Control Port) for every <strong>$PMVXG</strong> and <strong>$XXGPQ</strong> sentence that is received. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Sentence ID</td> + <td> </td> + <td>Char</td> + <td> </td> + </tr> + <tr> + <td>2</td> + <td>Accept/Reject Status</td> + <td> </td> + <td>Int</td> + <td>0=Sentence Accepted<br> + 1=Bad Checksum<br> + 2=Illegal Value<br> + 3=Unrecognized ID<br> + 4=Wrong # of fields<br> + 5=Required Data Field Missing<br> + 6=Requested Sentence Unavailable</td> + </tr> + <tr> + <td>3</td> + <td>Bad Field Index</td> + <td> </td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>4</td> + <td>Requested Sentence ID (If field #1 = GPQ)</td> + <td> </td> + <td>Char</td> + <td> </td> + </tr> + </table> + Example:<br> + <code>$PMVXG,101,GPQ,0,,030*0D</code> + <hr> + <h3><a name="output_523">$PMVXG,523</a></h3> + <h4>Time Recovery Configuration</h4> + This sentence contains the configuration of the time recovery function of the receiver. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Time Recovery Mode</td> + <td> </td> + <td>Char</td> + <td>D=Dynamic<br> + S=Static<br> + K=Known Position<br> + N=No Time Recovery</td> + </tr> + <tr> + <td>2</td> + <td>Time Synchronization</td> + <td> </td> + <td>Char</td> + <td>U=UTC Time<br> + G=GPS Time</td> + </tr> + <tr> + <td>3</td> + <td>Time Mark Mode</td> + <td> </td> + <td>Char</td> + <td>A=Always Output Time Pulse<br> + V=Only when Valid</td> + </tr> + <tr> + <td>4</td> + <td>Maximum Time Error for which a time mark will be considered valid</td> + <td>Nsec</td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>5</td> + <td>User Time Bias</td> + <td>Nsec</td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>6</td> + <td>Time Message Control</td> + <td> </td> + <td>Int</td> + <td>0=No Message<br> + 1=830 to Control Port<br> + 2=830 to Equipment Port</td> + </tr> + <tr> + <td>7</td> + <td>Not Used</td> + <td> </td> + <td> </td> + <td> </td> + </tr> + </table> + Example:<br> + <code>$PMVXG,523,S,U,A,0500,000000,1,0*23</code> + <hr> + <h3><a name="output_830">$PMVXG,830</a></h3> + <h4>Time Recovery Results</h4> + This sentence is output approximately 1 second preceding the 1PPS output. It indicates the exact time of the next pulse, whether or not the time mark will be valid (based on operator-specified error tolerance), the time to which the pulse is synchronized, the receiver operating mode, and the time error of the <strong>last</strong> 1PPS output. The leap second flag (Field #11) is not output by older receivers. + <p></p> + <table border> + <tr> + <th>Field</th> + <th>Description</th> + <th>Units</th> + <th>Format</th> + <th>Range</th> + </tr> + <tr> + <td>1</td> + <td>Time Mark Valid</td> + <td> </td> + <td>Char</td> + <td>T=Valid<br> + F=Not Valid</td> + </tr> + <tr> + <td>2</td> + <td>Year</td> + <td> </td> + <td>Int</td> + <td>1993-</td> + </tr> + <tr> + <td>3</td> + <td>Month</td> + <td> </td> + <td>Int</td> + <td>1-12</td> + </tr> + <tr> + <td>4</td> + <td>Day</td> + <td>Nsec</td> + <td>Int</td> + <td>1-31</td> + </tr> + <tr> + <td>5</td> + <td>Time</td> + <td>HH:MM:SS</td> + <td>Int</td> + <td>00:00:00-23:59:59</td> + </tr> + <tr> + <td>6</td> + <td>Time Synchronization</td> + <td> </td> + <td>Char</td> + <td>U=UTC<br> + G=GPS</td> + </tr> + <tr> + <td>7</td> + <td>Operating Mode</td> + <td> </td> + <td>Char</td> + <td>D=Dynamic<br> + S=Static<br> + K=Known Position</td> + </tr> + <tr> + <td>8</td> + <td>Oscillator Offset - estimate of oscillator frequency error</td> + <td>PPB</td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>9</td> + <td>Time Mark Error of last pulse</td> + <td>Nsec</td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>10</td> + <td>User Time Bias</td> + <td>Nsec</td> + <td>Int</td> + <td> </td> + </tr> + <tr> + <td>11</td> + <td>Leap Second Flag - indicates that a leap second will occur. This value is usually zero except during the week prior to a leap second occurrence, when this value will be set to +/-1. A value of +1 indicates that GPS time will be 1 second further ahead of UTC time.</td> + <td> </td> + <td>Int</td> + <td>-1,0,1</td> + </tr> + </table> + Example:<br> + <code>$PMVXG,830,T,1998,10,12,15:30:46,U,S,000298,00003,000000,01*02</code> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/notes.html b/contrib/ntp/html/notes.html new file mode 100644 index 0000000..e757dbd --- /dev/null +++ b/contrib/ntp/html/notes.html @@ -0,0 +1,280 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Notes on setting up a NTP subnet</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Notes on setting up a NTP subnet</h3> + <img src="pic/tonea.gif" alt="gif" align="left">From NBS Special Publication 432 (out of print) + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:44</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <hr> + <h4>Introduction</h4> + <p>This document is a collection of notes concerning the use of ntpd and related programs, and on coping with the Network Time Protocol (NTP) in general. It is a major rewrite and update of an earlier document written by Dennis Ferguson of the University of Toronto and includes many changes and additions resulting from the NTP Version 3 specification and new Version 4 implementation features. It supersedes earlier documents, which should no longer be used for new configurations.</p> + <p><tt>ntpd</tt> includes a complete implementation of the NTP Version 3 specification, as defined in:</p> + <ul> + <li>Mills, D.L. Network Time Protocol (Version 3) specification, implementation and analysis. Network Working Group Report RFC-1305, University of Delaware, March 1992, 113 pp. Abstract: <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305a.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305a.pdf">PDF</a>, Body: <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305b.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305b.pdf">PDF</a>, Appendices: <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305c.ps">PostScript</a> | <a href="http://www.eecis.udel.edu/%7emills/database/rfc/rfc1305/rfc1305c.pdf">PDF</a> + </ul> + <p>Additional features have are described for <a href="release.html">NTP Version 4 Release Notes</a>. It also retains compatibility with both NTP Version 2, as defined in RFC-1119, and NTP Version 1, as defined in RFC-1059, although this compatibility is sometimes strained and only semiautomatic. In order to support in principle the ultimate precision of about 232 picoseconds in the NTP specification, <tt>ntpd</tt> uses NTP timestamp format for external communication and double precision floating point arithmetic internally. <tt>ntpd</tt> fully implements NTP Versions 2 and 3 authentication and in addition Version 4 autokey. It supports the NTP mode-6 control message facility along with a private mode-7 control- message facility used to remotely reconfigure the system and monitor a considerable amount of internal detail. As extensions to the specification, a flexible address-and-mask restriction facility has been included.</p> + <p>The code is biased towards the needs of a busy time server with numerous, often hundreds, of clients and other servers. Tables are hashed to allow efficient handling of many associations, though at the expense of additional overhead when the number of associations is small. Many fancy features have been included to permit efficient management and monitoring of a busy primary server, features which are probably excess baggage for a high stratum client. In such cases, a stripped-down version of the protocol, the Simple Network Time Protocol (SNTP) can be used. SNTP and NTP servers and clients can interwork in most situations, as described in: Mills, D.L. Simple Network Time Protocol (SNTP). Network Working Group Report RFC-2030, University of Delaware, October 1996, 14 pp. <a href="http://www.eecis.udel.edu/%7emills/database/rfc2030.txt">(ASCII)</a>.</p> + <p>The code was written with near demonic attention to details which can affect precision and as a consequence should be able to make good use of high performance, special purpose hardware such as precision oscillators and radio clocks. The present code supports a number of radio clocks, including those for the WWV, CHU, WWVB, MSF, DCF77, GOES and GPS radio and satellite time services and USNO, ACTS and PTB modem time services. It also supports the IRIG-B and IRIG-E signal format connected via an audio codec. The server methodically avoids the use of Unix-specific library routines where possible by implementing local versions, in order to aid in porting the code to perverse Unix and non-Unix platforms.</p> + <p>While this implementation conforms in most respects to the NTP Version 3 specification RFC-1305, a number of improvements have been made which are described in the conformance statement in the <a href="http://www.eecis.udel.edu/%7emills/biblio.html">NTP Protocol Conformance Statement</a> page. It has been specifically tuned to achieve the highest accuracy possible on whatever hardware and operating-system platform is available. In general, its precision and stability are limited only by the characteristics of the onboard clock source used by the hardware and operating system, usually an uncompensated crystal oscillator. On modern RISC-based processors connected directly to radio clocks via serial-asynchronous interfaces, the accuracy is usually limited by the radio clock and interface to the order of a millisecond or less. The code includes special features to support a pulse-per-second (PPS) signal and/or an IRIG-B signal generated by some radio clocks. When used in conjunction with a suitable hardware level converter, the accuracy can be improved to a few tens of microseconds. Further improvement is possible using an outboard, stabilized frequency source, in which the accuracy and stability are limited only by the characteristics of that source.</p> + <p>The NTP Version 4 distribution includes, in addition to the daemon itself (<tt><a href="ntpd.html">ntpd</a></tt>), several utility programs, including two remote-monitoring programs (<a href="ntpq.html"><tt>ntpq</tt></a>, <tt><a href="ntpdc.html">ntpdc</a></tt>), a remote clock-setting program similar to the Unix rdate program (<tt>ntpdate</tt>), a traceback utility useful to discover suitable synchronization sources (<tt>ntptrace</tt>), and various programs used to configure the local platform and calibrate the intrinsic errors. NTP has been ported to a large number of platforms, including most RISC and CISC workstations and mainframes manufactured today. Example configuration files for many models of these machines are included in the distribution. While in most cases the standard version of the implementation runs with no hardware or operating system modifications, not all features of the distribution are available on all platforms. For instance, a special feature allowing Sun workstations to achieve accuracies in the order of 100 microseconds requires some minor changes and additions to the kernel and input/output support.</p> + <p>There are, however, several drawbacks to all of this. <tt>ntpd</tt> is quite fat. This is rotten if your intended platform for the daemon is memory limited. <tt>ntpd</tt> uses <tt>SIGIO</tt> for all input, a facility which appears to not enjoy universal support and whose use seems to exercise the parts of your vendors' kernels which are most likely to have been done poorly. The code is unforgiving in the face of kernel problems which affect performance, and generally requires that you repair the problems in order to achieve acceptable performance. The code has a distinctly experimental flavour and contains features which could charitably be termed failed experiments, but which have not been completely hacked out. Much was learned from the addition of support for a variety of radio clocks, with the result that some radio clock drivers could use some rewriting.</p> + <h4>How NTP Works</h4> + <p>The approach used by NTP to achieve reliable time synchronization from a set of possibly unreliable remote time servers is somewhat different than other protocols. In particular, NTP does not attempt to synchronize clocks to each other. Rather, each server attempts to synchronize to Universal Coordinated Time (UTC) using the best available source and available transmission paths to that source. This is a fine point which is worth understanding. A group of NTP-synchronized clocks may be close to each other in time, but this is not a consequence of the clocks in the group having synchronized to each other, but rather because each clock has synchronized closely to UTC via the best source it has access to. As such, trying to synchronize a set of clocks to a set of servers whose time is not in mutual agreement may not result in any sort of useful synchronization of the clocks, even if you don't care about UTC. However, in networks isolated from UTC sources, provisions can made to nominate one of them as a phantom UTC source.</p> + <p>NTP operates on the premise that there is one true standard time, and that if several servers which claim synchronization to standard time disagree about what that time is, then one or more of them must be broken. There is no attempt to resolve differences more gracefully since the premise is that substantial differences cannot exist. In essence, NTP expects that the time being distributed from the root of the synchronization subnet will be derived from some external source of UTC (e.g., a radio clock). This makes it somewhat inconvenient (though by no means impossible) to synchronize hosts together without a reliable source of UTC to synchronize them to. If your network is isolated and you cannot access other people's servers across the Internet, a radio clock may make a good investment.</p> + <p>Time is distributed through a hierarchy of NTP servers, with each server adopting a <i>stratum</i> which indicates how far away from an external source of UTC it is operating at. Stratum-1 servers, which are at the top of the pile (or bottom, depending on your point of view), have access to some external time source, usually a radio clock synchronized to time signal broadcasts from radio stations which explicitly provide a standard time service. A stratum-2 server is one which is currently obtaining time from a stratum-1 server, a stratum-3 server gets its time from a stratum-2 server, and so on. To avoid long lived synchronization loops the number of strata is limited to 15.</p> + <p>Each client in the synchronization subnet (which may also be a server for other, higher stratum clients) chooses exactly one of the available servers to synchronize to, usually from among the lowest stratum servers it has access to. This is, however, not always an optimal configuration, for indeed NTP operates under another premise as well, that each server's time should be viewed with a certain amount of distrust. NTP really prefers to have access to several sources of lower stratum time (at least three) since it can then apply an agreement algorithm to detect insanity on the part of any one of these. Normally, when all servers are in agreement, NTP will choose the best of these, where "best" is defined in terms of lowest stratum, closest (in terms of network delay) and claimed precision, along with several other considerations. The implication is that, while one should aim to provide each client with three or more sources of lower stratum time, several of these will only be providing backup service and may be of lesser quality in terms of network delay and stratum (i.e., a same-stratum peer which receives time from lower stratum sources the local server doesn't access directly can also provide good backup service).</p> + <p>Finally, there is the issue of association modes. There are a number of modes in which NTP servers can associate with each other, with the mode of each server in the pair indicating the behaviour the other server can expect from it. In particular, when configuring a server to obtain time from other servers, there is a choice of two modes which may be used. Configuring an association in symmetric-active mode (usually indicated by a <tt>peer</tt> declaration in the configuration file) indicates to the remote server that one wishes to obtain time from the remote server and that one is also willing to supply time to the remote server if need be. This mode is appropriate in configurations involving a number of redundant time servers interconnected via diverse network paths, which is presently the case for most stratum-1 and stratum-2 servers on the Internet today. Configuring an association in client mode (usually indicated by a <tt>server</tt> declaration in the configuration file) indicates that one wishes to obtain time from the remote server, but that one is not willing to provide time to the remote server. This mode is appropriate for file-server and workstation clients that do not provide synchronization to other local clients. Client mode is also useful for boot-date-setting programs and the like, which really have no time to provide and which don't retain state about associations over the longer term.</p> + <p>Where the requirements in accuracy and reliability are modest, clients can be configured to use broadcast and/or multicast modes. These modes are not normally utilized by servers with dependent clients. The advantage of these modes is that clients do not need to be configured for a specific server, so that all clients operating can use the same configuration file. Broadcast mode requires a broadcast server on the same subnet, while multicast mode requires support for IP multicast on the client machine, as well as connectivity via the MBONE to a multicast server. Since broadcast messages are not propagated by routers, only those broadcast servers on the same subnet will be used. There is at present no way to select which of possibly many multicast servers will be used, since all operate on the same group address.</p> + <p>Where the maximum accuracy and reliability provided by NTP are needed, clients and servers operate in either client/server or symmetric modes. Symmetric modes are most often used between two or more servers operating as a mutually redundant group. In these modes, the servers in the group members arrange the synchronization paths for maximum performance, depending on network jitter and propagation delay. If one or more of the group members fail, the remaining members automatically reconfigure as required. Dependent clients and servers normally operate in client/server mode, in which a client or dependent server can be synchronized to a group member, but no group member can synchronize to the client or dependent server. This provides protection against malfunctions or protocol attacks.</p> + <p>Servers that provide synchronization to a sizeable population of clients normally operate as a group of three or more mutually redundant servers, each operating with three or more stratum-one or stratum-two servers in client-server modes, as well as all other members of the group in symmetric modes. This provides protection against malfunctions in which one or more servers fail to operate or provide incorrect time. The NTP algorithms have been specifically engineered to resist attacks where some fraction of the configured synchronization sources accidently or purposely provide incorrect time. In these cases a special voting procedure is used to identify spurious sources and discard their data.</p> + <h4>Configuring Your Subnet</h4> + At startup time the <tt>ntpd</tt> daemon running on a host reads the initial configuration information from a file, usually <tt>/etc/ntp.conf</tt>, unless a different name has been specified at compile time. Putting something in this file which will enable the host to obtain time from somewhere else is usually the first big hurdle after installation of the software itself, which is described in the <a href="build/build.html">Building and Installing the Distribution</a> page. At its simplest, what you need to do in the configuration file is declare the servers that the daemon should poll for time synchronization. In principle, no such list is needed if some other time server operating in broadcast/multicast mode is available, which requires the client to operate in a broadcastclient mode. + <p>In the case of a workstation operating in an enterprise network for a public or private organization, there is often an administrative department that coordinates network services, including NTP. Where available, the addresses of appropriate servers can be provided by that department. However, if this infrastructure is not available, it is necessary to explore some portion of the existing NTP subnet now running in the Internet. There are at present many thousands of time servers running NTP in the Internet, a significant number of which are willing to provide a public time- synchronization service. Some of these are listed in the list of public time servers, which can be accessed via the <a href="http://www.eecis.udel.edu/%7entp">NTP web page</a>. These data are updated on a regular basis using information provided voluntarily by various site administrators. There are other ways to explore the nearby subnet using the <tt><a href="ntptrace.html">ntptrace</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> programs.</p> + <p>It is vital to carefully consider the issues of robustness and reliability when selecting the sources of synchronization. Normally, not less than three sources should be available, preferably selected to avoid common points of failure. It is usually better to choose sources which are likely to be "close" to you in terms of network topology, though you shouldn't worry overly about this if you are unable to determine who is close and who isn't. Normally, it is much more serious when a server becomes faulty and delivers incorrect time than when it simply stops operating, since an NTP-synchronized host normally can coast for hours or even days without its clock accumulating serious error approaching a second, for instance. Selecting at least three sources from different operating administrations, where possible, is the minimum recommended, although a lesser number could provide acceptable service with a degraded degree of robustness.</p> + <p>Normally, it is not considered good practice for a single workstation to request synchronization from a primary (stratum-1) time server. At present, these servers provide synchronization for hundreds of clients in many cases and could, along with the network access paths, become seriously overloaded if large numbers of workstation clients requested synchronization directly. Therefore, workstations located in sparsely populated administrative domains with no local synchronization infrastructure should request synchronization from nearby stratum-2 servers instead. In most cases the keepers of those servers in the lists of public servers provide unrestricted access without prior permission; however, in all cases it is considered polite to notify the administrator listed in the file upon commencement of regular service. In all cases the access mode and notification requirements listed in the file must be respected. Under no conditions should servers not in these lists be used without prior permission, as to do so can create severe problems in the local infrastructure, especially in cases of dial-up access to the Internet.</p> + <p>In the case of a gateway or file server providing service to a significant number of workstations or file servers in an enterprise network it is even more important to provide multiple, redundant sources of synchronization and multiple, diversity-routed, network access paths. The preferred configuration is at least three administratively coordinated time servers providing service throughout the administrative domain including campus networks and subnetworks. Each of these should obtain service from at least two different outside sources of synchronization, preferably via different gateways and access paths. These sources should all operate at the same stratum level, which is one less than the stratum level to be used by the local time servers themselves. In addition, each of these time servers should peer with all of the other time servers in the local administrative domain at the stratum level used by the local time servers, as well as at least one (different) outside source at this level. This configuration results in the use of six outside sources at a lower stratum level (toward the primary source of synchronization, usually a radio clock), plus three outside sources at the same stratum level, for a total of nine outside sources of synchronization. While this may seem excessive, the actual load on network resources is minimal, since the interval between polling messages exchanged between peers usually ratchets back to no more than one message every 17 minutes.</p> + <p>The stratum level to be used by the local time servers is an engineering choice. As a matter of policy, and in order to reduce the load on the primary servers, it is desirable to use the highest stratum consistent with reliable, accurate time synchronization throughout the administrative domain. In the case of enterprise networks serving hundreds or thousands of client file servers and workstations, conventional practice is to obtain service from stratum-1 primary servers listed for public access. When choosing sources away from the primary sources, the particular synchronization path in use at any time can be verified using the <tt>ntptrace</tt> program included in this distribution. It is important to avoid loops and possible common points of failure when selecting these sources. Note that, while NTP detects and rejects loops involving neighboring servers, it does not detect loops involving intervening servers. In the unlikely case that all primary sources of synchronization are lost throughout the subnet, the remaining servers on that subnet can form temporary loops and, if the loss continues for an interval of many hours, the servers will drop off the subnet and free-run with respect to their internal (disciplined) timing sources. After some period with no outside timing source (currently one day), a host will declare itself unsynchronized and provide this information to local application programs.</p> + <p>In many cases the purchase of one or more radio clocks is justified, in which cases good engineering practice is to use the configurations described above anyway and connect the radio clock to one of the local servers. This server is then encouraged to participate in a special primary-server subnetwork in which each radio-equipped server peers with several other similarly equipped servers. In this way the radio-equipped server may provide synchronization, as well as receive synchronization, should the local or remote radio clock(s) fail or become faulty. <tt>ntpd</tt> treats attached radio clock(s) in the same way as other servers and applies the same criteria and algorithms to the time indications, so can detect when the radio fails or becomes faulty and switch to alternate sources of synchronization. It is strongly advised, and in practice for most primary servers today, to employ the authentication or access-control features of the NTP specification in order to protect against hostile intruders and possible destabilization of the time service. Using this or similar strategies, the remaining hosts in the same administrative domain can be synchronized to the three (or more) selected time servers. Assuming these servers are synchronized directly to stratum-1 sources and operate normally as stratum-2, the next level away from the primary source of synchronization, for instance various campus file servers, will operate at stratum 3 and dependent workstations at stratum 4. Engineered correctly, such a subnet will survive all but the most exotic failures or even hostile penetrations of the various, distributed timekeeping resources.</p> + <p>The above arrangement should provide very good, robust time service with a minimum of traffic to distant servers and with manageable loads on the local servers. While it is theoretically possible to extend the synchronization subnet to even higher strata, this is seldom justified and can make the maintenance of configuration files unmanageable. Serving time to a higher stratum peer is very inexpensive in terms of the load on the lower stratum server if the latter is located on the same concatenated LAN. When justified by the accuracy expectations, NTP can be operated in broadcast and multicast modes, so that clients need only listen for periodic broadcasts and do not need to send anything.</p> + <p>When planning your network you might, beyond this, keep in mind a few generic don'ts, in particular:</p> + <ul> + <li>Don't synchronize a local time server to another peer at the same stratum, unless the latter is receiving time from lower stratum sources the former doesn't talk to directly. This minimizes the occurrence of common points of failure, but does not eliminate them in cases where the usual chain of associations to the primary sources of synchronization are disrupted due to failures. + <li style="list-style: none"><br> + <li>Don't configure peer associations with higher stratum servers. Let the higher strata configure lower stratum servers, but not the reverse. This greatly simplifies configuration file maintenance, since there is usually much greater configuration churn in the high stratum clients such as personal workstations. + <li style="list-style: none"><br> + <li>Don't synchronize more than one time server in a particular administrative domain to the same time server outside that domain. Such a practice invites common points of failure, as well as raises the possibility of massive abuse, should the configuration file be automatically distributed do a large number of clients. + </ul> + There are many useful exceptions to these rules. When in doubt, however, follow them. + <h4>Configuring Your Server or Client</h4> + <p>As mentioned previously, the configuration file is usually called /etc/ntp.conf. This is an ASCII file conforming to the usual comment and whitespace conventions. A working configuration file might look like (in this and other examples, do not copy this directly):</p> + <pre> + # peer configuration for host whimsy + # (expected to operate at stratum 2) + + server rackety.udel.edu + server umd1.umd.edu + server lilben.tn.cornell.edu + + driftfile /etc/ntp.drift +</pre> + (Note the use of host names, although host addresses in dotted-quad notation can also be used. It is always preferable to use names rather than addresses, since over time the addresses can change, while the names seldom change.) + <p>This particular host is expected to operate as a client at stratum 2 by virtue of the <tt>server</tt> keyword and the fact that two of the three servers declared (the first two) have radio clocks and usually run at stratum 1. The third server in the list has no radio clock, but is known to maintain associations with a number of stratum 1 peers and usually operates at stratum 2. Of particular importance with the last host is that it maintains associations with peers besides the two stratum 1 peers mentioned. This can be verified using the <tt>ntpq</tt> program mentioned above. When configured using the <tt>server</tt> keyword, this host can receive synchronization from any of the listed servers, but can never provide synchronization to them.</p> + <p>Unless restricted using facilities described later, this host can provide synchronization to dependent clients, which do not have to be listed in the configuration file. Associations maintained for these clients are transitory and result in no persistent state in the host. These clients are normally not visible using the <tt>ntpq</tt> program included in the distribution; however, <tt>ntpd</tt> includes a monitoring feature (described later) which caches a minimal amount of client information useful for debugging administrative purposes.</p> + <p>A time server expected to both receive synchronization from another server, as well as to provide synchronization to it, is declared using the <tt>peer</tt> keyword instead of the <tt>server</tt> keyword. In all other aspects the server operates the same in either mode and can provide synchronization to dependent clients or other peers. If a local source of UTC time is available, it is considered good engineering practice to declare time servers outside the administrative domain as <tt>peer</tt> and those inside as <tt>server</tt> in order to provide redundancy in the global Internet, while minimizing the possibility of instability within the domain itself. A time server in one domain can in principle heal another domain temporarily isolated from all other sources of synchronization. However, it is probably unwise for a casual workstation to bridge fragments of the local domain which have become temporarily isolated.</p> + <p>Note the inclusion of a <tt>driftfile</tt> declaration. One of the things the NTP daemon does when it is first started is to compute the error in the intrinsic frequency of the clock on the computer it is running on. It usually takes about a day or so after the daemon is started to compute a good estimate of this (and it needs a good estimate to synchronize closely to its server). Once the initial value is computed, it will change only by relatively small amounts during the course of continued operation. The <tt>driftfile</tt> declaration indicates to the daemon the name of a file where it may store the current value of the frequency error so that, if the daemon is stopped and restarted, it can reinitialize itself to the previous estimate and avoid the day's worth of time it will take to recompute the frequency estimate. Since this is a desirable feature, a <tt>driftfile</tt> declaration should always be included in the configuration file.</p> + <p>An implication in the above is that, should <tt>ntpd</tt> be stopped for some reason, the local platform time will diverge from UTC by an amount that depends on the intrinsic error of the clock oscillator and the time since last synchronized. In view of the length of time necessary to refine the frequency estimate, every effort should be made to operate the daemon on a continuous basis and minimize the intervals when for some reason it is not running.</p> + <h4>Configuring NTP with NetInfo</h4> + If NetInfo support is compiled into NTP, you can opt to configure NTP in your NetInfo domain. NTP will look in the NetInfo directory <tt>/locations/ntp</tt> for property/value pairs which are equivalent to the lines in the configuration file described above. Each configuration keyword may have a corresponding property in NetInfo. Each value for a given property is treated as arguments to that property, similar to a line in the configuration file. + <p>For example, the configuration shown in the configuration file above can be duplicated in NetInfo by adding a property "<tt>server</tt>" with values "<tt>rackety.udel.edu</tt>", "<tt>umd1.umd.edu</tt>", and "<tt>lilben.tn.cornell.edu</tt>"; and a property "<tt>driftfile</tt>" with the single value "<tt>/etc/ntp.drift</tt>".</p> + <p>Values may contain multiple tokens similar to the arguments available in the configuration file. For example, to use <tt>mimsy.mil</tt> as an NTP version 1 time server, you would add a value "<tt>mimsy.mil version 1</tt>" to the "<tt>server</tt>" property.</p> + <h4>Ntp4 Versus Previous Versions</h4> + There are several items of note when dealing with a mixture of <tt>ntp4</tt> and previous distributions of NTP Version 2 (<tt>ntpd</tt>) and NTP Version 1 (<tt>ntp3.4</tt>). The <tt>ntp4</tt> implementation conforms to the NTP Version 3 specification RFC-1305 and, in addition, contains additional features documented in the <a href="release.html">Release Notes</a> page. As such, by default when no additional information is available concerning the preferences of the peer, <tt>ntpd</tt> claims to be version 4 in the packets that it sends from configured associations. The <tt>version</tt> subcommand of the <tt>server</tt>, <tt>peer</tt>, <tt>broadcast</tt> and <tt>manycastclient</tt> command can be used to change the default. In unconfigured (ephemeral) associaitons, the daemon always replies in the same version as the request. + <p>An NTP implementation conforming to a previous version specification ordinarily discards packets from a later version. However, in most respects documented in RFC-1305, The version 2 implementation is compatible with the version 3 algorithms and protocol. The version 1 implementation contains most of the version 2 algorithms, but without important features for clock selection and robustness. Nevertheless, in most respects the NTP versions are backwards compatible. The sticky part here is that, when a previous version implementation receives a packet claiming to be from a version 4 server, it discards it without further processing. Hence there is a danger that in some situations synchronization with previous versions will fail.</p> + <p>The trouble occurs when an previous version is to be included in an <tt>ntpd</tt> configuration file. With no further indication, <tt>ntpd</tt> will send packets claiming to be version 4 when it polls. To get around this, <tt>ntpd</tt> allows a qualifier to be added to configuration entries to indicate which version to use when polling. Hence the entries</p> + <pre> + # specify NTP version 1 + + server mimsy.mil version +1 # server running ntpd version 1 + server apple.com version +2 # server running ntpd version 2 +</pre> + will cause version 1 packets to be sent to the host mimsy.mil and version 2 packets to be sent to apple.com. If you are testing <tt>ntpd</tt> against previous version servers you will need to be careful about this. Note that, as indicated in the RFC-1305 specification, there is no longer support for the original NTP specification, once called NTP Version 0. + <h4>Traffic Monitoring</h4> + <tt>ntpd</tt> handles peers whose stratum is higher than the stratum of the local server and polls using client mode by a fast path which minimizes the work done in responding to their polls, and normally retains no memory of these pollers. Sometimes, however, it is interesting to be able to determine who is polling the server, and how often, as well as who has been sending other types of queries to the server. + <p>To allow this, <tt>ntpd</tt> implements a traffic monitoring facility which records the source address and a minimal amount of other information from each packet which is received by the server. This feature is normally enabled, but can be disabled if desired using the configuration file entry:</p> + <pre> + # disable monitoring feature + disable monitor +</pre> + The recorded information can be displayed using the <tt>ntpdc</tt> query program, described briefly below. + <h4>Address-and-Mask Restrictions</h4> + The address-and-mask configuration facility supported by <tt>ntpd</tt> is quite flexible and general, but is not an integral part of the NTP Version 3 specification. The major drawback is that, while the internal implementation is very nice, the user interface is not. For this reason it is probably worth doing an example here. Briefly, the facility works as follows. There is an internal list, each entry of which holds an address, a mask and a set of flags. On receipt of a packet, the source address of the packet is compared to each entry in the list, with a match being posted when the following is true: + <pre> + (source_addr & mask) == (address & +mask) +</pre> + A particular source address may match several list entries. In this case the entry with the most one bits in the mask is chosen. The flags associated with this entry are used to control the access. + <p>In the current implementation the flags always add restrictions. In effect, an entry with no flags set leaves matching hosts unrestricted. An entry can be added to the internal list using a <tt>restrict</tt> declaration. The flags associated with the entry are specified textually. For example, the <tt>notrust</tt> flag indicates that hosts matching this entry, while treated normally in other respects, shouldn't be trusted to provide synchronization even if otherwise so enabled. The <tt>nomodify</tt> flag indicates that hosts matching this entry should not be allowed to do run-time configuration. There are many more flags, see the <a href="ntpd.html"><tt>ntpd</tt></a> page.</p> + <p>Now the example. Suppose you are running the server on a host whose address is 128.100.100.7. You would like to ensure that run time reconfiguration requests can only be made from the local host and that the server only ever synchronizes to one of a pair of off-campus servers or, failing that, a time source on net 128.100. The following entries in the configuration file would implement this policy:</p> + <pre> + # by default, don't trust and don't allow +modifications + + restrict default notrust nomodify + + # these guys are trusted for time, but no +modifications allowed + + restrict 128.100.0.0 mask 255.255.0.0 nomodify + restrict 128.8.10.1 nomodify + restrict 192.35.82.50 nomodify + + # the local addresses are unrestricted + + restrict 128.100.100.7 + restrict 127.0.0.1 +</pre> + The first entry is the default entry, which all hosts match and hence which provides the default set of flags. The next three entries indicate that matching hosts will only have the <tt>nomodify</tt> flag set and hence will be trusted for time. If the mask isn't specified in the <tt>restrict</tt> keyword, it defaults to 255.255.255.255. Note that the address 128.100.100.7 matches three entries in the table, the default entry (mask 0.0.0.0), the entry for net 128.100 (mask 255.255.0.0) and the entry for the host itself (mask 255.255.255.255). As expected, the flags for the host are derived from the last entry since the mask has the most bits set. + <p>The only other thing worth mentioning is that the <tt>restrict</tt> declarations apply to packets from all hosts, including those that are configured elsewhere in the configuration file and even including your clock pseudopeer(s), if any. Hence, if you specify a default set of restrictions which you don't wish to be applied to your configured peers, you must remove those restrictions for the configured peers with additional <tt>restrict</tt> declarations mentioning each peer separately.</p> + <h4>Authentication</h4> + <tt>ntpd</tt> supports the optional authentication procedure specified in the NTP Version 2 and 3 specifications. Briefly, when an association runs in authenticated mode, each packet transmitted has appended to it a 32-bit key ID and a 64/128-bit cryptographic checksum of the packet contents computed using either the Data Encryption Standard (DES) or Message Digest (MD5) algorithms. Note that, while either of these algorithms provide sufficient protection from message- modification attacks, distribution of the former algorithm implementation is restricted to the U.S. and Canada, while the latter presently is free from such restrictions. For this reason, the DES algorithm is not included in the current distribution. Directions for obtaining it in other countries is in the <a href="build/build.html">Building and Installing the Distribution</a> page. With either algorithm the receiving peer recomputes the checksum and compares it with the one included in the packet. For this to work, the peers must share at least one encryption key and, furthermore, must associate the shared key with the same key ID. + <p>This facility requires some minor modifications to the basic packet processing procedures, as required by the specification. These modifications are enabled by the <tt>enable auth</tt> configuration declaration, which is currently the default. In authenticated mode, peers which send unauthenticated packets, peers which send authenticated packets which the local server is unable to decrypt and peers which send authenticated packets encrypted using a key we don't trust are all marked untrustworthy and unsuitable for synchronization. Note that, while the server may know many keys (identified by many key IDs), it is possible to declare only a subset of these as trusted. This allows the server to share keys with a client which requires authenticated time and which trusts the server, but which is not trusted by the server. Also, some additional configuration language is required to specify the key ID to be used to authenticate each configured peer association. Hence, for a server running in authenticated mode, the configuration file might look similar to the following:</p> + <pre> + # peer configuration for 128.100.100.7 + # (expected to operate at stratum 2) + # fully authenticated this time + + peer 128.100.49.105 key 22 # +suzuki.ccie.utoronto.ca + peer 128.8.10.1 key 4 # +umd1.umd.edu + peer 192.35.82.50 key 6 # +lilben.tn.cornell.edu + + keys /usr/local/etc/ntp.keys # path for +key file + trustedkey 1 2 14 15 # +define trusted keys + requestkey +15 # +key (7) for accessing server variables + controlkey +15 # +key (6) for accessing server variables + + authdelay +0.000094 # authentication delay +(Sun4c/50 IPX) +</pre> + There are a couple of previously unmentioned things in here. The <tt>keys</tt> line specifies the path to the keys file (see below and the <tt>ntpd</tt> document page for details of the file format). The <tt>trustedkey</tt> declaration identifies those keys that are known to be uncompromised; the remainder presumably represent the expired or possibly compromised keys. Both sets of keys must be declared by key identifier in the <tt>ntp.keys</tt> file described below. This provides a way to retire old keys while minimizing the frequency of delicate key-distribution procedures. The <tt>requestkey</tt> line establishes the key to be used for mode-6 control messages as specified in RFC-1305 and used by the <tt>ntpq</tt> utility program, while the <tt>controlkey</tt> line establishes the key to be used for mode-7 private control messages used by the <tt>ntpdc</tt> utility program. These keys are used to prevent unauthorized modification of daemon variables. + <p>Ordinarily, the authentication delay; that is, the processing time taken between the freezing of a transmit timestamp and the actual transmission of the packet when authentication is enabled (i.e. more or less the time it takes for the DES or MD5 routine to encrypt a single block) is computed automatically by the daemon. If necessary, the delay can be overridden by the <tt>authdelay</tt> line, which is used as a correction for the transmit timestamp.</p> + Additional utility programs included in the <tt>./authstuff</tt> directory can be used to generate random keys, certify implementation correctness and display sample keys. As a general rule, keys should be chosen randomly, except possibly the request and control keys, which must be entered by the user as a password. + <p>The <tt>ntp.keys</tt> file contains the list of keys and associated key IDs the server knows about (for obvious reasons this file is better left unreadable by anyone except root). The contents of this file might look like:</p> + <pre> + # ntp keys file (ntp.keys) + 1 N +29233E0461ECD6AE # DES key in NTP format + 2 M +RIrop8KPPvQvYotM # md5 key as an ASCII random string + 14 M +sundial +; # md5 key as an ASCII string + 15 A +sundial +; # DES key as an ASCII string + + # the following 3 keys are identical + + 10 A SeCReT + 10 N +d3e54352e5548080 + 10 S +a7cb86a4cba80101 +</pre> + In the keys file the first token on each line indicates the key ID, the second token the format of the key and the third the key itself. There are four key formats. An <tt>A</tt> indicates a DES key written as a 1- to-8 character string in 7-bit ASCII representation, with each character standing for a key octet (like a Unix password). An <tt>S</tt> indicates a DES key written as a hex number in the DES standard format, with the low order bit (LSB) of each octet being the (odd) parity bit. An <tt>N</tt> indicates a DES key again written as a hex number, but in NTP standard format with the high order bit of each octet being the (odd) parity bit (confusing enough?). An <tt>M</tt> indicates an MD5 key written as a 1-to-31 character ASCII string in the <tt>A</tt> format. Note that, because of the simple tokenizing routine, the characters <tt>' ', '#', '\t', '\n'</tt> and <tt>'\0'</tt> can't be used in either a DES or MD5 ASCII key. Everything else is fair game, though. Key 0 (zero) is used for special purposes and should not appear in this file. + <p>The big trouble with the authentication facility is the keys file. It is a maintenance headache and a security problem. This should be fixed some day. Presumably, this whole bag of worms goes away if/when a generic security regime for the Internet is established. An alternative with NTP Version 4 is the autokey feature, which uses random session keys and public-key cryptography and avoids the key file entirely. While this feature is not completely finished yet, details can be found in the <a href="release.html">Release Notes</a> page.</p> + <h4>Query Programs</h4> + Three utility query programs are included with the distribution, <tt>ntpq</tt>, <tt>ntptrace</tt> and <tt>ntpdc</tt>. <tt>ntpq</tt> is a handy program which sends queries and receives responses using NTP standard mode-6 control messages. Since it uses the standard control protocol specified in RFC- 1305, it may be used with NTP Version 2 and Version 3 implementations for both Unix and Fuzzball, but not Version 1 implementations. It is most useful to query remote NTP implementations to assess timekeeping accuracy and expose bugs in configuration or operation. + <p><tt>ntptrace</tt> can be used to display the current synchronization path from a selected host through possibly intervening servers to the primary source of synchronization, usually a radio clock. It works with both version 2 and version 3 servers, but not version 1.</p> + <p><tt>ntpdc</tt> is a horrid program which uses NTP private mode-7 control messages to query local or remote servers. The format and contents of these messages are specific to this version of <tt>ntpd</tt> and some older versions. The program does allow inspection of a wide variety of internal counters and other state data, and hence does make a pretty good debugging tool, even if it is frustrating to use. The other thing of note about <tt>ntpdc</tt> is that it provides a user interface to the run time reconfiguration facility. See the respective document pages for details on the use of these programs.</p> + <h4>Run-Time Reconfiguration</h4> + <tt>ntpd</tt> was written specifically to allow its configuration to be fully modifiable at run time. Indeed, the only way to configure the server is at run time. The configuration file is read only after the rest of the server has been initialized into a running default-configured state. This facility was included not so much for the benefit of Unix, where it is handy but not strictly essential, but rather for dedicated platforms where the feature is more important for maintenance. Nevertheless, run time configuration works very nicely for Unix servers as well. + <p>Nearly all of the things it is possible to configure in the configuration file may be altered via NTP mode-7 messages using the <tt>ntpdc</tt> program. Mode-6 messages may also provide some limited configuration functionality (though the only thing you can currently do with mode-6 messages is set the leap-second warning bits) and the <tt>ntpq</tt> program provides generic support for the latter. The leap bits that can be set in the <tt>leap_warning</tt> variable (up to one month ahead) and in the <tt>leap_indication</tt> variable have a slightly different encoding than the usual interpretation:</p> + <pre> + +Value Action + + +00 +p; The daemon passes the leap bits of its + + +synchronisation source (usual mode of operation) + + 01/10 A leap +second is added/deleted + + +11 +p; Leap information from the synchronization source + + is +ignored (thus LEAP_NOWARNING is passed on) +</pre> + Mode-6 and mode-7 messages which would modify the configuration of the server are required to be authenticated using standard NTP authentication. To enable the facilities one must, in addition to specifying the location of a keys file, indicate in the configuration file the key IDs to be used for authenticating reconfiguration commands. Hence the following fragment might be added to a configuration file to enable the mode-6 (ntpq) and mode-7 (ntpdc) facilities in the daemon: + <pre> + # specify mode-6 and mode-7 trusted keys + + requestkey 65535 # for mode-7 +requests + controlkey 65534 # for mode-6 +requests +</pre> + If the <tt>requestkey</tt> and/or the <tt>controlkey</tt> configuration declarations are omitted from the configuration file, the corresponding run-time reconfiguration facility is disabled. + <p>The query programs require the user to specify a key ID and a key to use for authenticating requests to be sent. The key ID provided should be the same as the one mentioned in the configuration file, while the key should match that corresponding to the key ID in the keys file. As the query programs prompt for the key as a password, it is useful to make the request and control authentication keys typeable (in ASCII format) from the keyboard.</p> + <h4>Name Resolution</h4> + <tt>ntpd</tt> includes the capability to specify host names requiring resolution in <tt>peer</tt> and <tt>server</tt> declarations in the configuration file. However, in some outposts of the Internet, name resolution is unreliable and the interface to the Unix resolver routines is synchronous. The hangups and delays resulting from name-resolver clanking can be unacceptable once the NTP server is running (and remember it is up and running before the configuration file is read). However, it is advantageous to resolve time server names, since their addresses are occasionally changed. + <p>In order to prevent configuration delays due to the name resolver, the daemon runs the name resolution process in parallel with the main daemon code. When the daemon comes across a <tt>peer</tt> or <tt>server</tt> entry with a non-numeric host address, it records the relevant information in a temporary file and continues on. When the end of the configuration file has been reached and one or more entries requiring name resolution have been found, the server runs the name resolver from the temporary file. The server then continues on normally but with the offending peers/servers omitted from its configuration.</p> + <p>As each name is resolved, it configures the associated entry into the server using the same mode-7 run time reconfiguration facility that <tt>ntpdc</tt> uses. If temporary resolver failures occur, the resolver will periodically retry the requests until a definite response is received. The program will continue to run until all entries have been resolved.</p> + <h4>Dealing with Frequency Tolerance Violations (<tt>tickadj</tt> and Friends)</h4> + The NTP Version 3 specification RFC-1305 calls for a maximum oscillator frequency tolerance of +-100 parts-per-million (PPM), which is representative of those components suitable for use in relatively inexpensive workstation platforms. For those platforms meeting this tolerance, NTP will automatically compensate for the frequency errors of the individual oscillator and no further adjustments are required, either to the configuration file or to various kernel variables. For the NTP Version 4 release, this tolerance has been increased to +-500 PPM. + <p>However, in the case of certain notorious platforms, in particular Sun 4.1.1 systems, the performance can be improved by adjusting the values of certain kernel variables; in particular, <tt>tick</tt> and <tt>tickadj</tt>. The variable <tt>tick</tt> is the increment in microseconds added to the system time on each interval- timer interrupt, while the variable <tt>tickadj</tt> is used by the time adjustment code as a slew rate, in microseconds per tick. When the time is being adjusted via a call to the system routine <tt>adjtime()</tt>, the kernel increases or reduces tick by <tt>tickadj</tt> microseconds per tick until the specified adjustment has been completed. Unfortunately, in most Unix implementations the tick increment must be either zero or plus/minus exactly <tt>tickadj</tt> microseconds, meaning that adjustments are truncated to be an integral multiple of <tt>tickadj</tt> (this latter behaviour is a misfeature, and is the only reason the <tt>tickadj</tt> code needs to concern itself with the internal implementation of <tt>tickadj</tt> at all). In addition, the stock Unix implementation considers it an error to request another adjustment before a prior one has completed.</p> + <p>Thus, to make very sure it avoids problems related to the roundoff, the <tt>tickadj</tt> program can be used to adjust the values of <tt>tick</tt> and <tt>tickadj</tt>. This ensures that all adjustments given to <tt>adjtime()</tt> are an even multiple of <tt>tickadj</tt> microseconds and computes the largest adjustment that can be completed in the adjustment interval (using both the value of <tt>tick</tt> and the value of <tt>tickadj</tt>) so it can avoid exceeding this limit. It is important to note that not all systems will allow inspection or modification of kernel variables other than at system build time. It is also important to know that, with the current NTP tolerances, it is rarely necessary to make these changes, but in many cases they will substantially improve the general accuracy of the time service.</p> + <p>Unfortunately, the value of <tt>tickadj</tt> set by default is almost always too large for <tt>ntpd</tt>. NTP operates by continuously making small adjustments to the clock, usually at one-second intervals. If <tt>tickadj</tt> is set too large, the adjustments will disappear in the roundoff; while, if <tt>tickadj</tt> is too small, NTP will have difficulty if it needs to make an occasional large adjustment. While the daemon itself will read the kernel's values of these variables, it will not change the values, even if they are unsuitable. You must do this yourself before the daemon is started using the <tt>tickadj</tt> program included in the <tt>./util</tt> directory of the distribution. Note that the latter program will also compute an optimal value of <tt>tickadj</tt> for NTP use based on the kernel's value of <tt>tick</tt>.</p> + <p>The <tt>tickadj</tt> program can reset several other kernel variables if asked. It can change the value of <tt>tick</tt> if asked. This is handy to compensate for kernel bugs which cause the clock to run with a very large frequency error, as with SunOS 4.1.1 systems. It can also be used to set the value of the kernel <tt>dosynctodr</tt> variable to zero. This variable controls whether to synchronize the system clock to the time-of-day clock, something you really don't want to be happen when <tt>ntpd</tt> is trying to keep it under control. In some systems, such as recent Sun Solaris kernels, the <tt>dosynctodr</tt> variable is the only one that can be changed by the <tt>tickadj</tt> program. In this and other modern kernels, it is not necessary to change the other variables in any case.</p> + <p>We have a report that says starting with Solaris 2.6 we should leave <i>dosynctodr</i> alone.</p> + <p>In order to maintain reasonable correctness bounds, as well as reasonably good accuracy with acceptable polling intervals, <tt>ntpd</tt> will complain if the frequency error is greater than 500 PPM. For machines with a value of <tt>tick</tt> in the 10-ms range, a change of one in the value of <tt>tick</tt> will change the frequency by about 100 PPM. In order to determine the value of <tt>tick</tt> for a particular CPU, disconnect the machine from all sources of time (<tt>dosynctodr</tt> = 0) and record its actual time compared to an outside source (eyeball-and-wristwatch will do) over a day or more. Multiply the time change over the day by 0.116 and add or subtract the result to tick, depending on whether the CPU is fast or slow. An example call to <tt>tickadj</tt> useful on SunOS 4.1.1 is:</p> + <pre> + <tt>tickadj</tt> -t 9999 -a 5 -s +</pre> + which sets tick 100 PPM fast, <tt>tickadj</tt> to 5 microseconds and turns off the clock/calendar chip fiddle. This line can be added to the <tt>rc.local</tt> configuration file to automatically set the kernel variables at boot time. + <p>All this stuff about diddling kernel variables so the NTP daemon will work is really silly. If vendors would ship machines with clocks that kept reasonable time and would make their <tt>adjtime()</tt> system call apply the slew it is given exactly, independent of the value of <tt>tickadj</tt>, all this could go away. This is in fact the case on many current Unix systems.</p> + <h4>Tuning Your Subnet</h4> + There are several parameters available for tuning the NTP subnet for maximum accuracy and minimum jitter. One of these is the <tt>prefer</tt> configuration declaration described in <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> documentation page. When more than one eligible server exists, the NTP clock-selection and combining algorithms act to winnow out all except the "best" set of servers using several criteria based on differences between the readings of different servers and between successive readings of the same server. The result is usually a set of surviving servers that are apparently statistically equivalent in accuracy, jitter and stability. The population of survivors remaining in this set depends on the individual server characteristics measured during the selection process and may vary from time to time as the result of normal statistical variations. In LANs with high speed RISC-based time servers, the population can become somewhat unstable, with individual servers popping in and out of the surviving population, generally resulting in a regime called <i>clockhopping</i>. + <p>When only the smallest residual jitter can be tolerated, it may be convenient to elect one of the servers at each stratum level as the preferred one using the keyword <tt>prefer</tt> on the configuration declaration for the selected server:</p> + <pre> + # preferred server declaration + + peer rackety.udel.edu prefer +# preferred server +</pre> + The preferred server will always be included in the surviving population, regardless of its characteristics and as long as it survives preliminary sanity checks and validation procedures. + <p>The most useful application of the <tt>prefer</tt> keyword is in high speed LANs equipped with precision radio clocks, such as a GPS receiver. In order to insure robustness, the hosts need to include outside peers as well as the GPS-equipped server; however, as long as that server is running, the synchronization preference should be that server. The keyword should normally be used in all cases in order to prefer an attached radio clock. It is probably inadvisable to use this keyword for peers outside the LAN, since it interferes with the carefully crafted judgement of the selection and combining algorithms.</p> + <h4>Provisions for Leap Seconds and Accuracy Metrics</h4> + <tt>ntpd</tt> understands leap seconds and will attempt to take appropriate action when one occurs. In principle, every host running ntpd will insert a leap second in the local timescale in precise synchronization with UTC. This requires that the leap-warning bits be activated some time prior to the occurrence of a leap second at the primary (stratum 1) servers. Subsequently, these bits are propagated throughout the subnet depending on these servers by the NTP protocol itself and automatically implemented by <tt>ntpd</tt> and the time- conversion routines of each host. The implementation is independent of the idiosyncrasies of the particular radio clock, which vary widely among the various devices, as long as the idiosyncratic behavior does not last for more than about 20 minutes following the leap. Provisions are included to modify the behavior in cases where this cannot be guaranteed. While provisions for leap seconds have been carefully crafted so that correct timekeeping immediately before, during and after the occurrence of a leap second is scrupulously correct, stock Unix systems are mostly inept in responding to the available information. This caveat goes also for the maximum-error and statistical-error bounds carefully calculated for all clients and servers, which could be very useful for application programs needing to calibrate the delays and offsets to achieve a near- simultaneous commit procedure, for example. While this information is maintained in the <tt>ntpd</tt> data structures, there is at present no way for application programs to access it. This may be a topic for further development. + <h4>Clock Support Overview</h4> + <tt>ntpd</tt> was designed to support radio (and other external) clocks and does some parts of this function with utmost care. Clocks are treated by the protocol as ordinary NTP peers, even to the point of referring to them with an (invalid) IP host address. Clock addresses are of the form 127.127.<i>t.u</i>, where <i>t</i> specifies the particular type of clock (i.e., refers to a particular clock driver) and <i>u</i> is a unit number whose interpretation is clock-driver dependent. This is analogous to the use of major and minor device numbers by Unix and permits multiple instantiations of clocks of the same type on the same server, should such magnificent redundancy be required. + <p>Because clocks look much like peers, both configuration file syntax and run time reconfiguration commands can be used to control clocks in the same way as ordinary peers. Clocks are configured via <tt>server</tt> declarations in the configuration file, can be started and stopped using ntpdc and are subject to address-and-mask restrictions much like a normal peer, should this stretch of imagination ever be useful. As a concession to the need to sometimes transmit additional information to clock drivers, an additional configuration file is available: the <tt>fudge</tt> statement. This enables one to specify the values of two time quantities, two integral values and two flags, the use of which is dependent on the particular clock driver. For example, to configure a PST radio clock which can be accessed through the serial device <tt>/dev/pst1</tt>, with propagation delays to WWV and WWVH of 7.5 and 26.5 milliseconds, respectively, on a machine with an imprecise system clock and with the driver set to disbelieve the radio clock once it has gone 30 minutes without an update, one might use the following configuration file entries:</p> + <pre> + # radio clock fudge fiddles + server 127.127.3.1 + fudge 127.127.3.1 time1 0.0075 time2 0.0265 + fudge 127.127.3.1 value2 30 flag1 1 +</pre> + Additional information on the interpretation of these data with respect to various radio clock drivers is given in the <a href="refclock.html">Reference Clock Drivers</a> document page and in the individual driver documents accessible via that page. + <h4>Towards the Ultimate Tick</h4> + This section considers issues in providing precision time synchronization in NTP subnets which need the highest quality time available in the present technology. These issues are important in subnets supporting real-time services such as distributed multimedia conferencing and wide-area experiment control and monitoring. + <p>In the Internet of today synchronization paths often span continents and oceans with moderate to high variations in delay due to traffic spasms. NTP is specifically designed to minimize timekeeping jitter due to delay variations using intricately crafted filtering and selection algorithms; however, in cases where these variations are as much as a second or more, the residual jitter following these algorithms may still be excessive. Sometimes, as in the case of some isolated NTP subnets where a local source of precision time is available, such as a PPS signal produced by a calibrated cesium clock, it is possible to remove the jitter and retime the local clock oscillator of the NTP server. This has turned out to be a useful feature to improve the synchronization quality of time distributed in remote places where radio clocks are not available. In these cases special features of the distribution are used together with the PPS signal to provide a jitter-free timing signal, while NTP itself is used to provide the coarse timing and resolve the seconds numbering.</p> + <p>Most available radio clocks can provide time to an accuracy in the order of milliseconds, depending on propagation conditions, local noise levels and so forth. However, as a practical matter, all clocks can occasionally display errors significantly exceeding nominal specifications. Usually, the algorithms used by NTP for ordinary network peers, as well as radio clock peers will detect and discard these errors as discrepancies between the disciplined local clock oscillator and the decoded time message produced by the radio clock. Some radio clocks can produce a special PPS signal which can be interfaced to the server platform in a number of ways and used to substantially improve the (disciplined) clock oscillator jitter and wander characteristics by at least an order of magnitude. Using these features it is possible to achieve accuracies in the order of a few tens of microseconds with a fast RISC- based platform.</p> + <p>There are three ways to implement PPS support, depending on the radio clock model, platform model and serial line interface. These are described in detail in the application notes mentioned in the <a href="index.html">The Network Time Protocol (NTP) Distribution</a> document page. Each of these requires circuitry to convert the TTL signal produced by most clocks to the EIA levels used by most serial interfaces. The <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page describes a device designed to do this. Besides being useful for this purpose, this device includes an inexpensive modem designed for use with the Canadian CHU time/frequency radio station.</p> + <p>In order to select the appropriate implementation, it is important to understand the underlying PPS mechanism used by ntpd. The PPS support depends on a continuous source of PPS pulses used to calculate an offset within +-500 milliseconds relative to the local clock. The serial timecode produced by the radio or the time determined by NTP in absence of the radio is used to adjust the local clock within +-128 milliseconds of the actual time. As long as the local clock is within this interval the PPS support is used to discipline the local clock and the timecode used only to verify that the local clock is in fact within the interval. Outside this interval the PPS support is disabled and the timecode used directly to control the local clock.</p> + <h4>Parting Shots</h4> + There are several undocumented programs which can be useful in unusual cases. They can be found in the <tt>./clockstuff</tt> and <tt>./authstuff</tt> directories of the distribution. One of these is the <tt>propdelay</tt> program, which can compute high frequency radio propagation delays between any two points whose latitude and longitude are known. The program understands something about the phenomena which allow high frequency radio propagation to occur, and will generally provide a better estimate than a calculation based on the great circle distance. Other programs of interest include <tt>clktest</tt>, which allows one to exercise the generic clock line discipline, and <tt>chutest</tt>, which runs the basic reduction algorithms used by the daemon on data received from a serial port. + <hr> + <center> + <img src="pic/pogo1a.gif" alt="gif"></center> + <br> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntp_conf.html b/contrib/ntp/html/ntp_conf.html new file mode 100644 index 0000000..520ce45 --- /dev/null +++ b/contrib/ntp/html/ntp_conf.html @@ -0,0 +1,173 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Configuration File Definition (Advanced)</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Configuration File Definition (Advanced)</h3> + <img src="pic/bustardfly.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>A typical NTP monitoring packet</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">19:46</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="223">Friday, June 16, 2006</csobj></p> + <br clear="left"> + <hr> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#synopsis">Synopsis</a><br> + <li class="inline"><a href="#files">Files</a> + <li class="inline"><a href="#high-level">High-Level Description</a> + <li class="inline"><a href="#detailed">Detailed Description</a> + <li class="inline"><a href="#guidelines">Guidelines for Adding Configuration Commands </a> + </ul> + <h4 id="synopsis">Synopsis</h4> + <p>The NTP configuration process is driven by a phrase-structure grammar which is used to specify the format of the configuration commands and the actions needed to build an abstract syntax tree (AST). The grammar is fed to a parser generator (Bison) which produces a parser for the configuration file.</p> + <p>The generated parser is used to parse an NTP configuration file and check it for syntax and semantic errors. The result of the parse is an AST, which contains a representation of the various commands and options. This AST is then traversed to set up the NTP daemon to the correct configuration.</p> + <p>This document is intended for developers who wish to modify the configuration code and/or add configuration commands and options. It contains a description of the files used in the configuration process as well as guidelines on how to construct them.</p> + <h4 id="files">Files</h4> + <p>A brief description of the files used by the configuration code is given below:</p> + <table border="1"> + <tbody> + <tr> + <th width="179">File</th> + <th width="537">Description</th> + </tr> + <tr> + <td valign="top"><b>ntp_config.y</b></td> + <td>This file is a Bison source file that contains the phrase-structure grammar and the actions that need to be performed to generate an AST.</td> + </tr> + <tr> + <td valign="top"><b>ntp_config.c</b></td> + <td>This file contains the major chunk of the configuration code. It contains all the functions that are called for building the AST as well as the functions that are needed for traversing the AST.</td> + </tr> + <tr> + <td valign="top"><b>ntp_config.h</b></td> + <td>This file is the header file for <b>ntp_config.c</b>. It mainly contains the structure definitions needed to build the AST. </td> + </tr> + <tr> + <td valign="top"><b>ntp_scanner.c</b></td> + <td>This file contains the code for a simple lexical analyzer. This file is directly included into the <b>ntp_config.c</b> file since this code is only used by the configuration code. The most important function in this file is <tt>yylex</tt>, which is called by the generated parser to get the next token on the input line.</td> + </tr> + <tr> + <td valign="top"><b>ntp_data_structures.c</b></td> + <td>This file contains a generic implementation of a priority queue and a simple queue. This code can be used to create a queue for any structure.</td> + </tr> + <tr> + <td valign="top"><b>ntp_data_structures.h</b></td> + <td>This header file contains the structure declarations and function prototypes needed to use the data structures defined in <b>ntp_data_structures.c</b>. This file forms the public interface of the data structures.</td> + </tr> + <tr> + <td valign="top"><b>ntp_config.tab.c</b></td> + <td>This file is generated by Bison from the <b>ntp_config.y</b> file. This file is also included directly into the configuration code.</td> + </tr> + </tbody> + </table> + <h4 id="high-level">High-Level Description</h4> + <p>A high-level description of the configuration process showing where all the files fit in is given below:</p> + <p><img src="pic/description.jpg" alt="JPEG" border="0"></p> + <p>The scanner reads in an NTP configuration file and converts it into tokens. The Bison generated parser reads these tokens and converts them into an AST. The AST traverser consists of a set of functions that configure parts of NTP on the basis of what is on the tree. A more detailed description of these parts and the files used is given below:</p> + <h4 id="detailed">Detailed Description</h4> + <dl> + <dt><b>ntp_scanner.c</b> + <dd>This file contains the scanner. The scanner is a small program that converts an input NTP configuration file into a set of <b>tokens</b> that correspond to <b>lexemes</b> in the input. Lexemes are strings in the input, delimited by whitespace and/or special characters. Tokens are basically unique integers that represent these lexemes. A different token is generated for each reserved word and special character in the input. There are two main functions in the public interface of this file: + <dt><tt>int yylex</tt>() + <dd>This function is called <tt>yylex</tt> for historical reasons; <tt>lex</tt> is a program that takes a set of regular expressions and generates a scanner that returns tokens corresponding to those regular expressions. The name of the generated function is called <tt>yylex</tt>. We aren't using<b> </b><tt>lex</tt><b> </b>because it requires linking against an external library and we didn't want to increase the compile-time requirements of NTP. + <dd>History lessons aside, this function basically checks to see if the next input character is a special character as defined in the array <tt>char special_char[]</tt>. (The function <tt>int is_special(char ch)</tt>, can be used for this.) If yes, the special character is returned as the token. If not, a set of characters is read until the next whitespace or special character is encountered. This set of characters forms the lexeme; <tt>yylex</tt> then checks whether this lexeme is an integer, a double, an IP address or a reserved word. If yes, the corresponding token is returned. If not, a token for a string is returned as the default token. + <dt><tt>struct state *create_keyword_scanner(struct key_tok *<i>keyword_list</i>)</tt> + <dd>This function takes a list of (<i>keyword, token</i>) pairs and converts them into a trie that can recognize the keywords (reserved words). Every time the scanner reads a lexeme, it compares it against the list of reserved words. If it finds a match, it returns the corresponding token for that keyword. + <dt><b>ntp_data_structures.c</b> + <dd>This file contains an implementation of a generic priority queue and FIFO queue. By generic, we mean that these queues can hold element of any type (integers, user-defined structs, etc.), provided that these elements are allocated on the heap using the function <tt>void</tt> *<tt>get_node(size_t size)</tt>. Note that the prototype for this function is exactly the same as that of <tt>malloc</tt> and that it can be used in the exact same way. Behind the scenes, <tt>get_node</tt> calls <tt>malloc</tt> to allocate <i>size</i> plus some extra memory needed for bookkeeping. The allocated memory can be freed using the function <tt>void free_node (void *<i>my_node</i>)</tt>. In addition to these two functions, the public interface of this file contains the following functions: + <dt><tt>queue *create_priority_queue(int (*get_order)(void *, void*))</tt> + <dd>This function creates a priority queue in which the order of the elements is determined by the <tt>get_order</tt><b> </b>function that is passed as input to the priority queue. The <tt>get_order</tt><b> </b>function should return positive if the priority of the first element is less than the priority of the second element. + <dt><tt>queue *create_queue(void)</tt> + <dd>This function creates a FIFO queue. It basically calls the <tt>create_priority_queue</tt> function with the <tt>get_fifo_order</tt><b> </b>function as its argument. + <dt><tt>void destroy_queue(queue *<i>my_queue</i>)</tt> + <dd>This function deletes <tt><i>my_queue</i></tt><b> </b>and frees up all the memory allocated to it an its elements. + <dt><tt>int empty(queue *</tt><i><tt>my_queue</tt></i><tt>)</tt> + <dd>This function checks to see if <i><tt>my_queue</tt></i> is empty. Returns <tt>true</tt> if <tt><i>my_queue</i></tt> does not have any elements, else it returns false. + <dt><tt>queue *enqueue(queue *<i>my_queue</i>, void *<i>my_node</i>)</tt> + <dd>This function adds an element, <i><tt>my_node</tt></i>, to a queue, <i><tt>my_queue</tt></i>. <i><tt>my_node</tt></i> must be allocated on the heap using the <tt>get_node</tt> function instead of <tt>malloc</tt>. + <dt><tt>void *dequeue(queue *<i>my_queue</i>)</tt> + <dd>This function returns the element at the front of the queue. This element will be element with the highest priority. + <dt><tt>int get_no_of_elements(queue *<i>my_queue</i>)</tt> + <dd>This function returns the number of elements in <tt><i>my_queue</i></tt>. + <dt><tt>void append_queue(queue *<i>q</i>1, queue *<i>q</i>2)</tt> + <dd>This function adds all the elements of <tt><i>q</i>2</tt> to <tt><i>q</i>1</tt>. The queue <tt><i>q</i>2</tt> is destroyed in the process. + <dt><b>ntp_config.y</b> + <dd>This file is structured as a standard Bison file and consists of three main parts, separated by <tt>%%</tt>: + </dl> + <ol> + <li>The prologue and bison declarations: This section contains a list of the terminal symbols, the non-terminal symbols and the types of these symbols.<li>The rules section: This section contains a description of the actual phrase-structure rules that are used to parse the configuration commands. Each rule consists of a left-hand side (LHS), a right-hand side (RHS) and an optional action. As is standard with phrase-structure grammars, the LHS consists of a single non-terminal symbol. The RHS can contain both terminal and non-terminal symbols, while the optional action can consist of any arbitrary C code. + <li>The epilogue: This section is left empty on purpose. It is traditionally used to code the support functions needed to build the ASTs Since, we have moved all the support functions to <b>ntp_config.c</b>, this section is left empty. + </ol> + <h4>Prologue and Bison Declarations</h4> + <p>All the terminal symbols (also known as tokens) have to be declared in the prologue section. Note that terminals and non-terminals may have values associated with them and these values have types. (More on this later). An unnamed union has to be declared with all the possible types at the start of the prologue section. For example, we declare the following union at the start of the <b>ntp_config.y</b> file:</p> + <p class="style1"><tt>%union {<br> + char *String;<br> + double Double;<br> + int Integer;<br> + void *VoidPtr;<br> + queue *Queue;<br> + struct attr_val *Attr_val;<br> + struct address_node *Address_node;<br> + struct setvar_node *Set_var;<br> + /* Simulation types */<br> + server_info *Sim_server;<br> + script_info *Sim_script;<br> + }</tt></p> + <p>Some tokens may not have any types. For example, tokens that correspond to reserved words do not usually have types as they simply indicate that a reserved word has been read in the input file. Such tokens have to be declared as follows:</p> + <p><tt>%token T_Discard<br> + %token T_Dispersion</tt></p> + <p>Other tokens do have types. For example, a <tt>T_Double</tt> token is returned by the scanner whenever it sees a floating-point double in the configuration file. The value associated with the token is the actual number that was read in the configuration file and its type (after conversion) is double. Hence, the token <tt>T_Double</tt> will have to be declared as follows in the prologue of <b>ntp_config.y</b> file:</p> + <p><tt>%token <Double> T_Double </tt></p> + <p>Note that the declaration given in the angled brackets is not <tt>double</tt> but <tt>Double</tt>, which is the name of the variable given in the <tt>%union {}</tt> declaration above.</p> + <p>Finally, non-terminal symbols may also have values associated with them, which have types. This is because Bison allows non-terminal symbols to have actions associated with them. Actions may be thought of as small functions which get executed whenever the RHS of a non-terminal is detected. The return values of these functions are the values associated with the non-terminals. The types of the non-terminals are specified with a <tt>%type</tt> declaration as shown below:</p> + <p><tt>%type <Queue> address_list<br> + %type <Integer> boolean</tt></p> + <p>The <tt>%type</tt> declaration may be omitted for non-terminals that do not return any value and do not have type information associated with them.</p> + <h4>The Rules Section </h4> + <p>The rule section only consists of phrase-structure grammar rules. Each rule typically has the following format:</p> + <p><tt>LHS : RHS [{ Actions }]<br> + ;</tt></p> + <p>where LHS consists of a single non-terminal symbol and the RHS consists of one or more terminal and non-terminal symbols. The <tt>Actions</tt> are optional and may consist of any number of arbitrary C statements. Note that Bison can only process LALR(1) grammars, which imposes additional restrictions on the kind of rules that can be specified. Examples of rules are shown below:</p> + <p><tt>orphan_mode_command<br> + : T_Tos tos_option_list<br> + { append_queue(my_config.orphan_cmds, $2); }<br> + ;</tt></p> + <p><tt>tos_option_list<br> + : tos_option_list tos_option { $$ = enqueue($1, $2); }<br> + | tos_option { $$ = enqueue_in_new_queue($1); }<br> + ;</tt></p> + <p>The <tt>$n</tt> notation, where <tt>n</tt> is an integer, is used to refer to the value of a terminal or non-terminal symbol. All terminals and non-terminal symbols within a particular rule are numbered (starting from 1) according to the order in which they appear within the RHS of a rule. <tt>$$</tt> is used to refer to the value of the LHS terminal symbol - it is used to return a value for the non-terminal symbol specified in the LHS of the rule.</p> + <h4>Invoking Bison </h4> + <p>Bison needs to be invoked in order to convert the <b>ntp_config.y</b> file into a C source file. To invoke Bison, simply enter the command:</p> + <p><tt>bison ntp_config.y</tt></p> + <p>at the command prompt. If no errors are detected, an <b>ntp_config.tab.c</b> file will be generated by default. This generated file can be directly included into the <b>ntp_config.c</b> file.</p> + <p>If Bison report shift-reduce errors or reduce-reduce errors, it means that the grammar specified using the rules in not LALR(1). To debug such a grammar, invoke Bison with a <tt>-v</tt> switch, as shown below. This will generate a <b>ntp_config.output</b> file, which will contain a description of the generated state machine, together with a list of states that have shift-reduce/reduce-reduce conflicts. You can then change the rules to remove such conflicts.</p> + <p><tt>bison -v ntp_config.y</tt></p> + <p>For more information, refer to the <a href="http://www.gnu.org/software/bison/manual/html_mono/bison.html">Bison manual</a>.</p> + <p><b>ntp_config.c</b></p> + <p>This file contains the major chunk of the configuration code including all the support functions needed for building and traversing the ASTs. As such, most of the functions in this file can be divided into two groups:</p> + <ol> + <li>Functions that have a <tt>create_</tt> prefix. These functions are used to build a node of the AST. + <li>Functions that have a <tt>config_</tt> prefix. These functions are used to traverse the AST and configure NTP according to the nodes present on the tree. + </ol> + <h4>Guidelines for Adding Configuration Commands</h4> + <p>The following steps may be used to add a new configuration command to the NTP reference implementation:</p> + <ol> + <li>Write phrase-structure grammar rules for the syntax of the new command. Add these rules to the rules section of the <b>ntp_config.y</b> file. + <li>Write the action to be performed on recognizing the rules. These actions will be used to build the AST. + <li>If new reserved words are needed, add these to the <tt>struct key_tok keyword_list[]</tt>structure in the <b>ntp_config.c </b>file. This will allow the scanner to recognize these reserved words and generate the desired tokens on recognizing them. + <li>Specify the types of all the terminals and non-terminal symbols in the prologue section of the <b>ntp_config.c</b> file. + <li>Write a function with a <tt>config_</tt> prefix that will be executed for this new command. Make sure this function is called in the <tt>config_ntpd()</tt>function. + </ol> + <hr> + <address><a href="mailto:skamboj@udel.edu">Sachin Kamboj</a></address> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntpd.html b/contrib/ntp/html/ntpd.html new file mode 100644 index 0000000..3b70694 --- /dev/null +++ b/contrib/ntp/html/ntpd.html @@ -0,0 +1,185 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpd - Network Time Protocol (NTP) daemon</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</h3> + <img src="pic/alice47.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The mushroom knows all the command line options.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:44</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#synop">Synopsis</a><br> + <li class="inline"><a href="#descr">Description</a><br> + <li class="inline"><a href="#op">How NTP Operates</a><br> + <li class="inline"><a href="#freq">Frequency Discipline</a><br> + <li class="inline"><a href="#modes">Operating Modes</a><br> + <li class="inline"><a href="#poll">Poll Interval Control</a><br> + <li class="inline"><a href="#poll">Poll Interval Control</a><br> + <li class="inline"><a href="#notes">Notes</a><br> + <li class="inline"><a href="#cmd">Command Line Options</a><br> + <li class="inline"><a href="#cfg">The Configuration File</a><br> + <li class="inline"><a href="#opt">Configuration Options</a><br> + <li class="inline"><a href="#files">Files</a> + </ul> + <hr> + <h4 id="synop">Synopsis</h4> + <tt>ntpd [ -46aAbdDgLmnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt> + <h4 id="descr">Description</h4> + <p>The <tt>ntpd</tt> program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. It is a complete implementation of the Network Time Protocol (NTP) version 4, but also retains compatibility with version 3, as defined by RFC-1305, and version 1 and 2, as defined by RFC-1059 and RFC-1119, respectively. <tt>ntpd</tt> does most computations in 64-bit floating point arithmetic and does relatively clumsy 64-bit fixed point operations only when necessary to preserve the ultimate precision, about 232 picoseconds. While the ultimate precision is not achievable with ordinary workstations and networks of today, it may be required with future gigahertz CPU clocks and gigabit LANs.</p> + <h4 id="op">How NTP Operates</h4> + <p>The <tt>ntpd</tt> program operates by exchanging messages with one or more configured servers at designated poll intervals. When started, whether for the first or subsequent times, the program requires several exchanges from the majority of these servers so the signal processing and mitigation algorithms can accumulate and groom the data and set the clock. In order to protect the network from bursts, the initial poll interval for each server is delayed an interval randomized over a few seconds. At the default initial poll interval of 64s, several minutes can elapse before the clock is set. The initial delay to set the clock can be reduced using the <tt>iburst</tt> keyword with the <tt>server</tt> configuration command, as described on the <a href="confopt.html">Configuration Options</a> page.</p> + <p>Most operating systems and hardware of today incorporate a time-of-year (TOY) chip to maintain the time during periods when the power is off. When the machine is booted, the chip is used to initialize the operating system time. After the machine has synchronized to a NTP server, the operating system corrects the chip from time to time. In case there is no TOY chip or for some reason its time is more than 1000s from the server time, <tt>ntpd</tt> assumes something must be terribly wrong and the only reliable action is for the operator to intervene and set the clock by hand. This causes <tt>ntpd</tt> to exit with a panic message to the system log. The <tt>-g</tt> option overrides this check and the clock will be set to the server time regardless of the chip time. However, and to protect against broken hardware, such as when the CMOS battery fails or the clock counter becomes defective, once the clock has been set, an error greater than 1000s will cause <tt>ntpd</tt> to exit anyway.</p> + <p>Under ordinary conditions, <tt>ntpd</tt> adjusts the clock in small steps so that the timescale is effectively continuous and without discontinuities. Under conditions of extreme network congestion, the roundtrip delay jitter can exceed three seconds and the synchronization distance, which is equal to one-half the roundtrip delay plus error budget terms, can become very large. The <tt>ntpd</tt> algorithms discard sample offsets exceeding 128 ms, unless the interval during which no sample offset is less than 128 ms exceeds 900s. The first sample after that, no matter what the offset, steps the clock to the indicated time. In practice this reduces the false alarm rate where the clock is stepped in error to a vanishingly low incidence.</p> + <p>As the result of this behavior, once the clock has been set, it very rarely strays more than 128 ms, even under extreme cases of network path congestion and jitter. Sometimes, in particular when <tt>ntpd</tt> is first started, the error might exceed 128 ms. This may on occasion cause the clock to be set backwards if the local clock time is more than 128 s in the future relative to the server. In some applications, this behavior may be unacceptable. If the <tt>-x</tt> option is included on the command line, the clock will never be stepped and only slew corrections will be used.</p> + <p>The issues should be carefully explored before deciding to use the <tt>-x</tt> option. The maximum slew rate possible is limited to 500 parts-per-million (PPM) as a consequence of the correctness principles on which the NTP protocol and algorithm design are based. As a result, the local clock can take a long time to converge to an acceptable offset, about 2,000 s for each second the clock is outside the acceptable range. During this interval the local clock will not be consistent with any other network clock and the system cannot be used for distributed applications that require correctly synchronized network time.</p> + <p>In spite of the above precautions, sometimes when large frequency errors are present the resulting time offsets stray outside the 128-ms range and an eventual step or slew time correction is required. If following such a correction the frequency error is so large that the first sample is outside the acceptable range, <tt>ntpd</tt> enters the same state as when the <tt>ntp.drift</tt> file is not present. The intent of this behavior is to quickly correct the frequency and restore operation to the normal tracking mode. In the most extreme cases (<tt>time.ien.it</tt> comes to mind), there may be occasional step/slew corrections and subsequent frequency corrections. It helps in these cases to use the <tt>burst</tt> keyword when configuring the server.</p> + <h4 id="freq">Frequency Discipline</h4> + <p>The <tt>ntpd</tt> behavior at startup depends on whether the frequency file, usually <tt>ntp.drift</tt>, exists. This file contains the latest estimate of clock frequency error. When the <tt>ntpd</tt> is started and the file does not exist, the <tt>ntpd</tt> enters a special mode designed to quickly adapt to the particular system clock oscillator time and frequency error. This takes approximately 15 minutes, after which the time and frequency are set to nominal values and the <tt>ntpd</tt> enters normal mode, where the time and frequency are continuously tracked relative to the server. After one hour the frequency file is created and the current frequency offset written to it. When the <tt>ntpd</tt> is started and the file does exist, the <tt>ntpd</tt> frequency is initialized from the file and enters normal mode immediately. After that the current frequency offset is written to the file at hourly intervals.</p> + <h4 id="modes">Operating Modes</h4> + <p><tt>ntpd</tt> can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the <a href="assoc.html">Association Management</a> page. It normally operates continuously while monitoring for small changes in frequency and trimming the clock for the ultimate precision. However, it can operate in a one-time mode where the time is set from an external server and frequency is set from a previously recorded frequency file. A broadcast/multicast or manycast client can discover remote servers, compute server-client propagation delay correction factors and configure itself automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment.</p> + <p>By default, <tt>ntpd</tt> runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate state machine. The state machine measures the incidental roundtrip delay jitter and oscillator frequency wander and determines the best poll interval using a heuristic algorithm. Ordinarily, and in most operating environments, the state machine will start with 64s intervals and eventually increase in steps to 1024s. A small amount of random variation is introduced in order to avoid bunching at the servers. In addition, should a server become unreachable for some time, the poll interval is increased in steps to 1024s in order to reduce network overhead.</p> + <p>In some cases it may not be practical for <tt>ntpd</tt> to run continuously. A common workaround has been to run the <tt>ntpdate</tt> program from a <tt>cron</tt> job at designated times. However, this program does not have the crafted signal processing, error checking and mitigation algorithms of <tt>ntpd</tt>. The <tt>-q</tt> option is intended for this purpose. Setting this option will cause <tt>ntpd</tt> to exit just after setting the clock for the first time. The procedure for initially setting the clock is the same as in continuous mode; most applications will probably want to specify the <tt>iburst</tt> keyword with the <tt>server</tt> configuration command. With this keyword a volley of messages are exchanged to groom the data and the clock is set in about 10 s. If nothing is heard after a couple of minutes, the daemon times out and exits. After a suitable period of mourning, the <tt>ntpdate</tt> program may be retired.</p> + <p>When kernel support is available to discipline the clock frequency, which is the case for stock Solaris, Tru64, Linux and FreeBSD, a useful feature is available to discipline the clock frequency. First, <tt>ntpd</tt> is run in continuous mode with selected servers in order to measure and record the intrinsic clock frequency offset in the frequency file. It may take some hours for the frequency and offset to settle down. Then the <tt>ntpd</tt> is stopped and run in one-time mode as required. At each startup, the frequency is read from the file and initializes the kernel frequency.</p> + <h4 id="poll">Poll Interval Control</h4> + <p>This version of NTP includes an intricate state machine to reduce the network load while maintaining a quality of synchronization consistent with the observed jitter and wander. There are a number of ways to tailor the operation in order enhance accuracy by reducing the interval or to reduce network overhead by increasing it. However, the user is advised to carefully consider the consequences of changing the poll adjustment range from the default minimum of 64 s to the default maximum of 1,024 s. The default minimum can be changed with the <tt>tinker minpoll</tt> command to a value not less than 16 s. This value is used for all configured associations, unless overridden by the <tt>minpoll</tt> option on the configuration command. Note that most device drivers will not operate properly if the poll interval is less than 64 s and that the broadcast server and manycast client associations will also use the default, unless overridden.</p> + <p>In some cases involving dial up or toll services, it may be useful to increase the minimum interval to a few tens of minutes and maximum interval to a day or so. Under normal operation conditions, once the clock discipline loop has stabilized the interval will be increased in steps from the minimum to the maximum. However, this assumes the intrinsic clock frequency error is small enough for the discipline loop correct it. The capture range of the loop is 500 PPM at an interval of 64s decreasing by a factor of two for each doubling of interval. At a minimum of 1,024 s, for example, the capture range is only 31 PPM. If the intrinsic error is greater than this, the drift file <tt>ntp.drift</tt> will have to be specially tailored to reduce the residual error below this limit. Once this is done, the drift file is automatically updated once per hour and is available to initialize the frequency on subsequent daemon restarts.</p> + <h4 id="huff">The huff-n'-puff Filter</h4> + <p>In scenarios where a considerable amount of data are to be downloaded or uploaded over telephone modems, timekeeping quality can be seriously degraded. This occurs because the differential delays on the two directions of transmission can be quite large. In many cases the apparent time errors are so large as to exceed the step threshold and a step correction can occur during and after the data transfer is in progress.</p> + <p>The huff-n'-puff filter is designed to correct the apparent time offset in these cases. It depends on knowledge of the propagation delay when no other traffic is present. In common scenarios this occurs during other than work hours. The filter maintains a shift register that remembers the minimum delay over the most recent interval measured usually in hours. Under conditions of severe delay, the filter corrects the apparent offset using the sign of the offset and the difference between the apparent delay and minimum delay. The name of the filter reflects the negative (huff) and positive (puff) correction, which depends on the sign of the offset.</p> + <p>The filter is activated by the <tt>tinker</tt> command and <tt>huffpuff</tt> keyword, as described in the <a href="miscopt.html">Miscellaneous Options</a> page.</p> + <h4 id="notes">Notes</h4> + <p>If NetInfo support is built into <tt>ntpd</tt>, then <tt>ntpd</tt> will attempt to read its configuration from the NetInfo if the default ntp.conf file cannot be read and no file is specified by the <tt>-c</tt> option.</p> + <p>In contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p> + <p>Various internal <tt>ntpd</tt> variables can be displayed and configuration options altered while the <tt>ntpd</tt> is running using the <tt><a href="ntpq.html">ntpq</a></tt> and <tt><a href="ntpdc.html">ntpdc</a></tt> utility programs.</p> + <p>When <tt>ntpd</tt> starts it looks at the value of <tt>umask</tt>, and if zero <tt>ntpd</tt> will set the <tt>umask</tt> to <tt>022</tt>.</p> + <h4 id="cmd">Command Line Options</h4> + <dl> + <dt><tt>-a</tt> + <dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the default. + <dt><tt>-A</tt> + <dd>Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is almost never a good idea. + <dt><tt>-b</tt> + <dd>Enable the client to synchronize to broadcast servers. + <dt><tt>-c <i>conffile</i></tt> + <dd>Specify the name and path of the configuration file, default <tt>/etc/ntp.conf</tt>. + <dt><tt>-d</tt> + <dd>Specify debugging mode. This option may occur more than once, with each occurrence indicating greater detail of display. + <dt><tt>-D <i>level</i></tt> + <dd>Specify debugging level directly. + <dt><tt>-f <i>driftfile</i></tt> + <dd>Specify the name and path of the frequency file, default <tt>/etc/ntp.drift</tt>. This is the same operation as the <tt>driftfile <i>driftfile</i></tt> configuration command. + <dt><tt>-g</tt> + <dd>Normally, <tt>ntpd</tt> exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, <tt>ntpd</tt> will exit with a message to the system log. This option can be used with the <tt>-q</tt> and <tt>-x</tt> options. See the <tt>tinker</tt> command for other options. + <dt><tt>-i <i>jaildir</i></tt> + <dd>Chroot the server to the directory <i>jaildir</i>. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a <tt>-u</tt> option. + <dt><tt>-k <i>keyfile</i></tt> + <dd>Specify the name and path of the symmetric key file, default <tt>/etc/ntp.keys</tt>. This is the same operation as the <tt>keys <i>keyfile</i></tt> configuration command. + <dt><tt>-l <i>logfile</i></tt> + <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> configuration command. + <dt><tt>-L</tt> + <dd>Do not listen to virtual IPs. The default is to listen. + <dt><tt>-n</tt> + <dd>Don't fork. + <dt><tt>-N</tt> + <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the highest priority. + <dt><tt>-p <i>pidfile</i></tt> + <dd>Specify the name and path of the file used to record the <tt>ntpd</tt> process ID. This is the same operation as the <tt>pidfile <i>pidfile</i></tt> configuration command. + <dt><tt>-P <i>priority</i></tt> + <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the specified priority. + <dt><tt>-q</tt> + <dd>Exit the <tt>ntpd</tt> just after the first time the clock is set. This behavior mimics that of the <tt>ntpdate</tt> program, which is to be retired. The <tt>-g</tt> and <tt>-x</tt> options can be used with this option. Note: The kernel time discipline is disabled with this option. + <dt><tt>-r <i>broadcastdelay</i></tt> + <dd>Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol. + <dt><tt>-s <i>statsdir</i></tt> + <dd>Specify the directory path for files created by the statistics facility. This is the same operation as the <tt>statsdir <i>statsdir</i></tt> configuration command. + <dt><tt>-t <i>key</i></tt> + <dd>Add a key number to the trusted key list. This option can occur more than once. + <dt><tt>-u <i>user[:group]</i> </tt> + <dd>Specify a user, and optionally a group, to switch to. This option is only available if the OS supports to run the server without full root privileges. Currently, this option is supported under NetBSD (configure with --enable-clockctl) and Linux (configure with --enable-linuxcaps). + <dt><tt>-U <i>interface update interval</i></tt> + <dd>Number of seconds to wait between interface list scans to pick up new and delete network interface. Set to 0 to disable dynamic interface list updating. The default is to scan every 5 minutes.</dd> + <dt><tt>-v <i>variable</i></tt> + <dt><tt>-V <i>variable</i></tt> + <dd>Add a system variable listed by default. + <dt><tt>-x</tt> + <dd>Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the <tt>-g</tt> and <tt>-q</tt> options. See the <tt>tinker</tt> command for other options. Note: The kernel time discipline is disabled with this option. + </dl> + <h4 id="cfg">The Configuration File</h4> + <p>Ordinarily, <tt>ntpd</tt> reads the <tt>ntp.conf</tt> configuration file at startup time in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast/multicast client, with all peers being determined by listening to broadcasts at run time.</p> + <p>Usually, the configuration file is installed in the <tt>/etc</tt> directory, but could be installed elsewhere (see the <tt>-c <i>conffile</i></tt> command line option). The file format is similar to other Unix configuration files - comments begin with a <tt>#</tt> character and extend to the end of the line; blank lines are ignored.</p> + <p>Configuration commands consist of an initial keyword followed by a list of arguments, some of which may be optional, separated by whitespace. Commands may not be continued over multiple lines. Arguments may be host names, host addresses written in numeric, dotted-quad form, integers, floating point numbers (when specifying times in seconds) and text strings. Optional arguments are delimited by <tt>[ ]</tt> in the following descriptions, while alternatives are separated by <tt>|</tt>. The notation <tt>[ ... ]</tt> means an optional, indefinite repetition of the last item before the <tt>[ ... ]</tt>.</p> + <h4 id="opt">Configuration Options</h4> + <p><a href="confopt.html">Server Options</a><br> + <a href="authopt.html">Authentication Options</a><br> + <a href="monopt.html">Monitoring Options</a><br> + <a href="accopt.html">Access Control Options</a><br> + <a href="manyopt.html">Automatic NTP Configuration Options</a><br> + <a href="clockopt.html">Reference Clock Options</a><br> + <a href="miscopt.html">Miscellaneous Options</a></p> + <h4 id="files">Files</h4> + <table width="100%" border="1"> + <tr> + <td width="30%">File</td> + <td width="30%">Default</td> + <td width="20%">Option</td> + <td width="20%">Command</td> + </tr> + <tr> + <td width="30%">configuration file</td> + <td width="30%"><tt>/etc/ntp.conf</tt></td> + <td width="20%"><tt>-c</tt></td> + <td width="20%">none</td> + </tr> + <tr> + <td width="30%">frequency file</td> + <td width="30%"><tt>/etc/ntp.drift</tt></td> + <td width="20%"><tt>-f</tt></td> + <td width="20%"><tt>driftfile</tt></td> + </tr> + <tr> + <td width="30%">process ID file</td> + <td width="30%">none</td> + <td width="20%"><tt>-p</tt></td> + <td width="20%"><tt>pidfile</tt></td> + </tr> + <tr> + <td width="30%">log file</td> + <td width="30%">system log</td> + <td width="20%"><tt>-l</tt></td> + <td width="20%"><tt>logfile</tt></td> + </tr> + <tr> + <td width="30%">include file</td> + <td width="30%">none</td> + <td width="20%">none</td> + <td width="20%"><tt>includefile</tt></td> + </tr> + <tr> + <td width="30%">statistics path</td> + <td width="30%"><tt>/var/NTP</tt></td> + <td width="20%"><tt>-s</tt></td> + <td width="20%"><tt>statsdir</tt></td> + </tr> + <tr> + <td width="30%">keys path</td> + <td width="30%"><tt>/usr/local/etc</tt></td> + <td width="20%"><tt>-k</tt></td> + <td width="20%"><tt>keysdir</tt></td> + </tr> + </table> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntpdate.html b/contrib/ntp/html/ntpdate.html new file mode 100644 index 0000000..30d8cad --- /dev/null +++ b/contrib/ntp/html/ntpdate.html @@ -0,0 +1,72 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpdate - set the date and time via NTP</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpdate</tt> - set the date and time via NTP</h3> + <img src="pic/rabbit.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>I told you it was eyeball and wristwatch.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:44</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <hr> + <p>Disclaimer: The functionality of this program is now available in the <tt>ntpd</tt> program. See the <tt>-q</tt> command line option in the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page. After a suitable period of mourning, the <tt>ntpdate</tt> program is to be retired from this distribution</p> + <h4>Synopsis</h4> + <tt>ntpdate [ -bBdoqsuv ] [ -a <i>key</i> ] [ -e <i>authdelay</i> ] [ -k <i>keyfile</i> ] [ -o <i>version</i> ] [ -p <i>samples</i> ] [ -t <i>timeout</i> ] <i>server</i> [ ... ]</tt> + <h4>Description</h4> + <tt>ntpdate</tt> sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the <i>server</i> arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of <tt>ntpdate</tt> depends on the number of servers, the number of polls each time it is run and the interval between runs. + <p><tt>ntpdate</tt> can be run manually as necessary to set the host clock, or it can be run from the host startup script to set the clock at boot time. This is useful in some cases to set the clock initially before starting the NTP daemon <tt>ntpd</tt>. It is also possible to run <tt>ntpdate</tt> from a <tt>cron</tt> script. However, it is important to note that <tt>ntpdate</tt> with contrived <tt>cron</tt> scripts is no substitute for the NTP daemon, which uses sophisticated algorithms to maximize accuracy and reliability while minimizing resource use. Finally, since <tt>ntpdate</tt> does not discipline the host clock frequency as does <tt>ntpd</tt>, the accuracy using <tt>ntpdate</tt> is limited.</p> + <p>Time adjustments are made by <tt>ntpdate</tt> in one of two ways. If <tt>ntpdate</tt> determines the clock is in error more than 0.5 second it will simply step the time by calling the system <tt>settimeofday()</tt> routine. If the error is less than 0.5 seconds, it will slew the time by calling the system <tt>adjtime()</tt> routine. The latter technique is less disruptive and more accurate when the error is small, and works quite well when <tt>ntpdate</tt> is run by <tt>cron</tt> every hour or two.</p> + <p><tt>ntpdate</tt> will decline to set the date if an NTP server daemon (e.g., <tt>ntpd</tt>) is running on the same host. When running <tt>ntpdate</tt> on a regular basis from <tt>cron</tt> as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock.</p> + <p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p> + <p>If NetInfo support is compiled into <tt>ntpdate</tt>, then the <tt>server</tt> argument is optional if <tt>ntpdate</tt> can find a time server in the NetInfo configuration for <tt>ntpd</tt>.</p> + <h4>Command Line Options</h4> + <dl> + <dt><tt>-4</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace. + <dt><tt>-6</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace. + <dt><tt>-a <i>key</i></tt> + <dd>Enable the authentication function and specify the key identifier to be used for authentication as the argument <i>key</i><tt>ntpdate</tt>. The keys and key identifiers must match in both the client and server key files. The default is to disable the authentication function. + <dt><tt>-B</tt> + <dd>Force the time to always be slewed using the adjtime() system call, even if the measured offset is greater than +-128 ms. The default is to step the time using settimeofday() if the offset is greater than +-128 ms. Note that, if the offset is much greater than +-128 ms in this case, that it can take a long time (hours) to slew the clock to the correct value. During this time. the host should not be used to synchronize clients. + <dt><tt>-b</tt> + <dd>Force the time to be stepped using the settimeofday() system call, rather than slewed (default) using the adjtime() system call. This option should be used when called from a startup file at boot time. + <dt><tt>-d</tt> + <dd>Enable the debugging mode, in which <tt>ntpdate</tt> will go through all the steps, but not adjust the local clock. Information useful for general debugging will also be printed. + <dt><tt>-e <i>authdelay</i></tt> + <dd>Specify the processing delay to perform an authentication function as the value <i>authdelay</i>, in seconds and fraction (see <tt>ntpd</tt> for details). This number is usually small enough to be negligible for most purposes, though specifying a value may improve timekeeping on very slow CPU's. + <dt><tt>-k <i>keyfile</i></tt> + <dd>Specify the path for the authentication key file as the string <i>keyfile</i>. The default is <tt>/etc/ntp.keys</tt>. This file should be in the format described in <tt>ntpd</tt>. + <dt><tt>-o <i>version</i></tt> + <dd>Specify the NTP version for outgoing packets as the integer <i>version</i>, which can be 1 or 2. The default is 3. This allows <tt>ntpdate</tt> to be used with older NTP versions. + <dt><tt>-p <i>samples</i></tt> + <dd>Specify the number of samples to be acquired from each server as the integer <i>samples</i>, with values from 1 to 8 inclusive. The default is 4. + <dt><i><tt>-q</tt></i> + <dd>Query only - don't set the clock. + <dt><tt>-s</tt> + <dd>Divert logging output from the standard output (default) to the system <tt>syslog</tt> facility. This is designed primarily for convenience of <tt>cron</tt> scripts. + <dt><tt>-t <i>timeout</i></tt> + <dd>Specify the maximum time waiting for a server response as the value <i>timeout</i>, in seconds and fraction. The value is is rounded to a multiple of 0.2 seconds. The default is 1 second, a value suitable for polling across a LAN. + <dt><tt>-u</tt> + <dd>Direct <tt>ntpdate</tt> to use an unprivileged port or outgoing packets. This is most useful when behind a firewall that blocks incoming traffic to privileged ports, and you want to synchronise with hosts beyond the firewall. Note that the <tt>-d</tt> option always uses unprivileged ports. + <dt><tt>-<i>v</i></tt> + <dd>Be verbose. This option will cause <tt>ntpdate</tt>'s version identification string to be logged. + </dl> + <h4>Diagnostics</h4> + <tt>ntpdate</tt>'s exit status is zero if it finds a server and updates the clock, and nonzero otherwise. + <h4>Files</h4> + <tt>/etc/ntp.keys</tt> - encryption keys used by <tt>ntpdate</tt>. + <h4>Bugs</h4> + The slew adjustment is actually 50% larger than the measured offset, since this (it is argued) will tend to keep a badly drifting clock more accurate. This is probably not a good idea and may cause a troubling hunt for some values of the kernel variables <tt>tick</tt> and <tt>tickadj</tt>. + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntpdc.html b/contrib/ntp/html/ntpdc.html new file mode 100644 index 0000000..92fde1d --- /dev/null +++ b/contrib/ntp/html/ntpdc.html @@ -0,0 +1,215 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpdc - special NTP query program</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpdc</tt> - special NTP query program</h3> + <img src="pic/alice31.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>This program is a big puppy.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="99">04:11 AM</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="294">Monday, November 27, 2006</csobj></p> + <br clear="left"> + <h4>More Help</h4> + <script type="text/javascript" language="javascript" src="scripts/links12.txt"></script> + <hr> + <h4>Synopsis</h4> + <tt>ntpdc [ -ilnps ] [ -c <i>command</i> ] [ <i>host</i> ] [ ... ]</tt> + <h4>Description</h4> + <tt>ntpdc</tt> is used to query the <tt>ntpd</tt> daemon about its current state and to request changes in that state. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the <tt>ntpdc</tt> interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configuration file may also be specified at run time using <tt>ntpdc</tt>. + <p>If one or more request options are included on the command line when <tt>ntpdc</tt> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <tt>ntpdc</tt> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <tt>ntpdc</tt> will prompt for commands if the standard input is a terminal device.</p> + <p><tt>ntpdc</tt> uses NTP mode 7 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <tt>ntpdc</tt> makes no attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.</p> + <p>The operation of <tt>ntpdc</tt> are specific to the particular implementation of the <tt>ntpd</tt> daemon and can be expected to work only with this and maybe some previous versions of the daemon. Requests from a remote <tt>ntpdc</tt> program which affect the state of the local server must be authenticated, which requires both the remote program and local server share a common key and key identifier.</p> + <p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p> + <h4>Command Line Options</h4> + <p>Specifying a command line option other than <tt>-i</tt> or <tt>-n</tt> will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, <tt>ntpdc</tt> will attempt to read interactive format commands from the standard input.</p> + <dl> + <dt><tt>-4</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace. + <dt><tt>-6</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace. + <dt><tt>-c <i>command</i></tt> + <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple -c options may be given. + <dt><tt>-i</tt> + <dd>Force <tt>ntpdc</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. + <dt><tt>-l</tt> + <dd>Obtain a list of peers which are known to the server(s). This switch is equivalent to <tt>-c listpeers</tt>. + <dt><tt>-n</tt> + <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. + <dt><tt>-p</tt> + <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to <tt>-c peers</tt>. + <dt><tt>-s</tt> + <dd>Print a list of the peers known to the server as well as a summary of their state, but in a slightly different format than the -p switch. This is equivalent to <tt>-c dmpeers</tt>. + </dl> + <h4>Interactive Commands</h4> + <p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <tt><</tt>, followed by a file name, to the command line.</p> + <p>A number of interactive format commands are executed entirely within the <tt>ntpdc</tt> program itself and do not result in NTP mode 7 requests being sent to a server. These are described following.</p> + <dl> + <dt><tt>? [ <i>command_keyword</i> ]</tt><br> + <tt>help [ <i>command_keyword</i> ]</tt> + <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to this incarnation of <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about <tt>ntpq</tt> than this manual page. + <dt><tt>delay <i>milliseconds</i></tt> + <dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete. + <dt><tt>host <i>hostname</i></tt> + <dd>Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address. + <dt><tt>hostnames [ yes | no ]</tt> + <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch. + <dt><tt>keyid <i>keyid</i></tt> + <dd>This command allows the specification of a + key number to be used to authenticate configuration + requests from ntpdc to the host(s). This must + correspond to a key number which the host/server has + been configured to use for this purpose (server + options: <tt>trustedkey</tt>, and + <tt>requestkey</tt>). If authentication is not + enabled on the host(s) for ntpdc + commands, the command + <tt>"keyid 0"</tt> should be given; otherwise the + <i>keyid</i> of the next subsequent <tt>addpeer/addserver/broadcast + </tt> command will + be used. + <dt><tt>quit</tt> + <dd>Exit <tt>ntpdc</tt>. + <dt><tt>passwd</tt> + <dd>This command prompts you to type in a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for use by the NTP server for this purpose if such requests are to be successful. + <dt><tt>timeout <i>milliseconds</i></tt> + <dd>Specify a timeout period for responses to server queries. The default is about 8000 milliseconds. Note that since <tt>ntpdc</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. + </dl> + <h4>Control Message Commands</h4> + <p>Query commands result in NTP mode 7 packets containing requests for information being sent to the server. These are read-only commands in that they make no modification of the server configuration state.</p> + <dl> + <dt><tt>listpeers</tt> + <dd>Obtains and prints a brief list of the peers for which the server is maintaining state. These should include all configured peer associations as well as those peers whose stratum is such that they are considered by the server to be possible future synchronization candidates. + <dt><tt>peers</tt> + <dd>Obtains a list of peers for which the server is maintaining state, along with a summary of that state. Summary information includes the address of the remote peer, the local interface address (0.0.0.0 if a local address has yet to be determined), the stratum of the remote peer (a stratum of 16 indicates the remote peer is unsynchronized), the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in seconds. + <p>The character in the left margin indicates the mode this peer entry is operating in. A <tt>+</tt> denotes symmetric active, a <tt>-</tt> indicates symmetric passive, a <tt>=</tt> means the remote server is being polled in client mode, a <tt>^</tt> indicates that the server is broadcasting to this address, a <tt>~</tt> denotes that the remote peer is sending broadcasts and a <tt>*</tt> marks the peer the server is currently synchronizing to.</p> + <p>The contents of the host field may be one of four forms. It may be a host name, an IP address, a reference clock implementation name with its parameter or <tt>REFCLK(<i>implementation number</i>, <i>parameter</i>)</tt>. On <tt>hostnames no</tt> only IP-addresses will be displayed.</p> + <dt><tt>dmpeers</tt> + <dd>A slightly different peer summary list. Identical to the output of the <tt>peers</tt> command, except for the character in the leftmost column. Characters only appear beside peers which were included in the final stage of the clock selection algorithm. A <tt>.</tt> indicates that this peer was cast off in the falseticker detection, while a <tt>+</tt> indicates that the peer made it through. A <tt>*</tt> denotes the peer the server is currently synchronizing with. + <dt><tt>showpeer <i>peer_address</i> [...]</tt> + <dd>Shows a detailed display of the current peer variables for one or more peers. Most of these values are described in the NTP Version 2 specification. + <dt><tt>pstats <i>peer_address</i> [...]</tt> + <dd>Show per-peer statistic counters associated with the specified peer(s). + <dt><tt>clockinfo <i>clock_peer_address</i> [...]</tt> + <dd>Obtain and print information concerning a peer clock. The values obtained provide information on the setting of fudge factors and other clock performance information. + <dt><tt>kerninfo</tt> + <dd>Obtain and print kernel phase-lock loop operating parameters. This information is available only if the kernel has been specially modified for a precision timekeeping function. + <dt><tt>loopinfo [ oneline | multiline ]</tt> + <dd>Print the values of selected loop filter variables. The loop filter is the part of NTP which deals with adjusting the local system clock. The <tt>offset</tt> is the last offset given to the loop filter by the packet processing code. The <tt>frequency</tt> is the frequency error of the local clock in parts-per-million (ppm). The <tt>time_const</tt> controls the stiffness of the phase-lock loop and thus the speed at which it can adapt to oscillator drift. The <tt>watchdog timer</tt> value is the number of seconds which have elapsed since the last sample offset was given to the loop filter. The <tt>oneline</tt> and <tt>multiline</tt> options specify the format in which this information is to be printed, with <tt>multiline</tt> as the default. + <dt><tt>sysinfo</tt> + <dd>Print a variety of system state variables, i.e., state related to the local server. All except the last four lines are described in the NTP Version 3 specification, RFC-1305. + <p>The <tt>system flags</tt> show various system flags, some of which can be set and cleared by the <tt>enable</tt> and <tt>disable</tt> configuration commands, respectively. These are the <tt>auth</tt>, <tt>bclient</tt>, <tt>monitor</tt>, <tt>pll</tt>, <tt>pps</tt> and <tt>stats</tt> flags. See the <tt>ntpd</tt> documentation for the meaning of these flags. There are two additional flags which are read only, the <tt>kernel_pll</tt> and <tt>kernel_pps</tt>. These flags indicate the synchronization status when the precision time kernel modifications are in use. The <tt>kernel_pll</tt> indicates that the local clock is being disciplined by the kernel, while the kernel_pps indicates the kernel discipline is provided by the PPS signal.</p> + <p>The <tt>stability</tt> is the residual frequency error remaining after the system frequency correction is applied and is intended for maintenance and debugging. In most architectures, this value will initially decrease from as high as 500 ppm to a nominal value in the range .01 to 0.1 ppm. If it remains high for some time after starting the daemon, something may be wrong with the local clock, or the value of the kernel variable <tt>tick</tt> may be incorrect.</p> + <p>The <tt>broadcastdelay</tt> shows the default broadcast delay, as set by the <tt>broadcastdelay</tt> configuration command.</p> + <p>The <tt>authdelay</tt> shows the default authentication delay, as set by the <tt>authdelay</tt> configuration command.</p> + <dt><tt>sysstats</tt> + <dd>Print statistics counters maintained in the protocol module. + <dt><tt>memstats</tt> + <dd>Print statistics counters related to memory allocation code. + <dt><tt>iostats</tt> + <dd>Print statistics counters maintained in the input-output module. + <dt><tt>timerstats</tt> + <dd>Print statistics counters maintained in the timer/event queue support code. + <dt><tt>reslist</tt> + <dd>Obtain and print the server's restriction list. This list is (usually) printed in sorted order and may help to understand how the restrictions are applied. + <dt><tt>ifstats</tt> + <dd>List interface statistics for interfaces used by ntpd for network communication.</dd> + <dt><tt>ifreload</tt> + <dd>Force rescan of current system interfaces. Outputs interface statistics for interfaces that could possibly change. Marks unchanged interfaces with <b>.</b>, added interfaces with <b>+</b> and deleted interfaces with <b>-</b>.</dd> + <dt><tt>monlist [ <i>version</i> ]</tt> + <dd>Obtain and print traffic counts collected and maintained by the monitor facility. The version number should not normally need to be specified. + <dt><tt>clkbug <i>clock_peer_address</i> [...]</tt> + <dd>Obtain debugging information for a reference clock driver. This information is provided only by some clock drivers and is mostly undecodable without a copy of the driver source in hand. + </dl> + <h4>Runtime Configuration Requests</h4> + <p>All requests which cause state changes in the server are authenticated by the server using a configured NTP key (the facility can also be disabled by the server by not configuring a key). The key number and the corresponding key must also be made known to <tt>ntpdc</tt>. This can be done using the keyid and passwd commands, the latter of which will prompt at the terminal for a password to use as the encryption key. You will also be prompted automatically for both the key number and password the first time a command which would result in an authenticated request to the server is given. Authentication not only provides verification that the requester has permission to make such changes, but also gives an extra degree of protection again transmission errors.</p> + <p>Authenticated requests always include a timestamp in the packet data, which is included in the computation of the authentication code. This timestamp is compared by the server to its receive time stamp. If they differ by more than a small amount the request is rejected. This is done for two reasons. First, it makes simple replay attacks on the server, by someone who might be able to overhear traffic on your LAN, much more difficult. Second, it makes it more difficult to request configuration changes to your server from topologically remote hosts. While the reconfiguration facility will work well with a server on the local host, and may work adequately between time-synchronized hosts on the same LAN, it will work very poorly for more distant hosts. As such, if reasonable passwords are chosen, care is taken in the distribution and protection of keys and appropriate source address restrictions are applied, the run time reconfiguration facility should provide an adequate level of security.</p> + <p>The following commands all make authenticated requests.</p> + <dl> + <dt><tt>addpeer <i>peer_address</i> [ + <i>keyid</i> ] [ <i>version</i> ] [ + <tt>minpoll# | prefer | iburst | burst | minpoll + <i>N</i> | <tt>maxpoll</tt> <i>N</i> [...] ]</tt> + <dt><tt>addpeer <i>peer_address</i> [ + <tt>prefer | iburst | burst | minpoll + <i>N</i> | <tt>maxpoll</tt> <i>N</i> | <tt>keyid</tt> + <i>N</i> | <tt>version</tt> <i>N</i> [...] ]</tt> + <dd>Add a configured peer association at the + given address and operating in symmetric + active mode. Note that an existing association + with the same peer may be deleted when this + command is executed, or may simply be + converted to conform to the new configuration, + as appropriate. If the <tt>keyid</tt> + is nonzero, all outgoing packets to + the remote server will have an authentication + field attached encrypted with this key. If the + value is 0 (or not given) no authentication + will be done. If ntpdc's key number has not + yet been set (<i>e.g.,</i> by the keyid + command), it will be set to this value. + The <tt>version#</tt> can be 1 through 4 and defaults to 3. The remaining + options are either a numeric value for <tt>minpoll</tt> or + literals <tt>prefer</tt>, <tt>iburst</tt>, + <tt>burst</tt>, <tt>minpoll </tt><i>N</i>, + <tt>keyid </tt><i>N</i>, <tt>version </tt> <i>N</i>, or + <tt>maxpoll </tt><i>N</i> (where <i>N</i> is a numeric value), and have the action as specified in the + <tt>peer</tt> configuration file command of + ntpd. See the <a href="confopt.html">Server Options</a> page for further information. + Each flag (or its absence) replaces the + previous setting. The <tt>prefer</tt> keyword indicates a preferred peer (and thus will be used primarily for clock synchronisation if possible). The preferred peer also determines the validity of the PPS signal - if the preferred peer is suitable for synchronisation so is the PPS signal. + <dt><tt>addserver <i>peer_address</i> [ + <i>keyid</i> ] [ <i>version</i> ] [ + <tt>minpoll# | prefer | iburst | burst | minpoll + <i>N</i> | <tt>maxpoll</tt> <i>N</i> [...] ]</tt> + <dt><tt>addserver <i>peer_address</i> [ + <tt>prefer | iburst | burst | minpoll + <i>N</i> | <tt>maxpoll</tt> <i>N</i> | <tt>keyid</tt> + <i>N</i> | <tt>version</tt> <i>N</i> [...] ]</tt> + <dd>Identical to the addpeer command, except that the operating mode is client. + <dt><tt>broadcast <i>peer_address</i> [ + <i>keyid</i> ] [ <i>version</i> ] [ <i>prefer</i> ]</tt> + <dd>Identical to the addpeer command, except + that the operating mode is broadcast. In this + case a valid non-zero key identifier and key are required. The <tt>peer_address</tt> parameter can be the broadcast address of the local network or a multicast group address assigned to NTP. If a multicast address, a multicast-capable kernel is required. + <dt><tt>unconfig <i>peer_address</i> [...]</tt> + <dd>This command causes the configured bit to be removed from the specified peer(s). In many cases this will cause the peer association to be deleted. When appropriate, however, the association may persist in an unconfigured mode if the remote peer is willing to continue on in this fashion. + <dt><tt>fudge <i>peer_address</i> [ <i>time1</i> ] [ <i>time2</i> ] [ <i>stratum</i> ] [ <i>refid</i> ]</tt> + <dd>This command provides a way to set certain data for a reference clock. See the source listing for further information. + <dt><tt>enable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]</tt><br> + <tt>disable [ auth | bclient | calibrate | kernel | monitor | ntp | pps | stats]</tt> + <dd>These commands operate in the same way as the <tt>enable</tt> and <tt>disable</tt> configuration file commands of <tt>ntpd</tt>. See the <a href="miscopt.html">Miscellaneous Options</a> page for further information. + <dt><tt>restrict <i>address mask flag</i> [ <i>flag</i> ]</tt> + <dd>This command operates in the same way as the <tt>restrict</tt> configuration file commands of <tt>ntpd</tt>. + <dt><tt>unrestrict <i>address mask flag</i> [ <i>flag</i> ]</tt> + <dd>Unrestrict the matching entry from the restrict list. + <dt><tt>delrestrict <i>address mask [ ntpport ]</i></tt> + <dd>Delete the matching entry from the restrict list. + <dt><tt>readkeys</tt> + <dd>Causes the current set of authentication keys to be purged and a new set to be obtained by rereading the keys file (which must have been specified in the <tt>ntpd</tt> configuration file). This allows encryption keys to be changed without restarting the server. + <dt><tt>trustedkey <i>keyid</i> [...]</tt> + <dt><tt>untrustedkey <i>keyid</i> [...]</tt> + <dd>These commands operate in the same way as the <tt>trustedkey</tt> and <tt>untrustedkey</tt> configuration file commands of <tt>ntpd</tt>. + <dt><tt>authinfo</tt> + <dd>Returns information concerning the authentication module, including known keys and counts of encryptions and decryptions which have been done. + <dt><tt>traps</tt> + <dd>Display the traps set in the server. See the source listing for further information. + <dt><tt>addtrap [ <i>address</i> [ <i>port</i> ] [ <i>interface</i> ]</tt> + <dd>Set a trap for asynchronous messages. See the source listing for further information. + <dt><tt>clrtrap [ <i>address</i> [ <i>port</i> ] [ <i>interface</i>]</tt> + <dd>Clear a trap for asynchronous messages. See the source listing for further information. + <dt><tt>reset</tt> + <dd>Clear the statistics counters in various modules of the server. See the source listing for further information. + </dl> + <h4>Bugs</h4> + <p><tt>ntpdc</tt> is a crude hack. Much of the information it shows is deadly boring and could only be loved by its implementer. The program was designed so that new (and temporary) features were easy to hack in, at great expense to the program's ease of use. Despite this, the program is occasionally useful.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntpdsim.html b/contrib/ntp/html/ntpdsim.html new file mode 100644 index 0000000..31eccf8 --- /dev/null +++ b/contrib/ntp/html/ntpdsim.html @@ -0,0 +1,73 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpdsim - Network Time Protocol (NTP) simulator</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</h3> + <img src="pic/alice47.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The mushroom knows all the command line options.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">20:07</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="223">Friday, June 16, 2006</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#synop">Synopsis</a><br> + <li class="inline"><a href="#descr">Description</a><br> + <li class="inline"><a href="#cmd">Command Line Oprionts</a> + <li class="inline"><a href="#files">Files</a> + </ul> + <hr> + <h4 id="synop">Synopsis</h4> + <tt>ntpdsim [ -B <i>bdly</i> ] [ -C <i>snse</i> ] [ -O <i>clk_time</i> ] [ -S <i>sim_time</i> ] [ -T <i>ferr</i> ] [ -W <i>fsne</i> ] [ -Y </tt><i><tt>ndly</tt></i><tt> ] [ -X </tt><i><tt>pdly</tt></i><tt> ]</tt> + <h4 id="descr">Description</h4> + <p>The <tt>ntpdsim</tt> program is an adaptation of the <tt>ntpd</tt> operating system daemon. The program operates as a discrete time simulator using specified systematic and random driving sources. It includes all the mitigation and discipline algorithms of the actual daemon, but with the packet I/O and system clock algorithms driven by simulation. Most functions of the real <tt>ntpd</tt> remain intact, including the monitoring, statistics recording, trace and host name resolution features. Further information on the simulator is on the <a href="http://www.eecis.udel.edu/%7emills/ntpsim.html">NTP Discrete Event Simulator</a> page.</p> + <p>The simulator is most useful to study NTP behavior in response to time and/or frequency transients under specific conditions of network jitter and oscillator wander. For this purpose the daemon can be driven by pseudorandom jitter and wander sample sequences characteristic of real networks and oscillators. The jitter generator produces samples from a Poisson distribution, while the wander generator produces samples from a Guassian distribution.</p> + <p>The easiest way to use this program is to create a <tt>ntpstats</tt> directory, configuration file <tt>ntp.conf</tt> and frequency file <tt>ntp.drift</tt> and test shell <tt>test.sh</tt> in the base directory. The <tt>ntp.drift</tt> file and <tt>ntpstats</tt> directory can be empty to start. The <tt>test.sh</tt> script can contain something like</p> + <pre>rm ./ntpstats/* +ntpdsim -O 0.1 -C .001 -T 400 -W 1 -c ./ntp.conf, +</pre> + <p>which starts the simulator with a time offset 100 ms, network jitter 1 ms, frequency offset 400 PPM and oscillator wander 1 PPM/s. These parameters represent typical conditions with modern workstations on a Ethernet LAN. The ntp.conf file should contain something like</p> + <pre>disable kernel +server pogo +driftfile ./ntp.drift +statsdir ./ntpstats/ +filegen loopstats type day enable +filegen peerstats type day enable +</pre> + <h4 id="cmd">Command Line Options</h4> + <dl> + <dt>Note: The NTP development team is moving to the use of a syntax-directed configuration file design. When complete these options will be replaced by a <a href="ntpdsim_new.html">new one</a>. Most of the <tt>ntpd</tt> command line options apply also to <tt>ntpdsim</tt>. In addition, the following command line options apply to <tt>ntpdsim.</tt> + <dt><tt>-B <i>bdly</i></tt> + <dd>Specify beep delay (3600) s. + <dt><tt>-C <i>snse</i></tt> + <dd>Specify network jitter parameter (0) s. + <dt><tt>-O <i>clk_time</i></tt> + <dd>Specify initial time offset (0) s. + <dt><tt>-S <i>sim_time</i></tt> + <dd>Specify simulation duration (86400) s. + <dt><tt>-T <i>ferr</i></tt> + <dd>Specify initial frequency offset (0) PPM. + <dt><tt>-W <i>fnse</i></tt> + <dd>Specify oscillator wander parameter (0) PPM/s. + <dt><tt>-Y <i>ndly</i></tt> + <dd>Specify network propagation delay (.001) s. + <dt><tt>-Z <i>pdly</i></tt> + <dd>Specify server processing delay (.001) s. + </dl> + <h4 id="files">Files</h4> + <tt>/etc/ntp.conf</tt> - the default name of the configuration file<br> + <tt>/etc/ntp.drift</tt> - the default name of the drift file<br> + <tt>/etc/ntp.keys</tt> - the default name of the key file + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/ntpdsim_new.html b/contrib/ntp/html/ntpdsim_new.html new file mode 100644 index 0000000..47c226a --- /dev/null +++ b/contrib/ntp/html/ntpdsim_new.html @@ -0,0 +1,102 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpdsim - Network Time Protocol (NTP) simulator</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</h3> + <img src="pic/alice47.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The mushroom knows all the command line options.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">21:32</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="223">Friday, June 16, 2006</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li><a href="#description">Description</a><br> + <li><a href="#configuration">Configuration</a> + <li><a href="#sample">Sample Configuration File</a> + </ul> + <h4 id="description">Description</h4> + <p>The ntpdsim program is used to simulate and study the behavior of an NTP daemon that derives its time from a number of different simulated time sources (servers). Each simulated server can be configured to have a different time offset, frequency offset, propagation delay, processing delay, network jitter and oscillator wander.</p> + <p>The ntpdsim program runs all the same selection, mitigation, and discipline algorithms as the actual ntpd daemon at the client. (It actually uses the same code). However, the input/output routines and servers are simulated. That is, instead of sending the client messages over the network to the actual servers, the client messages are intercepted by the ntpdsim program, which then generates the replies to those messages. The reply messages are carefully "inserted" into the input queue of the client at the right time according to the specified server properties (like propagation delay).</p> + <p>Each simulated server runs according to a specified script that describes the server properties at a particular time. Each script consists of a series of consecutive acts. Each act runs for a particular duration and specifies the frequency offset, propagation delay, processing delay, network jitter and oscillator wander of the server for that duration. Once the duration of an act expires, the simulated server reconfigures itself according to the properties specified in the next act.</p> + <h4 id="configuration">Configuration</h4> + <p>The ntpdsim program is configured by providing a configuration file at startup. The crux of the simulator configuration is specified using a <tt>simulate</tt> command, the syntax of which is given below. Note that all time quantities are in seconds and all frequency quantities are in parts per million (PPM):</p> + <p><<i>simulate_command</i>> ::= <tt>simulate</tt> { <<i>init_statement_list</i>> <<i>server_list</i>> }<br> + <<i>init_statement_list</i>> ::= <init_statement_list> <init_statement> | <init_statement><br> + <<i>init_statement</i>> ::= <tt>beep_delay</tt> = <number> | <tt>simulation_duration</tt> = <number><br> + <<i>server_list</i>> ::= <<i>server_list</i>> <server> | <server><br> + <<i>server_list</i>> ::= <tt>server</tt> = <address> { <tt>server_offset</tt> = <number> <act_list> }<br> + <<i>act_list</i>> ::= <<i>act_list</i>> <<i>act</i>> | <<i>act</i>><br> + <<i>act</i>> ::= <tt>duration</tt> = <number> { <<i>act_stmt_list</i>> }<br> + <<i>act_stmt_list</i>> ::= <<i>act_stmt_list</i>> <<i>act_stmt</i>> | <<i>act_stmt</i>><br> + <<i>act_stmt</i>> ::= <tt>freq_offset</tt> = <number> | <tt>wander</tt> = <number> | <tt>jitter</tt> = <number> | <tt>prop_delay</tt> = <number> | <tt>proc_delay</tt> = <number></p> + <p>In addition to the simulate command, other standard NTP configuration commands can be specified. These commands have the same meaning as in the ntpd configuration. Note that newlines are <b>not</b> significant within the simulate command even though they are used to mark the end of a normal NTP configuration command.</p> + <h4 id="sample">Sample Configuration File</h4> + <p>A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.</p> + <pre> + # Client configuration + disable kernel + server pogo + driftfile ./ntp.drift + statsdir ./ntpstats/ + filegen loopstats type day enable + filegen peerstats type day enable + + # Simulation configuration + simulate { + simulation_duration = 86400 + beep_delay = 3600 + + # Server 1 + server = louie.udel.edu { + server_offset = 0 + duration = 50000 { + freq_offset = 400 + wander = 1.0 + jitter = 0.001 + prop_delay = 0.001 + proc_delay = 0.001 + } + duration = 6400 { + freq_offset = 200 + wander = 1.0 + jitter = 0.001 + prop_delay = 0.001 + proc_delay = 0.001 + } + } + + # Server 2 + server = baldwin.udel.edu { + server_offset = 0.02 + duration = 10000 { + freq_offset = 400 + wander = 1.0 + jitter = 0.001 + prop_delay = 0.5 + proc_delay = 0.001 + } + duration = 60000 { + freq_offset = 200 + wander = 1.0 + jitter = 0.05 + prop_delay = 0.005 + proc_delay = 0.001 + } + } + } + </pre> + <hr> + <address><a href="mailto:skamboj@udel.edu">Sachin Kamboj</a></address> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html> diff --git a/contrib/ntp/html/ntpq.html b/contrib/ntp/html/ntpq.html new file mode 100644 index 0000000..4c077e2 --- /dev/null +++ b/contrib/ntp/html/ntpq.html @@ -0,0 +1,264 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntpq - standard NTP query program</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntpq</tt> - standard NTP query program</h3> + <img src="pic/bustardfly.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>A typical NTP monitoring packet</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:45</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>More Help</h4> + <script type="text/javascript" language="javascript" src="scripts/links12.txt"></script> + <hr> + <h4>Synopsis</h4> + <tt>ntpq [-inp] [-c <i>command</i>] [<i>host</i>] [...]</tt> + <h4>Description</h4> + <p>The <tt>ntpq</tt> utility program is used to monitor NTP daemon <tt>ntpd</tt> operations and determine performance. It uses the standard NTP mode 6 control message formats defined in Appendix B of the NTPv3 specification RFC1305. The same formats are used in NTPv4, although some of the variables have changed and new ones added. The description on this page is for the NTPv4 variables.</p> + <p>The program can be run either in interactive mode or controlled using command line arguments. Requests to read and write arbitrary variables can be assembled, with raw and pretty-printed output options being available. The <tt>ntpq</tt> can also obtain and print a list of peers in a common format by sending multiple queries to the server.</p> + <p>If one or more request options is included on the command line when <tt>ntpq</tt> is executed, each of the requests will be sent to the NTP servers running on each of the hosts given as command line arguments, or on localhost by default. If no request options are given, <tt>ntpq</tt> will attempt to read commands from the standard input and execute these on the NTP server running on the first host given on the command line, again defaulting to localhost when no other host is specified. <tt>ntpq</tt>will prompt for commands if the standard input is a terminal device.</p> + <p><tt>ntpq</tt> uses NTP mode 6 packets to communicate with the NTP server, and hence can be used to query any compatible server on the network which permits it. Note that since NTP is a UDP protocol this communication will be somewhat unreliable, especially over large distances in terms of network topology. <tt>ntpq</tt> makes one attempt to retransmit requests, and will time requests out if the remote host is not heard from within a suitable timeout time.</p> + <p>Note that in contexts where a host name is expected, a <tt>-4</tt> qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a <tt>-6</tt> qualifier forces DNS resolution to the IPv6 namespace.</p> + <p>For examples and usage, see the <a href="debug.html">NTP Debugging Techniques</a> page.</p> + <p>Command line options are described following. Specifying a command line option other than <tt>-i</tt> or <tt>-n</tt> will cause the specified query (queries) to be sent to the indicated host(s) immediately. Otherwise, <tt>ntpq</tt> will attempt to read interactive format commands from the standard input.</p> + <dl> + <dt><tt>-4</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv4 namespace. + <dt><tt>-6</tt> + <dd>Force DNS resolution of following host names on the command line to the IPv6 namespace. + <dt><tt>-c</tt> + <dd>The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). Multiple <tt>-c</tt> options may be given. + <dt><tt>-d</tt> + <dd>Turn on debugging mode. + <dt><tt>-i</tt> + <dd>Force <tt>ntpq</tt> to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. + <dt><tt>-n</tt> + <dd>Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. + <dt><tt>-p</tt> + <dd>Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the <tt>peers</tt> interactive command. + </dl> + <h4>Internal Commands</h4> + <p>Interactive format commands consist of a keyword followed by zero to four arguments. Only enough characters of the full keyword to uniquely identify the command need be typed. The output of a command is normally sent to the standard output, but optionally the output of individual commands may be sent to a file by appending a <tt>></tt>, followed by a file name, to the command line. A number of interactive format commands are executed entirely within the <tt>ntpq</tt> program itself and do not result in NTP mode 6 requests being sent to a server. These are described following.</p> + <dl> + <dt><tt>? [<i>command_keyword</i>]</tt><br> + <tt>helpl [<i>command_keyword</i>]</tt> + <dd>A <tt>?</tt> by itself will print a list of all the command keywords known to this incarnation of <tt>ntpq</tt>. A <tt>?</tt> followed by a command keyword will print function and usage information about the command. This command is probably a better source of information about <tt>ntpq</tt> than this manual page. + <dt><tt>addvars <i>variable_name</i> [ = <i>value</i>] [...]</tt><br> + <tt>rmvars <i>variable_name</i> [...]</tt><br> + <tt>clearvars</tt> + <dd>The data carried by NTP mode 6 messages consists of a list of items of the form <tt><i>variable_name</i> = <i>value</i></tt>, where the <tt>= <i>value</i></tt> is ignored, and can be omitted, in requests to the server to read variables. <tt>ntpq</tt> maintains an internal list in which data to be included in control messages can be assembled, and sent using the <tt>readlist</tt> and <tt>writelist</tt> commands described below. The <tt>addvars</tt> command allows variables and their optional values to be added to the list. If more than one variable is to be added, the list should be comma-separated and not contain white space. The <tt>rmvars</tt> command can be used to remove individual variables from the list, while the <tt>clearlist</tt> command removes all variables from the list. + <dt><tt>cooked</tt> + <dd>Causes output from query commands to be "cooked", so that variables which are recognized by <tt>ntpq</tt> will have their values reformatted for human consumption. Variables which <tt>ntpq</tt> thinks should have a decodable value but didn't are marked with a trailing <tt>?</tt>. + <dt><tt>debug more | less | off</tt> + <dd>Turns internal query program debugging on and off. + <dt><tt>delay <i>milliseconds</i></tt> + <dd>Specify a time interval to be added to timestamps included in requests which require authentication. This is used to enable (unreliable) server reconfiguration over long delay network paths or between machines whose clocks are unsynchronized. Actually the server does not now require timestamps in authenticated requests, so this command may be obsolete. + <dt><tt>host <i>hostname</i></tt> + <dd>Set the host to which future queries will be sent. Hostname may be either a host name or a numeric address. + <dt><tt>hostnames [yes | no]</tt> + <dd>If <tt>yes</tt> is specified, host names are printed in information displays. If <tt>no</tt> is specified, numeric addresses are printed instead. The default is <tt>yes</tt>, unless modified using the command line <tt>-n</tt> switch. + <dt><tt>keyid <i>keyid</i></tt> + <dd>This command specifies the key number to be used to authenticate configuration requests. This must correspond to a key number the server has been configured to use for this purpose. + <dt><tt>ntpversion 1 | 2 | 3 | 4</tt> + <dd>Sets the NTP version number which <tt>ntpq</tt> claims in packets. Defaults to 2, Note that mode 6 control messages (and modes, for that matter) didn't exist in NTP version 1. + <dt><tt>passwd</tt> + <dd>This command prompts for a password (which will not be echoed) which will be used to authenticate configuration requests. The password must correspond to the key configured for NTP server for this purpose. + <dt><tt>quit</tt> + <dd>Exit <tt>ntpq</tt>. + <dt><tt>raw</tt> + <dd>Causes all output from query commands is printed as received from the remote server. The only formating/interpretation done on the data is to transform nonascii data into a printable (but barely understandable) form. + <dt><tt>timeout <i>millseconds</i></tt> + <dd>Specify a timeout period for responses to server queries. The default is about 5000 milliseconds. Note that since <tt>ntpq</tt> retries each query once after a timeout, the total waiting time for a timeout will be twice the timeout value set. + </dl> + <h4>Control Message Commands</h4> + <p>Each association known to an NTP server has a 16 bit integer association identifier. NTP control messages which carry peer variables must identify the peer the values correspond to by including its association ID. An association ID of 0 is special, and indicates the variables are system variables, whose names are drawn from a separate name space.</p> + <p>Control message commands result in one or more NTP mode 6 messages being sent to the server, and cause the data returned to be printed in some format. Most commands currently implemented send a single message and expect a single response. The current exceptions are the peers command, which will send a preprogrammed series of messages to obtain the data it needs, and the mreadlist and mreadvar commands, which will iterate over a range of associations.</p> + <dl> + <dt><tt>associations</tt> + <dd>Obtains and prints a list of association identifiers and peer statuses for in-spec peers of the server being queried. The list is printed in columns. The first of these is an index numbering the associations from 1 for internal use, the second the actual association identifier returned by the server and the third the status word for the peer. This is followed by a number of columns containing data decoded from the status word. See the peers command for a decode of the <tt>condition</tt> field. Note that the data returned by the <tt>associations</tt> command is cached internally in <tt>ntpq</tt>. The index is then of use when dealing with stupid servers which use association identifiers which are hard for humans to type, in that for any subsequent commands which require an association identifier as an argument, the form &index may be used as an alternative. + <dt><tt>clockvar [<i>assocID</i>] [<i>variable_name</i> [ = <i>value</i> [...]] [...]</tt> + <dt><tt>cv [<i>assocID</i>] [<i>variable_name</i> [ = <i>value</i> [...] ][...]</tt> + <dd>Requests that a list of the server's clock variables be sent. Servers which have a radio clock or other external synchronization will respond positively to this. If the association identifier is omitted or zero the request is for the variables of the <tt>system clock</tt> and will generally get a positive response from all servers with a clock. If the server treats clocks as pseudo-peers, and hence can possibly have more than one clock connected at once, referencing the appropriate peer association ID will show the variables of a particular clock. Omitting the variable list will cause the server to return a default variable display. + <dt><tt>lassociations</tt> + <dd>Obtains and prints a list of association identifiers and peer statuses for all associations for which the server is maintaining state. This command differs from the <tt>associations</tt> command only for servers which retain state for out-of-spec client associations (i.e., fuzzballs). Such associations are normally omitted from the display when the <tt>associations</tt> command is used, but are included in the output of <tt>lassociations</tt>. + <dt><tt>lpassociations</tt> + <dd>Print data for all associations, including out-of-spec client associations, from the internally cached list of associations. This command differs from <tt>passociations</tt> only when dealing with fuzzballs. + <dt><tt>lpeers</tt> + <dd>Like R peers, except a summary of all associations for which the server is maintaining state is printed. This can produce a much longer list of peers from fuzzball servers. + <dt><tt>mreadlist <i>assocID</i> <i>assocID</i></tt><br> + <tt>mrl <i>assocID</i> <i>assocID</i></tt> + <dd>Like the <tt>readlist</tt> command, except the query is done for each of a range of (nonzero) association IDs. This range is determined from the association list cached by the most recent <tt>associations</tt> command. + <dt><tt>mreadvar <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt><br> + <tt>mrv <i>assocID</i> <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i>[ ... ]</tt> + <dd>Like the <tt>readvar</tt> command, except the query is done for each of a range of (nonzero) association IDs. This range is determined from the association list cached by the most recent <tt>associations</tt> command. + <dt><tt>opeers</tt> + <dd>An old form of the <tt>peers</tt> command with the reference ID replaced by the local interface address. + <dt><tt>passociations</tt> + <dd>Displays association data concerning in-spec peers from the internally cached list of associations. This command performs identically to the <tt>associations</tt> except that it displays the internally stored data rather than making a new query. + <dt><tt>peers</tt> + <dd>Obtains a current list peers of the server, along with a summary of each peer's state. Summary information includes the address of the remote peer, the reference ID (0.0.0.0 if this is unknown), the stratum of the remote peer, the type of the peer (local, unicast, multicast or broadcast), when the last packet was received, the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in milliseconds. The character at the left margin of each line shows the synchronization status of the association and is a valuable diagnostic tool. The encoding and meaning of this character, called the tally code, is given later in this page. + <dt><tt>pstatus <i>assocID</i></tt> + <dd>Sends a read status request to the server for the given association. The names and values of the peer variables returned will be printed. Note that the status word from the header is displayed preceding the variables, both in hexadecimal and in pidgeon English. + <dt><tt>readlist [ <i>assocID</i> ]</tt><br> + <tt>rl [ <i>assocID</i> ]</tt> + <dd>Requests that the values of the variables in the internal variable list be returned by the server. If the association ID is omitted or is 0 the variables are assumed to be system variables. Otherwise they are treated as peer variables. If the internal variable list is empty a request is sent without data, which should induce the remote server to return a default display. + <dt><tt>readvar <i>assocID</i> <i>variable_name</i> [ = <i>value</i> ] [ ...]</tt><br> + <tt>rv <i>assocID</i> [ <i>variable_name</i> [ = <i>value</i> ] [...]</tt> + <dd>Requests that the values of the specified variables be returned by the server by sending a read variables request. If the association ID is omitted or is given as zero the variables are system variables, otherwise they are peer variables and the values returned will be those of the corresponding peer. Omitting the variable list will send a request with no data which should induce the server to return a default display. The encoding and meaning of the variables derived from NTPv3 is given in RFC-1305; the encoding and meaning of the additional NTPv4 variables are given later in this page. + <dt><tt>writevar <i>assocID</i> <i>variable_name</i> [ = <i>value</i> [ ...]</tt> + <dd>Like the readvar request, except the specified variables are written instead of read. + <dt><tt>writelist [ <i>assocID</i> ]</tt> + <dd>Like the readlist request, except the internal list variables are written instead of read. + </dl> + <h4>Tally Codes</h4> + <p>The character in the left margin in the <tt>peers</tt> billboard, called the tally code, shows the fate of each association in the clock selection process. Following is a list of these characters, the pigeon used in the <tt>rv</tt> command, and a short explanation of the condition revealed.</p> + <dl> + <dt><tt>space reject</tt> + <dd>The peer is discarded as unreachable, synchronized to this server (synch loop) or outrageous synchronization distance. + <dt><tt>x falsetick</tt> + <dd>The peer is discarded by the intersection algorithm as a falseticker. + <dt><tt>. excess</tt> + <dd>The peer is discarded as not among the first ten peers sorted by synchronization distance and so is probably a poor candidate for further consideration. + <dt><tt>- outlyer</tt> + <dd>The peer is discarded by the clustering algorithm as an outlyer. + <dt><tt>+ candidat</tt> + <dd>The peer is a survivor and a candidate for the combining algorithm. + <dt><tt># selected</tt> + <dd>The peer is a survivor, but not among the first six peers sorted by synchronization distance. If the association is ephemeral, it may be demobilized to conserve resources. + <dt><tt>* sys.peer</tt> + <dd>The peer has been declared the system peer and lends its variables to the system variables. + <dt><tt>o pps.peer</tt> + <dd>The peer has been declared the system peer and lends its variables to thesystem variables. However, the actual system synchronization is derived from a pulse-per-second (PPS) signal, either indirectly via the PPS reference clock driver or directly via kernel interface. + </dl> + <h4>System Variables</h4> + <p>The <tt>status, leap, stratum, precision, rootdelay, rootdispersion, refid, reftime, poll, offset, and frequency</tt> variables are described in RFC-1305 specification. Additional NTPv4 system variables include the following.</p> + <dl> + <dt><tt>version</tt> + <dd>Everything you might need to know about the software version and generation time. + <dt><tt>processor</tt> + <dd>The processor and kernel identification string. + <dt><tt>system</tt> + <dd>The operating system version and release identifier. + <dt><tt>state</tt> + <dd>The state of the clock discipline state machine. The values are described in the architecture briefing on the NTP Project page linked from www.ntp.org. + <dt><tt>peer</tt> + <dd>The internal integer used to identify the association currently designated the system peer. + <dt><tt>jitter</tt> + <dd>The estimated time error of the system clock measured as an exponential average of RMS time differences. + <dt><tt>stability</tt> + <dd>The estimated frequency stability of the system clock measured as an exponential average of RMS frequency differences. + </dl> + <p>When the NTPv4 daemon is compiled with the OpenSSL software library, additional system variables are displayed, including some or all of the following, depending on the particular dance:</p> + <dl> + <dt><tt>flags</tt> + <dd>The current flags word bits and message digest algorithm identifier (NID) in hex format. The high order 16 bits of the four-byte word contain the NID from the OpenSSL ligrary, while the low-order bits are interpreted as follows: + <dd> + <dl> + <dt><tt>0x01</tt> + <dd>autokey enabled + <dt><tt>0x02</tt> + <dd>NIST leapseconds file loaded + <dt><tt>0x10</tt> + <dd>PC identity scheme + <dt><tt>0x20</tt> + <dd>IFF identity scheme + <dt><tt>0x40</tt> + <dd>GQ identity scheme + </dl> + <dt><tt>hostname</tt> + <dd>The name of the host as returned by the Unix <tt>gethostname()</tt> library function. + <dt><tt>hostkey</tt> + <dd>The NTP filestamp of the host key file. + <dt><tt>cert</tt> + <dd>A list of certificates held by the host. Each entry includes the subject, issuer, flags and NTP filestamp in order. The bits are interpreted as follows: + <dd> + <dl> + <dt><tt>0x01</tt> + <dd>certificate has been signed by the server + <dt><tt>0x02</tt> + <dd>certificate is trusted + <dt><tt>0x04</tt> + <dd>certificate is private + <dt><tt>0x08</tt> + <dd>certificate contains errors and should not be trusted + </dl> + <dt><tt>leapseconds</tt> + <dd>The NTP filestamp of the NIST leapseconds file. + <dt><tt>refresh</tt> + <dd>The NTP timestamp when the host public cryptographic values were refreshed and signed. + <dt><tt>signature</tt> + <dd>The host digest/signature scheme name from the OpenSSL library. + <dt><tt>tai</tt> + <dd>The TAI-UTC offset in seconds obtained from the NIST leapseconds table. + </dl> + <h4>Peer Variables</h4> + <p>The <tt>status, srcadr, srcport, dstadr, dstport, leap, stratum, precision, rootdelay, rootdispersion, readh, hmode, pmode, hpoll, ppoll, offset, delay, dspersion, reftime</tt> variables are described in the RFC-1305 specification, as are the timestamps <tt>org, rec and xmt</tt>. Additional NTPv4 system variables include the following.</p> + <dl> + <dt><tt>flash</tt> + <dd>The flash code for the most recent packet received. The encoding and meaning of these codes is given later in this page. + <dt><tt>jitter</tt> + <dd>The estimated time error of the peer clock measured as an exponential average of RMS time differences. + <dt><tt>unreach</tt> + <dd>The value of the counter which records the number of poll intervals since the last valid packet was received. + </dl> + <p>When the NTPv4 daemon is compiled with the OpenSSL software library, additional peer variables are displayed, including the following:</p> + <dl> + <dt><tt>flags</tt> + <dd>The current flag bits. This word is the server host status word with additional bits used by the Autokey state machine. See the source code for the bit encoding. + <dt><tt>hostname</tt> + <dd>The server host name. + <dt><tt>initkey <i>key</i></tt> + <dd>The initial key used by the key list generator in the Autokey protocol. + <dt><tt>initsequence <i>index</i></tt> + <dd>The initial index used by the key list generator in the Autokey protocol. + <dt><tt>signature</tt> + <dd>The server message digest/signature scheme name from the OpenSSL software library. + <dt><tt>timestamp <i>time</i></tt> + <dd>The NTP timestamp when the last Autokey key list was generated and signed. + </dl> + <h4>Flash Codes</h4> + <p>The <tt>flash</tt> code is a valuable debugging aid displayed in the peer variables list. It shows the results of the original sanity checks defined in the NTP specification RFC-1305 and additional ones added in NTPv4. There are 12 tests designated <tt>TEST1</tt> through <tt>TEST12</tt>. The tests are performed in a certain order designed to gain maximum diagnostic information while protecting against accidental or malicious errors. The <tt>flash</tt> variable is initialized to zero as each packet is received. If after each set of tests one or more bits are set, the packet is discarded.</p> + <p>Tests <tt>TEST1</tt> through <tt>TEST3</tt> check the packet timestamps from which the offset and delay are calculated. If any bits are set, the packet is discarded; otherwise, the packet header variables are saved. <tt>TEST4</tt> and <tt>TEST5</tt> are associated with access control and cryptographic authentication. If any bits are set, the packet is discarded immediately with nothing changed.</p> + <p>Tests <tt>TEST6</tt> through <tt>TEST8</tt> check the health of the server. If any bits are set, the packet is discarded; otherwise, the offset and delay relative to the server are calculated and saved. <tt>TEST9</tt> checks the health of the association itself. If any bits are set, the packet is discarded; otherwise, the saved variables are passed to the clock filter and mitigation algorithms.</p> + <p>Tests <tt>TEST10</tt> through <tt>TEST12</tt> check the authentication state using Autokey public-key cryptography, as described in the <a href="authopt.html">Authentication Options</a> page. If any bits are set and the association has previously been marked reachable, the packet is discarded; otherwise, the originate and receive timestamps are saved, as required by the NTP protocol, and processing continues.</p> + <p>The <tt>flash</tt> bits for each test are defined as follows.</p> + <dl> + <dt><tt>0x001 TEST1</tt> + <dd>Duplicate packet. The packet is at best a casual retransmission and at worst a malicious replay. + <dt><tt>0x002 TEST2</tt> + <dd>Bogus packet. The packet is not a reply to a message previously sent. This can happen when the NTP daemon is restarted and before somebody else notices. + <dt><tt>0x004 TEST3</tt> + <dd>Unsynchronized. One or more timestamp fields are invalid. This normally happens when the first packet from a peer is received. + <dt><tt>0x008 TEST4</tt> + <dd>Access is denied. See the <a href="accopt.html">Access Control Options</a> page. + <dt><tt>0x010 TEST5</tt> + <dd>Cryptographic authentication fails. See the <a href="authopt.html">Authentication Options</a> page. + <dt><tt>0x020TEST6</tt> + <dd>The server is unsynchronized. Wind up its clock first. + <dt><tt>0x040 TEST7</tt> + <dd>The server stratum is at the maximum than 15. It is probably unsynchronized and its clock needs to be wound up. + <dt><tt>0x080 TEST8</tt> + <dd>Either the root delay or dispersion is greater than one second, which is highly unlikely unless the peer is unsynchronized to Mars. + <dt><tt>0x100 TEST9</tt> + <dd>Either the peer delay or dispersion is greater than one second, which is higly unlikely unless the peer is on Mars. + <dt><tt>0x200 TEST10</tt> + <dd>The autokey protocol has detected an authentication failure. See the <a href="authopt.html">Authentication Options</a> page. + <dt><tt>0x400 TEST11</tt> + <dd>The autokey protocol has not verified the server or peer is proventic and has valid public key credentials. See the <a href="authopt.html">Authentication Options</a> page. + <dt><tt>0x800 TEST12</tt> + <dd>A protocol or configuration error has occurred in the public key algorithms or a possible intrusion event has been detected. See the <a href="authopt.html">Authentication Options</a> page. + </dl> + <h4>Bugs</h4> + <p>The peers command is non-atomic and may occasionally result in spurious error messages about invalid associations occurring and terminating the command. The timeout time is a fixed constant, which means you wait a long time for timeouts since it assumes sort of a worst case. The program should improve the timeout estimate as it sends queries to a particular host, but doesn't.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/ntptime.html b/contrib/ntp/html/ntptime.html new file mode 100644 index 0000000..a9ea33b --- /dev/null +++ b/contrib/ntp/html/ntptime.html @@ -0,0 +1,48 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntptime - read kernel time variables</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntptime</tt> - read kernel time variables</h3> + <img src="pic/pogo5.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Pogo</i>, Walt Kelly</a> + <p>The turtle has been swimming in the kernel.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:46</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <hr> + <h4>Synopsis</h4> + <tt>ntptime [ -chr ] [ -e <i>est_error</i> ] [ -f <i>frequency</i> ] [ -m <i>max_error</i> ] [ -o <i>offset</i> ] [ -s <i>status</i> ] [ -t <i>time_constant</i>]</tt> + <h4>Description</h4> + <p>This program is useful only with special kernels described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. It reads and displays time-related kernel variables using the <tt>ntp_gettime()</tt> system call. A similar display can be obtained using the <tt>ntpdc</tt> program and <tt>kerninfo</tt> command.</p> + <h4>Options</h4> + <dl> + <dt><tt>-c</tt> + <dd>Display the execution time of <tt>ntptime</tt> itself. + <dt><tt>-e <i>est_error</i></tt> + <dd>Specify estimated error, in microseconds. + <dt><tt>-f <i>frequency</i></tt> + <dd>Specify frequency offset, in parts per million. + <dt><tt>-h</tt> + <dd>Display help information. + <dt><tt>-m <i>max_error</i></tt> + <dd>Specify max possible errors, in microseconds. + <dt><tt>-o <i>offset</i></tt> + <dd>Specify clock offset, in microseconds. + <dt><tt>-r</tt> + <dd>Display Unix and NTP times in raw format. + <dt><tt>-s <i>status</i></tt> + <dd>Specify clock status. Better know what you are doing. + <dt><tt>-t <i>time_constant</i></tt> + <dd>Specify time constant, an integer in the range 0-10. + </dl> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/ntptrace.html b/contrib/ntp/html/ntptrace.html new file mode 100644 index 0000000..3b533f9 --- /dev/null +++ b/contrib/ntp/html/ntptrace.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>ntptrace - trace a chain of NTP servers back to the primary source</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>ntptrace</tt> - trace a chain of NTP servers back to the primary source</h3> + <img src="pic/alice13.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The rabbit knows the way back.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:47</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <hr> + <h4>Synopsis</h4> + <tt>ntptrace [ -vdn ] [ -r <i>retries</i> ] [ -t <i>timeout</i> ] [ <i>server</i> ]</tt> + <h4>Description</h4> + <p><tt>ntptrace</tt> determines where a given Network Time Protocol (NTP) server gets its time from, and follows the chain of NTP servers back to their master time source. If given no arguments, it starts with <tt>localhost</tt>. Here is an example of the output from <tt>ntptrace</tt>:</p> + <pre> +% ntptrace +localhost: stratum 4, offset 0.0019529, synch distance 0.144135 +server2ozo.com: stratum 2, offset 0.0124263, synch distance 0.115784 +usndh.edu: stratum 1, offset 0.0019298, synch distance 0.011993, refid 'WWVB' +</pre> + <p>On each line, the fields are (left to right): the host name, the host stratum, the time offset between that host and the local host (as measured by <tt>ntptrace</tt>; this is why it is not always zero for "<tt>localhost</tt>"), the host synchronization distance, and (only for stratum-1 servers) the reference clock ID. All times are given in seconds. Note that the stratum is the server hop count to the primary source, while the synchronization distance is the estimated error relative to the primary source. These terms are precisely defined in RFC-1305.</p> + <h4>Options</h4> + <dl> + <dt><tt>-d</tt> + <dd>Turns on some debugging output. + <dt><tt>-n</tt> + <dd>Turns off the printing of host names; instead, host IP addresses are given. This may be useful if a nameserver is down. + <dt><tt>-r <i>retries</i></tt> + <dd>Sets the number of retransmission attempts for each host (default = 5). + <dt><tt>-t <i>timeout</i></tt> + <dd>Sets the retransmission timeout (in seconds) (default = 2). + <dt><tt>-v</tt> + <dd>Prints verbose information about the NTP servers. + </dl> + <h4>Bugs</h4> + <p>This program makes no attempt to improve accuracy by doing multiple samples.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/parsedata.html b/contrib/ntp/html/parsedata.html new file mode 100644 index 0000000..301d8e7 --- /dev/null +++ b/contrib/ntp/html/parsedata.html @@ -0,0 +1,349 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>NTP PARSE clock data formats</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>NTP PARSE clock data formats</h3> + <p>The parse driver currently supports several clocks with different query mechanisms. In order for you to find a sample that might be similar to a clock you might want to integrate into parse I'll sum up the major features of the clocks (this information is distributed in the parse/clk_*.c and ntpd/refclock_parse.c files).</p> + <hr> + <h4>Meinberg clocks</h4> + <pre> +Meinberg: start=<STX>, end=<ETX>, sync on start + pattern="\2D: . . ;T: ;U: . . ; \3" + pattern="\2 . . ; ; : : ; \3" + pattern="\2 . . ; ; : : ; : ; ; . . " +</pre> + <p>Meinberg is a German manufacturer of time code receivers. Those clocks have a pretty common output format in the stock version. In order to support NTP Meinberg was so kind to produce some special versions of the firmware for the use with NTP. So, if you are going to use a Meinberg clock please ask whether there is a special Uni Erlangen version. You can reach <a href="http://www.meinberg.de/">Meinberg</a> via the Web. Information can also be ordered via eMail from <a href="mailto:%20info@meinberg.de">info@meinberg.de</a></p> + <p>General characteristics:<br> + Meinberg clocks primarily output pulse per second and a describing ASCII string. This string can be produced in two modes: either upon the reception of a question mark or every second. NTP uses the latter mechanism. DCF77 AM clocks have a limited accuracy of a few milliseconds. The DCF77 PZF5xx variants provide higher accuracy and have a pretty good relationship between RS232 time code and the PPS signal. Except for early versions of the old GPS166 receiver type, Meinberg GPS receivers have a very good timing relationship between the datagram and the pulse. The beginning of the start bit of the first character has basically the same accuracy as the PPS signal, plus a jitter of up to 1 bit time depending on the selected baud rate, i.e. 52 μs @ 19200. PPS support should always be used, if possible, in order to yield the highest possible accuracy.</p> + <p>The preferred tty setting for Meinberg DCF77 receivers is 9600/7E2:</p> + <pre> + CFLAG (B9600|CS7|PARENB|CREAD|HUPCL) + IFLAG (IGNBRK|IGNPAR|ISTRIP) + OFLAG 0 + LFLAG 0 + </pre> + <p>The tty setting for Meinberg GPS16x/17x receivers is 19200/8N1:</p> + <pre> + CFLAG (B19200|CS8|PARENB|CREAD|HUPCL) + IFLAG (IGNBRK|IGNPAR|ISTRIP) + OFLAG 0 + LFLAG 0 + </pre> + <p>All clocks should be run at datagram once per second.<br><br></p> + <p>Format of the Meinberg standard time string:</p> +<pre> + <b><i><STX></i>D:<i>dd.mm.yy</i>;T:<i>w</i>;U:<i>hh.mm.ss</i>;<i>uvxy</i><i><ETX></i></b> + pos: 0 000000001111111111222222222233 3 + 1 234567890123456789012345678901 2 + + <i><STX></i> = start-of-text, ASCII code 0x02 + <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots + <i>w</i> = day of week (1..7, Monday = 1) + <i>hh:mm:ss</i> = hour, minute, second, separated by dots + <i>u</i> = '#' for GPS receivers: time is <b>not</b> synchronized + '#' for older PZF5xx receivers: no correlation, not synchronized + '#' for other devices: never sync'ed since powerup + ' ' if nothing of the above applies + <i>v</i> = '*' for GPS receivers: position has <b>not</b> been verified + '*' for other devices: freewheeling based on internal quartz + ' ' if nothing of the above applies + <i>x</i> = 'U' if UTC time is transmitted + 'S' if daylight saving time is active + ' ' if nothing of the above applies + <i>y</i> = '!' during the hour preceding start or end of daylight saving time + 'A' during the hour preceding a leap second + ' ' if nothing of the above applies + <i><ETX></i> = end-of-text, ASCII code 0x03 +</pre> + <p>Format of the Uni Erlangen time string for PZF5xx receivers:</p> +<pre> + <b><i><STX></i><i>dd.mm.yy</i>; <i>w</i>; <i>hh:mm:ss</i>; <i>tuvxyza</i><i><ETX></i></b> + pos: 0 000000001111111111222222222233 3 + 1 234567890123456789012345678901 2 + + <i><STX></i> = start-of-text, ASCII code 0x02 + <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots + <i>w</i> = day of week (1..7, Monday = 1) + <i>hh:mm:ss</i> = hour, minute, second, separated by colons + + <i>t</i> = 'U' if UTC time is transmitted, else ' ' + <i>u</i> = '#' for older PZF5xx receivers: no correlation, not synchronized + '#' for PZF511 and newer: never sync'ed since powerup + ' ' if nothing of the above applies + <i>v</i> = '*' if freewheeling based on internal quartz, else ' ' + <i>x</i> = 'S' if daylight saving time is active, else ' ' + <i>y</i> = '!' during the hour preceding start or end of daylight saving time, else ' ' + <i>z</i> = 'A' during the hour preceding a leap second, else ' ' + <i>a</i> = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers + <i><ETX></i> = end-of-text, ASCII code 0x03 +</pre> + <p>Format of the Uni Erlangen time string for GPS16x/GPS17x receivers:</p> +<pre> + <b><i><STX></i><i>dd.mm.yy</i>; <i>w</i>; <i>hh:mm:ss</i>; <i>+uu:uu</i>; <i>uvxyzab</i>; <i>ll.lllln</i> <i>lll.lllle</i> <i>hhhh</i>m<i><ETX></i></b> + pos: 0 0000000011111111112222222222333333333344444444445555555555666666 6 + 1 2345678901234567890123456789012345678901234567890123456789012345 6 + + <i><STX></i> = start-of-text, ASCII code 0x02 + <i>dd.mm.yy</i> = day of month, month, year of the century, separated by dots + <i>w</i> = day of week (1..7, Monday = 1) + <i>hh:mm:ss</i> = hour, minute, second, separated by colons + <i>+uu:uu</i> = offset to UTC in hours and minutes, preceded by + or - + <i>u</i> = '#' if time is <b>not</b> synchronized, else ' ' + <i>v</i> = '*' if position has <b>not</b> been verified, else ' ' + <i>x</i> = 'S' if daylight saving time is active, else ' ' + <i>y</i> = '!' during the hour preceding start or end of daylight saving time, else ' ' + <i>z</i> = 'A' during the hour preceding a leap second, else ' ' + <i>a</i> = 'R' alternate antenna (reminiscent of PZF5xx), usually ' ' for GPS receivers + <i>b</i> = 'L' during a leap second, i.e. if the seconds field is 60, else ' ' + <i>ll.lllln</i> = position latitude in degrees, 'n' can actually be 'N' or 'S', i.e. North or South + <i>lll.lllle</i> = position longitude in degrees, 'e' can actually be 'E' or 'W', i.e. East or West + <i>hhhh</i> = position altitude in meters, always followed by 'm' + <i><ETX></i> = end-of-text, ASCII code 0x03 +</pre> + <p>Examples for Uni Erlangen strings from GPS receivers:</p> +<pre> + \x02 09.07.93; 5; 08:48:26; +00:00; ; 49.5736N 11.0280E 373m \x03 + \x02 08.11.06; 3; 14:39:39; +00:00; ; 51.9828N 9.2258E 176m \x03 +</pre> + <p>The Uni Erlangen formats should be used preferably. Newer Meinberg GPS receivers can be configured to transmit that format, for older devices there may be a special firmware version available.</p> + <p>For the Meinberg parse look into clk_meinberg.c<br><br></p> + <hr> + <h4>Raw DCF77 Data via serial line</h4> + <p>RAWDCF: end=TIMEOUT>1.5s, sync each char (any char),generate psuedo time codes, fixed format</p> + <p>direct DCF77 code input</p> + <p>In Europe it is relatively easy/cheap the receive the german time code transmitter DCF77. The simplest version to process its signal is to feed the 100/200ms pulse of the demodulated AM signal via a level converter to an RS232 port at 50Baud. parse/clk_rawdcf.c holds all necessary decoding logic for the time code which is transmitted each minute for one minute. A bit of the time code is sent once a second.</p> + <pre> + The preferred tty setting is: + CFLAG (B50|CS8|CREAD|CLOCAL) + IFLAG 0 + OFLAG 0 + LFLAG 0 +</pre> + <h4>DCF77 raw time code</h4> + <p>From "Zur Zeit", Physikalisch-Technische Bundesanstalt (PTB), Braunschweig und Berlin, März 1989<br> + </p> + <p>Timecode transmission:</p> + <pre> + AM: + + time marks are send every second except for the second before the + next minute mark + time marks consist of a reduction of transmitter power to 25% + of the nominal level + the falling edge is the time indication (on time) + time marks of a 100ms duration constitute a logical 0 + time marks of a 200ms duration constitute a logical 1 +</pre> + <p>see the spec. (basically a (non-)inverted psuedo random phase shift) encoding:</p> + <pre> + FM: + + Second Contents + 0 - 10 AM: free, FM: 0 + 11 - 14 free + 15 R - alternate antenna + 16 A1 - expect zone change (1 hour before) + 17 - 18 Z1,Z2 - time zone + 0 0 illegal + 0 1 MEZ (MET) + 1 0 MESZ (MED, MET DST) + 1 1 illegal + 19 A2 - expect leap insertion/deletion (1 hour before) + 20 S - start of time code (1) + 21 - 24 M1 - BCD (lsb first) Minutes + 25 - 27 M10 - BCD (lsb first) 10 Minutes + 28 P1 - Minute Parity (even) + 29 - 32 H1 - BCD (lsb first) Hours + 33 - 34 H10 - BCD (lsb first) 10 Hours + 35 P2 - Hour Parity (even) + 36 - 39 D1 - BCD (lsb first) Days + 40 - 41 D10 - BCD (lsb first) 10 Days + 42 - 44 DW - BCD (lsb first) day of week (1: Monday -> 7: Sunday) + 45 - 49 MO1 - BCD (lsb first) Month + 50 MO10 - 10 Months + 51 - 53 Y1 - BCD (lsb first) Years + 54 - 57 Y10 - BCD (lsb first) 10 Years + 58 P3 - Date Parity (even) + 59 - usually missing (minute indication), except for leap insertion +</pre> + <hr> + <h4>Schmid clock</h4> + <p>Schmid clock: needs poll, binary input, end='\xFC', sync start</p> + <p>The Schmid clock is a DCF77 receiver that sends a binary time code at the reception of a flag byte. The contents if the flag byte determined the time code format. The binary time code is delimited by the byte 0xFC.</p> + <pre> + TTY setup is: + CFLAG (B1200|CS8|CREAD|CLOCAL) + IFLAG 0 + OFLAG 0 + LFLAG 0 + +</pre> + <p>The command to Schmid's DCF77 clock is a single byte; each bit allows the user to select some part of the time string, as follows (the output for the lsb is sent first).</p> + <pre> + Bit 0: time in MEZ, 4 bytes *binary, not BCD*; hh.mm.ss.tenths + Bit 1: date 3 bytes *binary, not BCD: dd.mm.yy + Bit 2: week day, 1 byte (unused here) + Bit 3: time zone, 1 byte, 0=MET, 1=MEST. (unused here) + Bit 4: clock status, 1 byte, 0=time invalid, + 1=time from crystal backup, + 3=time from DCF77 + Bit 5: transmitter status, 1 byte, + bit 0: backup antenna + bit 1: time zone change within 1h + bit 3,2: TZ 01=MEST, 10=MET + bit 4: leap second will be + added within one hour + bits 5-7: Zero + Bit 6: time in backup mode, units of 5 minutes (unused here) +</pre> + <hr> + <h4>Trimble SV6 ASCII time code (TAIP)</h4> + <p>Trimble SV6: needs poll, ascii timecode, start='>', end='<', query='>QTM<', eol='<'</p> + <p>Trimble SV6 is a GPS receiver with PPS output. It needs to be polled. It also need a special tty mode setup (EOL='<').</p> + <pre> + TTY setup is: + CFLAG (B4800|CS8|CREAD) + IFLAG (BRKINT|IGNPAR|ISTRIP|ICRNL|IXON) + OFLAG (OPOST|ONLCR) + LFLAG (ICANON|ECHOK) +</pre> + <p>Special flags are:</p> + <pre> PARSE_F_PPSPPS - use CIOGETEV for PPS time stamping + PARSE_F_PPSONSECOND - the time code is not related to + the PPS pulse (so use the time code + only for the second epoch) + + Timecode + 0000000000111111111122222222223333333 / char + 0123456789012345678901234567890123456 \ posn + >RTMhhmmssdddDDMMYYYYoodnnvrrrrr;*xx< Actual + ----33445566600112222BB7__-_____--99- Parse + >RTM 1 ;* < Check +</pre> + <hr> + <h4>ELV DCF7000</h4> + <p>ELV DCF7000: end='\r', pattern=" - - - - - - - \r"</p> + <p>The ELV DCF7000 is a cheap DCF77 receiver sending each second a time code (though not very precise!) delimited by '`r'</p> + <pre> + Timecode + YY-MM-DD-HH-MM-SS-FF\r + + FF&0x1 - DST + FF&0x2 - DST switch warning + FF&0x4 - unsynchronised +</pre> + <hr> + <h4>HOPF 6021 und Kompatible</h4> + <p>HOPF Funkuhr 6021 mit serieller Schnittstelle Created by F.Schnekenbuehl <frank@comsys.dofn.de> from clk_rcc8000.c Nortel DASA Network Systems GmbH, Department: ND250 A Joint venture of Daimler-Benz Aerospace and Nortel.</p> + <pre> + hopf Funkuhr 6021 + used with 9600,8N1, + UTC via serial line + "Sekundenvorlauf" ON + ETX zum Sekundenvorlauf ON + dataformat 6021 + output time and date + transmit with control characters + transmit evry second + </pre> + <p>Type 6021 Serial Output format</p> + <pre> + 000000000011111111 / char + 012345678901234567 \ position + sABHHMMSSDDMMYYnre Actual + C4110046231195 Parse + s enr Check + + s = STX (0x02), e = ETX (0x03) + n = NL (0x0A), r = CR (0x0D) + + A B - Status and weekday + + A - Status + + 8 4 2 1 + x x x 0 - no announcement + x x x 1 - Summertime - wintertime - summertime announcement + x x 0 x - Wintertime + x x 1 x - Summertime + 0 0 x x - Time/Date invalid + 0 1 x x - Internal clock used + 1 0 x x - Radio clock + 1 1 x x - Radio clock highprecision + + B - 8 4 2 1 + 0 x x x - MESZ/MEZ + 1 x x x - UTC + x 0 0 1 - Monday + x 0 1 0 - Tuesday + x 0 1 1 - Wednesday + x 1 0 0 - Thursday + x 1 0 1 - Friday + x 1 1 0 - Saturday + x 1 1 1 - Sunday +</pre> + <hr> + <h4>Diem Computime Clock</h4> + <p>The Computime receiver sends a datagram in the following format every minute</p> + <pre> + Timestamp T:YY:MM:MD:WD:HH:MM:SSCRLF + Pos 0123456789012345678901 2 3 + 0000000000111111111122 2 2 + Parse T: : : : : : : \r\n + + T Startcharacter "T" specifies start of the timestamp + YY Year MM Month 1-12 + MD Day of the month + WD Day of week + HH Hour + MM Minute + SS Second + CR Carriage return + LF Linefeed +</pre> + <hr> + <h4>WHARTON 400A Series Clock with a 404.2 Serial interface</h4> + <p>The WHARTON 400A Series clock is able to send date/time serial messages in 7 output formats. We use format 1 here because it is the shortest. We set up the clock to send a datagram every second. For use with this driver, the WHARTON 400A Series clock must be set-up as follows :</p> + <pre> + Programmable Selected + Option No Option + BST or CET display 3 9 or 11 + No external controller 7 0 + Serial Output Format 1 9 1 + Baud rate 9600 bps 10 96 + Bit length 8 bits 11 8 + Parity even 12 E +</pre> + <p>WHARTON 400A Series output format 1 is as follows :</p> + <pre> + Timestamp STXssmmhhDDMMYYSETX + Pos 0 12345678901234 + 0 00000000011111 + + STX start transmission (ASCII 0x02) + ETX end transmission (ASCII 0x03) + ss Second expressed in reversed decimal (units then tens) + mm Minute expressed in reversed decimal + hh Hour expressed in reversed decimal + DD Day of month expressed in reversed decimal + MM Month expressed in reversed decimal (January is 1) + YY Year (without century) expressed in reversed decimal + S Status byte : 0x30 + + bit 0 0 = MSF source 1 = DCF source + bit 1 0 = Winter time 1 = Summer time + bit 2 0 = not synchronised 1 = synchronised + bit 3 0 = no early warning 1 = early warning +</pre> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/parsenew.html b/contrib/ntp/html/parsenew.html new file mode 100644 index 0000000..4f11a46 --- /dev/null +++ b/contrib/ntp/html/parsenew.html @@ -0,0 +1,198 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Making PARSE Clocks</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>How to build new PARSE clocks</h3> + <p>Here is an attempt to sketch out what you need to do in order to add another clock to the parse driver: Currently the implementation is being cleaned up - so not all information in here is completely correct. Refer to the included code where in doubt.</p> + <p>Prerequisites:</p> + <ul> + <li>Does the system you want the clock connect to have the include files termio.h or termios.h ? (You need that for the parse driver) + </ul> + <p>What to do:</p> + <p>Make a conversion module (libparse/clk_*.c)</p> + <ol> + <li>What ist the time code format ? + <ul> + <li>find year, month, day, hour, minute, second, status (synchronised or not), possibly time zone information (you need to give the offset to UTC) You will have to convert the data from a string into a struct clocktime: + <pre> + struct clocktime /* clock time broken up from time code */ + { + long day; + long month; + long year; + long hour; + long minute; + long second; + long usecond; + long utcoffset; /* in seconds */ + time_t utcoffset; /* true utc time instead of date/time */ + long flags; /* current clock status */ + }; +</pre> + <p>Conversion is usually simple and straight forward. For the flags following values can be OR'ed together:</p> + <pre> + PARSEB_ANNOUNCE switch time zone warning (informational only) + PARSEB_POWERUP no synchronisation - clock confused (must set then) + PARSEB_NOSYNC timecode currently not confirmed (must set then) + usually on reception error when there is still a + chance the the generated time is still ok. + + PARSEB_DST DST in effect (informational only) + PARSEB_UTC timecode contains UTC time (informational only) + PARSEB_LEAPADD LEAP addition warning (prior to leap happening - must set when imminent) + also used for time code that do not encode the + direction (as this is currently the default). + PARSEB_LEAPDEL LEAP deletion warning (prior to leap happening - must set when imminent) + PARSEB_ALTERNATE backup transmitter (informational only) + PARSEB_POSITION geographic position available (informational only) + PARSEB_LEAPSECOND actual leap second (this time code is the leap + second - informational only) +</pre> + <p>These are feature flags denoting items that are supported by the clock:</p> + <pre> + PARSEB_S_LEAP supports LEAP - might set PARSEB_LEAP + PARSEB_S_ANTENNA supports ANTENNA - might set PARSEB_ALTERNATE + PARSEB_S_PPS supports PPS time stamping + PARSEB_S_POSITION supports position information (GPS) + </pre> + <p>If the utctime field is non zero this value will be take as time code value. This allows for conversion routines that already have the utc time value. The utctime field gives the seconds since Jan 1st 1970, 0:00:00. The useconds field gives the respective usec value. The fields for date and time (down to second resolution) will be ignored.</p> + <p>Conversion is done in the cvt_* routine in parse/clk_*.c files. look in them for examples. The basic structure is:</p> + <pre> + struct clockformat <yourclock>_format = { + lots of fields for you to fill out (see below) + }; + + static cvt_<yourclock>() + ... + { + if (<I do not recognize my time code>) { + return CVT_NONE; + } else { + if (<conversion into clockformat is ok>) { + <set all necessary flags>; + return CVT_OK; + } else { + return CVT_FAIL|CVT_BADFMT; + } + } +</pre> + <p>The struct clockformat is the interface to the rest of the parse driver - it holds all information necessary for finding the clock message and doing the appropriate time stamping.</p> + <pre> +struct clockformat +{ + u_long (*input)(); + /* input routine - your routine - cvt_<yourclock> */ + u_long (*convert)(); + /* conversion routine - your routine - cvt_<yourclock> */ + /* routine for handling RS232 sync events (time stamps) - usually sync_simple */ + u_long (*syncpps)(); + /* PPS input routine - usually pps_one */ + void *data; + /* local parameters - any parameters/data/configuration info your conversion + routine might need */ + char *name; + /* clock format name - Name of the time code */ + unsigned short length; + /* maximum length of data packet for your clock format */ + u_long flags; + /* information for the parser what to look for */ +}; +</pre> + <p>The above should have given you some hints on how to build a clk_*.c file with the time code conversion. See the examples and pick a clock closest to yours and tweak the code to match your clock.</p> + <p>In order to make your clk_*.c file usable a reference to the clockformat structure must be put into parse_conf.c.</p> + </ul> + <li>TTY setup and initialisation/configuration will be done in ntpd/refclock_parse.c. + <ul> + <li>Find out the exact tty settings for your clock (baud rate, parity, stop bits, character size, ...) and note them in terms of termio*.h c_cflag macros. + <li>in ntpd/refclock_parse.c fill out a new the struct clockinfo element (that allocates a new "IP" address - see comments) (see all the other clocks for example) + <pre> + struct clockinfo + { + u_long cl_flags; /* operation flags (io modes) */ + PARSE_F_PPSPPS use loopfilter PPS code (CIOGETEV) + PARSE_F_PPSONSECOND PPS pulses are on second + usually flags stay 0 as they are used only for special setups + + void (*cl_poll)(); /* active poll routine */ + The routine to call when the clock needs data sent to it in order to + get a time code from the clock (e.g. Trimble clock) + + int (*cl_init)(); /* active poll init routine */ + The routine to call for very special initializations. + + void (*cl_event)(); /* special event handling (e.g. reset clock) */ + What to do, when an event happens - used to re-initialize clocks on timeout. + + void (*cl_end)(); /* active poll end routine */ + The routine to call to undo any special initialisation (free memory/timers) + + void *cl_data; /* local data area for "poll" mechanism */ + local data for polling routines + + u_fp cl_rootdelay; /* rootdelay */ + NTP rootdelay estimate (usually 0) + + u_long cl_basedelay; /* current offset - unsigned l_fp + fractional part (fraction) by + which the RS232 time code is + delayed from the actual time. */ + + u_long cl_ppsdelay; /* current PPS offset - unsigned l_fp fractional + time (fraction) by which the PPS time stamp is delayed (usually 0) + part */ + + char *cl_id; /* ID code (usually "DCF") */ + Refclock id - (max 4 chars) + + char *cl_description; /* device name */ + Name of this device. + + char *cl_format; /* fixed format */ + If the data format cann not ne detected automatically this is the name + as in clk_*.c clockformat. + + u_char cl_type; /* clock type (ntp control) */ + Type if clock as in clock status word (ntp control messages) - usually 0 + + u_long cl_maxunsync; /* time to trust oscillator after losing synch + */ + seconds a clock can be trusted after losing synchronisation. + + u_long cl_speed; /* terminal input & output baudrate */ + u_long cl_cflag; /* terminal io flags */ + u_long cl_iflag; /* terminal io flags */ + u_long cl_oflag; /* terminal io flags */ + u_long cl_lflag; /* terminal io flags */ + termio*.h tty modes. + + u_long cl_samples; /* samples for median filter */ + u_long cl_keep; /* samples for median filter to keep */ + median filter parameters - smoothing and rejection of bad samples + } clockinfo[] = { + ...,<other clocks>,... + { < your parameters> }, + }; + +</pre> + </ul> + </ol> + <p>Well, this is very sketchy, i know. But I hope it helps a little bit. The best way is to look which clock comes closest to your and tweak that code.</p> + <p>Two sorts of clocks are used with parse. Clocks that automatically send their time code (once a second) do not need entries in the poll routines because they send the data all the time. The second sort are the clocks that need a command sent to them in order to reply with a time code (like the Trimble clock).</p> + <p>For questions: <a href="mailto:%20kardel <AT> acm.org">kardel + <AT> + acm.org</a>.</p> + <p>Please include an exact description on how your clock works. (initialisation, TTY modes, strings to be sent to it, responses received from the clock).</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + + <body></body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/pps.html b/contrib/ntp/html/pps.html new file mode 100644 index 0000000..b9fcd7f --- /dev/null +++ b/contrib/ntp/html/pps.html @@ -0,0 +1,41 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Pulse-per-second (PPS) Signal Interfacing</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Pulse-per-second (PPS) Signal Interfacing</h3> + <img src="pic/alice32.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Alice is trying to find the PPS signal connector.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:48</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links11.txt"></script> + <hr> + <p>Some radio clocks and related timekeeping gear have a pulse-per-second (PPS) signal that can be used to discipline the system clock to a high degree of precision, typically to the order less than 10 <font face="Symbol">m</font>s in time and 0.01 parts-per-million (PPM) in frequency. This page describes the hardware and software necessar for NTP to use this signal.</p> + <img src="pic/gadget.jpg" alt="gif" align="left">A Gadget Box built by Chuck Hanavin<br clear="left"> + <h4>Gadget Box</h4> + <p>The PPS signal can be connected in either of two ways: via the data carrier detector (DCD) pin of a serial port or via the acknowledge (ACK) pin of a parallel port, depending on the hardware and operating system. Note that NTP no longer supports connection via the data leads of a serial port. However, the PPS signal levels are usually incompatible with serial port levels. The gadget box consists of a handful of electronic components assembled in a small aluminum box. It includes level converters and a optional modem designed to decode the radio timecode signals transmitted by Canadian time and frequency station CHU. This can be used with the <a href="drivers/driver7.html">Radio CHU Audio Demodulator/Decoder</a>. A complete set of schematics, PCB artwork and drill templates can be obrtained via the web at <a href="ftp://ftp.udel.edu/pub/ntp/hardware/gadget.tar.Z">gadget.tar.Z</a>.</p> + <h4>Operating System Support </h4> + <p>Both the serial and parallel port connection require operating system support, which is available in only a few operating systems, including FreeBSD, Linux (with PPSkit patch) and Solaris. Support on an experimental basis is available for several other systems, including SunOS and HP/Compaq/Digital Tru64. The PPSAPI application program interface defined in [1] is the only interface currently supported. Older PPS interfaces based on the <tt>ppsclock</tt> and <tt>tty_clk</tt> streams modules are no longer supported. As the PPSAPI is expected to become an IETF cross-platform standard, it should be used by new applications.</p> + <p>The entire PPS interface functionality is currently provided by inline code in the <tt>timepps.h</tt> header file. While not all implementations support the full PPSAPI specification, they do support all the functions required for the PPS driver described next. The FreeBSD, Linux and Solaris implementations can be used with the stock kernels provided with those systems; however, the Tru64 and SunOS kernels require additional functions not provided in the stock kernels. Solaris users are cautioned that these functions operate improperly in Solaris versions prior to 2.8 with patch Generic_108528-02. Header files for other systems can be found via the web at <a href="ftp://ftp.udel.edu/pub/ntp/software/nanokernel.tar.gz">nanokernel.tar.gz</a>.</p> + <h4>PPS Driver</h4> + <p>In the preferred mode of operation, PPS signals are processed by the <a href="drivers/driver22.html">PPS Clock Discipline</a> driver and other clock drivers which might be involved need not know or care about them. In some cases where there is no other driver, time might be obtained from remote NTP servers via the network and local PPS signals, for instance from a calibrated cesium oscillator, used to stabilize the frequency and remove network jitter. Note that the <tt>pps</tt> configuration command has been obsoleted by this driver.</p> + <p>The PPS driver operates in conjunction with a preferred peer, as described in the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. One of the drivers described in the <a href="refclock.html">Reference Clock Drivers</a> page or another NTP server furnishes the coarse timing and disambiguates the seconds numbering of the PPS signal itself. The NTP daemon mitigates between the clock driver or NTP server and the PPS driver as described in that page in order to provide the most accurate time, while respecting the various types of equipment failures that could happen.</p> + <p>Some Unix system kernels support a PPS signal directly, as described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. Specifically, the PPS driver can be used to direct the PPS signal to the kernel for use as a discipline source for both time and frequency. The presence of the kernel support is automatically detected during the NTP build process and supporting code automatically compiled. Note that the PPS driver does not normally enable the PPS kernel code, since performance is generally better without it. However, this code can be enabled by a driver fudge flag if necessary.</p> + <p>Some configurations may include multiple radio clocks with individual PPS outputs. In some PPSAPI designs multiple PPS signals can be connected to multiple instances of the PPS driver. In such cases the NTP mitigation and grooming algorithms operate with all the radio timecodes and PPS signals to develop the highest degree of redundancy and survivability.</p> + <h4>Reference</h4> + <ol> + <li>Mogul, J., D. Mills, J. Brittenson, J. Stone and U. Windl. Pulse-per-second API for Unix-like operating systems, version 1. Request for Comments RFC-2783, Internet Engineering Task Force, March 2000, 31 pp. <a href="http://www.eecis.udel.edu/mills/database/rfc/rfc2783.txt">ASCII</a> + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/prefer.html b/contrib/ntp/html/prefer.html new file mode 100644 index 0000000..00225d1 --- /dev/null +++ b/contrib/ntp/html/prefer.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Mitigation Rules and the prefer Keyword</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Mitigation Rules and the <tt>prefer</tt> Keyword</h3> + <img src="pic/alice11.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html"> from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>Listen carefully to what I say; it is very complicated.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:49</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links10.txt"></script> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#intro">Introduction</a> + <li class="inline"><a href="#prefer">The <tt>prefer</tt> Peer</a> + <li class="inline"><a href="#peer">Peer Classification</a> + <li class="inline"><a href="#miti">Mitigation Rules</a> + <li class="inline"><a href="#pps">Using the Pulse-per-Second (PPS) Signal</a> + </ul> + <hr> + <h4 id="intro">Introduction</h4> + <p>The mechanics of the NTP algorithms which select the best data sample from each available server and the best subset of the server population have been finely crafted to resist network jitter, faults in the network or server operations, and to deliver the best possible accuracy. Most of the time these algorithms do a good job without requiring explicit manual tailoring of the configuration file. However, there are times when the accuracy can be improved by some careful tailoring. The following sections explain how to do this using explicit configuration items and special signals, when available, that are generated by some radio clocks and laboratory instruments.</p> + <p>In order to provide robust backup sources, primary (stratum-1) servers are usually operated in a diversity configuration, in which the server operates with a number of remote servers in addition to one or more radio or modem clocks. In these configurations the suite of algorithms used in NTP to refine the data from each peer separately and to select and combine the data from a number of servers and clocks. As the result of these algorithms, a set of <i>survivors</i> are identified which can presumably provide the most reliable and accurate time. Ordinarily, the individual clock offsets of the survivors are combined on a weighted average basis to produce an offset used to control the system clock.</p> + <p>However, because of small but significant systematic time offsets between the survivors, it is in general not possible to achieve the lowest jitter and highest stability in these configurations. This happens because the selection algorithm tends to <i>clockhop</i> between survivors of substantially the same quality, but showing small systematic offsets between them. In addition, there are a number of configurations involving pulse-per-second (PPS) signals, modem backup services and other special cases, so that a set of mitigation rules becomes necessary to select a single peer from among the survivors. These rules are based on a set of special characteristics of the various remote servers and reference clock drivers specified in the configuration file.</p> + <h4 id="prefer">The <tt>prefer</tt> Peer</h4> + <p>The mitigation rules are designed to provide an intelligent selection between various sources of substantially the same statistical quality without compromising the normal operation of the NTP algorithms. While they have been implemented in NTP Version 4 and will be incorporated in the NTP Version 4 specification when published, they are not in the NTP Version 3 specification RFC-1305. The rules are based on the concept of <i>prefer peer</i>, which is specified by including the <tt>prefer</tt> keyword with the associated <tt>server</tt> or <tt>peer</tt> command in the configuration file. This keyword can be used with any server or peer, but is most commonly used with a radio clock. While the rules do not forbid it, it does not seem useful to designate more than one peer as preferred, since the additional complexities to mitigate among them do not seem justified from on-air experience.</p> + <p>The prefer scheme works on the set of peers that have survived the sanity checks and intersection algorithms of the clock selection procedures. Ordinarily, the members of this set can be considered <i>truechimers</i> and any one of them could in principle provide correct time; however, due to various error contributions, not all can provide the most accurate and stable time. The job of the clustering algorithm, which is invoked at this point, is to select the best subset of the survivors providing the least variance in the combined ensemble average, compared to the variance in each member of the subset separately. The detailed operation of the clustering algorithm, which is given in RFC-1305, is beyond the scope of discussion here. It operates in rounds, where a survivor, presumably the worst of the lot, is discarded in each round until one of several termination conditions is met. An example terminating condition is when the number of survivors is about to be reduced below three.</p> + <p>In the prefer scheme the clustering algorithm is modified so that the prefer peer is never discarded; on the contrary, its potential removal becomes a termination condition. If the original algorithm were about to toss out the prefer peer, the algorithm terminates immediately. The prefer peer can still be discarded by the sanity checks and intersection algorithm, of course, but it will always survive the clustering algorithm. If it does not survive or for some reason it fails to provide updates, it will eventually become unreachable and the clock selection will remitigate to select the next best source.</p> + <p>Along with this behavior, the clock selection procedures are modified so that the combining algorithm is not used when a prefer peer is present. Instead, the offset of the prefer peer is used exclusively as the synchronization source. In the usual case involving a radio clock and a flock of remote stratum-1 peers, and with the radio clock designated a prefer peer, the result is that the high quality radio time disciplines the server clock as long as the radio itself remains operational and with valid time, as determined from the remote peers, sanity checks and intersection algorithm.</p> + <h4 id="peer">Peer Classification</h4> + <p>In order to understand the effects of the various intricate schemes involved, it is necessary to understand some arcane details on how the algorithms decide on a synchronization source when more than one source is available. This is done on the basis of a set of explicit mitigation rules, which define special classes of remote serves and local radio clocks as a function of configuration declarations and clock driver type:</p> + <ol> + <li>The prefer peer is designated using the <tt>prefer</tt> keyword with the <tt>server</tt> or <tt>peer</tt> commands. All other things being equal, this peer will be selected for synchronization over all other survivors of the clock selection procedures. + <li>When a PPS signal is connected via the PPS Clock Discipline driver (type 22), this is called the <i>PPS peer</i>. This driver provides precision clock corrections only within one second, so is always operated in conjunction with another server or radio clock driver, which provides the seconds numbering. The PPS peer is active only under conditions explained below. + <li>When the Undisciplined Local Clock driver (type 1) is configured, this is called the <i>local clock peer</i>. This is used either as a backup reference source (stratum greater than zero), should all other synchronization sources fail, or as the primary reference source (stratum zero) in cases where the kernel time is disciplined by some other means of synchronization, such as the NIST <tt>lockclock</tt> scheme, or another synchronization protocol, such as the Digital Time Synchronization Service (DTSS). + <li>When a modem driver such as the Automated Computer Time Service driver (type 18) is configured, this is called the <i>modem peer</i>. This is used either as a backup reference source, should all other primary sources fail, or as the (only) primary reference source. + <li>Where support is available, the PPS signal may be processed directly by the kernel, as described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. This is called the <i>kernel discipline</i>. The PPS signal can discipline the kernel in both frequency and time. The frequency discipline is active as long as the PPS interface device and signal itself is operating correctly, as determined by the kernel algorithms. The time discipline is active only under conditions explained below. + </ol> + <p>Reference clock drivers operate in the manner described in the <a href="refclock.html">Reference Clock Drivers</a> page and its dependencies. The drivers are ordinarily operated at stratum zero, so that as the result of ordinary NTP operations, the server itself operates at stratum one, as required by the NTP specification. In some cases described below, the driver is intentionally operated at an elevated stratum, so that it will be selected only if no other survivor is present with a lower stratum. In the case of the PPS peer or kernel time discipline, these sources appear active only if the prefer peer has survived the intersection and clustering algorithms, as described below, and its clock offset relative to the current local clock is less than a specified value, currently 128 ms.</p> + <p>The modem clock drivers are a special case. Ordinarily, the update interval between modem calls to synchronize the system clock is many times longer than the interval between polls of either a remote server or local radio clock. In order to provide the best stability, the operation of the clock discipline algorithm changes gradually from a phase-lock mode at the shorter update intervals to a frequency-lock mode at the longer update intervals. If remote servers or local radio clocks together with a modem peer operate in the same client, the following things can happen.</p> + <p>First the clock selection algorithm can select one or more remote servers or local radio clocks and the clock discipline algorithm will optimize for the shorter update intervals. Then, the selection algorithm can select the modem peer, which requires a much different optimization. The intent in the design is to allow the modem peer to control the system clock either when no other source is available or, if the modem peer happens to be marked as prefer, then it always controls the clock, as long as it passes the sanity checks and intersection algorithm. There still is room for suboptimal operation in this scheme, since a noise spike can still cause a clockhop either way. Nevertheless, the optimization function is slow to adapt, so that a clockhop or two does not cause much harm.</p> + <p>The local clock driver is another special case. Normally, this driver is eligible for selection only if no other source is available. When selected, vernier adjustments introduced via the configuration file or remotely using the <tt><a href="ntpdc.html">ntpdc</a> </tt>program can be used to trim the local clock frequency and time. However, if the local clock driver is designated the prefer peer, this driver is always selected and all other sources are ignored. This behavior is intended for use when the kernel time is controlled by some means external to NTP, such as the NIST <tt>lockclock</tt> algorithm or another time synchronization protocol such as DTSS. In this case the only way to disable the local clock driver is to mark it unsynchronized using the leap indicator bits. In the case of modified kernels with the <tt>ntp_adjtime()</tt> system call, this can be done automatically if the external synchronization protocol uses it to discipline the kernel time.</p> + <h4 id="miti">Mitigation Rules</h4> + <p>The mitigation rules apply in the intersection and clustering algorithms described in the NTP specification. The intersection algorithm first scans all peers with a persistent association and includes only those that satisfy specified sanity checks. In addition to the checks required by the specification, the mitigation rules require either the local-clock peer or modem peer to be included only if marked as the prefer peer. The intersection algorithm operates on the included population to select only those peers believed to represent the correct time. If one or more peers survive the algorithm, processing continues in the clustering algorithm. Otherwise, if there is a modem peer, it is declared the only survivor; otherwise, if there is a local-clock peer, it is declared the only survivor. Processing then continues in the clustering algorithm.</p> + <p>The clustering algorithm repeatedly discards outlyers in order to reduce the residual jitter in the survivor population. As required by the NTP specification, these operations continue until either a specified minimum number of survivors remain or the minimum select dispersion of the population is greater than the maximum peer dispersion of any member. The mitigation rules require an additional terminating condition which stops these operations at the point where the prefer peer is about to be discarded.</p> + <p>The mitigation rules establish the choice of <i>system peer</i>, which determines the stratum, reference identifier and several other system variables which are visible to clients of the server. In addition, they establish which source or combination of sources control the local clock.</p> + <ol> + <li>If there is a prefer peer and it is the local-clock peer or the modem peer; or, if there is a prefer peer and the kernel time discipline is active, choose the prefer peer as the system peer and its offset as the system clock offset. If the prefer peer is the local-clock peer, an offset can be calculated by the driver to produce a frequency offset in order to correct for systematic frequency errors. In case a source other than NTP is controlling the system clock, corrections determined by NTP can be ignored by using the <tt>disable pll</tt> in the configuration file. If the prefer peer is the modem peer, it must be the primary source for the reasons noted above. If the kernel time discipline is active, the system clock offset is ignored and the corrections handled directly by the kernel. + <li>If the above is not the case and there is a PPS peer, then choose it as the system peer and its offset as the system clock offset. + <li>If the above is not the case and there is a prefer peer (not the local-clock or modem peer in this case), then choose it as the system peer and its offset as the system clock offset. + <li>If the above is not the case and the peer previously chosen as the system peer is in the surviving population, then choose it as the system peer and average its offset along with the other survivors to determine the system clock offset. This behavior is designed to avoid excess jitter due to clockhopping, when switching the system peer would not materially improve the time accuracy. + <li>If the above is not the case, then choose the first candidate in the list of survivors ranked in order of synchronization distance and average its offset along with the other survivors to determine the system clock offset. This is the default case and the only case considered in the current NTP specification. + </ol> + <h4 id="pps">Using the Pulse-per-Second (PPS) Signal</h4> + <p>Most radio clocks are connected using a serial port operating at speeds of 9600 bps or higher. The accuracy using typical timecode formats, where the on-time epoch is indicated by a designated ASCII character, like carriage-return <tt><cr></tt>, is limited to a millisecond or two. However, some radios produce a PPS signal which can be used to improve the accuracy with typical workstation servers to the order of microseconds. The details of how this can be accomplished are discussed in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. The following paragraphs discuss how the PPS signal is affected by the mitigation rules.</p> + <p>First, it should be pointed out that the PPS signal is inherently ambiguous, in that it provides a precise seconds epoch, but does not provide a way to number the seconds. In principle and most commonly, another source of synchronization, either the timecode from an associated radio clock, or even one or more remote NTP servers, is available to perform that function. In all cases, a specific, configured peer or server must be designated as associated with the PPS signal. This is done using the <tt>prefer</tt> keyword as described previously. The PPS signal can be associated in this way with any peer, but is most commonly used with the radio clock generating the PPS signal.</p> + <p>The PPS signal can be used in two ways to discipline the local clock, one using a special PPS driver described in the <a href="drivers/driver22.html">PPS Clock Discipline</a> page, the other using PPS signal support in the kernel, as described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. In either case, the signal must be present and within nominal jitter and wander error tolerances. In addition, the associated prefer peer must have survived the sanity checks and intersection algorithms and the dispersion settled below 1 s. This insures that the radio clock hardware is operating correctly and that, presumably, the PPS signal is operating correctly as well. Second, the absolute offset of the local clock from that peer must be less than 128 ms, or well within the 0.5-s unambiguous range of the PPS signal itself. In the case of the PPS driver, the time offsets generated from the PPS signal are propagated via the clock filter to the clock selection procedures just like any other peer. Should these pass the sanity checks and intersection algorithms, they will show up along with the offsets of the prefer peer itself. Note that, unlike the prefer peer, the PPS peer samples are not protected from discard by the clustering algorithm. These complicated procedures insure that the PPS offsets developed in this way are the most accurate, reliable available for synchronization.</p> + <p>The PPS peer remains active as long as it survives the intersection algorithm and the prefer peer is reachable; however, like any other clock driver, it runs a reachability algorithm on the PPS signal itself. If for some reason the signal fails or displays gross errors, the PPS peer will either become unreachable or stray out of the survivor population. In this case the clock selection remitigates as described above.</p> + <p>When kernel support for the PPS signal is available, the PPS signal is interfaced to the kernel serial driver code via a modem control lead. As the PPS signal is derived from external equipment, cables, etc., which sometimes fail, a good deal of error checking is done in the kernel to detect signal failure and excessive noise. The way in which the mitigation rules affect the kernel discipline is as follows.</p> + <p>PPS support requires the PPS driver (type 22) and PPSAPI interface described in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page. In order to operate, the prefer peer must be designated and the kernel support enabled by the <tt>enable pps</tt> command in the configuration file and the signal must be present and within nominal jitter and wander error tolerances. In the NTP daemon, the PPS discipline is active only when the prefer peer is among the survivors of the clustering algorithm, and its absolute offset is within 128 ms, as determined by the PPS driver. Under these conditions the kernel disregards updates produced by the NTP daemon and uses its internal PPS source instead. The kernel maintains a watchdog timer for the PPS signal; if the signal has not been heard or is out of tolerance for more than some interval, currently two minutes, the kernel discipline is declared inoperable and operation continues as if it were not present.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/rdebug.html b/contrib/ntp/html/rdebug.html new file mode 100644 index 0000000..d49514d --- /dev/null +++ b/contrib/ntp/html/rdebug.html @@ -0,0 +1,32 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Debugging Reference Clock Drivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Debugging Reference Clock Drivers</h3> + <img src="pic/oz2.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a> + <p>Call the girls and the'll sweep your bugs.</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:49</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links10.txt"></script> + <h4>More Help</h4> + <script type="text/javascript" language="javascript" src="scripts/links12.txt"></script> + <hr> + <p>The <a href="ntpq.html"><tt>ntpq</tt></a> and <a href="ntpdc.html"><tt>ntpdc</tt></a> utility programs can be used to debug reference clocks, either on the server itself or from another machine elsewhere in the network. The server is compiled, installed and started using the configuration file described in the <a href="ntpd.html"><tt>ntpd</tt></a> page and its dependencies. If the clock appears in the <tt>ntpq</tt> utility and <tt>pe</tt> command, no errors have occurred and the daemon has started, opened the devices specified and waiting for peers and radios to come up. If not, the first thing to look for are error messages on the system log. These are usually due to improper configuration, missing links or multiple instances of the daemon.</p> + <p>It normally takes a minute or so for evidence to appear that the clock is running and the driver is operating correctly. The first indication is a nonzero value in the <tt>reach</tt> column in the <tt>pe</tt> billboard. If nothing appears after a few minutes, the next step is to be sure the RS232 messages, if used, are getting to and from the clock. The most reliable way to do this is with an RS232 tester and to look for data flashes as the driver polls the clock and/or as data arrive from the clock. Our experience is that the overwhelming fraction of problems occurring during installation are due to problems such as miswired connectors or improperly configured device links at this stage.</p> + <p>If RS232 messages are getting to and from the clock, the variables of interest can be inspected using the <tt>ntpq</tt> program and various commands described on the documentation page. First, use the <tt>pe</tt> and <tt>as</tt> commands to display billboards showing the peer configuration and association IDs for all peers, including the radio clock. The assigned clock address should appear in the <tt>pe</tt> billboard and the association ID for it at the same relative line position in the <tt>as</tt> billboard.</p> + <p>Additional information is available with the <tt>rv</tt> and <tt>clockvar</tt> commands, which take as argument the association ID shown in the <tt>as</tt> billboard. The <tt>rv</tt> command with no argument shows the system variables, while the <tt>rv</tt> command with association ID argument shows the peer variables for the clock, as well as other peers of interest. The <tt>clockvar</tt> command with argument shows the peer variables specific to reference clock peers, including the clock status, device name, last received timecode (if relevant), and various event counters. In addition, a subset of the <tt>fudge</tt> parameters is included. The poll and error counters in the <tt>clockvar</tt> billboard are useful debugging aids. The <tt>poll</tt> counts the poll messages sent to the clock, while the <tt>noreply</tt>, <tt>badformat</tt> and <tt>baddate</tt> count various errors. Check the timecode to be sure it matches what the driver expects. This may require consulting the clock hardware reference manual, which is probably pretty dusty at this stage.</p> + <p>The <tt>ntpdc</tt> utility program can be used for detailed inspection of the clock driver status. The most useful are the <tt>clockstat</tt> and <tt>clkbug</tt> commands described in the document page. While these commands permit getting quite personal with the particular driver involved, their use is seldom necessary, unless an implementation bug shows up. If all else fails, turn on the debugging trace using two <tt>-d</tt> flags in the <tt>ntpd</tt> startup command line. Most drivers will dump status at every received message in this case. While the displayed trace can be intimidating, this provides the most detailed and revealing indicator of how the driver and clock are performing and where bugs might lurk.</p> + <p>Most drivers write a message to the <tt>clockstats</tt> file as each timecode or surrogate is received from the radio clock. By convention, this is the last ASCII timecode (or ASCII gloss of a binary-coded one) received from the radio clock. This file is managed by the <tt>filegen</tt> facility described in the <tt>ntpd</tt> page and requires specific commands in the configuration file. This forms a highly useful record to discover anomalies during regular operation of the clock. The scripts included in the <tt>./scripts/stats</tt> directory can be run from a <tt>cron</tt> job to collect and summarize these data on a daily or weekly basis. The summary files have proven inspirational to detect infrequent misbehavior due to clock implementation bugs in some radios.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/refclock.html b/contrib/ntp/html/refclock.html new file mode 100644 index 0000000..733b7bf --- /dev/null +++ b/contrib/ntp/html/refclock.html @@ -0,0 +1,103 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>Reference Clock Drivers</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Reference Clock Drivers</h3> + <img src="pic/stack1a.jpg" alt="gif" align="left">Master Time Facility at the <a href="http://www.eecis.udel.edu/%7emills/lab.html">UDel Internet Research Laboratory</a> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">13:06</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="298">Wednesday, August 10, 2005</csobj></p> + <br clear="left"> + <h4>Related Links</h4> + <script type="text/javascript" language="javascript" src="scripts/links10.txt"></script> + <h4>Pulse-Per-Second Interfacing Links</h4> + <p> + <script type="text/javascript" language="javascript" src="scripts/links11.txt"></script> + </p> + <h4>Audio Driver Links</h4> + <p> + <script type="text/javascript" language="javascript" src="scripts/links8.txt"></script> + </p> + <h4>Table of Contents</h4> + <ul> + <li class="inline"><a href="#clock">Reference Clock Drivers</a> + <li class="inline"><a href="#cal">Driver Calibration</a> + <li class="inline"><a href="#perf">Performance Enhancements</a> + <li class="inline"><a href="#list">Comprehensive List of Clock Drivers</a> + </ul> + <hr> + <h4 id="clock">Reference Clock Drivers</h4> + <p>Support for most of the commonly available radio and modem reference clocks is included in the default configuration of the NTP daemon for Unix <tt>ntpd</tt>. Individual clocks can be activated by configuration file commands, specifically the <tt>server</tt> and <tt>fudge</tt> commands described in the <a href="ntpd.html"><tt>ntpd</tt> program manual page</a>. The following discussion presents Information on how to select and configure the device drivers in a running Unix system.</p> + <p>Many radio reference clocks can be set to display local time as adjusted for timezone and daylight saving mode. For use with NTP the clock must be set for Coordinated Universal Time (UTC) only. Ordinarily, these adjustments are performed by the kernel, so the fact that the clock runs on UTC will be transparent to the user.</p> + <p>Radio and modem clocks by convention have addresses in the form 127.127.<i>t.u</i>, where <i>t</i> is the clock type and <i>u</i> is a unit number in the range 0-3 used to distinguish multiple instances of clocks of the same type. Most of these clocks require support in the form of a serial port or special bus peripheral, but some can work directly from the audio codec found in some workstations. The particular device is normally specified by adding a soft link <tt>/dev/device<i>u</i></tt> to the particular hardware device involved, where <i><tt>u</tt></i> correspond to the unit number above.</p> + <p>Most clock drivers communicate with the reference clock using a serial port, usually at 9600 bps. There are several application program interfaces (API) used in the various Unix and NT systems, most of which can be detected at configuration time. Thus, it is important that the NTP daemon and utilities be compiled on the target system or clone. In some cases special features are available, such as timestamping in the kernel or pulse-per-second (PPS) interface. In most cases these features can be detected at configuration time as well; however, the kernel may have to be recompiled in order for them to work.</p> + <p>The audio drivers are a special case. These include support for the NIST time/frequency stations WWV and WWVH, the Canadian time/frequency station CHU and generic IRIG signals. Currently, support for the Solaris and SunOS audio API is included in the distribution. It is left to the volunteer corps to extend this support to other systems. Further information on hookup, debugging and monitoring is given in the <a href="audio.html">Audio Drivers</a> page.</p> + <p>The local clock driver is also a special case. A server configured with this driver can operate as a primary server to synchronize other clients when no other external synchronization sources are available. If the server is connected directly or indirectly to the public Internet, there is some danger that it can adversely affect the operation of unrelated clients. Carefully read the <a href="drivers/driver1.html">Undisciplined Local Clock</a> page and respect the stratum limit.</p> + <p>The local clock driver also supports an external synchronization source such as a high resolution counter disciplined by a GPS receiver, for example. Further information is on the <a href="extern.html">External Clock Discipline and the Local Clock Driver</a> page.</p> + <h4 id="cal">Driver Calibration</h4> + <p>Some drivers depending on longwave and shortwave radio services need to know the radio propagation time from the transmitter to the receiver, which can amount to some tens of milliseconds. This must be calculated for each specific receiver location and requires the geographic coordinates of both the transmitter and receiver. The transmitter coordinates for various radio services are given in the <a href="http://www.eecis.udel.edu/%7emills/ntp/qth.html">Time and Frequency Standard Station Information</a> page. Receiver coordinates can be obtained or estimated from various sources. The actual calculations are beyond the scope of this document.</p> + <p>When more than one clock driver is supported, it is often the case that each shows small systematic offset differences relative to the rest. To reduce the effects of jitter when switching from one driver to the another, it is useful to calibrate the drivers to a common ensemble offset. The <tt>enable calibrate</tt> configuration command in the <a href="miscopt.html">Miscellaneous Options</a> page is useful for this purpose. The calibration function can also be enabled and disabled using the <tt>ntpdc</tt> program utility.</p> + <p>Most clock drivers use the <tt>time1</tt> value specified in the <tt>fudge</tt> configuration command to provide the calibration correction when this cannot be provided by the clock or interface. When the calibration function is enabled, the <tt>time1</tt> value is automatically adjusted to match the offset of the remote server or local clock driver selected for synchronization. Ordinarily, the NTP selection algorithm chooses the best from among all sources, usually the best radio clock determined on the basis of stratum, synchronization distance and jitter. The calibration function adjusts the <tt>time1</tt> values for all clock drivers except this source so that their indicated offsets tend to zero. If the selected source is the kernel PPS discipline, the <tt>fudge time1</tt> values for all clock drivers are adjusted.</p> + <p>The adjustment function is an exponential average designed to improve accuracy, so the function takes some time to converge. The recommended procedure is to enable the function, let it run for an hour or so, then edit the configuration file using the <tt>time1</tt> values displayed by the <tt>ntpq</tt> utility and <tt>clockvar</tt> command. Finally, disable the calibration function to avoid possible future disruptions due to misbehaving clocks or drivers.</p> + <h4 id="perf">Performance Enhancements</h4> + <p>In general, performance can be improved, especially when more than one clock driver is supported, to use the prefer peer function described in the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page. The prefer peer is ordinarily designated the remote peer or local clock driver which provides the best quality time. All other things equal, only the prefer peer source is used to discipline the system clock and jitter-producing "clockhopping" between sources is avoided. This is valuable when more than one clock driver is present and especially valuable when the PPS clock driver (type 22) is used. Support for PPS signals is summarized in the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page.</p> + <p>Where the highest performance is required, generally better than one millisecond, additional hardware and/or software functions may be required. Kernel modifications for precision time are described in the <a href="kern.html">A Kernel Model for Precision Timekeeping</a> page. Special line discipline and streams modules for use in capturing precision timestamps are described in the <a href="ldisc.html">Line Disciplines and Streams Drivers</a> page.</p> + <h4 id="list">Comprehensive List of Clock Drivers</h4> + <p>Following is a list showing the type and title of each driver currently implemented. The compile-time identifier for each is shown in parentheses. Click on a selected type for specific description and configuration documentation, including the clock address, reference ID, driver ID, device name and serial line speed, and features (line disciplines, etc.). For those drivers without specific documentation, please contact the author listed in the <a href="copyright.html">Copyright Notice</a> page.</p> + <ul> + <li class="inline"><a href="drivers/driver1.html">Type 1</a> Undisciplined Local Clock (<tt>LOCAL</tt>) + <li class="inline"><a href="drivers/driver2.html">Type 2</a> Trak 8820 GPS Receiver (<tt>GPS_TRAK</tt>) + <li class="inline"><a href="drivers/driver3.html">Type 3</a> PSTI/Traconex 1020 WWV/WWVH Receiver (<tt>WWV_PST</tt>) + <li class="inline"><a href="drivers/driver4.html">Type 4</a> Spectracom WWVB and GPS Receivers (<tt>WWVB_SPEC</tt>) + <li class="inline"><a href="drivers/driver5.html">Type 5</a> TrueTime GPS/GOES/OMEGA Receivers (<tt>TRUETIME</tt>) + <li class="inline"><a href="drivers/driver6.html">Type 6</a> IRIG Audio Decoder (<tt>IRIG_AUDIO</tt>) + <li class="inline"><a href="drivers/driver7.html">Type 7</a> Radio CHU Audio Demodulator/Decoder (<tt>CHU</tt>) + <li class="inline"><a href="drivers/driver8.html">Type 8</a> Generic Reference Driver (<tt>PARSE</tt>) + <li class="inline"><a href="drivers/driver9.html">Type 9</a> Magnavox MX4200 GPS Receiver (<tt>GPS_MX4200</tt>) + <li class="inline"><a href="drivers/driver10.html">Type 10</a> Austron 2200A/2201A GPS Receivers (<tt>GPS_AS2201</tt>) + <li class="inline"><a href="drivers/driver11.html">Type 11</a> Arbiter 1088A/B GPS Receiver (<tt>GPS_ARBITER</tt>) + <li class="inline"><a href="drivers/driver12.html">Type 12</a> KSI/Odetics TPRO/S IRIG Interface (<tt>IRIG_TPRO</tt>) + <li class="inline">Type 13 Leitch CSD 5300 Master Clock Controller (<tt>ATOM_LEITCH</tt>) + <li class="inline">Type 14 EES M201 MSF Receiver (<tt>MSF_EES</tt>) + <li class="inline">Type 15 reserved + <li class="inline"><a href="drivers/driver16.html">Type 16</a> Bancomm GPS/IRIG Receiver (<tt>GPS_BANCOMM</tt>) + <li class="inline">Type 17 Datum Precision Time System (<tt>GPS_DATUM</tt>) + <li class="inline"><a href="drivers/driver18.html">Type 18</a> Automated Computer Time Service (<tt>ACTS_MODEM</tt>) + <li class="inline"><a href="drivers/driver19.html">Type 19</a> Heath WWV/WWVH Receiver (<tt>WWV_HEATH</tt>) + <li class="inline"><a href="drivers/driver20.html">Type 20</a> Generic NMEA GPS Receiver (<tt>NMEA</tt>) + <li class="inline">Type 21 TrueTime GPS-VME Interface (<tt>GPS_VME</tt>) + <li class="inline"><a href="drivers/driver22.html">Type 22</a> PPS Clock Discipline (<tt>PPS</tt>) + <li class="inline">Type 23 reserved + <li class="inline">Type 24 reserved + <li class="inline">Type 25 reserved + <li class="inline"><a href="drivers/driver26.html">Type 26</a> Hewlett Packard 58503A GPS Receiver (<tt>GPS_HP</tt>) + <li class="inline"><a href="drivers/driver27.html">Type 27</a> Arcron MSF Receiver (<tt>MSF_ARCRON</tt>) + <li class="inline"><a href="drivers/driver28.html">Type 28</a> Shared Memory Driver (<tt>SHM</tt>) + <li class="inline"><a href="drivers/driver29.html">Type 29</a> Trimble Navigation Palisade GPS (<tt>GPS_PALISADE</tt>) + <li class="inline"><a href="drivers/driver30.html">Type 30</a> Motorola UT Oncore GPS <tt>GPS_ONCORE</tt>) + <li class="inline"><a href="drivers/driver31.html">Type 31</a> Rockwell Jupiter GPS (<tt>GPS_JUPITER</tt>) + <li class="inline"><a href="drivers/driver32.html">Type 32</a> Chrono-log K-series WWVB receiver (<tt>CHRONOLOG</tt>) + <li class="inline"><a href="drivers/driver33.html">Type 33</a> Dumb Clock (<tt>DUMBCLOCK</tt>) + <li class="inline"><a href="drivers/driver34.html">Type 34</a> Ultralink WWVB Receivers (<tt>ULINK</tt>) + <li class="inline"><a href="drivers/driver35.html">Type 35</a> Conrad Parallel Port Radio Clock (<tt>PCF</tt>) + <li class="inline"><a href="drivers/driver36.html">Type 36</a> Radio WWV/H Audio Demodulator/Decoder (<tt>WWV</tt>) + <li class="inline"><a href="drivers/driver37.html">Type 37</a> Forum Graphic GPS Dating station (<tt>FG</tt>) + <li class="inline"><a href="drivers/driver38.html">Type 38</a> hopf GPS/DCF77 6021/komp for Serial Line (<tt>HOPF_S</tt>) + <li class="inline"><a href="drivers/driver39.html">Type 39</a> hopf GPS/DCF77 6039 for PCI-Bus (<tt>HOPF_P</tt>) + <li class="inline"><a href="drivers/driver40.html">Type 40</a> JJY Receivers (<tt>JJY</tt>) + <li class="inline">Type 41 TrueTime 560 IRIG-B Decoder + <li class="inline"><a href="drivers/driver42.html">Type 42</a> Zyfer GPStarplus Receiver + <li class="inline"><a href="drivers/driver43.html">Type 43</a> RIPE NCC interface for Trimble Palisade + <li class="inline"><a href="drivers/driver44.html">Type 44</a> NeoClock4X - DCF77 / TDF serial line + </ul> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/release.html b/contrib/ntp/html/release.html new file mode 100644 index 0000000..b2f4d05 --- /dev/null +++ b/contrib/ntp/html/release.html @@ -0,0 +1,70 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>NTP Version 4 Release Notes</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>NTP Version 4 Release Notes</h3> + <img src="pic/hornraba.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>The rabbit toots to make sure you read this</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">19:17</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="270">Monday, October 10, 2005</csobj></p> + .<br clear="left"> + <hr> + <h4>NTP Version 4 Release Notes</h4> + <p>This release of the NTP Version 4 (NTPv4) daemon for Unix, VMS and Windows incorporates new features and refinements to the NTP Version 3 (NTPv3) algorithms. However, it continues the tradition of retaining backwards compatibility with older versions, including NTPv3 and NTPv2, but not NTPv1. Support for NTPv1 has been discontinued because of certain security vulnerabilities. The NTPv4 version has been under development for quite a while and isn't finished yet. In fact, quite a number of NTPv4 features have already been retrofitted in the older NTPv3, although this version is not actively maintained by the NTPv4 developer corps.</p> + <p>The code compiles and runs properly in all test host configurations available to the developer corps, including Sun Microsystems, Digital/Compaq, Hewlett Packard, FreeBSD and Linux. Other volunteers have verified it works in IRIX and Windows NT and XP. We invite comments and corrections about the various architectures, operating systems and hardware complement that can't be verified by the developer corps. Of particular interest are other Windows versions, VMS and various reference clock drivers. As always, corrections and bugfixes are warmly received, especially in the form of context diffs sent to <a href="mailto:bugs@ntp.org">bugs@ntp.org</a>.</p> + <p>This release has been compiled and tested on many systems, including SunOS 4.1.3, Solaris 2.5.1-2.10, Alpha Tru64 4.0-5.1, Ultrix 4.4, Linux 2.4.2, FreeBSD 4.5-5.3 and HP-UX 10.02. It has been compiled and tested by others on Windows NT4, 2000 and XP, but not yet on other Windows versions or for VMS. There are several new features apparently incompatible with Linux systems, including some modes used with the Autokey protocol. The developer corps looks for help elsewhere to resolve these differences.</p> + <p>This note summarizes the differences between this software release of NTPv4, called ntp-4.x.x, and the previous NTPv3 version, called xntp3-5.x.x. Additional information on protocol compatibility details is on the <a href="http://www.eecis.udel.edu/%7emills/biblio.html">Protocol Conformance Statement</a> page.</p> + <h4>New Features</h4> + <ol> + <li>Support for the IPv6 addressing family is included in this distribution. If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default support for the IPv4 address family. Combination IPv6 and IPv4 configurations have been successfully tested in all protocol modes supported by NTP and using both symmetric and public key (Autokey) cryptography. However, users should note that IPv6 support is new and we have not had a lot of experience with it in various operational scenarios and local infrastructure environments. As always, feedback is welcome. + <li>Most calculations are now done using 64-bit floating double format, rather than 64-bit fixed point format. The motivation for this is to reduce size, improve speed and avoid messy bounds checking. Workstations of today are much faster than when the original NTP version was designed in the early 1980s, and it is rare to find a processor architecture that does not support floating double. The fixed point format is still used with raw timestamps, in order to retain the full precision of about 212 picoseconds. However, the algorithms which process raw timestamps all produce fixed point differences before converting to floating double. The differences are ordinarily quite small so can be expressed without loss of accuracy in this format. + + <li>The clock discipline algorithm has been redesigned to improve accuracy, reduce the impact of network jitter and allow increased in poll intervals to well over one day with only moderate sacrifice in accuracy. + </ol> + <ul> + <ul> + <li>A new feature called <i>huffpuff</i> maximizes accuracy in cases of highly asymmetric network delays typical of ISDN and modem access circuits. + <li>The NTPv4 design allows clients to increase the poll intervals even when synchronized directly to the server. In NTPv3 the poll interval in such cases was clamped to the minimum, usually 64 s. For those servers with hundreds of clients, the new design can dramatically reduce the network load, especially when large numbers of potential clients, as in national laboratory services. + <li>A scheme designed to reduce "clockhopping" when the choice of servers changes frequently as the result of comparatively insignificant quality changes. + </ul> + </ul> + <ol> + <li>This release includes support for the <a href="ftp://ftp.udel.edu/usa/ftp/pub/ntp/software/"><i>nanokernel</i></a> precision time kernel support, which is now in stock FreeBSD and optional Linux kernels. If a precision time source such as a GPS timing receiver or cesium clock is available, kernel timekeeping can be improved to the order of one microsecond. The older <i>microtime</i> kernel for Digital/Compaq/HP Tru64, Digital Ultrix, as well as Sun Microsystems SunOS and Solaris, continues to be supported. + <li>This release includes support for Autokey public-key cryptography, which is the preferred scheme for authenticating servers to clients. Autokey Version 2 uses NTP header extension fields and protocols as described on the NTP project page linked from www.ntp.org. This release includes support for additional message digest and digital signature schemes supported by the OpenSSL software library, as well as new identity schemes based on cryptographic challenge/responce algorithms. The new design greatly simplifies key generation and distribution and provides orderly key refreshment. Security procedures and media formats are consistent with industry standard X.509 Version 3 certificates and authority procedures. Specific improvements to the protocol include a reduction in the number of messages required and a method to protect the cookie used in client/server mode against disclosure. Additional information about Autokey cryptography is contained in the <a href="authopt.html">Authentication Options</a> page and links from there. See also the new <tt>cryptostats</tt> monitoring statistics file in the <a href="monopt.html">Monitoring Options</a> page. + <li>This release includes support for a discrete event simulator (DES), which allows the NTP algorithms to be tested in an embedded environment with systematic and pseudorandom network delay and oscillator wander distributions. This has been used to verify correct operation under conditions of extreme error and misconfiguration. See the <a href="ntpdsim.html"><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</a> page. + <li>NTPv4 includes two new association modes which in most applications can avoid per-host configuration altogether. Both of these are based on IP multicast technology and Autokey cryptography. They provide automatic discovery, configuration and authentication of servers and clients without identifying servers or clients in advance. In multicast mode a server sends a message at fixed intervals using specified multicast group addresses, while clients listen on these addresses. + <p>Upon receiving the the first message, a client exchanges several messages with the server in order to calibrate the multicast propagation delay between the client and server and run the authentication protocol. In manycast mode a client sends a message to a specified multicast group address and expects one or more servers to reply. Using engineered algorithms, the client selects an appropriate subset of servers from the messages received and continues an ordinary client/server campaign. The manycast scheme can provide somewhat better accuracy than the multicast scheme at the price of additional network overhead. See the <a href="manyopt.html">Automatic NTP Configuration Options</a> page for further information.</p> + <li>This release includes support for the orphan mode, which replaces the local clock driver for most configurations. The local clock driver provides a synchronization source for networks not connected to the public Internet or reference clock driver. However, it does not opperate with multiple sources nor multiple failures. The orphan mode provides an automatic, subnet-wide synchronization feature with multiple sources. It can be used in isolated networks or in Internet subnets where the servers or Internet connection have failed. See the <a href="manyopt.html">Automatic NTP Configuration Options</a> page for further information.<li>This release includes support for preemptable servers, which are provisionally mobilized in manycast mode or by participants in the pool scheme. Manycast mode is described in these notes. In the pool scheme multiple client associations are mobilized for a designated DNS name such as pool.ntp.org. The DNS resolver randomizes replies over a set of volunteer service providers. The NTP mitigation algorithms select the best three from among the set and demobilizes the excess. See the <a href="manyopt.html">Automatic NTP Configuration Options</a> page for further information.<li>There are two burst mode features available where special conditions apply. One of these is enabled by the <tt>iburst</tt> keyword in the <tt>server</tt> configuration command. It is intended for cases where it is important to set the clock quickly when an association is first mobilized. The other is enabled by the <tt>burst</tt> keyword in the <tt>server</tt> configuration command. It is intended for cases where the network attachment requires an initial calling or training procedure. See the <a href="assoc.html">Association Management</a> page for further information. + <li>The reference clock driver interface is smaller, more rational and more accurate. Support for pulse-per-second (PPS) signals has been extended to all drivers as an intrinsic function. Most of the drivers in NTPv3 have been converted to the NTPv4 interface and continue to operate as before. New drivers have been added for several GPS receivers now on the market for a total of 44 drivers. Audio drivers for the Canadian standard time and frequency station CHU, the US standard time and frequency stations WWV/H and for IRIG signals have been updated and capabilities added to allow direct connection of these signals to a Sun or FreeBSD audio port. See the <a href="audio.html">Reference Clock Audio Drivers</a> page for further information. + <li>In all except a very few cases, all timing intervals are randomized, so that the tendency for NTPv3 to self-synchronize and bunch messages, especially with a large number of configured associations, is minimized. + <li>In NTPv3 a large number of weeds and useless code had grown over the years since the original NTPv1 code was implemented almost twenty years ago. Using a powerful weedwacker, much of the shrubbery has been removed, with effect a substantial reduction in size of almost 40 percent. + <li>The entire distribution has been converted to gnu <tt>automake</tt>, which should greatly ease the task of porting to new and different programming environments, as well as reduce the incidence of bugs due to improper handling of idiosyncratic kernel functions. Version control is provided by <tt>Bitkeeper</tt> using an online repository at www.ntp.org. + <li>Several new options have been added for the <tt>ntpd</tt> command line. For the inveterate knob twiddlers several of the more important performance variables can be changed to fit actual or perceived special conditions. In particular, the tos command can be used to limit the accepted stratum range, specify minimum dispersion increment and maximum selection theshold, and activate orphan mode. + <li>The <tt>ntpd</tt> daemon can be operated in a one-time mode similar to <tt>ntpdate</tt>, which program is headed for retirement. See the <a href="ntpd.html"><tt>ntpd</tt> - Network Time Protocol (NTP) daemon</a> page for the new features. + </ol> + <h4>Nasty Surprises</h4> + <p>There are a few things different about this release that have changed since the latest NTP Version 3 release. Following are a few things to worry about:</p> + <ol> + <li>When both IPv4 and IPv6 address families are in use, the host's resolver library may not choose the intended address family if a server has an IPv4 and IPv6 address associated with the same DNS name. The solution is to use the IPv4 or IPv6 address directly in such cases or use another DNS name that resolves to the intended address family. Older versions of <tt>ntpdc</tt> will only show the IPv4 associations with the <tt>peers</tt> and other simular commands. Older versions of <tt>ntpq</tt> will show 0.0.0.0 for IPv6 associations with the <tt>peers</tt> and other simular commands. + <li>There is a minor change to the reference ID field of the NTP packet header when operating with IPv6 associations. In IPv4 associations this field contains the 32-bit IPv4 address of the server, in order to detect and avoid loops. In IPv6 associations this field contains the first 32-bits of a MD5 hash formed from the address (IPv4 or IPv6) each of the configured associations. Normally, this detail would not be of concern; however, the <tt>ntptrace</tt> program originally depended on that field in order to display a server traceback to the primary reference source. This program has now been replaced by a script that does the same function, but does not depend on the reference ID field. The <tt>ntpdc</tt> utility now uses a special version number to communicate with the <tt>ntpd</tt> server. The server uses this version number to select which address family to used in reply packets. The <tt>ntpdc</tt> program falls back to the older version behavior when communicating with older NTP versions. + <li>As required by Defense Trade Regulations (DTR), the cryptographic routines supporting the Data Encryption Standard (DES) have been removed from the base distribution of NTPv3. For NTPv4 a new interface has been implemented for the OpenSSL cryptographic library, which is widely available on the web at www.openssl.org. This library replaces the library formerly available from RSA Laboratories. Besides being somewhat faster and more widely available, the OpenSSL library supports many additional cryptographic algorithms, which are now selectable at run time. Directions for using OpenSSL are in the <a href="build/build.html">Building and Installing the Distribution</a> page. + <li>As the result of the above, the <tt>./authstuff</tt> directory, intended as a development and testing aid for porting cryptographic routines to exotic architectures, has been removed. Testing and conformance validation tools are in the OpenSSL software distrbution. + <li>The NTPv4 enable and disable commands have a few changes in the arguments. See the <tt>ntpd</tt> <a href="miscopt.html">Miscellaneous Options</a> page for details. Note that the <tt>authenticate</tt> command has been removed. + <li>To help reduce the level of spurious network traffic due to obsolete configuration files, a special control message called the <i>kiss-o'-death</i> packet has been implemented. If enabled and a packet is denied service or exceeds the client limits, a compliant server will send this message to the client. A compliant client will cease further transmission and send a message to the system log. See the <a href="accopt.html">Authentication Options</a> page for further information. + <li>The <tt>tty_clk</tt> and <tt>ppsclock</tt> pulse-per-second (PPS) line discipline/streams modules are no longer supported. The PPS function is now handled by the <a href="drivers/driver22.html">PPS Clock Discipline</a> driver, which uses the new PPSAPI application program interface adopted by the IETF. Note that the <tt>pps</tt> configuration file command has been obsoleted by the driver. See the <a href="pps.html">Pulse-per-second (PPS) Signal Interfacing</a> page for further information. + <li>Support for the NTPv1 symmetric mode has been discontinued, since it hasn't worked for years. Support continues for the NTPv1 client mode, which is used in some SNTP clients. + <li>The precision time support in stock Solaris 2.6 has bugs that were fixed in 2.7. A patch is available that fixes the 2.6 bugs. The 2.6 PPS kernel discipline has been disabled by default. For testing, the kernel can be enabled using the <tt>enable kernel</tt> command either in the configuration file or via <tt>ntpdc</tt>. + <li>The HTML documentation has been partially updated. However, most of the NTPv3 documentation continues to apply to NTPv4. Until a comprehensive update happens, what you see is what you get. We are always happy to accept comments, corrections and bug reports. However, we are most thrilled upon receipt of patches to fix the dang bugs. <b>Please send bug reports to <a href="mailto:bugs@ntp.org">bugs@ntp.org</a>, not the individual members on the team</b>. + </ol> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/footer.txt b/contrib/ntp/html/scripts/footer.txt new file mode 100644 index 0000000..7fc6dd8 --- /dev/null +++ b/contrib/ntp/html/scripts/footer.txt @@ -0,0 +1,7 @@ +document.write("\
+<table><tr>\
+<td width='50%' ><img src='icons/home.gif' align='middle' alt='gif'>\
+<a href='index.html'>Home Page</a></td>\
+<td width='50%' ><img src='icons/mail2.gif' align='middle' alt='gif'>\
+<a href='http://www.ntp.org/contact.html'>Contacts</a></i></td>\ +</tr></table>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links10.txt b/contrib/ntp/html/scripts/links10.txt new file mode 100644 index 0000000..880e379 --- /dev/null +++ b/contrib/ntp/html/scripts/links10.txt @@ -0,0 +1,5 @@ +document.write("<ul>\
+<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\
+<li class='inline'><a href='prefer.html'>Mitigation Rules and the <tt>prefer</tt> Keyword</a><br>\
+<li class='inline'><a href='howto.html'>How to Write a Reference Clock Driver</a><br>\
+</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links11.txt b/contrib/ntp/html/scripts/links11.txt new file mode 100644 index 0000000..59e7017 --- /dev/null +++ b/contrib/ntp/html/scripts/links11.txt @@ -0,0 +1,7 @@ +document.write("<ul>\
+<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\
+<li class='inline'><a href='pps.html'>Pulse-per-second (PPS) Signal Interfacing</a><br>\
+<li class='inline'><a href='ldisc.html'>Line Disciplines and Streams Modules</a><br>\
+<li class='inline'><a href='kernpps.html'>PPSAPI Interface for Precision Time Signals</a><br>\ +<li class='inline'><a href='gadget.html'>Gadget Box PPS Level Converter and CHU Modem</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links12.txt b/contrib/ntp/html/scripts/links12.txt new file mode 100644 index 0000000..7ca9249 --- /dev/null +++ b/contrib/ntp/html/scripts/links12.txt @@ -0,0 +1,5 @@ +document.write("<ul>\
+<li class='inline'><a href='debug.html'>NTP Debugging Techniques</a><br>\
+<li class='inline'><a href='rdebug.html'>Debugging Reference Clock Drivers</a><br>\
+<li class='inline'><a href='msyslog.html'><tt>ntpd</tt> System Log Messages</a><br>\
+</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links7.txt b/contrib/ntp/html/scripts/links7.txt new file mode 100644 index 0000000..0d33473 --- /dev/null +++ b/contrib/ntp/html/scripts/links7.txt @@ -0,0 +1,6 @@ +document.write("<ul>\
+<li class='inline'><a href='confopt.html'>Server Options</a><br>\
+<li class='inline'><a href='authopt.html'>Authentication Options</a><br>\
+<li class='inline'><a href='monopt.html'>Monitoring Options</a><br>\
+<li class='inline'><a href='ntp_conf.html'>Configuration File Definition (Advanced)</a><br>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links8.txt b/contrib/ntp/html/scripts/links8.txt new file mode 100644 index 0000000..135310c --- /dev/null +++ b/contrib/ntp/html/scripts/links8.txt @@ -0,0 +1,6 @@ +document.write("<ul>\
+<li class='inline'><a href='refclock.html'>Reference Clock Drivers</a><br>\
+<li class='inline'><a href='drivers/driver7.html'>Radio CHU Audio Demodulator/Decoder</a><br>\ +<li class='inline'><a href='drivers/driver36.html'>Radio WWV/H Audio Demodulator/Decoder</a><br>\ +<li class='inline'><a href='drivers/driver6.html'>IRIG Audio Decoder</a>\ +</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/links9.txt b/contrib/ntp/html/scripts/links9.txt new file mode 100644 index 0000000..6ea32f0 --- /dev/null +++ b/contrib/ntp/html/scripts/links9.txt @@ -0,0 +1,8 @@ +document.write("<ul>\
+<li class='inline'><a href='authopt.html'>Authentication Options</a><br>\
+<li class='inline'><a href='manyopt.html'>Automatic NTP Configuration Options</a><br>\
+<li class='inline'><a href='confopt.html'>Server Options</a><br>\
+<li class='inline'><a href='groups.html'>Trusted Hosts and Groups</a><br>\ +<li class='inline'><a href='keygen.html'><tt>ntp-keygen</tt> - generate public and private keys</a>\ +<li class='inline'><a href='http://www.eecis.udel.edu/~mills/autokey.html'>Autonomous Authentication</a>\
+</ul>")
\ No newline at end of file diff --git a/contrib/ntp/html/scripts/style.css b/contrib/ntp/html/scripts/style.css new file mode 100644 index 0000000..7d7b276 --- /dev/null +++ b/contrib/ntp/html/scripts/style.css @@ -0,0 +1,64 @@ +body {background: #FDF1E1;
+ color: #006600;
+ font-family: "verdana", sans-serif; + text-align: justify;
+ margin-left: 5px;}
+
+p, h4, hr, li {margin-top: .6em; margin-bottom: .6em}
+li.inline {text-align: left; margin-top: 0; margin-bottom: 0}
+
+ul, dl, ol, {margin-top: .6em; margin-bottom: .6em; margin-left 5em}
+
+dt {margin-top: .6em}
+dd {margin-bottom: .6em}
+
+div.header {text-align: center;
+ font-style: italic;}
+
+div.footer {text-align: center;
+ font-size: 60%;}
+
+img.cell {align: left;}
+
+td.sidebar {width: 40px; align: center; valign: top;}
+img.sidebar {align: center; margin-top: 5px;}
+h4.sidebar {align: center;}
+
+p.top {background: #FDF1E1;
+ color: #006600;
+ position: absolute;
+ margin-left: -90px;
+ text-align: center;}
+
+a:link.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:visited.sidebar {background: transparent;
+ color: #990033;
+ font-weight: bold;}
+
+a:hover.sidebar {background: #FDF1E1;
+ color: #006600;}
+
+img {margin: 5px;}
+
+div {text-align: center;}
+
+h1 {text-align: center;
+ font-size: 250%;}
+
+caption {background: #EEEEEE;
+ color: #339999;}
+
+tx {text-align: center;}
+
+th {background: #FFFFCC;
+ color: #006600;
+ text-align: center;
+ text-decoration: underline;
+ padding-top: 5px;}
+
+th.caption {background: #EEEEEE;
+ color: #006600;
+ text-align: center;}
\ No newline at end of file diff --git a/contrib/ntp/html/sntp.html b/contrib/ntp/html/sntp.html new file mode 100644 index 0000000..839271e --- /dev/null +++ b/contrib/ntp/html/sntp.html @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <title>Simple Network Time Protocol (SNTP) Client</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3>Simple Network Time Protocol (SNTP) Client</h3> + <img src="pic/dogsnake.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>Alice's Adventures in Wonderland</i>, Lewis Carroll</a> + <p>S is for snakeoil</p> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:50</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <br clear="left"> + <hr> + <h4>Synopsis</h4> + <tt>sntp [{-h --help -?}][{ -v -V -W }][{-r -a}][-P <i>prompt</i>][-e <i>minerr</i>][-E <i>maxerr</i>][-c <i>count</i>][-d <i>delay</i>][address(es)]</tt> + <h4>Description</h4> + <p>This program is a Simple Network Time Protocol (SNTP) client that can be used to query a Network TIme Protocol (NTP) server and display the time offset of the system clock relative to the server clock. Run as root it can correct the system clock to this offset as well. It can be run as an interactive command or from a script by a <tt>cron</tt> job. The program implements the SNTP protocol defined in RFC-2030, which is a subset of the NTP protocol defined in RFC-1305, but does not provide the sanity checks, access controls, security functions and mitigation algorithms as in the full NTP implementation.</p> + <p>While this program can do other things, including operation as a primitive server, some of these things are truly dangerous in a ubiquitous public time server network. A full disclosure is in the man page in the <tt>./sntp</tt> directory, but be truly advised RFC-2030 specifically <b>forbids</b> a SNTP client to operate as a server for other NTP or SNTP clients. If such operation is contemplated, do <b>not</b> allow access by clients on the public Internet.</p> + <p>By default, <tt>sntp</tt> writes the local date and time (i.e., not UTC) to the standard output in the format</p> + <p><tt>1996 Oct 15 20:17:25.123 + 4.567 +/- 0.089 secs</tt>,</p> + <p>where the <tt>+ 4.567 +/- 0.089 secs</tt> indicates the time offset and error bound of the system clock relative to the server clock.</p> + <p>If a NTP server <i>address</i> is explicitly specified, the program sends a single message to the server and waits up to <i>delay</i> seconds for a unicast server message. Otherwise, it sends no message and waits up to <i>delay</i> seconds for a broadcast server message.</p> + <h4>Options</h4> + <p><tt>sntp</tt> recognizes the following options:</p> + <dl> + <dt><tt>-h, --help</tt> + <dd>displays usage information. + <dt><tt>-v</tt> + <dd>writes diagnostic messages and a limited amount of tracing to standard error. The <tt>-v, -V</tt> and <tt>-W</tt> give increasing levels of detail. + <dt><tt>-r</tt> + <dd>steps the system clock to the correct time by the Unix <tt>settimeofday</tt> system call. Requires root priviledge. + <dt><tt>-a</tt> + <dd>slews the system clock to the correct time by the Unix <tt>adjtime</tt> system call. Requires root priviledge. + <dt><tt>-e <i>minerr</i></tt> + <dd>sets the minimum offset to <tt><i>minerr</i></tt> seconds. Measured offsets less than this are ignored. Acceptable values are from 0.001 to 1 with default 0.1 if unicast mode and 0.5 for broadcast mode. + <dt><tt>-E <i>maxerr</i></tt> + <dd>sets the maximum offset to <tt><i>maxerr</i></tt> seconds. Measured offsets greater than this are ignored. Acceptable values are from 1 to 60 with default 5. + <dt><tt>-P <i>prompt</i></tt> + <dd>sets the maximum automatic offset to <tt><i>maxerr</i></tt> seconds. Acceptable values are from 1 to 3600 or <tt>no</tt>, with default 30. If the program is being run interactively, measured offsets greater than this will prompt the user for confirmation. Specifying <tt>no</tt> will disable this and the correction will be made regardless. + <dt><tt>-c <i>count</i></tt> + <dd>sets the maximum number of NTP packets required to <i>count</i>. Acceptable values are from 1 to 25 in unicast mode and 5 to 25 in broadcast mode. The default is 5 in either mode. + <dt><tt>-d <i>delay</i></tt> + <dd>sets the maximum waiting time in broadcast mode to <i>delay</i> seconds. Acceptable values are from 1 to 3600, with default 15 in unicast mode and 300 in broadcast mode. + </dl> + <h4>Return Value</h4> + <p>The program returns an exit status of zero for success and non-zero otherwise.</p> + <h4>Author</h4> + <p><tt>sntp</tt> was developed by N.M. Maclaren of the University of Cambridge Computing Service.</p> + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file diff --git a/contrib/ntp/html/tickadj.html b/contrib/ntp/html/tickadj.html new file mode 100644 index 0000000..14559ed --- /dev/null +++ b/contrib/ntp/html/tickadj.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + +<html> + + <head> + <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> + <meta name="generator" content="HTML Tidy, see www.w3.org"> + <title>tickadj - set time-related kernel variables</title> + <link href="scripts/style.css" type="text/css" rel="stylesheet"> + </head> + + <body> + <h3><tt>tickadj</tt> - set time-related kernel variables</h3> + <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">18:50</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="246">Thursday, July 28, 2005</csobj></p> + <hr> + <h4>Synopsis</h4> + <tt>tickadj [ -Aqs ] [ -a <i>tickadj</i> ] [ -t <i>tick</i> ]</tt> + <h4>Description</h4> + <p>The <tt>tickadj</tt> program reads, and optionally modifies, several timekeeping-related variables in older kernels that do not have support for precision ttimekeeping, including HP-UX, SunOS, Ultrix, SGI and probably others. Those machines provide means to patch the kernel <tt>/dev/kmem</tt>. Newer machines with precision time support, including Solaris, Tru64, FreeBSD and Linux (with PPSkit patch) should NOT use the program. The particular variables that can be changed with <tt>tickadj</tt> include <tt>tick</tt>, which is the number of microseconds added to the system time for a clock interrupt, <tt>tickadj</tt>, which sets the slew rate and resolution used by the <tt>adjtime</tt> system call, and <tt>dosynctodr</tt>, which indicates to the kernels on some machines whether they should internally adjust the system clock to keep it in line with time-of-day clock or not.</p> + <p>By default, with no arguments, <tt>tickadj</tt> reads the variables of interest in the kernel and displays them. At the same time, it determines an "optimal" value for the value of the <tt>tickadj</tt> variable if the intent is to run the <tt>ntpd</tt> Network Time Protocol (NTP) daemon, and prints this as well. Since the operation of <tt>tickadj</tt> when reading the kernel mimics the operation of similar parts of the <tt>ntpd</tt> program fairly closely, this can be useful when debugging problems with <tt>ntpd</tt>.</p> + <p>Note that <tt>tickadj</tt> should be run with some caution when being used for the first time on different types of machines. The operations which <tt>tickadj</tt> tries to perform are not guaranteed to work on all Unix machines and may in rare cases cause the kernel to crash.</p> + <h4>Command Line Options</h4> + <dl> + <dt><tt>-a <i>tickadj</i></tt> + <dd>Set the kernel variable <tt>tickadj</tt> to the value <i><tt>tickadj</tt></i>specified. + <dt><tt>-A</tt> + <dd>Set the kernel variable <tt>tickadj</tt> to an internally computed "optimal" value. + <dt><tt>-t <i>tick</i></tt> + <dd>Set the kernel variable <tt>tick</tt> to the value <i><tt>tick</tt></i> specified. + <dt><tt>-s</tt> + <dd>Set the kernel variable <tt>dosynctodr</tt> to zero, which disables the hardware time-of-year clock, a prerequisite for running the <tt>ntpd</tt> daemon under SunOS4. + <dt><tt>-q</tt> + <dd>Normally, <tt>tickadj</tt> is quite verbose about what it is doing. The <tt>-q</tt> flag tells it to shut up about everything except errors. + </dl> + <h4>Files</h4> + <pre> +/vmunix + +/unix + +/dev/kmem +</pre> + <h4>Bugs</h4> + Fiddling with kernel variables at run time as a part of ordinary operations is a hideous practice which is only necessary to make up for deficiencies in the implementation of <tt>adjtime</tt> in many kernels and/or brokenness of the system clock in some vendors' kernels. It would be much better if the kernels were fixed and the <tt>tickadj</tt> program went away. + <hr> + <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> + </body> + +</html>
\ No newline at end of file |