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

📄 rfc1305.txt

📁 著名的RFC文档,其中有一些文档是已经翻译成中文的的.
💻 TXT
📖 第 1 页 / 共 5 页
字号:
established. NTP timestamps are represented as a 64-bit unsigned fixed-point number, in seconds relative to 0h on 1 January 1900. The integerpart is in the first 32 bits and the fraction part in the last 32 bits.This format allows convenient multiple-precision arithmetic andconversion to Time Protocol representation (seconds), but doescomplicate the conversion to ICMP Timestamp message representation(milliseconds). The precision of this representation is about 200picoseconds, which should be adequate for even the most exoticrequirements.Timestamps are determined by copying the current value of the localclock to a timestamp when some significant event, such as the arrival ofa message, occurs. In order to maintain the highest accuracy, it isimportant that this be done as close to the hardware or software driverassociated with the event as possible. In particular, departuretimestamps should be redetermined for each link-level retransmission. Insome cases a particular timestamp may not be available, such as when thehost is rebooted or the protocol first starts up. In these cases the 64-bit field is set to zero, indicating the value is invalid or undefined.Note that since some time in 1968 the most significant bit (bit 0 of theinteger part) has been set and that the 64-bit field will overflow sometime in 2036. Should NTP be in use in 2036, some external means will benecessary to qualify time relative to 1900 and time relative to 2036(and other multiples of 136 years). Timestamped data requiring suchqualification will be so precious that appropriate means should bereadily available. There will exist an 200-picosecond interval,henceforth ignored, every 136 years when the 64-bit field will be zeroand thus considered invalid.State Variables and ParametersFollowing is a summary of the various state variables and parametersused by the protocol. They are separated into classes of systemvariables, which relate to the operating system environment and local-clock mechanism; peer variables, which represent the state of theprotocol machine specific to each peer; packet variables, whichrepresent the contents of the NTP message; and parameters, whichrepresent fixed configuration constants for all implementations of thecurrent version. For each class the description of the variable isfollowed by its name and the procedure or value which controls it. Notethat variables are in lower case, while parameters are in upper case.Additional details on formats and use are presented in later sectionsand Appendices.Common VariablesThe following variables are common to two or more of the system, peerand packet classes. Additional variables are specific to the optionalauthentication mechanism as described in Appendix C. When necessary todistinguish between common variables of the same name, the variableidentifier will be used.Peer Address (peer.peeraddr, pkt.peeraddr), Peer Port (peer.peerport,pkt.peerport): These are the 32-bit Internet address and 16-bit portnumber of the peer.Host Address (peer.hostaddr, pkt.hostaddr), Host Port (peer.hostport,pkt.hostport): These are the 32-bit Internet address and 16-bit portnumber of the host. They are included among the state variables tosupport multi-homing.Leap Indicator (sys.leap, peer.leap, pkt.leap): This is a two-bit codewarning of an impending leap second to be inserted in the NTP timescale.The bits are set before 23:59 on the day of insertion and reset after00:00 on the following day. This causes the number of seconds (rolloverinterval) in the day of insertion to be increased or decreased by one.In the case of primary servers the bits are set by operatorintervention, while in the case of secondary servers the bits are set bythe protocol. The two bits, bit 0 and bit 1, respectively, are coded asfollows:@Z_TBL_BEG = COLUMNS(2), DIMENSION(IN), COLWIDTHS(E1,E8), WIDTH(5.0000),ABOVE(.0830), BELOW(.0830), HGUTTER(.0560), KEEP(OFF), ALIGN(CT)@Z_TBL_BODY = TABLE TEXT, TABLE TEXT00, no warning01, last minute has 61 seconds10, last minute has 59 seconds11, alarm condition (clock not synchronized)@Z_TBL_END =In all except the alarm condition (112), NTP itself does nothing withthese bits, except pass them on to the time-conversion routines that arenot part of NTP. The alarm condition occurs when, for whatever reason,the local clock is not synchronized, such as when first coming up orafter an extended period when no primary reference source is available.Mode (peer.mode, pkt.mode): This is an integer indicating theassociation mode, with values coded as follows:@Z_TBL_BEG = COLUMNS(2), DIMENSION(IN), COLWIDTHS(E1,E8), WIDTH(5.0000),ABOVE(.0830), BELOW(.0830), HGUTTER(.0560), KEEP(OFF), ALIGN(CT)@Z_TBL_BODY = TABLE TEXT, TABLE TEXT0, unspecified1, symmetric active2, symmetric passive3, client4, server5, broadcast6, reserved for NTP control messages7, reserved for private use@Z_TBL_END =Stratum (sys.stratum, peer.stratum, pkt.stratum): This is an integerindicating the stratum of the local clock, with values defined asfollows:@Z_TBL_BEG = COLUMNS(2), DIMENSION(IN), COLWIDTHS(E1,E8), WIDTH(5.0000),ABOVE(.0830), BELOW(.0830), HGUTTER(.0560), KEEP(OFF), ALIGN(CT)@Z_TBL_BODY = TABLE TEXT, TABLE TEXT0, unspecified1, primary reference (e.g.,, calibrated atomic clock,, radio clock)2-255, secondary reference (via NTP)@Z_TBL_END =For comparison purposes a value of zero is considered greater than anyother value. Note that the maximum value of the integer encoded as apacket variable is limited by the parameter NTP.MAXSTRATUM.Poll Interval (sys.poll, peer.hostpoll, peer.peerpoll, pkt.poll): Thisis a signed integer indicating the minimum interval between transmittedmessages, in seconds as a power of two. For instance, a value of sixindicates a minimum interval of 64 seconds.Precision (sys.precision, peer.precision, pkt.precision): This is asigned integer indicating the precision of the various clocks, inseconds to the nearest power of two. The value must be rounded to thenext larger power of two; for instance, a 50-Hz (20 ms) or 60-Hz (16.67ms) power-frequency clock would be assigned the value -5 (31.25 ms),while a 1000-Hz (1 ms) crystal-controlled clock would be assigned thevalue -9 (1.95 ms).Root Delay (sys.rootdelay, peer.rootdelay, pkt.rootdelay): This is asigned fixed-point number indicating the total roundtrip delay to theprimary reference source at the root of the synchronization subnet, inseconds. Note that this variable can take on both positive and negativevalues, depending on clock precision and skew.Root Dispersion (sys.rootdispersion, peer.rootdispersion,pkt.rootdispersion): This is a signed fixed-point number indicating themaximum error relative to the primary reference source at the root ofthe synchronization subnet, in seconds. Only positive values greaterthan zero are possible.Reference Clock Identifier (sys.refid, peer.refid, pkt.refid): This is a32-bit code identifying the particular reference clock. In the case ofstratum 0 (unspecified) or stratum 1 (primary reference source), this isa four-octet, left-justified, zero-padded ASCII string, for example (seeAppendix A for comprehensive list):@Z_TBL_BEG = COLUMNS(3), DIMENSION(IN), COLWIDTHS(E2,E2,E5),WIDTH(4.1700), ABOVE(.1670), BELOW(.0830), HGUTTER(.3330),BOX(Z_SINGLE), KEEP(ON), ALIGN(CT), L1(R1C0..R1C3)@Z_TBL_BODY = TABLE CENTER, TABLE HEADER, TABLE HEADERStratum, Code, Meaning@Z_TBL_BODY = TABLE CENTER, TABLE TEXT, TABLE TEXT0, DCN, DCN routing protocol0, TSP, TSP time protocol1, ATOM, Atomic clock (calibrated)1, WWVB, WWVB LF (band 5) radio1, GOES, GOES UHF (band 9) satellite@Z_TBL_BODY = TABLE CENTER, TABLE HEADER, TABLE HEADER1, WWV, WWV HF (band 7) radio@Z_TBL_END =In the case of stratum 2 and greater (secondary reference) this is thefour-octet Internet address of the peer selected for synchronization.Reference Timestamp (sys.reftime, peer.reftime, pkt.reftime): This isthe local time, in timestamp format, when the local clock was lastupdated. If the local clock has never been synchronized, the value iszero.Originate Timestamp (peer.org, pkt.org): This is the local time, intimestamp format, at the peer when its latest NTP message was sent. Ifthe peer becomes unreachable the value is set to zero.Receive Timestamp (peer.rec, pkt.rec): This is the local time, intimestamp format, when the latest NTP message from the peer arrived. Ifthe peer becomes unreachable the value is set to zero.Transmit Timestamp (peer.xmt, pkt.xmt): This is the local time, intimestamp format, at which the NTP message departed the sender.System VariablesTable 1<$&tab1> shows the complete set of system variables. In additionto the common variables described previously, the following variablesare used by the operating system in order to synchronize the localclock.Local Clock (sys.clock): This is the current local time, in timestampformat. Local time is derived from the hardware clock of the particularmachine and increments at intervals depending on the design used. Anappropriate design, including slewing and skew-Compensation mechanisms,is described in Section 5.Clock Source (sys.peer): This is a selector identifying the currentsynchronization source. Usually this will be a pointer to a structurecontaining the peer variables. The special value NULL indicates there isno currently valid synchronization source.Peer VariablesTable 2 shows the complete set of peer variables. In addition to thecommon variables described previously, the following variables are usedby the peer management and measurement functions.Configured Bit (peer.config): This is a bit indicating that theassociation was created from configuration information and should not bedemobilized if the peer becomes unreachable.Update Timestamp (peer.update): This is the local time, in timestampformat, when the most recent NTP message was received. It is used incalculating the skew dispersion.Reachability Register (peer.reach): This is a shift register ofNTP.WINDOW bits used to determine the reachability status of the peer,with bits entering from the least significant (rightmost) end. A peer isconsidered reachable if at least one bit in this register is set to one.Peer Timer (peer.timer): This is an integer counter used to control theinterval between transmitted NTP messages. Once set to a nonzero value,the counter decrements at one-second intervals until reaching zero, atwhich time the transmit procedure is called. Note that the operation ofthis timer is independent of local-clock updates, which implies that thetimekeeping system and interval-timer system architecture must beindependent of each other.<$&tab2>Packet VariablesTable 3<$&tab3> shows the complete set of packet variables. In additionto the common variables described previously, the following variablesare defined.Version Number (pkt.version): This is an integer indicating the versionnumber of the sender. NTP messages will always be sent with the currentversion number NTP.VERSION and will always be accepted if the versionnumber matches NTP.VERSION. Exceptions may be advised on a case-by-casebasis at times when the version number is changed. Specific guidelinesfor interoperation between this version and previous versions of NTP aresummarized in Appendix D.Clock-Filter VariablesWhen the filter and selection algorithms suggested in Section 4 areused, the following state variables are defined in addition to thevariables described previously.Filter Register (peer.filter): This is a shift register of NTP.SHIFTstages, where each stage stores a 3-tuple consisting of the measureddelay, measured offset and calculated dispersion associated with a

⌨️ 快捷键说明

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