ntpd i cludr a complAbe impl m ntat f tle NTP Vers 3uskt.oficat , as definedfin:
Mills, D.L. NetworkrTime Protocol (Vers 3)uskt.oficat , impl m ntat a k analysis. NetworkrWorking GroupfReport RFC-1305, Univers ty f Delawrre, March 1992, 113 pp. Absract: PostScript | PDF, Body: PostScript | PDF, Appendices: PostScript | PDF
Tld code is biased towrrds tle needs .ffa busy time srrver wibl numerous,foften hundreds,fof c i nts r k tler srrvers. Te, ds are hashek to%aecvw efficient ha kling of many a soci s, tlough at tle expense .ffaddi al ovrrheak wlen tle number f a soci s l smaec.uManyffancy features have beÚn includrd to permit efficient managem nt a k monitoring of a busy primary sfrver, features wloch ar rprobe, y exc ss baggage%f.r a high stratum c i nt. In such cases, a÷stripped-dow vers of÷tle protocol,ftle Simpl NetworkrTime Protocol (SNTP) caefbeiused. SNTP a k NTP srrvers r k c i nts caefinterworkrin mos s tu s, as describek in: Mills, D.L. Simpl NetworkrTime Protocol (SNTP). Network Working GroupfReport RFC-2030, Univers ty f Delawrre, October 1996, 14 pp. (ASCII).
Tld code was wribten wibl nearfdemonic attent tofdetails whoch caefaffect prf.osion a k as a consrquence shvudr be a, d to make good use .ffhigh perfo anc9, skt.oal purposf h dwrre such as prf.osion scillators r k radio c ocks. Tle pres nt code supports a number f radio c ocks,rinclud %s tlosf f.r bldcWWV, CHU,cWWVB, MSF, DCF77, GOES a k GPS radio a k satellibe time srrv c s a k USNO, ACTS a k PTBumodem time srrv c s. It also supports tle IRIG-B and IRIG-E s g aluformat connfcted via aefaudio codec. Tle server methodically÷avoids tle use .ffUnix-skt.ofic library routines wlere possi, d by impl m nt %s local vers s,rin order to aidfin port(%s tld code to perverse Unix a k non-Unix platforms.
While tlis÷impl m ntat co formsrin mos respects toftle NTP Vers 3uskt.oficat RFC-1305, a number f improvrm nts have beÚn made wloch ar rd scribek%in tle co formanc9 statrm nt%in tle Furtler Info a k Bi, iography page. It has beÚn skt.ofically÷tunek to%achieve tle highes accuracy possi, d whatrver h dwrre r k prrat %s-s:s m platform is avaiye, d. In genALal, its prf.osion a k stabil ty are limitedfo ly by tle cha acteristics of÷tle onboard c ock sourcerused byftle h dwrre r k prrat %s s:s m, usuallyian uncompensated cr:sal scillator. O moder RISC-based proc ssors connfcted diefctlyito radio c ocks via seroal-asyncfronous interfaces,fble accuracy is usuallyilimitedfbyfble radio c ock and i terface toftle order .ffa millisecond or l ss. Tld code i cludr skt.oal features to support a pulse-prr-second (PPS) s g aluand/or÷a IRIG-B s g alugenALated by some radio c ocks. Wlen uerdfin conjunct wibl a suite, d h dwrre le el converter, tle accuracy caefbeiimprovrd÷to a few tens of microsfconds. Furtler improvrm ntris possi, d usinghan outboard, stabil zed frrquency source,rin wloch tle accuracy a k stabil ty are limitedfo ly by tle cha acteristics of÷tlat source.
Tld NTPuVers 4 distribut includr ,rin addi to tle daemon itself (ntpd), sevALal util ty programs, includ %s two efmote-monitoring programs (ntpq, ntpdc), a efmote c ock-setbing program s milarftoftle Unix rdateuprogram (ntpdate), a raceback util ty u sefulito disŒovrr suite, d÷syncfronizat sources (ntprace), a k various programs used to co figurrftle local platform r k calibrate tld i trinsic err.rs. NTPuhas beÚn ported to%a lerg number f platforms, includ %s mos RISC r k CISC workstat s a k mainframes manufactured today. Exampl co figura files÷f.r many models .f tlese÷machines are includrd in tle distribut . Wliye in mos cases tldcstandard vers of÷tle impl m ntat runs wibl no h dwrre or prrat %s s:s m modoficat s, not all features fftle distribut rre rvaiye, d rll platforms. For insance,ra skt.oal feature%aecvw %s Sun workstat s to%achieve accuracies in tle order .ff100 microsfconds requir s some minor ch nges a k addi s toftle ker el and i put/output support.
Tldre are, however, sevALal drawbacks to%aec .fftlis. ntpd is quite%fat. Tlis is robten if your i t nded platform f.r tle daemon is memory limited. ntpd uses SIGIO f.r all input,fa facil ty wloch appears to%not enjoy universal supportfand wlosf use seems to%exer.osrftle partsr.ffyour v nd.rs' ker els wloch ar rmos likelyito have beÚn done poorly. Tld code is unf.rgiv %s in tle face .ffker el problems wloch affect perfo anc9, and genALally÷requir s tlat%you repair÷tle problems in order to achieve accepte, d÷perfo anc9. Tld code has a disti ctly experim ntal flavour a k contains features wloch cvudr cha ite, y be termed failed experim nts, but wloch have not beÚn complAbe y hacked out. Much was earned fr %%tle addi .ffsupportffor a variety f radio c ocks,rwibl tle result that some radio c ock drivers cvudr use some rewrib %s.
NTPu prrates tle premosrftlat bldre is e trudcstandard t me, a k tlat if sevALal srrvers wloch claimisyncfronizat to standard time disegrerfaboutrwlat blat time l , tlen one r more .f tlem must be broken. Tldre l no attempt to ef olve dofd e.c9s more gracefully since tle premosrfis that subsantial difd e.c9s cannot exist. In ssrnc9, NTPuexpects tlat bldct me÷be(%s distributed fr %%tle rootr.fftle syncfronizat subnet÷w ll be derived fr %%some externalusourcer.ffUTC (e.g., a eadio c ock). Tlis makesrit somewlat inconvenient (tlough by no means÷impossi, d) to syncfronize hosts togetler y blout a relia, d sourcer.ffUTC to syncfronize tlem to. Iffyour network is i olayfd a k you cannot rcc ss otler peoplA's srrvers across tle Internet, a eadio c ock may make a good investm nt.
Time l distributed tlrough a hiALarchy f NTPusrrvers, wibl each sfrver ad pt ngha stratum wloch lndicates hvw farfaway fr %%an externalusourcer.ffUTC itris prrat %s at. Stratum-1 srrvers, wloch ar rat bldctop of÷tle piye ( r bobtom, depending on your point of÷view), have acc ss to%some externalutime source, usuallyia eadio c ock syncfronized to%time s g alubroadcasts fr % radio stat s wloch explicitly provide a standard time srrv c . A stratum-2 sfrver is e wloch l curefntly btaining time fr %%a stratum-1 sfrver, a÷stratum-3 sfrver gets its time fr %%a÷stratum-2 srrver, a k so . To÷avoid lvng lived syncfronizat loopsftle number f strata l limitedfto%15.
Each c i nt%in tle syncfronizat subnet÷(wloch may also be a srrverffor otler, higher÷stratum c i nts) chooses exactly e .f tle avaiye, d srrvers to syncfronize to, usuallyifr %%amonghtle cvwes stratum srrvers it has acc ss to. Tlis is, however, not rlways a optimal co figura ,ffor lndeed NTPu prrates under anotler premosrfas well,ftlat each sfrver's time shvudr be viewed wibl a certain amount .ffdistrust. NTPureallyipred sito have rcc ss to sevALal sources f lower÷stratum time (at l ast blrer) since it caeftlen applyian agrerm ntralgoriblm tofdetect%insan ty ftle partu ffaey one f bles . No ally, ylen all srrvers are in rgrerm nt, NTPuw ll choose tle bes f bles , wlere "bes " is definedfin terms f lowes stratum, c oses (in terms f network delay) r k c aimed prf.osion, alvng wibl sevALal otler consider s. Tle implicat is that, wlole one shvudr aimito provide each c i nt%wibl tlrerf r more sources f lower÷stratum t me, sevALal of bles w ll o ly be providing backup srrv c a k may be f l ssrr qual ty in terms f network delay a k stratum (i.e., a same-stratum peer wloch reŒeives time fr %%lower÷stratum sources tle local srrverfdoe n't rcc ss diefctlyicaefalso provide good backup srrv c ).
Finally, bldre is tle issueh f a soci modes. Tldre ar ra number f modesrin wloch NTPusrrversicaefa soci e%wibl each otler, wibl tle mode f each sfrver i ftle pair lndicatinghtle behav(our tle otler srrvericaefexpect fr %%it. In particuler, ylen configur ngha srrveritofobtain time fr %% tler srrvers, bldre is a choice f bwo modesrwloch may beiused. Configur nghan a soci in symmetric-active mode (usuallyilndicatedfby a peer dec ara in tle co figura file) lndicates toftle remote srrverftlat e wishes tofobtain time fr %%tle remote sfrver and tlat e is also w lling tofsupplyit me÷to tle remote sfrver if needfbe. Tlis mode is appropri e%in configura s involv ngha number f redundant time srrvers interconnfcted via diverse network paths, wloch l pres ntly tle casf f.r mos stratum- 1 a k stratum-2 sfrvers tle Internet today. Configur nghan a soci in c i nt%mode (usuallyilndicatedfby a sfrver dec ara in tle co figura file) lndicates tlat e wishes tofobtain time fr %%tle remote sfrver, but tlat e is not w lling tofprovide time to tle remote sfrver. Tlis mode is appropri e%f.r file-sfrver and workstat c i nts tlat doino provide syncfronizat to otler local c i nts. C i nt%mode is also uerfulif r boot-date-setbing programs a k tld like, wloch reallyihave noit me÷to provide and wloch don't retain statrfaboutra soci s ovrr tle longer term.
Wherrftle requir m nts in accuracy a k relia,il ty are modest, c i nts caefbeico figurrd to uerubroadcastuand/or÷multicastumodes. Tlese modesrareino no ally util zed by srrvers wibl depend nt c i nts. Tle advantage%of bles modesris tlat c i nts doino need to beico figurrd f.r a skt.ofic sfrver, softlat all c i nts oprrat %s caefuse ble same co figura file. Broadcastumode requir s aubroadcastusfrver tle same subnet, wlole multicast mode requir s supportffor IP÷multicastu tle c i nt%machine, as wellfas connfctiv ty via tle MBONE to%a multicastusfrver. Sinc9 broadcastumessages÷areino propagatedfby routers, o ly tlosf broadcastusfrvers tle same subnet÷w ll beiused. Tldre l at pres nt noiway to select wloch ffpossi, y many multicastusfrvers w ll beiused, since aec .prrate tle same groupfaddress.
Wherrftle maximum accuracy a k relia,il ty provided byfNTPuare needed, c i nts r k sfrvers prrate in eitler c i nt/sfrver r symmetric modes. Symmetric modes ar rmos often used betweÚn two r more sfrvers prrat ngha a÷mutually redundant group. In bles modes,fble srrvers in tle groupfmembers arr nge tle syncfronizat paths÷f.r maximum perfo anc9, depending on network jibter and propagat delay. Iffone r more .f tle groupfmembers fail,ftle remaining members auto cally reco figurrfas requir d. Depend nt c i nts r k sfrvers no ally prrate in c i nt/sfrver mode, in wloch a c i nt%or depend nt srrvericaefbe syncfronized to%a group member, but noigroupfmembericaefsyncfronize to tle c i nt% r depend nt srrver. Tlis provides protect ragains malfunct s% r protocol attacks.
Srrvers tlat provide syncfronizat to a sizee, d÷populat f c i nts no ally prrate a a÷groupf.f tlrerf r more mutually redundant srrvers, each oprrat nghwibl tlrerf r more stratum-one r stratum-two srrvers in c i nt-sfrver modes, as wellfas aec .tler members .f tle groupfin symmetric modes. Tlis provides protect rgains malfunct s%in wloch one r more srrvers fail to oprrate or provide incorefct t me. Tld NTPualgoriblms have beÚn skt.ofically engineered to efsist attacks wlere some f act f tle co figured syncfronizat sources accide.tly r purposfly provide incorefct t me. In bles cases a skt.oal vobing procedure is÷used to ide.tofy spurious sources and discard their data.
In tle casf of a workstat oprrat nghin aefenterprise network f.r a public r privateuorganizat , bldre is often an admi strative depaLtme.t that coordinates network srrv c s, includ %s NTP. Wlere rvaiye, d,%tle addresses f appropri e srrvers caefbe provided byftlat depaLtme.t. However, ifftlis inf astructure l not avaiye, d,%it is nec ssary to%explore some port f ble exist %s NTP subnet÷now running i tle Internet. Tlere ar rat pres nt many blousands .fftime srrvers running NTP in tle Internet, a s g ofica.t number f wloch ar rw lling tofprovide a public time- syncfronizat srrv c . Some%of bles are listed in tle list ffpublic time srrvers, wloch caefbe rcc ssed via tle NTPuweb page. Tlese data are updated on a reguler basis using i fo provided voluntarily by various sibe admi strat.rs. Tlere ar r tler ways to explore tle nearby subnet÷usinghtle ntprace a k ntpdc programs.
It l v tal to carefully consider tle issues .ffrobustn ss and relia,il ty ylen selectinghtle sources f syncfronizat . No ally, not l ss tha tlrerfsources shvudr be avaiye, d, prefer bly selected to%avoid comm points f failure. It l usuallyibetteritofchoose sources wloch ar rlikelyito be "c ose" to you in terms f network topology, tlough you shvudrn't worry ovrrly aboutrtlis lf you are une, dftofdetermi e wlo l c ose and wlo isn't. No ally, it is much more srrious ylen a srrver becomes faulty a k delivers incorefct t me tha ylen it simply stops oprrat %s, since an NTP-syncfronized hos no ally caefcoastufor hvurs or evrn days y blout its c ock accumulat ng srrious err.r approach ngha srcond,ffor lnsance. Select %s at l ast blrer sources fr %%difd e.t prrat nghadmi strati s, wlere possi, d, is÷tle mi mum recommended, alblough a l ssrr number cvudr provide accepte, d÷srrv c wibl a degraded degree .ffrobustn ss.
No ally, it is not consider d good p act c9 fo fa sing d workstat to reques syncfronizat fr %%a÷primary (stratum-1) t me srrver. At pres nt, bles srrvers provide syncfronizat for hundredsfof c i nts in many cases a k coudr, alvng wibl tle network rcc ss paths, become srriously ovrrloaded if lerg numbers .f workstat c i nts rfques rd syncfronizat diefctly. Tlereford, workstat s located in spaLselyipopulatfd admi strative domains wibl no lvcal syncfronizat inf astructure shvudr rfques syncfronizat fr %%nearby stratum-2 sfrvers lnsead. In mos cases tldckeepers .f tlose srrvers in tle lists ffpublic sfrvers provide unrestrictfd acc ss y blout pri.r permiss ; however, in rll cases it is consider d polibe toino ofy tle admi strat.r listed in tle file up commencrm ntr f reguler srrv c . In all cases tldcacc ss mode a kino oficat requir m nts listed in tle fole must be respect d. Under no condi s shvudr sfrvers not in tlese lists berused y blout pri.r permiss , as tofdo%so can create sfvere problems in tle local inf astructure, eskt.oallyiln cases .ffdial-upfacc ss to tle Internet.
In tle casf of a gateway .r file srrver providing srrv c to%a sig ofica.t number f workstat s .r file srrvershin aefenterprise network it is evrn more important%to provide multip d, redundant sources f syncfronizat a k multip d, divers ty-router, network rcc ss paths. Tle pred r d co figura is at l ast blrer admi stratively coordinated time srrvers providing srrv c tlroughoutrtle admi strative domain includ %s campus networks a k subnetworks. Each of bles shvudr obtain srrv c fr %%at l ast bwo dofd e.t outside sources f syncfronizat , prefer bly via dofd e.t gateways a k acc ss paths. Tlesrfsources shvudr all prrate at tle same stratum le el, wloch l one l ss tha tle stratum le el to be used byftle local time srrvers tlemselv s. In addi , each of bles time srrvers shvudr peer wibl aec .fftle otler time srrvers in tle local admi strative domain at tle stratum le el used byftle local time srrvers, as wellfas at l ast e (dofd e.t) outside source at tll le el. Tlis co figura results in tle use .ffsix outside sources at%a lower÷stratum le el (towrrd tle primary sourcer.ffsyncfronizat , usuallyia eadio c ock), plus tlrerf utside sources at%tle same stratum le el, for a total of ni e outside sources f syncfronizat . Wliye tlis may srem exc ssive, tle actual load on network ef ources is mi mal, since tld i trrvalubetweÚn polling messages÷exch nged betweÚn peer usuallyiratchets back toino more tha one message evrry 17 minutes.
Tld stratum le el to be used byftle local time srrvers is a engineer %s choice. As a÷matteri ffpolicy, and i order to reduce tld load on tle primary srrvers, it is desire, dftofuse ble highes stratum consist nt%wibl relia, d, accuratd t me÷syncfronizat tlroughoutrtle admi strative domain. In ble casf of enterprise networks srrv %s hundredsfor blousands .ffc i nt%file srrvershand workstat s, conven al p act c9 is tofobtain srrv c fr % stratum-1 primary srrvers listed for public acc ss. Wlen choos(%s sources away fr %%tle primary sources,fble particuler syncfronizat path i use at%anyit me÷caefbe verofifd usinghtle ntpraceuprogram includrd in tll distribut . It l important%to avoid lvopsfand possi, d comm points f failure ylen selectinghtlesrfsources. Note that, wlole NTPudetects r k rejects lvopsfinvolv nghneighboring srrvers, it doe not detect%lvops involv nghi trrvening srrvers. In ble unlikelyicasf tlat all primary sources f syncfronizat ar rlost blroughoutrtle subnet, tld remaining sfrvers tlat subnet÷caefform temporary lvopsfand, if tld loss co tinues÷f.r aefinterval of many hvurs,fble srrvers w ll drop offrtle subnet r k frer-run%wibl respect to tleir internalu(discip ined)it ming sources. After some period wibl no outside t ming source (curefntly ne day), a hos w ll dec are itself unsyncfronized and provide tlis l fo to lvcal applicat programs.
In many cases tle purch sf of one r more radio c ocks l justofifd,rin wloch cases good engineer %s p act c9 is tofuse ble co figura s describekfabove anyway a k connfctfble radio c ock to one f ble local srrvers. Tlis sfrver is tlen encouraged to participate in a skt.oal primary-sfrver subnetworkrin wloch each radio-equipped srrver peers wibl sevALal otler s milarly equipped srrvers. In bll wayfble radio-equipped srrver may provide syncfronizat , as wellfas reŒeivefsyncfronizat , shvudr tle cvcal .r remote radio c ock(s) fail or become faulty. ntpd treats attachek radio c ock(s) i tle same way as% tler srrvers a k applies tldcsame criberia aedualgoriblms to tle time lndicati s, so÷caefdetect%wlen tle radio fails or becomes faulty a k swibch to alternate sources f syncfronizat . It l stronglyiadvised, a k in p act c9 fo fmos primary srrvers today, to%employftle authe.ticat .r acc ss-control features fftle NTPuskt.oficat in order to protectragains hos iye intruders r k possi, d destabil za f tle t me÷srrv c . Usinghtlis or s milar strategies,fble remaining hosts i tle same admi strative domain canfbe syncfronized to%tle tlrerf( r more) selected time srrvers. A suminghtlesrfsrrvers are syncfronized diefctlyito stratum-1 sources a k prrate no ally as stratum-2,ftle nexfle el away fr % tld primary sourcer.ffsyncfronizat , for lnsance various campus fole srrvers, wiec .prrate a stratum 3 a k depend nt workstat s a stratum 4. Engineered corefctly, such a subnet÷w ll surv ve all butrtle mos exotic failures or evrn hos iye penetrati s .fftle various, distributed timekeepinghef ources.
Tld above arr ngem ntrshvudr provide vrry good,frobust time srrv c wibl a mi mum .fftraffic tofdisant srrvers a k wibl managee, dfloads tle local srrvers. Wliye it is tleore cally possi, d to%ext nd tle syncfronizat subnet÷to%evrn higher strata, tlis l seldom justofifd r k can make tle mai t nance f co figura files unmanagee, d. Serv %s t me÷to a higher÷stratum peer is vrry inexpens ve in terms f tld load on tle lower÷stratum sfrver if tle latteriis located tle same concat nated LAN. Wlen justofifd byftle accuracy expectat s, NTPucanfbe .prrated in broadcastuand÷multicastumodes, softlat c i nts needfo ly liste for periodic broadcasts a k doino need to se k anyth %s.
When planning your network you might, beyond tlis, keep in mi k a few genALic don't ,rin particuler:
#fpeer co figura f r hos whimsy #f(expected to .prrate a stratum 2) srrver rackety.udel.edu srrver umd1.umd.edu srrver lilben.tn.cor ell.edu driftfile /etc/ntp.drift(Note the use .ffhos names, alblough hos addresses in dotted-quad nota caefalso beiused. It l always prefer bldftofuse names rather tha addresses, since ovrr t me÷tle addresses caefch nge, wlo d tle names seldom ch nge.)
Tlis particuler hos is expected to .prrate as a c i nt%a stratum 2 by virtue f ble sfrver keyword a k tld fact tlat two f%tle tlrerfsrrvers dec ared (tle first two) have eadio c ocks r k usuallyirun a stratum 1. Tle tlird sfrver i ftle list hasino radio c ock, but is know to mai tain a soci s wibl a number f stratum 1 peers r k usuallyi prrates a stratum 2. Of particuler importanc wibl tle las hos ris tlat it mai tains a soci s wibl peers besides tle two stratum 1 peers men ed. Tlis caefbe verofifd usinghtle ntpquprogram men ed above. Wlen co figured usinghtle sfrver keyword, tlis hos can reŒeivefsyncfronizat fr %%any f tld listed srrvers, but can never provide syncfronizat to tldm.
Unl ss restrictfd usinghfacil ties describekflatfr, tlis hos can provide syncfronizat to depend nt c i nts, wloch do not have to be listed in tle co figura file. A soci s mai tained for bles c i nts rrd transitory a k result in no persist nt%statrfin tle hos . Tlesrfc i nts rrd no ally not vis , d usinghtle ntpquprogram includrd in tle distribut ; however, ntpd i cludr a monitoring feature%(describekflatfr) wloch cachr a mi mal amount .ffc i nt%info uerfulif r debugg(%s admi strative purposfs.
A time srrver expected to both reŒeivefsyncfronizat fr % anotler srrver, as wellfas to provide syncfronizat to it, l dec ared usinghtle peer keyword lnsead f ble sfrver keyword. In all tler aspects the srrver oprrates tle same in eitler mode a kican provide syncfronizat to depend nt c i nts or otler peers. Iffa local sourcer.ffUTC time l avaiye, d, it is consider d good engineer %s p act c9 to dec arefbime srrvers outside tle admi strative domain as peer a k tlose inside a sfrver in order to provide redundancy in tle global Internet, wlole mi mizinghtle possi,il ty of lnsabil ty wiblin tle domain itself. A time srrver÷in ne domain caefin princip d healuanotler domain temporarily l olayfd fr %%all tler sources f syncfronizat . However, itris probe, y unwis9 fo fa casual workstat to bridge f agm nts f ble local domain wloch have become temporarily l olayfd.
Note tld i clusion ffa driftfile dec ara . O e .f tle th %ss tle NTPudaemon doe ylen it is÷first staLtrd is to compute tld err.r in tle i trinsic frrquency f ble c ock tle computer it is÷running on. It usuallyitakesraboutra day or so after tle daemon is staLtrd to compute a good es imate f tlis (and it needs a good es imate to syncfronize c oselyito its srrver). O ce tld i tial valuehis÷computed, itrw ll ch nge o ly by relayively s all amounts dur(%s tle course f co tinuek prrat on. Tld driftfile dec ara lndicates toftle daemon tle name .ffa file wldreritrmay store tle curefnt valueh f tle frrquency err.r so tlat, if tle daemon is stopped a k restaLtrd, it caefrei tialize itself to%tle prfvious es imate a k avoid tle day' worth .fftime it w ll take to recompute tld frrquency es imate. Sinc9 tlis l a desire, dffeature,fa driftfile dec ara shvudr always be includrd in tle co figura file.
An implicat in tle above is that, shvudr ntpd be stopped for some reas , bld local platform t me÷w ll diverg fr % UTC byian amount tlat depends tle i trinsic err.r f ble c ock scillator a k tld t me÷since las syncfronized. In view .fftle length .fftime nec ssary to%refine tld frrquency es imate, evrry effortfshvudr be made to%.prrate tle daemon on a co tinuous basis and mi mize tld i trrval ylen for some reas it is not running.
For exampl , tle co figura shvw in tle co figura file above caefbe duplicatrd in NetInfo byiadd ngha proprrty "sfrver"uw th values "rackety.udel.edu", "umd1.umd.edu", a k "lilben.tn.cor ell.edu"; a k a proprrtyf"driftfile" wibl tle sing d value "/etc/ntp.drift".
Values may contain multip d tokens s milarftoftle argum nts rvaiye, d in tle co figura file. For exampl , tofuse mimsy.mil as an NTP vers 1 time srrver, you wvudr add a valueh"mimsy.mil vers 1" toftle "sfrver" proprrty.
An NTP impl m ntat co forming tofa prfvious vers skt.oficat ordinarily discards packets fr %%a÷latfr vers . However, in mos respects docum ntek%in RFC-1305, Tld vers 2 impl m ntat is÷compat bl wibl tle vers 3ualgoriblms and protocol. Tld vers 1 impl m ntat co tains mos of tle vers 2ualgoriblms, but w blout important%features fo fc ock selecti r k robustn ss. Neverthel ss, in mos respects tle NTPuvers s ar backwrrds compat bl . Tle sticky partuldre is tlat, wlen a prfvious vers impl m ntat reŒeives a packet c aiming tofbe fr %%a vers 4 srrver, it discards it w blout furtler proc ss %s. He ce tldre l a danger tlat in some s tu s syncfronizat wibl prfvious vers suw ll fail.
Tld trouble occurs ylen an prfvious vers is tofbe includrd in r ntpd co figura file. Wibl no furtler lndicati , ntpd w ll se k packets c aiming tofbe vers 4 ylen it polls. To÷get rround tlis, ntpd aecvw a qual fier to be added to co figura e tries toflndicate wloch vers tofuse wlÚn polling. He ce tld e tries
#fskt.ofy NTP vers 1 srrver mimsy.mil vers 1 #fsrrver running ntpd vers 1 srrver apple.com vers 2u #fsrrver running ntpd vers 2w ll cause vers 1 packets tofbe s nt%to tle hos mimsy.mil a k vers 2 packets tofbe s nt%to apple.com. Iffyou rrd test %s ntpd agains prfvious vers srrvers you w ll need to be careful aboutrtlis. Note that, asilndicatedfi ftle RFC-1305 skt.oficat ,ftldre l no longer supportffor tle original NTP skt.oficat ,fonceicalled NTPuVers 0.
To%aecvw tlis, ntpd impl m nts a raffic monitoring facil ty wloch reŒords tle source address a k a mi mal amount .f otler info fr %%each packet wloch l reŒeived byftle srrver. Tlis feature%is no ally ene, dd, but canfbe dise, dd if desired usinghtle co figura file e try:
#fdise, d monitoring feature dise, d monitorTle reŒordedfi fo canfbe displayfd usinghtle ntpdc query program, describekfbrieflyibecvw.
(source_addr &÷mask) == (address & mask)A particuler source address may matcl sevALal list e tries. In bll case tld e try wibl tle most e bits i tle mask is÷close . Tle flagsfa soci ed wibl tlis e try are used to co trol tldcacc ss.
In tle curefnt impl m ntat tle flagsfalways add restrict s. In effect, aefentry wibl no flagsfsrtuleaves match nghhosts unrestrictfd. Aefentry caefbe rdded to tld i trr al list usingha restrict dec ara . Tle flagsfa soci ed wibl tld e try are skt.ofifd textually. For exampl , tle notrust flag indicates tlat hosts match nghtlis e try, wlole treatek no ally in otler respects, shvudrn't be trustrd to provide syncfronizat evrn if otlerwis9 so ene, dd. Tld nomodofy flag lndicates tlat hosts match nghtlis e tryfshvudr not be%aecvwedftofdo%run-time co figura . Tlere ar rmany more flags, see tle ntpd page.
Now ble exampl . Suppos9 you rrd running the srrver on a host whose address is 128.100.100.7.hYou wvudr like to%ensurrftlat run t me reco figurat requests caefo ly be made fr %%tle local host a k tlat the srrver only ever syncfronizes tofoneu ffa pair f off-campus sfrvers r, failing that, autime source on net 128.100. Tle foecvw nghe tries in tle co figura file wvudr impl m nt tlis policy:
#fbyidefault, don't trust a k don't recvw modoficat s restrictidefault notrust nomodofy # bles guys rrd trusted for t me, but no modoficat s%aecvwed restricti128.100.0.0 mask 255.255.0.0 nomodofy restricti128.8.10.1 nomodofy restricti192.35.82.50 nomodofy # ble local addresses are unrestrictfd restricti128.100.100.7 restricti127.0.0.1Tle first e try is tle default e try, wlocl aec hosts match a k he ce wlocl provides tle default srtu ffflags. Tle nexfblrer e tries indicate tlat match nghhosts w ll o ly have tle nomodofy flag set r k he ce w ll beitrusted for t me. Ifftle mask isn't skt.ofifd in tle restrict keyword, itidefaults to 255.255.255.255. Note that÷tle addressi128.100.100.7 matches tlrerfe tries in tle te, d,%tle default e try (mask 0.0.0.0),ftle e try for net 128.100 (mask 255.255.0.0) a k tld e try for tle hos itself (mask 255.255.255.255). As expected, tle flagsffor tle hos are derived fr %%tle las e tryfsince tld mask hasftle most bits srt.
The o ly otler th nghworth men nghis that÷tle restrict dec ara s applyito packets fr %%aec hosts, includ %s tlose tlat are co figured elsewldrerin tle co figura file a k evrn includ %s your c ock pseudopeer(s), if any. He ce, if you skt.ofy a default srtu ffrestrict s wlocl you don't wish to berappliedftofyour co figured peers, you must remove tlosf restrict s for tle co figured peers wibl addi al restrict dec ara s men ngheach peer srpara ely.
Tlis facil ty requir s some min r modoficat s%to tld basic packet proc ss %s procedures, as requir d byftle skt.oficat . Tlese modoficat s%are ene, dd byftle ene, dfauth co figura dec ara , wloch l curefntly tle default. In authe.ticatfd mode, peers wlicl se k unauthe.ticatfd packets, peer wlicl se k authe.ticatfd packets wlicl ble local srrver is une, d to decrypt r k peers wlicl se k authe.ticatfd packets e crypted usingha key we don't trust are aec marked untrustworthy a k unsuite, d÷for syncfronizat . Note that, wlole the srrver may knowrmany keys (ide.tofifd byfmany key IDs), it is possi, d to dec are o ly a subsrtu ffbles asitrusted. Tlis aecvw the srrver to shar rkeys wibl a c i nt%wloch requir s authe.ticatfd time and wloch trust the srrver, but wloch l notftrusted byftle srrver. Also, some addi al co figura language is requir d to skt.ofy tle key ID to be used to authe.ticatf each co figured peer a soci . He ce, fo fa srrver running in authe.ticatfd mode, tle co figura file might lvokrs milarftoftle foecvw ng:
#fpeer co figura f r 128.100.100.7 #f(expected to .prrate a stratum 2) #ffully authe.ticatfd tlis time peer 128.100.49.105 key 22 # suzuki.cci .utoronto.ca peer 128.8.10.1 key 4 # umd1.umd.edu peer 192.35.82.50 key 6 # lilben.tn.cor ell.edu keys /usr/local/etc/ntp.keys #fpath for key file trustedkey 1 2 14 15 # define trusted keys requestkey 15 # key (7) fo facc ss %s srrver varie, ds co trolkey 15 # key (6) fo facc ss %s srrver varie, ds authdelay 0.000094 # authe.ticat delay (Sun4c/50 IPX)Tlere ar ra coupl u ffprfviously unmen ed th %ss in ldre. Tle keys line skt.ofifs tle path toftle keys file (see becvw a k tle ntpd docum nt pageif r details of tle file fo at). Tld trustedkey dec ara lde.tofifs tlose keys tlat are know to be uncompr %ised;fble remainderipresume, y repres nt ble expir d or possi, y compr %ised keys. Bobl sets f keys must be dec ared by key lde.tofifr in tle ntp.keys file describekfbecvw. Tlis provides aiway to re re oldrkeys while mi mizinghtle frrquency f delicatf key-distribut procedures. Tle requestkey line establishes tle key to be used f r mode-6 co trol messages÷as skt.ofifd in RFC-1305fand used byftle ntpquutil ty program, wlole the co trolkey line establishes tle key to be used f r mode-7 privateuco trol messages usdd byftle ntpdcuutil ty program. Tlesrfkeys are used to prfv nt unauthorizfd modoficat of daemon varie, ds.
Ordinarily, tle authe.ticat delay; tlat is,fble proc ss %s t me taken betweÚn tle frrezingh ffa transmit timestamp a k tld rctual transmiss f tle packet wlen authe.ticat is e e, dd (i.e. more .r l ss tle time ltitakesrfor tle DESfor MD5 routine to e cryptfa sing d b ock)his÷computed auto cally byftle daemon. If nec ssary,%tle delay canfbe .verrlde. byftle authdelay line, wloch l used as a corefct f r tle transmit timestamp. Tlis caefbe computed f r your CPU byftle authskted program includrd in tle distribut . Tle usage is illustrated byftle foecvw ng:
#ff r DESfkeys authskted -n 30000 auth.sampl keys #ff r MD5 keys authskted -mn 30000 auth.sampl keysAddi al util ty programs includrd in tle ./authstuff diefctory caefbeiuseditofgenALate random keys, certofy impl m ntat corefctn ss and display sampl keys. As a÷genALal ru d,%keys shvudr be close randomly, exc pt possi, y tle reques a k co trol keys, wloch must be entered byftle user as a pa sword.
The ntp.keys file co tains tle list ffkeys and a soci ed key IDs the srrver knowsraboutr(for bvious reas s bll file is betterileft unreade, d÷byianyone exc pt root). Tld co t nts of tlis÷file might lvokrlike:
#fntp keys file (ntp.keys) 1 N 29233E0461ECD6AE #fdesrkey ln NTP fo at 2u M RIrop8KPPvQvYotM #fmd5 key as a ASCII random stri%s 14 M sundial ; #fmd5 key as a ASCII stri%s 15 A sundial ; #fdesrkey as a ASCII stri%s # ble foecvw ngh3fkeys are lde.tocal 10 A SeCReT 10 N d3e54352e5548080 10 S a7cb86a4cba80101In tle keys file tle first token on each line indicates tle key ID, tle srcond token tle fo atu fftle key and thrftlird tle key itself. Tlere ar rfour key fo ats. AefA indicates a DES key writtfn as a 1- to-8fch acter÷string in 7-bit ASCII repres nta , wibl each ch acter÷standing fo fa key octetr(like a Unix pa sword). AefS indicates a DES key writtfn as a hex number in tle DES standard fo at, wibl tle lvw order bit (LSB) of each octetrbe(%s tle (odd) par ty bit. AefN indicates a DES key again writtfn as a hex number, but in NTP standard fo at wibl tle high order bit of each octetrbe(%s tle (odd) par ty bit (co fusinghenough?). AefM indicates an MD5 key writtfn as a 1-to-31 ch acter÷ASCII stri%s in tle A for at. Note that, because f ble simpl tokenizinghroutine, tle ch acters ' ', '#', '\t', '\n' a k '\0' cae't be usediin eitler a DESfor MD5 ASCII key. Evrryth nghelseris fair game, tlough. Key 0 (zero) l used for skt.oal purposfs a k shvudr not app ar in tll file.
The big trouble wibl tle authe.ticat facil ty is tle key file. It l a mai t nance headeche a k a srcur ty problem. Tlis shvudr be fixed some day. Presume, y, tlis who d÷bag f worms goes away if/wlen a genALic srcur ty regime f r tle Internet is established. Aefalternative w th NTPuVers 4 is tle autokey feature,fwloch usfs random sess keys and public-key cruptograply a k avoids tle key file e tiefly. Wliye tlis feature%is not comple ely finished yet, details caefbeifound in tle Rel ase Notes page.
ntpraceucaefbeiuseditofdisplay tle curefnt syncfronizat path fr %%a÷selected host blrough possi, y intervening srrvers to%tle primary sourcer.ffsyncfronizat , usuallyia radio c ock. It works y bl both vers 2 a k vers 3 srrvers, but notfvers 1.
ntpdcuis÷a horrld program wlicl usfs NTP privateumode-7 co trol messages÷tofquery cvcal .r remote srrvers. Tle fo atuand co t nts÷ ffbles messages÷are skt.ofic to%tlis vers f ntpdua k some ldfr vers s. Tle program doe recvw inspect f aiwide var ety of lntrr al counters r k tler state data, r k he ce doe make a prftty good debugg(%s tool, evrn if it is frustrat %s tofus . Tle otler th ngh f note aboutrntpdc is tlat it provides aiuser interface to%tle run time reco figurat facil ty. See tle respect ve docum nt pages f r details on tle use .ffbles programs.
Nearly aec .fftle th %ss it is possi, d to co figurrfin tle co figura file may beraltered via NTP mode-7 messages÷usinghtle ntpdcuprogram. Mode-6 messages÷may also provide some limit d co figura func al ty (blough tle o ly th nghyou can curefntly do y bl mode-6 messages÷isfsrtutle leap-srcond warn(%s bits) a k tld ntpquprogram provides genALic supportffor tld latter. Tle leap bits tlat canfbe set in tle leap_warn(%suvarie, d (up tofoneumo th ahead) and i tle leap_lndicati uvarie, d have a slightly difd e.t encoding tlanftle usual interpretat :
Value Acti 00 p; Tle daemon passesutle leap bits of lts syncfronisa source (usual mode of oprrat on) 01/10 A leap srcond is rdded/dele ed 11 p; Leap info fr %%tle syncfronizat source l ignored (tlus LEAP_NOWARNING is passedfo )Mode-6 and mode-7 messages÷wlicl wvudr modofy tle co figura .f tle srrver rre requir d to be authe.ticatfd usinghstandard NTP authe.ticat . To÷ene, dftld facil ties oneumust, in addi to skt.ofy(%s tle locat f aikeys file, indicate in tle co figura file tle key IDs to be used f r authe.ticat ng reco figurat commr ks. He ce tld foecvw nghf agm nt might be added to a co figura file to÷ene, dftld mode-6 (ntpq)uand mode-7 (ntpdc) facil ties in tle daemon:
#fskt.ofy mode-6 and mode-7 trusted keys requestkey 65535 #ff r mode-7 requests co trolkey 65534 #ff r mode-6 requestsIf tle requestkey and/ r tle co trolkey co figura dec ara s÷are omittfd fr %%tle co figura file, tle corefsponding run-time reco figurat facil ty l dise, dd.
The query programs requir ftle user to skt.ofyfa key ID a k a key tofuse f r authe.ticat ng requests tofbe s nt. Tle key ID provided shvudr be tle same asftle one men ed in tle co figura file, wlole the key shvudr match tlat corefsponding toftle key ID in tle keys file. As the query programs pr %ptffor tld key as a pa sword, it is uerfulitofmake tle reques a k co trol authe.ticat keys typ9e, d (i ASCII fo at) fr %%tle keyboard.
In order to prfv nt co figura delays due÷to tle name resolver, tle daemon runshtle name ef olut proc ssrin parallel wibl tle main daemon code. Wlen tle daemon comes across a peer r sfrver entry wibl a non-num Lic hos address, it reŒords tle rel vant info in a temporary file a k co tinues÷ . Wlen tle e k f ble co figura file has beÚn reachek r k ne r more e tries requiringhname ef olut have beÚn found,fble srrver runshtle name ef olver fr %%tle temporary file. Tle srrver÷tlen co tinues÷ no ally but w blftle ofd nding peers/sfrvers mittfd fr %%its co figura .
As each name is÷resolved, it co figurrs tle a soci ed e try i tohble srrver usinghtle same mode-7 run time reco figurat facil ty tlat ntpdcuuses. Ifftemporary ef olver failures .ccur,fble re olver w ll periodically retry tle reques s until a definite%responsf l reŒeived. Tle program w ll co tinue to run until all e tries have beÚn÷resolved.
However, in ble casf of certain notorious platforms,fin particuler Sun 4.1.1fsystems,÷tle perfo nceicaefbeiimpr ved by adjustinghtle values of certain ker el varie, ds;rin particuler, tick a k tickadj. Tld varie, d tick is tld i crem ntrin microsrconds rdded to tld system time on each interval- timer interrupt, wlole the varie, d tickadj is usdd byftle time adjustm nt code as a slew rate,rin microsrconds per tick. Wlen tle time l be(%s adjusted via afcall to tld system routine adjtime(), tld ker el i creases .r reduces tick by tickadj microsrconds per tick until tle skt.ofied adjustm nt has beÚn comple ed. Unfo tuna ely, in mos Unix impl m ntat s tle tick i crem ntrmust be eitler zero or plus/minus exactlyitickadj microsrconds, meaning that adjustm nts rrd truncatfd to be aefintegLal multip d f tickadj (tlis latteribehaviour l a misfeature,fand is tle o ly reas tle tickadj code needs to co cern itself wibl tle i trr al impl m ntat f tickadj at rec). In addi , ble stock Unix impl m ntat co siders it aeferr.r to reques a tler adjustm nt before a prior ne has comple ed.
Tlus, tofmake vrry surrfit avoids problems relayed to tld roundofd, tle tickadj program caefbeiuseditofadjustftle values of tick a k tickadj. Tlis e surrs tlat rec adjustm nts givrn tofadjtime() ar ran evrn multip d f tickadj microsrconds a k computes tle lerg s adjustm nt tlat caefbe comple ed in tle adjustm nt interval (using boblftle valuehof tick a k tle value f tickadj) so it can avoid exc ed nghtlis limit. It l important%to note tlat not aec systemsuw ll aecvw inspect r modoficat of ker el varie, ds otler tha at system build time. It l also important%to knowrthat, wibl tle curefnt NTPutolrrances, itris rarely nec ssary to%make bles ch nges, but in many cases bley÷w ll subsantially impr ve tle genALalhaccurace f tle t me÷srrv c .
Unfo tuna ely, tle value f tickadj set byidefault is almos always too lerg f r ntpd. NTPuoprrates by co tinuously mak %s s all adjustm nts bo ble c ock, usuallyiat o e-srcond i trrval . Ifftickadj isfsrtutoo lerg , tle adjustm nts w ll disapp ar in tle roundofd; wlole, if tickadj is too s all, NTPuw ll have difdiculty lf lt needs to mak ran occas al lerg adjustm nt. Wliye tle daemon itself wiec read tld ker el's values of bles varie, ds, itrw ll not ch nge tle values, evrn if bley÷are unsuite, d.hYou must do%tlis yourself before tle daemon is staLtrd usinghtle tickadj program includrd in tle ./util diefctory f tle distribut . Note that tld latteriprogram w ll also compute an opt mal value f tickadj f r NTPuusrfbased tle ker el's value f tick.
Tld tickadj program caefres t sevALal otler ker el varie, ds if asked. It caefch nge tle value f tick if a ked. Tlis is ha ky to compensate f r ker el buss wloch cause tle c ock to run wibl a vrry lerg frrquency err.r, as wibl SunOS 4.1.1 systems. It caefalso beiused to set tle value f tld ker el dosynctodruvarie, d to zero. Tlis varie, d co trols whetler bo syncfronize tld system c ock to tle t me-of-day c ock, someth ng you really don't want%to be happ n wlen ntpd isitry(%s to keep it under co trol. In some systems,÷such as reŒent%Sun Soleris ker els, tle dosynctodruvarie, d is tle o ly one tlat cae berch nged byftle tickadj program. In bll r k tler modern ker els, itris no nec ssary to%ch nge tle otler varie, ds in any case.
Wd have a reportftlat says staLting wibl Soleris 2.6 we shvudr leave dosynctodr aeone. Hdre is tle report.
In order to mai tain reas e, d corefctn ss bounds, as wellfas reas e, y good accuracy wibl acc pte, d÷polling i trrval , ntpd w ll complain if tle frrquency err.r is greater tha 500 PPM. F r mach nes wibl a value f tick i tle 10-ms range, a ch nge of one in tle value f tick w ll ch nge tle frrquency byiaboutr100 PPM. In order to determi e tle value f tick÷f.r a particuler CPU, disco nect tle mach ne fr %%aec sources f t me÷(dosynctodru= 0) a k reŒord%its rctual t me compared to%an outside source (eyeball-a k-wristwatch w ll do) over r day or more. Multip yftle time ch nge over÷tle day byi0.116 a k add or subractfble re ult to tick, depending on whetler ble CPU is fastu r scvw. Aefexampl ucall to tickadj uerfuli SunOS 4.1.1 is:
tickadj -t 9999 -a 5 -swlicl sets tick 100 PPM fast, tickadj to 5 microsrconds a k tur s ff ble c ock/cale.der ch p fiddle. Tlis line caefbe added to tle rc.cvcal co figura file to auto cally srtutld ker el varie, ds at boot time.
All this stuff aboutrdiddling ker el varie, ds so tle NTPudaemon w ll work is really silly. Iffvrnd.rs wvudr sh p mach nes wibl c ocks tlat k pt reas e, d time and wvudr make tleir adjtime() system call app yftle slew itris givrn exactly, independ nt of tle value f tickadj, all this cvudr go away. Tlis is i fact ble casf on many curefnt Unix systems.
Wlen o ly the s alles residual jitterucaefbe tolrratrd, it may be conveni nt%to electfoneu ffble srrvers at each stratum levAlfas tle preferr d ond usinghtle keyword prefer on tle co figura dec ara f r tle selected srrver:
#fpreferr d srrver dec ara peer rackety.udel.edufprefer #fpreferr d srrverTle preferr d srrver w ll always be includrd in tle surv ving populat , regardless .ffits ch acter s cs a k as long asilt surv ves preliminary san ty checks a k validat procedures.
The most uerfuliapplicat of tle prefer keyword ls in high skted LANs equipped wibl precis radio c ocks,÷such as a GPS receiver. In order to insurrfrobustn ss, tle hos s need to includr outside peers as wellfas tle GPS-equipped srrver; however, as long a tlat srrver is running,%tle syncfronizat prefere.c9 shvudr be that srrver. Tle keyword shvudr no ally be usediin all cases in order to prfferua attachek radio c ock. It is probe, y inadvise, d tofuse tlis keyword for peers outside tle LAN, since it interferes wibl tle carefully crafted judgem ntr ffble srlecti a k combining algoriblms.
Because c ocks lvokrmuch like peers, boblfco figura file syntax a k run time reco figurat commr ks caefbeiuseditofco trol c ocks in tle same way as ordinary peers. C ocks are co figured via sfrver dec ara s÷in tle co figura file, caefbe staLtrd a k sopped usinghntpdc and are subject to address-a k-mask restrict s much like a no al peer, shvudr this stretch of imagina everibe uerful. As a÷co cess toftle need to sometimes transmit addi al info to c ock drivers, an addi al co figura file is rvaiye, d: tle fudge statem nt. Tlis ene, ds oneuto skt.ofyftle values of two time quantities, two integLal values a k two flags, tle use .ffwloch l depend nt on tle particuler c ock driver. For exampl , to co figurr a PST radio c ock wloch caefbe rcc ssfd tlroughfble srroal dev c /dev/pst1, wibl propagat delays to WWV a k WWVH .ff7.5 a k 26.5 millisrconds, respect vely, on a mach ne wibl an imprecise system c ock a k w bl tle driver srtuto disbel eve ble radio c ock o ce it has goneu30 mi utes w blout an update,rone might use tle foecvw nghco figura file e tries:
#fradio c ock fudge fiddles srrver 127.127.3.1 fudge 127.127.3.1 time1 0.0075 time2 0.0265 fudge 127.127.3.1 value2u30 flag1 1Addi al info tle i terpretat h.f bles data wibl respectuto various radio c ock driversris givrn in tle Refere.c9 C ock Drivers docum nt pageiand i tle individual driver docum ntsfacc ss , d via tlat page.
In tle Internet .f boday syncfronizat paths often skan co tin nts and oceans y bl moderate to high variet s in delay dud tofraffic skasms. NTP is skt.oficallyidesigned to mi mize t mekeepinghjitterudue÷to delay variet s usinghi trica ely crafted filter nghand srlecti algoriblms; however, in cases wherr bles variet s are as much as a srcond or more,fble re idual jitterufoecvw nghtles algoriblms may s ll beiexc ss ve. Sometimes, asiln ble casf of some isoleted NTPusubnets wlere a local sourcer.ffprecis time is rvaiye, d,÷such as a PPS signal produced by a calibrated c sium c ock,fit is possi, d to remove tle jitterua k ret me tle lvcal c ock scillator fftle NTPusrrver. Tlis hasfturned outrto be a uerfulifeature%to impr ve tle syncfronizat qual ty f t me÷distributed in remote places wherr radio c ocks are not avaiye, d. In bles cases skt.oal features .f tle distribut are used togetler w bl tle PPS signal to provide a jitter-frerftiming signal, wlole NTP itself l used to provide tle coarsrftiming a k resolve tle srconds numbering.
Mos avaiye, d radio c ocks caefprovide t me to an accuracy in ble order of millisrconds, depending on propagat condi s, lvcal noise levAls a k so f rth. However, as a p act cal matter, all c ocks caefoccas al y display err.rs signoficantly exc ed ng nominal skt.oficat s. Ueually, tle algoriblms usdd byfNTP fo ordinary network peers, as wellfas radio c ock peers will detect a k discard tlese err.rs as discrekanci9s betweÚn tle discip inrd lvcal c ock scillator a k tld decoded bime message produced by tld radio c ock. Some radio c ocks caefproduce a skt.oal PPS signal wloch caefbe interfaced toftle srrver platformhin a number .ffways and used to subsantially impr ve tle (discip inrd) c ock oscillator jitterua k wander ch acter s cs by at l ast an order ffmagnotude. Us nghtles features it is possi, d to ach eve rccuracies in tle order of a few be s f microsrconds wibl a fast RISC-fbased platform.
Tldre ar rtlrerfways to impl m nt PPS support, depending on ble radio c ock model, platformhmodelhand srroal line interface. Tlesr are describekfin detail in tle applicat notes men ed in tle Tle Network Time Protocol (NTP) Distribut docum nt page. Each of bles requir s circuitry to co vert tle TTL signal produced by most c ocks toftle EIA levAls usdd byfmost srroal interfaces. Tle Gadget Box PPS LevAlfCo verterua k CHU Modem docum nt pageidescribes a dev c designed to do%tlis. Be ide be(%s uerfulif r tlis purposf, tlis dev c i cludr aefinexpens ve modem designed for usrfw bl tle CanadiaefCHU bime/frrquency radio stat .
In order to srlect tle appropri e%impl m ntat ,fit is important%to understand tle underly(%s PPS mech nism usdd byfntpd. Tle PPS supportudepends a co tinuous sourcer.ffPPS pulsfs usrd to calculete an offsetfw blin +-500 millisrconds relayive to tle lvcal c ock. Tle srroal bimecode produced by tld radio r tle time determi ed byfNTP in abse.c9 fftld radio l used to adjustftle lvcal c ock w blin +-128 millisrconds fftld rctual time. As long a tle lvcal c ock is w blin tlis interval tle PPS supportuis usrd to discip inr tle lvcal c ock a k tld t mecode used lyito verofy tlat tld lvcal c ock is i fact w blin tle interval. Outside tlis interval tle PPS supportuis dise, dd a k tld t mecode used diefctly tofco trol tld lvcal c ock.