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