⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc1305.txt

📁 著名的RFC文档,其中有一些文档是已经翻译成中文的的.
💻 TXT
📖 第 1 页 / 共 5 页
字号:
single observation. These 3-tuples enter from the most significant(leftmost) right and are shifted towards the least significant(rightmost) end and eventually discarded as new observations arrive.Valid Data Counter (peer.valid): This is an integer counter indicatingthe valid samples remaining in the filter register. It is used todetermine the reachability state and when the poll interval should beincreased or decreased.Offset (peer.offset): This is a signed, fixed-point number indicatingthe offset of the peer clock relative to the local clock, in seconds.Delay (peer.delay): This is a signed fixed-point number indicating theroundtrip delay of the peer clock relative to the local clock over thenetwork path between them, in seconds. Note that this variable can takeon both positive and negative values, depending on clock precision andskew-error accumulation.Dispersion (peer.dispersion): This is a signed fixed-point numberindicating the maximum error of the peer clock relative to the localclock over the network path between them, in seconds. Only positivevalues greater than zero are possible.Authentication VariablesWhen the authentication mechanism suggested in Appendix C is used, thefollowing state variables are defined in addition to the variablesdescribed previously. These variables are used only if the optionalauthentication mechanism described in Appendix C is implemented.Authentication Enabled Bit (peer.authenable): This is a bit indicatingthat the association is to operate in the authenticated mode.Authenticated Bit (peer.authentic): This is a bit indicating that thelast message received from the peer has been correctly authenticated.Key Identifier (peer.hostkeyid, peer.peerkeyid, pkt.keyid): This is aninteger identifying the cryptographic key used to generate the message-authentication code.Cryptographic Keys (sys.key): This is a set of 64-bit DES keys. Each keyis constructed as in the Berkeley Unix distributions, which consists ofeight octets, where the seven low-order bits of each octet correspond tothe DES bits 1-7 and the high-order bit corresponds to the DES odd-parity bit 8.Crypto-Checksum (pkt.check): This is a crypto-checksum computed by theencryption procedure.ParametersTable 4<$&tab4> shows the parameters assumed for all implementationsoperating in the Internet system. It is necessary to agree on the valuesfor these parameters in order to avoid unnecessary network overheads andstable peer associations. The following parameters are assumed fixed andapplicable to all associations.Version Number (NTP.VERSION): This is the current NTP version number(3).NTP Port (NTP.PORT): This is the port number (123) assigned by theInternet Assigned Numbers Authority to NTP.Maximum Stratum (NTP.MAXSTRATUM): This is the maximum stratum value thatcan be encoded as a packet variable, also interpreted as<169>infinity<170> or unreachable by the subnet routing algorithm.Maximum Clock Age (NTP.MAXAGE): This is the maximum interval a referenceclock will be considered valid after its last update, in seconds.Maximum Skew (NTP.MAXSKEW): This is the maximum offset error due to skewof the local clock over the interval determined by NTP.MAXAGE, inseconds. The ratio <$Ephi~=~roman {NTP.MAXSKEW over NTP.MAXAGE}> isinterpreted as the maximum possible skew rate due to all causes.Maximum Distance (NTP.MAXDISTANCE): When the selection algorithmsuggested in Section 4 is used, this is the maximum synchronizationdistance for peers acceptable for synchronization.Minimum Poll Interval (NTP.MINPOLL): This is the minimum poll intervalallowed by any peer of the Internet system, in seconds to a power oftwo.Maximum Poll Interval (NTP.MAXPOLL): This is the maximum poll intervalallowed by any peer of the Internet system, in seconds to a power oftwo.Minimum Select Clocks (NTP.MINCLOCK): When the selection algorithmsuggested in Section 4 is used, this is the minimum number of peersacceptable for synchronization.Maximum Select Clocks (NTP.MAXCLOCK): When the selection algorithmsuggested in Section 4 is used, this is the maximum number of peersconsidered for selection.Minimum Dispersion (NTP.MINDISPERSE): When the filter algorithmsuggested in Section 4 is used, this is the minimum dispersion incrementfor each stratum level, in seconds.Maximum Dispersion (NTP.MAXDISPERSE): When the filter algorithmsuggested in Section 4 is used, this is the maximum peer dispersion andthe dispersion assumed for missing data, in seconds.Reachability Register Size (NTP.WINDOW): This is the size of thereachability register (peer.reach), in bits.Filter Size (NTP.SHIFT): When the filter algorithm suggested in Section4 is used, this is the size of the clock filter (peer.filter) shiftregister, in stages.Filter Weight (NTP.FILTER): When the filter algorithm suggested inSection 4 is used, this is the weight used to compute the filterdispersion.Select Weight (NTP.SELECT): When the selection algorithm suggested inSection 4 is used, this is the weight used to compute the selectdispersion.Modes of OperationExcept in broadcast mode, an NTP association is formed when two peersexchange messages and one or both of them create and maintain aninstantiation of the protocol machine, called an association. Theassociation can operate in one of five modes as indicated by the host-mode variable (peer.mode): symmetric active, symmetric passive, client,server and broadcast, which are defined as follows:Symmetric Active (1): A host operating in this mode sends periodicmessages regardless of the reachability state or stratum of its peer. Byoperating in this mode the host announces its willingness to synchronizeand be synchronized by the peer.Symmetric Passive (2): This type of association is ordinarily createdupon arrival of a message from a peer operating in the symmetric activemode and persists only as long as the peer is reachable and operating ata stratum level less than or equal to the host; otherwise, theassociation is dissolved. However, the association will always persistuntil at least one message has been sent in reply. By operating in thismode the host announces its willingness to synchronize and besynchronized by the peer.Client (3): A host operating in this mode sends periodic messagesregardless of the reachability state or stratum of its peer. Byoperating in this mode the host, usually a LAN workstation, announcesits willingness to be synchronized by, but not to synchronize the peer.Server (4): This type of association is ordinarily created upon arrivalof a client request message and exists only in order to reply to thatrequest, after which the association is dissolved. By operating in thismode the host, usually a LAN time server, announces its willingness tosynchronize, but not to be synchronized by the peer.Broadcast (5): A host operating in this mode sends periodic messagesregardless of the reachability state or stratum of the peers. Byoperating in this mode the host, usually a LAN time server operating ona high-speed broadcast medium, announces its willingness to synchronizeall of the peers, but not to be synchronized by any of them.A host operating in client mode occasionally sends an NTP message to ahost operating in server mode, perhaps right after rebooting and atperiodic intervals thereafter. The server responds by simplyinterchanging addresses and ports, filling in the required informationand returning the message to the client. Servers need retain no stateinformation between client requests, while clients are free to managethe intervals between sending NTP messages to suit local conditions. Inthese modes the protocol machine described in this document can beconsiderably simplified to a simple remote-procedure-call mechanismwithout significant loss of accuracy or robustness, especially whenoperating over high-speed LANs.In the symmetric modes the client/server distinction (almost)disappears. Symmetric passive mode is intended for use by time serversoperating near the root nodes (lowest stratum) of the synchronizationsubnet and with a relatively large number of peers on an intermittentbasis. In this mode the identity of the peer need not be known inadvance, since the association with its state variables is created onlywhen an NTP message arrives. Furthermore, the state storage can bereused when the peer becomes unreachable or is operating at a higherstratum level and thus ineligible as a synchronization source.Symmetric active mode is intended for use by time servers operating nearthe end nodes (highest stratum) of the synchronization subnet. Reliabletime service can usually be maintained with two peers at the next lowerstratum level and one peer at the same stratum level, so the rate ofongoing polls is usually not significant, even when connectivity is lostand error messages are being returned for every poll.Normally, one peer operates in an active mode (symmetric active, clientor broadcast modes) as configured by a startup file, while the otheroperates in a passive mode (symmetric passive or server modes), oftenwithout prior configuration. However, both peers can be configured tooperate in the symmetric active mode. An error condition results whenboth peers operate in the same mode, but not symmetric active mode. Insuch cases each peer will ignore messages from the other, so that priorassociations, if any, will be demobilized due to reachability failure.Broadcast mode is intended for operation on high-speed LANs withnumerous workstations and where the highest accuracies are not required.In the typical scenario one or more time servers on the LAN sendperiodic broadcasts to the workstations, which then determine the timeon the basis of a preconfigured latency in the order of a fewmilliseconds. As in the client/server modes the protocol machine can beconsiderably simplified in this mode; however, a modified form of theclock selection algorithm may prove useful in cases where multiple timeservers are used for enhanced reliability.Event ProcessingThe significant events of interest in NTP occur upon expiration of apeer timer (peer.timer), one of which is dedicated to each peer with anactive association, and upon arrival of an NTP message from the variouspeers. An event can also occur as the result of an operator command ordetected system fault, such as a primary reference source failure. Thissection describes the procedures invoked when these events occur.Notation ConventionsThe NTP filtering and selection algorithms act upon a set of variablesfor clock offset (<$Etheta ,~THETA>), roundtrip delay (<$Edelta,~DELTA>) and dispersion (<$Eepsilon ,~EPSILON>). When necessary todistinguish between them, lower-case Greek letters are used forvariables relative to a peer, while upper-case Greek letters are usedfor variables relative to the primary reference source(s), i.e., via thepeer to the root of the synchronization subnet. Subscripts will be usedto identify the particular peer when this is not clear from context. Thealgorithms are based on a quantity called the synchronization distance(<$Elambda ,~LAMBDA>), which is computed from the roundtrip delay anddispersion as described below.As described in Appendix H, the peer dispersion <$Eepsilon> includescontributions due to measurement error <$Erho~=~1~<< <<~romansys.precision>, skew-error accumulation <$Ephi tau>, where<$Ephi~=~roman {NTP.MAXSKEW over NTP.MAXAGE}> is the maximum skew rateand <$Etau~=~roman {sys.clock~-~peer.update}> is the interval since thelast update, and filter (sample) dispersion <$Eepsilon sub sigma>computed by the clock-filter algorithm. The root dispersion <$EEPSILON>includes contributions due to the selected peer dispersion <$Eepsilon>and skew-error accumulation <$Ephi tau>, together with the rootdispersion for the peer itself. The system dispersion includes theselect (sample) dispersion <$Eepsilon sub xi> computed by the clock-select algorithm and the absolute initial clock offset <$E| THETA |>provided to the local-clock algorithm. Both <$Eepsilon> and <$EEPSILON>are dynamic quantities, since they depend on the elapsed time <$Etau>since the last update, as well as the sample dispersions calculated bythe algorithms.Each time the relevant peer variables are updated, all dispersionsassociated with that peer are updated to reflect the skew-erroraccumulation. The computations can be summarized as follows:<$Etheta~==~roman peer.offset> ,<$Edelta~==~roman peer.delay> ,<$Eepsilon~==~roman peer.dispersion~=~rho~+~phi tau~+~epsilon sub sigma>,<$Elambda~==~epsilon~+~{| delta |} over 2> ,where <$Etau> is the interval since the original timestamp (from which<$Etheta> and <$Edelta> were determined) was transmitted to the presenttime and <$Eepsilon sub sigma> is the filter dispersion (see clock-filter procedure below). The variables relative to the root of thesynchronization subnet via peer i are determined as follows:<$ETHETA sub i~==~theta sub i> ,<$EDELTA sub i~==~roman peer.rootdelay~+~delta sub i> ,<$EEPSILON sub i~==~roman peer.rootdispersion~+~epsilon sub i~+~phi tausub i> ,<$ELAMBDA sub i~==~EPSILON sub i~+~{| DELTA sub i |} over 2> ,where all variables are understood to pertain to the ith peer. Finally,assuming the ith peer is selected for synchronization, the systemvariables are determined as follows:<$ETHETA~=~>combined final offset ,<$EDELTA~=~DELTA sub i> ,<$EEPSILON~=~EPSILON sub i~+~epsilon sub xi~+~| THETA |> ,<$ELAMBDA~=~LAMBDA sub i> ,where <$Eepsilon sub xi> is the select dispersion (see clock-selectionprocedure below).Informal pseudo-code which accomplishes these computations is presentedbelow. Note that the pseudo-code is represented in no particularlanguage, although it has many similarities to the C language. Specificde

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -