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

📄 rfc891.txt

📁 RFC 相关的技术文档
💻 TXT
📖 第 1 页 / 共 5 页
字号:
         --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Fixed        |           Checksum            |Area         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |             Date              |             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |                               |             +              Time             +             |                               |             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |           Timestamp           |             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |     Offset    |   Hosts (n)   |         --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Host         |          Delay Host 0         |Area         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |         Offset Host 0         |             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+            ...                             ...             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |         Delay Host n-1        |             +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+             |         Offset Host n-1       |         --- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               Figure 3. HELLO Message Format     There are two HELLO message formats, depending on the length ofthe message.  One format, sent by a DCN host to another host on thesame local net, includes both the fixed and host areas shown above.The second format, sent in all other cases, includes only the fixedarea.     Note that all word fields shown are byte-swapped with respect tothe ordinary PDP11 representation.  The "Checksum" field contains achecksum covering the fields indicated.  The "Date" and "Time" fieldsare filled in with the local date and time of origination.  The"Timestamp" field is used in the computation of the roundtrip delay(see below).  The "Offset" field contains the offset of the block afInternet addresses used by the local net.  The "Delay Host n" and"Offset Host n" fields represent a copy of the corresponding entriesof the Host Table as they exist at the time of origination.  The"Hosts (n)" field contains the number of entries in this table.2.2.  Roundtrip Delay Calculations     Periodically, each DCN physical host sends a HELLO message to itsneighbor on each of the communication links common to both of them.For each of these links the sender keeps a set of state variables,including a copy of the source-address field of the last HELLO messagereceived.  DCN Local-Network Protocols                                         Page 7D.L. MillsWhen constructing a HELLO message the sender sets thedestination-address field to this state variable and thesource-address field to its own address.  It then fills in the "Date"and "Time" fields from its logical clock and the "Timestamp" fieldfrom another state variable.  It finally copies the "Delay" and"Offset" values from its Host Table into the message.     A host receiving a HELLO message discards it if the format is bador the checksum fails.  If valid, it initializes a link state variableto show that the link is up.  Each time a HELLO message is transmittedthis state variable is decremented.  If it decrements to zero the linkis declared down.     The host then checks if the source-address field matches thestate variable containing the last address stored.  If not, the linkhas been switched to a new host, so the state variables are flushedand the link forced into a recovery state.  The host then checks ifthe destination-address field matches its own address.  If so, themessage has been looped (legal only in the case of a broadcast net)and the roundtrip delay information is corrected.  The host and netareas are ignored in this case.  If not, the host and net areas of themessage are processed to update the Host and Net Tables.     Roundtrip delay calculations are performed in the following way.The link input/output processes assigned each link maintain aninternal state variable which is updated as each HELLO message isreceived and transmitted.  When a HELLO message is received thisvariable takes the value of the "Time" field minus the currenttime-of-day.  When the next HELLO message is transmitted, the valueassigned the "Timestamp" field is computed as the low-order 16-bits ofthis variable plus the current time-of-day.  The value of thisvariable is forced to zero if either the link is down of the systemlogical clock has been reset since the last HELLO message wasreceived.     If a HELLO message is received with zero "Timestamp" field, noprocessing other than filling in the internal state variable.Otherwise, the roundtrip delay is computed as the low-order 16-bits ofthe current time-of-day minus the value of this field.  In order toassure the highest accuracy, the calculation is performed only if thelength of the last transmitted HELLO message (in octets) matches thelength of the received HELLO message.     The above technique renders the calculation independent of theclock offsets and intervals between HELLO messages at either host,protects against errors that might occur due to lost HELLO messagesand works even when a neighbor host simply forwards the HELLO messageback to the originator without modifying it.  The latter behavior,typical of ARPANET IMPs and gateways, as well as broadcast nets, relieson the loop-detection mechanism so that correct calculations can bemade and, furthermore, that spurious host updates can be avoided.DCN Local-Network Protocols                                         Page 8D.L. Mills2.3.  Host Updates     When a HELLO message arrives which results in a valid roundtripdelay calculation, a host update process is performed.  This consistsof adding the roundtrip delay to each of the "Delay Host n" entries inthe HELLO message in turn and comparing each of these calculateddelays to the "Host Delay" field of the corresponding Host Tableentry.  Each entry is then updated according to the following rules:1.  If the link connects to another DCN host on the same net and the    port ID (PID) of the link output process matches the "Port ID"    field of the entry, then update the entry.2.  If the link connects to another DCN host on the same net, the PID    of the link output process does not match the "Port ID" field and the    calculated delay is less than the "Host Delay" field by at least a    specified switching threshold (currently 100 milliseconds), then    update the entry. 3.  If the link connects to a foreign net and is assigned a host ID    corresponding to the entry, then update the entry.  In this case    only, use as the calculated delay the roundtrip delay.    4.  If none of the above conditions are met, or if the virtual host    has been declared down and the "TTL" field contains a nonzero    value, then no update is performed.     The update process consists of replacing the "Delay" field withthe calculated delay, the "Port ID" field with the PID of the linkoutput process, the "Update Timestamp" field with the current time ofday and the "TTL" field by a specified value (currently 120) inseconds.  If the calculated delay exceeds a specified maximum interval(currently 30 seconds), the virtual host is declared down by settingthe corresponding "Delay" field to the maximum and the remainingfields as before.  For the purposes of delay calculations values lessthan a specified minimum (currently 100 milliseconds) are rounded upto that minimum.     The "Offset" field is also replaced during the update process.When the HELLO message arrives, The value of the current logical clockis subtracted from the "Time" field and the difference added toone-half the roundtrip delay.  The resulting sum, which represents theoffset of the local clock to the clock of the sender, is added to thecorresponding "Offset" field of the HELLO message and the sum replacesthe "Offset" field of the Host Table.  Thus, the "Offset" field in theHost Table for a particular virtual host is replaced only if that hostis up and on the minimum-delay path to the DCN host.     The purpose of the switching threshold in (2) above and theminimum delay specification in the update process is to avoidunnecessary switching between links and transient loops which canoccur due to normal variations in propagation delays.  The purpose ofthe "TTL" field test in (4) above is to ensure consistency by purgingall paths to a virtual host when that virtual host goes down.DCN Local-Network Protocols                                         Page 9D.L. Mills     In addition to the updates performed as HELLO messages arrive, eachvirtual host in a DCN host also performs a periodic update of its ownHost Table entry.  The update procedure is identical to the above,except that the calculated delay and offset are taken as zero.  Atleast one of the virtual hosts in a DCN host must have the same hostID as the host number assigned the DCN host itself and all must beassigned the same net number.  Other than these, there are norestrictions on the number or addresses of internet processes residentin a single DCN host.     It should be appreciated that virtual hosts are truly portableand can migrate about the net, should such a requirement arise.  Thehost update protocols described here insure that the routingprocedures always converge to the minimum-delay paths via operationallinks and DCN hosts.  In the case of broadcast nets such as Ethernets,the procedures are modified slightly as described below.  In this casethe HELLO messages are used to determine routing from the variousEthernet hosts to destinations off the cable, as well as to providetime synchronization.2.4.  Timeouts     The "TTL" field in every Host Table entry is decremented once asecond in normal operation.  Thus, if following a host update anotherupdate is not received within an interval corresponding to the valueinitialized in that field, it decrements to zero, at which point thevirtual host is declared down and the Host Table entry set asdescribed above.  The 120-second interval used currently provides forat least four HELLO messages to be generated by every neighbor onevery link during that interval, since the maximum delay between HELLOmessages is 30 seconds on the lowest-speed link (1200 bps).  Thus, ifno HELLO messages are lost, the maximum number of links between anyvirtual host and any other is four.     The "TTL" field is initialized at 120 seconds when an updateoccurs and when the virtual host is declared down.  During theinterval this field decrements to zero immediately after beingdeclared down, updates are ignored.  This provides a decent intervalfor the bad news to propagate throughout the net and for the HostTables in all DCN hosts to reflect the fact.  Thus, the formation ofrouting loops is prevented.     The IP datagram forwarding procedures call for decrementing the"time-to-live" field in the IP header once per second or at each pointwhere it is forwarded, whichever comes first.  The value usedcurrently for this purpose is 30, so that an IP datagram can live inthe net no longer than that number of seconds.  This is thus themaximum delay allowed on any path between two virtual hosts.  If thismaximum delay is exceeded in calculating the roundtrip delay for aHost Table entry, the corresponding virtual host will be declareddown.DCN Local-Network Protocols                                        Page 10D.L. Mills     The interval between HELLO messages on any link depends on thedata rate supported by the link.  As a general rule, this interval isset at 16 times the expected roundtrip time for the longest packet tobe sent on that link.  For 1200-bps asynchronous transmission andpacket lengths to 256 octets, this corresponds to a maximum HELLOmessage interval of about 30 seconds.      Although the roundtrip delay calculation, upon which the routingprocess depends, is relatively insensitive to net traffic andcongestion, stochastic variations in the calculated values ordinarilyoccur due to coding (bit or character stuffing) and mediumperturbations.  In order to suppress loops and needless path changes aminimum switching threshold is incorporated into the routing mechanism(see above).  The interval used for this threshold, as well as for theminimum delay on any path, is 100 milliseconds.3.  Formal Specification     The following sections provide a formal framework which describethe DCN HELLO protocol.  This protocol is run between neighboring DCNhosts that share a common point-to-point link and provides automaticconnectivity determination, routing and timekeeping functions.     The descriptions to follow are organized as follows: First asummary of data structures describes the global variables and packetformats.  Then three processes which implement the protocol aredescribed: the CLOCK, HELLO and HOST processes.  The description ofthese processes is organized into sections that describe (1) the localvariables used by that process, (2) the parameters and constants and(3) the events that initiate processing together with the proceduresthey evoke.  In the case of variables a distinction is made betweenstate variables, which retain their contents between procedure calls,and temporaries, which have a lifetime extending only while theprocess is running.  Except as noted below, the initial contents ofstate variables are unimportant.3.1.  Data Structures3.1.1.  Global VariablesADDRESS    This is a 32-bit bit-string temporary variable used to contain an    Internet address.    CLOCK-HID    This is an eight-bit integer state variable used to contain the    host ID of the local-net host to be used as the master clock.  It    is initialized to the appropriate value depending upon the net    configuration.     DATE    This is a 16-bit bit-string state variable used to contain the    date in RT-11 format.  Bits 0-4 contain the year, with zero

⌨️ 快捷键说明

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