Initial import from FreeBSD RELENG_4:
[games.git] / contrib / ntp / html / driver22.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <html>
3 <head>
4 <meta name="generator" content="HTML Tidy, see www.w3.org">
5 <title>PPS Clock Discipline</title>
6 </head>
7 <body>
8 <h3>PPS Clock Discipline</h3>
9
10 <hr>
11 <h4>Synopsis</h4>
12
13 Address: 127.127.22.<i>u</i> <br>
14 Reference ID: <tt>PPS</tt> <br>
15 Driver ID: <tt>PPS</tt> <br>
16 Serial or Parallel Port: <tt>/dev/pps<i>u</i></tt> <br>
17 Requires: PPSAPI interface 
18
19 <p>Note: This driver supersedes an older one of the same name. The
20 older driver operated with several somewhat archaic signal
21 interface devices, required intricate configuration and was poorly
22 documented. This driver operates only with the PPSAPI interface
23 proposed as an IETF standard. Note also that the <tt>pps</tt>
24 configuration command has been obsoleted by this driver.</p>
25
26 <h4>Description</h4>
27
28 <p>This driver furnishes an interface for the pulse-per-second
29 (PPS) produced by a cesium clock, radio clock or related equipment.
30 It can be used to augment the serial timecode generated by a GPS
31 receiver, for example. It can be used to remove accumulated jitter
32 and re-time a secondary server when synchronized to a primary
33 server over a congested, wide-area network and before
34 redistributing the time to local clients. The driver includes
35 extensive signal sanity checks and grooming algorithms. A range
36 gate and frequency discriminator reject noise and signals with
37 incorrect frequency. A multiple-stage median filter rejects jitter
38 due to hardware interrupt and operating system latencies. A
39 trimmed-mean algorithm determines the best time samples. With
40 typical workstations and processing loads, the incidental jitter
41 can be reduced to less than a microsecond.</p>
42
43 <p>While this driver can discipline the time and frequency relative
44 to the PPS source, it cannot number the seconds. For this purpose a
45 auxiliary source is required, ordinarily a radio clock operated as
46 a primary reference (stratum 1) source; however, another NTP time
47 server can be used as well. For this purpose, the auxiliary source
48 is marked as the prefer peer, as described in the <a href=
49 "prefer.htm">Mitigation Rules and the <tt>prefer</tt> Keyword</a>
50 page.</p>
51
52 <p>The driver requires the PPSAPI interface<sup>1</sup>, which is a
53 proposed IETF standard. The interface consists of the <tt>
54 timepps.h</tt> header file and associated kernel support. Support
55 for this interface is included in current versions of FreeBSD and
56 Linux and proprietary versions for Digital/Compaq Tru64 (Alpha),
57 Sun Solaris and Sun SunOS. See the <a href="pps.htm">
58 Pulse-per-second (PPS) Signal Interfacing</a> page for further
59 information.</p>
60
61 <p>The PPS source can be connected via a serial or parallel port,
62 depending on the hardware and operating system. The port can be
63 dedicated to the PPS source or shared with another device. A radio
64 clock is usually connected via a serial port and the PPS source
65 connected via a level converter to the data carrier detect (DCD)
66 pin (DB-9 pin 1, DB-25 pin 8) of the same connector. In some
67 systems where a parallel port and driver are available, the PPS
68 signal can be connected directly to the ACK pin (pin 10) of the
69 connector. Whether the PPS signal is connected via a dedicated port
70 or shared with another device, the driver opens the device <tt>
71 /dev/pps%d</tt>, where <tt>%d</tt> is the unit number. As with
72 other drivers, links can be used to redirect the logical name to
73 the actual physical device.</p>
74
75 <p>The driver normally operates like any other driver and uses the
76 same mitigation algorithms and PLL/FLL clock discipline
77 incorporated in the daemon. If kernel PLL/FLL support is available,
78 the kernel PLL/FLL clock discipline is used instead. The default
79 behavior is not to use the kernel PPS clock discipline, even if
80 present. This driver incorporates a good deal of signal processing
81 to reduce jitter using the median filter and trimmed average
82 algorithms in the driver interface. As the result, performance with
83 minpoll and maxpoll configured at the minimum 4 (16s) is generally
84 better than the kernel PPS clock discipline. However, fudge flag 3
85 can be used to enable this discipline if necessary.</p>
86
87 <p>Note that the PPS source is considered reachable only if the
88 auxiliary source is the prefer peer, is reachable and is selected
89 to discipline the system clock. The stratum assigned to the PPS
90 source is automatically determined. If the auxiliary source is
91 unreachable or inoperative, the stratum is set to 16; otherwise it
92 is set to match the stratum of the auxiliary source. Since the
93 stratum is determined dynamically, it is not possible to assign
94 another stratum using the <tt>fudge</tt> command as in other
95 drivers.</p>
96
97 <h4>Fudge Factors</h4>
98
99 <dl>
100 <dt><tt>time1 <i>time</i></tt></dt>
101
102 <dd>Specifies the time offset calibration factor, in seconds and
103 fraction, with default 0.0.dd&gt;</dd>
104
105 <dt><tt>time2 <i>time</i></tt></dt>
106
107 <dd>Not used by this driver.</dd>
108
109 <dt><tt>stratum <i>number</i></tt></dt>
110
111 <dd>Specifies the driver stratum, in decimal from 0 to 15, with
112 default 0.</dd>
113
114 <dt><tt>refid <i>string</i></tt></dt>
115
116 <dd>Specifies the driver reference identifier, an ASCII string from
117 one to four characters, with default <tt>PPS</tt>.</dd>
118
119 <dt><tt>flag1 0 | 1</tt></dt>
120
121 <dd>Not used by this driver.</dd>
122
123 <dt><tt>flag2 0 | 1</tt></dt>
124
125 <dd>Specifies the PPS signal on-time edge: 0 for assert (default),
126 1 for clear.</dd>
127
128 <dt><tt>flag3 0 | 1</tt></dt>
129
130 <dd>Controls the kernel PPS discipline: 0 for disable (default), 1
131 for enable.</dd>
132
133 <dt><tt>flag4 0 | 1</tt></dt>
134
135 <dd>Not used by this driver.</dd>
136 </dl>
137
138 <p>Additional Information</p>
139
140 <p><a href="refclock.htm">Reference Clock Drivers</a></p>
141
142 <p>Reference</p>
143
144 <ol>
145 <li>Mogul, J., D. Mills, J. Brittenson, J. Stone and U. Windl.
146 Pulse-per-second API for Unix-like operating systems, version 1.
147 Request for Comments RFC-2783, Internet Engineering Task Force,
148 March 2000, 31 pp.</li>
149 </ol>
150
151 <hr>
152 <a href="index.htm"><img align="left" src="pic/home.gif" alt=
153 "gif"></a> 
154
155 <address><a href="mailto:mills@udel.edu">David L. Mills
156 &lt;mills@udel.edu&gt;</a></address>
157 </body>
158 </html>
159