From: Harlan Stenn The skunk watches for intruders and sprays. Last update: Last update: 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. Clients can be denied service because they are explicitly included in the restrict list created by the restrict 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. 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 noserve or notrust flag of the matching restrict list entry is set, the code is "DENY"; if the limited flag is set and the rate limit is exceeded, the code is "RATE". Finally, if a cryptographic violation occurs, the code is "CRYP". 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. An example may clarify how it works. Our campus has two class-B networks, 128.4 for the ECE and CIS deparements and 128.175 for the rest of campus. Subnet 128.4.1 homes critical services like class rosters and spread sheets. A suitable ACL might be While this facility may be useful for keeping unwanted, 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. Our resident cryptographer; now you see him, now you don't. Last update: Last update: This page describes the various cryptographic authentication provisions in NTPv4. Details about the configuration commands and options are given on the Configuration Options page. Details about the cryptographic authentication schemes are given on the Authentication Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page. Authentication support allows the NTP client to verify that servers are in fact known and trusted and not intruders intending accidentally or intentionally to masquerade as a legitimate server. The NTPv3 specification RFC-1305 defines a scheme using the Data Encryption Standard (DES) algorithm, commonly called DES-CBC. Subsequently, this scheme was replaced by the RSA Message Digest 5 (MD5) algorithm, commonly called keyed-MD5. Either algorithm computes a message digest or one-way hash which can be used to verify the client has the same key as the server. NTPv4 includes the NTPv3 scheme, properly described as symmetric key cryptography and, in addition a new scheme based on public key cryptography and called Autokey. Public key cryptography is generally considered more secure than symmetric key cryptography, since the security is based on private and public values which are generated by each participant and where the private value is never revealed. Autokey uses X.509 public certificates, which can be produced by commercial services, utility programs in the OpenSSL software library or a utility program in the NTP software distribution. While the algorithms for symmetric key cryptography are included in the NTPv4 software distribution, Autokey cryptography requires the OpenSSL software library to be installed before building the NTP distribution. This library is available from http://www.openssl.org and can be installed using the procedures outlined in the Building and Installing the Distribution page. Once installed, the configure and build process automatically detects the library and links the library routines required. Authentication is configured separately for each association separately using the key or autokey option on the peer, server, broadcast or manycastclient configuration commands, as described in the Server Options page, and the options described on this page. The ntp-keygen page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from www.ntp.org. Authentication is configured separately for each association using the key or autokey option of the server command, as described in the Server Options page, and the options described on this page. The ntp-keygen page describes the files required for the various authentication schemes. Further details are in the briefings, papers and reports at the NTP project page linked from www.ntp.org. Keys and related information are specified in a keys file, usually called ntp.keys, 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 ntpq and ntpdc utility programs. Ordinarily, the ntp.keys file is generated by the ntp-keygen program, but it can be constructed using an ordinary text editor. When ntpd is first started, it reads the key file specified by the keys configuration command and installs the keys in the key cache. However, individual keys must be activated with the trustedkey command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using ntpdc. The requestkey command selects the key ID used as the password for the ntpdc utility, while the controlkey command selects the key ID used as the password for the ntpq utility. When ntpd is first started, it reads the key file specified by the keys command and installs the keys in the key cache. However, individual keys must be activated with the trustedkey command before use. This allows, for instance, the installation of possibly several batches of keys and then activating a key remotely using ntpdc. The requestkey command selects the key ID used as the password for the ntpdc utility, while the controlkey command selects the key ID used as the password for the ntpq utility. NTPv4 supports the Autokey security protocol, which is based on public key cryptography. The Autokey Version 2 protocol described on the Autokey Protocol page verifies packet integrity using MD5 message digests and verifies the source using digital signatures and any of several digest/signature schemes. Optional identity schemes described on the Autokey Identity Schemes page are based on cryptographic challenge/response exchanges. Using these schemes provides strong security against replay with or without modification, spoofing, masquerade and most forms of clogging attacks. These schemes are described along with an executive summary, current status, briefing slides and reading list on the Autonomous Authentication page. NTPv4 supports the Autokey security protocol, which is based on public key cryptography. The Autokey Version 2 protocol described on the Autokey Protocol page verifies packet integrity using MD5 message digests and verifies the source using digital signatures and any of several digest/signature schemes. Optional identity schemes described on the Autokey Identity Schemes page are based on cryptographic challenge/response exchanges. These schemes provide strong security against replay with or without message modification, spoofing, masquerade and most forms of clogging attacks. These schemes are described along with an executive summary, current status, briefing slides and reading list on the Autonomous Authentication page. Autokey authenticates individual packets using cookies bound to the IP source and destination addresses. The cookies must have the same addresses 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. There are three timeouts associated with the Autokey scheme. The key list timeout, which defaults to about 1.1 h, specifies the interval between generating new key lists. The revoke timeout, which defaults to about 36 h, specifies the interval between generating new private values. The restart timeout, with default about 5 d, specifies the interval between protocol restarts to refresh public values. In general, the behavior when these timeouts expire is not affected by the issues discussed on this page. NTP secure groups are used to define cryptographic compartments and security hierarchies. All hosts belonging to a secure group have the same group name but different host names. The string specified in the host option of the crypto command is the name of the host and in the name of the host key, sign key and certificate files. The string specified in the ident option of the crypto comand is the group name of all group hosts and in the name of the identity files. The file naming conventions are described on the ntp-keygen page. Each group includes one or more trusted hosts (THs) operating at the root, or lowest stratum in the group. The group name is used in the subject and issuer fields of the TH trusted certificate. The host name is used in these fields for hosts other than THs. NTP secure groups are used to define cryptographic compartments and security hierarchies. All hosts belonging to a secure group have the same group name but different host names. The string specified in the host option of the crypto command is the name of the host and the name of the host key, sign key and certificate files. The string specified in the ident option of the crypto comand is the group name of all group hosts and the name of the identity files. The file naming conventions are described on the ntp-keygen page. Each group includes one or more trusted hosts (THs) operating at the root, or lowest stratum in the group. The group name is used in the subject and issuer fields of the TH trusted certificate. The host name is used in these fields for all other hosts. All group hosts are configured to provide an unbroken path, called a certificate trail, from each host, possibly via intermediate hosts and ending at a TH. When a host starts up, it recursively retrieves the certificates along the trail in order to verify group membership and avoid masquerade and middleman attacks. Secure groups can be configured as hierarchies where a TH of one group can be a client of one or more other groups operating at a lower stratum. In one scenario, groups RED and GREEN can be cryptographically distinct, but both be clients of group BLUE operating at a lower stratum. In another scenario, group CYAN can be a client of multiple groups YELLOW and MAGENTA, both operating at a lower stratum. There are many other scenarios, but all must be configured to include only acyclic certificate trails. All configurations include a public/private host key pair and matching certificate. Absent an identity scheme, this is a Trusted Certificate (TC) scheme. There are three identity schemes, IFF, GQ and MV described on the Identity Schemes page. With these schemes all servers in the group have encrypted server identity keys, while clients have nonencrypted client identity parameters. The client parameters can be obtained from a trusted agent (TA), usually one of the THs of the lower stratum group. Further information on identity schemes is on the Autokey Identity Schemes page. All configurations include a public/private host key pair and matching certificate. Absent an identity scheme, this is a Trusted Certificate (TC) scheme. There are three identity schemes, IFF, GQ and MV described on the Identity Schemes page. With these schemes all servers in the group have encrypted server identity keys, while clients have nonencrypted client identity parameters. The client parameters can be obtained from a trusted agent (TA), usually one of the THs of the lower stratum group. Further information on identity schemes is on the Autokey Identity Schemes page. A specific combination of authentication and identity schemes is called a cryptotype, which applies to clients and servers separately. A group can be configured using more than one cryptotype combination, although not all combinations are interoperable. Note however that some cryptotype combinations may successfully interoperate with each other, but may not represent good security practice. The server and client cryptotypes are defined by the the following codes. * These combinations are not valid if the restriction list includes the notrust option. Autokey has an intimidating number of configuration options, most of which are not necessary in typical scenarios. The simplest scenario consists of a secure group with one TH at the lowest stratum. For the simplest identity scheme TC, the TH generates host key and trusted certificate files using the ntp-keygen -T command, while the remaining group hosts use the same command with no options. All hosts use the crypto configuration command with no options. Configuration with passwords is described in the ntp-keygen page When an identity scheme is included, for example IFF, the TH generates host key, trusted certificate and private identity keys files using the ntp-keygen -T -I -i group command, where group is the group name. The remaining group hosts use the same command with no options. All hosts use the crypto ident group configuration command. Hosts with no dependent clients can retrieve public identity parameters from an archive or web page. The ntp-keygen can export these data using the -e option. Hosts with dependent clients other than the TH must retrieve copies of the TH private identity keys using secure means. The ntp-keygen can export these data using the -q option. In either case the data are installed as a file and then renamed using the name given as the first line in the file, but without the filestamp. Autokey has an intimidating number of configuration options, most of which are not necessary in typical scenarios. The simplest scenario consists of an unnamed secure group with one TH at the lowest stratum. For the simplest identity scheme TC, the TH generates host key and trusted certificate files using the ntp-keygen -T command, while the remaining group hosts use the same command with no options to generate the host key and public certificate files. All hosts use the crypto configuration command with no options. Configuration with passwords is described in the ntp-keygen page When an identity scheme is included, for example IFF, the TH generates host key, trusted certificate and private server identity files using the ntp-keygen -T -I -i group command, where group is the group name. The reemaining group hosts use the same command as above. The client identity files are obtained separately. All hosts use the crypto ident group configuration command. Hosts with no dependent clients can retrieve client files from an archive or web page. The ntp-keygen can export these data using the -e option. Hosts with dependent clients other than the TH must retrieve copies of the server files using secure means. The ntp-keygen can export these data using the -q option. In either case the data are installed as a file and then renamed using the name given as the first line in the file, but without the filestamp. Consider a scenario involving three secure groups RED, GREEN and BLUE. RED and BLUE are typical of national laboratories providing certified time to the Internet at large. TH mort of RED and TH macabre of BLUE run NTP symmetric mode with each other for monitoring or backup. GREEN is typical of a large university providing certified time to the campus community. TH howland of GREEN is a client of both RED and BLUE. BLUE uses the IFF scheme, while both RED and GREEN use the GQ scheme, but with different keys. BLUE TH macabre uses configuration commands crypto pw yyy ident green where yyy is the password for mort files. It generates GREEN files using the commands where yyy is the password for howland files. It generates GREEN files using the commands ntp-keygen -p yyy -T -G -i greenAccess Control Options
from Pogo, Walt Kelly
Related Links
+
Table of Contents
Access Control Support
- The ntpd 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.
- The Kiss-of-Death Packet
-
+restrict default nopeer # deny new association
+restrict 128.175.0.0 255.255.0.0 # allow campus access
+restrict 128.4.0.0 255.255.0.0 none # allow ECE and CIS access
+restrict 128.4.1.0 255.255.255.0 notrust # require auth
+restrict time.nist.gov # allow access
+
+Access Control Commands
-
-
+
+
+
+
Authentication Options
from Alice's Adventures in Wonderland, Lewis Carroll
Related Links
+
Table of Contents
-
- Authentication Support
+ Introduction
+ Symmetric Key Cryptography
The original RFC-1305 specification allows any one of possibly 65,534 keys (excluding zero), each distinguished by a 32-bit key ID, to authenticate an association. The servers and clients involved must agree on the key and key ID to authenticate NTP packets. If an NTP packet includes a message authentication code (MAC), consisting of a key ID and message digest, it is accepted only if the key ID matches a trusted key and the message digest is verified with this key.
Public Key Cryptography
- NTP Secure Groups
- Identity Schemes and Cryptotypes
-
Configuration
- Examples
server mort autokey
server macabre autokey
ntp-keygen -p yyy -e >ntpkey_gqpar_green
- ntp-keygen -p yyy -v zzz >zzz_ntpkey_gqkey_green
The first two lines serve the same purpose as the preceeding examples. The third line generats a copy of the private GREEN server file for use on another server in the same group, but encrypted with the zzz pasword.
-Each TH in a group acting as a client of another group retrieves the public client file for that group from a public archive or web page using nonsecure means. In addition, each server in a group retrieves the private server file from the TH of that group, but it is encrypted and so can be sent using nonsecured means. The files are installed in the keys directory with name taken from the first line in the file, but without the filestamp
+A client of GREEN, for example, uses the configuration commands
+crypto pw abc ident green
+ server howland autokey
where abc is the password for its files. It generates files using the command
+ntp-keygen -p abc
+The client retrieves the client file for that group from a public archive or web page using nonsecure means. In addition, each server in a group retrieves the private server file from the TH of that group, but it is encrypted and so can be sent using nonsecured means. The files are installed in the keys directory with name taken from the first line in the file, but without the filestamp.
+In another example mort and macabre are operated as broadcast servers and howland as a broadcast client. Replace the server configuration command for both mort and macabre with the two commands
+broadcast ipaddr autokey
+ broadcastclient
where ipaddr is the broadast address, and replace the two server commands for howland with the single command
+broadcastclient
+Note that if servers of different groups, in this case RED and BLUE, share the same broadcast media, each server must have client files for all groups other than its own, while each client must have client files for all groups.
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 ntp-keygen program.
diff --git a/html/bugs.html b/html/bugs.html index ac7e3e224..8251590c5 100644 --- a/html/bugs.html +++ b/html/bugs.html @@ -13,14 +13,14 @@
from Alice's Adventures in Wonderland, Lewis Carroll
The rabbit toots to make sure you read this.
-Last update:
Last update:
If you find or suspect a security related program bug in this distribution, please send a report to security@ntp.org. Please do not contact developers directly.
If you find or suspect a non-security related program bug in this distribution, please send a report to the NTP Public Service Project Bug Tracking System (Bugzilla) at http://bugs.ntp.org/. Bugs reported this way are immediately forwarded to the developers. Please do not contact the developers directly.
-If you find or suspect an error in the program documention pages, please send a report directly to the editor David Mills at mills@udel.edu. The master documentation pages are not controlled by the bug tracking system. You are invited to contribute new or revised pages in similar style and DOS format.
+If you find or suspect an error in the program documention pages, please send a report directly to the editor David Mills at mills@udel.edu. The master documentation pages are not controlled by the bug tracking system. You are invited to contribute new or revised pages in similar style and format.
If you wish to send a report via electronic mail, please remember that your report will be held until one of our volunteers enters it in Bugzilla. The email address for these reports is bugs@ntp.org. You will need to register at http://bugs.ntp.org/ so that you may participate directly in any e-mail discussion regarding your report.
from Pogo, Walt Kelly
For putting out compiler fires.
-Last update:
Last update:
It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types ./configure, make and install in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the Hints and Kinks pages.
-If available, the OpenSSL library from http://www.openssl.org 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 libcrypto.a library file and openssl header files are needed. If the library is not available or disabled, this step is not required.
-The Configuration Options page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.
+It is not possible in a software distribution such as this to support every individual computer and operating system with a common executable, even with the same system but different versions and options. Therefore, it is necessary to configure, build and install for each system and version. In almost all cases, these procedures are completely automatic, The user types ./configure, make and install in that order and the autoconfigure system does the rest. There are some exceptions, as noted below and on the Hints and Kinks pages.
+If available, the OpenSSL library from http://www.openssl.org is used to support public key cryptography. The library must be built and installed prior to building NTP. The procedures for doing that are included in the OpenSSL documentation. The library is found during the normal NTP configure phase and the interface routines compiled automatically. Only the libcrypto.a library file and openssl header files are needed. If the library is not available or disabled, this step is not required.
+The Build Options page describes a number of options that determine whether debug support is included, whether and which reference clock drivers are included and the locations of the executables and library files, if not the default. By default debugging options and all reference clock drivers are included.
This distribution uses common compilers and tools that come with most Unix distributions. 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 gcc compiler included as freeware in some products. For a successful build, all of these tools should be accessible via the current path.
-The first thing to do is uncompress the distribution and extract the source tree. In the distribution base directory use the ./configure command to perform an automatic configuration procedure. This command inspects the hardware and software environment and configures the build process accordingly. Use the make command to compile and link the distribution and the install command to install the executables by default in /usr/local/bin.
-If your site supports multiple architectures and uses NFS to share files, you can use a single source tree to build executables for multiple architectures. While running on a particular architecture, change to the base directory and create a subdirectory using a command like mkdir A.machine which will create an architecture-specific directory, then change to this directory and mumble ../configure. The remaining steps are the same whether building in the base directory or in the subdirectory.
+This distribution uses common compilers and tools that come with most Unix distributions. 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 gcc compiler included as freeware in some systems. For a successful build, all of these tools should be accessible via the current path.
+The first thing to do is uncompress the distribution and extract the source tree. In the distribution base directory use the ./configure command to perform an automatic configuration procedure. This command inspects the hardware and software environment and configures the build process accordingly. Use the make command to compile and link the distribution and the install command to install the executables by default in /usr/local/bin.
+If your site supports multiple architectures and uses NFS to share files, you can use a single source tree to build executables for multiple architectures. While running on a particular architecture, change to the base directory and create a subdirectory using a command like mkdir A.machine, which will create an architecture-specific directory, then change to this directory and mumble ../configure. The remaining steps are the same whether building in the base directory or in the subdirectory.
NTP supports Windows Vista, XP, NT4 and 2000 systems. See hints/winnt.htm for directions to compile the sources and install the executables. A precompiled executable is available.
+NTP supports Windows Vista, XP, NT4 and 2000 systems. See the NTP 4.x for Windows NT page for directions to compile the sources and install the executables. A precompiled executable is available.
You are now ready to configure the daemon. You will need to create a NTP configuration file by default in n/etc/ntp.conf. Newbies should see the Quick Start page for orientation. Seasoned veterans can start with the ntpd - Network Time Protocol (NTP) daemon page and move on to the specific configuration option pages from there.
+You are now ready to configure the daemon. You will need to create a NTP configuration file by default in /etc/ntp.conf. Newbies should see the Quick Start page for orientation. Seasoned veterans can start with the ntpd - Network Time Protocol (NTP) daemon page and move on to the specific configuration option pages from there.
If you have problems with your hardware and software environment (e.g. operating system-specific issues), browse the Hints and Kinks pages. For other problems a tutorial on debugging technique is in the NTP Debugging Technique page. A list of important system log messages is on the ntpd System Log Messages page.
The first line of general assistance is the NTP web site www.ntp.org and the helpful documents 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.
diff --git a/html/clockopt.html b/html/clockopt.html index e18d35cde..475082d9f 100644 --- a/html/clockopt.html +++ b/html/clockopt.html @@ -11,13 +11,13 @@
- See the radios, all in a row.
-Last update:
Master Time Facility at the UDel Internet Research Laboratory
+ Last update:
The stratum number of a reference clock is by default zero. Since the ntpd 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 stratum 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 refid option is used for this purpose. Except where noted, these options apply to all clock drivers.
from Alice's Adventures in Wonderland, Lewis Carrol
+ The Mad Hatter says "Bring it on".
+Last update:
from Pogo, Walt Kelly
Gnu autoconfigure tools are in the backpack.
-Last update:
Last update:
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.
Configuration options are specified as arguments to the configure script. Following is a summary of the current options, as of the 4.0.99m version:
Usage: configure [options] [host]
diff --git a/html/confopt.html b/html/confopt.html
index 847f9008c..437e96865 100644
--- a/html/confopt.html
+++ b/html/confopt.html
@@ -13,10 +13,11 @@
from Pogo, Walt Kelly
The chicken is getting configuration advice.
-Last update:
Last update:
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 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 -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.
"Clone me," says Dolly sheepishly
- Last update:
"Clone me," says Dolly sheepishly.Last update:
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.
diff --git a/html/debug.html b/html/debug.html index 94119c841..d6d959a1a 100644 --- a/html/debug.html +++ b/html/debug.html @@ -13,133 +13,32 @@
from Pogo, Walt Kelly
We make house calls and bring our own bugs.
-Last update:
Last update:
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 ntpd - Network Time Protocol (NTP) daemon page are required. Once started, the daemon will begin sending and receiving messages, as specified in the configuration file.
When started for the first time, the frequency file, usually called ntp.drift, 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 ntp.drift file. When restarted after that, the daemon reads the frequency offset from the ntp.drift file and avoids the training routine.
-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 iburst configuration option.
-The best way to verify correct operation is using the ntpq - standard NTP query program and ntpdc - special NTP query program utility programs, either on the server itself or from another machine elsewhere in the network. The ntpq program implements the management functions specified in the NTP specification RFC-1305, Appendix A. The ntpdc 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 ntpdc, additional ones intended for serious debugging. In addition, the ntpdc program can be used to selectively reconfigure and enable or disable some functions while the daemon is running.
-In extreme cases with elusive bugs, the daemon can operate in two modes, depending on the presence of the -d command-line debug switch. If not present, the daemon detaches from the controlling terminal and proceeds autonomously. If one or more -d 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 -d 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 grep and specifying the keyword of the trace you want to see.
-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 /etc/services file (or equivalent in some systems). Note that NTP does not use TCP in any form. Also note that NTP requires 123 for both source and destination ports. These facts should be pointed out to firewall administrators.
-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.
-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 ping command. The Unix traceroute or Windows tracert 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.
-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 date command, or by the ntpdate or ntpd -q commands. The panic threshold can be changed by the tinker panic command discribed on the Miscellaneous Options page. The panic threshold can be disabled for the first measurement by the -g command line option described on the ntpd - Network Time Protocol (NTP) daemon page.
-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 -x command line option described on the ntpd 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 tinker step command discribed on the Miscellaneous Options 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 NTP Timescale and Leap Seconds 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.
-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 tinker stepout command discribed on the Miscellaneous Options page.
-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 ntp.drift file. If the frequency error is over 500 PPM, convergence will never occur and occasional step adjustments will occur indefinitely.
+This page discusses ntpd program monitoring and debugging techniques using the ntpq - standard NTP query program, either on the local server or from a remote machine. In special circumstances the ntpdc - special NTP query program, can be useful, but its use is not covered here. The ntpq program implements the management functions specified in the NTP specification RFC-1305, Appendix A. It is used to read and write the variables defined in the NTP Version 4 specification now navigating the standards process. In addition, the program can be used to send remote configuration commands to the server.
+The ntpd daemon can operate in two modes, depending on the presence of the -d command-line option. Without the option the daemon detaches from the controlling terminal and proceeds autonomously. With one or more -d options the daemon does not detach and generates special trace output useful for debugging. In general, interpretation of this output requires reference to the sources. However, a single -d does produce only mildly cryptic output and can be very useful in finding problems with configuration and network troubles.
+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 /etc/services file (or equivalent in some systems). Note that NTP does not use TCP in any form. Also note that NTP requires port 123 for both source and destination ports. These facts should be pointed out to firewall administrators.
+Other problems are apparent in the system log, which ordinarily shows the startup banner, some cryptic initialization data and the computed precision value. Event messages at startup and during regular operation are sent to the optional protostats monitor file, as described on the Event Messages and Status Words page. These and other error messages are sent to the system log, as described on the ntpd System Log Messages page. In real emergencies the daemon will sent a terminal error message to the system log and then cease operation.
+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 ping command. The Unix traceroute or Windows tracert 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.
After starting the daemon, run the ntpq program using the -n switch, which will avoid possible distractions due to name resolution problems. Use the pe 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:
--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 --
The host names or addresses shown in the remote 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 refid column shows the current source of synchronization, while the st column reveals the stratum, t the type (u = unicast, m = multicast, l = local, - = don't know), and poll the poll interval in seconds. The when column shows the time since the peer was last heard in seconds, while the reach 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 dispersion column has been replaced by the jitter column.
-As per the NTP specification RFC-1305, when the stratum is between 0 and 15 for a NTP server, the refid field shows the server DNS name or, if not found, the IP address in dotted-quad. When the stratum 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 stratum for a NTP server is 0 (appears as 16 in the billboards), the status cannot be determined. As a help in debugging, the refid field is set to a four-character string called the kiss code. The current kiss codes are as as follows.
-Peer Kiss Codes
-ACST
-System Kiss Codes
-The tattletale symbol at the left margin displays the synchronization status of each peer. The currently selected peer is marked *, while additional peers designated acceptable for synchronization are marked +. Peers marked * and + 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 ntpq page for the meaning of these symbols.
-Additional details for each peer separately can be determined by the following procedure. First, use the as command to display an index of association identifiers, such as
--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 --
Each line in this billboard is associated with the corresponding line in the pe billboard above. The assID shows the unique identifier for each mobilized association, while the status column shows the peer status word in hex, as defined in the NTP specification. Next, use the rv command and the respective assID identifier to display a detailed synopsis for the selected peer, such as
--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 --
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 ntpq 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.
-A useful indicator of miscellaneous problems is the flash 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 ntpq page.
-The three lines identified as filtdelay, filtoffset and filtdisp 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.
-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.
-The state of the local clock itself can be determined using the rv command (without the argument), such as
--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" --
An explanation about most of these variables is in the RFC-1305 specification. The most useful ones include clock, which shows when the clock was last adjusted, and reftime, which shows when the server clock of refid was last adjusted. The version, processor and system values are very helpful when included in bug reports. The mean millisecond time offset (phase) and deviation (jitter) monitor the clock quality, while the mean PPM frequency offset (frequency) and deviation (stability) 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.
-Among the new variables added for NTP Version 4 are the hostname, signature, flags, hostkey, refresh and cert, which are used for the Autokey public-key cryptography described on the Authentication Options 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.
-When nothing seems to happen in the pe 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 Access Control Options page. Another common problem is that the server is down or running in unsynchronized mode due to a local problem. Use the ntpq program to spy on the server variables in the same way you can spy on your own.
-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.
+Unless using the iburst option, the client normally takes a few minutes to synchronize to a server. If the client time at startup happens to be more thatn 1000 s distant from NTP time, the daemon exits with a message to the system log directing the operator to manually set the time within 1000 s and restart. If the time is less than 1000 s but more than 128 s distant, a step correction occurs and the daemon restarts automatically.
+When started for the first time and a frequency file is not present, the daemon enters a special mode in order to calibrate the frequency. This takes 900 s during which the time is not desciplined. When calibration is complete, the daemon creates the frequency file and enters normal mode to amortize whatever residual offset remains.
+The ntpq commands pe, as and rv are normally sufficient to verify correct operation and assess nominal performace. The pe command displays a list showing the DNS name or IP address for each association along with selected status and statistics variables. The first character in each line is the tally code, which shows which associations are candidates to set the system clock and of these which one is the system peer. The encoding is shown in the source field of the system status word.
+The as command displays a list of associations and association identifiers. Note the condition column, which reflects the tally code. The rv command displays the system variables billboard, including the system status word. The rv assocID command, where assocID is the association ID, displays the peer variables billboard, including the peer status word. Note that, except for explicit calendar dates, times are in milliseconds and frequencies are in parts-per-million (PPM).
+A detailed explanation of the system, peer and clock variables in the billboards is beyond the scope of this page; however, a comprehensive explanation for each one is in the NTPv4 protocol specification. The following observations will be useful in debugging and monitoring.
+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 ntp.drift 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.
-In order to determine if excessive frequency error is a problem, observe the nominal filtoffset 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 tickadj utility and the -s command line argument. For other systems this can be done using a command in the system startup file.
-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 tickadj utility and the -t command line argument. Note that the tickadj alters certain kernel variables and, while the utility attempts to figure out an acceptable way to do this, there are many cases where tickadj is incompatible with a running kernel.
+The frequency tolerance of computer clock oscillators varies widely, sometimes above 500 PPM. While the daemon can handle frequency errors up to 500 PPM, or 43 seconds per day, values much above 100 PPM reduce the headroom, especially at the lowest poll intervals. To determine the particular oscillator frequency, start ntpd using the noselect option with the server configuration command.
+Record the time of day and offset displayed by the ntpq pe command. Wait for an hour or so and record the time of day and offset. Calculate the frequency as the offset difference divided by the time difference. If the frequency is much above 100 PPM, the tickadj program might be useful to adjust the kernel clock frequency below that value. For systems that do not support this program, this might be one using a command in the system startup file.
Provisions are included in ntpd for access controls which deflect unwanted traffic from selected hosts or networks. The controls described on the Access Control Options 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.
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 Access Control Options page for further informatin.
@@ -159,7 +58,7 @@ cert="whimsy.udel.edu whimsy.udel.edu 0x5 3233682156"
from Alice's Adventures in Wonderland, Lewis Carroll
+ Caterpillar knows all the error codes, which is more than most of us do.
+Last update:
This page lists the status and event messages and error codes used for status reporting and monitoring. Status words are used to display the current status of the running program. There is one system status word and a peer status word for each association. There is a clock status word for each association that supports a reference clock driver. There is a flash code for each association which shows errors found in the last packet received (pkt) and during protocol processing (peer). These are commonly viewed using the ntpq program.
+Sinificant changes in program state are reported as events. There is one set of system events and a set of peer events for each association. In adition, there is a set of clock events for each association that supports a reference clock driver. Events are normally reported to the protostats file and optionally to the system log. In addition, if the trap facility is configured, traps can be reported to a remote program that can page an administrator.
+This page also includes a description of the error messages produced by the Autokey protocol. These messages are normally sent to the cryptostats file.
+In the following tables the Code Field is the status or event code assigned and the Message Field a short string used for display and event reporting. The Description field contains a longer explanation of the status or event. Some messages include additional information useful for error diagnosis and performance assessment.
+The system status word consists of four fields LI (0-1), Source (2-7), Count (8-11) and Code (12-15). It is reported in the first line of the ntpd rv display.
+|
+ Leap
+ |
+
+
+ Source
+ |
+
+
+ Count
+ |
+
+
+ Code
+ |
+
The Leap Field displays the system leap indicator bits coded as follows:
+| Code | +Message | +Description | +
| 0 | +leap_none | +normal synchronized state | +
| 1 | +leap_add_sec | +insert second after 23:59:59 of the current day | +
| 2 | +leap_del_sec | +delete second 23:59:59 of the current day | +
| 3 | +leap_alarm | +never synchronized | +
The Source Field displays the current synchronization source coded as follows:.
+| Code | +Message | +Description | +
| 0 | +sync_unspec | +not yet synchronized | +
| 1 | +sync_pps | +pulse-per-second signal (Cs, Ru, GPS, etc.) | +
| 2 | +sync_lf_radio | +VLF/LF radio (WWVB, DCF77, etc.) | +
| 3 | +sync_hf_radio | +MF/HF radio (WWV, etc.) | +
| 4 | +sync_uhf_radio | +VHF/UHF radio/satellite (GPS, Galileo, etc.) | +
| 5 | +sync_local | +local timecode (IRIG, LOCAL driver, etc.) | +
| 6 | +sync_ntp | +NTP | +
| 7 | +sync_other | +other (IEEE 1588, openntp, crony, etc.) | +
| 8 | +sync_wristwatch | +eyeball and wristwatch | +
| 9 | +sync_telephone | +telephone modem (ACTS, PTB, etc.) | +
The Count Field displays the number of events since the last rv command while the Event Field displays the most recent event message coded as follows:
+| Code | +Message | +Description | +
| 0 | +unspecified | +unspecified | +
| 1 | +freq_not_set | +frequency file not available | +
| 2 | +freq_set | +frequency set from frequency file | +
| 3 | +spike_detect | +spike detected | +
| 4 | +freq_mode | +initial frequency training mode | +
| 5 | +clock_sync | +clock synchronized | +
| 6 | +restart | +program restart | +
| 7 | +panic_stop | +clock error more than 600 s | +
| 8 | +no_system_peer | +no system peer | +
| 9 | +leap_armed | +leap second armed from file or Autokey | +
| 10 | +leap_disarmed | +leap second disarmed | +
| 11 | +leap_event | +leap event | +
| 12 | +clock_step | +clock stepped | +
| 13 | +kern | +kernel information message | +
The peer status word consists of four fields: Status (0-4, Select (5-7), Count (8-11) and Code (12-15). It is reported in the first line of the ntpd rv associd display.
+|
+
+ Status
+ |
+
+ Select
+ |
+
+
+ Count
+ |
+
+
+ Code
+ |
+
The Status Field displays the peer status code bits in hexadecimal as follows:
+| Code | +Message | +Description | +
| 08 | +bcst | +broadcast association | +
| 10 | +reach | +host reachable | +
| 20 | +authenb | +authentication enabled | +
| 40 | +auth | +authentication ok | +
| 80 | +config | +persistent association | +
| Code | +Message | +T | +Description | +
| 0 | +sel_reject | ++ | discarded as not valid (TEST10-TEST13) | +
| 1 | +sel_falsetick | +x | +discarded by intersection algorithm | +
| 2 | +sel_excess | +. | +discarded by table overflow (not used) | +
| 3 | +sel_outlyer | +- | +discarded by the cluster algorithm | +
| 4 | +sel_candidate | ++ | +included by the combine algorithm | +
| 5 | +sel_backup | +# | +backup (more than tinker maxclock sources) | +
| 6 | +sel_sys.peer | +* | +system peer | +
| 7 | +sel_pps.peer | +o | +PPS peer (when the prefer peer is valid) | +
The Count Field displays the number of events since the last rv command, while the Event Field displays the most recent event message coded as follows:
+| Code | +Message | +Description | +
| 1 | +mobilize | +association mobilized | +
| 2 | +demobilize | +association demobilized | +
| 3 | +unreachable | +server unreachable | +
| 4 | +reachable | +server reachable | +
| 5 | +restart | +association restart | +
| 6 | +no_reply | +no server found (ntpdate mode) | +
| 7 | +rate_exceeded | +rate exceeded (kiss code RATE) | +
| 8 | +access_denied | +access denied (kiss code DENY) | +
| 9 | +leap_armed | +leap armed from server LI code | +
| 10 | +sys_peer | +new system peer | +
| 11 | +clock | +reference clock message (see clock status word) | +
The clock status word consists of four fields: Unused (0-7), Count (8-11) and Code (12-15). It is reported in the first line of the ntpd clockvar associd display.
+|
+
+ Unused
+ |
+
+
+ Count
+ |
+
+
+ Code
+ |
+
The Count Field displays the number of events since the last clockvar command, while the Event Field displays the most recent event message coded as follows:
+| Code | +Message | +Description | +
| 0 | +clk_unspe | +nominal | +
| 1 | +clk_noreply | +no reply to poll | +
| 2 | +clk_badformat | +bad timecode format | +
| 3 | +clk_fault | +hardware or software fault | +
| 4 | +clk_bad_signal | +signal loss | +
| 5 | +clk_bad_date | +bad date format | +
| 6 | +clk_bad_time | +bad time format | +
When the clock driver sets the code to a new value, a clock_alarm (11) peer event is reported.
+The flash status word is displayed by the ntpq program rv command. It consists of a number of bits coded in hexadecimal as follows:
+| Code | +Tag | +Message | +Description | +
| 0001 | +TEST1 | +pkt_dup | +duplicate packet | +
| 0002 | +TEST2 | +pkt_bogus | +bogus packet | +
| 0004 | +TEST3 | +pkt_unsync | +protocol unsynchronized | +
| 0008 | +TEST4 | +pkt_denied | +access denied | +
| 0010 | +TEST5 | +pkt_auth | +bad authentication | +
| 0020 | +TEST6 | +pkt_stratum | +bad synch or stratum | +
| 0040 | +TEST7 | +pkt_header | +bad header | +
| 0080 | +TEST8 | +pkt_autokey | +bad autokey | +
| 0100 | +TEST9 | +pkt_crypto | +bad crypto | +
| 0200 | +TEST10 | +peer_stratum | +peer bad synch or stratum | +
| 0400 | +TEST11 | +peer_dist | +peer distance exceeded | +
| 0800 | +TEST12 | +peer_loop | +peer synchronization loop | +
| 1000 | +TEST13 | +peer_unreach | +peer unreachable | +
| Code | +Description | +
| ACST | +manycast server | +
| AUTH | +authentication error | +
| AUTO | +Autokey sequence error | +
| BCST | +broadcast server | +
| CRYPT | +Autokey protocol error | +
| DENY | +access denied by server | +
| INIT | +association initialized | +
| MCST | +multicast server | +
| RATE | +rate exceeded | +
| TIME | +association timeout | +
| STEP | +step time change | +
These messages are sent to the cryptostats file when an error is detected in the Autokey protocol.
+| Code | +Message | +Description | +
| 1 | +bad_format | +bad extension field format or length | +
| 2 | +bad_timestamp | +bad timestamp | +
| 3 | +bad_filestamp | +bad filestamp | +
| 4 | +bad_public_key | +bad or missing public key | +
| 5 | +bad_digest | +unsupported digest type | +
| 6 | +bad_identity | +unsupported identity type | +
| 7 | +bad_siglength | +bad signature length | +
| 8 | +bad signature | +extension field signature not verified | +
| 9 | +cert_not_verified | +certificate signature not verified | +
| 10 | +cert_expired | +host certificate expired | +
| 11 | +bad_cookie | +bad or missing cookie | +
| 12 | +bad_leapseconds | +bad or misssing leapseconds values | +
| 13 | +cert_missing | +bad or missing certificate | +
| 14 | +bad_group_key | +bad or missing group key | +
| 15 | +proto_error | +protocol error | +
from Alice's Adventures in Wonderland, Lewis Carroll
Alice holds the key.
-Last update:
Last update:
The NTP 4 distribution runs as service on Windows Vista, 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. A ready-to-run install distribution is available from Meinberg at http://www.meinberg.de/english/sw/ntp.htm
-With this release ntp-keygen is supported. See the ntp keygen documentation for details on how to use ntp-keygen.
+The NTP 4 distribution runs as service on Windows Vista, 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. A ready-to-run install distribution is available from Meinberg at http://www.meinberg.de/english/sw/ntp.htm.
+Users should note that the stock Windows client sends requests as mode-1 packets, which can have unintended consequences and create a security risk. The client should send requests as mode-3 (client) packets, which conform to the protocol specification. The issues and resolution are described in Microsoft KB 875424. A less desirable alternative that avoids changing registry keys is to use the --with-wintime option when building the executable.
+With this release ntp-keygen is supported. See the ntp keygen documentation for details on how to use ntp-keygen.
ntpd can now use the generated keys in the same way as on Unix platforms. Please refer to the Authentication Options for details on how to use these.
NOTE: 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 file 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.
diff --git a/html/index.html b/html/index.html index 23a6b5337..5d64cbd69 100644 --- a/html/index.html +++ b/html/index.html @@ -13,11 +13,12 @@
P.T. Bridgeport Bear; from Pogo, Walt Kelly
Pleased to meet you.
-Last update:
Last update:
Note: These pages are being updated and may appear a little scruffy for awhile.
The most important factor in providing accurate, reliable time is the selection of modes and servers in the configuration file. A discussion on the available modes is on the Association Management page. The current public server list is maintained at the www.ntp.org web site. In many cases the configuration can be automated using the schemes described on the Automatic Server Discovery Schemes page.
This distribution includes a statistics data recording facility which can record performance statistics and events of various types for retrospective analysis. These include time and frequency statistics, significant events and usage statistics described on the Monitoring Options page.
-Some programs included in this distribution use cryptographic algorithms to verify server authenticity. Where local security policy permits relatively weak symmetric key cryptography, the required software is included in this distribution. Where local policy requires stronger public key cryptography, the OpenSSL library available from http://www.openssl.org is required. This library is also used by the Secure Shell facility, so is often already installed. NTP public key cryptography is described on the Authentication Options page.
+Some programs included in this distribution use cryptographic algorithms to verify server authenticity. Where local security policy permits relatively weak symmetric key cryptography, the required software is included in this distribution. Where local policy requires stronger public key cryptography, the OpenSSL library available from http://www.openssl.org is required. This library is also used by the Secure Shell facility, so is often already installed. Additional details are on the Authentication Options page.
This distribution includes features that can restrict access in various ways as described on the Access Control Options page. This can be used to deny service if not authenticated, deny service requiring persistent resources or deny service altogether.
This distribution includes a simulation framework in which substantially all the runtime NTP operations and most features can be tested and evaluated. This has been very useful in exploring invitro response to unusal circumstances or over time periods impractical invivo. Details are on the Network Time Protocol (NTP) Simulator page.
The NTP Debugging Techniques and Hints and Kinks pages contain useful information for identifying problems and devising solutions. Additional information on reference clock driver construction and debugging is in the Debugging Hints for Reference Clock Drivers page.
Users are invited to report bugs and offer suggestions via the NTP Bug Reporting Procedures page.
The Site Map page contains a list of document collections arranged by topic. The Program Manual Pages collection may be the best place to start, followed by the Configuration Commands and Options collection. A great wealth of additional information is available via the External Links collection, including a book and numerous background papers and briefing presentations.
+The Site Map page contains a list of document collections arranged by topic. The Program Manual Pages collection may be the best place to start, followed by the Configuration Commands and Options collection. The Command Index collection contains a list of all configuration file commands together with a short function description. A great wealth of additional information is available via the External Links collection, including a book and numerous background papers and briefing presentations.

Alice touched the kernel and it exploded.
-Last update:
Alice finds the kernel a house of cards.
+Last update:
from NBS Special Publication 432, 1979 (out of print)
+ Last update:
diff --git a/html/manyopt.html b/html/manyopt.html index 31373e7bc..a7d577d04 100644 --- a/html/manyopt.html +++ b/html/manyopt.html @@ -5,15 +5,15 @@
-
from Alice's Adventures in Wonderland, Lewis Carroll
Make sure who your friends are.
-Last update:
Last update:
This page describes the automatic server discovery schemes provided in NTPv4. Details about the configuration commands and options are described on the Configuration Options page. Details about the cryptographic authentication schemes are described on the Authentication Options page. Details about the other modes not directly involved in these schemes are described on the Association Management page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.
-There are three automatic server discovery schemes: broadcast/multicast, manycast and server pool described on this page. The broadcast/multicast and manycast schemes utilize the ubiquitous broadcast or one-to-many paradigm native to IPv4 and IPv6. The server pool scheme uses DNS to resolve addresses of multiple volunteer servers scattered throughout the world. All three schemes work in much the same way and might be described as grab-n'-drop. Through one means or another they grab at least the number of potential servers specified by the tos maxclock configuration command, order them from best to worst using the NTP algorithms, then cast off from the end of the list until no more than the number of survivors specified in the tos minclock command remain.
-This process is handled using a set of counters, one for each preemptible association. Once each poll interval the counter is increased by one. It the counter reaches a cutoff value of 10, it is preempted and demobilized. However, the counters for the survivors at the beginning of the list are set to zero.
-Any of the schemes can use a stratum filter to select just those servers with stratum considered useful. This can avoid large numbers of clients ganging up on a small number of low-stratum servers and avoid servers above a certain stratum level. The range of acceptable strata range from the number specified by the tos floor command, inclusive, to the number specified by the tos ceiling command, exclusive. Potential servers operating at the same stratum as the client will be avoided unless the tos cohort command is present.
- -Since an intruder can impersonate a broadcast or multicast server and inject false time values, broadcast mode should always be cryptographically authenticated.
+There are three automatic server discovery schemes: broadcast/multicast, manycast and server pool described on this page. The broadcast/multicast and manycast schemes utilize the ubiquitous broadcast or one-to-many paradigm native to IPv4 and IPv6. The server pool scheme uses DNS to resolve addresses of multiple volunteer servers scattered throughout the world. All three schemes work in much the same way and might be described as grab-n'-prune. Through one means or another they grab a number of associations either directly or indirectly from the configuration file, order them from best to worst according to a defined metric, then cast off the associations with the lowest metric until no more than the number specified by the maxclock option of the tos command remain.
+All schemes use a stratum filter to select just those servers with stratum considered useful. This can avoid large numbers of clients ganging up on a small number of low-stratum servers and avoid servers below or above specified stratum levels. By default, servers of all strata are acceptable; however, the tos command can be used to restrict the acceptable range from the floor option, inclusive, to the ceiling option, exclusive. Potential servers operating at the same stratum as the client will be avoided, unless the cohort option is present.
+The pruning process is handled using a set of counters, one for each preemptible association. Once each poll interval the counter is increased by one. If the association survives the selection and clustering algorithms; that is, it is a candidate for synchronization, the counter is reset to zero. If not and the counter reaches a defined threshold and the number of assocations is greater than maxclock, the association becomes a candidate for pruning. The pruning algorithm assigns to each association a metric ranging from the lowest, corresponding to no possibility of synchronization, to the highest, corresponding to a very likely possibility of synchronization. Upon reaching the threshold, an association is demobilized if it has the lowest metric of all associations. Operation continues in this way until the number of remaining associations is not greater than maxclock.
Following is a summary of each scheme. Note that reference to option applies to the commands described on the Configuration Options page. See that page for applicability and defaults.
A broadcast server generates messages continuously at intervals by default 64 s and time-to-live by default 127. These defaults can be overriden by the minpoll and ttl options, respectively. Not all kernels support the ttl command. A broadcast client responds to the first message received by waiting a randomized interval to avoid implosion at the server. It then polls the server in client/server mode and using the iburst opion in order to quickly authenticate the server, set the host clock and calibrate the broadcast message propagation delay. This normally results in a volley of six client/server exchanges at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently.
-Following the volley, the server continues in listen-only mode and sends no further messages. If for some reason the broadcast server does not respond to these messages, the client will cease transmission and continue in listen-only mode with a default propagation delay. The volley can be avoided by using the authdelay configuration command with nonzero argument.
+A broadcast server generates messages continuously at intervals by default 64 s and time-to-live by default 127. These defaults can be overriden by the minpoll and ttl options, respectively. Not all kernels support the ttl option. A broadcast client responds to the first message received by waiting a randomized interval to avoid implosion at the server. It then polls the server in client/server mode using the iburst option in order to quickly authenticate the server, calibrate the propagation delay and set the host clock. This normally results in a volley of six client/server exchanges at 2-s intervals during which both the synchronization and cryptographic protocols run concurrently.
+Following the volley, the server continues in listen-only mode and sends no further messages. If for some reason the broadcast server does not respond to these messages, the client will cease transmission and continue in listen-only mode with a default propagation delay. The volley can be avoided by using the authdelay command with nonzero argument.
A server is configured in broadcast mode using the broadcast command and specifying the broadcast address of a local interface. If two or more local interfaces are installed with different broadcast addresses, a broadcast command is needed for each address. This provides a way to limit exposure in a firewall, for example. A broadcast client is configured using the broadcastclient command.
-NTP multicast mode can be used to extend the scope of a timekeeping using IPv4 multicast or IPv6 broadcast with defined span. The IANA has assigned IPv4 multicast address 224.0.1.1 and IPv6 address 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.
-A multicast server is configured using the broadcast command, but specifying a multicast address instead of a broadcast address. A multicast client is configured using the multicastclient command specifying a list of one or more multicast addresses. Note that there is a subtle distinction between the IPv4 and IPv6 address families. The IPv4 broadcast or mulitcast mode is determined by the IPv4 class. For IPv6 the same distinction can be made using the link-local prefix FF02 for each interface and site-local prefix FF05 for all interfacesl.
-In both broadcast and multicast versions the client association is demobilized in case of timeout.
+NTP multicast mode can be used to extend the scope using IPv4 multicast or IPv6 broadcast with defined span. The IANA has assigned IPv4 multicast address 224.0.1.1 and IPv6 address 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.
+A multicast server is configured using the broadcast command, but specifying a multicast address instead of a broadcast address. A multicast client is configured using the multicastclient command specifying a list of one or more multicast addresses. Note that there is a subtle distinction between the IPv4 and IPv6 address families. The IPv4 broadcast or mulitcast mode is determined by the IPv4 class. For IPv6 the same distinction can be made using the link-local prefix FF02 for each interface and site-local prefix FF05 for all interfaces.
+It is possible and frequently useful to configure a host as both broadcast client and broadcast server. A number of hosts configured this way and sharing a common broadcast address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.
+Since an intruder can impersonate a broadcast server and inject false time values, broadcast mode should always be cryptographically authenticated. By default, a broadcast association will not be mobilized unless cryptographically authenticated. If necessary, the auth option of the disable command will disable this feature. The feature can be selectively enabled using the notrust option of the restrict command.
+With symmetric key cryptography each broadcast server can use the same or different keys. In one scenario on a broadcast LAN, a set of broadcast clients and servers share the same key along with another set that share a different key. Only the clients with matching key will respond to a server broadcast.
+Public key cryptography can be used with some restrictions. If multiple servers belonging to different secure groups share the same broadcast LAN, the clients on that LAN must have the client keys for all of them. This scenario is illustrated in the example on the Authentication Options page.
Manycast is a automatic server 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. It uses the grab-n'-drop paradigm with the additional feature that active means are used to grab additional servers should the number of survivors fall below the minclock threshold.
+Manycast is a automatic server 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. It uses the grab-n'-drop paradigm with the additional feature that active means are used to grab additional servers should the number of survivors fall below the minclock option of the tos command.
The manycast paradigm is not 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.
-A manycast clients is configured using the manycastclient configuration command, which is similar to the server configuration command. It sends ordinary client mode messages, but with a broadcast address rather than a unicast address and sends only if less than minclock survivors remain and then only at the minimum feasible rate and minimum feasible time-to-live (TTL) hops. 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. There can be as many manycast client associations as different addresses, each one serving as a template for a future unicast client/server association.
+A manycast clients is configured using the manycastclient configuration command, which is similar to the server configuration command. It sends ordinary client mode messages, but with a broadcast address rather than a unicast address and sends only if less than minclock associateons remain and then only at the minimum feasible rate and minimum feasible time-to-live (TTL) hops. 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. There can be as many manycast client associations as different addresses, each one serving as a template for a future unicast client/server association.
A manycast server is configured using the manycastserver command, which listens 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 with an ordinary unicast server message.
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.
-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.
+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 multicast group address will automatically organize themselves in an optimum configuration based on stratum and synchronization distance.
+The use of cryptograpic authentication is always a good idea in any server descovery scheme. Both symmetric key and public key cryptography can be used in the same scenarios as described above for the broadast/multicast scheme.
The idea of targeting servers on a random basis to distribute and balance the load is not a new one; however, the NTP pool scheme puts this on steroids. At present, several hundred operators around the globe have volunteered their servers for public access. In general, NTP is a lightweight service and servers used for other purposes don't mind an additional small load. The trick is to randomize over the population and minimize the load on any one server while retaining the advantages of multiple servers with the NTP mitigation algorithms.
-To support this service the DNS for some volunteer servers as been modified to collect a number of the volunteer servers and return a randomized list in response to a query. The client receiving this list modbilizes some or all of them just as in the other discovery schemes and casts off the excess.
-The pool scheme is configured using one or pool commands with the DNS name region.pool.ntp.org, where region is a region of the world, country of the region or state of the country or even the whole world if absent. The pool command can be used more than once; duplicate servers are detected and discarded. In principle, it is possible to use a configuration file containing a single line pool.ntp.org.
+The idea of targeting servers on a random basis to distribute and balance the load is not a new one; however, the NTP pool scheme puts this on steroids. At present, several hundred operators around the globe have volunteered their servers for public access. In general, NTP is a lightweight service and servers used for other purposes don't mind an additional small load. The trick is to randomize over the population and minimize the load on any one server while retaining the advantages of multiple servers using the NTP mitigation algorithms.
+To support this service the DNS for some volunteer servers as been modified to collect a number of other volunteer servers and return a randomized list in response to a DNS query. The client receiving this list modbilizes some or all of them just as in the other discovery schemes and casts off the excess.
+The pool scheme is configured using one or pool commands with the DNS name region.pool.ntp.org, where region is a region of the world, country of the region or state of the country or even the whole world if absent. The pool command can be used more than once; duplicate servers are detected and discarded. In principle, it is possible to use a configuration file containing a single line pool pool.ntp.org.
from Pogo, Walt Kelly
We have three, now looking for more.
-Last update:
Last update:
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 ntpd must have write permission for the directory the drift file is located in, and that file system links, symbolic or otherwise, should be avoided.
- -The parameter tolerance is the wander threshold to skip writing the new value. If the value of wander computed from recent frequency changes is greater than this threshold the file will be updated once per hour. If below the threshold, the file will not be written.
-The parameter tolerance is the wander threshold to skip writing the new value. If the value of wander computed from recent frequency changes is greater than this threshold the file will be updated once per hour. If below the threshold, the file will not be written.
+While not strictly a security function, the Autokey protocol provides means to securely retrieve the current or updated leapsecond values from a server.
- -Configuration keywords are formed by concatenating the message class with the event class. The all prefix can be used instead of a message class. A message class may also be followed by the all keyword to enable/disable all messages of the respective message class. By default, logconfig output is set to allsync. -
Thus, a minimal log configuration could look like this:
+ +Thus, a minimal log configuration could look like this:
logconfig=syncstatus +sysevents
This would just list the synchronizations state of ntpd and the major system events. For a simple reference server, the following minimum message configuration could be useful:
-logconfig=allsync +allclock
This configuration will list all clock information and synchronization information. All other events and messages about peers, system events and so on is suppressed.
-This command specifies the location of an alternate log file to be used instead of the default system syslog facility. This is the same operation as the -l command line option.
- -The variables operate as follows:
+allan allan
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.
-
from Pogo, Walt Kelly
- The pig watches the logs.
-Last update:
Pig was hired to watch the logs.
+Last update:
ntpd includes a comprehensive monitoring facility which collects statistical data of various types and writes the data to files associated with each type at defined intervals. The files associated with a particular type are collectively called the generation file set for that type. The files in the file set are the members of that set.
File sets have names specific to the type and generation epoch. The names are constructed from three concatenated elements prefix, filename and suffix:
+The ntpd includes a comprehensive monitoring facility which collects statistical data of various types and writes the data to files associated with each type at defined events or intervals. The files associated with a particular type are collectively called the generation file set for that type. The files in the file set are the members of that set.
+File sets have names specific to the type and generation epoch. The names are constructed from three concatenated elements prefix, filename and suffix:
Statistics files can be managed using scripts, examples of which are in the ./scripts directory. Using these or similar scripts and Unix cron jobs, the files can be automatically summarized and archived for retrospective analysis.
| Item | +Units | +Description | +
| 49213 | +MJD | +date | +
| 525.624 | +s | +time past midnight | +
| 127.127.4.1 | +IP | +reference clock address | +
| message | +text | +log message | +
| Item | +Units | +Description | +
| 49213 | +MJD | +date | +
| 525.624 | +s | +time past midnight | +
| 128.4.1.1 | +IP | +source address (0.0.0.0 for system) | +
| message | +text | +log message | +
| Item | +Units | +Description | +
| 50935 | +MJD | +date | +
| 75440.031 | +s | +time past midnight | +
| 0.000006019 | +s | +clock offset | +
| 13.778 | +PPM | +frequency offset | +
| 0.000351733 | +s | +RMS jitter | +
| 0.013380 | +PPM | +RMS wander | +
| 6 | +log2 s | +clock discipline loop time constant | +
| Item | +Units | +Description | +
| 48773 | +MJD | +date | +
| 10847.650 | +s | +time past midnight | +
| 127.127.4.1 | +IP | +source address | +
| 9714 | +hex | +status word | +
| -0.001605376 | +s | +clock offset | +
| 0.000000000 | +s | +roundtrip delay | +
| 0.001424877 | +s | +dispersion | +
| 0.000958674 | +s | +RMS jitter | +
| Item | -Units | -Description | -
| 49213 | -MJD | -date | -
| 525.624 | -s | -time past midnight | -
| 127.127.4.1 | -IP | -reference clock address | -
| message | -text | -log message | -
The message field includes the last timecode received in decoded ASCII format, where meaningful. In some cases a good deal of additional information is displayed. See information specific to each reference clock for further details.
-| Item | -Units | -Description | -
| 49213 | -MJD | -date | -
| 525.624 | -s | -time past midnight | -
| 128.4.1.1 | -IP | -source address | -
| message | -text | -log message | -
The message field includes the message type and certain ancillary information. See the Authentication Options page for further information.
-| Item | -Units | -Description | -
| 50935 | -MJD | -date | -
| 75440.031 | -s | -time past midnight | -
| 0.000006019 | -s | -clock offset | -
| 13.778 | -PPM | -frequency offset | -
| 0.000351733 | -hex | -RMS jitter | -
| 0.013380 | -PPM | -RMS wander | -
| 6 | -log2 s | -clock discipline loop time constant | -
| Item | -Units | -Description | -
| 48773 | -MJD | -date | -
| 10847.650 | -s | -time past midnight | -
| 127.127.4.1 | -IP | -source address | -
| 128.4.1.20 | -IP | -destination address | -
| 9714 | -hex | -status word | -
| -0.001605376 | -s | -clock offset | -
| 0.000000000 | -s | -roundtrip delay | -
| 0.001424877 | -s | -dispersion | -
| 0.000958674 | -s | -RMS jitter | -
The status field is encoded in hex format as described in Appendix B of the NTP specification RFC 1305.
-| Item | -Units | -Description | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50928 | -MJD | -date | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2132.543 | -s | -time past midnight | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128.4.1.1 | -IP | -source address | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128.4.1.20 | -IP | -destination address | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3102453281.584327000 | -NTP s | -originate timestamp | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3102453281.586228000 | -NTP s | -receive timestamp | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3102453332.540806000 | -NTP s | -transmit timestamp | -
| Item | +Units | +Description | +
| 49213 | +MJD | +date | +
| 525.624 | +s | +time past midnight | +
| 128.4.1.1 | +IP | +source address (0.0.0.0 for system) | +
| message | +text | +log message | +
| Item | +Units | +Description | +
| 50928 | +MJD | +date | +
| 2132.543 | +s | +time past midnight | +
| 128.4.1.1 | +IP | +source address | +
| 128.4.1.20 | +IP | +destination address | +
| 3102453281.584327000 | +NTP s | +originate timestamp | +
| 3102453281.586228000 | +NTP s | +receive timestamp | +
| 3102453332.540806000 | +NTP s | +transmit timestamp | +
| 3102453332.541458000 | NTP s | destination timestamp |
| Item | -Units | -Description | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50928 | -MJD | -date | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2132.543 | -s | -time past midnight | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | -h | -time since restart | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81965 | -# | -total packets received last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 0 | -# | -packets received for this host last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9546 | -# | -current version packets last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | -# | -previous version packets last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | -# | -access denied packets last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | -# | -bad length or format packets last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | -# | -bad authentication packets last hour | -|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | -# | -rate exceeded packets last hour | -
| Item | +Units | +Description | +|
| 50928 | +MJD | +date | +|
| 2132.543 | +s | +time past midnight | +|
| 3600 | +s | +time since reset | +|
| 81965 | +# | +packets received | +|
| 0 | +# | +packets for this host | +|
| 9546 | +# | +current versions | +|
| 56 | +# | +old version | +|
| 512 | +# | +access denied | +|
| 540 | +# | +bad length or format | +|
| 10 | +# | +bad authentication | +|
| 4 | +# | +declined | +|
| 147 | +# | +rate exceeded | +|
| 1 | # | -kiss-o'-death packets sent last hour | +kiss-o'-death packets sent |
| Item | -Units | -Description | -
| 53876 | -MJD | -date | -
| 36.920 | -s | -time past midnight | -
| 10.0.3.5 | -IP | -server address | -
| 1 | -# | -event count | -
| 0.000014592 | -s | -total time | -
| message | -text | -code path description (see source) | -
| Item | +Units | +Description | +
| 53876 | +MJD | +date | +
| 36.920 | +s | +time past midnight | +
| 10.0.3.5 | +IP | +server address | +
| 1 | +# | +event count | +
| 0.000014592 | +s | +total time | +
| message | +text | +code path description (see source) | +
from Alice's Adventures in Wonderland, Lewis Carroll
- The mushroom knows all the error codes, which is more than most of us do.
-Last update:
from Alice's Adventures in Wonderland, Lewis Carroll
+ The log can be shrill at times.
+Last update:
@@ -33,7 +33,10 @@
LOG_INFO
from Pogo, Walt Kelly
- A typical NTP monitoring packet
-Last update:
from Pogo, Walt Kelly
+ Racoon is shooting configuration bugs.
+Last update:
from Alice's Adventures in Wonderland, Lewis Carroll
- The mushroom knows all the command line options.
-Last update:
from The Wizard of Oz, L. Frank Baum
+ You need help from the monkeys.
+Last update:
The ntpd 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. ntpd 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.
-The ntpd 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 to set the clock. In order to protect the network from bunching, the initial poll interval for each server is delayed an interval randomized over a few seconds. At the default initial poll interval of 64 s, several minutes can elapse before the clock is set. The initial delay to set the clock can be reduced using the iburst keyword with the server configuration command, as described on the Server Options page.
-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 1000 s, called the panic threshold, from the server time, ntpd 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 ntpd to exit with a panic message to the system log. The -g 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 1000 s will cause ntpd to exit anyway.
-Under ordinary conditions, ntpd adjusts the clock in small steps so that the timescale is effectively continuous and never runs backwards. 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 ntpd algorithms discard offsets exceeding 128 ms, called the step threshold, unless the interval during which no sample offset is less than 128 ms exceeds 900 s, called the stepout threshold. 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.
-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 congestion and jitter. Sometimes, in particular when ntpd 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 -x option is included on the command line, the clock will always be slewed unless the offset exceeds 600 s (10 minutes), in which case it will be stepped.
-The issues should be carefully explored before deciding to use the -x 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.
-The ntpd behavior at startup depends on whether the frequency file, usually called ntp.drift, exists. This file contains the latest estimate of clock frequency offset. When ntpd is started and the file does not exist, ntpd enters a special mode designed to directly measure the particular clock frequency offset. This takes 15 minutes, after which the time and frequency are set to nominal values and ntpd enters normal mode, where the time and frequency are continuously adjusted.
-After one hour the frequency file is created and the current frequency offset written to it. When ntpd is started and the file does exist, ntpd initializes the frequency from the file and then enters normal mode immediately. In either case the current frequency offset is written to the file at hourly intervals.
+The ntpd program is an operating system daemon that synchronises the system clock with remote NTP time servers or local reference clocks. 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. The program can operate in any of several modes, as described on the Association Management page, and with both symmetric key and public key cryptography, as described on the Authentication Options page.
+The ntpd program ordinarily requires a configuration file as desccribe on the Configuration Commands and Options collection above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the Automatic Server Discovery page.
+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. Once started, the daemon will begin sending and receiving messages, as specified in the configuration file.
+The ntpd program operates by exchanging messages with one or more servers at designated intervals ranging from about one minute to about 17 minutes. When started, the program requires several exchanges while the algorithms accumulate and groom the data before setting the clock. The initial delay to set the clock can be reduced using options on the Server Options page.
+Most compters 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. In case there is no TOY chip or the TOY time is more than 1000 s from the server time, ntpd assumes something must be terribly wrong and exits with a panic message to the system operator. With the -g option the clock will be initially set to the server time regardless of the chip time. However, once the clock has been set, an error greater than 1000 s will cause ntpd to exit anyway.
+Under ordinary conditions, ntpd slews the clock so that the time is effectively continuous and never runs backwards. If due to extreme network congestion an error spike exceeds the step threshold, by default 128 ms, the spike is discarded. However, if the error persists for more than the stepout threshold, by default 900 s, the system clock is stepped to the correct value. In practice the need for a step has is extremely rare and almost always the result of a hardware failure. With the -x option the step threshold is increased to 600 s. Other options are available using the tinker command on the Miscellaneous Options page.
+The issues should be carefully considered before using these options. The maximum slew rate possible is limited to 500 parts-per-million (PPM) by the Unix kernel. As a result, the clock can take 2000 s for each second the clock is outside the acceptable range. During this interval the 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.
+The frequency file, usually called ntp.drift, contains the latest estimate of clock frequency. If this file does not exist when ntpd is started, it enters a special mode designed to measure the particular frequency directly. The measurement takes 15 minutes, after which the frequency is set and ntpd resumes normal mode where the time and frequency are continuously adjusted. The frequency file is updated at intervals of an hour or more depending on the measured clock stability.
ntpd can operate in any of several modes, including symmetric active/passive, client/server broadcast/multicast and manycast, as described in the Association Management page. It normally operates continuously while adjusting the system clock time and frequency with respect to external sources. In some cases it may not be practical to run ntpd continuously. A common workaround has been to run the ntpdate program from a cron job at designated times. However, this program does not have the crafted signal processing, error checking and mitigation algorithms of ntpd. If the -q option is specified on the command line, ntpd will operate as in continous mode, but exit just after setting the clock for the first time. Most applications will probably want to specify the iburst keyword with the server configuration command. With this keyword a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a couple of minutes, the daemon times out and exits.
-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. An alternative to broadcast/multicast is manycast mode, in which a client broadcasts a request and one or more servers in range offer service. Further details are on the Automatic NTP Configuration Options page.
-By default, ntpd runs in continuous mode where each of possibly several external servers is polled at intervals determined by an intricate phase/frequncy-lock feedback loop. The feedback loop measures the incidental clock offset jitter and oscillator frequency wander and determines the best poll interval using a heuristic algorithm. Ordinarily, and in most operating environments, the feedback loop will start with 64 s poll intervals and eventually increase in steps to 1024 s. A small amount of random variation is introduced in order to avoid bunching. In addition, should a server become unreachable for some time, the poll interval is increased in steps to 1024 s in order to reduce network overhead.
+The ntpd program normally operates continuously while adjusting the time and frequency, but in some cases it may not be practical to run it continuously. With the -q option ntpd operates as in continous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the iburst option with the server command. With this option a volley of messages is exchanged to groom the data and set the clock in about 10 s. If nothing is heard after a few minutes, the daemon times out and exits.
NTP uses an intricate clock discipline algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network load. The default minimum interval is 64 s and the maximum 1024 s, which is suitable for most conditions. The default minimum and maximum intervals can be changed using the tinker minpoll and tinker maxpoll commands, respectively. These values are used for all configured associations, unless overridden by the minpoll or minpoll options on the serverconfiguration command.
-In some cases involving dial-up or ISDN toll services, it may be useful to set the minimum interval to 12 (4096 s) and maximum interval to 17 (36 h). 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 residual clock frequency error is small enough for the discipline loop to capture and correct it. The capture range of the loop is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM. If the frequency changes abruptly, due for instance a large change in temperature, one or more step adjustments may occur.is greater than this, the frequency file ntp.drift
+NTP uses an intricate heuristic algorithm to automatically control the poll interval for maximum accuracy consistent with minimum network overhead. The algorithm measures the incidental offset and jitter to determine the best poll interval. When ntpd starts, the interval is the default minimum 64 s. Under normal conditions when the clock discipline has stabilized, the interval increases in steps to the default maximum 1024 s. In addition, should a server become unreachable after some time, the interval increases in steps to the maximum in order to reduce network overhead.
+The default poll interval range is suitable for most conditions, but can be changed using options on the Server Options and Miscellaneous Options pages. However, when using maximum intervals much larger than the default, the residual clock frequency error must be small enough for the discipline loop to capture and correct. The capture range is 500 PPM with a 64-s interval decreasing by a factor of two for each interval doubling. At a 36-hr interval, for example, the capture range is only 0.24 PPM.
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.
-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.
-The filter is activated by the tinker huffpuff command, as described in the Miscellaneous Options page.
+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.
+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, such as during other than work hours. The filter 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. The filter is activated by the tinker huffpuff command, as described in the Miscellaneous Options page.
As provided by international agreement, an extra second is sometimes inserted in Coordinated Universal Time (UTC) at the end of a selected month, usually June or December. The National Institutes of Standards and Technology (NIST) provides an historic leapseconds file at time.nist.gov for retrieval via FTP. When this file, usually called ntp.leap, is installed, ntpd reads it at startup and initializes three leapsecond values, the offset of International Atomic Time (TAI) after the last leap in the file, the NTP seconds of that leap and the NTP seconds when the leapseconds file expires.
-If a host does not have the leapsecond values, they can be obtained over the net using the Autokey security protocol. Ordinarily, the leapseconds file is installed on the primary servers and the values flow from them to dependent servers and eventually clients. When multiple servers are involved, the values with the latest expiration time are used.
-If the latest leap is in the past, nothing further is done other than to install the TAI offset in the kernel where it can be retrieved by the ntp_gettimeofday() system call. If the leap is in the future less than 28 days, the leap warning bits are set to insert one second. If in the future less than 23 hours, the kernel is armed to insert one second at the end of the current day. If the kernel is enabled, the leap is done automatically at that time; otherwise, the clock is stepped back one second at that time.
+As provided by international agreement, an extra second is sometimes inserted in Coordinated Universal Time (UTC) at the end of a selected month, usually June or December. The National Institutes of Standards and Technology (NIST) provides an historic leapseconds file at time.nist.gov for retrieval via FTP. When this file, usually called ntp.leapseconds, is installed, ntpd reads it at startup and initializes three leapsecond values: the NTP seconds at the next leap event, the offset of UTC relative to International Atomic Time (TAI) after the leap and the NTP seconds when the leapseconds file expires.
+If a host does not have the leapsecond values, they can be obtained over the net using the Autokey security protocol. Ordinarily, the leapseconds file is installed on the primary servers and the values flow from them via secondary servers to the clients. When multiple servers are involved, the values with the latest expiration time are used.
+If the latest leap is in the past, nothing further is done other than to install the TAI offset. If the leap is in the future less than 28 days, the leap warning bits are set. If in the future less than 23 hours, the kernel is armed to insert one second at the end of the current day. If the kernel is enabled, the leap is done automatically at that time; otherwise, the clock is effectively stopped for one second at the leap. Additional details are in the The NTP Timescale and Leap Seconds white paper
Dependent servers and clients tally the leap warning bits of surviving servers and reference clocks. When a majority of the survivors show warning, a leap is programmed at the end of the current month. During the month and day of insertion, they operate as above. In this way the leap is propagated at all dependent servers and clients.
If ntpd, is configured with NetInfo support, it will attempt to read its configuration from the NetInfo service if the default ntp.conf file cannot be read and no file is specified by the -c option.
+If ntpd, is configured with NetInfo support, it will attempt to read its configuration from the NetInfo service if the default ntp.conf file cannot be read and no file is specified by the -c option.
In contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace.
Various internal ntpd variables can be displayed and configuration options altered while the ntpd is running using the ntpq and ntpdc utility programs.
When ntpd starts it looks at the value of umask, and if zero ntpd will set the umask to 022.
Ordinarily, ntpd reads the ntp.conf 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.
-Usually, the configuration file is installed in the /etc directory, but could be installed elsewhere (see the -c conffile command line option). The file format is similar to other Unix configuration files - comments begin with a # character and extend to the end of the line; blank lines are ignored.
-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 [ ] in the following option pages, while alternatives are separated by |. The notation [ ... ] means an optional, indefinite repetition of the last item before the [ ... ].
-Server Options
- Authentication Options
- Monitoring Options
- Access Control Options
- Automatic NTP Configuration Options
- Reference Clock Options
- Miscellaneous Options
Ordinarily, ntpd reads the ntp.conf configuration file at startup 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 client, with servers determined by listening to broadcasts at run time.
+Usually, the configuration file is installed as/etc/ntp.conf, but could be installed elsewhere (see the -c conffile command line option). The file format is similar to other Unix configuration files - comments begin with a # character and extend to the end of the line; blank lines are ignored.
+Configuration commands consist of an initial command keyword followed by a list of option keywords separated by whitespace. Commands may not be continued over multiple lines. Options 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 [ ] in the options pages, while alternatives are separated by |. The notation [ ... ] means an optional, indefinite repetition of the last item before the [ ... ].
| frequency file | -/etc/ntp.drift | +none | -f | driftfile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| leapseconds file | +none | ++ | leapfile | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process ID file | none | diff --git a/html/ntpdsim.html b/html/ntpdsim.html index 3ae33b565..2fcfebf5f 100644 --- a/html/ntpdsim.html +++ b/html/ntpdsim.html @@ -11,9 +11,9 @@
| Variable | +Description | +
| ind | +index on this list | +
| assid | +association ID | +
| status | +peer status word | +
| conf | +yes: persistent, no: ephemeral | +
| reach | +yes: reachable, no: unreachable | +
| auth | +ok, yes, bad and none | +
| condition | +source (see peer status word) | +
| last_event | +event report (see peer status word) | +
| cnt | +event count (see peer status word) | +
The character in the left margin in the peers 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 rv command, and a short explanation of the condition revealed.
-The status, leap, stratum, precision, rootdelay, rootdispersion, refid, reftime, poll, offset, and frequency variables are described in RFC-1305 specification. Additional NTPv4 system variables include the following.
-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:
-The status, srcadr, srcport, dstadr, dstport, leap, stratum, precision, rootdelay, rootdispersion, readh, hmode, pmode, hpoll, ppoll, offset, delay, dspersion, reftime variables are described in the RFC-1305 specification, as are the timestamps org, rec and xmt. Additional NTPv4 system variables include the following.
+| Variable | +Description | +
| remote | +index on this list | +
| refid | +association ID or kiss code | +
| st | +peer status word | +
| t | +u: unicast, b: broadcast, l: local | +
| when | +sec/min/hr since last received packet | +
| poll | +poll interval (log2 s) | +
| reach | +reach shift register (octal) | +
| delay | +roundtrip delay | +
| offset | +offset | +
| jitter | +jitter | +
The current state of the operating program is shown in a set of status words maintained by the system and each association separately. These words are displayed in the rv and as commands both in hexadecimal and decoded short tip strings. The codes, tips and short explanations are on the Event Messages and Status Words page. The page also includes a list of system and peer messages, the code for the latest of which is included in the status word.
+Information resulting from protocol machine state transitions is displayed using an informal set of ASCII strings called kiss codes. The original purpose was for kiss-o'-death (KoD) packets sent by the server to advise the client of an unusual condition. They are now displayed, when appropriate, in the reference identifier field in various billboards.
+The following system variables apear in the rv billboard. Not all variables are displayed in some configurations.
+| Variable | +Description | +
| status | +system status word | +
| version | +NTP software version and build time | +
| processor | +hardware platform and version | +
| system | +operating system and version | +
| leap | +leap warning indicator (0-3) | +
| stratum | +stratum (1-15) | +
| precision | +precision (log2 s) | +
| rootdelay | +total roundtrip delay to the primary reference clock | +
| rootdisp | +total dispersion to the primary reference clock | +
| peer | +system peer association ID | +
| tc | +time constant and poll exponent (log2 s) (3-17) | +
| mintc | +minimum time constant (log2 s) (3-10) | +
| clock | +date and time of day | +
| refid | +reference ID or kiss code | +
| reftime | +reference time | +
| offset | +combined time offset | +
| sys_jitter | +combined system jitter | +
| frequency | +clock frequency offset (PPM) | +
| clk_wander | +clock frequency wander (PPM) | +
| clk_jitter | +clock jitter | +
| tai | +TAI-UTC offset (s) | +
| leapsec | +NTP seconds when the next leap second is/was inserted | +
| expire | +NTP seconds when the NIST leapseconds file expires | +
| Variable | +Description | +
| host | +Autokey host name | +
| group | +Autokey group name | +
| flags | +host flags (see Autokey specification) | +
| signature | +OpenSSL digest/signature scheme | +
| update | +NTP seconds at last signature update | +
| cert | +certificate subject, issuer and certificate flags | +
| until | +NTP seconds when the certificate expires | +
The following system variables apear in the rv billboard for each association. Not all variables are displayed in some configurations.
+| Variable | +Description | +
| associd | +association ID | +
| status | +peer status word | +
| srcadr + srcport |
+ source (remote) IP address and port | +
| dstadr + dstport |
+ destination (local) IP address and port | +
| leap | +leap indicator (0-3) | +
| stratum | +stratum (0-15) | +
| precision | +precision (log2 s) | +
| rootdelay | +total roundtrip delay to the primary reference clock | +
| rootdisp | +total root dispersion to the primary reference clock | +
| refid | +reference ID or kiss code | +
| reftime | +reference time | +
| reach | +reach register (octal) | +
| unreach | +unreach counter | +
| hmode | +host mode (1-6) | +
| pmode | +peer mode (1-5) | +
| hpoll | +host poll exponent (log2 s) (3-17) | +
| ppoll | +peer poll exponent (log2 s) (3-17) | +
| headway | +headway (s) | +
| flash | +flash status word | +
| offset | +filter offset | +
| delay | +filter delay | +
| dispersion | +filter dispersion | +
| jitter | +filter jitter | +
When the NTPv4 daemon is compiled with the OpenSSL software library, additional peer variables are displayed, including the following:
-The flash 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 TEST1 through TEST12. The tests are performed in a certain order designed to gain maximum diagnostic information while protecting against accidental or malicious errors. The flash 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.
-Tests TEST1 through TEST3 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. TEST4 and TEST5 are associated with access control and cryptographic authentication. If any bits are set, the packet is discarded immediately with nothing changed.
-Tests TEST6 through TEST8 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. TEST9 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.
-Tests TEST10 through TEST12 check the authentication state using Autokey public-key cryptography, as described in the Authentication Options 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.
-The flash bits for each test are defined as follows.
-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.
+| Variable | +Description | +
| flags | +peer flags (see Autokey specification) | +
| host | +Autokey server name | +
| signature | +initial session key ID | +
| initsequence | +initial key ID | +
| initkey | +initial key index | +
| timestamp | +Autokey signature timestamp | +
The following clock variables apear in the cv billboard for each association with a reference clock. Not all variables are displayed in some configurations.
+| Variable | +Description | +
| associd | +association ID | +
| status | +clock status word | +
| device | +device description | +
| timecode | +ASCII timecode string (specific to device) | +
| poll | +poll messages sent | +
| noreply | +no reply | +
| badformat | +bad format | +
| baddata | +bad date or time | +
| fudgetime1 | +fudge time 1 | +
| fudgetime2 | +fudge time 2 | +
| stratum | +driver stratum | +
| refid | +driver reference ID | +
| flags | +driver flags | +
from Pogo, Walt Kelly
The turtle has been swimming in the kernel.
-Last update:
Last update:
FAX test image for SATNET (1979).
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 Fuzzball. 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.
-Last update:
Last update:
For the rank amateur the sheer volume of the documentation collection must be intimidating. However, it doesn't take much to fly the ntpd daemon with a simple configuration where a workstation needs to synchronize to some server elsewhere in the Internet. The first thing is to build the distribution for the particular workstation and install in the usual place. The Building and Installing the Distribution page describes how to do this.
-While it is possible that certain configurations do not need a configuration file, most do. The file, called by default /etc/ntp.conf, need only contain one line specifying a remote server, for instance
+While it is possible that certain configurations do not need a configuration file, most do. The file, called by default /etc/ntp.conf, need only contain one command specifying a remote server, for instance
server foo.bar.com
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 the 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 Public NTP Time Servers 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.
-During operation ntpd measures and corrects for incidental clock frequency error and writes the current value to a file specified by the
+During operation ntpd measures and corrects for incidental clock frequency error and occasionally writes the current value to a file specified by the
driftfile /etc/ntp.drift
-command in the configuration file. If ntpd 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.
+configuration command. If ntpd is stopped and restarted, it initializes the frequency from this file and avoids the potentially lengthy interval to relearn the correction.
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 ntpd fails to come up at all.
The best way to confirm NTP is working is using the ntpq utility, although the ntpdc utility may be useful in extreme cases. See the documentation pages for further information. Don't forget to check for system log messages. In the most extreme cases the -d option on the ntpd 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 any errors found.
from Alice's Adventures in Wonderland, Lewis Carroll
- Packet blizzard
-Last update:
from Pogo, Walt Kelly
+ Our junior managers and the administrators.
+Last update:
This page describes the various rate management provisions in NTPv4. Details about the configuration commands and options are given on the Configuration Options page. Details about the cryptographic authentication schemes are given on the Authentication Options page. Details about the automatic server discovery schemes are described on the Automatic Server Discovery Schemes page. Additional information is available in the papers, reports, memoranda and briefings on the NTP Project page.
Some national time metrology laboratories, including NIST and USNO, use the ntpd reference implementation in their very busy public time servers. They operate multiple servers behind load-balancing devices to support aggregate rates up to several thousand packets per second. The servers need to defend themselves against all manner of broken implementations that can clog the server and and network infrastructure. On the other hand, friendly ntpd clients need to avoid configurations that can result in unfriendly rates.
There are several features in ntpd designed to defend the servers, clients and network against accidental or intentional flood attack. On the other hand these features are also used to insure ntpd is a good citizen, even if configured in unfriendly ways. The ground rules are:
Rate management involves four algorithms to manage resources: (1) poll rate control, (2) burst control, (3) average headway time and (4) guard time. These are described in following sections.
In the ntpd design control of the poll interval is an intricate balance between nominal errors and network load. As a rule of thumb, the nominal errors double for a fourfold increase in poll interval. As the poll interval increases from 64 s to 1024 s, for example, the nominal errors ecrease by a factor of four. Nevertheless and unless the lowest possible nominal error is required, the well mannered NTP client should allow the interval to increase to the maximum when possible.
-The poll interval is proportional to the time constant of the feedback loop which disciplines the system clock. The optimum time constant depends on the network time jitter and the clock oscillator frequency wander. Errors due to jitter are reduced as the time constant increases, while errors due to wander are decreased as the time constant decreases. The two error characteristics intersect at a point called the Allan intercept, which represents the ideal time constant. The ntpd poll interval algorithms slowly increases the poll interval when jitter dominates the error budget, but quickly reduces the interval when wander dominates it.
-In ntpd the poll interval is represented in log2 s, so the actual values span the range 6-10. The algorithm uses a jiggle counter which operates over the range from -30 to +30 and is initialized at 0. If the measured offset is less than four times the measured average jitter, the counter is increased by the poll interval; if not, it is decreased by twice the poll interval. If the counter reaches +30, the poll interval is incremented by 1; if the counter reaches -30, the poll interval is decremented by 1. In either case the counter is set to 0.
+Control of the poll interval is an intricate balance between expected acuracy and network load. The poll interval is constrained by the lower limit minpoll and upper limit maxpoll options of the server command and represented by the poll exponent in log2 s units. The limits default to 6 (64 s) and 10 (1024 s), respectively, which are appropriate for the vast majority of cases. The default limits can be changed with these options to a minimum set by the average option of the discard command (see below) to a maximum of 17 (36 h). Unless the best possible accuracy is required, the well mannered NTP client automatically increases the poll interval to the maximum when possible, whether or not the server is reachable. The current poll interval for each association is displayed by the ntpq program pe command. The global poll interval/time constant is displayed as the poll system variable by the rv command. The minimum global poll interval/time constant is displayed as the minpoll system variable by the rv command.
+As a rule of thumb, the expected errors increase by a factor of two as the poll interval increases by a factor of four. The ntpd poll interval algorithm slowly increases the poll interval when jitter dominates the error budget, but quickly reduces the interval when wander dominates it. The algorithm uses a jiggle counter which operates over the range from -30 to +30 and is initialized at 0. If the measured offset is less than four times the measured average jitter, the counter is increased by the pollcurrent exponent; if not, it is decreased by twice the poll exponent. If the counter reaches +30, the poll exponent is incremented by 1; if the counter reaches -30, the exponent is decremented by 1. In either case the counter is set to 0.
+The poll interval is proportional to the time constant of the feedback loop which disciplines the system clock. The optimum time constant depends on the network time jitter and the clock oscillator frequency wander. Errors due to jitter decrease as the time constant increases, while errors due to wander decrease as the time constant decreases. The two error characteristics intersect at a point called the Allan intercept, which represents the ideal time constant. With a compromise Allan intercept of 2000 s, the optimim poll interval is about 64 s, which corresponds to a poll exponent of 6.
+There is normally no need to change the poll limits, as the poll interval is managed automatically as a function of prevailing jitter and wander. The most common exceptions are the following.
+Occasionally it is necessary to send packets at intervals less than the poll interval. For instance, with the burst and iburst options, the poll algorithm sends a burst of several packets at 2-s intervals. The ntpd poll algorithm avoids sending needless packets if the server is not responding. If a burst is to be sent, the client sends only a single packet. When the first packet is received from the server, the client continues with the remaining packets in the burst. If the first packet is not received within 64 s, it will be sent again for two additional retries before giving up. The result is to minimize network load if the server is not responding.
-For the iburst option the number of packets in the burst is six, which is the number normally needed to synchronize the clock; for the burst option, the number of packets in the burst is determined by the difference between the poll interval and the minimum poll interval set by the minpoll option of the server command. For instance, at a poll interval of 6 (64 s), only a single packet is sent for every poll, while the full number of eight packets is sent at poll intervals of 9 (512 s) or more.
+Occasionally it is necessary to send packets at intervals less than the poll interval. For instance, with the burst and iburst options of the server command, the poll algorithm sends a burst of several packets at 2-s intervals. The ntpd poll algorithm avoids sending needless packets if the server is not responding. The client begins a burst with a single packet. When the first packet is received from the server, the client continues with the remaining packets in the burst. If the first packet is not received within 64 s, it will be sent again for two additional retries before beginning backoff. The result is to minimize network load if the server is not responding.
+For the iburst option the number of packets in the burst is six, which is the number normally needed to synchronize the clock; for the burst option, the number of packets in the burst is determined by the difference between the poll interval and the minimum poll interval set by the minpoll option of the server command. For instance, with a poll exponent of 6 (64 s), only a single packet is sent for every poll, while the full number of eight packets is sent at poll intervals of 9 (512 s) or more.
There are features in ntpd to manage the interval between one packet and the next. These features make use of a set of counters: an output counter for each client association and an input counter for each distinct client address. Each counter increments by a value called the headway when a packet is processed and decrements by one each second. The default headway in ntpd is 16 s, but this can be changed using the average option of the discard command.
-If the iburst or burst options are present, the poll algorithm sends a burst of packets instead of a single packet at each poll opportunity. The NTPv4 specification requires that bursts contain no more than eight packets; so, starting from an output counter value of zero, the maximum counter value or ouput ceiling can be no more than eight times the minimum poll interval set by the minpoll option of the server command. However, if the burst starts with a counter value other than zero, there is a potential to exceed the ceiling. The poll algorithm avoids this by computing an additional headway time so that the next packet sent will not exceed the ceiling. Additional headway time can result from Autokey protocol operations. Designs such as this are often called leaky buckets.
-The ntpd input packet routine uses a special list of entries, one for each distinct client address found. Each entry includes an IP address, input counter and time of the most recent arrival. The entries are ordered by time of arrival, most recent first. As each packet arrives, the IP source address is compared to the IP address in each entry in turn. If a match is found the entry is removed and inserted first on the list. If the IP source address does not match any entry, a new entry is created and inserted first, possibly discarding the last entry on the list if it is full. Observers will note this is the same algorithm used for page replacement in virtual memory systems.
-In the virtual memory algorithm the entry of interest is the last, whereas here the entry of interest is the first. The input counter is decreased by the time since it was last referenced, but not below zero. If the value of the counter plus the headway is greater than the input ceiling set by the average option of the discard command, the packet is discarded. Otherwise, the counter is increased by the headway and the packet is processed. The result is, if the client maintains a maximum average headway not less than the input ceiling and transmits no more than eight packets in a burst, the input counter will not exceed the input ceiling.
+There are two features in ntpd to manage the interval between one packet and the next. These features make use of a set of counters: a client output counter for each association and a server input counter for each distinct client address. Each counter increments by a value called the headway when a packet is processed and decrements by one each second. The default minimum average headway in ntpd is 8 s, but this can be changed using the average option of the discard command, but not less than 3 (8 s).
+If the iburst or burst options are present, the poll algorithm sends a burst of packets instead of a single packet at each poll opportunity. The NTPv4 specification requires that bursts contain no more than eight packets; so, starting from an output counter value of zero, the maximum counter value or ouput ceiling can be no more than eight times the minimum poll interval set by the minpoll option of the server command. However, if the burst starts with a counter value other than zero, there is a potential to exceed the ceiling. The poll algorithm avoids this by computing an additional headway time so that the next packet sent will not exceed the ceiling. Additional headway time can result from Autokey protocol operations. Designs such as this are often called leaky buckets. The current headway is displayed as the headway peer variable by the ntpq rv command.
+The ntpd input packet routine uses a special list of entries, one for each distinct client address found. Each entry includes an IP address, input counter and interval since the last packet arrival. The entries are ordered by interval from the smallest to the largest. As each packet arrives, the IP source address is compared to the IP address in each entry in turn. If a match is found the entry is removed and inserted first on the list. If the IP source address does not match any entry, a new entry is created and inserted first, possibly discarding the last entry on the list if it is full. Observers will note this is the same algorithm used for page replacement in virtual memory systems.
+In the virtual memory algorithm the entry of interest is the last, whereas here the entry of interest is the first. The input counter is decreased by the interval since it was last referenced, but not below zero. If the value of the counter plus the headway is greater than the input ceiling set by the average option, the packet is discarded. Otherwise, the counter is increased by the headway and the packet is processed. The result is, if the client maintains a maximum average headway not less than the input ceiling and transmits no more than eight packets in a burst, the input counter will not exceed the ceiling.
A review of past client abuse incidence shows the most frequent scenario is a broken client that attempts to send a number of packets at rates of one per second or more. There have been occasions where this abuse has persisted for days at a time. These scenarios are the most damaging, as they can threaten not only the victim server but the network infrastructure as well.
-In the ntpd server design the minimum headway between the last packet received and the current packet is called the guard time. If the headway is less than the guard time, the packet is discarded. The guard time defaults to 2 s, but this can be changed using the minimum option of the discard ommand.
-As an optional feature ntpd can send a special packet called the Kiss-o'-Death (KoD) packet when either the average headway or guard time is violated. The KoD is a packet with leap bits 11, stratum 0 and reference ID field other than 0. In this case the reference ID field is a four-character ASCII string, called the kiss code, showing the reason for the KoD. The KoD is enabled by the limited kod options to the restrict command.
-At present, only one kiss code RATE is used to tell the client to slow down. In order to make sure the client notices the KoD, the receive and transmit timestamps are set to the transmit timestamp of the client packet and all other fields left as in the client packet. Thus, even if the client ignores the KoD, it cannot do any useful time computations. KoDs themselves are rate limited in the same way as arriving packets in order to deflect a flood attack.
-There is some controversy about the KoD provisions. The nature of the datagram service supporting NTP provides no way to throttle clients other than behaving badly. Clients are strongly advised to support the KoD, but there are no legal or societal statutes requiring it. The reference implementation responds to a KoD by temporarily increasing the ouptut counter and thus the headway.
+A review of past client abuse incidence shows the most frequent scenario is a broken client that attempts to send a number of packets at rates of one per second or more. On one occasion due to a defective client design, over 750,000 clients fell into this mode. There have been occasions where this abuse has persisted for days at a time. These scenarios are the most damaging, as they can threaten not only the victim server but the network infrastructure as well.
+In the ntpd design the minimum headway between the last packet received and the current packet is called the guard time. If the headway is less than the guard time, the packet is discarded. The guard time defaults to 2 s, but this can be changed using the minimum option of the discard ommand.
+Ordinarily, packets denied service are simply dropped with no further action except incrementing statistics counters. Sometimes a more proactive response is needed to cause the client to slow down. A special packet format has been created for this purpose called the kiss-o'-death (KoD) packet. KoD packets have leap indicator 3, stratum 0 and the reference identifier set to a four-byte ASCII code. At present, only one code RATE is sent by the server if the limited and kod flags are set in the restrict command and the rate limit is exceeded.
+A client receiving a KoD packet is expected to slow down; however, no explicit mechanism is specified in the protocol to do this. In the current reference implementation, the server sets the packet poll to the greater of (a) minimum average headway and (b) client packet poll. The client sets the peer poll field to the maximum of (a) minimum average headway and (b) server packet poll. For KoD packets (only), the minimum peer poll is clamped not less than the peer poll and the headway temporarily increased.
+At present there is only one KoD packet with code RATE. In order to make sure the client notices the KoD, the receive and transmit timestamps are set to the transmit timestamp of the client packet and all other fields left as in the client packet. Thus, even if the client ignores the KoD, it cannot do any useful time computations. KoDs themselves are rate limited in the same way as arriving packets in order to deflect a flood attack.
from Alice's Adventures in Wonderland, Lewis Carroll
- The rabbit toots to make sure you read this
-Last update:
The rabbit toots to make sure you read this.
+Last update:
Configuration Commands and Options
Client and Server Configuration
\
External Links
Build and Install
Program Manual Pages
P.T. Bridgeport Bear; from Pogo, Walt Kelly
- Pleased to meet you.
-Last update:
from Alice in Wonderland, Lewis Carroll
+ Welcome to the tea party.
+Last update:

from Alice's Adventures in Wonderland, Lewis Carroll
- S is for snakeoil
-Last update:
S is for snakeoil.
+Last update:
) { - if (/^state=4/) { - print "\bOK!\n" if ($opt_v); - exit 0; - } - - if (/request variable was unknown/) { - print "\bCan't tell!\nPerhaps you are running an old version of ntpd.\n" if ($opt_v); - exit $opt_f; + chomp; + # the first line should be similar to: + # associd=0 status=0645 leap_none, sync_ntp, ... + if (/^associd=0 status=(\S{4}) (\S+), (\S+),/) { + my $status = $1; + my $leap = $2; + my $sync = $3; + # print $_; + # print "status <$status>, leap <$leap>, sync <$sync>\n"; + last if ($leap =~ /(sync|leap)_alarm/); + if ($leap =~ /leap_(none|((add|del)_sec))/) { + # We could check $sync here to make sure we like the source... + print "\bOK!\n" if ($opt_v); + exit 0; + } + print "\bUnexpected 'leap' status <$leap>\n"; + exit 1; } if (/Connection refused/) { print "\bntpd is not running!\n" if ($opt_v); exit 1; } + + # Otherwise, we have a bigger problem. + print "\bUnexpected first line <$_>\n"; + exit 1; } close(Q); print "\b".substr("*+:.", $i % 4, 1) if ($opt_v);