ntpd.1ntpdmdoc revision 1.1.1.2 1 1.1.1.2 christos .Dd December 19 2014
2 1.1 christos .Dt NTPD 1ntpdmdoc User Commands
3 1.1.1.2 christos .Os
4 1.1 christos .\" EDIT THIS FILE WITH CAUTION (ntpd-opts.mdoc)
5 1.1 christos .\"
6 1.1.1.2 christos .\" It has been AutoGen-ed December 19, 2014 at 07:49:14 AM by AutoGen 5.18.5pre4
7 1.1 christos .\" From the definitions ntpd-opts.def
8 1.1 christos .\" and the template file agmdoc-cmd.tpl
9 1.1 christos .Sh NAME
10 1.1 christos .Nm ntpd
11 1.1 christos .Nd NTP daemon program
12 1.1 christos .Sh SYNOPSIS
13 1.1 christos .Nm
14 1.1 christos .\" Mixture of short (flag) options and long options
15 1.1 christos .Op Fl flags
16 1.1 christos .Op Fl flag Op Ar value
17 1.1 christos .Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
18 1.1 christos [ <server1> ... <serverN> ]
19 1.1 christos .Pp
20 1.1 christos .Sh DESCRIPTION
21 1.1 christos The
22 1.1 christos .Nm
23 1.1 christos utility is an operating system daemon which sets
24 1.1 christos and maintains the system time of day in synchronism with Internet
25 1.1 christos standard time servers.
26 1.1 christos It is a complete implementation of the
27 1.1 christos Network Time Protocol (NTP) version 4, as defined by RFC\-5905,
28 1.1 christos but also retains compatibility with
29 1.1 christos version 3, as defined by RFC\-1305, and versions 1
30 1.1 christos and 2, as defined by RFC\-1059 and RFC\-1119, respectively.
31 1.1 christos .Pp
32 1.1 christos The
33 1.1 christos .Nm
34 1.1 christos utility does most computations in 64\-bit floating point
35 1.1 christos arithmetic and does relatively clumsy 64\-bit fixed point operations
36 1.1 christos only when necessary to preserve the ultimate precision, about 232
37 1.1 christos picoseconds.
38 1.1 christos While the ultimate precision is not achievable with
39 1.1 christos ordinary workstations and networks of today, it may be required
40 1.1 christos with future gigahertz CPU clocks and gigabit LANs.
41 1.1 christos .Pp
42 1.1 christos Ordinarily,
43 1.1 christos .Nm
44 1.1 christos reads the
45 1.1 christos .Xr ntp.conf 5
46 1.1 christos configuration file at startup time in order to determine the
47 1.1 christos synchronization sources and operating modes.
48 1.1 christos It is also possible to
49 1.1 christos specify a working, although limited, configuration entirely on the
50 1.1 christos command line, obviating the need for a configuration file.
51 1.1 christos This may
52 1.1 christos be particularly useful when the local host is to be configured as a
53 1.1 christos broadcast/multicast client, with all peers being determined by
54 1.1 christos listening to broadcasts at run time.
55 1.1 christos .Pp
56 1.1 christos If NetInfo support is built into
57 1.1 christos .Nm ,
58 1.1 christos then
59 1.1 christos .Nm
60 1.1 christos will attempt to read its configuration from the
61 1.1 christos NetInfo if the default
62 1.1 christos .Xr ntp.conf 5
63 1.1 christos file cannot be read and no file is
64 1.1 christos specified by the
65 1.1 christos .Fl c
66 1.1 christos option.
67 1.1 christos .Pp
68 1.1 christos Various internal
69 1.1 christos .Nm
70 1.1 christos variables can be displayed and
71 1.1 christos configuration options altered while the
72 1.1 christos .Nm
73 1.1 christos is running
74 1.1 christos using the
75 1.1 christos .Xr ntpq 1ntpqmdoc
76 1.1 christos and
77 1.1 christos .Xr ntpdc 1ntpdcmdoc
78 1.1 christos utility programs.
79 1.1 christos .Pp
80 1.1 christos When
81 1.1 christos .Nm
82 1.1 christos starts it looks at the value of
83 1.1 christos .Xr umask 2 ,
84 1.1 christos and if zero
85 1.1 christos .Nm
86 1.1 christos will set the
87 1.1 christos .Xr umask 2
88 1.1 christos to 022.
89 1.1 christos .Sh "OPTIONS"
90 1.1 christos .Bl -tag
91 1.1 christos .It Fl 4 , Fl \-ipv4
92 1.1 christos Force IPv4 DNS name resolution.
93 1.1 christos This option must not appear in combination with any of the following options:
94 1.1 christos ipv6.
95 1.1 christos .sp
96 1.1 christos Force DNS resolution of following host names on the command line
97 1.1 christos to the IPv4 namespace.
98 1.1 christos .It Fl 6 , Fl \-ipv6
99 1.1 christos Force IPv6 DNS name resolution.
100 1.1 christos This option must not appear in combination with any of the following options:
101 1.1 christos ipv4.
102 1.1 christos .sp
103 1.1 christos Force DNS resolution of following host names on the command line
104 1.1 christos to the IPv6 namespace.
105 1.1 christos .It Fl a , Fl \-authreq
106 1.1 christos Require crypto authentication.
107 1.1 christos This option must not appear in combination with any of the following options:
108 1.1 christos authnoreq.
109 1.1 christos .sp
110 1.1 christos Require cryptographic authentication for broadcast client,
111 1.1 christos multicast client and symmetric passive associations.
112 1.1 christos This is the default.
113 1.1 christos .It Fl A , Fl \-authnoreq
114 1.1 christos Do not require crypto authentication.
115 1.1 christos This option must not appear in combination with any of the following options:
116 1.1 christos authreq.
117 1.1 christos .sp
118 1.1 christos Do not require cryptographic authentication for broadcast client,
119 1.1 christos multicast client and symmetric passive associations.
120 1.1 christos This is almost never a good idea.
121 1.1 christos .It Fl b , Fl \-bcastsync
122 1.1 christos Allow us to sync to broadcast servers.
123 1.1 christos .sp
124 1.1 christos .It Fl c Ar string , Fl \-configfile Ns = Ns Ar string
125 1.1 christos configuration file name.
126 1.1 christos .sp
127 1.1 christos The name and path of the configuration file,
128 1.1 christos \fI/etc/ntp.conf\fP
129 1.1 christos by default.
130 1.1 christos .It Fl d , Fl \-debug\-level
131 1.1 christos Increase debug verbosity level.
132 1.1 christos This option may appear an unlimited number of times.
133 1.1 christos .sp
134 1.1 christos .It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
135 1.1 christos Set the debug verbosity level.
136 1.1 christos This option may appear an unlimited number of times.
137 1.1 christos This option takes an integer number as its argument.
138 1.1 christos .sp
139 1.1 christos .It Fl f Ar string , Fl \-driftfile Ns = Ns Ar string
140 1.1 christos frequency drift file name.
141 1.1 christos .sp
142 1.1 christos The name and path of the frequency file,
143 1.1 christos \fI/etc/ntp.drift\fP
144 1.1 christos by default.
145 1.1 christos This is the same operation as the
146 1.1 christos \fBdriftfile\fP \fIdriftfile\fP
147 1.1 christos configuration specification in the
148 1.1 christos \fI/etc/ntp.conf\fP
149 1.1 christos file.
150 1.1 christos .It Fl g , Fl \-panicgate
151 1.1 christos Allow the first adjustment to be Big.
152 1.1 christos This option may appear an unlimited number of times.
153 1.1 christos .sp
154 1.1 christos Normally,
155 1.1 christos \fBntpd\fP
156 1.1 christos exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
157 1.1 christos \fBntpd\fP
158 1.1 christos will exit with a message to the system log. This option can be used with the
159 1.1 christos \fB\-q\fP
160 1.1 christos and
161 1.1 christos \fB\-x\fP
162 1.1 christos options.
163 1.1 christos See the
164 1.1 christos \fBtinker\fP
165 1.1 christos configuration file directive for other options.
166 1.1 christos .It Fl i Ar string , Fl \-jaildir Ns = Ns Ar string
167 1.1 christos Jail directory.
168 1.1 christos .sp
169 1.1 christos Chroot the server to the directory
170 1.1 christos \fIjaildir\fP
171 1.1 christos .
172 1.1 christos This option also implies that the server attempts to drop root privileges at startup.
173 1.1 christos You may need to also specify a
174 1.1 christos \fB\-u\fP
175 1.1 christos option.
176 1.1 christos This option is only available if the OS supports adjusting the clock
177 1.1 christos without full root privileges.
178 1.1 christos This option is supported under NetBSD (configure with
179 1.1 christos \fB\-\-enable\-clockctl\fP) or Linux (configure with
180 1.1 christos \fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
181 1.1 christos .It Fl I Ar iface , Fl \-interface Ns = Ns Ar iface
182 1.1 christos Listen on an interface name or address.
183 1.1 christos This option may appear an unlimited number of times.
184 1.1 christos .sp
185 1.1 christos Open the network address given, or all the addresses associated with the
186 1.1 christos given interface name. This option may appear multiple times. This option
187 1.1 christos also implies not opening other addresses, except wildcard and localhost.
188 1.1 christos This option is deprecated. Please consider using the configuration file
189 1.1 christos \fBinterface\fP command, which is more versatile.
190 1.1 christos .It Fl k Ar string , Fl \-keyfile Ns = Ns Ar string
191 1.1 christos path to symmetric keys.
192 1.1 christos .sp
193 1.1 christos Specify the name and path of the symmetric key file.
194 1.1 christos \fI/etc/ntp.keys\fP
195 1.1 christos is the default.
196 1.1 christos This is the same operation as the
197 1.1 christos \fBkeys\fP \fIkeyfile\fP
198 1.1 christos configuration file directive.
199 1.1 christos .It Fl l Ar string , Fl \-logfile Ns = Ns Ar string
200 1.1 christos path to the log file.
201 1.1 christos .sp
202 1.1 christos Specify the name and path of the log file.
203 1.1 christos The default is the system log file.
204 1.1 christos This is the same operation as the
205 1.1 christos \fBlogfile\fP \fIlogfile\fP
206 1.1 christos configuration file directive.
207 1.1 christos .It Fl L , Fl \-novirtualips
208 1.1 christos Do not listen to virtual interfaces.
209 1.1 christos .sp
210 1.1 christos Do not listen to virtual interfaces, defined as those with
211 1.1 christos names containing a colon. This option is deprecated. Please
212 1.1 christos consider using the configuration file \fBinterface\fP command, which
213 1.1 christos is more versatile.
214 1.1 christos .It Fl M , Fl \-modifymmtimer
215 1.1 christos Modify Multimedia Timer (Windows only).
216 1.1 christos .sp
217 1.1 christos Set the Windows Multimedia Timer to highest resolution. This
218 1.1 christos ensures the resolution does not change while ntpd is running,
219 1.1 christos avoiding timekeeping glitches associated with changes.
220 1.1 christos .It Fl n , Fl \-nofork
221 1.1 christos Do not fork.
222 1.1 christos This option must not appear in combination with any of the following options:
223 1.1 christos wait\-sync.
224 1.1 christos .sp
225 1.1 christos .It Fl N , Fl \-nice
226 1.1 christos Run at high priority.
227 1.1 christos .sp
228 1.1 christos To the extent permitted by the operating system, run
229 1.1 christos \fBntpd\fP
230 1.1 christos at the highest priority.
231 1.1 christos .It Fl p Ar string , Fl \-pidfile Ns = Ns Ar string
232 1.1 christos path to the PID file.
233 1.1 christos .sp
234 1.1 christos Specify the name and path of the file used to record
235 1.1 christos \fBntpd\fP's
236 1.1 christos process ID.
237 1.1 christos This is the same operation as the
238 1.1 christos \fBpidfile\fP \fIpidfile\fP
239 1.1 christos configuration file directive.
240 1.1 christos .It Fl P Ar number , Fl \-priority Ns = Ns Ar number
241 1.1 christos Process priority.
242 1.1 christos This option takes an integer number as its argument.
243 1.1 christos .sp
244 1.1 christos To the extent permitted by the operating system, run
245 1.1 christos \fBntpd\fP
246 1.1 christos at the specified
247 1.1 christos \fBsched_setscheduler(SCHED_FIFO)\fP
248 1.1 christos priority.
249 1.1 christos .It Fl q , Fl \-quit
250 1.1 christos Set the time and quit.
251 1.1 christos This option must not appear in combination with any of the following options:
252 1.1 christos saveconfigquit, wait\-sync.
253 1.1 christos .sp
254 1.1 christos \fBntpd\fP
255 1.1 christos will not daemonize and will exit after the clock is first
256 1.1 christos synchronized. This behavior mimics that of the
257 1.1 christos \fBntpdate\fP
258 1.1 christos program, which will soon be replaced with a shell script.
259 1.1 christos The
260 1.1 christos \fB\-g\fP
261 1.1 christos and
262 1.1 christos \fB\-x\fP
263 1.1 christos options can be used with this option.
264 1.1 christos Note: The kernel time discipline is disabled with this option.
265 1.1 christos .It Fl r Ar string , Fl \-propagationdelay Ns = Ns Ar string
266 1.1 christos Broadcast/propagation delay.
267 1.1 christos .sp
268 1.1 christos Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
269 1.1 christos .It Fl \-saveconfigquit Ns = Ns Ar string
270 1.1 christos Save parsed configuration and quit.
271 1.1 christos This option must not appear in combination with any of the following options:
272 1.1 christos quit, wait\-sync.
273 1.1 christos .sp
274 1.1 christos Cause \fBntpd\fP to parse its startup configuration file and save an
275 1.1 christos equivalent to the given filename and exit. This option was
276 1.1 christos designed for automated testing.
277 1.1 christos .It Fl s Ar string , Fl \-statsdir Ns = Ns Ar string
278 1.1 christos Statistics file location.
279 1.1 christos .sp
280 1.1 christos Specify the directory path for files created by the statistics facility.
281 1.1 christos This is the same operation as the
282 1.1 christos \fBstatsdir\fP \fIstatsdir\fP
283 1.1 christos configuration file directive.
284 1.1 christos .It Fl t Ar tkey , Fl \-trustedkey Ns = Ns Ar tkey
285 1.1 christos Trusted key number.
286 1.1 christos This option may appear an unlimited number of times.
287 1.1 christos .sp
288 1.1 christos Add the specified key number to the trusted key list.
289 1.1 christos .It Fl u Ar string , Fl \-user Ns = Ns Ar string
290 1.1 christos Run as userid (or userid:groupid).
291 1.1 christos .sp
292 1.1 christos Specify a user, and optionally a group, to switch to.
293 1.1 christos This option is only available if the OS supports adjusting the clock
294 1.1 christos without full root privileges.
295 1.1 christos This option is supported under NetBSD (configure with
296 1.1 christos \fB\-\-enable\-clockctl\fP) or Linux (configure with
297 1.1 christos \fB\-\-enable\-linuxcaps\fP) or Solaris (configure with \fB\-\-enable\-solarisprivs\fP).
298 1.1 christos .It Fl U Ar number , Fl \-updateinterval Ns = Ns Ar number
299 1.1 christos interval in seconds between scans for new or dropped interfaces.
300 1.1 christos This option takes an integer number as its argument.
301 1.1 christos .sp
302 1.1 christos Give the time in seconds between two scans for new or dropped interfaces.
303 1.1 christos For systems with routing socket support the scans will be performed shortly after the interface change
304 1.1 christos has been detected by the system.
305 1.1 christos Use 0 to disable scanning. 60 seconds is the minimum time between scans.
306 1.1 christos .It Fl \-var Ns = Ns Ar nvar
307 1.1 christos make ARG an ntp variable (RW).
308 1.1 christos This option may appear an unlimited number of times.
309 1.1 christos .sp
310 1.1 christos .It Fl \-dvar Ns = Ns Ar ndvar
311 1.1 christos make ARG an ntp variable (RW|DEF).
312 1.1 christos This option may appear an unlimited number of times.
313 1.1 christos .sp
314 1.1 christos .It Fl w Ar number , Fl \-wait\-sync Ns = Ns Ar number
315 1.1 christos Seconds to wait for first clock sync.
316 1.1 christos This option must not appear in combination with any of the following options:
317 1.1 christos nofork, quit, saveconfigquit.
318 1.1 christos This option takes an integer number as its argument.
319 1.1 christos .sp
320 1.1 christos If greater than zero, alters \fBntpd\fP's behavior when forking to
321 1.1 christos daemonize. Instead of exiting with status 0 immediately after
322 1.1 christos the fork, the parent waits up to the specified number of
323 1.1 christos seconds for the child to first synchronize the clock. The exit
324 1.1 christos status is zero (success) if the clock was synchronized,
325 1.1 christos otherwise it is \fBETIMEDOUT\fP.
326 1.1 christos This provides the option for a script starting \fBntpd\fP to easily
327 1.1 christos wait for the first set of the clock before proceeding.
328 1.1 christos .It Fl x , Fl \-slew
329 1.1 christos Slew up to 600 seconds.
330 1.1 christos .sp
331 1.1 christos Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
332 1.1 christos This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
333 1.1 christos Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
334 1.1 christos Thus, an adjustment as much as 600 s will take almost 14 days to complete.
335 1.1 christos This option can be used with the
336 1.1 christos \fB\-g\fP
337 1.1 christos and
338 1.1 christos \fB\-q\fP
339 1.1 christos options.
340 1.1 christos See the
341 1.1 christos \fBtinker\fP
342 1.1 christos configuration file directive for other options.
343 1.1 christos Note: The kernel time discipline is disabled with this option.
344 1.1 christos .It Fl \-usepcc
345 1.1 christos Use CPU cycle counter (Windows only).
346 1.1 christos .sp
347 1.1 christos Attempt to substitute the CPU counter for \fBQueryPerformanceCounter\fP.
348 1.1 christos The CPU counter and \fBQueryPerformanceCounter\fP are compared, and if
349 1.1 christos they have the same frequency, the CPU counter (RDTSC on x86) is
350 1.1 christos used directly, saving the overhead of a system call.
351 1.1 christos .It Fl \-pccfreq Ns = Ns Ar string
352 1.1 christos Force CPU cycle counter use (Windows only).
353 1.1 christos .sp
354 1.1 christos Force substitution the CPU counter for \fBQueryPerformanceCounter\fP.
355 1.1 christos The CPU counter (RDTSC on x86) is used unconditionally with the
356 1.1 christos given frequency (in Hz).
357 1.1 christos .It Fl m , Fl \-mdns
358 1.1 christos Register with mDNS as a NTP server.
359 1.1 christos .sp
360 1.1 christos Registers as an NTP server with the local mDNS server which allows
361 1.1 christos the server to be discovered via mDNS client lookup.
362 1.1 christos .It Fl \&? , Fl \-help
363 1.1 christos Display usage information and exit.
364 1.1 christos .It Fl \&! , Fl \-more\-help
365 1.1 christos Pass the extended usage information through a pager.
366 1.1 christos .It Fl \-version Op Brq Ar v|c|n
367 1.1 christos Output version of program and exit. The default mode is `v', a simple
368 1.1 christos version. The `c' mode will print copyright information and `n' will
369 1.1 christos print the full copyright notice.
370 1.1 christos .El
371 1.1 christos .Sh "OPTION PRESETS"
372 1.1 christos Any option that is not marked as \fInot presettable\fP may be preset
373 1.1 christos by loading values from environment variables named:
374 1.1 christos .nf
375 1.1 christos \fBNTPD_<option\-name>\fP or \fBNTPD\fP
376 1.1 christos .fi
377 1.1 christos .ad
378 1.1 christos .Sh USAGE
379 1.1 christos .Ss "How NTP Operates"
380 1.1 christos The
381 1.1 christos .Nm
382 1.1 christos utility operates by exchanging messages with
383 1.1 christos one or more configured servers over a range of designated poll intervals.
384 1.1 christos When
385 1.1 christos started, whether for the first or subsequent times, the program
386 1.1 christos requires several exchanges from the majority of these servers so
387 1.1 christos the signal processing and mitigation algorithms can accumulate and
388 1.1 christos groom the data and set the clock.
389 1.1 christos In order to protect the network
390 1.1 christos from bursts, the initial poll interval for each server is delayed
391 1.1 christos an interval randomized over a few seconds.
392 1.1 christos At the default initial poll
393 1.1 christos interval of 64s, several minutes can elapse before the clock is
394 1.1 christos set.
395 1.1 christos This initial delay to set the clock
396 1.1 christos can be safely and dramatically reduced using the
397 1.1 christos .Cm iburst
398 1.1 christos keyword with the
399 1.1 christos .Ic server
400 1.1 christos configuration
401 1.1 christos command, as described in
402 1.1 christos .Xr ntp.conf 5 .
403 1.1 christos .Pp
404 1.1 christos Most operating systems and hardware of today incorporate a
405 1.1 christos time\-of\-year (TOY) chip to maintain the time during periods when
406 1.1 christos the power is off.
407 1.1 christos When the machine is booted, the chip is used to
408 1.1 christos initialize the operating system time.
409 1.1 christos After the machine has
410 1.1 christos synchronized to a NTP server, the operating system corrects the
411 1.1 christos chip from time to time.
412 1.1 christos In the default case, if
413 1.1 christos .Nm
414 1.1 christos detects that the time on the host
415 1.1 christos is more than 1000s from the server time,
416 1.1 christos .Nm
417 1.1 christos assumes something must be terribly wrong and the only
418 1.1 christos reliable action is for the operator to intervene and set the clock
419 1.1 christos by hand.
420 1.1 christos (Reasons for this include there is no TOY chip,
421 1.1 christos or its battery is dead, or that the TOY chip is just of poor quality.)
422 1.1 christos This causes
423 1.1 christos .Nm
424 1.1 christos to exit with a panic message to
425 1.1 christos the system log.
426 1.1 christos The
427 1.1 christos .Fl g
428 1.1 christos option overrides this check and the
429 1.1 christos clock will be set to the server time regardless of the chip time
430 1.1 christos (up to 68 years in the past or future \(em
431 1.1 christos this is a limitation of the NTPv4 protocol).
432 1.1 christos However, and to protect against broken hardware, such as when the
433 1.1 christos CMOS battery fails or the clock counter becomes defective, once the
434 1.1 christos clock has been set an error greater than 1000s will cause
435 1.1 christos .Nm
436 1.1 christos to exit anyway.
437 1.1 christos .Pp
438 1.1 christos Under ordinary conditions,
439 1.1 christos .Nm
440 1.1 christos adjusts the clock in
441 1.1 christos small steps so that the timescale is effectively continuous and
442 1.1 christos without discontinuities.
443 1.1 christos Under conditions of extreme network
444 1.1 christos congestion, the roundtrip delay jitter can exceed three seconds and
445 1.1 christos the synchronization distance, which is equal to one\-half the
446 1.1 christos roundtrip delay plus error budget terms, can become very large.
447 1.1 christos The
448 1.1 christos .Nm
449 1.1 christos algorithms discard sample offsets exceeding 128 ms,
450 1.1 christos unless the interval during which no sample offset is less than 128
451 1.1 christos ms exceeds 900s.
452 1.1 christos The first sample after that, no matter what the
453 1.1 christos offset, steps the clock to the indicated time.
454 1.1 christos In practice this
455 1.1 christos reduces the false alarm rate where the clock is stepped in error to
456 1.1 christos a vanishingly low incidence.
457 1.1 christos .Pp
458 1.1 christos As the result of this behavior, once the clock has been set it
459 1.1 christos very rarely strays more than 128 ms even under extreme cases of
460 1.1 christos network path congestion and jitter.
461 1.1 christos Sometimes, in particular when
462 1.1 christos .Nm
463 1.1 christos is first started without a valid drift file
464 1.1 christos on a system with a large intrinsic drift
465 1.1 christos the error might grow to exceed 128 ms,
466 1.1 christos which would cause the clock to be set backwards
467 1.1 christos if the local clock time is more than 128 s
468 1.1 christos in the future relative to the server.
469 1.1 christos In some applications, this behavior may be unacceptable.
470 1.1 christos There are several solutions, however.
471 1.1 christos If the
472 1.1 christos .Fl x
473 1.1 christos option is included on the command line, the clock will
474 1.1 christos never be stepped and only slew corrections will be used.
475 1.1 christos But this choice comes with a cost that
476 1.1 christos should be carefully explored before deciding to use
477 1.1 christos the
478 1.1 christos .Fl x
479 1.1 christos option.
480 1.1 christos The maximum slew rate possible is limited
481 1.1 christos to 500 parts\-per\-million (PPM) as a consequence of the correctness
482 1.1 christos principles on which the NTP protocol and algorithm design are
483 1.1 christos based.
484 1.1 christos As a result, the local clock can take a long time to
485 1.1 christos converge to an acceptable offset, about 2,000 s for each second the
486 1.1 christos clock is outside the acceptable range.
487 1.1 christos During this interval the
488 1.1 christos local clock will not be consistent with any other network clock and
489 1.1 christos the system cannot be used for distributed applications that require
490 1.1 christos correctly synchronized network time.
491 1.1 christos .Pp
492 1.1 christos In spite of the above precautions, sometimes when large
493 1.1 christos frequency errors are present the resulting time offsets stray
494 1.1 christos outside the 128\-ms range and an eventual step or slew time
495 1.1 christos correction is required.
496 1.1 christos If following such a correction the
497 1.1 christos frequency error is so large that the first sample is outside the
498 1.1 christos acceptable range,
499 1.1 christos .Nm
500 1.1 christos enters the same state as when the
501 1.1 christos .Pa ntp.drift
502 1.1 christos file is not present.
503 1.1 christos The intent of this behavior
504 1.1 christos is to quickly correct the frequency and restore operation to the
505 1.1 christos normal tracking mode.
506 1.1 christos In the most extreme cases
507 1.1 christos (the host
508 1.1 christos .Cm time.ien.it
509 1.1 christos comes to mind), there may be occasional
510 1.1 christos step/slew corrections and subsequent frequency corrections.
511 1.1 christos It
512 1.1 christos helps in these cases to use the
513 1.1 christos .Cm burst
514 1.1 christos keyword when
515 1.1 christos configuring the server, but
516 1.1 christos ONLY
517 1.1 christos when you have permission to do so from the owner of the target host.
518 1.1 christos .Pp
519 1.1 christos Finally,
520 1.1 christos in the past many startup scripts would run
521 1.1 christos .Xr ntpdate 1ntpdatemdoc
522 1.1 christos to get the system clock close to correct before starting
523 1.1 christos .Xr ntpd 1ntpdmdoc ,
524 1.1 christos but this was never more than a mediocre hack and is no longer needed.
525 1.1.1.2 christos If you are following the instructions in
526 1.1.1.2 christos .Sx "Starting NTP (Best Current Practice)"
527 1.1.1.2 christos and you still need to set the system time before starting
528 1.1.1.2 christos .Nm ,
529 1.1.1.2 christos please open a bug report and document what is going on,
530 1.1.1.2 christos and then look at using
531 1.1.1.2 christos .Xr sntp 1sntpmdoc .
532 1.1 christos .Pp
533 1.1 christos There is a way to start
534 1.1 christos .Xr ntpd 1ntpdmdoc
535 1.1 christos that often addresses all of the problems mentioned above.
536 1.1 christos .Ss "Starting NTP (Best Current Practice)"
537 1.1 christos First, use the
538 1.1 christos .Cm iburst
539 1.1 christos option on your
540 1.1 christos .Cm server
541 1.1 christos entries.
542 1.1 christos .Pp
543 1.1 christos If you can also keep a good
544 1.1 christos .Pa ntp.drift
545 1.1 christos file then
546 1.1 christos .Xr ntpd 1ntpdmdoc
547 1.1 christos will effectively "warm\-start" and your system's clock will
548 1.1 christos be stable in under 11 seconds' time.
549 1.1 christos .Pp
550 1.1 christos As soon as possible in the startup sequence, start
551 1.1 christos .Xr ntpd 1ntpdmdoc
552 1.1 christos with at least the
553 1.1 christos .Fl g
554 1.1 christos and perhaps the
555 1.1 christos .Fl N
556 1.1 christos options.
557 1.1 christos Then,
558 1.1 christos start the rest of your "normal" processes.
559 1.1 christos This will give
560 1.1 christos .Xr ntpd 1ntpdmdoc
561 1.1 christos as much time as possible to get the system's clock synchronized and stable.
562 1.1 christos .Pp
563 1.1 christos Finally,
564 1.1 christos if you have processes like
565 1.1 christos .Cm dovecot
566 1.1 christos or database servers
567 1.1 christos that require
568 1.1 christos monotonically\-increasing time,
569 1.1 christos run
570 1.1 christos .Xr ntp\-wait 1ntp\-waitmdoc
571 1.1 christos as late as possible in the boot sequence
572 1.1 christos (perhaps with the
573 1.1 christos .Fl v
574 1.1 christos flag)
575 1.1 christos and after
576 1.1 christos .Xr ntp\-wait 1ntp\-waitmdoc
577 1.1 christos exits successfully
578 1.1 christos it is as safe as it will ever be to start any process that require
579 1.1 christos stable time.
580 1.1 christos .Ss "Frequency Discipline"
581 1.1 christos The
582 1.1 christos .Nm
583 1.1 christos behavior at startup depends on whether the
584 1.1 christos frequency file, usually
585 1.1 christos .Pa ntp.drift ,
586 1.1 christos exists.
587 1.1 christos This file
588 1.1 christos contains the latest estimate of clock frequency error.
589 1.1 christos When the
590 1.1 christos .Nm
591 1.1 christos is started and the file does not exist, the
592 1.1 christos .Nm
593 1.1 christos enters a special mode designed to quickly adapt to
594 1.1 christos the particular system clock oscillator time and frequency error.
595 1.1 christos This takes approximately 15 minutes, after which the time and
596 1.1 christos frequency are set to nominal values and the
597 1.1 christos .Nm
598 1.1 christos enters
599 1.1 christos normal mode, where the time and frequency are continuously tracked
600 1.1 christos relative to the server.
601 1.1 christos After one hour the frequency file is
602 1.1 christos created and the current frequency offset written to it.
603 1.1 christos When the
604 1.1 christos .Nm
605 1.1 christos is started and the file does exist, the
606 1.1 christos .Nm
607 1.1 christos frequency is initialized from the file and enters normal mode
608 1.1 christos immediately.
609 1.1 christos After that the current frequency offset is written to
610 1.1 christos the file at hourly intervals.
611 1.1 christos .Ss "Operating Modes"
612 1.1 christos The
613 1.1 christos .Nm
614 1.1 christos utility can operate in any of several modes, including
615 1.1 christos symmetric active/passive, client/server broadcast/multicast and
616 1.1 christos manycast, as described in the
617 1.1 christos .Qq Association Management
618 1.1 christos page
619 1.1 christos (available as part of the HTML documentation
620 1.1 christos provided in
621 1.1 christos .Pa /usr/share/doc/ntp ) .
622 1.1 christos It normally operates continuously while
623 1.1 christos monitoring for small changes in frequency and trimming the clock
624 1.1 christos for the ultimate precision.
625 1.1 christos However, it can operate in a one\-time
626 1.1 christos mode where the time is set from an external server and frequency is
627 1.1 christos set from a previously recorded frequency file.
628 1.1 christos A
629 1.1 christos broadcast/multicast or manycast client can discover remote servers,
630 1.1 christos compute server\-client propagation delay correction factors and
631 1.1 christos configure itself automatically.
632 1.1 christos This makes it possible to deploy a
633 1.1 christos fleet of workstations without specifying configuration details
634 1.1 christos specific to the local environment.
635 1.1 christos .Pp
636 1.1 christos By default,
637 1.1 christos .Nm
638 1.1 christos runs in continuous mode where each of
639 1.1 christos possibly several external servers is polled at intervals determined
640 1.1 christos by an intricate state machine.
641 1.1 christos The state machine measures the
642 1.1 christos incidental roundtrip delay jitter and oscillator frequency wander
643 1.1 christos and determines the best poll interval using a heuristic algorithm.
644 1.1 christos Ordinarily, and in most operating environments, the state machine
645 1.1 christos will start with 64s intervals and eventually increase in steps to
646 1.1 christos 1024s.
647 1.1 christos A small amount of random variation is introduced in order to
648 1.1 christos avoid bunching at the servers.
649 1.1 christos In addition, should a server become
650 1.1 christos unreachable for some time, the poll interval is increased in steps
651 1.1 christos to 1024s in order to reduce network overhead.
652 1.1 christos .Pp
653 1.1 christos In some cases it may not be practical for
654 1.1 christos .Nm
655 1.1.1.2 christos to run continuously.
656 1.1 christos A common workaround has been to run the
657 1.1 christos .Xr ntpdate 1ntpdatemdoc
658 1.1.1.2 christos or
659 1.1.1.2 christos .Xr sntp 1sntpmdoc
660 1.1.1.2 christos programs from a
661 1.1 christos .Xr cron 8
662 1.1 christos job at designated
663 1.1 christos times.
664 1.1.1.2 christos However, these programs do not have the crafted signal
665 1.1.1.2 christos processing, error checking or mitigation algorithms of
666 1.1 christos .Nm .
667 1.1 christos The
668 1.1 christos .Fl q
669 1.1 christos option is intended for this purpose.
670 1.1 christos Setting this option will cause
671 1.1 christos .Nm
672 1.1 christos to exit just after
673 1.1 christos setting the clock for the first time.
674 1.1 christos The procedure for initially
675 1.1 christos setting the clock is the same as in continuous mode; most
676 1.1 christos applications will probably want to specify the
677 1.1 christos .Cm iburst
678 1.1 christos keyword with the
679 1.1 christos .Ic server
680 1.1 christos configuration command.
681 1.1 christos With this
682 1.1 christos keyword a volley of messages are exchanged to groom the data and
683 1.1 christos the clock is set in about 10 s.
684 1.1 christos If nothing is heard after a
685 1.1 christos couple of minutes, the daemon times out and exits.
686 1.1 christos After a suitable
687 1.1 christos period of mourning, the
688 1.1 christos .Xr ntpdate 1ntpdatemdoc
689 1.1.1.2 christos program will be
690 1.1 christos retired.
691 1.1 christos .Pp
692 1.1 christos When kernel support is available to discipline the clock
693 1.1 christos frequency, which is the case for stock Solaris, Tru64, Linux and
694 1.1 christos .Fx ,
695 1.1 christos a useful feature is available to discipline the clock
696 1.1 christos frequency.
697 1.1 christos First,
698 1.1 christos .Nm
699 1.1 christos is run in continuous mode with
700 1.1 christos selected servers in order to measure and record the intrinsic clock
701 1.1 christos frequency offset in the frequency file.
702 1.1 christos It may take some hours for
703 1.1 christos the frequency and offset to settle down.
704 1.1 christos Then the
705 1.1 christos .Nm
706 1.1 christos is
707 1.1 christos stopped and run in one\-time mode as required.
708 1.1 christos At each startup, the
709 1.1 christos frequency is read from the file and initializes the kernel
710 1.1 christos frequency.
711 1.1 christos .Ss "Poll Interval Control"
712 1.1 christos This version of NTP includes an intricate state machine to
713 1.1 christos reduce the network load while maintaining a quality of
714 1.1 christos synchronization consistent with the observed jitter and wander.
715 1.1 christos There are a number of ways to tailor the operation in order enhance
716 1.1 christos accuracy by reducing the interval or to reduce network overhead by
717 1.1 christos increasing it.
718 1.1 christos However, the user is advised to carefully consider
719 1.1 christos the consequences of changing the poll adjustment range from the
720 1.1 christos default minimum of 64 s to the default maximum of 1,024 s.
721 1.1 christos The
722 1.1 christos default minimum can be changed with the
723 1.1 christos .Ic tinker
724 1.1 christos .Cm minpoll
725 1.1 christos command to a value not less than 16 s.
726 1.1 christos This value is used for all
727 1.1 christos configured associations, unless overridden by the
728 1.1 christos .Cm minpoll
729 1.1 christos option on the configuration command.
730 1.1 christos Note that most device drivers
731 1.1 christos will not operate properly if the poll interval is less than 64 s
732 1.1 christos and that the broadcast server and manycast client associations will
733 1.1 christos also use the default, unless overridden.
734 1.1 christos .Pp
735 1.1 christos In some cases involving dial up or toll services, it may be
736 1.1 christos useful to increase the minimum interval to a few tens of minutes
737 1.1 christos and maximum interval to a day or so.
738 1.1 christos Under normal operation
739 1.1 christos conditions, once the clock discipline loop has stabilized the
740 1.1 christos interval will be increased in steps from the minimum to the
741 1.1 christos maximum.
742 1.1 christos However, this assumes the intrinsic clock frequency error
743 1.1 christos is small enough for the discipline loop correct it.
744 1.1 christos The capture
745 1.1 christos range of the loop is 500 PPM at an interval of 64s decreasing by a
746 1.1 christos factor of two for each doubling of interval.
747 1.1 christos At a minimum of 1,024
748 1.1 christos s, for example, the capture range is only 31 PPM.
749 1.1 christos If the intrinsic
750 1.1 christos error is greater than this, the drift file
751 1.1 christos .Pa ntp.drift
752 1.1 christos will
753 1.1 christos have to be specially tailored to reduce the residual error below
754 1.1 christos this limit.
755 1.1 christos Once this is done, the drift file is automatically
756 1.1 christos updated once per hour and is available to initialize the frequency
757 1.1 christos on subsequent daemon restarts.
758 1.1 christos .Ss "The huff\-n'\-puff Filter"
759 1.1 christos In scenarios where a considerable amount of data are to be
760 1.1 christos downloaded or uploaded over telephone modems, timekeeping quality
761 1.1 christos can be seriously degraded.
762 1.1 christos This occurs because the differential
763 1.1 christos delays on the two directions of transmission can be quite large.
764 1.1 christos In
765 1.1 christos many cases the apparent time errors are so large as to exceed the
766 1.1 christos step threshold and a step correction can occur during and after the
767 1.1 christos data transfer is in progress.
768 1.1 christos .Pp
769 1.1 christos The huff\-n'\-puff filter is designed to correct the apparent time
770 1.1 christos offset in these cases.
771 1.1 christos It depends on knowledge of the propagation
772 1.1 christos delay when no other traffic is present.
773 1.1 christos In common scenarios this
774 1.1 christos occurs during other than work hours.
775 1.1 christos The filter maintains a shift
776 1.1 christos register that remembers the minimum delay over the most recent
777 1.1 christos interval measured usually in hours.
778 1.1 christos Under conditions of severe
779 1.1 christos delay, the filter corrects the apparent offset using the sign of
780 1.1 christos the offset and the difference between the apparent delay and
781 1.1 christos minimum delay.
782 1.1 christos The name of the filter reflects the negative (huff)
783 1.1 christos and positive (puff) correction, which depends on the sign of the
784 1.1 christos offset.
785 1.1 christos .Pp
786 1.1 christos The filter is activated by the
787 1.1 christos .Ic tinker
788 1.1 christos command and
789 1.1 christos .Cm huffpuff
790 1.1 christos keyword, as described in
791 1.1 christos .Xr ntp.conf 5 .
792 1.1 christos .Sh "ENVIRONMENT"
793 1.1 christos See \fBOPTION PRESETS\fP for configuration environment variables.
794 1.1 christos .Sh FILES
795 1.1 christos .Bl -tag -width /etc/ntp.drift -compact
796 1.1 christos .It Pa /etc/ntp.conf
797 1.1 christos the default name of the configuration file
798 1.1 christos .It Pa /etc/ntp.drift
799 1.1 christos the default name of the drift file
800 1.1 christos .It Pa /etc/ntp.keys
801 1.1 christos the default name of the key file
802 1.1 christos .El
803 1.1 christos .Sh "EXIT STATUS"
804 1.1 christos One of the following exit values will be returned:
805 1.1 christos .Bl -tag
806 1.1 christos .It 0 " (EXIT_SUCCESS)"
807 1.1 christos Successful program execution.
808 1.1 christos .It 1 " (EXIT_FAILURE)"
809 1.1 christos The operation failed or the command syntax was not valid.
810 1.1 christos .It 70 " (EX_SOFTWARE)"
811 1.1 christos libopts had an internal operational error. Please report
812 1.1 christos it to autogen\-users (a] lists.sourceforge.net. Thank you.
813 1.1 christos .El
814 1.1 christos .Sh "SEE ALSO"
815 1.1 christos .Xr ntp.conf 5 ,
816 1.1 christos .Xr ntpdate 1ntpdatemdoc ,
817 1.1 christos .Xr ntpdc 1ntpdcmdoc ,
818 1.1.1.2 christos .Xr ntpq 1ntpqmdoc ,
819 1.1.1.2 christos .Xr sntp 1sntpmdoc
820 1.1 christos .Pp
821 1.1 christos In addition to the manual pages provided,
822 1.1 christos comprehensive documentation is available on the world wide web
823 1.1 christos at
824 1.1 christos .Li http://www.ntp.org/ .
825 1.1 christos A snapshot of this documentation is available in HTML format in
826 1.1 christos .Pa /usr/share/doc/ntp .
827 1.1 christos .Rs
828 1.1 christos .%A David L. Mills
829 1.1 christos .%T Network Time Protocol (Version 1)
830 1.1 christos .%O RFC1059
831 1.1 christos .Re
832 1.1 christos .Rs
833 1.1 christos .%A David L. Mills
834 1.1 christos .%T Network Time Protocol (Version 2)
835 1.1 christos .%O RFC1119
836 1.1 christos .Re
837 1.1 christos .Rs
838 1.1 christos .%A David L. Mills
839 1.1 christos .%T Network Time Protocol (Version 3)
840 1.1 christos .%O RFC1305
841 1.1 christos .Re
842 1.1 christos .Rs
843 1.1 christos .%A David L. Mills
844 1.1 christos .%A J. Martin, Ed.
845 1.1 christos .%A J. Burbank
846 1.1 christos .%A W. Kasch
847 1.1 christos .%T Network Time Protocol Version 4: Protocol and Algorithms Specification
848 1.1 christos .%O RFC5905
849 1.1 christos .Re
850 1.1 christos .Rs
851 1.1 christos .%A David L. Mills
852 1.1 christos .%A B. Haberman, Ed.
853 1.1 christos .%T Network Time Protocol Version 4: Autokey Specification
854 1.1 christos .%O RFC5906
855 1.1 christos .Re
856 1.1 christos .Rs
857 1.1 christos .%A H. Gerstung
858 1.1 christos .%A C. Elliott
859 1.1 christos .%A B. Haberman, Ed.
860 1.1 christos .%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4)
861 1.1 christos .%O RFC5907
862 1.1 christos .Re
863 1.1 christos .Rs
864 1.1 christos .%A R. Gayraud
865 1.1 christos .%A B. Lourdelet
866 1.1 christos .%T Network Time Protocol (NTP) Server Option for DHCPv6
867 1.1 christos .%O RFC5908
868 1.1 christos .Re
869 1.1 christos .Sh "AUTHORS"
870 1.1 christos The University of Delaware
871 1.1 christos .Sh "COPYRIGHT"
872 1.1.1.2 christos Copyright (C) 1970\-2014 The University of Delaware all rights reserved.
873 1.1 christos This program is released under the terms of the NTP license, <http://ntp.org/license>.
874 1.1 christos .Sh BUGS
875 1.1 christos The
876 1.1 christos .Nm
877 1.1 christos utility has gotten rather fat.
878 1.1 christos While not huge, it has gotten
879 1.1 christos larger than might be desirable for an elevated\-priority
880 1.1 christos .Nm
881 1.1 christos running on a workstation, particularly since many of
882 1.1 christos the fancy features which consume the space were designed more with
883 1.1 christos a busy primary server, rather than a high stratum workstation in
884 1.1 christos mind.
885 1.1 christos .Pp
886 1.1 christos Please send bug reports to: http://bugs.ntp.org, bugs (a] ntp.org
887 1.1 christos .Sh NOTES
888 1.1 christos Portions of this document came from FreeBSD.
889 1.1 christos .Pp
890 1.1 christos This manual page was \fIAutoGen\fP\-erated from the \fBntpd\fP
891 1.1 christos option definitions.
892