1ea906c41SOllivier Robert/* -*- Mode: Text -*- */ 2ea906c41SOllivier Robert 3ea906c41SOllivier Robertautogen definitions options; 4ea906c41SOllivier Robert 5ea906c41SOllivier Robert#include copyright.def 6ea906c41SOllivier Robert 7ea906c41SOllivier Robertprog-name = "ntpd"; 8*c7a33fe3SAlexander Ziaeeprog-title = "set clock via Network Time Protocol daemon"; 92b15cb3dSCy Schubertargument = "[ <server1> ... <serverN> ]"; 10ea906c41SOllivier Robert 11ea906c41SOllivier Robert#include ntpdbase-opts.def 12ea906c41SOllivier Robert 132b15cb3dSCy Schubert/* explain: Additional information whenever the usage routine is invoked */ 142b15cb3dSCy Schubertexplain = <<- _END_EXPLAIN 152b15cb3dSCy Schubert _END_EXPLAIN; 162b15cb3dSCy Schubert 172b15cb3dSCy Schubertdoc-section = { 182b15cb3dSCy Schubert ds-type = 'DESCRIPTION'; 192b15cb3dSCy Schubert ds-format = 'mdoc'; 202b15cb3dSCy Schubert ds-text = <<- _END_PROG_MDOC_DESCRIP 212b15cb3dSCy SchubertThe 222b15cb3dSCy Schubert.Nm 232b15cb3dSCy Schubertutility is an operating system daemon which sets 242b15cb3dSCy Schubertand maintains the system time of day in synchronism with Internet 252b15cb3dSCy Schubertstandard time servers. 262b15cb3dSCy SchubertIt is a complete implementation of the 272b15cb3dSCy SchubertNetwork Time Protocol (NTP) version 4, as defined by RFC-5905, 282b15cb3dSCy Schubertbut also retains compatibility with 292b15cb3dSCy Schubertversion 3, as defined by RFC-1305, and versions 1 302b15cb3dSCy Schubertand 2, as defined by RFC-1059 and RFC-1119, respectively. 312b15cb3dSCy Schubert.Pp 322b15cb3dSCy SchubertThe 332b15cb3dSCy Schubert.Nm 342b15cb3dSCy Schubertutility does most computations in 64-bit floating point 352b15cb3dSCy Schubertarithmetic and does relatively clumsy 64-bit fixed point operations 362b15cb3dSCy Schubertonly when necessary to preserve the ultimate precision, about 232 372b15cb3dSCy Schubertpicoseconds. 382b15cb3dSCy SchubertWhile the ultimate precision is not achievable with 392b15cb3dSCy Schubertordinary workstations and networks of today, it may be required 402b15cb3dSCy Schubertwith future gigahertz CPU clocks and gigabit LANs. 412b15cb3dSCy Schubert.Pp 422b15cb3dSCy SchubertOrdinarily, 432b15cb3dSCy Schubert.Nm 442b15cb3dSCy Schubertreads the 452b15cb3dSCy Schubert.Xr ntp.conf 5 462b15cb3dSCy Schubertconfiguration file at startup time in order to determine the 472b15cb3dSCy Schubertsynchronization sources and operating modes. 482b15cb3dSCy SchubertIt is also possible to 492b15cb3dSCy Schubertspecify a working, although limited, configuration entirely on the 502b15cb3dSCy Schubertcommand line, obviating the need for a configuration file. 512b15cb3dSCy SchubertThis may 522b15cb3dSCy Schubertbe particularly useful when the local host is to be configured as a 532b15cb3dSCy Schubertbroadcast/multicast client, with all peers being determined by 542b15cb3dSCy Schubertlistening to broadcasts at run time. 552b15cb3dSCy Schubert.Pp 562b15cb3dSCy SchubertIf NetInfo support is built into 572b15cb3dSCy Schubert.Nm , 582b15cb3dSCy Schubertthen 592b15cb3dSCy Schubert.Nm 602b15cb3dSCy Schubertwill attempt to read its configuration from the 612b15cb3dSCy SchubertNetInfo if the default 622b15cb3dSCy Schubert.Xr ntp.conf 5 632b15cb3dSCy Schubertfile cannot be read and no file is 642b15cb3dSCy Schubertspecified by the 652b15cb3dSCy Schubert.Fl c 662b15cb3dSCy Schubertoption. 672b15cb3dSCy Schubert.Pp 682b15cb3dSCy SchubertVarious internal 692b15cb3dSCy Schubert.Nm 702b15cb3dSCy Schubertvariables can be displayed and 712b15cb3dSCy Schubertconfiguration options altered while the 722b15cb3dSCy Schubert.Nm 732b15cb3dSCy Schubertis running 742b15cb3dSCy Schubertusing the 752b15cb3dSCy Schubert.Xr ntpq 1ntpqmdoc 762b15cb3dSCy Schubertand 772b15cb3dSCy Schubert.Xr ntpdc 1ntpdcmdoc 782b15cb3dSCy Schubertutility programs. 792b15cb3dSCy Schubert.Pp 802b15cb3dSCy SchubertWhen 812b15cb3dSCy Schubert.Nm 822b15cb3dSCy Schubertstarts it looks at the value of 832b15cb3dSCy Schubert.Xr umask 2 , 842b15cb3dSCy Schubertand if zero 852b15cb3dSCy Schubert.Nm 862b15cb3dSCy Schubertwill set the 872b15cb3dSCy Schubert.Xr umask 2 882b15cb3dSCy Schubertto 022. 892b15cb3dSCy Schubert _END_PROG_MDOC_DESCRIP; 902b15cb3dSCy Schubert}; 912b15cb3dSCy Schubert 922b15cb3dSCy Schubertdoc-section = { 932b15cb3dSCy Schubert ds-type = 'USAGE'; 942b15cb3dSCy Schubert ds-format = 'mdoc'; 952b15cb3dSCy Schubert ds-text = <<- _END_MDOC_USAGE 962b15cb3dSCy Schubert.Ss "How NTP Operates" 972b15cb3dSCy SchubertThe 982b15cb3dSCy Schubert.Nm 992b15cb3dSCy Schubertutility operates by exchanging messages with 1002b15cb3dSCy Schubertone or more configured servers over a range of designated poll intervals. 1012b15cb3dSCy SchubertWhen 1022b15cb3dSCy Schubertstarted, whether for the first or subsequent times, the program 1032b15cb3dSCy Schubertrequires several exchanges from the majority of these servers so 1042b15cb3dSCy Schubertthe signal processing and mitigation algorithms can accumulate and 1052b15cb3dSCy Schubertgroom the data and set the clock. 1062b15cb3dSCy SchubertIn order to protect the network 1072b15cb3dSCy Schubertfrom bursts, the initial poll interval for each server is delayed 1082b15cb3dSCy Schubertan interval randomized over a few seconds. 1092b15cb3dSCy SchubertAt the default initial poll 1102b15cb3dSCy Schubertinterval of 64s, several minutes can elapse before the clock is 1112b15cb3dSCy Schubertset. 1122b15cb3dSCy SchubertThis initial delay to set the clock 1132b15cb3dSCy Schubertcan be safely and dramatically reduced using the 1142b15cb3dSCy Schubert.Cm iburst 1152b15cb3dSCy Schubertkeyword with the 1162b15cb3dSCy Schubert.Ic server 1172b15cb3dSCy Schubertconfiguration 1182b15cb3dSCy Schubertcommand, as described in 1192b15cb3dSCy Schubert.Xr ntp.conf 5 . 1202b15cb3dSCy Schubert.Pp 1212b15cb3dSCy SchubertMost operating systems and hardware of today incorporate a 1222b15cb3dSCy Schuberttime-of-year (TOY) chip to maintain the time during periods when 1232b15cb3dSCy Schubertthe power is off. 1242b15cb3dSCy SchubertWhen the machine is booted, the chip is used to 1252b15cb3dSCy Schubertinitialize the operating system time. 1262b15cb3dSCy SchubertAfter the machine has 1272b15cb3dSCy Schubertsynchronized to a NTP server, the operating system corrects the 1282b15cb3dSCy Schubertchip from time to time. 1292b15cb3dSCy SchubertIn the default case, if 1302b15cb3dSCy Schubert.Nm 1312b15cb3dSCy Schubertdetects that the time on the host 1322b15cb3dSCy Schubertis more than 1000s from the server time, 1332b15cb3dSCy Schubert.Nm 1342b15cb3dSCy Schubertassumes something must be terribly wrong and the only 1352b15cb3dSCy Schubertreliable action is for the operator to intervene and set the clock 1362b15cb3dSCy Schubertby hand. 1372b15cb3dSCy Schubert(Reasons for this include there is no TOY chip, 1382b15cb3dSCy Schubertor its battery is dead, or that the TOY chip is just of poor quality.) 1392b15cb3dSCy SchubertThis causes 1402b15cb3dSCy Schubert.Nm 1412b15cb3dSCy Schubertto exit with a panic message to 1422b15cb3dSCy Schubertthe system log. 1432b15cb3dSCy SchubertThe 1442b15cb3dSCy Schubert.Fl g 1452b15cb3dSCy Schubertoption overrides this check and the 1462b15cb3dSCy Schubertclock will be set to the server time regardless of the chip time 1472b15cb3dSCy Schubert(up to 68 years in the past or future \(em 1482b15cb3dSCy Schubertthis is a limitation of the NTPv4 protocol). 1492b15cb3dSCy SchubertHowever, and to protect against broken hardware, such as when the 1502b15cb3dSCy SchubertCMOS battery fails or the clock counter becomes defective, once the 1512b15cb3dSCy Schubertclock has been set an error greater than 1000s will cause 1522b15cb3dSCy Schubert.Nm 1532b15cb3dSCy Schubertto exit anyway. 1542b15cb3dSCy Schubert.Pp 1552b15cb3dSCy SchubertUnder ordinary conditions, 1562b15cb3dSCy Schubert.Nm 1572b15cb3dSCy Schubertadjusts the clock in 1582b15cb3dSCy Schubertsmall steps so that the timescale is effectively continuous and 1592b15cb3dSCy Schubertwithout discontinuities. 1602b15cb3dSCy SchubertUnder conditions of extreme network 1612b15cb3dSCy Schubertcongestion, the roundtrip delay jitter can exceed three seconds and 1622b15cb3dSCy Schubertthe synchronization distance, which is equal to one-half the 1632b15cb3dSCy Schubertroundtrip delay plus error budget terms, can become very large. 1642b15cb3dSCy SchubertThe 1652b15cb3dSCy Schubert.Nm 1662b15cb3dSCy Schubertalgorithms discard sample offsets exceeding 128 ms, 1672b15cb3dSCy Schubertunless the interval during which no sample offset is less than 128 1682b15cb3dSCy Schubertms exceeds 900s. 1692b15cb3dSCy SchubertThe first sample after that, no matter what the 1702b15cb3dSCy Schubertoffset, steps the clock to the indicated time. 1712b15cb3dSCy SchubertIn practice this 1722b15cb3dSCy Schubertreduces the false alarm rate where the clock is stepped in error to 1732b15cb3dSCy Schuberta vanishingly low incidence. 1742b15cb3dSCy Schubert.Pp 1752b15cb3dSCy SchubertAs the result of this behavior, once the clock has been set it 1762b15cb3dSCy Schubertvery rarely strays more than 128 ms even under extreme cases of 1772b15cb3dSCy Schubertnetwork path congestion and jitter. 1782b15cb3dSCy SchubertSometimes, in particular when 1792b15cb3dSCy Schubert.Nm 1802b15cb3dSCy Schubertis first started without a valid drift file 1812b15cb3dSCy Schuberton a system with a large intrinsic drift 1822b15cb3dSCy Schubertthe error might grow to exceed 128 ms, 1832b15cb3dSCy Schubertwhich would cause the clock to be set backwards 1842b15cb3dSCy Schubertif the local clock time is more than 128 s 1852b15cb3dSCy Schubertin the future relative to the server. 1862b15cb3dSCy SchubertIn some applications, this behavior may be unacceptable. 1872b15cb3dSCy SchubertThere are several solutions, however. 1882b15cb3dSCy SchubertIf the 1892b15cb3dSCy Schubert.Fl x 1902b15cb3dSCy Schubertoption is included on the command line, the clock will 1912b15cb3dSCy Schubertnever be stepped and only slew corrections will be used. 1922b15cb3dSCy SchubertBut this choice comes with a cost that 1932b15cb3dSCy Schubertshould be carefully explored before deciding to use 1942b15cb3dSCy Schubertthe 1952b15cb3dSCy Schubert.Fl x 1962b15cb3dSCy Schubertoption. 1972b15cb3dSCy SchubertThe maximum slew rate possible is limited 1982b15cb3dSCy Schubertto 500 parts-per-million (PPM) as a consequence of the correctness 1992b15cb3dSCy Schubertprinciples on which the NTP protocol and algorithm design are 2002b15cb3dSCy Schubertbased. 2012b15cb3dSCy SchubertAs a result, the local clock can take a long time to 2022b15cb3dSCy Schubertconverge to an acceptable offset, about 2,000 s for each second the 2032b15cb3dSCy Schubertclock is outside the acceptable range. 2042b15cb3dSCy SchubertDuring this interval the 2052b15cb3dSCy Schubertlocal clock will not be consistent with any other network clock and 2062b15cb3dSCy Schubertthe system cannot be used for distributed applications that require 2072b15cb3dSCy Schubertcorrectly synchronized network time. 2082b15cb3dSCy Schubert.Pp 2092b15cb3dSCy SchubertIn spite of the above precautions, sometimes when large 2102b15cb3dSCy Schubertfrequency errors are present the resulting time offsets stray 2112b15cb3dSCy Schubertoutside the 128-ms range and an eventual step or slew time 2122b15cb3dSCy Schubertcorrection is required. 2132b15cb3dSCy SchubertIf following such a correction the 2142b15cb3dSCy Schubertfrequency error is so large that the first sample is outside the 2152b15cb3dSCy Schubertacceptable range, 2162b15cb3dSCy Schubert.Nm 2172b15cb3dSCy Schubertenters the same state as when the 2182b15cb3dSCy Schubert.Pa ntp.drift 2192b15cb3dSCy Schubertfile is not present. 2202b15cb3dSCy SchubertThe intent of this behavior 2212b15cb3dSCy Schubertis to quickly correct the frequency and restore operation to the 2222b15cb3dSCy Schubertnormal tracking mode. 2232b15cb3dSCy SchubertIn the most extreme cases 2242b15cb3dSCy Schubert(the host 2252b15cb3dSCy Schubert.Cm time.ien.it 2262b15cb3dSCy Schubertcomes to mind), there may be occasional 2272b15cb3dSCy Schubertstep/slew corrections and subsequent frequency corrections. 2282b15cb3dSCy SchubertIt 2292b15cb3dSCy Schuberthelps in these cases to use the 2302b15cb3dSCy Schubert.Cm burst 2312b15cb3dSCy Schubertkeyword when 2322b15cb3dSCy Schubertconfiguring the server, but 2332b15cb3dSCy SchubertONLY 2342b15cb3dSCy Schubertwhen you have permission to do so from the owner of the target host. 2352b15cb3dSCy Schubert.Pp 2362b15cb3dSCy SchubertFinally, 2372b15cb3dSCy Schubertin the past many startup scripts would run 2382b15cb3dSCy Schubert.Xr ntpdate 1ntpdatemdoc 2399034852cSGleb Smirnoffor 2409034852cSGleb Smirnoff.Xr sntp 1sntpmdoc 2412b15cb3dSCy Schubertto get the system clock close to correct before starting 2422b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc , 2432b15cb3dSCy Schubertbut this was never more than a mediocre hack and is no longer needed. 2442b15cb3dSCy SchubertIf you are following the instructions in 2452b15cb3dSCy Schubert.Sx "Starting NTP (Best Current Practice)" 2462b15cb3dSCy Schubertand you still need to set the system time before starting 2472b15cb3dSCy Schubert.Nm , 2482b15cb3dSCy Schubertplease open a bug report and document what is going on, 2492b15cb3dSCy Schubertand then look at using 2509034852cSGleb Smirnoff.Xr sntp 1sntpmdoc 2519034852cSGleb Smirnoffif you really need to set the clock before starting 2529034852cSGleb Smirnoff.Nm . 2532b15cb3dSCy Schubert.Pp 2542b15cb3dSCy SchubertThere is a way to start 2552b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc 2562b15cb3dSCy Schubertthat often addresses all of the problems mentioned above. 2572b15cb3dSCy Schubert.Ss "Starting NTP (Best Current Practice)" 2582b15cb3dSCy SchubertFirst, use the 2592b15cb3dSCy Schubert.Cm iburst 2602b15cb3dSCy Schubertoption on your 2612b15cb3dSCy Schubert.Cm server 2622b15cb3dSCy Schubertentries. 2632b15cb3dSCy Schubert.Pp 2642b15cb3dSCy SchubertIf you can also keep a good 2652b15cb3dSCy Schubert.Pa ntp.drift 2662b15cb3dSCy Schubertfile then 2672b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc 2682b15cb3dSCy Schubertwill effectively "warm-start" and your system's clock will 2692b15cb3dSCy Schubertbe stable in under 11 seconds' time. 2702b15cb3dSCy Schubert.Pp 2712b15cb3dSCy SchubertAs soon as possible in the startup sequence, start 2722b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc 2732b15cb3dSCy Schubertwith at least the 2742b15cb3dSCy Schubert.Fl g 2752b15cb3dSCy Schubertand perhaps the 2762b15cb3dSCy Schubert.Fl N 2772b15cb3dSCy Schubertoptions. 2782b15cb3dSCy SchubertThen, 2792b15cb3dSCy Schubertstart the rest of your "normal" processes. 2802b15cb3dSCy SchubertThis will give 2812b15cb3dSCy Schubert.Xr ntpd 1ntpdmdoc 2822b15cb3dSCy Schubertas much time as possible to get the system's clock synchronized and stable. 2832b15cb3dSCy Schubert.Pp 2842b15cb3dSCy SchubertFinally, 2852b15cb3dSCy Schubertif you have processes like 2862b15cb3dSCy Schubert.Cm dovecot 2872b15cb3dSCy Schubertor database servers 2882b15cb3dSCy Schubertthat require 2892b15cb3dSCy Schubertmonotonically-increasing time, 2902b15cb3dSCy Schubertrun 2912b15cb3dSCy Schubert.Xr ntp-wait 1ntp-waitmdoc 2922b15cb3dSCy Schubertas late as possible in the boot sequence 2932b15cb3dSCy Schubert(perhaps with the 2942b15cb3dSCy Schubert.Fl v 2952b15cb3dSCy Schubertflag) 2962b15cb3dSCy Schubertand after 2972b15cb3dSCy Schubert.Xr ntp-wait 1ntp-waitmdoc 2982b15cb3dSCy Schubertexits successfully 2992b15cb3dSCy Schubertit is as safe as it will ever be to start any process that require 3002b15cb3dSCy Schubertstable time. 3012b15cb3dSCy Schubert.Ss "Frequency Discipline" 3022b15cb3dSCy SchubertThe 3032b15cb3dSCy Schubert.Nm 3042b15cb3dSCy Schubertbehavior at startup depends on whether the 3052b15cb3dSCy Schubertfrequency file, usually 3062b15cb3dSCy Schubert.Pa ntp.drift , 3072b15cb3dSCy Schubertexists. 3082b15cb3dSCy SchubertThis file 3092b15cb3dSCy Schubertcontains the latest estimate of clock frequency error. 3102b15cb3dSCy SchubertWhen the 3112b15cb3dSCy Schubert.Nm 3122b15cb3dSCy Schubertis started and the file does not exist, the 3132b15cb3dSCy Schubert.Nm 3142b15cb3dSCy Schubertenters a special mode designed to quickly adapt to 3152b15cb3dSCy Schubertthe particular system clock oscillator time and frequency error. 3162b15cb3dSCy SchubertThis takes approximately 15 minutes, after which the time and 3172b15cb3dSCy Schubertfrequency are set to nominal values and the 3182b15cb3dSCy Schubert.Nm 3192b15cb3dSCy Schubertenters 3202b15cb3dSCy Schubertnormal mode, where the time and frequency are continuously tracked 3212b15cb3dSCy Schubertrelative to the server. 3222b15cb3dSCy SchubertAfter one hour the frequency file is 3232b15cb3dSCy Schubertcreated and the current frequency offset written to it. 3242b15cb3dSCy SchubertWhen the 3252b15cb3dSCy Schubert.Nm 3262b15cb3dSCy Schubertis started and the file does exist, the 3272b15cb3dSCy Schubert.Nm 3282b15cb3dSCy Schubertfrequency is initialized from the file and enters normal mode 3292b15cb3dSCy Schubertimmediately. 3302b15cb3dSCy SchubertAfter that the current frequency offset is written to 3312b15cb3dSCy Schubertthe file at hourly intervals. 3322b15cb3dSCy Schubert.Ss "Operating Modes" 3332b15cb3dSCy SchubertThe 3342b15cb3dSCy Schubert.Nm 3352b15cb3dSCy Schubertutility can operate in any of several modes, including 3362b15cb3dSCy Schubertsymmetric active/passive, client/server broadcast/multicast and 3372b15cb3dSCy Schubertmanycast, as described in the 3382b15cb3dSCy Schubert.Qq Association Management 3392b15cb3dSCy Schubertpage 3402b15cb3dSCy Schubert(available as part of the HTML documentation 3412b15cb3dSCy Schubertprovided in 3422b15cb3dSCy Schubert.Pa /usr/share/doc/ntp ) . 3432b15cb3dSCy SchubertIt normally operates continuously while 3442b15cb3dSCy Schubertmonitoring for small changes in frequency and trimming the clock 3452b15cb3dSCy Schubertfor the ultimate precision. 3462b15cb3dSCy SchubertHowever, it can operate in a one-time 3472b15cb3dSCy Schubertmode where the time is set from an external server and frequency is 3482b15cb3dSCy Schubertset from a previously recorded frequency file. 3492b15cb3dSCy SchubertA 3502b15cb3dSCy Schubertbroadcast/multicast or manycast client can discover remote servers, 3512b15cb3dSCy Schubertcompute server-client propagation delay correction factors and 3522b15cb3dSCy Schubertconfigure itself automatically. 3532b15cb3dSCy SchubertThis makes it possible to deploy a 3542b15cb3dSCy Schubertfleet of workstations without specifying configuration details 3552b15cb3dSCy Schubertspecific to the local environment. 3562b15cb3dSCy Schubert.Pp 3572b15cb3dSCy SchubertBy default, 3582b15cb3dSCy Schubert.Nm 3592b15cb3dSCy Schubertruns in continuous mode where each of 3602b15cb3dSCy Schubertpossibly several external servers is polled at intervals determined 3612b15cb3dSCy Schubertby an intricate state machine. 3622b15cb3dSCy SchubertThe state machine measures the 3632b15cb3dSCy Schubertincidental roundtrip delay jitter and oscillator frequency wander 3642b15cb3dSCy Schubertand determines the best poll interval using a heuristic algorithm. 3652b15cb3dSCy SchubertOrdinarily, and in most operating environments, the state machine 3662b15cb3dSCy Schubertwill start with 64s intervals and eventually increase in steps to 3672b15cb3dSCy Schubert1024s. 3682b15cb3dSCy SchubertA small amount of random variation is introduced in order to 3692b15cb3dSCy Schubertavoid bunching at the servers. 3702b15cb3dSCy SchubertIn addition, should a server become 3712b15cb3dSCy Schubertunreachable for some time, the poll interval is increased in steps 3722b15cb3dSCy Schubertto 1024s in order to reduce network overhead. 3732b15cb3dSCy Schubert.Pp 3742b15cb3dSCy SchubertIn some cases it may not be practical for 3752b15cb3dSCy Schubert.Nm 3762b15cb3dSCy Schubertto run continuously. 3772b15cb3dSCy SchubertA common workaround has been to run the 3782b15cb3dSCy Schubert.Xr ntpdate 1ntpdatemdoc 3792b15cb3dSCy Schubertor 3802b15cb3dSCy Schubert.Xr sntp 1sntpmdoc 3812b15cb3dSCy Schubertprograms from a 3822b15cb3dSCy Schubert.Xr cron 8 3832b15cb3dSCy Schubertjob at designated 3842b15cb3dSCy Schuberttimes. 3852b15cb3dSCy SchubertHowever, these programs do not have the crafted signal 3862b15cb3dSCy Schubertprocessing, error checking or mitigation algorithms of 3872b15cb3dSCy Schubert.Nm . 3882b15cb3dSCy SchubertThe 3892b15cb3dSCy Schubert.Fl q 3902b15cb3dSCy Schubertoption is intended for this purpose. 3912b15cb3dSCy SchubertSetting this option will cause 3922b15cb3dSCy Schubert.Nm 3932b15cb3dSCy Schubertto exit just after 3942b15cb3dSCy Schubertsetting the clock for the first time. 3952b15cb3dSCy SchubertThe procedure for initially 3962b15cb3dSCy Schubertsetting the clock is the same as in continuous mode; most 3972b15cb3dSCy Schubertapplications will probably want to specify the 3982b15cb3dSCy Schubert.Cm iburst 3992b15cb3dSCy Schubertkeyword with the 4002b15cb3dSCy Schubert.Ic server 4012b15cb3dSCy Schubertconfiguration command. 4022b15cb3dSCy SchubertWith this 4032b15cb3dSCy Schubertkeyword a volley of messages are exchanged to groom the data and 4042b15cb3dSCy Schubertthe clock is set in about 10 s. 4052b15cb3dSCy SchubertIf nothing is heard after a 4062b15cb3dSCy Schubertcouple of minutes, the daemon times out and exits. 4072b15cb3dSCy SchubertAfter a suitable 4082b15cb3dSCy Schubertperiod of mourning, the 4092b15cb3dSCy Schubert.Xr ntpdate 1ntpdatemdoc 4102b15cb3dSCy Schubertprogram will be 4112b15cb3dSCy Schubertretired. 4122b15cb3dSCy Schubert.Pp 4132b15cb3dSCy SchubertWhen kernel support is available to discipline the clock 4142b15cb3dSCy Schubertfrequency, which is the case for stock Solaris, Tru64, Linux and 4152b15cb3dSCy Schubert.Fx , 4162b15cb3dSCy Schuberta useful feature is available to discipline the clock 4172b15cb3dSCy Schubertfrequency. 4182b15cb3dSCy SchubertFirst, 4192b15cb3dSCy Schubert.Nm 4202b15cb3dSCy Schubertis run in continuous mode with 4212b15cb3dSCy Schubertselected servers in order to measure and record the intrinsic clock 4222b15cb3dSCy Schubertfrequency offset in the frequency file. 4232b15cb3dSCy SchubertIt may take some hours for 4242b15cb3dSCy Schubertthe frequency and offset to settle down. 4252b15cb3dSCy SchubertThen the 4262b15cb3dSCy Schubert.Nm 4272b15cb3dSCy Schubertis 4282b15cb3dSCy Schubertstopped and run in one-time mode as required. 4292b15cb3dSCy SchubertAt each startup, the 4302b15cb3dSCy Schubertfrequency is read from the file and initializes the kernel 4312b15cb3dSCy Schubertfrequency. 4322b15cb3dSCy Schubert.Ss "Poll Interval Control" 4332b15cb3dSCy SchubertThis version of NTP includes an intricate state machine to 4342b15cb3dSCy Schubertreduce the network load while maintaining a quality of 4352b15cb3dSCy Schubertsynchronization consistent with the observed jitter and wander. 4362b15cb3dSCy SchubertThere are a number of ways to tailor the operation in order enhance 4372b15cb3dSCy Schubertaccuracy by reducing the interval or to reduce network overhead by 4382b15cb3dSCy Schubertincreasing it. 4392b15cb3dSCy SchubertHowever, the user is advised to carefully consider 4402b15cb3dSCy Schubertthe consequences of changing the poll adjustment range from the 4412b15cb3dSCy Schubertdefault minimum of 64 s to the default maximum of 1,024 s. 4422b15cb3dSCy SchubertThe 4432b15cb3dSCy Schubertdefault minimum can be changed with the 4442b15cb3dSCy Schubert.Ic tinker 4452b15cb3dSCy Schubert.Cm minpoll 4462b15cb3dSCy Schubertcommand to a value not less than 16 s. 4472b15cb3dSCy SchubertThis value is used for all 4482b15cb3dSCy Schubertconfigured associations, unless overridden by the 4492b15cb3dSCy Schubert.Cm minpoll 4502b15cb3dSCy Schubertoption on the configuration command. 4512b15cb3dSCy SchubertNote that most device drivers 4522b15cb3dSCy Schubertwill not operate properly if the poll interval is less than 64 s 4532b15cb3dSCy Schubertand that the broadcast server and manycast client associations will 4542b15cb3dSCy Schubertalso use the default, unless overridden. 4552b15cb3dSCy Schubert.Pp 4562b15cb3dSCy SchubertIn some cases involving dial up or toll services, it may be 4572b15cb3dSCy Schubertuseful to increase the minimum interval to a few tens of minutes 4582b15cb3dSCy Schubertand maximum interval to a day or so. 4592b15cb3dSCy SchubertUnder normal operation 4602b15cb3dSCy Schubertconditions, once the clock discipline loop has stabilized the 4612b15cb3dSCy Schubertinterval will be increased in steps from the minimum to the 4622b15cb3dSCy Schubertmaximum. 4632b15cb3dSCy SchubertHowever, this assumes the intrinsic clock frequency error 4642b15cb3dSCy Schubertis small enough for the discipline loop correct it. 4652b15cb3dSCy SchubertThe capture 4662b15cb3dSCy Schubertrange of the loop is 500 PPM at an interval of 64s decreasing by a 4672b15cb3dSCy Schubertfactor of two for each doubling of interval. 4682b15cb3dSCy SchubertAt a minimum of 1,024 4692b15cb3dSCy Schuberts, for example, the capture range is only 31 PPM. 4702b15cb3dSCy SchubertIf the intrinsic 4712b15cb3dSCy Schuberterror is greater than this, the drift file 4722b15cb3dSCy Schubert.Pa ntp.drift 4732b15cb3dSCy Schubertwill 4742b15cb3dSCy Schuberthave to be specially tailored to reduce the residual error below 4752b15cb3dSCy Schubertthis limit. 4762b15cb3dSCy SchubertOnce this is done, the drift file is automatically 4772b15cb3dSCy Schubertupdated once per hour and is available to initialize the frequency 4782b15cb3dSCy Schuberton subsequent daemon restarts. 4792b15cb3dSCy Schubert.Ss "The huff-n'-puff Filter" 4802b15cb3dSCy SchubertIn scenarios where a considerable amount of data are to be 4812b15cb3dSCy Schubertdownloaded or uploaded over telephone modems, timekeeping quality 4822b15cb3dSCy Schubertcan be seriously degraded. 4832b15cb3dSCy SchubertThis occurs because the differential 4842b15cb3dSCy Schubertdelays on the two directions of transmission can be quite large. 4852b15cb3dSCy SchubertIn 4862b15cb3dSCy Schubertmany cases the apparent time errors are so large as to exceed the 4872b15cb3dSCy Schubertstep threshold and a step correction can occur during and after the 4882b15cb3dSCy Schubertdata transfer is in progress. 4892b15cb3dSCy Schubert.Pp 4902b15cb3dSCy SchubertThe huff-n'-puff filter is designed to correct the apparent time 4912b15cb3dSCy Schubertoffset in these cases. 4922b15cb3dSCy SchubertIt depends on knowledge of the propagation 4932b15cb3dSCy Schubertdelay when no other traffic is present. 4942b15cb3dSCy SchubertIn common scenarios this 4952b15cb3dSCy Schubertoccurs during other than work hours. 4962b15cb3dSCy SchubertThe filter maintains a shift 4972b15cb3dSCy Schubertregister that remembers the minimum delay over the most recent 4982b15cb3dSCy Schubertinterval measured usually in hours. 4992b15cb3dSCy SchubertUnder conditions of severe 5002b15cb3dSCy Schubertdelay, the filter corrects the apparent offset using the sign of 5012b15cb3dSCy Schubertthe offset and the difference between the apparent delay and 5022b15cb3dSCy Schubertminimum delay. 5032b15cb3dSCy SchubertThe name of the filter reflects the negative (huff) 5042b15cb3dSCy Schubertand positive (puff) correction, which depends on the sign of the 5052b15cb3dSCy Schubertoffset. 5062b15cb3dSCy Schubert.Pp 5072b15cb3dSCy SchubertThe filter is activated by the 5082b15cb3dSCy Schubert.Ic tinker 5092b15cb3dSCy Schubertcommand and 5102b15cb3dSCy Schubert.Cm huffpuff 5112b15cb3dSCy Schubertkeyword, as described in 5122b15cb3dSCy Schubert.Xr ntp.conf 5 . 5132b15cb3dSCy Schubert _END_MDOC_USAGE; 5142b15cb3dSCy Schubert}; 5152b15cb3dSCy Schubert 5162b15cb3dSCy Schubertdoc-section = { 5172b15cb3dSCy Schubert ds-type = 'FILES'; 5182b15cb3dSCy Schubert ds-format = 'mdoc'; 5192b15cb3dSCy Schubert ds-text = <<- _END_MDOC_FILES 5202b15cb3dSCy Schubert.Bl -tag -width /etc/ntp.drift -compact 5212b15cb3dSCy Schubert.It Pa /etc/ntp.conf 5222b15cb3dSCy Schubertthe default name of the configuration file 5232b15cb3dSCy Schubert.It Pa /etc/ntp.drift 5242b15cb3dSCy Schubertthe default name of the drift file 5252b15cb3dSCy Schubert.It Pa /etc/ntp.keys 5262b15cb3dSCy Schubertthe default name of the key file 5272b15cb3dSCy Schubert.El 5282b15cb3dSCy Schubert _END_MDOC_FILES; 5292b15cb3dSCy Schubert}; 5302b15cb3dSCy Schubert 5312b15cb3dSCy Schubertdoc-section = { 5322b15cb3dSCy Schubert ds-type = 'SEE ALSO'; 5332b15cb3dSCy Schubert ds-format = 'mdoc'; 5342b15cb3dSCy Schubert ds-text = <<- _END_MDOC_SEE_ALSO 5352b15cb3dSCy Schubert.Xr ntp.conf 5 , 5362b15cb3dSCy Schubert.Xr ntpdate 1ntpdatemdoc , 5372b15cb3dSCy Schubert.Xr ntpdc 1ntpdcmdoc , 5382b15cb3dSCy Schubert.Xr ntpq 1ntpqmdoc , 5392b15cb3dSCy Schubert.Xr sntp 1sntpmdoc 5402b15cb3dSCy Schubert.Pp 5412b15cb3dSCy SchubertIn addition to the manual pages provided, 5422b15cb3dSCy Schubertcomprehensive documentation is available on the world wide web 5432b15cb3dSCy Schubertat 5442b15cb3dSCy Schubert.Li http://www.ntp.org/ . 5452b15cb3dSCy SchubertA snapshot of this documentation is available in HTML format in 5462b15cb3dSCy Schubert.Pa /usr/share/doc/ntp . 5472b15cb3dSCy Schubert.Rs 5482b15cb3dSCy Schubert.%A David L. Mills 5492b15cb3dSCy Schubert.%T Network Time Protocol (Version 1) 5502b15cb3dSCy Schubert.%O RFC1059 5512b15cb3dSCy Schubert.Re 5522b15cb3dSCy Schubert.Rs 5532b15cb3dSCy Schubert.%A David L. Mills 5542b15cb3dSCy Schubert.%T Network Time Protocol (Version 2) 5552b15cb3dSCy Schubert.%O RFC1119 5562b15cb3dSCy Schubert.Re 5572b15cb3dSCy Schubert.Rs 5582b15cb3dSCy Schubert.%A David L. Mills 5592b15cb3dSCy Schubert.%T Network Time Protocol (Version 3) 5602b15cb3dSCy Schubert.%O RFC1305 5612b15cb3dSCy Schubert.Re 5622b15cb3dSCy Schubert.Rs 5632b15cb3dSCy Schubert.%A David L. Mills 5642b15cb3dSCy Schubert.%A J. Martin, Ed. 5652b15cb3dSCy Schubert.%A J. Burbank 5662b15cb3dSCy Schubert.%A W. Kasch 5672b15cb3dSCy Schubert.%T Network Time Protocol Version 4: Protocol and Algorithms Specification 5682b15cb3dSCy Schubert.%O RFC5905 5692b15cb3dSCy Schubert.Re 5702b15cb3dSCy Schubert.Rs 5712b15cb3dSCy Schubert.%A David L. Mills 5722b15cb3dSCy Schubert.%A B. Haberman, Ed. 5732b15cb3dSCy Schubert.%T Network Time Protocol Version 4: Autokey Specification 5742b15cb3dSCy Schubert.%O RFC5906 5752b15cb3dSCy Schubert.Re 5762b15cb3dSCy Schubert.Rs 5772b15cb3dSCy Schubert.%A H. Gerstung 5782b15cb3dSCy Schubert.%A C. Elliott 5792b15cb3dSCy Schubert.%A B. Haberman, Ed. 5802b15cb3dSCy Schubert.%T Definitions of Managed Objects for Network Time Protocol Version 4: (NTPv4) 5812b15cb3dSCy Schubert.%O RFC5907 5822b15cb3dSCy Schubert.Re 5832b15cb3dSCy Schubert.Rs 5842b15cb3dSCy Schubert.%A R. Gayraud 5852b15cb3dSCy Schubert.%A B. Lourdelet 5862b15cb3dSCy Schubert.%T Network Time Protocol (NTP) Server Option for DHCPv6 5872b15cb3dSCy Schubert.%O RFC5908 5882b15cb3dSCy Schubert.Re 5892b15cb3dSCy Schubert _END_MDOC_SEE_ALSO; 5902b15cb3dSCy Schubert}; 5912b15cb3dSCy Schubert 5922b15cb3dSCy Schubertdoc-section = { 5932b15cb3dSCy Schubert ds-type = 'BUGS'; 5942b15cb3dSCy Schubert ds-format = 'mdoc'; 5952b15cb3dSCy Schubert ds-text = <<- _END_MDOC_BUGS 5962b15cb3dSCy SchubertThe 5972b15cb3dSCy Schubert.Nm 5982b15cb3dSCy Schubertutility has gotten rather fat. 5992b15cb3dSCy SchubertWhile not huge, it has gotten 6002b15cb3dSCy Schubertlarger than might be desirable for an elevated-priority 6012b15cb3dSCy Schubert.Nm 6022b15cb3dSCy Schubertrunning on a workstation, particularly since many of 6032b15cb3dSCy Schubertthe fancy features which consume the space were designed more with 6042b15cb3dSCy Schuberta busy primary server, rather than a high stratum workstation in 6052b15cb3dSCy Schubertmind. 6062b15cb3dSCy Schubert _END_MDOC_BUGS; 6072b15cb3dSCy Schubert}; 6082b15cb3dSCy Schubert 6092b15cb3dSCy Schubertdoc-section = { 6102b15cb3dSCy Schubert ds-type = 'NOTES'; 6112b15cb3dSCy Schubert ds-format = 'mdoc'; 6122b15cb3dSCy Schubert ds-text = <<- _END_MDOC_NOTES 6132b15cb3dSCy SchubertPortions of this document came from FreeBSD. 6142b15cb3dSCy Schubert _END_MDOC_NOTES; 6152b15cb3dSCy Schubert}; 616