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