home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / NETWORK / KA9QBGN.ZIP / RSPF.TXT < prev    next >
Encoding:
Text File  |  1991-02-26  |  60.4 KB  |  1,175 lines

  1.                 Fred Goldstein   k1io
  2.                 goldstein@carafe.enet.dec.com
  3.                 Version 2.1  2-oct-1989
  4.  
  5.      The Radio Shortest Path First (RSPF) Routing Protocol 
  6.       For DDN Internet Protocol over Amateur Packet Radio 
  7.  
  8.         ** DRAFT ARCHITECTURE -- FOR COMMENT **
  9.                 ** changes in V2.1 are noted by "**" and
  10.                    should be edited out before final release**
  11.  
  12. CONTENTS
  13.  
  14. I.   Introduction and Version Notes
  15. II.  Acquisition of router-router adjacencies
  16. III. Acquisition of end node adjacencies
  17. IV.  Link state propagation
  18. V.   The Shortest Path First Spanning Tree 
  19. Appendix:  Router Parameters
  20.  
  21.  
  22. I.  Introduction
  23.  
  24. Amateur packet radio use of the Internet Protocol does not yet provide 
  25. all of the capabilities of other IP networks.  One particular example
  26. of this is IP packet routing.  Most existing versions of the AMPR IP code
  27. make use of a static routing table.  This requires human intervention
  28. every time a new backbone path is added, and adds geographic constraints
  29. to address assignment which do not exist on the ARPA Internet. Some
  30. implementations make use of automatic routing protocols (interior
  31. gateway protocols, or IGPs) using distance vector routing.  These IGPs
  32. were originally written for wireline networks and tend to scale poorly
  33. to the amateur packet radio environment.
  34.  
  35. Many IP and other networks have implemented link state routing based upon
  36. Dijkstra's "SPF" (shortest path first) spanning tree algorithm.  A
  37. wireline implementation of SPF for IP is being standardized as the
  38. Open SPF Interior Gateway Protocol (OSPF), and an SPF procedure is
  39. being considered by ISO as the standard "IS-IS" routing protocol for
  40. OSI connectionless networks.  A similar (and derivative) procedure can
  41. be applied to AMPRnet (Net 44).  It is called Radio Shortest Packet
  42. First (RSPF); this document outlines the RSPF protocol.
  43.  
  44. RSPF occupies the role traditionally referred to in TCP/IP networks as
  45. an "Interior Gateway Protocol" (IGP), where "Gateway" means "router".
  46. It makes use of the services of the Internet Protocol.  It is not
  47. inconceivable that a router could use both RSPF and another IGP, or
  48. communicate with another network using the Exterior Gateway Protocol
  49. (EGP).  However these are not described in this document.
  50.  
  51. RSPF is intended to be implemented on routers, and need not be
  52. implemented on end nodes for the end nodes to take advantage of
  53. routing services.  Any IP station may be an end node giving no further
  54. consideration to routing.
  55.  
  56.  
  57. I.1. Elements of RSPF
  58.  
  59. The RSPF protocol is designed for use by internet-layer routing nodes (IP 
  60. Gateways) in a packet radio network using the DDN Internet Protocol.
  61. It is comprised of four major functions:
  62.  
  63.     1) Acquisition of router-router adjacencies
  64.     2) Acquisition of end node adjacencies
  65.     3) Link state propogation
  66.     4) Spanning tree route decision making.
  67.  
  68. Its net result is the automatic maintenance of a least-cost routing 
  69. table for use by IP Routing.  RSPF is optimized for the geographically
  70. heirarchical addressing used in AMPRnet, but does not depend upon it. 
  71.  
  72. RSPF is simpler than OSPF and IS-IS, as it is designed for PC
  73. implementation within the Amateur Radio Service.  It also adds
  74. procedures to take advantage of packet radio's "semi-broadcast"
  75. nature.
  76.  
  77.  
  78. I.2. Addressing convention
  79.  
  80. When an RSPF router communicates with an end node, it will typically
  81. deal with a 32 bit IP address.  Routers themselves, however, also
  82. support node group addressing (fewer than 32 bits need match).  This
  83. follows the convention in the KA9Q IP routing program, which permits a
  84. crude form of heirarchical addressing as well as allowing portable
  85. operations to override the defaults.  RSPF looks for the match (node or
  86. node group) with the greatest number of matching bits.  Only if the
  87. number of bits matched is equal, then the lower cost path will be used.
  88.  
  89. Thus a match to a full node address will override a "cheaper" path that
  90. matches its "class C net" of 24 bits, which overrides a "class B net",
  91. etc., noting that AMPRnet does not follow strict 8-bit address
  92. classification, and is a single Class A net.  In every case, a greater
  93. number of bits matched is considered a superior path to a destination
  94. than one that matches fewer bits, regardless of the value of the routing
  95. metric ("cost").
  96.  
  97.  
  98. I.3. Connection-oriented vs. connectionless lower layers
  99.  
  100. IP is a datagram network protocol, and supports both connection-
  101. oriented and connectionless lower layers (subnets).  In a network with
  102. a high packet loss rate, the local retransmission provided by a
  103. connection-oriented datalink will substantially improve overall
  104. throughput.  However, in a high-speed dedicated backbone, particularly
  105. one implemented using full-duplex radio or wireline links,
  106. connectionless links may provide better overall performance.  The
  107. choice of which to use is a local matter; RSPF will work with both.
  108. The reliability of the routing information, however, may be somewhat
  109. greater with connection-oriented datalink procedures, since these will
  110. give more rapid indication of a physical link failure.
  111.  
  112.  
  113. I.4. Relationship to other protocols
  114.  
  115. The reliability of the network depends upon reasonably reliable
  116. transmission of the routing update; hence, for non-broadcast procedures,
  117. connected-mode AX.25, or another reliable data link layer.  (In any case
  118. connected-AX.25 may be more useful than connectionless for backbone 
  119. links due to its local error correction ability.)  
  120.  
  121. **CHECK THIS OUT FOR VALIDITY WITH ANDERS**
  122. All packets specific to RSPF shall be exchanged inside IP packets using
  123. a protocol identifier which, pending formal assignment of one, shall
  124. be 73.  (How is this formally assigned?)  Such IP packets shall be
  125. sent with a time to live (TTL) value of 1.  If broadcast procedures
  126. are used, connectionless AX.25 UI frames shall be sent, with a
  127. multicast address "QST-0" in the AX.25 address and an IP address of
  128. 44.255.255.255. (A router can also "read the mail" on passing radio 
  129. packets not addressed to it; such procedures are for further study.) 
  130.  
  131. Note that in this document, "subnetwork" and "data link" are synonymous, 
  132. and refer to the layer over which IP packets are exchanged.
  133.  
  134.  
  135. I.5.  Version 2.1 changes.
  136.  
  137. RSPF draft 2.0 was released in June, 1988, as the first nearly-
  138. implementable version.  It was first implemented in September, 1989 by
  139. Anders Klemets.  This version 2.1 reflects changes whose need was
  140. discovered during this implementation.  These changes are both
  141. editorial and, in a few cases, substantive.
  142.  
  143. The format of the Routing Update packet has been slightly modified.
  144. In order to prevent fragments of two or more different routing update
  145. messages from being erroneously merged, an Envelope ID is added to
  146. each such packet, with the same Envelope ID on all fragments of a
  147. multi-packet message.  The term for such a message is now "envelope";
  148. it contains one or more "bulletins", each of which originated from a
  149. single router.
  150.  
  151. There are no longer separate packet types for Full Routing Update and
  152. Partial Routing Update.  Instead, they are distinguished by the value
  153. of the subsequence number, which is always 0 for Full Routing Updates
  154. and is never 0 for Partial Routing Updates.  A given envelope may
  155. contain both types of bulletin.
  156.  
  157. Cost is now set on the basis of receiver instead of transmitter.  This
  158. permits the automatic link quality adjustment to operate on the basis
  159. of locally-received traffic.
  160.  
  161. The remaining horizon is stored in the links table.  This is needed
  162. for consistency within the specification and was erroneously left out
  163. of 2.0.
  164.  
  165. It is now explicitly stated that upon creation of a new router-router
  166. adjacency, the routers exchage full routing information.  This allows
  167. routers to initialize themselves with a reasonably complete map of the
  168. network.
  169.  
  170.  
  171. II.  Acquisition of router-router adjacencies
  172.  
  173. For RSPF to operate correctly, all routers must remain reasonably 
  174. current as to the state of the network at large.  This is handled by
  175. the propagation of "bulletin" messages among routers.  End nodes need
  176. not concern themselves with this; they will normally communicate
  177. through one "designated" router at any given time, for all
  178. (non-adjacent) destinations (not seen by ARP or other lower-layer 
  179. procedures).  End nodes can also, of course, connect to each other
  180. directly, bypassing RSPF.
  181.  
  182. Each router maintains an adjacencies table.  Each router's adjacency
  183. table lists the following information for all other nodes, both
  184. routers and end nodes, from which it directly receives packets over a
  185. subnetwork:
  186.  
  187.     Adjacent node IP address (i.e., 44.56.0.44)
  188.     Adjacent node datalink (AX.25) address (i.e., K1IO-0)
  189.     Datalink used (i.e., AX0)
  190.     Datalink cost (i.e., 4)
  191.     Number of packets heard since last RRH update (i.e., 50)
  192.     Packet sequence number in last RRH update (i.e., 12593)
  193.     Time of last RRH update (i.e., 2130).
  194.  
  195.  
  196. II.1.  Router-router hello
  197.  
  198. For the backbone to create its topology automatically, there must be a
  199. way for routers to discover each other with minimal overhead.  For
  200. this purpose, a router-router hello (RRH) message is provided.
  201. Periodically (as an initial suggestion, shortly before beginning to
  202. propogate the periodic links state bulletin to known adjacencies), the
  203. router sends out the RRH message to the layer 2 multicast address and IP
  204. multicast address.  RSPF makes no assumption of reciprocity (that
  205. links are bidirectional), so receipt of an RRH packet provides the
  206. receiver with information about a one-way (received) adjacency. 
  207.  
  208.  
  209. II.2.  Connection-oriented procedure
  210.  
  211. If a router uses connection-oriented subnet procedures to its own 
  212. adjacencies, then when a router receives this RRH packet, it checks to
  213. see if it already has a link to that packet's originator in its own
  214. links table.  If not, it waits a random period of time (initial
  215. suggestion:  within the range of 0 to 10 times the link's value of T1,
  216. DWAIT or SLOTTIME, and in any case much longer than the timers used
  217. within a CSMA or Aloha subnet such as AX.25) and then attempts to
  218. establish an AX.25 connection with the usual SABM; the router responds
  219. with the usual UA (link established) or DM (link rejected). 
  220.  
  221. If a two-way connection has been established, then both routers add the 
  222. link to their adjacency tables.  While the existence of this route is
  223. set reciprocally, the cost of each side of the route is set separately
  224. for each side of the connection.  Cost is propagated in the routing
  225. update (link state) packet.  Thus the adjacency between two routers is
  226. not actually used for real traffic until the first routing update
  227. packet exchange has taken place.
  228.  
  229. Loss of an adjacency may then be noted by the loss of the subnet
  230. connection.  When this occurs, the router removes the adjacency from
  231. its adjacency table and follows the "bad news" procedures outlined
  232. below for link state propagation.
  233.  
  234.  
  235. II.3.  Connectionless procedure
  236.  
  237. If a router uses connectionless datalink procedures to its own 
  238. adjacencies (suitable to low-loss links), then when a router receives an 
  239. RRH packet, it checks to see if this adjacency is already in its 
  240. adjacency table.  If not, then it is added.  It also sends RRH packets
  241. with the same frequency as with connection-oriented subnets.
  242.  
  243. Loss of an adjacency may be noted by timeout; if no RRH message is 
  244. received, and no frames have been received from the adjacent router for 
  245. a period of time (initial suggestion:  slightly over twice the maximum 
  246. interval between RRH messages), then the adjacency becomes suspect.
  247. The router should attempt (**a settable number of times**) to exchange a
  248. packet (ICMP echo) with the suspect adjacency; if unsuccessful (after
  249. the usual number of retries), the route is marked lost.  It may also
  250. be marked lost if other attempts to send data through that router
  251. fail, such that the implementation determines that there is a high
  252. probability that the link is lost.  
  253.  
  254.  
  255. Table II-1.  Coding of the RRH PDU.
  256.  
  257.                   1           2
  258.  |0              |8              |6              |4              |
  259.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  260.  | RSPF Version #| Type (RRH)    | Checksum                      |
  261.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  262.  |         Full IP Address of sending router                     |
  263.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  264.  |  last packet sent seq. #      |  flags        |
  265.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  266.  |        plaintext                                              |...
  267.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  268.  
  269.  
  270. Parameters--
  271.  
  272.   An RSPF Router-Router Hello packet is sent within IP with a type
  273.   of <tbd-- 73 suggested>.  Each RRH packet contains the following
  274.   fields:
  275.  
  276.     RSPF Version Number:  Version number of this protocol (initially 1).
  277.  
  278.     Type:  Value of 3 for RRH.
  279.  
  280.     Checksum:  IP-style checksum
  281.  
  282.     Address:  Full IP address of sending router
  283.  
  284.     Last packet sent sequence number:  An integer (mod 65535) 
  285.     incremented by 1 for every frame sent by the datalink layer across 
  286.     this interface.  This value allows receiving entities using 
  287.     connectionless procedures to use the automatic link quality 
  288.     measurement technique described in II.4. 
  289.     
  290.     Flags:  The low-order bit is 1 if connectionless datalink is
  291.     preferred; 0 if connection-oriented is preferred.  (Set by
  292.     system management based upon anticipated link quality.)
  293.     Other bits are reserved (sent 0).
  294.  
  295.     Plaintext:  An optional text message (length may be up to maximum
  296.     size remaining in datalink PDU).  This might serve, for example,
  297.     to "broadcast" the router's existence to persons who might be
  298.     "reading the mail" (monitoring a radio channel promiscuously).
  299.  
  300.  
  301. II.4.  Automatic link quality measurement
  302.  
  303. A connectionless link or subnetwork may have very reliable, or very
  304. sporadic, performance.  Since there is no procedure for ensuring the
  305. reliability of packets sent over a connectionless link, a high rate of 
  306. packet loss may occur without being detected by the routers.  If this 
  307. loss is high enough, another route may become a better choice; a high 
  308. enough packet loss rate may be enough to mark a link as "down".  The
  309. automatic link quality measurement procedure allows links which are
  310. not yet "down", but whose performance is substandard, to be noted.
  311.  
  312. Every router shall maintain, for each link, a count of all packets
  313. sent over each link.  Every time an RRH message is sent, it includes
  314. the current value of this counter (modulo 65536).  Every router also
  315. maintains, in its adjacency table, a count of the total number of
  316. packets received from said adjacency since the last RRH message, and
  317. the value of that counter as received in the last RRH message.
  318.  
  319. Upon receipt of an RRH message, the recipient router compares the value 
  320. of the received packet counter with the last received value in the 
  321. adjacency table.  The difference (taking into account wrap-around at the 
  322. modulus) is compared with the number of packets received since the last 
  323. RRH message.  (This works even if an RRH message is lost.)  This packet 
  324. loss ratio is then maintained as a guideline to determine link quality.  
  325. If link quality falls below a settable threshhold, the link is
  326. suspect.  Timestamp can also be used to compute packet arrival rate.
  327.  
  328. Connection-oriented data links presumably deliver 100% of attempted 
  329. packets.  A high-quality connectionless link, such as Ethernet/LLC1, will 
  330. come close to this.  However, single-frequency packet radio links are 
  331. prone to packet loss for several reasons, including hidden transmitters, 
  332. lack of collision detection, and rf interference.  The packet loss ratio
  333. is useful in setting link cost, and may also be used to determine
  334. whether a link should use connectionless or connection-oriented 
  335. procedures.
  336.  
  337. If a router reports, in its link update packets, that a given link has a 
  338. cost of _n_, then its adjacencies (and only its adjacencies) may apply 
  339. the packet loss ratio to adjust the cost which they maintain in their 
  340. link state tables.  These adjusted costs, rather than the received 
  341. costs, may then be propagated to other routers.  
  342.  
  343. Such procedures should be applied sparingly, as each change must be
  344. propagated and could, if used too frequently, result in network-wide
  345. instability.  A suggested (experimental) algorithm is as follows:  A
  346. percentage threshhold x is set, as is a cost-adjustment factor y.  If
  347. fewer than x% of packets are received during a measurement interval,
  348. the cost of that adjacency is multipled by y.  For example, if x is 80 and
  349. y is 1.5, then an adjacency with a nominal assigned cost of 4 will be
  350. up-costed to 6 if only 70% of packets are received, but will be
  351. restored to 4 if 80% or more are received during the next measurement
  352. interval.  The measurement interval is the time between RRH messages,
  353. which precede routing update messages.
  354.  
  355.  
  356. III. Acquisition of end node adjacencies
  357.  
  358. Three possible means of determining adjacencies to end nodes are the use
  359. of connected-mode AX.25 links, the use of ARP, and the use of a 
  360. "wiretap" algorithm (see RFC981).  Unless a connection mode Data Link
  361. layer (with keepalive timers) is used, adjacent nodes may need to send
  362. each other messages at regular intervals (ping) to ensure that the
  363. link is still usable.  A procedure is outlined below for routers and
  364. end nodes to acquire knowledge of each other. 
  365.  
  366. It is assumed that RSPF will not be activated in end nodes; this
  367. permits them to use simple version of the IP software.  A node that
  368. has RSPF support in its software but operates as an end node can also
  369. use the router-router connection procedures and simply broadcast its
  370. adjacency to the router in a one-entry bulletin with a horizon of one.
  371. Such a node may also be simultaneously homed on two or more other
  372. routers, unlike true end nodes whose traffic either bypasses RSPF
  373. (using ARP) or arrives by way of its associated router.
  374.  
  375. There is no "redirect" function provided in RSPF.  Since radio does
  376. not provide a true "broadcast" topology subnetwork, a router cannot
  377. presume that if both end nodes can hear it, that both end nodes can
  378. hear each other.
  379.  
  380. If an end node knows the IP address of the router which will connect
  381. it to the network at large, it may establish a connected-mode AX.25
  382. (or other subnet) connection to the router; the presence of this
  383. connection indicates that the node is reachable from that router,
  384. which then adds it to its links table and subsequent bulletins.  This
  385. may, of course, require an ARP exchange in order to acquire the AX.25
  386. (or other data link layer or subnet) address.  
  387.  
  388. Alternately, the end node can simply use ARP and use connectionless 
  389. link procedures. In this case the router should assume that the end node
  390. is available until either a rather lengthy timer expires, or the router
  391. is unable to make an ARP contact after the ARP timer expires.  (A loss
  392. of reachability should not be inferred from the ARP timeout.) 
  393.  
  394. Routers should periodically broadcast their availability (suggested 
  395. interval:  every 15 minutes) with an AX.25 UI frame sent to QST-0 (the 
  396. AX.25 broadcast address).  A human-readable "unproto" message may go 
  397. here, allowing individual operators to recognize routers and connect
  398. as appropriate.  (No specific PDU coding is provided, as the end
  399. nodes do not use RSPF, and thus this is not really an RSPF packet.)
  400.  
  401. A router may also choose to use "Promiscuous ARP" to provide service to 
  402. an end node which is attempting to connect with an IP address reachable 
  403. by the router.  In such a case the router should wait an extra interval 
  404. after receiving the ARP request because the desired destination may 
  405. actually be directly reachable; ARP procedures may need to be modified
  406. to provide this. 
  407.  
  408. Another potential approach is for routers to simply listen to AX.25 
  409. traffic on the link and determine who is adjacent to whom.  This is the 
  410. gist of the "wiretap" algorithm in RFC981, which also finds non-adjacent 
  411. nodes by taking advantage of the source routing found in AX.25 frames.
  412. Integration of wiretap into RSPF is for further study.
  413.  
  414.  
  415.  
  416. IV.  Link state propagation
  417.  
  418. Link state information is propagated between routers within bulletin
  419. envelopes, which are sequences of packets containing partial or full
  420. copies of the sending node's link state table.  Both point-to-point
  421. and broadcast procedures are provided.
  422.  
  423. IV.1.  Optional multicast/broadcast
  424.  
  425. Packet radio is inherently a broadcast medium.  Packet radio networks, 
  426. however, may be viewed as a collection of individual links which happen 
  427. to use a broadcast physical medium.  It is also possible to exploit the
  428. broadcast nature of the medium.  RSPF link state propagation procedures
  429. allow but do not require such multicasting.  If the link uses
  430. connectionless procedures for user data packet exchange, then broadcast
  431. procedures should be used for link state packet exchange.  The converse
  432. may not necessarily be true:  The threshhold of loss that militates
  433. against connectionless transmission of user data may be more stringent
  434. than that which call for non-broadcast transmission of link state
  435. packets.  (Optimal parameters are for further study.) 
  436.  
  437.  
  438. IV.2.  Routing update bulletins
  439.  
  440. Routing updates are passed along from router to router via routing
  441. update bulletins, which are broadcast within routing update envelopes.
  442. Bulletin propagation is designed to make it extremely likely that
  443. every node within a given "horizon" receives every routing update
  444. message sent out by a given node. 
  445.  
  446. Every router originates information about changes in its own adjacencies, 
  447. as well as periodic retranmissions of its entire list of adjacencies.  
  448. These bulletins are then propagated among other routers. The router whose
  449. adjacency information is being broadcast is called the _reporting
  450. router_; this may be some hops away from the routers which forward it to
  451. their own adjacencies.  Each reporting router's bulletins (adjacency
  452. updates) contain a sequence number (and in some cases, a subsequence
  453. number).  These sequence and subsequence numbers are generated by the
  454. reporting router and propagated; they are not changed when a bulletin
  455. is relayed.  They are incrememted by 1 (modulo 65536) every time a new
  456. one is generated. 
  457.  
  458. Bulletins may also carry change information incremental to previous
  459. bulletins.  These carry the same sequence number as the full routing
  460. update bulletin to which they are reporting incremental changes; each
  461. such partial routing update bulletin has a subsequence number.  The
  462. subsequence number is zero for a full routing update bulletin.
  463.  
  464. Every bulletin also has a horizon value, set by the reporting router,
  465. associated with each of its constituent links.  (A given reporting
  466. router may have more than one constituent link, if it is a multi-port
  467. router.)  Every time a bulletin is propagated, each horizon value is
  468. decremented by 1.  When it hits zero, the bulletin is not propagated
  469. further.  Note that for horizon purposes, a bulletin's individual
  470. constituent links may have separate horizons; when a link's horizon hits
  471. zero, other links' adjacency information from the same reporting router 
  472. may continue to be propogated.  
  473.  
  474. It should also be noted that if a given link has adjacencies with
  475. different horizons, these must be treated as separate links, since
  476. horizon is reported as a characteristic of link.  Such a circumstance
  477. may occur, for example, when a router serves a node group.
  478. Adjacencies within the node group are typically propagated with short
  479. horizons, since they are only of local interest (i.e., to other nodes
  480. in or near that node group).  Similarly, the node group itself is
  481. propagated with a long horizon, across a backbone.  However,
  482. adjacencies outside the node group may be propagated with long
  483. horizons, as they would not otherwise be reached across a backbone
  484. dependent upon node groups for long-haul routing.
  485.  
  486. Every router maintains within memory a routers table containing one
  487. tuple for every other router on the network.  This tuple contains the
  488. following elements:  
  489.  
  490.     IP Address 
  491.     Last received bulletin sequence number 
  492.     Last received bulletin subsequence number 
  493.     Timestamp for when the data was received.  
  494.     Horizon remaining in bulletin when received **NEW IN 2.1**
  495.  
  496. This table is used to coordinate the receipt and transmission of
  497. bulletins, using either broadcast or non-broadcast procedures. 
  498.  
  499.  
  500. IV.3.  Flooding without congestion 
  501.  
  502. Upon initialization of adjacencies
  503.  
  504. Bulletins are forwarded in a routing update envelope which may contain
  505. one or more reporting routers' bulletins (adjacency lists), which are 
  506. flooded to the network.  A bulletin envelope may actually concatenate
  507. multiple reporting routers' bulletins; this is in fact the typical
  508. case, when routing update packets are exchange on schedule, **and when a
  509. given router acquires a new adjacency**.  However, partial routing
  510. updates (good news and bad news) may be sent at any time.
  511.  
  512. The first time an adjacency is acquired, the two routers perform a
  513. full routing update with each other, exchanging their complete link
  514. lists.  Once this is complete, the routers perform the SPF algorithm
  515. and compute new routing tables.
  516.  
  517. Preventing loops and retransmissions
  518.  
  519. A bulletin from reporting router X (which lists all of X's
  520. adjacencies) is sent, initially by X, to every adjacent (to X) router
  521. A.  This router A passes it along to all of its own adjacencies B,
  522. etc..  This flooding is controlled such that no reporting router's
  523. adjacency update is sent more than once between the same pair of
  524. routers.  
  525.  
  526. After router A sends its bulletin envelope to B, the recipient router
  527. B then looks at the sequence number of each reporting router X's
  528. adjacency bulletin within that envelope, and for each reporting
  529. router's bulletin, compares the sequence number of the just-received
  530. adjacency bulletin with the highest sequence number previously
  531. originated from X.  If the just-received bulletin is newer (higher
  532. number), then it sends a positive acknowledgement to A, and joins in
  533. the flooding to its own adjacencies.  The horizon is, of course,
  534. decremented.  ** HOW IS IT POSITIVELY ACKED?  NEED WE? **
  535.  
  536. If the bulletin from X has the same number as was stored in B, B checks 
  537. the horizon left in the received bulletin against the horizon left
  538. when it previously received the bulletin.  In the event that the
  539. latest bulletin received had a shorter (lower number) horizon left
  540. than the earlier one, it simply acknowledges the (redundant) message.
  541. But if the reporting router X's horizon left is greater for the new
  542. copy of the bulletin, router B propagates it as if it were a new
  543. bulletin. This way, if the bulletin happened to first arrive via a
  544. roundabout path, it won't accidentally fail to reach the intended end
  545. of its range. (Summary:  Newer or longer-horizon bulletins are both
  546. passed along.  Same age or older (by sequence number) or same or lower
  547. horizon will not be propagated.)
  548.  
  549. If any router B receives from router A a bulletin (from any reporting 
  550. router X) that contains a lower sequence number than one that had 
  551. previously arrived at B from said X, then it can be presumed that A
  552. has "obsolete" information.  B replies by sending a bulletin to A with
  553. the latest link state information for that node X.  As a corrolary, a
  554. router may poll for information about a given reporting router by
  555. sending a routing update bulletin for that reporting router with a
  556. sequence number that is lower than the latest one it actually has
  557. received.  Said bulletin may contain zero links' information.  (Note
  558. that since the sequence number is modular, a value of 0 is not correct
  559. for this function as 0 is higher than 65535; the "poll" number should
  560. be only slightly lower.)
  561.  
  562.  
  563. IV.4.  Non-broadcast bulletin envelope exchange
  564.  
  565. A router may acquire routing information from adjacent routers via 
  566. point-to-point procedures which treat every adjacency as a separate 
  567. logical data link.  (Such a procedure also works, of course, over 
  568. point-to-point links such as wirelines.)  This tends to have the highest
  569. reliability, since connection-oriented data link control procedures can
  570. be used to ensure the accuracy and completeness of the data passed over
  571. the link.  It has the disadvantage of requiring separate transmission of
  572. the same data to different adjacent nodes on the same radio channel. 
  573.  
  574. Bulletin envelopes are thus exchanged (when connection-oriented is
  575. selected) periodically (based upon timers) and when new information is
  576. received (over a new adjacency, and when good and bad news arrive).
  577. Delivery of these bulletins is considered to be gnerally reliable.
  578.  
  579.  
  580. IV.5.  Broadcast bulletin propagation
  581.  
  582. When a router is adjacent to several other routers via the same 
  583. broadcast (i.e., packet radio) channel, retransmission of routing
  584. bulletins to each adjacency makes additional use of bandwidth, which may
  585. be a scarce resource.  A broadcast procedure may be used to pass the
  586. bulletin along that link.  Note that broadcast propagation of bulletins
  587. may be combined with non-broadcast propagation, on a link by link basis.
  588. Although packet radio is a broadcast medium, it is not a perfect one:
  589. The reliability of multicast packets is not as high as for wireline LANs.
  590. This leads to the need for a unique broadcast "flooding" technique.
  591.  
  592. A routing update bulletin is broadcast to the Layer 2 multicast AX.25
  593. address using the IP multicast address.  Individual recipient routers
  594. may or may not receive the entire bulletin, since there is no
  595. acknowledgement provided. 
  596.  
  597. In the previously described case of a non-broadcast message sent via a
  598. connection-oriented datalink, the entire routing update bulletin can
  599. be assumed to have been received intact.  Thus, if a given reporting
  600. router has originated a new complete list of its adjacencies (new
  601. sequence numbers, subsequence numbers are 0), then any adjacency not
  602. included is presumed to have ceased to exist.  Such a presumption is
  603. not always possible when a bulletin was received via unacknowledged
  604. broadcast, as the message might have been received in part.  This
  605. should not make the partially received bulletin unusable. 
  606.  
  607. A bulletin envelope is transmitted in one or more packets, each of
  608. which constitutes a numbered fragment of the whole bulletin envelope.
  609. Within the transmitted bulletin envelope, each individual reporting
  610. router's bulletin begins with a node-header which contains the number
  611. of links being reported on.  Within each bulletin, each link is
  612. identified by a link header, each of which specifies the number of
  613. adjacencies being reported on (for that link).  Since each IP packet
  614. that makes up a bulletin contains a fragment number, it is also
  615. possible to determine whether or not a fragment was lost.  Each packet
  616. also contains an envelope-ID, which prevents accidental mis-assembly
  617. of different bulletins that may arrive close in time. **NEW IN 2.1**
  618.  
  619. In connection-oriented non-broadcast procedures, a routing update 
  620. bulletin (not a partial one with a subsequence numbers >0) provides a 
  621. complete list of adjacencies known to the sending node, except where the 
  622. horizon is exceeded.  Absence of a previouly-known adjacency then 
  623. implies that the adjacency has been lost.  However, that assumption does 
  624. not apply to fragmented bulletins received in part, which can occur with 
  625. broadcast procedures: If a fragment was lost before reaching the end of
  626. a given reporting router's bulletin within the bulletin envelope, then
  627. the absence of a previously-known adjacency in the received bulletin
  628. does not mean that the adjacency was lost. 
  629.  
  630. RSPF procedures dictate that routing update bulletins with a subsequence 
  631. number of zero are presumed to be complete lists of adjacencies from 
  632. their originators; higher subsequence numbers represent incremental
  633. changes only.  In the broadcast procedures, a routing update bulletin 
  634. with a subsequence number of zero, if received only in part, is
  635. treated as a partial routing update bulletin.  If it received in full,
  636. it is treated as a full routing update bulletin.
  637.  
  638. Thus, the recipient compares the sequence number with the previously
  639. received sequence number from that reporting router.  If it is higher
  640. than the previously received one, then its adjacencies are used.  If
  641. it was received in full, and had a subsequence number of 0, then its
  642. previous adjacencies are replaced (removed if not contained in the
  643. latest full routing update bulletin).  If it was not received in full,
  644. or if its subsequence number was not zero, then its previous
  645. adjacencies are left intact unless explicitly changed by the received
  646. bulletin.
  647.  
  648. If a bulletin is received in full, then the routers table is updated 
  649. with the latest sequence and/or subsequence number, horizon **NEW 2.1**
  650. and timestamp.  If it is received in part, then these entries are not
  651. updated.  After the bulletin has been completely transmitted, a
  652. recipient node which has received a partial update from a reporting
  653. node may poll for that node's latest information, by using the (now
  654. known to be obsolete) sequence number for that router in its router
  655. table in a bulletin, with zero links for that reporting router.  (This
  656. is the same polling procedure used for non-broadcast links.)
  657.  
  658. Note that if a fragment is lost, a reporting router whose node-header is 
  659. in the lost fragment will of course remain unchanged in the recipient's 
  660. data base.  Furthermore, any data received in subsequent fragments, 
  661. prior to a node-header, will also be meaningless.  The last adjacency 
  662. of the last link in a reporting router's bulletin will have the Last 
  663. flag set to 1, signaling that following the address, a node header 
  664. follows.  Note also that the first node-header within an envelope is
  665. pointed to by the sync byte in the envelope header.  The last flag and
  666. sync byte should match or an error should be noted.
  667.  
  668.  
  669. IV.6.  Routing update bulletin packets 
  670.  
  671. A routing update bulletin envelope (Table IV.1) may contain several
  672. different reporting routers' updated link state information,
  673. concatenated into one message, with a different sequence number for each
  674. source (reporting router).  One of the sources, of course, may be the
  675. local router.  Each router's link state information is further broken
  676. down by link, which allows its backbone routing information to be
  677. propogated separately from its local end node adjacency information. 
  678.  
  679. Incremental changes (good news and bad news)
  680.  
  681. Bulletins that only report changes in state come in two flavors.  Good
  682. News bulletins inform other routers that an adjacency has been noted.
  683. Bad News bulletins inform them that an adjacency has been lost.  If an
  684. end node establishes a connection with a router whose node group default
  685. addresses (based on the significant bit count) already include that end
  686. station, however, no bulletin need be sent out, as packets to that end 
  687. station will already be routed correctly.  Theoretically, a router could
  688. send out a new full routing update bulletin every time it gained or lost
  689. an adjacency. However, the use of shorter Good News and Bad News
  690. packets, which do not contain a full routing update, allow the network
  691. to remain relatively current with less transmitted traffic. 
  692.  
  693. Good news and bad news packets are propogated like other packets,
  694. but are not originated by the same rules.  While full routing bulletins
  695. are originated based upon a timer, good news packets are transmitted
  696. immediately upon receipt and initiated immediately after an adjacency
  697. is initialized.  This enables new links to be useful quickly.  Bad news,
  698. however, should not travel as fast:  A node should cache any bad
  699. news message for a time (initial recommendation for this timer: 60 
  700. seconds) while waiting for the link to come back up.  This helps keep
  701. the network stable; if the node receives a packet destined for the 
  702. lost destination, it may send an ICMP "host unreachable" message
  703. to the originator of the packet, unless it can reroute the packet
  704. itself (as may happen with the loss of a backbone link when others
  705. still exist).
  706.  
  707. Because good news and bad news messages represent changes to the last
  708. full link state bulletin propogated, but do not purport to completely
  709. represent a node's link states, they carry bulletin subsequence
  710. numbers.  These use the last bulletin sequence number originated by the
  711. reporting router, but the sub-sequence value increments from 1. (A full 
  712. link state packet has a sub-sequence value of 0, and resets the 
  713. subsequence counter.) 
  714.  
  715. Routes to nearby destinations
  716.  
  717. Sometimes more than one router will serve the same area (determined by 
  718. the significant bits' matching), and they will need to know which one has 
  719. the better path to a given station.  These adjacency messages may only 
  720. require a short horizon, as will Good News and Bad News packets which 
  721. refer to end nodes going on and off the air.   Higher horizons are 
  722. needed for backbone routers.
  723.  
  724.  
  725. Table IV.1.  Routing update (link state packet) bulletin envelope:
  726.  
  727.                   1           2
  728.  |0              |8              |6              |4              |
  729.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  730.  | RSPF Version #| Type          | fragment #    | fragment total| packet
  731.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -hdr
  732.  |       Checksum                | sync byte     | # nodes below |
  733.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  734.  |  Envelope-ID                  |
  735.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  736.  |         Reporting node #1 full IP Router-Address              | node
  737.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -hdr
  738.  |  Node 1 bulletin  sequence #  | sub-sequence #| # links       |
  739.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
  740.  | horizon left   |  ERP factor  |  link cost    |  #adjacencies | link
  741.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ _-hdr_
  742.  |significant bits|
  743.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  744.  |              Adjacent node(s) 1,1,1 IP address                | adj.
  745.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  746.  |significant bits|
  747.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  748.  |             Adjacent node(s) 1,1,2 IP address                 | adj.
  749.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  750.                        ...
  751.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  752.  |significant bits|
  753.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  754.  |             Adjacent node(s) 1,1,n IP address                 |
  755.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  756.  | horizon left   |  ERP factor  |  link cost    |  #adjacencies | link
  757.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  758.  |significant bits|
  759.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  760.  |             Adjacent node(s) 1,2,1 IP address                 | adj.
  761.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  762.                         ...
  763.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  764.  |significant bits|
  765.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  766.  |             Adjacent node(s) 1,2,n IP address                 | adj.
  767.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  768.  |         Reporting node #2 full IP Address                     | node
  769.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  770.  |  Node 2 bulletin sequence #   | sub-sequence #|  # links      |
  771.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  772.  | horizon left  |  ERP factor   |  link cost    |  #adjacencies | link
  773.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  774.  |significant bits|
  775.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ adj.
  776.  |             Adjacent node(s) 2,1,1 IP address                 |
  777.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---
  778.  |significant bits|
  779.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  780.  |             Adjacent node(s) 2,1,2 IP address                 |
  781.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  782.                        ...
  783.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  784.  | horizon left    |  ERP factor |  link cost    |  #adjacencies | 
  785.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  786.  |significant bits|
  787.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  788.  |             Adjacent node(s) 2,2,1 IP address                 |
  789.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  790.                         ...
  791.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  792.  |significant bits|
  793.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  794.  |             Adjacent node(s) 2,2,n IP address                 |
  795.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  796.                         ...
  797.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  798.  |         Reporting node #n full IP address                     |
  799.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  800.  |  Node n bulletin sequence #   | sub-sequence #|   # links     |
  801.  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  802.     etc.
  803.  
  804. Parameters--
  805.  
  806.   An RSPF bulletin packet is sent within IP with a type of <tbd - use 73
  807.   until an official value is assigned>.  Each routing update envelope
  808.   contains an envelope packet header that contains:
  809.  
  810.     RSPF Version Number:  Version number of the protocol (initially 1).
  811.     Type:  (Value 1 for Routing Update Bulletin Envelope)
  812.  
  813.     Fragment Number:  States which fragment, in a segmented message,
  814.     this is, beginning at 1.  Non-fragmented messages use 1.
  815.     
  816.     Fragment total:  Total number of fragments in message; 1 if not 
  817.     fragmented.
  818.  
  819.     Checksum:  IP-style checksum.
  820.  
  821.     Sync byte:  Which octet in this packet (counting from this 
  822.     byte as byte 0) is the beginning of the first node-header.  If 0,
  823.     this fragment has no node-header.  Non-fragmented messages
  824.     use a value of 4 (because 3 bytes follow in packet header).
  825.     **NOTE CHANGE IN 2.1**
  826.  
  827.     Number of nodes reporting:  The number of reporting routers in the 
  828.     messages that follows (this packet or a sequence of packets forming
  829.     the envelope).
  830.  
  831.  
  832.   The node-header (for each reporting router) contains 8 octets:
  833.  
  834.     Reporting router #n full IP router address:  The IP address of 
  835.     the router whose adjacencies are being reported below.  (Note
  836.     that if a router uses separate IP addresses on its links, it
  837.     should still adopt a single one as its router address.)
  838.  
  839.     Bulletin sequence number:  When a bulletin is passed along, this 
  840.     number is NOT changed; every new bulletin from a given Reporting 
  841.     router has a value 1 higher than the previous bulletin from that
  842.     reporting router.  (Note:  This is modulo 65536, so implementations
  843.     must cope with the "wrap around" and consider values below, say,
  844.     100, to be "higher" than values above, say, 65400.  Between 100
  845.     and 65400, modular arithmetic is NOT used.)
  846.  
  847.     Sub-sequence number:  Good news and bad news packets representing
  848.     incremental changes from the last full report increment this value
  849.     by 1; it is 0 for full bulletins.
  850.  
  851.     # links:  The number of different cost-horizon values (typically, 
  852.     but not necessarily, representing different types of link in a 
  853.     mulitiport gateway) being reported below; the following four octets 
  854.     are the header for each link.
  855.  
  856.  [For each reporting router, adjacencies are reported separately by
  857.   link cost.  This is the received cost value for that data link, after
  858.   any adjustment that may be based upon packet loss ratio.  Adjacencies
  859.   are also reported separately by horizon, even if the cost is the same. 
  860.   It does not matter at this point if there are multiple RF or other 
  861.   links if their cost and horizon are the same.  Likewise, separate
  862.   received costs or horizons on one link will be treated separately
  863.   and such adjacencies will be grouped under separate link headers:]
  864.  
  865.     Horizon left:  This number is decremented every time a routing update 
  866.     bulletin is passed along; when it reaches 0, it is not passed further.
  867.  
  868.     Link cost:  A "figure of merit" for each link, rising with
  869.     slower/poorer links.  This is the number whose total is minimized
  870.     by SPF.  The range is 1-127.  As a starting point, a 56000 bps fdx
  871.     backbone link might have a value of 2, a 4800bps hdx link a value
  872.     of 5, a 1200bps hdx link a value of 10 and a 300 bps hf "wormhole"
  873.     a value of 20.  An Ethernet or high-speed (1 Mbps+) link might
  874.     then have a value of 1.  A value of 255 denotes the loss of a
  875.     link; this is found in Bad News packets.  These values should be
  876.     coordinated network-wide;  adjusting them will change the way
  877.     packets are routed by RSPF.
  878.  
  879.     Number of adjacencies:  The number of adjacencies to be listed for that 
  880.     reporting node.
  881.  
  882.     ERP Factor:  Used for "approximating" a route; contains the number of 
  883.     significant bits for which a given node can be presumed to be a valid 
  884.     router, even if it doesn't report in detail.  A low factor = wider 
  885.     coverage area; thus ERP of 16 means that if NO other match is found for 
  886.     a given address, this router will try to handle it if it matches 16 
  887.     bits.  Basically a handle for future enhancements; its use will not
  888.     be required in the initial release of RSPF.
  889.  
  890.   For each adjacency of the given link cost, the following is provided:
  891.  
  892.     Significant bits: The number of bits used for node group routing 
  893.     purposes.  Usually 32 but may be lower if a given link purports to 
  894.     serve all end nodes in an area defined using the most-matched-bits 
  895.     node group convention.  Higher numbers of bits matched take a higher 
  896.     priority than least cost.  This uses the low-order 5 bits of the 
  897.     octet.
  898.  
  899.     Last-flag:  If this is the last adjacency in the list for this 
  900.     reporting router, this value is 1; otherwise it is 0.  (This 
  901.     occupies the high-order bit of the significant bits octet.)
  902.  
  903.     Full IP address: The full IP address for this node.  
  904.  
  905. Note that the n,n,n vector within the bulletin has three fields in the
  906. above representation: Reporting router within bulletin envelope, link 
  907. cost/horizon within reporting router's bulletin, and reporting adjacency
  908. with that link cost/horizon.
  909.  
  910.  
  911. IV.7.  Fragmentation
  912.  
  913. In a moderate to large network, a full routing update can easily exceed 
  914. the maximum size of an AX.25 frame or IP packet.  The RSPF Routing
  915. Update message, however, may be sent in fragments.  The IP
  916. fragmentation function is not used for this; bulletins are not assumed
  917. to be terminated by a packet boundary.  Each fragment is, however,
  918. numbered in the packet header, along with an indication of the number
  919. of the total number of fragments in that envelope.
  920.  
  921. In order to permit parsing of the incoming fragments by routers who
  922. are using unacknowledged broadcast information (with the high 
  923. likelihood of lost fragments), every bulletin's packet header contains a 
  924. sync byte indicator.  This indicates which byte, where the next byte in 
  925. the header is byte 1, is the beginning of a node header.  If a previous 
  926. fragment was lost, the receiver should ignore the number of bytes 
  927. indicated in the sync byte before resuming parsing of the packet.  (If 
  928. the fragment does not exceed 255 bytes, this will always be sufficient.  
  929. It is recognized that long packets may not be able to use this mechanism 
  930. reliably, and a value of "0" should be used to indicate that no sync is 
  931. possible within this fragment.)
  932.  
  933. Each routing update bulletin envelope takes the form of a three-
  934. dimensional list, with the dimensions being reporting router, link and
  935. adjacency. A given bulletin envelope may report on link state from one
  936. or more remote nodes, as well as from the sending node.  Each node may
  937. have one or more links; each link may have one or more adjacencies. 
  938.  
  939. Packets may not be fragmented within adjacencies, but may be
  940. fragmented after an adjacency's address and before the next adjacency's
  941. significant bits field.  (This presents a 5-octet field that should
  942. not be fragmented.)  The next fragment, in a new packet, simply begins
  943. where the last one left off; the receiver knows how much more to
  944. expect based upon the node and link count in the respective
  945. node-header and link-header. 
  946.  
  947. A router may not start sending a new Routing Update message of any kind 
  948. to any given IP address until all fragments of a previous message to
  949. that address have been transmitted.  This applies both to point to
  950. point (non-multicast address) and multicast procedures.
  951.  
  952.  
  953. IV.8.  Bulletin Timers
  954.  
  955. The timers used for bulletin updates must be a compromise between
  956. maintaing the network's current state and the traffic required to do
  957. so.  An initial suggestion:  Good news messages should be initiated
  958. within a few seconds and bad news messages should be initiated within
  959. one minute, with relatively short horizons on the bulletins (i.e., the
  960. routers within the region).  Full routing updates with normal horizons
  961. should be sent out every 30 minutes.  If the network is small, more
  962. frequent updates may be possible; too frequent updates risk choking
  963. the network with update traffic.
  964.  
  965.  
  966.  
  967.  
  968. V.  The Shortest Path First spanning tree algorithm
  969.  
  970. As a routing node comes onto the network, it acquires over time a
  971. complete list of adjacencies between other nodes on the network except
  972. as limited by the "horizon".  Each adjacency (point to point link)
  973. within the entire known network has a "cost" associated with it.  It
  974. should be noted that adjacencies, for the purposes of this algorithm,
  975. are "logical" and not necessarily physical;  if a subnetwork link
  976. occurs below IP (as in AX.25 digipieating or NET/ROM), the two ends of
  977. the link are still adjacent.  (Adjacency at the IP internet layer is
  978. based upon subnetworks, which may contain their own links.)  
  979.  
  980. Cost is set for the receive (** Changed in 2.1 to facilitate automatic
  981. link quality adjustment **) side of each link.  If the receiver and
  982. transmitter do not agree on cost, the network shall apply different
  983. routes for packets going in opposite directions between the same two
  984. end nodes.  (This is not a problem.  In a radio environment, one
  985. should NOT assume reciprocity across a link.) 
  986.  
  987. V.1.  Tables
  988.  
  989. Each router builds a _link state table_ that lists, for every known
  990. link in the network (from every reporting router), the two ends and
  991. the cost of that end of the link.  The ends are listed by an IP router
  992. address and, for the destination IP router address, a number of
  993. significant bits.  This is what's updated by the bulletins and by good
  994. news/bad news messages. 
  995.  
  996.     Source IP address    Dest. IP addr/bits    Cost
  997.  
  998.     44.56.0.44        44.56.0.128/32        5
  999.     44.56.0.44        44.56.0.12/25        10
  1000.  
  1001. The goal of the SPF algorithm is to build a _paths table_ which lists,
  1002. for every reachable node (or node group approximation of fewer than 32
  1003. bits) on the network, that node address (or node group address and
  1004. number of significant bits), the adjacent node used to get there
  1005. (i.e., where you blast the packets to next), and the total cost of the
  1006. path.  (This feeds the Route table in the IP Route module in NET.)
  1007. This is done by building a spanning tree with the router doing the
  1008. computation (the home router) as the root of the tree.  The paths
  1009. table thus lists the best way across the tree from the home router to
  1010. all known destinations.
  1011.  
  1012. Every router contains, for the purposes of building the tree, a 
  1013. _trial table_ that has three entries:  Destination address/bits,
  1014. adjacent node, and cost of this path.  The paths table additionally 
  1015. has one more entry, the _parent_ node, which is the last hop
  1016. before the destination.  Thus in a path A -> B -> C -> D -> E, home 
  1017. router A views E as the destination, D as the parent, and B as the
  1018. adjacency.  Note that in the path from A to B, A is the parent node. 
  1019.  
  1020. Begin building the paths table by using the home router as the first 
  1021. node on the paths table.  The cost to reach yourself is always 0, so 
  1022. make the first entry on the paths table as follows:  Source=self,
  1023. destination=self, parent=self, and cost=0.  From here on in, parent 
  1024. is always (by definition of the SPF spanning tree) the node most 
  1025. recently added to the paths table.
  1026.  
  1027.     Destination    Adjacent     Parent        Cost
  1028.  
  1029.     44.56.0.128    44.56.0.128    44.56.0.44    5
  1030.     44.56.0.131    44.56.0.128    44.56.0.128    10
  1031.     44.56.0.200    44.56.0.128    44.56.0.131    15
  1032.  
  1033.         Paths Table showing relationship between 
  1034.     destination, parent and adjacent nodes, where the home
  1035.     node is 44.56.0.44 and 44.56.0.200 is three hops away;
  1036.     all hops here have a cost of 5.
  1037.  
  1038. V.2.  Scanning the links
  1039.  
  1040. The home router now scans its links table looking for all nodes (routers 
  1041. and end nodes) that are adjacent to the current parent node, except
  1042. for links to nodes which are already on the paths table.  (It is
  1043. generally fastest to build the paths table by scanning the links table
  1044. in order of increasing link cost.)  Each of these new nodes is added
  1045. to the trial table, except for the parent node (which is already on
  1046. the paths table, so it can't possibly have a shorter path).  The value
  1047. of cost placed on the trial table is the cost of the link from the
  1048. parent to the destination plus the cost from home to the parent node
  1049. (which value is already on the paths table).  
  1050.  
  1051. A node may only appear once in the trial table at any given time.  If
  1052. an adjacency is found to a node that is already on the trial table, a
  1053. new entry replaces the existing entry if and only if the new total
  1054. cost is lower.  If the cost is higher, it is ignored.  (If the costs
  1055. are equal, then a "tiebreaker" is determined by treating the
  1056. lower-numbered IP address as the lower cost.  This will simply make
  1057. the spanning tree more deterministic in case of tie.)  Thus the trial
  1058. table always contains the lowest cost path to each destination found so
  1059. far.
  1060.  
  1061. Once all of the links from the parent node have had their chance to go 
  1062. onto the trial table, scan the entire trial table for the _one_ entry
  1063. with the lowest total cost.  This not need be a link from that parent
  1064. node!  In case of tie, pick the lower IP address (again just to be
  1065. deterministic).  Move this node to the paths table;  guaranteed,
  1066. there'll be no cheaper path to that node!  The adjacency used for that
  1067. node in the paths table is the adjacency to its parent node.  Note
  1068. that the parent _must_ already be on the paths table since that's the
  1069. source of the parent; you're working your way outward. 
  1070.  
  1071. This new addition to the paths table becomes the new parent node.  
  1072. Repeat the procedure above (from the beginning of V.2) until there are
  1073. no nodes left on the trial table.  This means you've completed the
  1074. spanning tree and have found the least-cost path to every other node.
  1075.  
  1076. One of the router parameters is maximum_cost.  If the cost to a given 
  1077. parent node exceeds this value, the procedure stops, since all 
  1078. subsequent entries in the route table will have a higher cost.  This 
  1079. value has some semblane to the time-to-live parameter of the IP
  1080. packet:  It makes little sense to compute a routing table to nodes
  1081. that cannot be reached within time-to-live.  (Ideally, ttl will be
  1082. implemented using a timer rather than a node counter, but this is
  1083. difficult to do with some of the packet radio data link controller
  1084. implementations; vis., TNCs.)
  1085.  
  1086. A router should recalculate its routes periodically based upon the 
  1087. current links table.  How frequently depends upon the CPU load involved.
  1088. Initial estimates are that it should be recalculated after receipt of
  1089. every routing update bulletin:  Partial calculations do not save
  1090. enough CPU time to make them worthwhile.
  1091.  
  1092.  
  1093. V.3.  Filling in the routing table
  1094.  
  1095. The route table in NOS and NET (the KA9Q et al implementations of IP)
  1096. contains, for each entry, the destination address, number of bits,
  1097. interface, gateway and metric.  This is essentially left intact,
  1098. except that metric is filled in by cost and the routing decision looks
  1099. for the least cost of all matches.  The route table is filled in from
  1100. the paths table.
  1101.  
  1102. Since the routing table will be periodically recalculated from
  1103. scratch, implementation may require two route tables, one "in
  1104. progress" and one "in service".  When the route calculation is
  1105. complete, the "in progress" table becomes "in service" and the old one
  1106. is cleared for reuse.  This allows packet forwarding to continue while
  1107. the completed paths table is being converted into the route table.
  1108.  
  1109. A manual route table may also be maintained.  This should be overriden
  1110. by RSPF-generated entries.  Manual routes are useful defaults before
  1111. RSPF generates routing entries, for destinations not reported on by
  1112. RSPF, and for interworking with other routing protocols.
  1113.  
  1114.  
  1115.  
  1116.  
  1117. Appendix I.  Router parameters
  1118.  
  1119. Every router must set a number of parameters in order to properly
  1120. operate.  While RSPF builds its routing matrix automatically, overall
  1121. network efficiency and stability may require some fine-tuning based
  1122. upon experience.  These include parameters set for each data link
  1123. or subnetwork layer entity (i.e., each radio channel) and for the
  1124. router in general.
  1125.  
  1126. Link/subnet settings:
  1127.  
  1128.    Set Link cost:  This is the cost parameter based upon the link speed
  1129.     and type.  Since the overall cost of the end-to-end path is
  1130.     minimized by the RSPF spanning tree, link cost should be set to
  1131.     arrive at the best overall network performance.  The legal range
  1132.     is 1-127.  This is sent in routing update bulletins.
  1133.  
  1134. Node settings: 
  1135.  
  1136.   Add/Delete Node group: [IPaddr]/bits {cost}.  This allows a node to 
  1137.    announce its ability to serve a group of nodes, identified using 
  1138.    the standard NET convention of address/significant bits.  Thus a 
  1139.    node group setting of [44.56.0.1]/25 will match all nodes from
  1140.    [44.56.0.1] to [44.56.0.127].  Cost is optional; if set, this
  1141.    cost to will be propogated to reach such nodes; otherwise, the 
  1142.    link's default is used. 
  1143.  
  1144.   Set horizon link:   This sets the horizon value for the node's
  1145.    routing bulletins apropos 32-bit addresses of other connected 
  1146.    routers.  This should be high enough to propogate across the 
  1147.    backbone.
  1148.  
  1149.   Set horizon group:  This sets the horizon value for the node's
  1150.    routing bulletins apropos node group addresses (fewer than 32
  1151.    bits matched).  Usually matches the horizon link value.
  1152.  
  1153.   Set horizon local:  This sets the horizon vaue for the node's
  1154.    routing bulletins apropos full link addresses (32 bits) **to
  1155.    non-routers** within the router's node group area.  This is set to
  1156.    a low value so that only other routers serving the same or overlapping
  1157.    node group(s) will receive these messages.
  1158.  
  1159.   Set horizon portable:  This sets the horizon value for the 
  1160.    node's routing bulletins apropos full link addresses (32 bits)
  1161.    not within a node group.  This allows portable end nodes to 
  1162.    have their location in the network propogated farther than
  1163.    the local horizon; this is usually set the same as horizon group.
  1164.  
  1165.   Set broadcast timer:  This sets the time, in seconds, between 
  1166.    router-router hello (RRH) broadcasts.  Initial suggestion:  900.
  1167.  
  1168.   Set suspect timer:  This sets the time, in seconds, after which
  1169.    an adjacency is "suspect" if no packets are received from it.
  1170.    An ICMP echo is then issued.  Initial suggestion:  900.
  1171.  
  1172.   Set suspect count:  This sets the number of times an ICMP echo 
  1173.    (ping) should be sent after a node is suspect, before it is
  1174.    removed from the adjacency list.
  1175.