|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() Certifications ![]() Cisco ![]() Downloads ![]() IP ![]() PC ![]() Protocols ![]() RemoteAccess ![]() Security ![]() Telecommunications ![]() Tools ![]() Unix ![]() Web |
NTP - Network Time ProtocolContent by:www.meinberg.de/english/info/ntp.htm Meinberg Funkuhren,
Configuration
In most installations the ntp.conf file contains at least one or more lines starting with the keyword server. Each of those lines specifies one reference time source which can be either another computer on the network, or a radio clock or GPS connected to the local computer. Reference time sources are specified using IP addresses, or host names which can be resolved by a name server. If an IP address represents a real node on the network then the NTP daemon assumes another NTP daemon running on a computer with that address. Additionally, NTP uses some pseudo IP addresses to specifiy special reference time sources. For example, NTP uses a pseudo IP address 127.127.8.n to access a Meinberg radio clock or GPS installed at the local computer. To access its own system clock, also called the local clock, NTP uses the pseudo IP address 127.127.1.0. This IP address must not be mixed up with 127.0.0.1, which is the IP of the localhost, i.e. the computer's loopback interface.
Attention: Configuration With Meinberg Radio Clock or GPS (Unix)
Each symbolic device name must point to a physical device which represents an existing radio clock. In most cases the physical device is a serial port which has a radio clock connected to. Each of the reference clocks must also be specified in the ntp.conf file using a server line with the pseudo IP address 127.127.8.n, where n must correspond to the index numbers used with the symbolic device names /dev/refclock-n mentioned above. The pseudo IP address must be followed by a mode m parameter which specifies the type of radio clock represented by the device. The table below lists the mode values which can be used with Meinberg radio clocks:
For example, if a single radio clock is connected to the serial port /dev/ttyS0 then a symbolic link for the clock must be set up using the command ln -s /dev/ttyS0 /dev/refclock-0 In the next step the file ntp.conf must be edited to configure the NTP daemon and tell it which reference clocks to use. The file should include a server line for the refclock-0 device created above. If the radio clock sends the Meinberg standard time string at 9600 baud and framing 7E2 then, as can be seen from the table above, the mode for refclock-0 must be set to 2: server 127.127.8.0 mode 2 # standard time string with 9600, 7E2Additionally, there should be an entry for the local clock which can be used as a fallback resource if no other time source is available. Since the local clock is not very accurate, it should be fudged to a low stratum: server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 12 Now the NTP daemon must be started (or restarted) to let the changes take effect. If the daemon has been shipped with the operating system then it may have support for Meinberg clocks compiled in, or not. If the output ot the command ntpq -p: remote refid st t when poll reach delay offset jitter ======================================================================= LOCAL(0) LOCAL(0) 12 l 30 64 377 0.000 0.000 0.000 *GENERIC(0) .DCFa. 0 - 24 64 377 0.000 0.050 0.003 +172.16.3.103 .PPS. 1 u 36 64 377 1.306 -0.019 0.043lists a clock labeled generic then everything is fine and the NTP daemon supports the reference clock. If the generic clock it not listed in the ntpq output then NTP must be configured and compliled on the target platform. This requires a compiler package installed on the target platform, and the source code of the NTP distribution. In the example below name is the base name of the NTP source package which is normally distributed as a file name.tar.gz which must be uncompressed on the target computer: tar xvzf name.tar.gzTo compile the package, change into the NTP base directory, and run configure and make to build the programs. You may use the following commands: cd name ./configure --enable-MEINBERG makeAfter the build procedure has finished successfully each of the new programs is available in its own subdirectory which has the same name as the program itself. Make sure there's no old version of ntpd or xntpd running, then start the new NTP daemon by entering ntpd/ntpdif a ntp-4.* package has been compiled, or xntpd/xntpdif a xntp3 package has been compiled. The command ntpq -p can be used to verify that the new daemon works correctly. Finally the newly compiled programs should be copied to the destination directories. The standard procedure to do that is by simply running the command make installHowever, care must be taken if a version of NTP had been installed previously. The old versions of the NTP executables should be deleted or overwritten by the new programs to prevent the NTP daemon from being loaded instead of the new one when the system starts up the next time. Also, the new executables must be in the directory where they are expected by the system startup scripts. Care must be taken especially if the NTP version changes between v3.x and v4.x because the naming conventions have changed between those version (e.g xntpd/ntpd). Configuration With Meinberg Radio Clock (Windows)
server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 1 # disciplined by radio clock Configuration Without Radio Clock
server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 12 # not disciplined server ntp_server_1 server ntp_server_2 server ... where ntp_server_1, ntp_server_2, etc. must be the real host names or IP addresses of existing NTP servers. Additional Configuration Options
driftfile /etc/ntp.driftto the ntp.conf file.
There are many more options which can be set up using the
configuration file. Please refer to the NTP documentation
for details.
Checking the NTP Status
ntpq can be run in an interactive mode or in batch mode. In batch mode, ntpq executes a command and returns to the command prompt. The parameter -p ('peers') lets ntpq print the status of a NTP daemon. Enter ntpq -pto display the status of the daemon on the local machine, or ntpq -p ntp_serverto display the status of the daemon on the remote host ntp_server. The command should print a table with one status line for each reference time source which has been configured for the NTP daemon on the specified host: [tethys]:[10:11am]:[/home/rnejdl] > ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== *time-A.timefreq .ACTS. 1 u 12 64 177 36.261 -43.055 0.711 +clock.isc.org clepsydra.dec.c 2 u 11 64 177 105.450 -22.851 21.988 +X.ns.verio.net clepsydra.dec.c 2 u 17 64 177 89.020 -7.575 34.865 [tethys]:[10:11am]:[/home/rnejdl] >The table above shows the output for a NTP daemon which has 3 reference time sources: its own local clock, a DCF77 radio clock as refclock-0, plus an NTP daemon on the network, with IP address 172.16.3.103. If the first character of a line is not blank then it contains a qualifier for the corresponding reference time source. Immediately after the daemon has been started all qualifiers are blank. The NTP daemon needs several polling cycles to check the available time sources and declare one of them as the reference it synchronizes to. An asterisk * in the first column marks the reference time source which is currently preferred by the NTP daemon, the + character marks high quality candidates for the reference time which could be used if the currently selected reference time source should become unavailable. The column remote displays the IP address or the host name of the reference time source, where LOCAL refers to the local clock. The refid shows the type of the reference clock, where e.g. LOCAL or LCL refers to the local clockagain, .DCFa. refers to a standard DCF77 time source, and .PPS. indicates that the reference clock is disciplined by a hardware pulse-per-second signal. Other identifiers are possible, depending on the type of the reference clock. The column st reflects the stratum number of the reference time source. In the example above, the local clock has stratum 12, the remote time server at 172.16.3.103 has stratum 1 which is the best you can see across the network, and the local radio clock has stratum 0, so the radio clock is currently being preferred. Every time a when count reaches the poll number in the same line, the NTP daemon queries the time from the corresponding time source and resets the when count to 0. The query results of each polling cycle are filtered and used as a measure for the clock's quality and reachability. The column reach shows if a reference time source could be reached at the last polling intervals, i.e. data could be read from the reference time source, and the reference time source was synchronized. The value must be interpreted as an 8 bit shift register whose contents is displayed as octal values. If the NTP daemon has just started, the value is 0. Each time a query was successful a '1' is shifted in from the right, so after the daemon has been started the sequence of reach numbers 0, 1, 3, 7, 17, 37, 77, 177, 377. The maximum value 377 means that the eight last queries were completed successfully. The NTP daemon must have reached a reference time source several times (reach not 0) before it selects a preferred time source and puts an asterisk in the first column. The columns delay, offset and jitter show some timing values which are derived from the query results. In some versions of ntpq the last column is labeled disp (for dispersion) instead of jitter. All values are in in milliseconds. The delay value is derived from the roundtrip time of the queries. The offset value shows the difference between the reference time and the system clock. The jitter value indicates the magnitude of jitter between several time queries. NTP LinksNTP Homepage
NTP Online Documentation
Very detailed information is available at the NTP FAQ at http://www.ntp.org/ntpfaq/NTP-a-faq.htm NTP Usenet Discussions
There is also an internet news group comp.protocols.time.ntp where users from all over the world discuss NTP or ask questions about special configurations. Older articles on NTP can be retrieved by keyword search from Google http://groups.google.com/advanced_group_search. Here are some example searches on Google for NTP and ... To refine the search click on the the link Advanced Group Search at the top of the Google result page. Commercial NTP Vendors
NTP RFCsRFCs related to NTP and Network Time Synchronization
This page was created in 0.30117 seconds Comments and Questions
Last modified: July 21 2004. |