xref: /freebsd/contrib/ntp/html/clockopt.html (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
5<meta name="generator" content="HTML Tidy, see www.w3.org">
6<title>Reference Clock Commands and Options</title>
7<link href="scripts/style.css" type="text/css" rel="stylesheet">
8</head>
9<body>
10<h3>Reference Clock Commands and Options</h3>
11<img src="pic/stack1a.jpg" alt="gif" align="left">Master Time Facility at the <a href="http://www.eecis.udel.edu/%7emills/lab.html">UDel Internet Research Laboratory</a>
12<p>Last update:
13  <!-- #BeginDate format:En2m -->26-Sep-2019  06:34<!-- #EndDate -->
14  UTC</p>
15<br clear="left">
16<h4>Related Links</h4>
17<script type="text/javascript" language="javascript" src="scripts/refclock.txt"></script>
18<script type="text/javascript" language="javascript" src="scripts/audio.txt"></script>
19<script type="text/javascript" language="javascript" src="scripts/clockopt.txt"></script>
20<hr>
21<h4 id="addrs">Reference Clock Adddresses</h4>
22<p>Unless noted otherwise, further information about these ccommands is on the <a href="refclock.html">Reference Clock Support</a> page.</p><p>Reference clocks are identified by a syntactically correct but invalid IP address, in order to distinguish them from ordinary NTP peers. These  addresses are of the form 127.127.<em>t</em>.<em>u</em>, where <em>t</em> is an integer denoting the clock type and <em>u</em> indicates the unit number in the range 0-3. While it may seem overkill, it is in fact sometimes useful to configure multiple reference clocks of the same type, in which case the unit numbers must be unique.</p>
23<h4 id="cmd"> Commands and Options</h4>
24<dl>
25  <dt id="server"><tt>server 127.127.<i>t.u</i> [prefer] [mode <i>int</i>] [minpoll <i>int</i>] [maxpoll <i>int</i>]</tt></dt>
26  <dd>This command can be used to configure reference clocks in special ways. The options are interpreted as follows:
27    <dl>
28      <dt><tt>prefer</tt></dt>
29      <dd>Marks the reference clock as preferred. All other things being equal, this host will be chosen for synchronization among a set of correctly operating hosts. See the <a href="prefer.html">Mitigation Rules and the <tt>prefer</tt> Keyword</a> page for further information.</dd>
30      <dt><tt>mode <i>int</i></tt></dt>
31      <dd>Specifies a mode number which is interpreted in a device-specific fashion. For instance, it selects a dialing protocol in the ACTS driver and a device subtype in the <tt>parse</tt> drivers.</dd>
32      <dt><tt>minpoll <i>int</i></tt></dt>
33      <dt><tt>maxpoll <i>int</i></tt></dt>
34      <dd>These options specify the minimum and maximum polling interval for reference clock messages in log<sub>2</sub> seconds. For most directly connected reference clocks, both <tt>minpoll</tt> and <tt>maxpoll</tt> default to 6 (64 s). For modem reference clocks, <tt>minpoll</tt> is ordinarily set to 10 (about 17 m) and <tt>maxpoll</tt> to  15 (about 9 h). The allowable range is 4 (16 s) to 17 (36 h) inclusive.</dd>
35    </dl>
36  </dd>
37  <dt id="fudge"><tt>fudge 127.127.<i>t.u</i> [time1 <i>sec</i>] [time2 <i>sec</i>]
38    [stratum <i>int</i>] [refid <i>string</i>] [flag1 0|1]
39    [flag2 0|1] [flag3 0|1] [flag4 0|1]</tt></dt>
40  <dd>This command can be used to configure reference clocks in special ways. It must immediately follow the <tt>server</tt> command which configures the driver. Note that the same capability is possible at run time using the <tt><a href="ntpdc.html">ntpdc</a></tt> program. The options are interpreted as follows:
41    <dl>
42      <dt><tt>time1 <i>sec</i></tt></dt>
43      <dd>Specifies a constant to be added to the time offset produced by the driver, a fixed-point decimal number in seconds. This is used as a calibration constant to adjust the nominal time offset of a particular clock to agree with an external standard, such as a precision PPS signal. It also provides a way to correct a systematic error or bias due to serial port or operating system latencies, different cable lengths or receiver internal delay. The specified offset is in addition to the propagation delay provided by other means, such as internal DIPswitches. Where a calibration for an individual system and driver is available, an approximate correction is noted in the driver documentation pages.</dd>
44      <dd>Note: in order to facilitate calibration when more than one radio clock or PPS signal is supported, a special calibration feature is available. It takes the form of an argument to the <tt>enable</tt> command described in the <a href="miscopt.html">Miscellaneous Options</a> page and operates as described in the <a href="refclock.html">Reference Clock Support</a> page.</dd>
45      <dt><tt>time2 <i>secs</i></tt></dt>
46      <dd>Specifies a fixed-point decimal number in seconds, which is interpreted in a driver-dependent way. See the descriptions of specific drivers in the <a href="refclock.html">Reference Clock Support</a> page.</dd>
47      <dt><tt>stratum <i>int</i></tt></dt>
48      <dd>Specifies the stratum number assigned to the driver in the range 0 to 15, inclusive. This number overrides the default stratum number ordinarily assigned by the driver itself, usually zero.</dd>
49      <dt><tt>refid <i>string</i></tt></dt>
50      <dd>Specifies an ASCII string of from one to four characters which defines the reference identifier used by the driver. This string overrides the default identifier ordinarily assigned by the driver itself.</dd>
51      <dt><tt>flag1 0|1</tt></dt>
52      <dt><tt>flag2 0|1</tt></dt>
53      <dt><tt>flag3 0|1</tt></dt>
54      <dt><tt>flag4 0|1</tt></dt>
55      <dd>These four flags are used for customizing the clock driver. The interpretation of these values, and whether they are used at all, is a function of the particular  driver. However, by convention <tt>flag4</tt> is used to enable recording monitoring data to the <tt>clockstats</tt> file configured with the <tt>filegen</tt> command. Additional information on the <tt>filegen</tt> command is on the <a href="monopt.html">Monitoring Options</a> page.</dd>
56      <dt><tt>minjitter <i>secs</i></tt></dt>
57      <dd>If the source has a jitter that cannot be sensibly estimated, because
58	it is not statistic jitter, the source will be detected as falseticker
59	sooner or later.  This has been observed e.g. with the serial data of
60	certain GPS receivers.  Enforcing a minimal jitter value avoids a too
61	low estimation, keeping the clock in the zoo while still detecting
62	higher jitter.
63      </dd><dd> Note: this changes the refclock samples and ends up in the
64	clock dispersion, not the clock jitter, despite being called jitter.  To
65	see the modified values, check the NTP clock variable "filtdisp", not
66	"jitter".
67      </dd><dd>The falseticker problem can also be avoided by increasing <tt>tos
68	mindist</tt>, which extends the intersection interval, but that affects
69	the root dispersion and is intended for the case of multiple reference
70	clocks with reliable jitter that do not intersect otherwise.
71      </dd>
72    </dl>
73  </dd>
74  <dt id="device"><tt>device 127.127.<i>t.u</i> [timedata <i>devpath</i>] [ppsdata <i>devpath</i>]</tt></dt>
75  <dd>
76    This command can be used to specify the devices a reference
77    clocks should use.  Every clock has a special hard-coded builtin
78    name to use, and while it is possible to make a symlink from the
79    expected name to the real device, doing so is not always
80    convenient.  On some platforms or setups it is much easier to
81    specify the real device name in <i>ntpd</i>'s configuration file.
82  </dd><dd>
83    Note: It is <i>not</i> necessary to specify device names
84    in the configuration file; in such a case the builtin name will be
85    used.  But once a device name is given, it will be used as
86    specified.  There's no fallback in case of errors.
87  </dd><dd>
88    The arguments are:
89    <dl>
90      <dt><tt>timedata <i>devpath</i></tt></dt>
91      <dd>
92	Defines the device that provides the time code data stream;
93	for e.g. NMEA, <i>devpath</i> could be "<tt>/dev/ttyS7</tt>" on a
94	POSIX-like system or "<tt>\\.\COM4</tt>" for another widely used OS.
95      </dd>
96      <dt><tt>ppsdata <i>devpath</i></tt></dt>
97      <dd>
98	Defines the device that provides the PPS timing stream.  By
99	default, the time data stream is expected to be able to
100	provide the PPS data, too.  (Proper wiring and hardware
101	assumed, of course.)  This is true for all OSes that implement
102	the PPS API as originally designed for BSD variants.
103	<p/>
104	But on some hardware the PPS signal cannot not delivered to
105	the UART that handles the serial data; instead it might
106	be routed to a GPIO pin, and that means that we need a
107	way to define the device where the PPS data can be acquired
108	from.  The <tt>ppsdata</tt> definition provides support for such
109	use cases.
110      </dd>
111    </dl>
112  </dd>
113</dl>
114<hr>
115<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
116</body>
117</html>
118