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