r1 - 2007-04-11 - 19:18:06 - RuneMagnussenYou are here: NTP >  Support Web > ConfiguringNTP > ConfiguringRefclocks > AdjustingRadioclocks
NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.

ntp-4.2.8p10 was released on 21 March 2017. It addresses 6 medium- and 5 low-severity security issues, 4 informational security topics, 15 bugfixes, and contains other improvements over 4.2.8p9.

Please see the NTP Security Notice for vulnerability and mitigation details.

Are you using Autokey in production? If so, please contact Harlan - he's got some questions for you.
REFACTOR See AdjustingRadioclocksDev for discussion of this topic.

Adjusting Radio clocks

Radioclocks must be adjusted to compensate for the timecodes to be transmitted from the sender to the radio clock. A simple approach is to measure the distance to the sender and the add 1 ms delay for each 300 km. A better way is to use statistics gathered by ntpd.

Configuring the clock before adjustment

The radio clock has to be configured in a special way to make the statistics useful. Some clocks have a default value for time1 which is not zero so that should be set to 0. The clock is not supposed to be used before adjustment so it should be marked with noselect.

server 127.127.x.y noselect
fudge 127.127.x.y time1 0

Configuring statistics

There are different kinds of statistics available. The one needed in this case is peer stats. To activate it the following must be set in ntp.conf:

statistics peerstats
statdir /var/log/ntp/stats/
filegen peerstats type day file peers enable

This makes ntpd generate one file of peer statistics a day. Note the trailing / in the statdir-definition.

Using the statistics to find the adjustment

The script peer.awk included with ntpd can be used to find the adjustment. The script lists statistics for each configured server and clock. An example:

$ LANG=C awk -f peer.awk /var/log/ntp/stats/peers.*

       ident     cnt     mean     rms      max     delay     dist     disp
==========================================================================
127.127.8.0       98   -1.487    1.091    2.642    0.000    0.000    0.000
193.162.159.194   84    0.907    0.414    1.051    8.953  943.384   25.527
193.162.145.130   84    0.770    0.435    1.085    8.658  942.140   25.586
193.10.7.250      84    0.702    0.398    0.952   27.279  951.166   25.686
193.10.7.246      85    0.711    0.490    1.253   27.546  952.638   25.082

After a while the means for the servers will be close to 0.000 and the mean for the clock can be used as a good value for time1. The mean will show up as negative because the clock lacks the adjustment. Note that the mean is in ms but the value for time1 is in seconds. LANG=C makes sure that the script works even for locales with , as the decimal point.

-- RuneMagnussen - 11 Apr 2007

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
SSL security by CAcert
Get the CAcert Root Certificate
This site is powered by the TWiki collaboration platform
IPv6 Ready
Copyright & 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding the site? Send feedback