home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1247 < prev    next >
Text File  |  1991-09-04  |  433KB  |  10,586 lines

  1.  
  2.  
  3.  
  4.  
  5. Network Working Group                                             J. Moy
  6. Request for Comments: 1247                                 Proteon, Inc.
  7. Obsoletes: RFC 1131                                            July 1991
  8.  
  9.  
  10.                              OSPF Version 2
  11.  
  12.  
  13.  
  14. Status of this Memo
  15.  
  16. This RFC specifies an IAB standards track protocol for the Internet
  17. community, and requests discussion and suggestions for improvements.
  18. Please refer to the current edition of the ``IAB Official Protocol
  19. Standards'' for the standardization state and status of this protocol.
  20. Distribution of this memo is unlimited.
  21.  
  22.  
  23. Abstract
  24.  
  25. This memo documents version 2 of the OSPF protocol.  OSPF is a link-
  26. state based routing protocol.  It is designed to be run internal to a
  27. single Autonomous System.  Each OSPF router maintains an identical
  28. database describing the Autonomous System's topology.  From this
  29. database, a routing table is calculated by constructing a shortest-path
  30. tree.
  31.  
  32. OSPF recalculates routes quickly in the face of topological changes,
  33. utilizing a minimum of routing protocol traffic.  OSPF provides support
  34. for equal-cost multipath.  Separate routes can be calculated for each IP
  35. type of service.  An area routing capability is provided, enabling an
  36. additional level of routing protection and a reduction in routing
  37. protocol traffic.  In addition, all OSPF routing protocol exchanges are
  38. authenticated.
  39.  
  40. Version 1 of the OSPF protocol was documented in RFC 1131.  The
  41. differences between the two versions are explained in Appendix F.
  42.  
  43. Please send comments to ospf@trantor.umd.edu.
  44.  
  45.  
  46. 1. Introduction
  47.  
  48. This document is a specification of the Open Shortest Path First (OSPF)
  49. internet routing protocol.  OSPF is classified as an Internal Gateway
  50. Protocol (IGP).  This means that it distributes routing information
  51. between routers belonging to a single Autonomous System.  The OSPF
  52. protocol is based on SPF or link-state technology.  This is a departure
  53.  
  54.  
  55.  
  56. [Moy]                                                           [Page 1]
  57.  
  58. RFC 1247                     OSPF Version 2                    July 1991
  59.  
  60.  
  61. from the Bellman-Ford base used by traditional internet routing
  62. protocols.
  63.  
  64. The OSPF protocol was developed by the OSPF working group of the
  65. Internet Engineering Task Force.  It has been designed expressly for the
  66. internet environment, including explicit support for IP subnetting,
  67. TOS-based routing and the tagging of externally-derived routing
  68. information.  OSPF also provides for the authentication of routing
  69. updates, and utilizes IP multicast when sending/receiving the updates.
  70. In addition, much work has been done to produce a protocol that responds
  71. quickly to topology changes, yet involves small amounts of routing
  72. protocol traffic.
  73.  
  74. The author would like to thank Rob Coltun, Milo Medin, Mike Petry and
  75. the rest of the OSPF working group for the ideas and support they have
  76. given to this project.
  77.  
  78.  
  79. 1.1 Protocol overview
  80.  
  81. OSPF routes IP packets based solely on the destination IP address and IP
  82. Type of Service found in the IP packet header.  IP packets are routed
  83. "as is" -- they are not encapsulated in any further protocol headers as
  84. they transit the Autonomous System.  OSPF is a dynamic routing protocol.
  85. It quickly detects topological changes in the AS (such as router
  86. interface failures) and calculates new loop-free routes after a period
  87. of convergence.  This period of convergence is short and involves a
  88. minimum of routing traffic.
  89.  
  90. In an SPF-based routing protocol, each router maintains a database
  91. describing the Autonomous System's topology.  Each participating router
  92. has an identical database.  Each individual piece of this database is a
  93. particular router's local state (e.g., the router's usable interfaces
  94. and reachable neighbors).  The router distributes its local state
  95. throughout the Autonomous System by flooding.
  96.  
  97. All routers run the exact same algorithm, in parallel.  From the
  98. topological database, each router constructs a tree of shortest paths
  99. with itself as root.  This shortest-path tree gives the route to each
  100. destination in the Autonomous System.  Externally derived routing
  101. information appears on the tree as leaves.
  102.  
  103. OSPF calculates separate routes for each Type of Service (TOS).  When
  104. several equal-cost routes to a destination exist, traffic is distributed
  105. equally among them.  The cost of a route is described by a single
  106. dimensionless metric.
  107.  
  108. OSPF allows sets of networks to be grouped together.  Such a grouping is
  109.  
  110.  
  111.  
  112. [Moy]                                                           [Page 2]
  113.  
  114. RFC 1247                     OSPF Version 2                    July 1991
  115.  
  116.  
  117. called an area.  The topology of an area is hidden from the rest of the
  118. Autonomous System.  This information hiding enables a significant
  119. reduction in routing traffic.  Also, routing within the area is
  120. determined only by the area's own topology, lending the area protection
  121. from bad routing data.  An area is a generalization of an IP subnetted
  122. network.
  123.  
  124. OSPF enables the flexible configuration of IP subnets.  Each route
  125. distributed by OSPF has a destination and mask.  Two different subnets
  126. of the same IP network number may have different sizes (i.e., different
  127. masks).  This is commonly referred to as variable length subnets.  A
  128. packet is routed to the best (i.e., longest or most specific) match.
  129. Host routes are considered to be subnets whose masks are "all ones"
  130. (0xffffffff).
  131.  
  132. All OSPF protocol exchanges are authenticated.  This means that only
  133. trusted routers can participate in the Autonomous System's routing.  A
  134. variety of authentication schemes can be used; a single authentication
  135. scheme is configured for each area.  This enables some areas to use much
  136. stricter authentication than others.
  137.  
  138. Externally derived routing data (e.g., routes learned from the Exterior
  139. Gateway Protocol (EGP)) is passed transparently throughout the
  140. Autonomous System.  This externally derived data is kept separate from
  141. the OSPF protocol's link state data.  Each external route can also be
  142. tagged by the advertising router, enabling the passing of additional
  143. information between routers on the boundaries of the Autonomous System.
  144.  
  145.  
  146. 1.2 Definitions of commonly used terms
  147.  
  148. Here is a collection of definitions for terms that have a specific
  149. meaning to the protocol and that are used throughout the text.  The
  150. reader unfamiliar with the Internet Protocol Suite is referred to [RS-
  151. 85-153] for an introduction to IP.
  152.  
  153.  
  154. Router
  155.     A level three Internet Protocol packet switch.  Formerly called a
  156.     gateway in much of the IP literature.
  157.  
  158. Autonomous System
  159.     A group of routers exchanging routing information via a common
  160.     routing protocol.  Abbreviated as AS.
  161.  
  162. Internal Gateway Protocol
  163.     The routing protocol spoken by the routers belonging to an
  164.     Autonomous system.  Abbreviated as IGP.  Each Autonomous System has
  165.  
  166.  
  167.  
  168. [Moy]                                                           [Page 3]
  169.  
  170. RFC 1247                     OSPF Version 2                    July 1991
  171.  
  172.  
  173.     a single IGP.  Different Autonomous Systems may be running different
  174.     IGPs.
  175.  
  176. Router ID
  177.     A 32-bit number assigned to each router running the OSPF protocol.
  178.     This number uniquely identifies the router within an Autonomous
  179.     System.
  180.  
  181. Network
  182.     In this paper, an IP network or subnet.  It is possible for one
  183.     physical network to be assigned multiple IP network/subnet numbers.
  184.     We consider these to be separate networks.  Point-to-point physical
  185.     networks are an exception - they are considered a single network no
  186.     matter how many (if any at all) IP network/subnet numbers are
  187.     assigned to them.
  188.  
  189. Network mask
  190.     A 32-bit number indicating the range of IP addresses residing on a
  191.     single IP network/subnet.  This specification displays network masks
  192.     as hexadecimal numbers.  For example, the network mask for a class C
  193.     IP network is displayed as 0xffffff00.  Such a mask is often
  194.     displayed elsewhere in the literature as 255.255.255.0.
  195.  
  196. Multi-access networks
  197.     Those physical networks that support the attachment of multiple
  198.     (more than two) routers.  Each pair of routers on such a network is
  199.     assumed to be able to communicate directly (e.g., multi-drop
  200.     networks are excluded).
  201.  
  202. Interface
  203.     The connection between a router and one of its attached networks.
  204.     An interface has state information associated with it, which is
  205.     obtained from the underlying lower level protocols and the routing
  206.     protocol itself.  An interface to a network has associated with it a
  207.     single IP address and mask (unless the network is an unnumbered
  208.     point-to-point network).  An interface is sometimes also referred to
  209.     as a link.
  210.  
  211. Neighboring routers
  212.     Two routers that have interfaces to a common network.  On multi-
  213.     access networks, neighbors are dynamically discovered by OSPF's
  214.     Hello Protocol.
  215.  
  216. Adjacency
  217.     A relationship formed between selected neighboring routers for the
  218.     purpose of exchanging routing information.  Not every pair of
  219.     neighboring routers become adjacent.
  220.  
  221.  
  222.  
  223.  
  224. [Moy]                                                           [Page 4]
  225.  
  226. RFC 1247                     OSPF Version 2                    July 1991
  227.  
  228.  
  229. Link state advertisement
  230.     Describes to the local state of a router or network.  This includes
  231.     the state of the router's interfaces and adjacencies.  Each link
  232.     state advertisement is flooded throughout the routing domain.  The
  233.     collected link state advertisements of all routers and networks
  234.     forms the protocol's topological database.
  235.  
  236. Hello protocol
  237.     The part of the OSPF protocol used to establish and maintain
  238.     neighbor relationships.  On multi-access networks the Hello protocol
  239.     can also dynamically discover neighboring routers.
  240.  
  241. Designated Router
  242.     Each multi-access network that has at least two attached routers has
  243.     a Designated Router.  The Designated Router generates a link state
  244.     advertisement for the multi-access network and has other special
  245.     responsibilities in the running of the protocol.  The Designated
  246.     Router is elected by the Hello Protocol.
  247.  
  248.     The Designated Router concept enables a reduction in the number of
  249.     adjacencies required on a multi-access network.  This in turn
  250.     reduces the amount of routing protocol traffic and the size of the
  251.     topological database.
  252.  
  253. Lower-level protocols
  254.     The underlying network access protocols that provide services to the
  255.     Internet Protocol and in turn the OSPF protocol.  Examples of these
  256.     are the X.25 packet and frame levels for PDNs, and the ethernet data
  257.     link layer for ethernets.
  258.  
  259.  
  260. 1.3 Brief history of SPF-based routing technology
  261.  
  262. OSPF is an SPF-based routing protocol.  Such protocols are also referred
  263. to in the literature as link-state or distributed-database protocols.
  264. This section gives a brief description of the developments in SPF-based
  265. technology that have influenced the OSPF protocol.
  266.  
  267. The first SPF-based routing protocol was developed for use in the
  268. ARPANET packet switching network.  This protocol is described in
  269. [McQuillan].  It has formed the starting point for all other SPF-based
  270. protocols.  The homogeneous Arpanet environment, i.e., single-vendor
  271. packet switches connected by synchronous serial lines, simplified the
  272. design and implementation of the original protocol.
  273.  
  274. Modifications to this protocol were proposed in [Perlman].  These
  275. modifications dealt with increasing the fault tolerance of the routing
  276. protocol through, among other things, adding a checksum to the link
  277.  
  278.  
  279.  
  280. [Moy]                                                           [Page 5]
  281.  
  282. RFC 1247                     OSPF Version 2                    July 1991
  283.  
  284.  
  285. state advertisements (thereby detecting database corruption).  The paper
  286. also included means for reducing the routing traffic overhead in an
  287. SPF-based protocol.  This was accomplished by introducing mechanisms
  288. which enabled the interval between link state advertisements to be
  289. increased by an order of magnitude.
  290.  
  291. An SPF-based algorithm has also been proposed for use as an ISO IS-IS
  292. routing protocol.  This protocol is described in [DEC].  The protocol
  293. includes methods for data and routing traffic reduction when operating
  294. over broadcast networks.  This is accomplished by election of a
  295. Designated Router for each broadcast network, which then originates a
  296. link state advertisement for the network.
  297.  
  298. The OSPF subcommittee of the IETF has extended this work in developing
  299. the OSPF protocol.  The Designated Router concept has been greatly
  300. enhanced to further reduce the amount of routing traffic required.
  301. Multicast capabilities are utilized for additional routing bandwidth
  302. reduction.  An area routing scheme has been developed enabling
  303. information hiding/protection/reduction.  Finally, the algorithm has
  304. been modified for efficient operation in the internet environment.
  305.  
  306.  
  307. 1.4 Organization of this document
  308.  
  309. The first three sections of this specification give a general overview
  310. of the protocol's capabilities and functions.  Sections 4-16 explain the
  311. protocol's mechanisms in detail.  Packet formats, protocol constants,
  312. configuration items and required management statistics are specified in
  313. the appendices.
  314.  
  315. Labels such as HelloInterval encountered in the text refer to protocol
  316. constants.  They may or may not be configurable.  The architectural
  317. constants are explained in Appendix B.  The configurable constants are
  318. explained in Appendix C.
  319.  
  320. The detailed specification of the protocol is presented in terms of data
  321. structures.  This is done in order to make the explanation more precise.
  322. Implementations of the protocol are required to support the
  323. functionality described, but need not use the precise data structures
  324. that appear in this paper.
  325.  
  326.  
  327. 2. The Topological Database
  328.  
  329. The database of the Autonomous System's topology describes a directed
  330. graph.  The vertices of the graph consist of routers and networks.  A
  331. graph edge connects two routers when they are attached via a physical
  332. point-to-point network.  An edge connecting a router to a network
  333.  
  334.  
  335.  
  336. [Moy]                                                           [Page 6]
  337.  
  338. RFC 1247                     OSPF Version 2                    July 1991
  339.  
  340.  
  341. indicates that the router has an interface on the network.
  342.  
  343. The vertices of the graph can be further typed according to function.
  344. Only some of these types carry transit data traffic; that is, traffic
  345. that is neither locally originated nor locally destined.  Vertices that
  346. can carry transit traffic are indicated on the graph by having both
  347. incoming and outgoing edges.
  348.  
  349.  
  350.  
  351.                    Vertex type   Vertex name    Transit?
  352.                    _____________________________________
  353.                    1             Router         yes
  354.                    2             Network        yes
  355.                    3             Stub network   no
  356.  
  357.  
  358.                         Table 1: OSPF vertex types.
  359.  
  360.  
  361. OSPF supports the following types of physical networks:
  362.  
  363.  
  364. Point-to-point networks
  365.     A network that joins a single pair of routers.  A 56Kb serial line
  366.     is an example of a point-to-point network.
  367.  
  368. Broadcast networks
  369.     Networks supporting many (more than two) attached routers, together
  370.     with the capability to address a single physical message to all of
  371.     the attached routers (broadcast).  Neighboring routers are
  372.     discovered dynamically on these nets using OSPF's Hello Protocol.
  373.     The Hello Protocol itself takes advantage of the broadcast
  374.     capability.  The protocol makes further use of multicast
  375.     capabilities, if they exist.  An ethernet is an example of a
  376.     broadcast network.
  377.  
  378. Non-broadcast networks
  379.     Networks supporting many (more than two) routers, but having no
  380.     broadcast capability.  Neighboring routers are also discovered on
  381.     these nets using OSPF's Hello Protocol.  However, due to the lack of
  382.     broadcast capability, some configuration information is necessary
  383.     for the correct operation of the Hello Protocol.  On these networks,
  384.     OSPF protocol packets that are normally multicast need to be sent to
  385.     each neighboring router, in turn.  An X.25 Public Data Network (PDN)
  386.     is an example of a non-broadcast network.
  387.  
  388.  
  389.  
  390.  
  391.  
  392. [Moy]                                                           [Page 7]
  393.  
  394. RFC 1247                     OSPF Version 2                    July 1991
  395.  
  396.  
  397. The neighborhood of each network node in the graph depends on whether
  398. the network has multi-access capabilities (either broadcast or non-
  399. broadcast) and, if so, the number of routers having an interface to the
  400. network.  The three cases are depicted in Figure 1.  Rectangles indicate
  401. routers.  Circles and oblongs indicate multi-access networks.  Router
  402. names are prefixed with the letters RT and network names with N.  Router
  403. interface names are prefixed by I.  Lines between routers indicate
  404. point-to-point networks.  The left side of the figure shows a network
  405. with its connected routers, with the resulting graph shown on the right.
  406.  
  407.  
  408. Two routers joined by a point-to-point network are represented in the
  409. directed graph as being directly connected by a pair of edges, one in
  410. each direction.  Interfaces to physical point-to-point networks need not
  411. be assigned IP addresses.  Such a point-to-point network is called
  412. unnumbered.  The graphical representation of point-to-point networks is
  413. designed so that unnumbered networks can be supported naturally.  When
  414. interface addresses exist, they are modelled as stub routes.  Note that
  415. each router would then have a stub connection to the other router's
  416. interface address (see Figure 1).
  417.  
  418. When multiple routers are attached to a multi-access network, the
  419. directed graph shows all routers bidirectionally connected to the
  420. network vertex (again, see Figure 1).  If only a single router is
  421. attached to a multi-access network, the network will appear in the
  422. directed graph as a stub connection.
  423.  
  424. Each network (stub or transit) in the graph has an IP address and
  425. associated network mask.  The mask indicates the number of nodes on the
  426. network.  Hosts attached directly to routers (referred to as host
  427. routes) appear on the graph as stub networks.  The network mask for a
  428. host route is always 0xffffffff, which indicates the presence of a
  429. single node.
  430.  
  431. Figure 2 shows a sample map of an Autonomous System.  The rectangle
  432. labelled H1 indicates a host, which has a SLIP connection to router
  433. RT12.  Router RT12 is therefore advertising a host route.  Lines between
  434.  
  435.  
  436.                  ______________________________________
  437.  
  438.                  (Figure not included in text version.)
  439.  
  440.                     Figure 1: Network map components
  441.                  ______________________________________
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448. [Moy]                                                           [Page 8]
  449.  
  450. RFC 1247                     OSPF Version 2                    July 1991
  451.  
  452.  
  453. routers indicate physical point-to-point networks.  The only point-to-
  454. point network that has been assigned interface addresses is the one
  455. joining routers RT6 and RT10.  Routers RT5 and RT7 have EGP connections
  456. to other Autonomous Systems.  A set of EGP-learned routes have been
  457. displayed for both of these routers.
  458.  
  459.  
  460. A cost is associated with the output side of each router interface.
  461. This cost is configurable by the system administrator.  The lower the
  462. cost, the more likely the interface is to be used to forward data
  463. traffic.  Costs are also associated with the externally derived routing
  464. data (e.g., the EGP-learned routes).
  465.  
  466. The directed graph resulting from the map in Figure 2 is depicted in
  467. Figure 3.  Arcs are labelled with the cost of the corresponding router
  468. output interface.  Arcs having no labelled cost have a cost of 0.  Note
  469. that arcs leading from networks to routers always have cost 0; they are
  470. significant nonetheless.  Note also that the externally derived routing
  471. data appears on the graph as stubs.
  472.  
  473.  
  474. The topological database (or what has been referred to above as the
  475. directed graph) is pieced together from link state advertisements
  476. generated by the routers.  The neighborhood of each transit vertex is
  477. represented in a single, separate link state advertisement.  Figure 4
  478. shows graphically the link state representation of the two kinds of
  479. transit vertices: routers and multi-access networks.  Router RT12 has an
  480.  
  481.  
  482.                  ______________________________________
  483.  
  484.                  (Figure not included in text version.)
  485.  
  486.                   Figure 2: A sample Autonomous System
  487.                  ______________________________________
  488.  
  489.  
  490.  
  491.                __________________________________________
  492.  
  493.                 (Figures not included in text version.)
  494.  
  495.                  Figure 3: The resulting directed graph
  496.                Figure 4: Individual link state components
  497.                __________________________________________
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504. [Moy]                                                           [Page 9]
  505.  
  506. RFC 1247                     OSPF Version 2                    July 1991
  507.  
  508.  
  509. interface to two broadcast networks and a SLIP line to a host.  Network
  510. N6 is a broadcast network with three attached routers.  The cost of all
  511. links from network N6 to its attached routers is 0.  Note that the link
  512. state advertisement for network N6 is actually generated by one of the
  513. attached routers: the router that has been elected Designated Router for
  514. the network.
  515.  
  516.  
  517. 2.1 The shortest-path tree
  518.  
  519. When no OSPF areas are configured, each router in the Autonomous System
  520. has an identical topological database, leading to an identical graphical
  521. representation.  A router generates its routing table from this graph by
  522. calculating a tree of shortest paths with the router itself as root.
  523. Obviously, the shortest-path tree depends on the router doing the
  524. calculation.  The shortest-path tree for router RT6 in our example is
  525. depicted in Figure 5.
  526.  
  527.  
  528. The tree gives the entire route to any destination network or host.
  529. However, only the next hop to the destination is used in the forwarding
  530. process.  Note also that the best route to any router has also been
  531. calculated.  For the processing of external data, we note the next hop
  532. and distance to any router advertising external routes.  The resulting
  533. routing table for router RT6 is pictured in Table 2.  Note that there is
  534. a separate route for each end of a numbered serial line (in this case,
  535. the serial line between routers RT6 and RT10).
  536.  
  537.  
  538. Routes to networks belonging to other AS'es (such as N12) appear as
  539. dashed lines on the shortest path tree in Figure 5.  Use of this
  540. externally derived routing information is considered in the next
  541. section.
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.                  ______________________________________
  549.  
  550.                  (Figure not included in text version.)
  551.  
  552.                  Figure 5: The SPF tree for router RT6
  553.                  ______________________________________
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560. [Moy]                                                          [Page 10]
  561.  
  562. RFC 1247                     OSPF Version 2                    July 1991
  563.  
  564.  
  565.  
  566.  
  567.                    Destination   Next  Hop   Distance
  568.                    __________________________________
  569.                    N1            RT3         10
  570.                    N2            RT3         10
  571.                    N3            RT3         7
  572.                    N4            RT3         8
  573.                    Ib            *           7
  574.                    Ia            RT10        12
  575.                    N6            RT10        8
  576.                    N7            RT10        12
  577.                    N8            RT10        10
  578.                    N9            RT10        11
  579.                    N10           RT10        13
  580.                    N11           RT10        14
  581.                    H1            RT10        21
  582.                    __________________________________
  583.                    RT5           RT5         6
  584.                    RT7           RT10        8
  585.  
  586.  
  587.     Table 2: The portion of router RT6's routing table listing local
  588.                              destinations.
  589.  
  590. 2.2 Use of external routing information
  591.  
  592. After the tree is created the external routing information is examined.
  593. This external routing information may originate from another routing
  594. protocol such as EGP, or be statically configured (static routes).
  595. Default routes can also be included as part of the Autonomous System's
  596. external routing information.
  597.  
  598. External routing information is flooded unaltered throughout the AS.  In
  599. our example, all the routers in the Autonomous System know that router
  600. RT7 has two external routes, with metrics 2 and 9.
  601.  
  602. OSPF supports two types of external metrics.  Type 1 external metrics
  603. are equivalent to the link state metric.  Type 2 external metrics are
  604. greater than the cost of any path internal to the AS.  Use of Type 2
  605. external metrics assumes that routing between AS'es is the major cost of
  606. routing a packet, and eliminates the need for conversion of external
  607. costs to internal link state metrics.
  608.  
  609. Here is an example of Type 1 external metric processing.  Suppose that
  610. the routers RT7 and RT5 in Figure 2 are advertising Type 1 external
  611. metrics.  For each external route, the distance from Router RT6 is
  612. calculated as the sum of the external route's cost and the distance from
  613.  
  614.  
  615.  
  616. [Moy]                                                          [Page 11]
  617.  
  618. RFC 1247                     OSPF Version 2                    July 1991
  619.  
  620.  
  621. Router RT6 to the advertising router.  For every external destination,
  622. the router advertising the shortest route is discovered, and the next
  623. hop to the advertising router becomes the next hop to the destination.
  624.  
  625. Both Router RT5 and RT7 are advertising an external route to destination
  626. network N12.  Router RT7 is preferred since it is advertising N12 at a
  627. distance of 10 (8+2) to Router RT6, which is better than router RT5's 14
  628. (6+8).  Table 3 shows the entries that are added to the routing table
  629. when external routes are examined:
  630.  
  631.  
  632.  
  633.                      Destination   Next  Hop   Distance
  634.                      __________________________________
  635.                      N12           RT10        10
  636.                      N13           RT5         14
  637.                      N14           RT5         14
  638.                      N15           RT10        17
  639.  
  640.  
  641.     Table 3: The portion of router RT6's routing table listing external
  642.                                destinations.
  643.  
  644.  
  645. Processing of Type 2 external metrics is simpler.  The AS boundary
  646. router advertising the smallest external metric is chosen, regardless of
  647. the internal distance to the AS boundary router.  Suppose in our example
  648. both router RT5 and router RT7 were advertising Type 2 external routes.
  649. Then all traffic destined for network N12 would be forwarded to router
  650. RT7, since 2 < 8.  When several equal-cost Type 2 routes exist, the
  651. internal distance to the advertising routers is used to break the tie.
  652.  
  653. Both Type 1 and Type 2 external metrics can be present in the AS at the
  654. same time.  In that event, Type 1 external metrics always take
  655. precedence.
  656.  
  657. This section has assumed that packets destined for external destinations
  658. are always routed through the advertising AS boundary router.  This is
  659. not always desirable.  For example, suppose in Figure 2 there is an
  660. additional router attached to network N6, called Router RTX.  Suppose
  661. further that RTX does not participate in OSPF routing, but does exchange
  662. EGP information with the AS boundary router RT7.  Then, router RT7 would
  663. end up advertising OSPF external routes for all destinations that should
  664. be routed to RTX.  An extra hop will sometimes be introduced if packets
  665. for these destinations need always be routed first to router RT7 (the
  666. advertising router).
  667.  
  668. To deal with this situation, the OSPF protocol allows an AS boundary
  669.  
  670.  
  671.  
  672. [Moy]                                                          [Page 12]
  673.  
  674. RFC 1247                     OSPF Version 2                    July 1991
  675.  
  676.  
  677. router to specify a "forwarding address" in its external advertisements.
  678. In the above example, Router RT7 would specify RTX's IP address as the
  679. "forwarding address" for all those destinations whose packets should be
  680. routed directly to RTX.
  681.  
  682. The "forwarding address" has one other application.  It enables routers
  683. in the Autonomous System's interior to function as "route servers".  For
  684. example, in Figure 2 the router RT6 could become a route server, gaining
  685. external routing information through a combination of static
  686. configuration and external routing protocols.  RT6 would then start
  687. advertising itself as an AS boundary router, and would originate a
  688. collection of OSPF external advertisements.  In each external
  689. advertisement, router RT6 would specify the correct Autonomous System
  690. exit point to use for the destination through appropriate setting of the
  691. advertisement's "forwarding address" field.
  692.  
  693.  
  694. 2.3 Equal-cost multipath
  695.  
  696. The above discussion has been simplified by considering only a single
  697. route to any destination.  In reality, if multiple equal-cost routes to
  698. a destination exist, they are all discovered and used.  This requires no
  699. conceptual changes to the algorithm, and its discussion is postponed
  700. until we consider the tree-building process in more detail.
  701.  
  702. With equal cost multipath, a router potentially has several available
  703. next hops towards any given destination.
  704.  
  705.  
  706. 2.4 TOS-based routing
  707.  
  708. OSPF can calculate a separate set of routes for each IP Type of Service.
  709. The IP TOS values are represented in OSPF exactly as they appear in the
  710. IP packet header.  This means that, for any destination, there can
  711. potentially be multiple routing table entries, one for each IP TOS.
  712.  
  713. Up to this point, all examples shown have assumed that routes do not
  714. vary on TOS.  In order to differentiate routes based on TOS, separate
  715. interface costs can be configured for each TOS.  For example, in Figure
  716. 2 there could be multiple costs (one for each TOS) listed for each
  717. interface.  A cost for TOS 0 must always be specified.
  718.  
  719. When interface costs vary based on TOS, a separate shortest path tree is
  720. calculated for each TOS (see Section 2.1).  In addition, external costs
  721. can vary based on TOS.  For example, in Figure 2 router RT7 could
  722. advertise a separate type 1 external metric for each TOS.  Then, when
  723. calculating the TOS X distance to network N15 the cost of the shortest
  724. TOS X path to RT7 would be added to the TOS X cost advertised by RT7
  725.  
  726.  
  727.  
  728. [Moy]                                                          [Page 13]
  729.  
  730. RFC 1247                     OSPF Version 2                    July 1991
  731.  
  732.  
  733. (see Section 2.2).
  734.  
  735. All OSPF implementations must be capable of calculating routes based on
  736. TOS.  However, OSPF routers can be configured to route all packets on
  737. the TOS 0 path (see Appendix C), eliminating the need to calculate non-
  738. zero TOS paths.  This can be used to conserve routing table space and
  739. processing resources in the router.  These TOS-0-only routers can be
  740. mixed with routers that do route based on TOS.  TOS-0-only routers will
  741. be avoided as much as possible when forwarding traffic requesting a
  742. non-zero TOS.
  743.  
  744. It may be the case that no path exists for some non-zero TOS, even if
  745. the router is calculating non-zero TOS paths.  In that case, packets
  746. requesting that non-zero TOS are routed along the TOS 0 path (see
  747. Section 11.1).
  748.  
  749.  
  750. 3. Splitting the AS into Areas
  751.  
  752. OSPF allows collections of contiguous networks and hosts to be grouped
  753. together.  Such a group, together with the routers having interfaces to
  754. any one of the included networks, is called an area.  Each area runs a
  755. separate copy of the basic SPF routing algorithm.  This means that each
  756. area has its own topological database and corresponding graph, as
  757. explained in the previous section.
  758.  
  759. The topology of an area is invisible from the outside of the area.
  760. Conversely, routers internal to a given area know nothing of the
  761. detailed topology external to the area.  This isolation of knowledge
  762. enables the protocol to effect a marked reduction in routing traffic as
  763. compared to treating the entire Autonomous System as a single SPF
  764. domain.
  765.  
  766. With the introduction of areas, it is no longer true that all routers in
  767. the AS have an identical topological database.  A router actually has a
  768. separate topological database for each area it is connected to.
  769. (Routers connected to multiple areas are called area border routers).
  770. Two routers belonging to the same area have, for that area, identical
  771. area topological databases.
  772.  
  773. Routing in the Autonomous System takes place on two levels, depending on
  774. whether the source and destination of a packet reside in the same area
  775. (intra-area routing is used) or different areas (inter-area routing is
  776. used).  In intra-area routing, the packet is routed solely on
  777. information obtained within the area; no routing information obtained
  778. from outside the area can be used.  This protects intra-area routing
  779. from the injection of bad routing information.  We discuss inter-area
  780. routing in Section 3.2.
  781.  
  782.  
  783.  
  784. [Moy]                                                          [Page 14]
  785.  
  786. RFC 1247                     OSPF Version 2                    July 1991
  787.  
  788.  
  789. 3.1 The backbone of the Autonomous System
  790.  
  791. The backbone consists of those networks not contained in any area, their
  792. attached routers, and those routers that belong to multiple areas.  The
  793. backbone must be contiguous.
  794.  
  795. It is possible to define areas in such a way that the backbone is no
  796. longer contiguous.  In this case the system administrator must restore
  797. backbone connectivity by configuring virtual links.
  798.  
  799. Virtual links can be configured between any two backbone routers that
  800. have an interface to a common non-backbone area.  Virtual links belong
  801. to the backbone.  The protocol treats two routers joined by a virtual
  802. link as if they were connected by an unnumbered point-to-point network.
  803. On the graph of the backbone, two such routers are joined by arcs whose
  804. costs are the intra-area distances between the two routers.  The routing
  805. protocol traffic that flows along the virtual link uses intra-area
  806. routing only.
  807.  
  808. The backbone is responsible for distributing routing information between
  809. areas.  The backbone itself has all of the properties of an area.  The
  810. topology of the backbone is invisible to each of the areas, while the
  811. backbone itself knows nothing of the topology of the areas.
  812.  
  813.  
  814. 3.2 Inter-area routing
  815.  
  816. When routing a packet between two areas the backbone is used.  The path
  817. that the packet will travel can be broken up into three contiguous
  818. pieces: an intra-area path from the source to an area border router, a
  819. backbone path between the source and destination areas, and then another
  820. intra-area path to the destination.  The algorithm finds the set of such
  821. paths that have the smallest cost.
  822.  
  823. Looking at this another way, inter-area routing can be pictured as
  824. forcing a star configuration on the Autonomous System, with the backbone
  825. as hub and and each of the areas as spokes.
  826.  
  827. The topology of the backbone dictates the backbone paths used between
  828. areas.  The topology of the backbone can be enhanced by adding virtual
  829. links.  This gives the system administrator some control over the routes
  830. taken by inter-area traffic.
  831.  
  832. The correct area border router to use as the packet exits the source
  833. area is chosen in exactly the same way routers advertising external
  834. routes are chosen.  Each area border router in an area summarizes for
  835. the area its cost to all networks external to the area.  After the SPF
  836. tree is calculated for the area, routes to all other networks are
  837.  
  838.  
  839.  
  840. [Moy]                                                          [Page 15]
  841.  
  842. RFC 1247                     OSPF Version 2                    July 1991
  843.  
  844.  
  845. calculated by examining the summaries of the area border routers.
  846.  
  847.  
  848. 3.3 Classification of routers
  849.  
  850. Before the introduction of areas, the only OSPF routers having a
  851. specialized function were those advertising external routing
  852. information, such as router RT5 in Figure 2.  When the AS is split into
  853. OSPF areas, the routers are further divided according to function into
  854. the following four overlapping categories:
  855.  
  856.  
  857. Internal routers
  858.     A router with all directly connected networks belonging to the same
  859.     area.  Routers with only backbone interfaces also belong to this
  860.     category.  These routers run a single copy of the basic routing
  861.     algorithm.
  862.  
  863. Area border routers
  864.     A router that attaches to multiple areas.  Area border routers run
  865.     multiple copies of the basic algorithm, one copy for each attached
  866.     area and an additional copy for the backbone.  Area border routers
  867.     condense the topological information of their attached areas for
  868.     distribution to the backbone.  The backbone in turn distributes the
  869.     information to the other areas.
  870.  
  871. Backbone routers
  872.     A router that has an interface to the backbone.  This includes all
  873.     routers that interface to more than one area (i.e., area border
  874.     routers).  However, backbone routers do not have to be area border
  875.     routers.  Routers with all interfaces connected to the backbone are
  876.     considered to be internal routers.
  877.  
  878. AS boundary routers
  879.     A router that exchanges routing information with routers belonging
  880.     to other Autonomous Systems.  Such a router has AS external routes
  881.     that are advertised throughout the Autonomous System.  The path to
  882.     each AS boundary router is known by every router in the AS.  This
  883.     classification is completely independent of the previous
  884.     classifications: AS boundary routers may be internal or area border
  885.     routers, and may or may not participate in the backbone.
  886.  
  887.  
  888. 3.4 A sample area configuration
  889.  
  890. Figure 6 shows a sample area configuration.  The first area consists of
  891. networks N1-N4, along with their attached routers RT1-RT4.  The second
  892. area consists of networks N6-N8, along with their attached routers RT7,
  893.  
  894.  
  895.  
  896. [Moy]                                                          [Page 16]
  897.  
  898. RFC 1247                     OSPF Version 2                    July 1991
  899.  
  900.  
  901. RT8, RT10, RT11.  The third area consists of networks N9-N11 and host
  902. H1, along with their attached routers RT9, RT11, RT12.  The third area
  903. has been configured so that networks N9-N11 and host H1 will all be
  904. grouped into a single route, when advertised external to the area (see
  905. Section 3.5 for more details).
  906.  
  907.  
  908. In Figure 6, routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are internal
  909. routers.  Routers RT3, RT4, RT7, RT10 and RT11 are area border routers.
  910. Finally as before, routers RT5 and RT7 are AS boundary routers.
  911.  
  912. Figure 7 shows the resulting topological database for the Area 1.  The
  913. figure completely describes that area's intra-area routing.  It also
  914. shows the complete view of the internet for the two internal routers RT1
  915. and RT2.  It is the job of the area border routers, RT3 and RT4, to
  916. advertise into Area 1 the distances to all destinations external to the
  917. area.  These are indicated in Figure 7 by the dashed stub routes.  Also,
  918. RT3 and RT4 must advertise into Area 1 the location of the AS boundary
  919. routers RT5 and RT7.  Finally, external advertisements from RT5 and RT7
  920. are flooded throughout the entire AS, and in particular throughout Area
  921. 1.  These advertisements are included in Area 1's database, and yield
  922. routes to networks N12-N15.
  923.  
  924. Routers RT3 and RT4 must also summarize Area 1's topology for
  925. distribution to the backbone.  Their backbone advertisements are shown
  926. in Table 4.  These summaries show which networks are contained in Area 1
  927. (i.e., networks N1-N4), and the distance to these networks from the
  928. routers RT3 and RT4 respectively.
  929.  
  930.  
  931. The topological database for the backbone is shown in Figure 8.  The set
  932. of routers pictured are the backbone routers.  Router RT11 is a backbone
  933. router because it belongs to two areas.  In order to make the backbone
  934. connected, a virtual link has been configured between routers R10 and
  935. R11.
  936.  
  937.  
  938.  
  939.  
  940.                __________________________________________
  941.  
  942.                  (Figure not included in text version.)
  943.  
  944.                Figure 6: A sample OSPF area configuration
  945.                __________________________________________
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952. [Moy]                                                          [Page 17]
  953.  
  954. RFC 1247                     OSPF Version 2                    July 1991
  955.  
  956.  
  957.  
  958.  
  959.                      Network   RT3 adv.   RT4 adv.
  960.                      _____________________________
  961.                      N1        4          4
  962.                      N2        4          4
  963.                      N3        1          1
  964.                      N4        2          3
  965.  
  966.  
  967.   Table 4: Networks advertised to the backbone by routers RT3 and RT4.
  968.  
  969.  
  970.                  ______________________________________
  971.  
  972.                  (Figure not included in text version.)
  973.  
  974.                       Figure 7: Area 1's Database
  975.                     Figure 8: The backbone database
  976.                  ______________________________________
  977.  
  978.  
  979. Again, routers RT3, RT4, RT7, RT10 and RT11 are area border routers.  As
  980. routers RT3 and RT4 did above, they have condensed the routing
  981. information of their attached areas for distribution via the backbone;
  982. these are the dashed stubs that appear in Figure 8.  Remember that the
  983. third area has been configured to condense networks N9-N11 and Host H1
  984. into a single route.  This yields a single dashed line for networks N9-
  985. N11 and Host H1 in Figure 8.  Routers RT5 and RT7 are AS boundary
  986. routers; their externally derived information also appears on the graph
  987. in Figure 8 as stubs.
  988.  
  989. The backbone enables the exchange of summary information between area
  990. border routers.  Every area border router hears the area summaries from
  991. all other area border routers.  It then forms a picture of the distance
  992. to all networks outside of its area by examining the collected
  993. advertisements, and adding in the backbone distance to each advertising
  994. router.
  995.  
  996. Again using routers RT3 and RT4 as an example, the procedure goes as
  997. follows: They first calculate the SPF tree for the backbone.  This gives
  998. the distances to all other area border routers.  Also noted are the
  999. distances to networks (Ia and Ib) and AS boundary routers (RT5 and RT7)
  1000. that belong to the backbone.  This calculation is shown in Table 5.
  1001.  
  1002.  
  1003. Next, by looking at the area summaries from these area border routers,
  1004. RT3 and RT4 can determine the distance to all networks outside their
  1005.  
  1006.  
  1007.  
  1008. [Moy]                                                          [Page 18]
  1009.  
  1010. RFC 1247                     OSPF Version 2                    July 1991
  1011.  
  1012.  
  1013.  
  1014.  
  1015.                  Area  border   dist  from   dist  from
  1016.                  router         RT3          RT4
  1017.                  ______________________________________
  1018.                  to  RT3        *            21
  1019.                  to  RT4        22           *
  1020.                  to  RT7        20           14
  1021.                  to  RT10       15           22
  1022.                  to  RT11       18           25
  1023.                  ______________________________________
  1024.                  to  Ia         20           27
  1025.                  to  Ib         15           22
  1026.                  ______________________________________
  1027.                  to  RT5        14           8
  1028.                  to  RT7        20           14
  1029.  
  1030.  
  1031.      Table 5: Backbone distances calculated by routers RT3 and RT4.
  1032.  
  1033. area.  These distances are then advertised internally to the area by RT3
  1034. and RT4.  The advertisements that router RT3 and RT4 will make into Area
  1035. 1 are shown in Table 6.  Note that Table 6 assumes that an area range
  1036. has been configured for the backbone which groups I5 and I6 into a
  1037. single advertisement.
  1038.  
  1039.  
  1040. The information imported into Area 1 by routers RT3 and RT4 enables an
  1041. internal router, such as RT1, to choose an area border router
  1042. intelligently.  Router RT1 would use RT4 for traffic to network N6, RT3
  1043. for traffic to network N10, and would load share between the two for
  1044.  
  1045.  
  1046.                    Destination   RT3 adv.   RT4 adv.
  1047.                    _________________________________
  1048.                    Ia,Ib         15         22
  1049.                    N6            16         15
  1050.                    N7            20         19
  1051.                    N8            18         18
  1052.                    N9-N11,H1     19         26
  1053.                    _________________________________
  1054.                    RT5           14         8
  1055.                    RT7           20         14
  1056.  
  1057.  
  1058.   Table 6: Destinations advertised into Area 1 by routers RT3 and RT4.
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064. [Moy]                                                          [Page 19]
  1065.  
  1066. RFC 1247                     OSPF Version 2                    July 1991
  1067.  
  1068.  
  1069. traffic to network N8.
  1070.  
  1071. Router RT1 can also determine in this manner the shortest path to the AS
  1072. boundary routers RT5 and RT7.  Then, by looking at RT5 and RT7's
  1073. external advertisements, router RT1 can decide between RT5 or RT7 when
  1074. sending to a destination in another Autonomous System (one of the
  1075. networks N12-N15).
  1076.  
  1077. Note that a failure of the line between routers RT6 and RT10 will cause
  1078. the backbone to become disconnected.  Configuring another virtual link
  1079. between routers RT7 and RT10 will give the backbone more connectivity
  1080. and more resistance to such failures.  Also, a virtual link between RT7
  1081. and RT10 would allow a much shorter path between the third area
  1082. (containing N9) and the router RT7, which is advertising a good route to
  1083. external network N12.
  1084.  
  1085.  
  1086. 3.5 IP subnetting support
  1087.  
  1088. OSPF attaches an IP address mask to each advertised route.  The mask
  1089. indicates the range of addresses being described by the particular
  1090. route.  For example, a summary advertisement for the destination
  1091. 128.185.0.0 with a mask of 0xffff0000 actually is describing a single
  1092. route to the collection of destinations 128.185.0.0 - 128.185.255.255.
  1093. Similarly, host routes are always advertised with a mask of 0xffffffff,
  1094. indicating the presence of only a single destination.
  1095.  
  1096. Including the mask with each advertised destination enables the
  1097. implementation of what is commonly referred to as variable-length subnet
  1098. masks.  This means that a single IP class A, B, or C network number can
  1099. be broken up into many subnets of various sizes.  For example, the
  1100. network 128.185.0.0 could be broken up into 64 variable-sized subnets:
  1101. 16 subnets of size 4K, 16 subnets of size 256, and 32 subnets of size 8.
  1102. Table 7 shows some of the resulting network addresses together with
  1103. their masks:
  1104.  
  1105.  
  1106.  
  1107.               Network address   IP address mask   Subnet size
  1108.               _______________________________________________
  1109.               128.185.16.0      0xfffff000        4K
  1110.               128.185.1.0       0xffffff00        256
  1111.               128.185.0.8       0xfffffff8        8
  1112.  
  1113.  
  1114.                      Table 7: Some sample subnet sizes.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120. [Moy]                                                          [Page 20]
  1121.  
  1122. RFC 1247                     OSPF Version 2                    July 1991
  1123.  
  1124.  
  1125. There are many possible ways of dividing up a class A, B, and C network
  1126. into variable sized subnets.  The precise procedure for doing so is
  1127. beyond the scope of this specification.  The specification however
  1128. establishes the following guideline: When an IP packet is forwarded, it
  1129. is always forwarded to the network that is the best match for the
  1130. packet's destination.  Here best match is synonymous with the longest or
  1131. most specific match.  For example, the default route with destination of
  1132. 0.0.0.0 and mask 0x00000000 is always a match for every IP destination.
  1133. Yet it is always less specific than any other match.  Subnet masks must
  1134. be assigned so that the best match for any IP destination is
  1135. unambiguous.
  1136.  
  1137. The OSPF area concept is modelled after an IP subnetted network.  OSPF
  1138. areas have been loosely defined to be a collection of networks.  In
  1139. actuality, an OSPF area is specified to be a list of address ranges (see
  1140. Section C.2 for more details).  Each address range is defined as an
  1141. [address,mask] pair.  Many separate networks may then be contained in a
  1142. single address range, just as a subnetted network is composed of many
  1143. separate subnets.  Area border routers then summarize the area contents
  1144. (for distribution to the backbone) by advertising a single route for
  1145. each address range.  The cost of the route is the minimum cost to any of
  1146. the networks falling in the specified range.
  1147.  
  1148. For example, an IP subnetted network can be configured as a single OSPF
  1149. area.  In that case, the area would be defined as a single address
  1150. range: a class A, B, or C network number along with its natural IP mask.
  1151. Inside the area, any number of variable sized subnets could be defined.
  1152. External to the area, a single route for the entire subnetted network
  1153. would be distributed, hiding even the fact that the network is subnetted
  1154. at all.  The cost of this route is the minimum of the set of costs to
  1155. the component subnets.
  1156.  
  1157.  
  1158. 3.6 Supporting stub areas
  1159.  
  1160. In some Autonomous Systems, the majority of the topological database may
  1161. consist of external advertisements.  An OSPF external advertisement is
  1162. usually flooded throughout the entire AS.  However, OSPF allows certain
  1163. areas to be configured as "stub areas".  External advertisements are not
  1164. flooded into/throughout stub areas; routing to AS external destinations
  1165. in these areas is based on a (per-area) default only.  This reduces the
  1166. topological database size, and therefore the memory requirements, for a
  1167. stub area's internal routers.
  1168.  
  1169. In order to take advantage of the OSPF stub area support, default
  1170. routing must be used in the stub area.  This is accomplished as follows.
  1171. One or more of the stub area's area border routers must advertise a
  1172. default route into the stub area via summary advertisements.  These
  1173.  
  1174.  
  1175.  
  1176. [Moy]                                                          [Page 21]
  1177.  
  1178. RFC 1247                     OSPF Version 2                    July 1991
  1179.  
  1180.  
  1181. summary defaults are flooded throughout the stub area, but no further.
  1182. (For this reason these defaults pertain only to the particular stub
  1183. area).  These summary default routes will match any destination that is
  1184. not explicitly reachable by an intra-area or inter-area path (i.e., AS
  1185. external destinations).
  1186.  
  1187. An area can be configured as stub when there is a single exit point from
  1188. the area, or when the choice of exit point need not be made on a per-
  1189. external-destination basis.  For example, area 3 in Figure 6 could be
  1190. configured as a stub area, because all external traffic must travel
  1191. though its single area border router RT11.  If area 3 were configured as
  1192. a stub, router RT11 would advertise a default route for distribution
  1193. inside area 3 (in a summary advertisement), instead of flooding the
  1194. external advertisements for networks N12-N15 into/throughout the area.
  1195.  
  1196. The OSPF protocol ensures that all routers belonging to an area agree on
  1197. whether the area has been configured as a stub.  This guarantees that no
  1198. confusion will arise in the flooding of external advertisements.
  1199.  
  1200. There are a couple of restrictions on the use of stub areas.  Virtual
  1201. links cannot be configured through stub areas.  In addition, AS boundary
  1202. routers cannot be placed internal to stub areas.
  1203.  
  1204.  
  1205. 3.7 Partitions of areas
  1206.  
  1207. OSPF does not actively attempt to repair area partitions.  When an area
  1208. becomes partitioned, each component simply becomes a separate area.  The
  1209. backbone then performs routing between the new areas.  Some destinations
  1210. reachable via intra-area routing before the partition will now require
  1211. inter-area routing.
  1212.  
  1213. In the previous section, an area was described as a list of address
  1214. ranges.  Any particular address range must still be completely contained
  1215. in a single component of the area partition.  This has to do with the
  1216. way the area contents are summarized to the backbone.  Also, the
  1217. backbone itself must not partition.  If it does, parts of the Autonomous
  1218. System will become unreachable.  Backbone partitions can be repaired by
  1219. configuring virtual links (see Section 15).
  1220.  
  1221. Another way to think about area partitions is to look at the Autonomous
  1222. System graph that was introduced in Section 2.  Area IDs can be viewed
  1223. as colors for the graph's edges.[1] Each edge of the graph connects to a
  1224. network, or is itself a point-to-point network.  In either case, the
  1225. edge is colored with the network's Area ID.
  1226.  
  1227. A group of edges, all having the same color, and interconnected by
  1228. vertices, represents an area.  If the topology of the Autonomous System
  1229.  
  1230.  
  1231.  
  1232. [Moy]                                                          [Page 22]
  1233.  
  1234. RFC 1247                     OSPF Version 2                    July 1991
  1235.  
  1236.  
  1237. is intact, the graph will have several regions of color, each color
  1238. being a distinct Area ID.
  1239.  
  1240. When the AS topology changes, one of the areas may become partitioned.
  1241. The graph of the AS will then have multiple regions of the same color
  1242. (Area ID).  The routing in the Autonomous System will continue to
  1243. function as long as these regions of same color are connected by the
  1244. single backbone region.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288. [Moy]                                                          [Page 23]
  1289.  
  1290. RFC 1247                     OSPF Version 2                    July 1991
  1291.  
  1292.  
  1293. 4. Functional Summary
  1294.  
  1295. A separate copy of OSPF's basic routing algorithm runs in each area.
  1296. Routers having interfaces to multiple areas run multiple copies of the
  1297. algorithm.  A brief summary of the routing algorithm follows.
  1298.  
  1299. When a router starts, it first initializes the routing protocol data
  1300. structures.  The router then waits for indications from the lower-level
  1301. protocols that its interfaces are functional.
  1302.  
  1303. A router then uses the OSPF's Hello Protocol to acquire neighbors.  The
  1304. router sends Hello packets to its neighbors, and in turn receives their
  1305. Hello packets.  On broadcast and point-to-point networks, the router
  1306. dynamically detects its neighboring routers by sending its Hello packets
  1307. to the multicast address AllSPFRouters.  On non-broadcast networks, some
  1308. configuration information is necessary in order to discover neighbors.
  1309. On all multi-access networks (broadcast or non-broadcast), the Hello
  1310. Protocol also elects a Designated router for the network.
  1311.  
  1312. The router will attempt to form adjacencies with some of its newly
  1313. acquired neighbors.  Topological databases are synchronized between
  1314. pairs of adjacent routers.  On multi-access networks, the Designated
  1315. Router determines which routers should become adjacent.
  1316.  
  1317. Adjacencies control the distribution of routing protocol packets.
  1318. Routing protocol packets are sent and received only on adjacencies.  In
  1319. particular, distribution of topological database updates proceeds along
  1320. adjacencies.
  1321.  
  1322. A router periodically advertises its state, which is also called link
  1323. state.  Link state is also advertised when a router's state changes.  A
  1324. router's adjacencies are reflected in the contents of its link state
  1325. advertisements.  This relationship between adjacencies and link state
  1326. allows the protocol to detect dead routers in a timely fashion.
  1327.  
  1328. Link state advertisements are flooded throughout the area.  The flooding
  1329. algorithm is reliable, ensuring that all routers in an area have exactly
  1330. the same topological database.  This database consists of the collection
  1331. of link state advertisements received from each router belonging to the
  1332. area.  From this database each router calculates a shortest-path tree,
  1333. with itself as root.  This shortest-path tree in turn yields a routing
  1334. table for the protocol.
  1335.  
  1336.  
  1337. 4.1 Inter-area routing
  1338.  
  1339. The previous section described the operation of the protocol within a
  1340. single area.  For intra-area routing, no other routing information is
  1341.  
  1342.  
  1343.  
  1344. [Moy]                                                          [Page 24]
  1345.  
  1346. RFC 1247                     OSPF Version 2                    July 1991
  1347.  
  1348.  
  1349. pertinent.  In order to be able to route to destinations outside of the
  1350. area, the area border routers inject additional routing information into
  1351. the area.  This additional information is a distillation of the rest of
  1352. the Autonomous System's topology.
  1353.  
  1354. This distillation is accomplished as follows: Each area border router is
  1355. by definition connected to the backbone.  Each area border router
  1356. summarizes the topology of its attached areas for transmission on the
  1357. backbone, and hence to all other area border routers.  A area border
  1358. router then has complete topological information concerning the
  1359. backbone, and the area summaries from each of the other area border
  1360. routers.  From this information, the router calculates paths to all
  1361. destinations not contained in its attached areas.  The router then
  1362. advertises these paths to its attached areas.  This enables the area's
  1363. internal routers to pick the best exit router when forwarding traffic to
  1364. destinations in other areas.
  1365.  
  1366.  
  1367. 4.2 AS external routes
  1368.  
  1369. Routers that have information regarding other Autonomous Systems can
  1370. flood this information throughout the AS.  This external routing
  1371. information is distributed verbatim to every participating router.
  1372. There is one exception: external routing information is not flooded into
  1373. "stub" areas (see Section 3.6).
  1374.  
  1375. To utilize external routing information, the path to all routers
  1376. advertising external information must be known throughout the AS
  1377. (excepting the stub areas).  For that reason, the locations of these AS
  1378. boundary routers are summarized by the (non-stub) area border routers.
  1379.  
  1380.  
  1381. 4.3 Routing protocol packets
  1382.  
  1383. The OSPF protocol runs directly over IP, using IP protocol 89.  OSPF
  1384. does not provide any explicit fragmentation/reassembly support.  When
  1385. fragmentation is necessary, IP fragmentation/reassembly is used.  OSPF
  1386. protocol packets have been designed so that large protocol packets can
  1387. generally be split into several smaller protocol packets.  This practice
  1388. is recommended; IP fragmentation should be avoided whenever possible.
  1389.  
  1390. Routing protocol packets should always be sent with the IP TOS field set
  1391. to 0.  If at all possible, routing protocol packets should be given
  1392. preference over regular IP data traffic, both when being sent and
  1393. received.  As an aid to accomplishing this, OSPF protocol packets should
  1394. have their IP precedence field set to the value Internetwork Control
  1395. (see [RFC 791]).
  1396.  
  1397.  
  1398.  
  1399.  
  1400. [Moy]                                                          [Page 25]
  1401.  
  1402. RFC 1247                     OSPF Version 2                    July 1991
  1403.  
  1404.  
  1405. All OSPF protocol packets share a common protocol header that is
  1406. described in Appendix A.  The OSPF packet types are listed below in
  1407. Table 8.  Their formats are also described in Appendix A.
  1408.  
  1409.  
  1410.  
  1411.          Type   Packet  name           Protocol  function
  1412.          __________________________________________________________
  1413.          1      Hello                  Discover/maintain  neighbors
  1414.          2      Database Description   Summarize database contents
  1415.          3      Link State Request     Database download
  1416.          4      Link State Update      Database update
  1417.          5      Link State Ack         Flooding acknowledgment
  1418.  
  1419.  
  1420.                         Table 8: OSPF packet types.
  1421.  
  1422.  
  1423. OSPF's Hello protocol uses Hello packets to discover and maintain
  1424. neighbor relationships.  The Database Description and Link State Request
  1425. packets are used in the forming of adjacencies.  OSPF's reliable update
  1426. mechanism is implemented by the Link State Update and Link State
  1427. Acknowledgment packets.
  1428.  
  1429. Each Link State Update packet carries a set of new link state
  1430. advertisements one hop further away from their point of origination.  A
  1431. single Link State Update packet may contain the link state
  1432. advertisements of several routers.  Each advertisement is tagged with
  1433. the ID of the originating router and a checksum of its link state
  1434. contents.  The five different types of OSPF link state advertisements
  1435. are listed below in Table 9.
  1436.  
  1437.  
  1438. LS     Advertisement        Advertisement description
  1439. type   name
  1440. ____________________________________________________________________________
  1441. 1      Router links advs.   Originated by all routers. This
  1442.        advs.                advertisement describes the collected
  1443.                             states of the router's interfaces to an
  1444.                             area. Flooded throughout a single area
  1445.                             only.
  1446. ____________________________________________________________________________
  1447. 2      Network links        Originated for multi-access networks by
  1448.        advs.                the Designated Router. This
  1449.                             advertisement contains the list of
  1450.                             routers connected to the network.
  1451.                             Flooded throughout a single area only.
  1452.  
  1453.  
  1454.  
  1455.  
  1456. [Moy]                                                          [Page 26]
  1457.  
  1458. RFC 1247                     OSPF Version 2                    July 1991
  1459.  
  1460.  
  1461. LS     Advertisement        Advertisement description
  1462. type   name
  1463. ____________________________________________________________________________
  1464. ____________________________________________________________________________
  1465. 3,4    Summary link         Originated by area border routers, and
  1466.        advs.                flooded throughout their associated
  1467.                             area. Each summary link advertisement
  1468.                             describes a route to a destination
  1469.                             outside the area, yet still inside the
  1470.                             AS (i.e., an inter-area route). Type 3
  1471.                             advertisements describe routes to
  1472.                             networks. Type 4 advertisements
  1473.                             describe routes to AS boundary routers.
  1474. ____________________________________________________________________________
  1475. 5      AS external          Originated by AS boundary routers, and
  1476.        link advs.           flooded throughout the AS. Each external
  1477.                             advertisement describes a route to a
  1478.                             destination in another Autonomous
  1479.                             System. Default routes for the AS can
  1480.                             also be described by AS external advertisements.
  1481.  
  1482.  
  1483.                 Table 9: OSPF link state advertisements.
  1484.  
  1485. As mentioned above, OSPF routing packets (with the exception of Hellos)
  1486. are sent only over adjacencies.  Note that this means that all protocol
  1487. packets travel a single IP hop, except those that are sent over virtual
  1488. adjacencies.  The IP source address of an OSPF protocol packet is one
  1489. end of a router adjacency, and the IP destination address is either the
  1490. other end of the adjacency or an IP multicast address.
  1491.  
  1492.  
  1493. 4.4 Basic implementation requirements
  1494.  
  1495. An implementation of OSPF requires the following pieces of system
  1496. support:
  1497.  
  1498.  
  1499. Timers
  1500.     Two different kind of timers are required.  The first kind, called
  1501.     single shot timers, fire once and cause a protocol event to be
  1502.     processed.  The second kind, called interval timers, fire at
  1503.     continuous intervals.  These are used for the sending of packets at
  1504.     regular intervals.  A good example of this is the regular broadcast
  1505.     of Hello packets (on broadcast networks).  The granularity of both
  1506.     kinds of timers is one second.
  1507.  
  1508.     Interval timers should be implemented to avoid drift.  In some
  1509.  
  1510.  
  1511.  
  1512. [Moy]                                                          [Page 27]
  1513.  
  1514. RFC 1247                     OSPF Version 2                    July 1991
  1515.  
  1516.  
  1517.     router implementations, packet processing can affect timer
  1518.     execution.  When multiple routers are attached to a single network,
  1519.     all doing broadcasts, this can lead to the synchronization of
  1520.     routing packets (which should be avoided).  If timers cannot be
  1521.     implemented to avoid drift, small random amounts should be added
  1522.     to/subtracted from the timer interval at each firing.
  1523.  
  1524. IP multicast
  1525.     Certain OSPF packets use IP multicast.  Support for receiving and
  1526.     sending IP multicasts, along with the appropriate lower-level
  1527.     protocol support, is required.  These IP multicast packets never
  1528.     travel more than one hop.  For information on IP multicast, see [RFC
  1529.     1112].
  1530.  
  1531. Lower-level protocol support
  1532.     The lower level protocols referred to here are the network access
  1533.     protocols, such as the Ethernet data link layer.  Indications must
  1534.     be passed from from these protocols to OSPF as the network interface
  1535.     goes up and down.  For example, on an ethernet it would be valuable
  1536.     to know when the ethernet transceiver cable becomes unplugged.
  1537.  
  1538. Non-broadcast lower-level protocol support
  1539.     Remember that non-broadcast networks are multi-access networks such
  1540.     as a X.25 PDN.  On these networks, the Hello Protocol can be aided
  1541.     by providing an indication to OSPF when an attempt is made to send a
  1542.     packet to a dead or non-existent router.  For example, on a PDN a
  1543.     dead router may be indicated by the reception of a X.25 clear with
  1544.     an appropriate cause and diagnostic, and this information would be
  1545.     passed to OSPF.
  1546.  
  1547. List manipulation primitives
  1548.     Much of the OSPF functionality is described in terms of its
  1549.     operation on lists of link state advertisements.  For example, the
  1550.     advertisements that will be retransmitted to an adjacent router
  1551.     until acknowledged are described as a list.  Any particular
  1552.     advertisement may be on many such lists.  An OSPF implementation
  1553.     needs to be able to manipulate these lists, adding and deleting
  1554.     constituent advertisements as necessary.
  1555.  
  1556. Tasking support
  1557.     Certain procedures described in this specification invoke other
  1558.     procedures.  At times, these other procedures should be executed
  1559.     in-line, that is, before the current procedure is finished.  This is
  1560.     indicated in the text by instructions to execute a procedure.  At
  1561.     other times, the other procedures are to be executed only when the
  1562.     current procedure has finished.  This is indicated by instructions
  1563.     to schedule a task.
  1564.  
  1565.  
  1566.  
  1567.  
  1568. [Moy]                                                          [Page 28]
  1569.  
  1570. RFC 1247                     OSPF Version 2                    July 1991
  1571.  
  1572.  
  1573. 4.5 Optional OSPF capabilities
  1574.  
  1575. The OSPF protocol defines several optional capabilities.  A router
  1576. indicates the optional capabilities that it supports in its OSPF Hello
  1577. packets, Database Description packets and in its link state
  1578. advertisements.  This enables routers supporting a mix of optional
  1579. capabilities to coexist in a single Autonomous System.
  1580.  
  1581. Some capabilities must be supported by all routers attached to a
  1582. specific area.  In this case, a router will not accept a neighbor's
  1583. Hello unless there is a match in reported capabilities (i.e., a
  1584. capability mismatch prevents a neighbor relationship from forming).  An
  1585. example of this is the external routing capability (see below).
  1586.  
  1587. Other capabilities can be negotiated during the database synchronization
  1588. process.  This is accomplished by specifying the optional capabilities
  1589. in Database Description packets.  A capability mismatch with a neighbor
  1590. is this case will result in only a subset of link state advertisements
  1591. being exchanged between the two neighbors.
  1592.  
  1593. The routing table build process can also be affected by the
  1594. presence/absence of optional capabilities.  For example, since the
  1595. optional capabilities are reported in link state advertisements, routers
  1596. incapable of certain functions can be avoided when building the shortest
  1597. path tree.  An example of this is the TOS routing capability (see
  1598. below).
  1599.  
  1600. The current OSPF optional capabilities are listed below.  See Section
  1601. A.2 for more information.
  1602.  
  1603.  
  1604. External routing capability
  1605.     Entire OSPF areas can be configured as "stubs" (see Section 3.6).
  1606.     AS external advertisements will not be flooded into stub areas.
  1607.     This capability is represented by the E-bit in the OSPF options
  1608.     field (see Section A.2).  In order to ensure consistent
  1609.     configuration of stub areas, all routers interfacing to such an area
  1610.     must have the E-bit clear in their Hello packets (see Sections 9.5
  1611.     and 10.5).
  1612.  
  1613. TOS capability
  1614.     All OSPF implementations must be able to calculate separate routes
  1615.     based on IP Type of Service.  However, to save routing table space
  1616.     and processing resources, an OSPF router can be configured to ignore
  1617.     TOS when forwarding packets.  In this case, the router calculates
  1618.     routes for TOS 0 only.  This capability is represented by the T-bit
  1619.     in the OSPF options field (see Section A.2).  TOS-capable routers
  1620.     will attempt to avoid non-TOS-capable routers when calculating non-
  1621.  
  1622.  
  1623.  
  1624. [Moy]                                                          [Page 29]
  1625.  
  1626. RFC 1247                     OSPF Version 2                    July 1991
  1627.  
  1628.  
  1629.     zero TOS paths.
  1630.  
  1631.  
  1632. 5. Protocol Data Structures
  1633.  
  1634. The OSPF protocol is described in this specification in terms of its
  1635. operation on various protocol data structures.  The following list
  1636. comprises the top-level OSPF data structures.  Any initialization that
  1637. needs to be done is noted.  Areas, OSPF interfaces and neighbors also
  1638. have associated data structures that are described later in this
  1639. specification.
  1640.  
  1641.  
  1642. Router ID
  1643.     a 32-bit number that uniquely identifies this router in the AS.  One
  1644.     possible implementation strategy would be to use the smallest IP
  1645.     interface address belonging to the router.
  1646.  
  1647. Pointers to area structures
  1648.     Each one of the areas to which the router is connected has its own
  1649.     data structure.  This data structure describes the working of the
  1650.     basic algorithm.  Remember that each area runs a separate copy of
  1651.     the basic algorithm.
  1652.  
  1653. Pointer to the backbone structure
  1654.     The basic algorithm operates on the backbone as if it were an area.
  1655.     For this reason the backbone is represented as an area structure.
  1656.  
  1657. Virtual links configured
  1658.     The virtual links configured with this router as one endpoint.  In
  1659.     order to have configured virtual links, the router itself must be an
  1660.     area border router.  Virtual links are identified by the Router ID
  1661.     of the other endpoint -- which is another area border router.  These
  1662.     two endpoint routers must be attached to a common area, called the
  1663.     virtual link's transit area.  Virtual links are part of the
  1664.     backbone, and behave as if they were unnumbered point-to-point
  1665.     networks between the two routers.  A virtual link uses the intra-
  1666.     area routing of its transit area to forward packets.  Virtual links
  1667.     are brought up and down through the building of the shortest-path
  1668.     trees for the transit area.
  1669.  
  1670. List of external routes
  1671.     These are routes to destinations external to the Autonomous System,
  1672.     that have been gained either through direct experience with another
  1673.     routing protocol (such as EGP), or through configuration
  1674.     information, or through a combination of the two (e.g., dynamic
  1675.     external info.  to be advertised by OSPF with configured metric).
  1676.     Any router having these external routes is called an AS boundary
  1677.  
  1678.  
  1679.  
  1680. [Moy]                                                          [Page 30]
  1681.  
  1682. RFC 1247                     OSPF Version 2                    July 1991
  1683.  
  1684.  
  1685.     router.  These routes are advertised by the router to the entire AS
  1686.     through AS external link advertisements.
  1687.  
  1688. List of AS external link advertisements
  1689.     Part of the topological database.  These have have originated from
  1690.     the AS boundary routers.  They comprise routes to destinations
  1691.     external to the Autonomous System.  Note that, if the router is
  1692.     itself an AS boundary router, some of these AS external link
  1693.     advertisements have been self originated.
  1694.  
  1695. The routing table
  1696.     Derived from the topological database.  Each destination that the
  1697.     router can forward to is represented by a cost and a set of paths.
  1698.     A path is described by its type and next hop.  For more information,
  1699.     see Section 11.
  1700.  
  1701. TOS capability
  1702.     This item indicates whether the router will calculate separate
  1703.     routes based on TOS.  This is a configurable parameter.  For more
  1704.     information, see Sections 4.5 and 16.9.
  1705.  
  1706.  
  1707. Figure 9 shows the collection of data structures present in a typical
  1708. router.  The router pictured is RT10, from the map in Figure 6.  Note
  1709. that router RT10 has a virtual link configured to router RT11, with Area
  1710. 2 as the link's transit area.  This is indicated by the dashed line in
  1711. Figure 9.  When the virtual link becomes active, through the building of
  1712. the shortest path tree for Area 2, it becomes an interface to the
  1713. backbone (see the two backbone interfaces depicted in Figure 9).
  1714.  
  1715.  
  1716.  
  1717. 6. The Area Data Structure
  1718.  
  1719. The area data structure contains all the information used to run the
  1720. basic routing algorithm.  Remember that each area maintains its own
  1721. topological database.  Router interfaces and adjacencies belong to a
  1722.  
  1723.  
  1724.                 _______________________________________
  1725.  
  1726.                 (Figure not included in text version.)
  1727.  
  1728.                 Figure 9: Router RT10's Data Structures
  1729.                 _______________________________________
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736. [Moy]                                                          [Page 31]
  1737.  
  1738. RFC 1247                     OSPF Version 2                    July 1991
  1739.  
  1740.  
  1741. single area.
  1742.  
  1743. The backbone has all the properties of an area.  For that reason it is
  1744. also represented by an area data structure.  Note that some items in the
  1745. structure apply differently to the backbone than to areas.
  1746.  
  1747. The area topological (or link state) database consists of the collection
  1748. of router links, network links and summary links advertisements that
  1749. have originated from the area's routers.  This information is flooded
  1750. throughout a single area only.  The list of AS external advertisements
  1751. is also considered to be part of each area's topological database.
  1752.  
  1753.  
  1754. Area ID
  1755.     A 32-bit number identifying the area.  0 is reserved for the area ID
  1756.     of the backbone.  If assigning subnetted networks as separate areas,
  1757.     the IP network number could be used as the Area ID.
  1758.  
  1759. List of component address ranges
  1760.     The address ranges that define the area.  Each address range is
  1761.     specified by an [address,mask] pair.  Each network is then assigned
  1762.     to an area depending on the address range that it falls into
  1763.     (specified address ranges are not allowed to overlap).  As an
  1764.     example, if an IP subnetted network is to be its own separate OSPF
  1765.     area, the area is defined to consist of a single address range - an
  1766.     IP network number with its natural (class A, B or C) mask.
  1767.  
  1768. Associated router interfaces
  1769.     This router's interfaces connecting to the area.  A router interface
  1770.     belongs to one and only one area (or the backbone).  For the
  1771.     backbone structure this list includes all the virtual adjacencies.
  1772.     A virtual adjacency is identified by the router ID of its other
  1773.     endpoint; its cost is the cost of the shortest intra-area path that
  1774.     exists between the two routers.
  1775.  
  1776. List of router links advertisements
  1777.     A router links advertisement is generated by each router in the
  1778.     area.  It describes the state of the router's interfaces to the
  1779.     area.
  1780.  
  1781. List of network links advertisements
  1782.     One network links advertisement is generated for each transit
  1783.     multi-access network in the area.  It describes the set of routers
  1784.     currently connected to the network.
  1785.  
  1786. List of summary links advertisements
  1787.     Summary link advertisements originate from the area's area border
  1788.     routers.  They describe routes to destinations internal to the
  1789.  
  1790.  
  1791.  
  1792. [Moy]                                                          [Page 32]
  1793.  
  1794. RFC 1247                     OSPF Version 2                    July 1991
  1795.  
  1796.  
  1797.     Autonomous System, yet external to the area.
  1798.  
  1799. Shortest-path tree
  1800.     The shortest-path tree for the area, with this router itself as
  1801.     root.  Derived from the collected router links and network links
  1802.     advertisements by the Dijkstra algorithm.
  1803.  
  1804. Authentication type
  1805.     The type of authentication used for this area.  Authentication types
  1806.     are defined in Appendix E.  All OSPF packet exchanges are
  1807.     authenticated.  Different authentication schemes may be used in
  1808.     different areas.
  1809.  
  1810. External routing capability
  1811.     Whether AS external advertisements will be flooded into/throughout
  1812.     the area.  This is a configurable parameter.  If AS external
  1813.     advertisements are excluded from the area, the area is called a
  1814.     "stub".  Internal to stub areas, routing to external destinations
  1815.     will be based solely on a default summary route.  The backbone
  1816.     cannot be configured as a stub area.  Also, virtual links cannot be
  1817.     configured through stub areas.  For more information, see Section
  1818.     3.6.
  1819.  
  1820. StubDefaultCost
  1821.     If the area has been configured as a stub area, and the router
  1822.     itself is an area border router, then the StubDefaultCost indicates
  1823.     the cost of the default summary link that the router should
  1824.     advertise into the area.  There can be a separate cost configured
  1825.     for each IP TOS.  See Section 12.4.3 for more information.
  1826.  
  1827.  
  1828. Unless otherwise specified, the remaining sections of this document
  1829. refer to the operation of the protocol in a single area.
  1830.  
  1831.  
  1832. 7. Bringing Up Adjacencies
  1833.  
  1834. OSPF creates adjacencies between neighboring routers for the purpose of
  1835. exchanging routing information.  Not every two neighboring routers will
  1836. become adjacent.  This section covers the generalities involved in
  1837. creating adjacencies.  For further details consult Section 10.
  1838.  
  1839.  
  1840. 7.1 The Hello Protocol
  1841.  
  1842. The Hello Protocol is responsible for establishing and maintaining
  1843. neighbor relationships.  It also ensures that communication between
  1844. neighbors is bidirectional.  Hello packets are sent periodically out all
  1845.  
  1846.  
  1847.  
  1848. [Moy]                                                          [Page 33]
  1849.  
  1850. RFC 1247                     OSPF Version 2                    July 1991
  1851.  
  1852.  
  1853. router interfaces.  Bidirectional communication is indicated when the
  1854. router sees itself listed in the neighbor's Hello Packet.
  1855.  
  1856. On multi-access networks, the Hello Protocol elects a Designated Router
  1857. for the network.  Among other things, the Designated Router controls
  1858. what adjacencies will be formed over the network (see below).
  1859.  
  1860. The Hello Protocol works differently on broadcast networks, as compared
  1861. to non-broadcast networks.  On broadcast networks, each router
  1862. advertises itself by periodically multicasting Hello Packets.  This
  1863. allows neighbors to be discovered dynamically.  These Hello Packets
  1864. contain the router's view of the Designated Router's identity, and the
  1865. list of routers whose Hellos have been seen recently.
  1866.  
  1867. On non-broadcast networks some configuration information is necessary
  1868. for the operation of the Hello Protocol.  Each router that may
  1869. potentially become Designated Router has a list of all other routers
  1870. attached to the network.  A router, having Designated Router potential,
  1871. sends hellos to all other potential Designated Routers when its
  1872. interface to the non-broadcast network first becomes operational.  This
  1873. is an attempt to find the Designated Router for the network.  If the
  1874. router itself is elected Designated Router, it begins sending hellos to
  1875. all other routers attached to the network.
  1876.  
  1877. After a neighbor has been discovered, bidirectional communication
  1878. ensured, and (if on a multi-access network) a Designated Router elected,
  1879. a decision is made regarding whether or not an adjacency should be
  1880. formed with the neighbor (see Section 10.4).  An attempt is always made
  1881. to establish adjacencies over point-to-point networks and virtual links.
  1882. The first step in bringing up an adjacency is to synchronize the
  1883. neighbors' topological databases.  This is covered in the next section.
  1884.  
  1885.  
  1886. 7.2 The Synchronization of Databases
  1887.  
  1888. In an SPF-based routing algorithm, it is very important for all routers'
  1889. topological databases to stay synchronized.  OSPF simplifies this by
  1890. requiring only adjacent routers to remain synchronized.  The
  1891. synchronization process begins as soon as the routers attempt to bring
  1892. up the adjacency.  Each router describes its database by sending a
  1893. sequence of Database Description packets to its neighbor.  Each Database
  1894. Description Packet describes a set of link state advertisements
  1895. belonging to the database.  When the neighbor sees a link state
  1896. advertisement that is more recent than its own database copy, it makes a
  1897. note that this newer advertisement should be requested.
  1898.  
  1899. This sending and receiving of Database Description packets is called the
  1900. "Database Exchange Process".  During this process, the two routers form
  1901.  
  1902.  
  1903.  
  1904. [Moy]                                                          [Page 34]
  1905.  
  1906. RFC 1247                     OSPF Version 2                    July 1991
  1907.  
  1908.  
  1909. a master/slave relationship.  Each Database Description Packet has a
  1910. sequence number.  Database Description Packets sent by the master
  1911. (polls) are acknowledged by the slave through echoing of the sequence
  1912. number.  Both polls and their responses contain summaries of link state
  1913. data.  The master is the only one allowed to retransmit Database
  1914. Description Packets.  It does so only at fixed intervals, the length of
  1915. which is the configured constant RxmtInterval.
  1916.  
  1917. Each Database Description contains an indication that there are more
  1918. packets to follow --- the M-bit.  The Database Exchange Process is over
  1919. when a router has received and sent Database Description Packets with
  1920. the M-bit off.
  1921.  
  1922. During and after the Database Exchange Process, each router has a list
  1923. of those link state advertisements for which the neighbor has more up-
  1924. to-date instances.  These advertisements are requested in Link State
  1925. Request Packets.  Link State Request packets that are not satisfied are
  1926. retransmitted at fixed intervals of time RxmtInterval.  When the
  1927. Database Description Process has completed and all Link State Requests
  1928. have been satisfied, the databases are deemed synchronized and the
  1929. routers are marked fully adjacent.  At this time the adjacency is fully
  1930. functional and is advertised in the two routers' link state
  1931. advertisements.
  1932.  
  1933. The adjacency is used by the flooding procedure as soon as the Database
  1934. Exchange Process begins.  This simplifies database synchronization, and
  1935. guarantees that it finishes in a predictable period of time.
  1936.  
  1937.  
  1938. 7.3 The Designated Router
  1939.  
  1940. Every multi-access network has a Designated Router.  The Designated
  1941. Router performs two main functions for the routing protocol:
  1942.  
  1943. o   The Designated Router originates a network links advertisement on
  1944.     behalf of the network.  This advertisement lists the set of routers
  1945.     (including the Designated Router itself) currently attached to the
  1946.     network.  The Link State ID for this advertisement (see Section
  1947.     12.1.4) is the IP interface address of the Designated Router.  The
  1948.     IP network number can then be obtained by using the subnet/network
  1949.     mask.
  1950.  
  1951. o   The Designated router becomes adjacent to all other routers on the
  1952.     network.  Since the link state databases are synchronized across
  1953.     adjacencies (through adjacency bring-up and then the flooding
  1954.     procedure), the Designated Router plays a central part in the
  1955.     synchronization process.
  1956.  
  1957.  
  1958.  
  1959.  
  1960. [Moy]                                                          [Page 35]
  1961.  
  1962. RFC 1247                     OSPF Version 2                    July 1991
  1963.  
  1964.  
  1965. The Designated Router is elected by the Hello Protocol.  A router's
  1966. Hello Packet contains its Router Priority, which is configurable on a
  1967. per-interface basis.  In general, when a router's interface to a network
  1968. first becomes functional, it checks to see whether there is currently a
  1969. Designated Router for the network.  If there is, it accepts that
  1970. Designated Router, regardless of its Router Priority.  (This makes it
  1971. harder to predict the identity of the Designated Router, but ensures
  1972. that the Designated Router changes less often.  See below.)  Otherwise,
  1973. the router itself becomes Designated Router if it has the highest Router
  1974. Priority on the network.  A more detailed (and more accurate)
  1975. description of Designated Router election is presented in Section 9.4.
  1976.  
  1977. The Designated Router is the endpoint of many adjacencies.  In order to
  1978. optimize the flooding procedure on broadcast networks, the Designated
  1979. Router multicasts its Link State Update Packets to the address
  1980. AllSPFRouters, rather than sending separate packets over each adjacency.
  1981.  
  1982. Section 2 of this document discusses the directed graph representation
  1983. of an area.  Router nodes are labelled with their Router ID.  Broadcast
  1984. network nodes are actually labelled with the IP address of their
  1985. Designated Router.  It follows that when the Designated Router changes,
  1986. it appears as if the network node on the graph is replaced by an
  1987. entirely new node.  This will cause the network and all its attached
  1988. routers to originate new link state advertisements.  Until the
  1989. topological databases again converge, some temporary loss of
  1990. connectivity may result.  This may result in ICMP unreachable messages
  1991. being sent in response to data traffic.  For that reason, the Designated
  1992. Router should change only infrequently.  Router Priorities should be
  1993. configured so that the most dependable router on a network eventually
  1994. becomes Designated Router.
  1995.  
  1996.  
  1997. 7.4 The Backup Designated Router
  1998.  
  1999. In order to make the transition to a new Designated Router smoother,
  2000. there is a Backup Designated Router for each multi-access network.  The
  2001. Backup Designated Router is also adjacent to all routers on the network,
  2002. and becomes Designated Router when the previous Designated Router fails.
  2003. If there were no Backup Designated Router, when a new Designated Router
  2004. became necessary, new adjacencies would have to be formed between the
  2005. router and all other routers attached to the network.  Part of the
  2006. adjacency forming process is the synchronizing of topological databases,
  2007. which can potentially take quite a long time.  During this time, the
  2008. network would not be available for transit data traffic.  The Backup
  2009. Designated obviates the need to form these adjacencies, since they
  2010. already exist.  This means the period of disruption in transit traffic
  2011. lasts only as long as it take to flood the new link state advertisements
  2012. (which announce the new Designated Router).
  2013.  
  2014.  
  2015.  
  2016. [Moy]                                                          [Page 36]
  2017.  
  2018. RFC 1247                     OSPF Version 2                    July 1991
  2019.  
  2020.  
  2021. The Backup Designated Router does not generate a network links
  2022. advertisement for the network.  (If it did, the transition to a new
  2023. Designated Router would be even faster.  However, this is a tradeoff
  2024. between database size and speed of convergence when the Designated
  2025. Router disappears.)
  2026.  
  2027. The Backup Designated Router is also elected by the Hello Protocol.
  2028. Each Hello Packet has a field that specifies the Backup Designated
  2029. Router for the network.
  2030.  
  2031. In some steps of the flooding procedure, the Backup Designated Router
  2032. plays a passive role, letting the Designated Router do more of the work.
  2033. This cuts down on the amount of local routing traffic.  See Section 13.3
  2034. for more information.
  2035.  
  2036.  
  2037. 7.5 The graph of adjacencies
  2038.  
  2039. An adjacency is bound to the network that the two routers have in
  2040. common.  If two routers have multiple networks in common, they may have
  2041. multiple adjacencies between them.
  2042.  
  2043. One can picture the collection of adjacencies on a network as forming an
  2044. undirected graph.  The vertices consist of routers, with an edge joining
  2045. two routers if they are adjacent.  The graph of adjacencies describes
  2046. the flow of routing protocol packets, and in particular Link State
  2047. Updates, through the Autonomous System.
  2048.  
  2049. Two graphs are possible, depending on whether the common network is
  2050. multi-access.  On physical point-to-point networks (and virtual links),
  2051. the two routers joined by the network will be adjacent after their
  2052. databases have been synchronized.  On multi-access networks, both the
  2053. Designated Router and the Backup Designated Router are adjacent to all
  2054. other routers attached to the network, and these account for all
  2055. adjacencies.
  2056.  
  2057. These graphs are shown in Figure 10.  It is assumed that router RT7 has
  2058. become the Designated Router, and router RT3 the Backup Designated
  2059. Router, for the network N2.  The Backup Designated Router performs a
  2060. lesser function during the flooding procedure than the Designated Router
  2061. (see Section 13.3).  This is the reason for the dashed lines connecting
  2062. the Backup Designated Router RT3.
  2063.  
  2064.  
  2065. 8. Protocol Packet Processing
  2066.  
  2067. This section discusses the general processing of routing protocol
  2068. packets.  It is very important that the router topological databases
  2069.  
  2070.  
  2071.  
  2072. [Moy]                                                          [Page 37]
  2073.  
  2074. RFC 1247                     OSPF Version 2                    July 1991
  2075.  
  2076.  
  2077. remain synchronized.  For this reason, routing protocol packets should
  2078. get preferential treatment over ordinary data packets, both in sending
  2079. and receiving.
  2080.  
  2081. Routing protocol packets are sent along adjacencies only (with the
  2082. exception of Hello packets, which are used to discover the adjacencies).
  2083. This means that all protocol packets travel a single IP hop, except
  2084. those sent over virtual links.
  2085.  
  2086. All routing protocol packets begin with a standard header.  The sections
  2087. below give the details on how to fill in and verify this standard
  2088. header.  Then, for each packet type, the section is listed that gives
  2089. more details on that particular packet type's processing.
  2090.  
  2091.  
  2092.  
  2093. 8.1 Sending protocol packets
  2094.  
  2095. When a router sends a routing protocol packet, it fills in the fields of
  2096. that standard header as follows.  For more details on the header format
  2097. consult Section A.3.1:
  2098.  
  2099.  
  2100. Version #
  2101.     Set to 2, the version number of the protocol as documented in this
  2102.     specification.
  2103.  
  2104. Packet type
  2105.     The type of OSPF packet, such as Link state Update or Hello Packet.
  2106.  
  2107. Packet length
  2108.     The length of the entire OSPF packet in bytes, including the
  2109.     standard header.
  2110.  
  2111. Router ID
  2112.     The identity of the router itself (who is originating the packet).
  2113.  
  2114.  
  2115.                  ______________________________________
  2116.  
  2117.                  (Figure not included in text version.)
  2118.  
  2119.                   Figure 10: The graph of adjacencies
  2120.                    Figure 11: Interface state changes
  2121.                  ______________________________________
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128. [Moy]                                                          [Page 38]
  2129.  
  2130. RFC 1247                     OSPF Version 2                    July 1991
  2131.  
  2132.  
  2133. Area ID
  2134.     The area that the packet is being sent into.
  2135.  
  2136. Checksum
  2137.     The standard IP 16-bit one's complement checksum of the entire OSPF
  2138.     packet, excluding the 64-bit authentication field.  This checksum
  2139.     should be calculated before handing the packet to the appropriate
  2140.     authentication procedure.
  2141.  
  2142. Autype and Authentication
  2143.     Each OSPF packet exchange is authenticated.  Authentication types
  2144.     are assigned by the protocol and documented in Appendix E.  A
  2145.     different authentication scheme can be used for each OSPF area.  The
  2146.     64-bit authentication field is set by the appropriate authentication
  2147.     procedure (determined by Autype).  This procedure should be the last
  2148.     called when forming the packet to be sent.  The setting of the
  2149.     authentication field is determined by the packet contents and the
  2150.     authentication key (which is configurable on a per-interface basis).
  2151.  
  2152.  
  2153. The IP destination address for the packet is selected as follows.  On
  2154. physical point-to-point networks, the IP destination is always set to
  2155. the the address AllSPFRouters.  On all other network types (including
  2156. virtual links), the majority of OSPF packets are sent as unicasts, i.e.,
  2157. sent directly to the other end of the adjacency.  In this case, the IP
  2158. destination is just the neighbor IP address associated with the other
  2159. end of the adjacency (see Section 10).  The only packets not sent as
  2160. unicasts are on broadcast networks; on these networks Hello packets are
  2161. sent to the multicast destination AllSPFRouters, the Designated Router
  2162. and its Backup send both Link State Update Packets and Link State
  2163. Acknowledgment Packets to the multicast address AllSPFRouters, while all
  2164. other routers send both their Link State Update and Link State
  2165. Acknowledgment Packets to the multicast address AllDRouters.
  2166.  
  2167. Retransmissions of Link State Update packets are ALWAYS sent as
  2168. unicasts.
  2169.  
  2170. The IP source address should be set to the IP address of the sending
  2171. interface.  Interfaces to unnumbered point-to-point networks have no
  2172. associated IP address.  On these interfaces, the IP source should be set
  2173. to any of the other IP addresses belonging to the router.  For this
  2174. reason, there must be at least one IP address assigned to the router.[2]
  2175. Note that, for most purposes, virtual links act precisely the same as
  2176. unnumbered point-to-point networks.  However, each virtual link does
  2177. have an interface IP address (discovered during the routing table build
  2178. process) which is used as the IP source when sending packets over the
  2179. virtual link.
  2180.  
  2181.  
  2182.  
  2183.  
  2184. [Moy]                                                          [Page 39]
  2185.  
  2186. RFC 1247                     OSPF Version 2                    July 1991
  2187.  
  2188.  
  2189. For more information on the format of specific packet types, consult the
  2190. sections listed in Table 10.
  2191.  
  2192.  
  2193.  
  2194.          Type   Packet name            detailed section (transmit)
  2195.          _________________________________________________________
  2196.          1      Hello                  Section  9.5
  2197.          2      Database description   Section 10.8
  2198.          3      Link state request     Section 10.9
  2199.          4      Link state update      Section 13.3
  2200.          5      Link state ack         Section 13.5
  2201.  
  2202.  
  2203.              Table 10: Sections describing packet transmission.
  2204.  
  2205.  
  2206.  
  2207. 8.2 Receiving protocol packets
  2208.  
  2209. Whenever a protocol packet is received by the router it is marked with
  2210. the interface it was received on.  For routers that have virtual links
  2211. configured, it may not be immediately obvious which interface to
  2212. associate the packet with.  For example, consider the router RT11
  2213. depicted in Figure 6.  If RT11 receives an OSPF protocol packet on its
  2214. interface to network N8, it may want to associate the packet with the
  2215. interface to area 2, or with the virtual link to router RT10 (which is
  2216. part of the backbone).  In the following, we assume that the packet is
  2217. initially associated with the non-virtual  link.[3]
  2218.  
  2219. In order for the packet to be accepted at the IP level, it must pass a
  2220. number of tests, even before the packet is passed to OSPF for
  2221. processing:
  2222.  
  2223.  
  2224. o   The IP checksum must be correct.
  2225.  
  2226. o   The packet's IP destination address must be the IP address of the
  2227.     receiving interface, or one of the IP multicast addresses
  2228.     AllSPFRouters or AllDRouters.
  2229.  
  2230. o   The IP protocol specified must be OSPF (89).
  2231.  
  2232. o   Locally originated packets should not be passed on to OSPF.  That
  2233.     is, the source IP address should be examined to make sure this is
  2234.     not a multicast packet that the router itself generated.
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240. [Moy]                                                          [Page 40]
  2241.  
  2242. RFC 1247                     OSPF Version 2                    July 1991
  2243.  
  2244.  
  2245. Next, the OSPF packet header is verified.  The fields specified in the
  2246. header must match those configured for the receiving interface.  If they
  2247. do not, the packet should be discarded:
  2248.  
  2249.  
  2250. o   The version number field must specify protocol version 2.
  2251.  
  2252. o   The 16-bit checksum of the OSPF packet's contents must be verified.
  2253.     Remember that the 64-bit authentication field must be excluded from
  2254.     the checksum calculation.
  2255.  
  2256. o   The Area ID found in the OSPF header must be verified.  If both of
  2257.     the following cases fail, the packet should be discarded.  The Area
  2258.     ID specified in the header must either:
  2259.  
  2260.     (1) Match the Area ID of the receiving interface.  In this case, the
  2261.         packet has been sent over a single hop.  Therefore, the packet's
  2262.         IP source address must be on the same network as the receiving
  2263.         interface.  This can be determined by comparing the packet's IP
  2264.         source address to the interface's IP address, after masking both
  2265.         addresses with the interface mask.
  2266.  
  2267.     (2) Indicate the backbone.  In this case, the packet has been sent
  2268.         over a virtual link.  The receiving router must be an area
  2269.         border router, and the router ID specified in the packet (the
  2270.         source router) must be the other end of a configured virtual
  2271.         link.  The receiving interface must also attach to the virtual
  2272.         link's configured transit area.  If all of these checks succeed,
  2273.         the packet is accepted and is from now on associated with the
  2274.         virtual link (and the backbone area).
  2275.  
  2276. o   Packets whose IP destination is AllDRouters should only be accepted
  2277.     if the state of the receiving interface is DR or Backup (see Section
  2278.     9.1).
  2279.  
  2280. o   The Authentication type specified must match the authentication type
  2281.     specified for the associated area.
  2282.  
  2283.  
  2284. Next, the packet must be authenticated.  This depends on the
  2285. authentication type specified (see Appendix E).  The authentication
  2286. procedure may use an Authentication key, which can be configured on a
  2287. per-interface basis.  If the authentication fails, the packet should be
  2288. discarded.
  2289.  
  2290. If the packet type is Hello, it should then be further processed by the
  2291. Hello Protocol (see Section 10.5).  All other packet types are
  2292. sent/received only on adjacencies.  This means that the packet must have
  2293.  
  2294.  
  2295.  
  2296. [Moy]                                                          [Page 41]
  2297.  
  2298. RFC 1247                     OSPF Version 2                    July 1991
  2299.  
  2300.  
  2301. been sent by one of the router's active neighbors.  If the receiving
  2302. interface is a multi-access network (either broadcast or non-broadcast)
  2303. the sender is identified by the IP source address found in the packet's
  2304. IP header.  If the receiving interface is a point-to-point link or a
  2305. virtual link, the sender is identified by the Router ID (source router)
  2306. found in the packet's OSPF header.  The data structure associated with
  2307. the receiving interface contains the list of active neighbors.  Packets
  2308. not matching any active neighbor are discarded.
  2309.  
  2310. At this point all received protocol packets are associated with an
  2311. active neighbor.  For the further input processing of specific packet
  2312. types, consult the sections listed in Table 11.
  2313.  
  2314.  
  2315.  
  2316.           Type   Packet name            detailed section (receive)
  2317.           ________________________________________________________
  2318.           1      Hello                  Section 10.5
  2319.           2      Database description   Section 10.6
  2320.           3      Link state request     Section 10.7
  2321.           4      Link state update      Section 13
  2322.           5      Link state ack         Section 13.7
  2323.  
  2324.  
  2325.               Table 11: Sections describing packet reception.
  2326.  
  2327.  
  2328.  
  2329. 9. The Interface Data Structure
  2330.  
  2331. An OSPF interface is the connection between a router and a network.
  2332. There is a single OSPF interface structure for each attached network;
  2333. each interface structure has at most one IP interface address (see
  2334. below).  The support for multiple addresses on a single network is a
  2335. matter for future consideration.
  2336.  
  2337. An OSPF interface can be considered to belong to the area that contains
  2338. the attached network.  All routing protocol packets originated by the
  2339. router over this interface are labelled with the interface's Area ID.
  2340. One or more router adjacencies may develop over an interface.  A
  2341. router's link state advertisements reflect the state of its interfaces
  2342. and their associated adjacencies.
  2343.  
  2344. The following data items are associated with an interface.  Note that a
  2345. number of these items are actually configuration for the attached
  2346. network; those items must be the same for all routers connected to the
  2347. network.
  2348.  
  2349.  
  2350.  
  2351.  
  2352. [Moy]                                                          [Page 42]
  2353.  
  2354. RFC 1247                     OSPF Version 2                    July 1991
  2355.  
  2356.  
  2357. Type
  2358.     The kind of network to which the interface attaches.  Its value is
  2359.     either broadcast, non-broadcast yet still multi-access, point-to-
  2360.     point or virtual link.
  2361.  
  2362. State
  2363.     The functional level of an interface.  State determines whether or
  2364.     not full adjacencies are allowed to form over the interface.  State
  2365.     is also reflected in the router's link state advertisements.
  2366.  
  2367. IP interface address
  2368.     The IP address associated with the interface.  This appears as the
  2369.     IP source address in all routing protocol packets originated over
  2370.     this interface.  Interfaces to unnumbered point-to-point networks do
  2371.     not have an associated IP address.
  2372.  
  2373. IP interface mask
  2374.     This indicates the portion of the IP interface address that
  2375.     identifies the attached network.  This is often referred to as the
  2376.     subnet mask.  Masking the IP interface address with this value
  2377.     yields the IP network number of the attached network.
  2378.  
  2379. Area ID
  2380.     The Area ID to which the attached network belongs.  All routing
  2381.     protocol packets originating from the interface are labelled with
  2382.     this Area ID.
  2383.  
  2384. HelloInterval
  2385.     The length of time, in seconds, between the Hello packets that the
  2386.     router sends on the interface.  Advertised in Hello packets sent out
  2387.     this interface.
  2388.  
  2389. RouterDeadInterval
  2390.     The number of seconds before the router's neighbors will declare it
  2391.     down, when they stop hearing the router's hellos.  Advertised in
  2392.     Hello packets sent out this interface.
  2393.  
  2394. InfTransDelay
  2395.     The estimated number of seconds it takes to transmit a Link State
  2396.     Update Packet over this interface.  Link state advertisements
  2397.     contained in the update packet will have their age incremented by
  2398.     this amount before transmission.  This value should take into
  2399.     account transmission and propagation delays; it must be greater than
  2400.     zero.
  2401.  
  2402. Router Priority
  2403.     An 8-bit unsigned integer.  When two routers attached to a network
  2404.     both attempt to become Designated Router, the one with the highest
  2405.  
  2406.  
  2407.  
  2408. [Moy]                                                          [Page 43]
  2409.  
  2410. RFC 1247                     OSPF Version 2                    July 1991
  2411.  
  2412.  
  2413.     Router Priority takes precedence.  A router whose Router Priority is
  2414.     set to 0 is ineligible to become Designated Router on the attached
  2415.     network.  Advertised in Hello packets sent out this interface.
  2416.  
  2417. Hello Timer
  2418.     An interval timer that causes the interface to send a Hello packet.
  2419.     This timer fires every HelloInterval seconds.  Note that on non-
  2420.     broadcast networks a separate Hello packet is sent to each qualified
  2421.     neighbor.
  2422.  
  2423. Wait Timer
  2424.     A single shot timer that causes the interface to exit the Waiting
  2425.     state, and as a consequence select a Designated Router on the
  2426.     network.  The length of the timer is RouterDeadInterval seconds.
  2427.  
  2428. List of neighboring routers
  2429.     The other routers attached to this network.  On multi-access
  2430.     networks, this list is formed by the Hello Protocol.  Adjacencies
  2431.     will be formed to some of these neighbors.  The set of adjacent
  2432.     neighbors can be determined by an examination of all of the
  2433.     neighbors' states.
  2434.  
  2435. Designated Router
  2436.     The Designated Router selected for the attached network.  The
  2437.     Designated Router is selected on all multi-access networks by the
  2438.     Hello Protocol.  Two pieces of identification are kept for the
  2439.     Designated Router: its Router ID and its interface IP address on the
  2440.     network.  The Designated Router advertises link state for the
  2441.     network.  The network link state advertisement is labelled with the
  2442.     Designated Router's IP address.  This item is initialized to 0,
  2443.     which indicates the lack of a Designated Router.
  2444.  
  2445. Backup Designated Router
  2446.     The Backup Designated Router is also selected on all multi-access
  2447.     networks by the Hello Protocol.  All routers on the attached network
  2448.     become adjacent to both the Designated Router and the Backup
  2449.     Designated Router.  The Backup Designated Router becomes Designated
  2450.     Router when the current Designated Router fails.  Initialized to 0
  2451.     indicating the lack of a Backup Designated Router.
  2452.  
  2453. Interface output cost(s)
  2454.     The cost of sending a packet on the interface, expressed in the link
  2455.     state metric.  This is advertised as the link cost for this
  2456.     interface in the router links advertisement.  There may be a
  2457.     separate cost for each IP Type of Service.  The cost of an interface
  2458.     must be greater than zero.
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464. [Moy]                                                          [Page 44]
  2465.  
  2466. RFC 1247                     OSPF Version 2                    July 1991
  2467.  
  2468.  
  2469. RxmtInterval
  2470.     The number of seconds between link state advertisement
  2471.     retransmissions, for adjacencies belonging to this interface.  Also
  2472.     used when retransmitting Database Description and Link State Request
  2473.     Packets.
  2474.  
  2475. Authentication key
  2476.     This configured data allows the authentication procedure to generate
  2477.     and/or verify the authentication field in the OSPF header.  The
  2478.     authentication key can be configured on a per-interface basis.  For
  2479.     example, if the authentication type indicates simple password, the
  2480.     authentication key would be a 64-bit password.  This key would be
  2481.     inserted directly into the OSPF header when originating routing
  2482.     protocol packets, and there could be a separate password for each
  2483.     network.
  2484.  
  2485.  
  2486. 9.1 Interface states
  2487.  
  2488. The various states that router interface may attain is documented in
  2489. this section.  The states are listed in order of progressing
  2490. functionality.  For example, the inoperative state is listed first,
  2491. followed by a list of intermediate states before the final, fully
  2492. functional state is achieved.  The specification makes use of this
  2493. ordering by sometimes making references such as "those interfaces in
  2494. state greater than X".
  2495.  
  2496. Figure 11 shows the graph of interface state changes.  The arcs of the
  2497. graph are labelled with the event causing the state change.  These
  2498. events are documented in Section 9.2.  The interface state machine is
  2499. described in more detail in Section 9.3.
  2500.  
  2501.  
  2502. Down
  2503.     This is the initial interface state.  In this state, the lower-level
  2504.     protocols have indicated that the interface is unusable.  No
  2505.     protocol traffic at all will be sent or received on such a
  2506.     interface.  In this state, interface parameters should be set to
  2507.     their initial values.  All interface timers should be disabled, and
  2508.     there should be no adjacencies associated with the interface.
  2509.  
  2510. Loopback
  2511.     In this state, the router's interface to the network is looped back.
  2512.     The interface may be looped back in hardware or software.  The
  2513.     interface will be unavailable for regular data traffic.  However, it
  2514.     may still be desirable to gain information on the quality of this
  2515.     interface, either through sending ICMP pings to the interface or
  2516.     through something like a bit error test.  For this reason, IP
  2517.  
  2518.  
  2519.  
  2520. [Moy]                                                          [Page 45]
  2521.  
  2522. RFC 1247                     OSPF Version 2                    July 1991
  2523.  
  2524.  
  2525.     packets may still be addressed to an interface in Loopback state.
  2526.     To facilitate this, such interfaces are advertised in router links
  2527.     advertisements as single host routes, whose destination is the IP
  2528.     interface address.[4]
  2529.  
  2530. Waiting
  2531.     In this state, the router is trying to determine the identity of the
  2532.     Backup Designated Router for the network.  To do this, the router
  2533.     monitors the Hellos it receives.  The router is not allowed to elect
  2534.     a Backup Designated Router nor Designated Router until it
  2535.     transitions out of Waiting state.  This prevents unnecessary changes
  2536.     of (Backup) Designated Router.
  2537.  
  2538. Point-to-point
  2539.     In this state, the interface is operational, and connects either to
  2540.     a physical point-to-point network or to a virtual link.  Upon
  2541.     entering this state, the router attempts to form an adjacency with
  2542.     the neighboring router.  Hellos are sent to the neighbor every
  2543.     HelloInterval seconds.
  2544.  
  2545. DR Other
  2546.     The interface is to a multi-access network on which another router
  2547.     has been selected to be the Designated Router.  In this state, the
  2548.     router itself has not been selected Backup Designated Router either.
  2549.     The router forms adjacencies to both the Designated Router and the
  2550.     Backup Designated Router (if they exist).
  2551.  
  2552. Backup
  2553.     In this state, the router itself is the Backup Designated Router on
  2554.     the attached network.  It will be promoted to Designated Router when
  2555.     the present Designated Router fails.  The router establishes
  2556.     adjacencies to all other routers attached to the network.  The
  2557.     Backup Designated Router performs slightly different functions
  2558.     during the Flooding Procedure, as compared to the Designated Router
  2559.     (see Section 13.3).  See Section 7.4 for more details on the
  2560.     functions performed by the Backup Designated Router.
  2561.  
  2562. DR  In this state, this router itself is the Designated Router on the
  2563.     attached network.  Adjacencies are established to all other routers
  2564.     attached to the network.  The router must also originate a network
  2565.     links advertisement for the network node.  The advertisement will
  2566.     contain links to all routers (including the Designated Router
  2567.     itself) attached to the network.  See Section 7.3 for more details
  2568.     on the functions performed by the Designated Router.
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576. [Moy]                                                          [Page 46]
  2577.  
  2578. RFC 1247                     OSPF Version 2                    July 1991
  2579.  
  2580.  
  2581. 9.2 Events causing interface state changes
  2582.  
  2583. State changes can be effected by a number of events.  These events are
  2584. pictured as the labelled arcs in Figure 11.  The label definitions are
  2585. listed below.  For a detailed explanation of the effect of these events
  2586. on OSPF protocol operation, consult Section 9.3.
  2587.  
  2588.  
  2589. Interface Up
  2590.     Lower-level protocols have indicated that the network interface is
  2591.     operational.  This enables the interface to transition out of Down
  2592.     state.  On virtual links, the interface operational indication is
  2593.     actually a result of the shortest path calculation (see Section
  2594.     16.7).
  2595.  
  2596. Wait Timer
  2597.     The Wait timer has fired, indicating the end of the waiting period
  2598.     that is required before electing a (Backup) Designated Router.
  2599.  
  2600. Backup seen
  2601.     The router has detected the existence or non-existence of a Backup
  2602.     Designated Router for the network.  This is done in one of two ways.
  2603.     First, a Hello Packet may be received from a neighbor claiming to be
  2604.     itself the Backup Designated Router.  Alternatively, a Hello Packet
  2605.     may be received from a neighbor claiming to be itself the Designated
  2606.     Router, and indicating that there is no Backup.  In either case
  2607.     there must be bidirectional communication with the neighbor, i.e.,
  2608.     the router must also appear in the neighbor's Hello Packet.  This
  2609.     event signals an end to the Waiting state.
  2610.  
  2611. Neighbor Change
  2612.     There has been a change in the set of bidirectional neighbors
  2613.     associated with the interface.  The (Backup) Designated Router needs
  2614.     to be recalculated.  The following neighbor changes lead to the
  2615.     Neighbor Change event.  For an explanation of neighbor states, see
  2616.     Section 10.1.
  2617.  
  2618.     o   Bidirectional communication has been established to a neighbor.
  2619.         In other words, the state of the neighbor has transitioned to
  2620.         2-Way or higher.
  2621.  
  2622.     o   There is no longer bidirectional communication with a neighbor.
  2623.         In other words, the state of the neighbor has transitioned to
  2624.         Init or lower.
  2625.  
  2626.     o   One of the bidirectional neighbors is newly declaring itself as
  2627.         either Designated Router or Backup Designated Router.  This is
  2628.         detected through examination of that neighbor's Hello Packets.
  2629.  
  2630.  
  2631.  
  2632. [Moy]                                                          [Page 47]
  2633.  
  2634. RFC 1247                     OSPF Version 2                    July 1991
  2635.  
  2636.  
  2637.     o   One of the bidirectional neighbors is no longer declaring itself
  2638.         as Designated Router, or is no longer declaring itself as Backup
  2639.         Designated Router.  This is again detected through examination
  2640.         of that neighbor's Hello Packets.
  2641.  
  2642.     o   The advertised Router Priority for a bidirectional neighbor has
  2643.         changed.  This is again detected through examination of that
  2644.         neighbor's Hello Packets.
  2645.  
  2646. Loop Ind
  2647.     An indication has been received that the interface is now looped
  2648.     back to itself.  This indication can be received either from network
  2649.     management or from the lower level protocols.
  2650.  
  2651. Unloop Ind
  2652.     An indication has been received that the interface is no longer
  2653.     looped back.  As with the Loop Ind event, this indication can be
  2654.     received either from network management or from the lower level
  2655.     protocols.
  2656.  
  2657. Interface Down
  2658.     Lower-level protocols indicate that this interface is no longer
  2659.     functional.  No matter what the current interface state is, the new
  2660.     interface state will be Down.
  2661.  
  2662.  
  2663. 9.3 The Interface state machine
  2664.  
  2665. A detailed description of the interface state changes follows.  Each
  2666. state change is invoked by an event (Section 9.2).  This event may
  2667. produce different effects, depending on the current state of the
  2668. interface.  For this reason, the state machine below is organized by
  2669. current interface state and received event.  Each entry in the state
  2670. machine describes the resulting new interface state and the required set
  2671. of additional actions.
  2672.  
  2673. When an interface's state changes, it may be necessary to originate a
  2674. new router links advertisement.  See Section 12.4 for more details.
  2675.  
  2676. Some of the required actions below involve generating events for the
  2677. neighbor state machine.  For example, when an interface becomes
  2678. inoperative, all neighbor connections associated with the interface must
  2679. be destroyed.  For more information on the neighbor state machine, see
  2680. Section 10.3.
  2681.  
  2682.  
  2683.  State(s):  Down
  2684.  
  2685.  
  2686.  
  2687.  
  2688. [Moy]                                                          [Page 48]
  2689.  
  2690. RFC 1247                     OSPF Version 2                    July 1991
  2691.  
  2692.  
  2693.     Event:  Interface Up
  2694.  
  2695. New state:  Depends on action routine
  2696.  
  2697.    Action:  Start the interval Hello Timer, enabling the periodic
  2698.             sending of Hello packets out the interface.  If the attached
  2699.             network is a physical point-to-point network or virtual
  2700.             link, the interface state transitions to Point-to-Point.
  2701.             Else, if the router is not eligible to become Designated
  2702.             Router the interface state transitions to DR other.
  2703.  
  2704.             Otherwise, the attached network is multi-access and the
  2705.             router is eligible to become Designated Router.  In this
  2706.             case, in an attempt to discover the attached network's
  2707.             Designated Router the interface state is set to Waiting and
  2708.             the single shot Wait Timer is started.  If in addition the
  2709.             attached network is non-broadcast, examine the configured
  2710.             list of neighbors for this interface and generate the
  2711.             neighbor event Start for each neighbor that is also eligible
  2712.             to become Designated Router.
  2713.  
  2714.  
  2715.  State(s):  Waiting
  2716.  
  2717.     Event:  Backup Seen
  2718.  
  2719. New state:  Depends upon action routine.
  2720.  
  2721.    Action:  Calculate the attached network's Backup Designated Router
  2722.             and Designated Router, as shown in Section 9.4.  As a result
  2723.             of this calculation, the new state of the interface will be
  2724.             either DR other, Backup or DR.
  2725.  
  2726.  
  2727.  State(s):  Waiting
  2728.  
  2729.     Event:  Wait Timer
  2730.  
  2731. New state:  Depends upon action routine.
  2732.  
  2733.    Action:  Calculate the attached network's Backup Designated Router
  2734.             and Designated Router, as shown in Section 9.4.  As a result
  2735.             of this calculation, the new state of the interface will be
  2736.             either DR other, Backup or DR.
  2737.  
  2738.  
  2739.  State(s):  DR Other, Backup or DR
  2740.  
  2741.  
  2742.  
  2743.  
  2744. [Moy]                                                          [Page 49]
  2745.  
  2746. RFC 1247                     OSPF Version 2                    July 1991
  2747.  
  2748.  
  2749.     Event:  Neighbor Change
  2750.  
  2751. New state:  Depends upon action routine.
  2752.  
  2753.    Action:  Recalculate the attached network's Backup Designated Router
  2754.             and Designated Router, as shown in Section 9.4.  As a result
  2755.             of this calculation, the new state of the interface will be
  2756.             either DR other, Backup or DR.
  2757.  
  2758.  
  2759.  State(s):  Any State
  2760.  
  2761.     Event:  Interface Down
  2762.  
  2763. New state:  Down
  2764.  
  2765.    Action:  All interface variables are reset, and interface timers
  2766.             disabled.  Also, all neighbor connections associated with
  2767.             the interface are destroyed.  This is done by generating the
  2768.             event KillNbr on all associated neighbors (see Section
  2769.             10.2).
  2770.  
  2771.  
  2772.  State(s):  Any State
  2773.  
  2774.     Event:  Loop Ind
  2775.  
  2776. New state:  Loopback
  2777.  
  2778.    Action:  Since this interface is no longer connected to the attached
  2779.             network the actions associated with the above Interface Down
  2780.             event are executed.
  2781.  
  2782.  
  2783.  State(s):  Loopback
  2784.  
  2785.     Event:  Unloop Ind
  2786.  
  2787. New state:  Down
  2788.  
  2789.    Action:  No actions are necessary.  For example, the interface
  2790.             variables have already been reset upon entering the Loopback
  2791.             state.  Note that reception of an Interface Up event is
  2792.             necessary before the interface again becomes fully
  2793.             functional.
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800. [Moy]                                                          [Page 50]
  2801.  
  2802. RFC 1247                     OSPF Version 2                    July 1991
  2803.  
  2804.  
  2805. 9.4 Electing the Designated Router
  2806.  
  2807. This section describes the algorithm used for calculating a network's
  2808. Designated Router and Backup Designated Router.  This algorithm is
  2809. invoked by the Interface state machine.  The initial time a router runs
  2810. the election algorithm for a network, the network's Designated Router
  2811. and Backup Designated Router are initialized to 0.0.0.0.  This indicates
  2812. the lack of both a Designated Router and a Backup Designated Router.
  2813.  
  2814. The Designated Router election algorithm proceeds as follows: Call the
  2815. router doing the calculation Router X.  The list of neighbors attached
  2816. to the network and having established bidirectional communication with
  2817. Router X is examined.  This list is precisely the collection of Router
  2818. X's neighbors (on this network) whose state is greater than or equal to
  2819. 2-Way (see Section 10.1).  Router X itself is also considered to be on
  2820. the list.  Discard all routers from the list that are ineligible to
  2821. become Designated Router.  (Routers having Router Priority of 0 are
  2822. ineligible to become Designated Router.)  The following steps are then
  2823. executed, considering only those routers that remain on the list:
  2824.  
  2825.  
  2826. (1) Note the current values for the network's Designated Router and
  2827.     Backup Designated Router.  This is used later for comparison
  2828.     purposes.
  2829.  
  2830. (2) Calculate the new Backup Designated Router for the network as
  2831.     follows.  Only those routers on the list that have not declared
  2832.     themselves to be Designated Router are eligible to become Backup
  2833.     Designated Router.  If one or more of these routers have declared
  2834.     themselves Backup Designated Router (i.e., they are currently
  2835.     listing themselves as Backup Designated Router, but not as
  2836.     Designated Router, in their Hello Packets) the one having highest
  2837.     Router Priority is declared to be Backup Designated Router.  In case
  2838.     of a tie, the one having the highest Router ID is chosen.  If no
  2839.     routers have declared themselves Backup Designated Router, choose
  2840.     the router having highest Router Priority, (again excluding those
  2841.     routers who have declared themselves Designated Router), and again
  2842.     use the Router ID to break ties.
  2843.  
  2844. (3) Calculate the new Designated Router for the network as follows.  If
  2845.     one or more of the routers have declared themselves Designated
  2846.     Router (i.e., they are currently listing themselves as Designated
  2847.     Router in their Hello Packets) the one having highest Router
  2848.     Priority is declared to be Designated Router.  In case of a tie, the
  2849.     one having the highest Router ID is chosen.  If no routers have
  2850.     declared themselves Designated Router, promote the new Backup
  2851.     Designated Router to Designated Router.
  2852.  
  2853.  
  2854.  
  2855.  
  2856. [Moy]                                                          [Page 51]
  2857.  
  2858. RFC 1247                     OSPF Version 2                    July 1991
  2859.  
  2860.  
  2861. (4) If Router X is now newly the Designated Router or newly the Backup
  2862.     Designated Router, or is now no longer the Designated Router or no
  2863.     longer the Backup Designated Router, repeat steps 2 and 3, and then
  2864.     proceed to step 5.  For example, if Router X is now the Designated
  2865.     Router, when step 2 is repeated X will no longer be eligible for
  2866.     Backup Designated Router election.  Among other things, this will
  2867.     ensure that no router will declare itself both Backup Designated
  2868.     Router and Designated Router.[5]
  2869.  
  2870. (5) As a result of these calculations, the router itself may now be
  2871.     Designated Router or Backup Designated Router.  See Sections 7.3 and
  2872.     7.4 for the additional duties this would entail.  The router's
  2873.     interface state should be set accordingly.  If the router itself is
  2874.     now Designated Router, the new interface state is DR.  If the router
  2875.     itself is now Backup Designated Router, the new interface state is
  2876.     Backup.  Otherwise, the new interface state is DR Other.
  2877.  
  2878. (6) If the attached network is non-broadcast, and the router itself has
  2879.     just become either Designated Router or Backup Designated Router, it
  2880.     must start sending hellos to those neighbors that are not eligible
  2881.     to become Designated Router (see Section 9.5.1).  This is done by
  2882.     invoking the neighbor event Start for each neighbor having a Router
  2883.     Priority of 0.
  2884.  
  2885. (7) If the above calculations have caused the identity of either the
  2886.     Designated Router or Backup Designated Router to change, the set of
  2887.     adjacencies associated with this interface will need to be modified.
  2888.     Some adjacencies may need to be formed, and others may need to be
  2889.     broken.  To accomplish this, invoke the event AdjOK?  on all
  2890.     neighbors whose state is at least 2-Way.  This will cause their
  2891.     eligibility for adjacency to be reexamined (see Sections 10.3 and
  2892.     10.4).
  2893.  
  2894.  
  2895. The reason behind the election algorithm's complexity is the desire for
  2896. an orderly transition from Backup Designated Router to Designated
  2897. Router, when the current Designated Router fails.  This orderly
  2898. transition is ensured through the introduction of hysteresis: no new
  2899. Backup router can be chosen until the old Backup accepts its new
  2900. Designated Router responsibilities.
  2901.  
  2902. If Router X is not itself eligible to become Designated Router, it is
  2903. possible that neither a Backup Designated Router nor a Designated Router
  2904. will be selected in the above procedure.  Note also that if Router X is
  2905. the only attached router that is eligible to become Designated Router,
  2906. it will select itself as Designated Router and there will be no Backup
  2907. Designated Router for the network.
  2908.  
  2909.  
  2910.  
  2911.  
  2912. [Moy]                                                          [Page 52]
  2913.  
  2914. RFC 1247                     OSPF Version 2                    July 1991
  2915.  
  2916.  
  2917. 9.5 Sending Hello packets
  2918.  
  2919. Hello packets are sent out each functioning router interface.  They are
  2920. used to discover and maintain neighbor relationships.[6] On multi-access
  2921. networks, hellos are also used to elect the Designated Router and Backup
  2922. Designated Router, and in that way determine what adjacencies should be
  2923. formed.
  2924.  
  2925. The format of a Hello packet is detailed in Section A.3.2.  The Hello
  2926. Packet contains the router's Router Priority (used in choosing the
  2927. Designated Router), and the interval between Hello broadcasts
  2928. (HelloInterval).  The Hello Packet also indicates how often a neighbor
  2929. must be heard from to remain active (RouterDeadInterval).  Both
  2930. HelloInterval and RouterDeadInterval must be the same for all routers
  2931. attached to a common network.  The Hello packet also contains the IP
  2932. address mask of the attached network (Network Mask).  On unnumbered
  2933. point-to-point networks and on virtual links this field should be set to
  2934. 0.
  2935.  
  2936. The Hello packet's Options field describes the router's optional OSPF
  2937. capabilities.  There are currently two optional capabilities defined
  2938. (see Sections 4.5 and A.2).  The T-bit of the Options field should be
  2939. set if the router is capable of calculating separate routes for each IP
  2940. TOS.  The E-bit should be set if and only if the attached area is
  2941. capable of processing AS external advertisements (i.e., it is not a stub
  2942. area).  If the E-bit is set incorrectly the neighboring routers will
  2943. refuse to accept the Hello Packet (see Section 10.5).  The rest of the
  2944. Hello Packet's Options field should be set to zero.
  2945.  
  2946. In order to ensure two-way communication between adjacent routers, the
  2947. Hello packet contains the list of all routers from which hellos have
  2948. been seen recently.  The Hello packet also contains the router's current
  2949. choice for Designated Router and Backup Designated Router.  A value of 0
  2950. in these fields means that one has not yet been selected.
  2951.  
  2952. On broadcast networks and physical point-to-point networks, Hello
  2953. packets are sent every HelloInterval seconds to the IP multicast address
  2954. AllSPFRouters.  On virtual links, Hello packets are sent as unicasts
  2955. (addressed directly to the other end of the virtual link) every
  2956. HelloInterval seconds.  On non-broadcast networks, the sending of Hello
  2957. packets is more complicated.  This will be covered in the next section.
  2958.  
  2959.  
  2960. 9.5.1 Sending Hello packets on non-broadcast networks
  2961.  
  2962. Static configuration information is necessary in order for the Hello
  2963. Protocol to function on non-broadcast networks (see Section C.5).  Every
  2964. attached router which is eligible to become Designated Router has a
  2965.  
  2966.  
  2967.  
  2968. [Moy]                                                          [Page 53]
  2969.  
  2970. RFC 1247                     OSPF Version 2                    July 1991
  2971.  
  2972.  
  2973. configured list of all of its neighbors on the network.  Each listed
  2974. neighbor is labelled with its Designated Router eligibility.
  2975.  
  2976. The interface state must be at least Waiting for any hellos to be sent.
  2977. Hellos are then sent directly (as unicasts) to some subset of a router's
  2978. neighbors.  Sometimes an hello is sent periodically on a timer; at other
  2979. times it is sent as a response to a received hello.  A router's hello-
  2980. sending behavior varies depending on whether the router itself is
  2981. eligible to become Designated Router.
  2982.  
  2983. If the router is eligible to become Designated Router, it must
  2984. periodically send hellos to all neighbors that are also eligible.  In
  2985. addition, if the router is itself the Designated Router or Backup
  2986. Designated Router, it must also send periodic hellos to all other
  2987. neighbors.  This means that any two eligible routers are always
  2988. exchanging hellos, which is necessary for the correct operation of the
  2989. Designated Router election algorithm.  To minimize the number of hellos
  2990. sent, the number of eligible routers on a non-broadcast network should
  2991. be kept small.
  2992.  
  2993. If the router is not eligible to become Designated Router, it must
  2994. periodically send hellos to both the Designated Router and the Backup
  2995. Designated Router (if they exist).  It must also send an hello in reply
  2996. to an hello received from any eligible neighbor (other than the current
  2997. Designated Router and Backup Designated Router).  This is needed to
  2998. establish an initial bidirectional relationship with any potential
  2999. Designated Router.
  3000.  
  3001. When sending Hello packets periodically to any neighbor, the interval
  3002. between hellos is determined by the neighbor's state.  If the neighbor
  3003. is in state Down, hellos are sent every PollInterval seconds.
  3004. Otherwise, hellos are sent every HelloInterval seconds.
  3005.  
  3006.  
  3007. 10. The Neighbor Data Structure
  3008.  
  3009. An OSPF router converses with its neighboring routers.  Each separate
  3010. conversation is described by a "neighbor data structure".  Each
  3011. conversation is bound to a particular OSPF router interface, and is
  3012. identified either by the neighboring router's OSPF router ID or by its
  3013. Neighbor IP address (see below).  Thus if the OSPF router and another
  3014. router have multiple attached networks in common, multiple conversations
  3015. ensue, each described by a unique neighbor data structure.  Each
  3016. separate conversation is loosely referred to in the text as being a
  3017. separate "neighbor".
  3018.  
  3019. The neighbor data structure contains all information pertinent to the
  3020. forming or formed adjacency between the two neighbors.  (However,
  3021.  
  3022.  
  3023.  
  3024. [Moy]                                                          [Page 54]
  3025.  
  3026. RFC 1247                     OSPF Version 2                    July 1991
  3027.  
  3028.  
  3029. remember that not all neighbors become adjacent.)  An adjacency can be
  3030. viewed as a highly developed conversation between two routers.
  3031.  
  3032.  
  3033. State
  3034.     The functional level of the neighbor conversation.  This is
  3035.     described in more detail in Section 10.1.
  3036.  
  3037. Inactivity Timer
  3038.     A single shot timer whose firing indicates that no Hello Packet has
  3039.     been seen from this neighbor recently.  The length of the timer is
  3040.     RouterDeadInterval seconds.
  3041.  
  3042. Master/Slave
  3043.     When the two neighbors are exchanging databases, they form a Master
  3044.     Slave relationship.  The Master sends the first Database Description
  3045.     Packet, and is the only part that is allowed to retransmit.  The
  3046.     slave can only respond to the master's Database Description Packets.
  3047.     The master/slave relationship is negotiated in state ExStart.
  3048.  
  3049. Sequence Number
  3050.     A 32-bit number identifying individual Database Description packets.
  3051.     When the neighbor state ExStart is entered, the sequence number
  3052.     should be set to a value not previously seen by the neighboring
  3053.     router.  One possible scheme is to use the machine's time of day
  3054.     counter.  The sequence number is then incremented by the master with
  3055.     each new Database Description packet sent.  The slave's sequence
  3056.     number indicates the last packet received from the master.  Only one
  3057.     packet is allowed outstanding at a time.
  3058.  
  3059. Neighbor ID
  3060.     The OSPF Router ID of the neighboring router.  The neighbor ID is
  3061.     learned when Hello packets are received from the neighbor, or is
  3062.     configured if this is a virtual adjacency (see Section C.4).
  3063.  
  3064. Neighbor priority
  3065.     The Router Priority of the neighboring router.  Contained in the
  3066.     neighbor's Hello packets, this item is used when selecting the
  3067.     Designated Router for the attached network.
  3068.  
  3069. Neighbor IP address
  3070.     The IP address of the neighboring router's interface to the attached
  3071.     network.  Used as the Destination IP address when protocol packets
  3072.     are sent as unicasts along this adjacency.  Also used in router
  3073.     links advertisements as the Link ID for the attached network if the
  3074.     neighboring router is selected to be Designated Router (see Section
  3075.     12.4.1).  The neighbor IP address is learned when Hello packets are
  3076.     received from the neighbor.  For virtual links, the neighbor IP
  3077.  
  3078.  
  3079.  
  3080. [Moy]                                                          [Page 55]
  3081.  
  3082. RFC 1247                     OSPF Version 2                    July 1991
  3083.  
  3084.  
  3085.     address is learned during the routing table build process (see
  3086.     Section 15).
  3087.  
  3088. Neighbor Options
  3089.     The optional OSPF capabilities supported by the neighbor.  Learned
  3090.     during the Database Exchange process (see Section 10.6).  The
  3091.     neighbor's optional OSPF capabilities are also listed in its Hello
  3092.     packets.  This enables received Hellos to be rejected (i.e.,
  3093.     neighbor relationships will not even start to form) if there is a
  3094.     mismatch in certain crucial OSPF capabilities (see Section 10.5).
  3095.     The optional OSPF capabilities are documented in Section 4.5.
  3096.  
  3097. Neighbor's Designated Router
  3098.     The neighbor's idea of the Designated Router.  If this is the
  3099.     neighbor itself, this is important in the local calculation of the
  3100.     Designated Router.  Defined only on multi-access networks.
  3101.  
  3102. Neighbor's Backup Designated Router
  3103.     The neighbor's idea of the Backup Designated Router.  If this is the
  3104.     neighbor itself, this is important in the local calculation of the
  3105.     Backup Designated Router.  Defined only on multi-access networks.
  3106.  
  3107.  
  3108. The next set of variables are lists of link state advertisements.  These
  3109. lists describe subsets of the area topological database.  There can be
  3110. five distinct types of link state advertisements in an area topological
  3111. database: router links, network links, and type 3 and 4 summary links
  3112. (all stored in the area data structure), and AS external links (stored
  3113. in the global data structure).
  3114.  
  3115.  
  3116. Link state retransmission list
  3117.     The list of link state advertisements that have been flooded but not
  3118.     acknowledged on this adjacency.  These will be retransmitted at
  3119.     intervals until they are acknowledged, or until the adjacency is
  3120.     destroyed.
  3121.  
  3122. Database summary list
  3123.     The complete list of link state advertisements that make up the area
  3124.     topological database, at the moment the neighbor goes into Database
  3125.     Exchange state.  This list is sent to the neighbor in Database
  3126.     Description packets.
  3127.  
  3128. Link state request list
  3129.     The list of link state advertisements that need to be received from
  3130.     this neighbor in order to synchronize the two neighbors' topological
  3131.     databases.  This list is created as Database Description packets are
  3132.     received, and is then sent to the neighbor in Link State Request
  3133.  
  3134.  
  3135.  
  3136. [Moy]                                                          [Page 56]
  3137.  
  3138. RFC 1247                     OSPF Version 2                    July 1991
  3139.  
  3140.  
  3141.     packets.  The list is depleted as appropriate Link State Update
  3142.     packets are received.
  3143.  
  3144.  
  3145. 10.1 Neighbor states
  3146.  
  3147. The state of a neighbor (really, the state of a conversation being held
  3148. with a neighboring router) is documented in the following sections.  The
  3149. states are listed in order of progressing functionality.  For example,
  3150. the inoperative state is listed first, followed by a list of
  3151. intermediate states before the final, fully functional state is
  3152. achieved.  The specification makes use of this ordering by sometimes
  3153. making references such as "those neighbors/adjacencies in state greater
  3154. than X".  Figures 12 and 13 show the graph of neighbor state changes.
  3155. The arcs of the graphs are labelled with the event causing the state
  3156. change.  The neighbor events are documented in Section 10.2.
  3157.  
  3158.  
  3159. The graph in Figure 12 show the state changes effected by the Hello
  3160. Protocol.  The Hello Protocol is responsible for neighbor acquisition
  3161. and maintenance, and for ensuring two way communication between
  3162. neighbors.
  3163.  
  3164. The graph in Figure 13 shows the forming of an adjacency.  Not every two
  3165. neighboring routers become adjacent (see Section 10.4).  The adjacency
  3166. starts to form when the neighbor is in state ExStart.  After the two
  3167. routers discover their master/slave status, the state transitions to
  3168. Exchange.  At this point the neighbor starts to be used in the flooding
  3169. procedure, and the two neighboring routers begin synchronizing their
  3170. databases.  When this synchronization is finished, the neighbor is in
  3171. state Full and we say that the two routers are fully adjacent.  At this
  3172. point the adjacency is listed in link state advertisements.
  3173.  
  3174. For a more detailed description of neighbor state changes, together with
  3175. the additional actions involved in each change, see Section 10.3.
  3176.  
  3177.  
  3178.  
  3179.          _____________________________________________________
  3180.  
  3181.                 (Figures not included in text version.)
  3182.  
  3183.           Figure 12: Neighbor state changes (Hello Protocol)
  3184.          Figure 13: Neighbor state changes (Database Exchange)
  3185.          _____________________________________________________
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192. [Moy]                                                          [Page 57]
  3193.  
  3194. RFC 1247                     OSPF Version 2                    July 1991
  3195.  
  3196.  
  3197. Down
  3198.     This is the initial state of a neighbor conversation.  It indicates
  3199.     that there has been no recent information received from the
  3200.     neighbor.  On non-broadcast networks, Hello packets may still be
  3201.     sent to "Down" neighbors, although at a reduced frequency (see
  3202.     Section 9.5.1).
  3203.  
  3204. Attempt
  3205.     This state is only valid for neighbors attached to non-broadcast
  3206.     networks.  It indicates that no recent information has been received
  3207.     from the neighbor, but that a more concerted effort should be made
  3208.     to contact the neighbor.  This is done by sending the neighbor Hello
  3209.     packets at intervals of HelloInterval (see Section 9.5.1).
  3210.  
  3211. Init
  3212.     In this state, an Hello packet has recently been seen from the
  3213.     neighbor.  However, bidirectional communication has not yet been
  3214.     established with the neighbor (i.e., the router itself did not
  3215.     appear in the neighbor's Hello packet).  All neighbors in this state
  3216.     (or higher) are listed in the Hello packets sent from the associated
  3217.     interface.
  3218.  
  3219. 2-Way
  3220.     In this state, communication between the two routers is
  3221.     bidirectional.  This has been assured by the operation of the Hello
  3222.     Protocol.  This is the most advanced state short of beginning
  3223.     adjacency establishment.  The (Backup) Designated Router is selected
  3224.     from the set of neighbors in state 2-Way or greater.
  3225.  
  3226. ExStart
  3227.     This is the first step in creating an adjacency between the two
  3228.     neighboring routers.  The goal of this step is to decide which
  3229.     router is the master, and to decide upon the initial sequence
  3230.     number.  Neighbor conversations in this state or greater are called
  3231.     adjacencies.
  3232.  
  3233. Exchange
  3234.     In this state the router is describing its entire link state
  3235.     database by sending Database Description packets to the neighbor.
  3236.     Each Database Description Packet has a sequence number, and is
  3237.     explicitly acknowledged.  Only one Database Description Packet is
  3238.     allowed outstanding at any one time.  In this state, Link State
  3239.     Request Packets may also be sent asking for the neighbor's more
  3240.     recent advertisements.  All adjacencies in Exchange state or greater
  3241.     are used by the flooding procedure.  In fact, these adjacencies are
  3242.     fully capable of transmitting and receiving all types of OSPF
  3243.     routing protocol packets.
  3244.  
  3245.  
  3246.  
  3247.  
  3248. [Moy]                                                          [Page 58]
  3249.  
  3250. RFC 1247                     OSPF Version 2                    July 1991
  3251.  
  3252.  
  3253. Loading
  3254.     In this state, Link State Request packets are sent to the neighbor
  3255.     asking for the more recent advertisements that have been discovered
  3256.     (but not yet received) in the Exchange state.
  3257.  
  3258. Full
  3259.     In this state, the neighboring routers are fully adjacent.  These
  3260.     adjacencies will now appear in router links and network links
  3261.     advertisements.
  3262.  
  3263.  
  3264. 10.2 Events causing neighbor state changes
  3265.  
  3266. State changes can be effected by a number of events.  These events are
  3267. shown in the labels of the arcs in Figures 12 and 13.  The label
  3268. definitions are as follows:
  3269.  
  3270.  
  3271. Hello Received
  3272.     A Hello packet has been received from a neighbor.
  3273.  
  3274. Start
  3275.     This is an indication that Hello Packets should now be sent to the
  3276.     neighbor at intervals of HelloInterval seconds.  This event is
  3277.     generated only for neighbors associated with non-broadcast networks.
  3278.  
  3279. 2-Way Received
  3280.     Bidirectional communication has been realized between the two
  3281.     neighboring routers.  This is indicated by this router seeing itself
  3282.     in the other's Hello packet.
  3283.  
  3284. NegotiationDone
  3285.     The Master/Slave relationship has been negotiated, and sequence
  3286.     numbers have been exchanged.  This signals the start of the
  3287.     sending/receiving of Database Description packets.  For more
  3288.     information on the generation of this event, consult Section 10.8.
  3289.  
  3290. Exchange Done
  3291.     Both routers have successfully transmitted a full sequence of
  3292.     Database Description packets.  Each router now knows what parts of
  3293.     its link state database are out of date.  For more information on
  3294.     the generation of this event, consult Section 10.8.
  3295.  
  3296. BadLSReq
  3297.     A Link State Request has been received for a link state
  3298.     advertisement not contained in the database.  This indicates an
  3299.     error in the synchronization process.
  3300.  
  3301.  
  3302.  
  3303.  
  3304. [Moy]                                                          [Page 59]
  3305.  
  3306. RFC 1247                     OSPF Version 2                    July 1991
  3307.  
  3308.  
  3309. Loading Done
  3310.     Link State Updates have been received for all out-of-date portions
  3311.     of the database.  This is indicated by the Link state request list
  3312.     becoming empty after the Database Description Process has completed.
  3313.  
  3314. AdjOK?
  3315.     A decision must be made (again) as to whether an adjacency should be
  3316.     established/maintained with the neighbor.  This event will start
  3317.     some adjacencies forming, and destroy others.
  3318.  
  3319.  
  3320. The following events cause well developed neighbors to revert to lesser
  3321. states.  Unlike the above events, these events may occur when the
  3322. neighbor conversation is in any of a number of states.
  3323.  
  3324.  
  3325. Seq Number Mismatch
  3326.     A Database Description packet has been received that either a) has
  3327.     an unexpected sequence number, b) unexpectedly has the Init bit set
  3328.     or c) has an Options field differing from the last Options field
  3329.     received in a Database Description packet.  Any of these conditions
  3330.     indicate that some error has occurred during adjacency
  3331.     establishment.
  3332.  
  3333. 1-Way
  3334.     An Hello packet has been received from the neighbor, in which this
  3335.     router is not mentioned.  This indicates that communication with the
  3336.     neighbor is not bidirectional.
  3337.  
  3338. KillNbr
  3339.     This  is  an  indication that  all  communication  with  the
  3340.     neighbor  is now  impossible,  forcing  the  neighbor  to  revert
  3341.     to  Down  state.
  3342.  
  3343. Inactivity Timer
  3344.     The inactivity Timer has fired.  This means that no Hello packets
  3345.     have been seen recently from the neighbor.  The neighbor reverts to
  3346.     Down state.
  3347.  
  3348. LLDown
  3349.     This is an indication from the lower level protocols that the
  3350.     neighbor is now unreachable.  For example, on an X.25 network this
  3351.     could be indicated by an X.25 clear indication with appropriate
  3352.     cause and diagnostic fields.  This event forces the neighbor into
  3353.     Down state.
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360. [Moy]                                                          [Page 60]
  3361.  
  3362. RFC 1247                     OSPF Version 2                    July 1991
  3363.  
  3364.  
  3365. 10.3 The Neighbor state machine
  3366.  
  3367. A detailed description of the neighbor state changes follows.  Each
  3368. state change is invoked by an event (Section 10.2).  This event may
  3369. produce different effects, depending on the current state of the
  3370. neighbor.  For this reason, the state machine below is organized by
  3371. current neighbor state and received event.  Each entry in the state
  3372. machine describes the resulting new neighbor state and the required set
  3373. of additional actions.
  3374.  
  3375. When an neighbor's state changes, it may be necessary to rerun the
  3376. Designated Router election algorithm.  This is determined by whether the
  3377. interface Neighbor Change event is generated (see Section 9.2).  Also,
  3378. if the Interface is in DR state (the router is itself Designated
  3379. Router), changes in neighbor state may cause a new network links
  3380. advertisement to be originated (see Section 12.4).
  3381.  
  3382. When the neighbor state machine needs to invoke the interface state
  3383. machine, it should be done as a scheduled task (see Section 4.4).  This
  3384. simplifies things, by ensuring that neither state machine will be
  3385. executed recursively.
  3386.  
  3387.  
  3388.  State(s):  Down
  3389.  
  3390.     Event:  Start
  3391.  
  3392. New state:  Attempt
  3393.  
  3394.    Action:  Send an hello to the neighbor (this neighbor is always
  3395.             associated with a non-broadcast network) and start the
  3396.             inactivity timer for the neighbor.  The timer's later firing
  3397.             would indicate that communication with the neighbor was not
  3398.             attained.
  3399.  
  3400.  
  3401.  State(s):  Attempt
  3402.  
  3403.     Event:  Hello Received
  3404.  
  3405. New state:  Init
  3406.  
  3407.    Action:  Restart the inactivity timer for the neighbor, since the
  3408.             neighbor has now been heard from.
  3409.  
  3410.  
  3411.  State(s):  Down
  3412.  
  3413.  
  3414.  
  3415.  
  3416. [Moy]                                                          [Page 61]
  3417.  
  3418. RFC 1247                     OSPF Version 2                    July 1991
  3419.  
  3420.  
  3421.     Event:  Hello Received
  3422.  
  3423. New state:  Init
  3424.  
  3425.    Action:  Start the inactivity timer for the neighbor.  The timer's
  3426.             later firing would indicate that the neighbor is dead.
  3427.  
  3428.  
  3429.  State(s):  Init or greater
  3430.  
  3431.     Event:  Hello Received
  3432.  
  3433. New state:  No state change.
  3434.  
  3435.    Action:  Restart the inactivity timer for the neighbor, since the
  3436.             neighbor has again been heard from.
  3437.  
  3438.  
  3439.  State(s):  Init
  3440.  
  3441.     Event:  2-Way Received
  3442.  
  3443. New state:  Depends upon action routine.
  3444.  
  3445.    Action:  Determine whether an adjacency should be established with
  3446.             the neighbor (see Section 10.4).  If not, the new neighbor
  3447.             state is 2-Way.
  3448.  
  3449.             Otherwise (an adjacency should be established) the neighbor
  3450.             state transitions to ExStart.  Upon entering this state, the
  3451.             router increments the sequence number for this neighbor.  If
  3452.             this is the first time that an adjacency has been attempted,
  3453.             the sequence number should be assigned some unique value
  3454.             (like the time of day clock).  It then declares itself
  3455.             master (sets the master/slave bit to master), and starts
  3456.             sending Database Description Packets, with the initialize
  3457.             (I), more (M) and master (MS) bits set.  This Database
  3458.             Description Packet should be otherwise empty.  This Database
  3459.             Description Packet should be retransmitted at intervals of
  3460.             RxmtInterval until the next state is entered (see Section
  3461.             10.8).
  3462.  
  3463.  
  3464.  State(s):  ExStart
  3465.  
  3466.     Event:  NegDone
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472. [Moy]                                                          [Page 62]
  3473.  
  3474. RFC 1247                     OSPF Version 2                    July 1991
  3475.  
  3476.  
  3477. New state:  Exchange
  3478.  
  3479.    Action:  The router must list the contents of its entire area link
  3480.             state database in the neighbor Database summary list.  The
  3481.             area link state database consists of the router links,
  3482.             network links and summary links contained in the area
  3483.             structure, along with the AS external links contained in the
  3484.             global structure.  AS external link advertisements are
  3485.             omitted from a virtual neighbor's Database summary list.  AS
  3486.             external advertisements are omitted from the Database
  3487.             summary list if the area has been configured as a stub (see
  3488.             Section 3.6).  Advertisements whose age is equal to MaxAge
  3489.             are instead added to the neighbor's Link state
  3490.             retransmission list.  A summary of the Database summary list
  3491.             will be sent to the neighbor in Database Description
  3492.             packets.  Each Database Description Packet has a sequence
  3493.             number, and is explicitly acknowledged.  Only one Database
  3494.             Description Packet is allowed outstanding at any one time.
  3495.             For more detail on the sending and receiving of Database
  3496.             Description packets, see Sections 10.8 and 10.6.
  3497.  
  3498.  
  3499.  State(s):  Exchange
  3500.  
  3501.     Event:  Exchange Done
  3502.  
  3503. New state:  Depends upon action routine.
  3504.  
  3505.    Action:  If the neighbor Link state request list is empty, the new
  3506.             neighbor state is Full.  No other action is required.  This
  3507.             is an adjacency's final state.
  3508.  
  3509.             Otherwise, the new neighbor state is Loading.  Start (or
  3510.             continue) sending Link State Request packets to the neighbor
  3511.             (see Section 10.9).  These are requests for the neighbor's
  3512.             more recent advertisements (which were discovered but not
  3513.             yet received in the Exchange state).  These advertisements
  3514.             are listed in the Link state request list associated with
  3515.             the neighbor.
  3516.  
  3517.  
  3518.  State(s):  Loading
  3519.  
  3520.     Event:  Loading Done
  3521.  
  3522. New state:  Full
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528. [Moy]                                                          [Page 63]
  3529.  
  3530. RFC 1247                     OSPF Version 2                    July 1991
  3531.  
  3532.  
  3533.    Action:  No action required.  This is an adjacency's final state.
  3534.  
  3535.  
  3536.  State(s):  2-Way
  3537.  
  3538.     Event:  AdjOK?
  3539.  
  3540. New state:  Depends upon action routine.
  3541.  
  3542.    Action:  Determine whether an adjacency should be formed with the
  3543.             neighboring router (see Section 10.4).  If not, the neighbor
  3544.             state remains at 2-Way.  Otherwise, transition the neighbor
  3545.             state to ExStart and perform the actions associated with the
  3546.             above state machine entry for state Init and event 2-Way
  3547.             Received.
  3548.  
  3549.  
  3550.  State(s):  ExStart or greater
  3551.  
  3552.     Event:  AdjOK?
  3553.  
  3554. New state:  Depends upon action routine.
  3555.  
  3556.    Action:  Determine whether the neighboring router should still be
  3557.             adjacent.  If yes, there is no state change and no further
  3558.             action is necessary.
  3559.  
  3560.             Otherwise, the (possibly partially formed) adjacency must be
  3561.             destroyed.  The neighbor state transitions to 2-Way.  The
  3562.             Link state retransmission list, Database summary list and
  3563.             Link state request list are cleared of link state
  3564.             advertisements.
  3565.  
  3566.  
  3567.  State(s):  Exchange or greater
  3568.  
  3569.     Event:  Seq Number Mismatch
  3570.  
  3571. New state:  ExStart
  3572.  
  3573.    Action:  The (possibly partially formed) adjacency is torn down, and
  3574.             then an attempt is made at reestablishment.  The neighbor
  3575.             state first transitions to ExStart.  The Link state
  3576.             retransmission list, Database summary list and Link state
  3577.             request list are cleared of link state advertisements.  Then
  3578.             the router increments the sequence number for this neighbor,
  3579.             declares itself master (sets the master/slave bit to
  3580.             master), and starts sending Database Description Packets,
  3581.  
  3582.  
  3583.  
  3584. [Moy]                                                          [Page 64]
  3585.  
  3586. RFC 1247                     OSPF Version 2                    July 1991
  3587.  
  3588.  
  3589.             with the initialize (I), more (M) and master (MS) bits set.
  3590.             This Database Description Packet should be otherwise empty
  3591.             (see Section 10.8).
  3592.  
  3593.  
  3594.  State(s):  Exchange or greater
  3595.  
  3596.     Event:  BadLSReq
  3597.  
  3598. New state:  ExStart
  3599.  
  3600.    Action:  The action for event BadLSReq is exactly the same as for the
  3601.             neighbor event SeqNumberMismatch.  The (possibly partially
  3602.             formed) adjacency is torn down, and then an attempt is made
  3603.             at reestablishment.  For more information, see the neighbor
  3604.             state machine entry that is invoked when event
  3605.             SeqNumberMismatch is generated in state Exchange or greater.
  3606.  
  3607.  
  3608.  State(s):  Any state
  3609.  
  3610.     Event:  KillNbr
  3611.  
  3612. New state:  Down
  3613.  
  3614.    Action:  The Link state retransmission list, Database summary list
  3615.             and Link state request list are cleared of link state
  3616.             advertisements.  Also, the inactivity timer is disabled.
  3617.  
  3618.  
  3619.  State(s):  Any state
  3620.  
  3621.     Event:  LLDown
  3622.  
  3623. New state:  Down
  3624.  
  3625.    Action:  The Link state retransmission list, Database summary list
  3626.             and Link state request list are cleared of link state
  3627.             advertisements.  Also, the inactivity timer is disabled.
  3628.  
  3629.  
  3630.  State(s):  Any state
  3631.  
  3632.     Event:  Inactivity Timer
  3633.  
  3634. New state:  Down
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640. [Moy]                                                          [Page 65]
  3641.  
  3642. RFC 1247                     OSPF Version 2                    July 1991
  3643.  
  3644.  
  3645.    Action:  The Link state retransmission list, Database summary list
  3646.             and Link state request list are cleared of link state
  3647.             advertisements.
  3648.  
  3649.  
  3650.  State(s):  2-Way or greater
  3651.  
  3652.     Event:  1-Way Received
  3653.  
  3654. New state:  Init
  3655.  
  3656.    Action:  The Link state retransmission list, Database summary list
  3657.             and Link state request list are cleared of link state
  3658.             advertisements.
  3659.  
  3660.  
  3661.  State(s):  2-Way or greater
  3662.  
  3663.     Event:  2-Way received
  3664.  
  3665. New state:  No state change.
  3666.  
  3667.    Action:  No action required.
  3668.  
  3669.  
  3670.  State(s):  Init
  3671.  
  3672.     Event:  1-Way received
  3673.  
  3674. New state:  No state change.
  3675.  
  3676.    Action:  No action required.
  3677.  
  3678.  
  3679. 10.4 Whether to become adjacent
  3680.  
  3681. Adjacencies are established with some subset of the router's neighbors.
  3682. Routers connected by point-to-point networks and virtual links always
  3683. become adjacent.  On multi-access networks, all routers become adjacent
  3684. to both the Designated Router and the Backup Designated Router.
  3685.  
  3686. The adjacency-forming decision occurs in two places in the neighbor
  3687. state machine.  First, when bidirectional communication is initially
  3688. established with the neighbor, and secondly, when the identity of the
  3689. attached network's (Backup) Designated Router changes.  If the decision
  3690. is made to not attempt an adjacency, the state of the neighbor
  3691. communication stops at 2-Way.
  3692.  
  3693.  
  3694.  
  3695.  
  3696. [Moy]                                                          [Page 66]
  3697.  
  3698. RFC 1247                     OSPF Version 2                    July 1991
  3699.  
  3700.  
  3701. An adjacency should be established with a (bidirectional) neighbor when
  3702. at least one of the following conditions holds:
  3703.  
  3704.  
  3705. o   The underlying network type is point-to-point
  3706.  
  3707. o   The underlying network type is virtual link
  3708.  
  3709. o   The router itself is the Designated Router
  3710.  
  3711. o   The router itself is the Backup Designated Router
  3712.  
  3713. o   The neighboring router is the Designated Router
  3714.  
  3715. o   The neighboring router is the Backup Designated Router
  3716.  
  3717.  
  3718. 10.5 Receiving Hello packets
  3719.  
  3720. This section explains the detailed processing of a received Hello
  3721. packet.  (See Section A.3.2 for the format of Hello packets.)  The
  3722. generic input processing of OSPF packets will have checked the validity
  3723. of the IP header and the OSPF packet header.  Next, the values of the
  3724. Network Mask, HelloInt, and DeadInt fields in the received Hello packet
  3725. must be checked against the values configured for the receiving
  3726. interface.  Any mismatch causes processing to stop and the packet to be
  3727. dropped.  In other words, the above fields are really describing the
  3728. attached network's configuration.  Note that the value of the Network
  3729. Mask field should not be checked in Hellos received on unnumbered serial
  3730. lines or on virtual links.
  3731.  
  3732. The receiving interface attaches to a single OSPF area (this could be
  3733. the backbone).  The setting of the E-bit found in the Hello Packet's
  3734. option field must match this area's external routing capability.  If AS
  3735. external advertisements are not flooded into/throughout the area (i.e,
  3736. the area is a "stub") the E-bit must be clear in received hellos,
  3737. otherwise the E-bit must be set.  A mismatch causes processing to stop
  3738. and the packet to be dropped.  The setting of the rest of the bits in
  3739. the Hello Packet's option field should be ignored.
  3740.  
  3741. At this point, an attempt is made to match the source of the Hello
  3742. Packet to one of the receiving interface's neighbors.  If the receiving
  3743. interface is a multi-access network (either broadcast or non-broadcast)
  3744. the source is identified by the IP source address found in the Hello's
  3745. IP header.  If the receiving interface is a point-to-point link or a
  3746. virtual link, the source is identified by the Router ID found in the
  3747. Hello's OSPF packet header.  The interface's current list of neighbors
  3748. is contained in the interface's data structure.  If a matching neighbor
  3749.  
  3750.  
  3751.  
  3752. [Moy]                                                          [Page 67]
  3753.  
  3754. RFC 1247                     OSPF Version 2                    July 1991
  3755.  
  3756.  
  3757. structure cannot be found, (i.e., this is the first time the neighbor
  3758. has been detected), one is created.  The initial state of a newly
  3759. created neighbor is set to Down.
  3760.  
  3761. When receiving an Hello Packet from a neighbor on a multi-access network
  3762. (broadcast or non-broadcast), set the neighbor structure's Neighbor ID
  3763. equal to the Router ID found in the packet's OSPF header.  When
  3764. receiving an Hello on a point-to-point network (but not on a virtual
  3765. link) set the neighbor structure's Neighbor IP address to the packet's
  3766. IP source address.
  3767.  
  3768. Now the rest of the Hello Packet is examined, generating events to be
  3769. given to the neighbor and interface state machines.  These state
  3770. machines are specified either to be executed or scheduled (see Section
  3771. 4.4).  For example, by specifying below that the neighbor state machine
  3772. be executed in line, several neighbor state transitions may be effected
  3773. by a single received Hello:
  3774.  
  3775.  
  3776. o   Each Hello Packet causes the neighbor state machine to be executed
  3777.     with the event Hello Received.
  3778.  
  3779. o   Then the list of neighbors contained in the Hello Packet is
  3780.     examined.  If the router itself appears in this list, the neighbor
  3781.     state machine should be executed with the event 2-Way Received.
  3782.     Otherwise, the neighbor state machine should be executed with the
  3783.     event 1-Way Received, and the processing of the packet stops.
  3784.  
  3785. o   Next, the Hello packet's Router Priority field is examined.  If this
  3786.     field is different than the one previously received from the
  3787.     neighbor, the receiving interface's state machine is scheduled with
  3788.     the event NeighborChange.  In any case, the Router Priority field in
  3789.     the neighbor data structure should be set accordingly.
  3790.  
  3791. o   Next the Designated Router field in the Hello Packet is examined.
  3792.     If the neighbor is both declaring itself to be Designated Router
  3793.     (Designated Router field = neighbor IP address) and the Backup
  3794.     Designated Router field in the packet is equal to 0.0.0.0 and the
  3795.     receiving interface is in state Waiting, the receiving interface's
  3796.     state machine is scheduled with the event BackupSeen.  Otherwise, if
  3797.     the neighbor is declaring itself to be Designated Router and it had
  3798.     not previously, or the neighbor is not declaring itself Designated
  3799.     Router where it had previously, the receiving interface's state
  3800.     machine is scheduled with the event NeighborChange.  In any case,
  3801.     the Designated Router item in the neighbor structure is set
  3802.     accordingly.
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808. [Moy]                                                          [Page 68]
  3809.  
  3810. RFC 1247                     OSPF Version 2                    July 1991
  3811.  
  3812.  
  3813. o   Finally, the Backup Designated Router field in the Hello Packet is
  3814.     examined.  If the neighbor is declaring itself to be Backup
  3815.     Designated Router (Backup Designated Router field = neighbor IP
  3816.     address) and the receiving interface is in state Waiting, the
  3817.     receiving interface's state machine is scheduled with the event
  3818.     BackupSeen.  Otherwise, if the neighbor is declaring itself to be
  3819.     Backup Designated Router and it had not previously, or the neighbor
  3820.     is not declaring itself Backup Designated Router where it had
  3821.     previously, the receiving interface's state machine is scheduled
  3822.     with the event NeighborChange.  In any case, the Backup Designated
  3823.     Router item in the neighbor structure is set accordingly.
  3824.  
  3825.  
  3826. 10.6 Receiving Database Description Packets
  3827.  
  3828. This section explains the detailed processing of a received Database
  3829. Description packet.  The incoming Database Description Packet has
  3830. already been associated with a neighbor and receiving interface by the
  3831. generic input packet processing (Section 8.2).  The further processing
  3832. of the Database Description Packet depends on the neighbor state.  If
  3833. the neighbor's state is Down or Attempt the packet should be ignored.
  3834. Otherwise, if the state is:
  3835.  
  3836.  
  3837. Init
  3838.     The neighbor state machine should be executed with the event 2-Way
  3839.     Received.  This causes an immediate state change to either state 2-
  3840.     Way or state Exstart.  The processing of the current packet should
  3841.     then continue in this new state.
  3842.  
  3843. 2-Way
  3844.     The packet should be ignored.  Database description packets are used
  3845.     only for the purpose of bringing up adjacencies.[7]
  3846.  
  3847. ExStart
  3848.     If the received packet matches one of the following cases, then the
  3849.     neighbor state machine should be executed with the event
  3850.     NegotiationDone (causing the state to transition to Exchange), the
  3851.     packet's Options field should be recorded in the neighbor
  3852.     structure's Neighbor Options field and the packet should be accepted
  3853.     as next in sequence and processed further (see below).  Otherwise,
  3854.     the packet should be ignored.
  3855.  
  3856.     o   The initialize(I), more (M) and master(MS) bits are set, the
  3857.         contents of the packet are empty, and the neighbor's Router ID
  3858.         is larger than the router's own.  In this case the router is now
  3859.         Slave.  Set the master/slave bit to slave, and set the sequence
  3860.         number to that specified by the master.
  3861.  
  3862.  
  3863.  
  3864. [Moy]                                                          [Page 69]
  3865.  
  3866. RFC 1247                     OSPF Version 2                    July 1991
  3867.  
  3868.  
  3869.     o   The initialize(I) and master(MS) bits are off, the packet's
  3870.         sequence number equals the router's own sequence number
  3871.         (indicating acknowledgment) and the neighbor's Router ID is
  3872.         smaller than the router's own.  In this case the router is
  3873.         Master.
  3874.  
  3875. Exchange
  3876.     If the state of the MS-bit is inconsistent with the master/slave
  3877.     state of the connection, generate the neighbor event Seq Number
  3878.     Mismatch and stop processing the packet.  Otherwise:
  3879.  
  3880.     o   If the initialize(I) bit is set, generate the neighbor event Seq
  3881.         Number Mismatch and stop processing the packet.
  3882.  
  3883.     o   If the packet's Options field indicates a different set of
  3884.         optional OSPF capabilities than were previously received from
  3885.         the neighbor (recorded in the Neighbor Options field of the
  3886.         neighbor structure), generate the neighbor event Seq Number
  3887.         Mismatch and stop processing the packet.
  3888.  
  3889.     o   If the router is master, and the packet's sequence number equals
  3890.         the router's own sequence number (this packet is the next in
  3891.         sequence) the packet should be accepted and its contents
  3892.         processed (below).
  3893.  
  3894.     o   If the router is master, and the packet's sequence number is one
  3895.         less than the router's sequence number, the packet is a
  3896.         duplicate.  Duplicates should be discarded by the master.
  3897.  
  3898.     o   If the router is slave, and the packet's sequence number is one
  3899.         more than the router's own sequence number (this packet is the
  3900.         next in sequence) the packet should be accepted and its contents
  3901.         processed (below).
  3902.  
  3903.     o   If the router is slave, and the packet's sequence number is
  3904.         equal to the router's sequence number, the packet is a
  3905.         duplicate.  The slave must respond to duplicates by repeating
  3906.         the last Database Description packet that it sent.
  3907.  
  3908.     o   Else, generate the neighbor event Seq Number Mismatch and stop
  3909.         processing the packet.
  3910.  
  3911. Loading or Full
  3912.     In this state, the router has sent and received an entire sequence
  3913.     of Database Descriptions.  The only packets received should be
  3914.     duplicates (see above).  In particular, the packet's Options field
  3915.     should match the set of optional OSPF capabilities previously
  3916.     indicated by the neighbor (stored in the neighbor structure's
  3917.  
  3918.  
  3919.  
  3920. [Moy]                                                          [Page 70]
  3921.  
  3922. RFC 1247                     OSPF Version 2                    July 1991
  3923.  
  3924.  
  3925.     neighbor Options field).  Any other packets received, including the
  3926.     reception of a packet with the Initialize(I) bit set, should
  3927.     generate the neighbor event Seq Number Mismatch.[8] Duplicates
  3928.     should be discarded by the master.  The slave must respond to
  3929.     duplicates by repeating the last Database Description packet that it
  3930.     sent.
  3931.  
  3932.  
  3933. When the router accepts a received Database Description Packet as the
  3934. next in sequence the packet contents are processed as follows.  For each
  3935. link state advertisement listed, the advertisement's LS type is checked
  3936. for validity.  If the LS type is unknown (e.g., not one of the LS types
  3937. 1-5 defined by this specification), or if this is a AS external
  3938. advertisement (LS type = 5) and the neighbor is associated with a stub
  3939. area, generate the neighbor event Seq Number Mismatch and stop
  3940. processing the packet.  Otherwise, the router looks up the advertisement
  3941. in its database to see whether it also has an instance of the link state
  3942. advertisement.  If it does not, or if the database copy is less recent
  3943. (see Section 13.1), the link state advertisement is put on the Link
  3944. state request list so that it can be requested (immediately or at some
  3945. later time) in Link State Request Packets.
  3946.  
  3947. When the router accepts a received Database Description Packet as the
  3948. next in sequence, it also performs the following actions, depending on
  3949. whether it is master or slave:
  3950.  
  3951.  
  3952. Master
  3953.     Increments the sequence number.  If the router has already sent its
  3954.     entire sequence of Database Descriptions, and the just accepted
  3955.     packet has the more bit (M) set to 0, the neighbor event Exchange
  3956.     Done is generated.  Otherwise, it should send a new Database
  3957.     Description to the slave.
  3958.  
  3959. Slave
  3960.     Sets the sequence number to the sequence number appearing in the
  3961.     received packet.  The slave must send a Database Description in
  3962.     reply.  If the received packet has the more bit (M) set to 0, and
  3963.     the packet to be sent by the slave will have the M-bit set to 0
  3964.     also, the neighbor event Exchange Done is generated.  Note that the
  3965.     slave always generates this event before the master.
  3966.  
  3967.  
  3968. 10.7 Receiving Link State Request Packets
  3969.  
  3970. This section explains the detailed processing of received Link State
  3971. Request packets.  Received Link State Request Packets specify a list of
  3972. link state advertisements that the neighbor wishes to receive.  Link
  3973.  
  3974.  
  3975.  
  3976. [Moy]                                                          [Page 71]
  3977.  
  3978. RFC 1247                     OSPF Version 2                    July 1991
  3979.  
  3980.  
  3981. state Request Packets should be accepted when the neighbor is in states
  3982. Exchange, Loading, or Full.  In all other states Link State Request
  3983. Packets should be ignored.
  3984.  
  3985. Each link state advertisement specified in the Link State Request packet
  3986. should be located in the router's database, and copied into Link State
  3987. Update packets for transmission to the neighbor.  These link state
  3988. advertisements should NOT be placed on the Link state retransmission
  3989. list for the neighbor.  If a link state advertisement cannot be found in
  3990. the database, something has gone wrong with the synchronization
  3991. procedure, and neighbor event BadLSReq should be generated.
  3992.  
  3993.  
  3994. 10.8 Sending Database Description Packets
  3995.  
  3996. This section describes how Database Description Packets are sent to a
  3997. neighbor.  The router's optional OSPF capabilities (see Section 4.5) are
  3998. transmitted to the neighbor in the Options field of the Database
  3999. Description packet.  The router should maintain the same set of optional
  4000. capabilities throughout the Database Exchange and flooding procedures.
  4001. If for some reason the router's optional capabilities change, the
  4002. Database Exchange procedure should be restarted by reverting to neighbor
  4003. state ExStart.  There are currently two optional capabilities defined.
  4004. The T-bit should be set if and only if the router is capable of
  4005. calculating separate routes for each IP TOS.  The E-bit should be set if
  4006. and only if the attached network belongs to a non-stub area.  The rest
  4007. of the Options field should be set to zero.
  4008.  
  4009. The sending of Database Description packets depends on the neighbor's
  4010. state.  In state ExStart the router sends empty Database Description
  4011. packets, with the initialize (I), more (M) and master (MS) bits set.
  4012. These packets are retransmitted every RxmtInterval seconds.
  4013.  
  4014. In state Exchange the Database Description Packets actually contain
  4015. summaries of the link state information contained in the router's
  4016. database.  Each link state advertisement in the area's topological
  4017. database (at the time the neighbor transitions into Exchange state) is
  4018. listed in the neighbor Database summary list.  When a new Database
  4019. Description Packet is to be sent, the packet's sequence number is
  4020. incremented, and the (new) top of the Database summary list is described
  4021. by the packet.  Items are removed from the Database summary list when
  4022. the previous packet is acknowledged.
  4023.  
  4024. In state Exchange, the determination of when to send a packet depends on
  4025. whether the router is master or slave:
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032. [Moy]                                                          [Page 72]
  4033.  
  4034. RFC 1247                     OSPF Version 2                    July 1991
  4035.  
  4036.  
  4037. Master
  4038.     Packets are sent when either a) the slave acknowledges the previous
  4039.     packet by echoing the sequence number or b) RxmtInterval seconds
  4040.     elapse without an acknowledgment, in which case the previous packet
  4041.     is retransmitted.
  4042.  
  4043. Slave
  4044.     Packets are sent only in response to packets received from the
  4045.     master.  If the packet received from the master is new, a new packet
  4046.     is sent, otherwise the previous packet is resent.
  4047.  
  4048.  
  4049. In states Loading and Full the slave must resend its last packet in
  4050. response to duplicate packets received from the master.  For this reason
  4051. the slave must wait RouterDeadInterval seconds before freeing the last
  4052. packet.  Reception of a packet from the master after this interval will
  4053. generate a Seq Number Mismatch neighbor event.
  4054.  
  4055.  
  4056. 10.9 Sending Link State Request Packets
  4057.  
  4058. In neighbor states Exchange or Loading, the Link state request list
  4059. contains a list of those link state advertisements that need to be
  4060. obtained from the neighbor.  To request these advertisements, a router
  4061. sends the neighbor the beginning of the Link state request list,
  4062. packaged in a Link State Request packet.
  4063.  
  4064. When the neighbor responds to these requests with the proper Link State
  4065. Update packet(s), the Link state request list is truncated and a new
  4066. Link State Request packet is sent.  This process continues until the
  4067. link state request list becomes empty.  Unsatisfied Link State Requests
  4068. are retransmitted at intervals of RxmtInterval.  There should be at most
  4069. one Link State Request packet outstanding at any one time.
  4070.  
  4071. When the Link state request list becomes empty, and the neighbor state
  4072. is Loading (i.e., a complete sequence of Database Description packets
  4073. has been received from the neighbor), the Loading Done neighbor event is
  4074. generated.
  4075.  
  4076.  
  4077. 10.10 An Example
  4078.  
  4079. Figure 14 shows an example of an adjacency forming.  Routers RT1 and RT2
  4080. are both connected to a broadcast network.  It is assumed that RT2 is
  4081. the Designated Router for the network, and that RT2 has a higher Router
  4082. ID that router RT1.
  4083.  
  4084. The neighbor state changes realized by each router are listed on the
  4085.  
  4086.  
  4087.  
  4088. [Moy]                                                          [Page 73]
  4089.  
  4090. RFC 1247                     OSPF Version 2                    July 1991
  4091.  
  4092.  
  4093. sides of the figure.
  4094.  
  4095.  
  4096. At the beginning of Figure 14, router RT1's interface to the network
  4097. becomes operational.  It begins sending hellos, although it doesn't know
  4098. the identity of the Designated Router or of any other neighboring
  4099. routers.  Router RT2 hears this hello (moving the neighbor to Init
  4100. state), and in its next hello indicates that it is itself the Designated
  4101. Router and that it has heard hellos from RT1.  This in turn causes RT1
  4102. to go to state ExStart, as it starts to bring up the adjacency.
  4103.  
  4104. RT1 begins by asserting itself as the master.  When it sees that RT2 is
  4105. indeed the master (because of RT2's higher Router ID), RT1 transitions
  4106. to slave state and adopts its neighbor's sequence number.  Database
  4107. Description packets are then exchanged, with polls coming from the
  4108. master (RT2) and responses from the slave (RT1).  This sequence of
  4109. Database Description Packets ends when both the poll and associated
  4110. response has the M-bit off.
  4111.  
  4112. In this example, it is assumed that RT2 has a completely up to date
  4113. database.  In that case, RT2 goes immediately into Full state.  RT1 will
  4114. go into Full state after updating the necessary parts of its database.
  4115. This is done by sending Link State Request Packets, and receiving Link
  4116. State Update Packets in response.  Note that, while RT1 has waited until
  4117. a complete set of Database Description Packets has been received (from
  4118. RT2) before sending any Link State Request Packets, this need not be the
  4119. case.  RT1 could have interleaved the sending of Link State Request
  4120. Packets with the reception of Database Description Packets.
  4121.  
  4122.  
  4123. 11. The Routing Table Structure
  4124.  
  4125. The routing table data structure contains all the information necessary
  4126. to forward an IP data packet toward its destination.  Each routing table
  4127. entry describes the collection of best paths to a particular
  4128. destination.  When forwarding an IP data packet, the routing table entry
  4129. providing the best match for the packet's IP destination is located.
  4130.  
  4131.  
  4132.                 ________________________________________
  4133.  
  4134.                  (Figure not included in text version.)
  4135.  
  4136.                 Figure 14: An adjacency bring-up example
  4137.                 ________________________________________
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144. [Moy]                                                          [Page 74]
  4145.  
  4146. RFC 1247                     OSPF Version 2                    July 1991
  4147.  
  4148.  
  4149. The matching routing table entry then provides the next hop towards the
  4150. packet's destination.  OSPF also provides for the existence of a default
  4151. route (Destination ID = DefaultDestination).  When the default route
  4152. exists, it matches all IP destinations (although any other matching
  4153. entry is a better match).  Finding the routing table entry that best
  4154. matches an IP destination is further described in Section 11.1.
  4155.  
  4156. There is a single routing table in each router.  Two sample routing
  4157. tables are described in Sections 11.2 and 11.3.  The building of the
  4158. routing table is discussed in Section 16.
  4159.  
  4160. The rest of this section defines the fields found in a routing table
  4161. entry.  The first set of fields describes the routing table entry's
  4162. destination.
  4163.  
  4164.  
  4165. Destination Type
  4166.     The destination can be one of three types.  Only the first type,
  4167.     Network, is actually used when forwarding IP data traffic.  The
  4168.     other destinations are used solely as intermediate steps in the
  4169.     routing table build process.
  4170.  
  4171.     Network
  4172.         A range of IP addresses, to which IP data traffic may be
  4173.         forwarded.  This includes IP networks (class A, B, or C), IP
  4174.         subnets, and single IP hosts.  The default route also falls in
  4175.         this category.
  4176.  
  4177.     Area border router
  4178.         Routers that are connected to multiple OSPF areas.  Such routers
  4179.         originate summary link advertisements.  These routing table
  4180.         entries are used when calculating the inter-area routes (see
  4181.         Section 16.2).  These routing table entries may also be
  4182.         associated with configured virtual links.
  4183.  
  4184.     AS boundary router
  4185.         Routers that originate AS external link advertisements.  These
  4186.         routing table entries are used when calculating the AS external
  4187.         routes (see Section 16.4).
  4188.  
  4189. Destination ID
  4190.     The destination's identifier or name.  This depends on the
  4191.     destination's type.  For networks, the identifier is their
  4192.     associated IP address.  For all other types, the identifier is the
  4193.     OSPF Router ID.[9]
  4194.  
  4195. Address Mask
  4196.     Only defined for networks.  The network's IP address together with
  4197.  
  4198.  
  4199.  
  4200. [Moy]                                                          [Page 75]
  4201.  
  4202. RFC 1247                     OSPF Version 2                    July 1991
  4203.  
  4204.  
  4205.     its address mask defines a range of IP addresses.  For IP subnets,
  4206.     the address mask is referred to as the subnet mask.  For host
  4207.     routes, the mask is "all ones" (0xffffffff).
  4208.  
  4209. Optional Capabilities
  4210.     When the destination is a router (either an area border router or an
  4211.     AS boundary router) this field indicates the optional OSPF
  4212.     capabilities supported by the destination router.  The two optional
  4213.     capabilities currently defined by this specification are the ability
  4214.     to route based on IP TOS and the ability to process AS external
  4215.     advertisements.  For a further discussion of OSPF's optional
  4216.     capabilities, see Section 4.5.
  4217.  
  4218.  
  4219. The set of paths to use for a destination may vary based on IP Type of
  4220. Service and the OSPF area to which the paths belong.  This means that
  4221. there may be multiple routing table entries for the same destination,
  4222. depending on the values of the next two fields.
  4223.  
  4224.  
  4225. Type of Service
  4226.     There can be a separate set of routes for each IP Type of Service.
  4227.     The encoding of TOS in OSPF link state advertisements is described
  4228.     in Section 12.3.
  4229.  
  4230. Area
  4231.     This field indicates the area whose link state information has led
  4232.     to the routing table entry's collection of paths.  This is called
  4233.     the entry's associated area.  For sets of AS external paths, this
  4234.     field is not defined.  For destinations of type "area border
  4235.     router", there may be separate sets of paths (and therefore separate
  4236.     routing table entries) associated with each of several areas.  This
  4237.     will happen when two area border routers share multiple areas in
  4238.     common.  For all other destination types, only the set of paths
  4239.     associated with the best area (the one providing the shortest route)
  4240.     is kept.
  4241.  
  4242.  
  4243. The rest of the routing table entry describes the set of paths to the
  4244. destination.  The following fields pertain to the set of paths as a
  4245. whole.  In other words, each one of the paths contained in a routing
  4246. table entry is of the same path-type and cost (see below).
  4247.  
  4248.  
  4249. Path-type
  4250.     There are four possible types of paths used to route traffic to the
  4251.     destination, listed here in order of preference: intra-area, inter-
  4252.     area, type 1 external or type 2 external.  Intra-area paths indicate
  4253.  
  4254.  
  4255.  
  4256. [Moy]                                                          [Page 76]
  4257.  
  4258. RFC 1247                     OSPF Version 2                    July 1991
  4259.  
  4260.  
  4261.     destinations belonging to one of the router's attached areas.
  4262.     Inter-area paths are paths to destinations in other OSPF areas.
  4263.     These are discovered through the examination of received summary
  4264.     link advertisements.  AS external paths are paths to destinations
  4265.     external to the AS.  These are detected through the examination of
  4266.     received AS external link advertisements.
  4267.  
  4268. Cost
  4269.     The link state cost of the path to the destination.  For all paths
  4270.     except type 2 external paths this describes the entire path's cost.
  4271.     For Type 2 external paths, this field describes the cost of the
  4272.     portion of the path internal to the AS.  This cost is calculated as
  4273.     the sum of the costs of the path's constituent links.
  4274.  
  4275. Type 2 cost
  4276.     Only valid for type 2 external paths.  For these paths, this field
  4277.     indicates the cost of the path's external portion.  This cost has
  4278.     been advertised by an AS boundary router, and is the most
  4279.     significant part of the total path cost.  For example, an external
  4280.     type 2 path with type 2 cost of 5 is always preferred over a path
  4281.     with type 2 cost of 10, regardless of the cost of the two paths'
  4282.     internal components.
  4283.  
  4284. Link State Origin
  4285.     Valid only for intra-area paths, this field indicates the link state
  4286.     advertisement (router links or network links) that directly
  4287.     references the destination.  For example, if the destination is a
  4288.     transit network, this is the transit network's network links
  4289.     advertisement.  If the destination is a stub network, this is the
  4290.     router links advertisement for the attached router.  The
  4291.     advertisement is discovered during the shortest-path tree
  4292.     calculation (see Section 16.1).  Multiple advertisements may
  4293.     reference the destination, however a tie-breaking scheme always
  4294.     reduces the choice to a single advertisement.
  4295.  
  4296.     This field is for informational purposes only.  The advertisement
  4297.     could be used as a root for an SPF calculation when building a
  4298.     reverse path forwarding tree.  This is beyond the scope of this
  4299.     specification.
  4300.  
  4301.  
  4302. When multiple paths of equal path-type and cost exist to a destination
  4303. (called elsewhere "equal-cost" paths), they are stored in a single
  4304. routing table entry.  Each one of the "equal-cost" paths is
  4305. distinguished by the following fields:
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312. [Moy]                                                          [Page 77]
  4313.  
  4314. RFC 1247                     OSPF Version 2                    July 1991
  4315.  
  4316.  
  4317. Next hop
  4318.     The outgoing router interface to use when forwarding traffic to the
  4319.     destination.  On multi-access networks, the next hop also includes
  4320.     the IP address of the next router (if any) in the path towards the
  4321.     destination.  This next router will always be one of the adjacent
  4322.     neighbors.
  4323.  
  4324. Advertising router
  4325.     Valid only for inter-area and AS external paths.  This field
  4326.     indicates the Router ID of the router advertising the summary link
  4327.     or AS external link that led to this path.
  4328.  
  4329.  
  4330. 11.1 Routing table lookup
  4331.  
  4332. When an IP data packet is received, an OSPF router finds the routing
  4333. table entry that best matches the packet's destination. This routing
  4334. table entry then provides the outgoing interface and next hop router to
  4335. use in forwarding the packet. This section describes the process of
  4336. finding the best matching routing table entry. The process consists of a
  4337. number of steps, wherein the collection of routing table entries is
  4338. progressively pruned. In the end, the single routing table entry
  4339. remaining is the called best match.
  4340.  
  4341. Note that the steps described below may fail to produce a best match
  4342. routing table entry (i.e., all existing routing table entries are pruned
  4343. for some reason or another). In this case, the packet's IP destination
  4344. is considered unreachable. Instead of being forwarded, the packet should
  4345. be dropped and an ICMP destination unreachable message should be
  4346. returned to the packet's source.
  4347.  
  4348.  
  4349. (1) Select the complete set of "matching" routing table entries from the
  4350.     routing table.  Each routing table entry describes a (set of)
  4351.     path(s) to a range of IP addresses. If the data packet's IP
  4352.     destination falls into an entry's range of IP addresses, the routing
  4353.     table entry is called a match. (It is quite likely that multiple
  4354.     entries will match the data packet.  For example, a default route
  4355.     will match all packets.)
  4356.  
  4357. (2) Suppose that the packet's IP destination falls into one of the
  4358.     router's configured area address ranges (see Section 3.5), and that
  4359.     the particular area address range is active. This means that there
  4360.     are one or more reachable (by intra-area paths) networks contained
  4361.     in the area address range. The packet's IP destination is then
  4362.     required to belong to one of these constituent networks. For this
  4363.     reason, only matching routing table entries with path-type of
  4364.     intra-area are considered (all others are pruned). If no such
  4365.  
  4366.  
  4367.  
  4368. [Moy]                                                          [Page 78]
  4369.  
  4370. RFC 1247                     OSPF Version 2                    July 1991
  4371.  
  4372.  
  4373.     matching entries exist, the destination is unreachable (see above).
  4374.     Otherwise, skip to step 4.
  4375.  
  4376. (3) Reduce the set of matching entries to those having the most
  4377.     preferential path-type (see Section 11). OSPF has a four level
  4378.     hierarchy of paths. Intra-area paths are the most preferred,
  4379.     followed in order by inter-area, Type 1 external and Type 2 external
  4380.     paths.
  4381.  
  4382. (4) Select the remaining routing table entry that provides the longest
  4383.     (most specific) match. Another way of saying this is to choose the
  4384.     remaining entry that specifies the narrowest range of IP
  4385.     addresses.[10] For example, the entry for the address/mask pair of
  4386.     (128.185.1.0, 0xffffff00) is more specific than an entry for the
  4387.     pair (128.185.0.0, 0xffff0000). The default route is the least
  4388.     specific match, since it matches all destinations.
  4389.  
  4390. (5) At this point, there may still be multiple routing table entries
  4391.     remaining. Each routing entry will specify the same range of IP
  4392.     addresses, but a different IP Type of Service. Select the routing
  4393.     table entry whose TOS value matches the TOS found in the packet
  4394.     header. If there is no routing table entry for this TOS, select the
  4395.     routing table entry for TOS 0. In other words, packets requesting
  4396.     TOS X are routed along the TOS 0 path if a TOS X path does not
  4397.     exist.
  4398.  
  4399.  
  4400. 11.2 Sample routing table, without areas
  4401.  
  4402. Consider the Autonomous System pictured in Figure 2.  No OSPF areas have
  4403. been configured.  A single metric is shown per outbound interface,
  4404. indicating that routes will not vary based on TOS.  The calculation
  4405. router RT6's routing table proceeds as described in Section 2.1.  The
  4406. resulting routing table is shown in Table 12.  Destination types are
  4407. abbreviated: Network as "N", area border router as "BR" and AS boundary
  4408. router as "ASBR".
  4409.  
  4410. There are no instances of multiple equal-cost shortest paths in this
  4411. example.  Also, since there are no areas, there are no inter-area paths.
  4412.  
  4413. Routers RT5 and RT7 are AS boundary routers.  Intra-area routes have
  4414. been calculated to routers RT5 and RT7.  This allows external routes to
  4415. be calculated to the destinations advertised by RT5 and RT7 (i.e.,
  4416. networks N12, N13, N14 and N15).  It is assumed all AS external
  4417. advertisements originated by RT5 and RT7 are advertising type 1 external
  4418. metrics.  This results in type 1 external paths being calculated to
  4419. destinations N12-N15.
  4420.  
  4421.  
  4422.  
  4423.  
  4424. [Moy]                                                          [Page 79]
  4425.  
  4426. RFC 1247                     OSPF Version 2                    July 1991
  4427.  
  4428.  
  4429. 11.3 Sample routing table, with areas
  4430.  
  4431. Consider the previous example, this time split into OSPF areas.  An OSPF
  4432. area configuration is pictured in Figure 6.  Router RT4's routing table
  4433. will be described for this area configuration.  Router RT4 has a
  4434. connection to Area 1 and a backbone connection.  This causes Router RT4
  4435. to view the AS as the concatenation of the two graphs shown in Figures 7
  4436. and 8.  The resulting routing table is displayed in Table 13.
  4437.  
  4438. Again, routers RT5 and RT7 are AS boundary routers.  Routers RT3, RT4,
  4439. RT7, RT10 and RT11 are area border routers.  Note that there are two
  4440. routing entries (in this case having identical paths) for router RT7, in
  4441. its dual capacities as an area border router and an AS boundary router.
  4442. Note also that there are two routing entries for the area border router
  4443. RT3, since it has two areas in common with RT4 (Area 1 and the
  4444. backbone).
  4445.  
  4446. Backbone paths have been calculated to all area border routers (BR).
  4447. These are used when determining the inter-area routes.  Note that all of
  4448.  
  4449.  
  4450. Type   Dest   Area   Path  Type        Cost   Next Hop(s)   Adv. Router(s)
  4451. __________________________________________________________________________
  4452. N      N1     0      intra-area        10     RT3           *
  4453. N      N2     0      intra-area        10     RT3           *
  4454. N      N3     0      intra-area        7      RT3           *
  4455. N      N4     0      intra-area        8      RT3           *
  4456. N      Ib     0      intra-area        7      *             *
  4457. N      Ia     0      intra-area        12     RT10          *
  4458. N      N6     0      intra-area        8      RT10          *
  4459. N      N7     0      intra-area        12     RT10          *
  4460. N      N8     0      intra-area        10     RT10          *
  4461. N      N9     0      intra-area        11     RT10          *
  4462. N      N10    0      intra-area        13     RT10          *
  4463. N      N11    0      intra-area        14     RT10          *
  4464. N      H1     0      intra-area        21     RT10          *
  4465. ASBR   RT5    0      intra-area        6      RT5           *
  4466. ASBR   RT7    0      intra-area        8      RT10          *
  4467. __________________________________________________________________________
  4468. N      N12    *      type 1 external   10     RT10          RT7
  4469. N      N13    *      type 1 external   14     RT5           RT5
  4470. N      N14    *      type 1 external   14     RT5           RT5
  4471. N      N15    *      type 1 external   17     RT10          RT7
  4472.  
  4473.  
  4474.    Table 12: The routing table for Router RT6 (no configured areas).
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480. [Moy]                                                          [Page 80]
  4481.  
  4482. RFC 1247                     OSPF Version 2                    July 1991
  4483.  
  4484.  
  4485. the inter-area routes are associated with the backbone; this is always
  4486. the case when the router is itself an area border router.  Routing
  4487. information is condensed at area boundaries.  In this example, we assume
  4488. that Area 3 has been defined so that networks N9-N11 and the host route
  4489. to H1 are all condensed to a single route when advertised to the
  4490. backbone (by router RT11).  Note that the cost of this route is the
  4491. minimum of the set of costs to its individual components.
  4492.  
  4493. There is a virtual link configured between routers RT10 and RT11.
  4494. Without this configured virtual link, RT11 would be unable to advertise
  4495. a route for networks N9-N11 and host H1 into the backbone, and there
  4496. would not be an entry for these networks in router RT4's routing table.
  4497.  
  4498. In this example there are two equal-cost paths to network N12.  However,
  4499. they both use the same next hop (Router RT5).
  4500.  
  4501.  
  4502.  
  4503. Router RT4's routing table would improve (i.e., some of the paths in the
  4504. routing table would become shorter) if an additional virtual link were
  4505. configured between router RT4 and router RT3.  The new virtual link
  4506. would itself be associated with the first entry for area border router
  4507. RT3 in Table 13 (an intra-area path through Area 1).  This would yield a
  4508. cost of 1 for the virtual link.  The routing table entries changes that
  4509. would be caused by the addition of this virtual link are shown in Table
  4510. 14.
  4511.  
  4512.  
  4513.  
  4514. 12. Link State Advertisements
  4515.  
  4516. Each router in the Autonomous System originates one or more link state
  4517. advertisements.  There are five distinct types of link state
  4518. advertisements, which are described in Section 4.3.  The collection of
  4519. link state advertisements forms the link state or topological database.
  4520. Each separate type of advertisement has a separate function.  Router
  4521. links and network links advertisements describe how an area's routers
  4522. and networks are interconnected.  Summary link advertisements provide a
  4523. way of condensing an area's routing information.  AS external
  4524. advertisements provide a way of transparently advertising externally-
  4525. derived routing information throughout the Autonomous System.
  4526.  
  4527. Each link state advertisement begins with a standard 20-byte header.
  4528. This link state header is discussed below.
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536. [Moy]                                                          [Page 81]
  4537.  
  4538. RFC 1247                     OSPF Version 2                    July 1991
  4539.  
  4540.  
  4541.  
  4542.  
  4543. Type   Dest        Area   Path  Type        Cost   Next Hop(s)   Adv. Router(s)
  4544. _______________________________________________________________________________
  4545. N      N1          1      intra-area        4      RT1           *
  4546. N      N2          1      intra-area        4      RT2           *
  4547. N      N3          1      intra-area        1      *             *
  4548. N      N4          1      intra-area        3      RT3           *
  4549. BR     RT3         1      intra-area        1      *             *
  4550. _______________________________________________________________________________
  4551. N      Ib          0      intra-area        22     RT5           *
  4552. N      Ia          0      intra-area        27     RT5           *
  4553. BR     RT3         0      intra-area        21     RT5           *
  4554. BR     RT7         0      intra-area        14     RT5           *
  4555. BR     RT10        0      intra-area        22     RT5           *
  4556. BR     RT11        0      intra-area        25     RT5           *
  4557. ASBR   RT5         0      intra-area        8      *             *
  4558. ASBR   RT7         0      intra-area        14     RT5           *
  4559. _______________________________________________________________________________
  4560. N      N6          0      inter-area        15     RT5           RT7
  4561. N      N7          0      inter-area        19     RT5           RT7
  4562. N      N8          0      inter-area        18     RT5           RT7
  4563. N      N9-N11,H1   0      inter-area        26     RT5           RT11
  4564. _______________________________________________________________________________
  4565. N      N12         *      type 1 external   16     RT5           RT5,RT7
  4566. N      N13         *      type 1 external   16     RT5           RT5
  4567. N      N14         *      type 1 external   16     RT5           RT5
  4568. N      N15         *      type 1 external   23     RT5           RT7
  4569.  
  4570.  
  4571.      Table 13: Router RT4's routing table in the presence of areas.
  4572.  
  4573.  
  4574. Type   Dest        Area   Path  Type   Cost   Next Hop(s)   Adv. Router(s)
  4575. __________________________________________________________________________
  4576. N      Ib          0      intra-area   16     RT3           *
  4577. N      Ia          0      intra-area   21     RT3           *
  4578. BR     RT3         0      intra-area   1      *             *
  4579. BR     RT10        0      intra-area   16     RT3           *
  4580. BR     RT11        0      intra-area   19     RT3           *
  4581. __________________________________________________________________________
  4582. N      N9-N11,H1   0      inter-area   20     RT3           RT11
  4583.  
  4584.  
  4585.       Table 14: Changes resulting from an additional virtual link.
  4586.  
  4587. 12.1 The Link State Header
  4588.  
  4589.  
  4590.  
  4591.  
  4592. [Moy]                                                          [Page 82]
  4593.  
  4594. RFC 1247                     OSPF Version 2                    July 1991
  4595.  
  4596.  
  4597. The link state header contains the LS type, Link State ID and
  4598. Advertising Router fields.  The combination of these three fields
  4599. uniquely identifies the link state advertisement.
  4600.  
  4601. There may be several instances of an advertisement present in the
  4602. Autonomous System, all at the same time.  It must then be determined
  4603. which instance is more recent.  This determination is made be examining
  4604. the LS sequence, LS checksum and LS age fields.  These fields are also
  4605. contained in the 20-byte link state header.
  4606.  
  4607. Several of the OSPF packet types list link state advertisements.  When
  4608. the instance is not important, an advertisement is referred to by its LS
  4609. type, Link State ID and Advertising Router (see Link State Request
  4610. Packets).  Otherwise, the LS sequence number, LS age and LS checksum
  4611. fields must also be referenced.
  4612.  
  4613. A detailed explanation of the fields contained in the link state header
  4614. follows.
  4615.  
  4616.  
  4617. 12.1.1 LS age
  4618.  
  4619. This field is the age of the link state advertisement in seconds.  It
  4620. should be processed as an unsigned 16-bit integer.  It is set to 0 when
  4621. the link state advertisement is originated.  It must be incremented by
  4622. InfTransDelay on every hop of the flooding procedure.  Link state
  4623. advertisements are also aged as they are held in each router's database.
  4624.  
  4625. The age of a link state advertisement is never incremented past MaxAge.
  4626. Advertisements having age MaxAge are not used in the routing table
  4627. calculation.  When an advertisement's age first reaches MaxAge, it is
  4628. reflooded.  A link state advertisement of age MaxAge is finally flushed
  4629. from the database when it is no longer contained on any neighbor Link
  4630. state retransmission lists.  This indicates that it has been
  4631. acknowledged by all adjacent neighbors.  For more information on the
  4632. aging of link state advertisements, consult Section 14.
  4633.  
  4634. Ages are examined when a router receives two instances of a link state
  4635. advertisement, both having identical sequence numbers and checksums.  An
  4636. instance of age MaxAge is then always accepted as most recent; this
  4637. allows old advertisements to be flushed quickly from the routing domain.
  4638. Otherwise, if the ages differ by more than MaxAgeDiff, the instance
  4639. having the smaller age is accepted as most recent.[11] See Section 13.1
  4640. for more details.
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648. [Moy]                                                          [Page 83]
  4649.  
  4650. RFC 1247                     OSPF Version 2                    July 1991
  4651.  
  4652.  
  4653. 12.1.2 Options
  4654.  
  4655. The options field in the link state header indicates which optional
  4656. capabilities are associated with the advertisement.  OSPF's optional
  4657. capabilities are described in Section 4.5.  There are currently two
  4658. optional capabilities defined; they are represented by the T-bit and E-
  4659. bit found in the options field.  The rest of the options field should be
  4660. set to zero.
  4661.  
  4662. The E-bit represents OSPF's external routing capability.  This bit
  4663. should be set in all advertisements associated with the backbone, and
  4664. all advertisements associated with non-stub areas (see Section 3.6).  It
  4665. should also be set in all AS external advertisements.  It should be
  4666. reset in all router links, network links and summary link advertisements
  4667. associated with a stub area.  For all link state advertisements, the
  4668. setting of the E-bit is for informational purposes only; it does not
  4669. affect the routing table calculation.
  4670.  
  4671. The T-bit represents OSPF's TOS routing capability.  This bit should be
  4672. set in a router links advertisement if and only if the router is capable
  4673. of calculating separate routes for each IP TOS (see Section 2.4).  The
  4674. T-bit should always be set in network links advertisements.  It should
  4675. be set in summary link and AS external link advertisements if and only
  4676. if the advertisement describes paths for all TOS values, instead of just
  4677. the TOS 0 path.  Note that, with the T-bit set, there may still be only
  4678. a single metric in the advertisement (the TOS 0 metric).  This would
  4679. mean that paths for non-zero TOS exist, but are equivalent to the TOS 0
  4680. path.  A link state advertisement's T-bit is examined when calculating
  4681. the routing table's non-zero TOS paths (see Section 16.9).
  4682.  
  4683.  
  4684. 12.1.3 LS type
  4685.  
  4686. The LS type field dictates the format and function of the link state
  4687. advertisement.  Advertisements of different types have different names
  4688. (e.g., router links or network links).  All advertisement types, except
  4689. the AS external link advertisements (LS type = 5), are flooded
  4690. throughout a single area only.  AS external link advertisements are
  4691. flooded throughout the entire Autonomous System, excluding stub areas
  4692. (see Section 3.6).  Each separate advertisement type is briefly
  4693. described below in Table 15.
  4694.  
  4695.  
  4696.            LS Type   Advertisement description
  4697.            __________________________________________________
  4698.            1         These are the router links
  4699.                      advertisements. They describe the
  4700.  
  4701.  
  4702.  
  4703.  
  4704. [Moy]                                                          [Page 84]
  4705.  
  4706. RFC 1247                     OSPF Version 2                    July 1991
  4707.  
  4708.  
  4709.            LS Type   Advertisement description
  4710.            __________________________________________________
  4711.                      collected states of the router's
  4712.                      interfaces. For more information,
  4713.                      consult Section 12.4.1.
  4714.            __________________________________________________
  4715.            2         These are the network links
  4716.                      advertisements. They describe the set
  4717.                      of routers attached to the network. For
  4718.                      more information, consult
  4719.                      Section 12.4.2.
  4720.            __________________________________________________
  4721.            3 or 4    These are the summary link
  4722.                      advertisements. They describe
  4723.                      inter-area routes, and enable the
  4724.                      condensation of routing information at
  4725.                      area borders. Originated by area border
  4726.                      routers, the Type 3 advertisements
  4727.                      describe routes to networks while the
  4728.                      Type 4 advertisements describe routes to
  4729.                      AS boundary routers.
  4730.            __________________________________________________
  4731.            5         These are the AS external link
  4732.                      advertisements. Originated by AS
  4733.                      boundary routers, they describe routes
  4734.                      to destinations external to the
  4735.                      Autonomous System. A default route for
  4736.                      the Autonomous System can also be
  4737.                      described by an AS external link
  4738.                      advertisement.
  4739.  
  4740.  
  4741.                Table 15: OSPF link state advertisements.
  4742.  
  4743.  
  4744. 12.1.4 Link State ID
  4745.  
  4746. This field identifies the piece of the routing domain that is being
  4747. described by the advertisement.  Depending on the advertisement's LS
  4748. type, the Link State ID takes on the values listed in Table 16.
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760. [Moy]                                                          [Page 85]
  4761.  
  4762. RFC 1247                     OSPF Version 2                    July 1991
  4763.  
  4764.  
  4765.  
  4766.    LS Type   Link State ID
  4767.    ______________________________________________________________________
  4768.    1         The originating router's Router ID.
  4769.    2         The IP interface address of the network's Designated Router.
  4770.    3         The destination network's IP address.
  4771.    4         The Router ID of the described AS boundary router.
  4772.    5         The destination network's IP address.
  4773.  
  4774.  
  4775.                 Table 16: The advertisement's Link State ID.
  4776.  
  4777.  
  4778. When the link state advertisement is describing a network, the Link
  4779. State ID is either the network's IP address (as in type 3 summary link
  4780. advertisements and in AS external link advertisements) or the network's
  4781. IP address is easily derivable from the Link State ID (note that masking
  4782. a network links advertisement's Link State ID with the network's subnet
  4783. mask yields the network's IP address).  When the link state
  4784. advertisement is describing a router, the Link State ID is always the
  4785. described router's OSPF Router ID.
  4786.  
  4787. When an AS external advertisement (LS Type = 5) is describing a default
  4788. route, its Link State ID is set to DefaultDestination (0.0.0.0).
  4789.  
  4790.  
  4791. 12.1.5 Advertising Router
  4792.  
  4793. This field specifies the OSPF Router ID of the advertisement's
  4794. originator.  For router links advertisements, this field is identical to
  4795. the Link State ID field.  Network link advertisements are originated by
  4796. the network's Designated Router.  Summary link advertisements are
  4797. originated by area border routers.  Finally, AS external link
  4798. advertisements are originated by AS boundary routers.
  4799.  
  4800.  
  4801. 12.1.6 LS sequence number
  4802.  
  4803. The sequence number field is a signed 32-bit integer.  It is used to
  4804. detect old and duplicate link state advertisements.  The space of
  4805. sequence numbers is linearly ordered.  The larger the sequence number
  4806. (when compared as signed 32-bit integers) the more recent the
  4807. advertisement.  To describe to sequence number space more precisely, let
  4808. N refer in the discussion below to the constant 2**31.
  4809.  
  4810. The sequence number -N (0x80000000) is reserved (and unused).  This
  4811. leaves -N + 1 (0x80000001) as the smallest (and therefore oldest)
  4812. sequence number.  A router uses this sequence number the first time it
  4813.  
  4814.  
  4815.  
  4816. [Moy]                                                          [Page 86]
  4817.  
  4818. RFC 1247                     OSPF Version 2                    July 1991
  4819.  
  4820.  
  4821. originates any link state advertisement.  Afterwards, the
  4822. advertisement's sequence number is incremented each time the router
  4823. originates a new instance of the advertisement.  When an attempt is made
  4824. to increment the sequence number past the maximum value of of N - 1
  4825. (0x7fffffff), the current instance of the advertisement must first be
  4826. flushed from the routing domain.  This is done by prematurely aging the
  4827. advertisement (see Section 14.1) and reflooding it.  As soon as this
  4828. flood has been acknowledged by all adjacent neighbors, a new instance
  4829. can be originated with sequence number of -N + 1 (0x80000001).
  4830.  
  4831. The router may be forced to promote the sequence number of one of its
  4832. advertisements when a more recent instance of the advertisement is
  4833. unexpectedly received during the flooding process.  This should be a
  4834. rare event.  This may indicate that an out-of-date advertisement,
  4835. originated by the router itself before its last restart/reload, still
  4836. exists in the Autonomous System.  For more information see Section 13.4.
  4837.  
  4838. ,uh "12.1.7 LS checksum"
  4839.  
  4840. This field is the checksum of the complete contents of the
  4841. advertisement, excepting the age field.  The age field is excepted so
  4842. that an advertisement's age can be incremented without updating the
  4843. checksum.  The checksum used is the same that is used for ISO
  4844. connectionless datagrams; it is commonly referred to as the Fletcher
  4845. checksum.  It is documented in Annex C of [RFC 994].  The link state
  4846. header also contains the length of the advertisement in bytes;
  4847. subtracting the size of the age field (two bytes) yields the amount of
  4848. data to checksum.
  4849.  
  4850. The checksum is used to detect data corruption of an advertisement.
  4851. This corruption can occur while an advertisement is being flooded, or
  4852. while it is being held in a router's memory.  The LS checksum field
  4853. cannot take on the value of zero; the occurrence of such a value should
  4854. be considered a checksum failure.  In other words, calculation of the
  4855. checksum is not optional.
  4856.  
  4857. The checksum of a link state advertisement is verified in two cases: a)
  4858. when it is received in a Link State Update Packet and b) at times during
  4859. the aging of the link state database.  The detection of a checksum
  4860. failure leads to separate actions in each case.  See Sections 13 and 14
  4861. for more details.
  4862.  
  4863. Whenever the LS sequence number field indicates that two instances of an
  4864. advertisement are the same, the LS checksum field is examined.  If there
  4865. is a difference, the instance with the larger checksum is considered to
  4866. be most recent.[12] See Section 13.1 for more details.
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872. [Moy]                                                          [Page 87]
  4873.  
  4874. RFC 1247                     OSPF Version 2                    July 1991
  4875.  
  4876.  
  4877. 12.2 The link state database
  4878.  
  4879. A router has a separate link state database for every area to which it
  4880. belongs.  The link state database has been referred to elsewhere in the
  4881. text as the topological database.  All routers belonging to the same
  4882. area have identical topological databases for the area.
  4883.  
  4884. The databases for each individual area are always dealt with separately.
  4885. The shortest path calculation is performed separately for each area (see
  4886. Section 16).  Components of the area topological database are flooded
  4887. throughout the area only.  Finally, when an adjacency (belonging to Area
  4888. A) is being brought up, only the database for Area A is synchronized
  4889. between the two routers.
  4890.  
  4891. The area database is composed of router links advertisements, network
  4892. links advertisements, and summary link advertisements (all listed in the
  4893. area data structure).  In addition, external routes (AS external
  4894. advertisements) are included in all non-stub area databases (see Section
  4895. 3.6).
  4896.  
  4897. An implementation of OSPF must be able to access individual pieces of an
  4898. area database.  This lookup function is based on an advertisement's LS
  4899. type, Link State ID and Advertising Router.[13] There will be a single
  4900. instance (the most up-to-date) of each link state advertisement in the
  4901. database.  The database lookup function is invoked during the link state
  4902. flooding procedure (Section 13) and the routing table calculation
  4903. (Section 16).  In addition, using this lookup function the router can
  4904. determine whether it has itself ever originated a particular link state
  4905. advertisement, and if so, with what LS sequence number.
  4906.  
  4907. A link state advertisement is added to a router's database when either
  4908. a) it is received during the flooding process (Section 13) or b) it is
  4909. originated by the router itself (Section 12.4).  A link state
  4910. advertisement is deleted from a router's database when either a) it has
  4911. been overwritten by a newer instance during the flooding process
  4912. (Section 13) or b) the router originates a newer instance of one of its
  4913. self-originated advertisements (Section 12.4) or c) the advertisement
  4914. ages out and is flushed from the routing domain (Section 14).  Whenever
  4915. a link state advertisement is deleted from the database it must also be
  4916. removed from all neighbors' Link state retransmission lists (see Section
  4917. 10).
  4918.  
  4919.  
  4920. 12.3 Representation of TOS
  4921.  
  4922. All OSPF link state advertisements (with the exception of network links
  4923. advertisements) specify metrics.  In router links advertisements, the
  4924. metrics indicate the costs of the described interfaces.  In summary link
  4925.  
  4926.  
  4927.  
  4928. [Moy]                                                          [Page 88]
  4929.  
  4930. RFC 1247                     OSPF Version 2                    July 1991
  4931.  
  4932.  
  4933. and AS external link advertisements, the metric indicates the cost of
  4934. the described path.  In all of these advertisements, a separate metric
  4935. can be specified for each IP TOS.  TOS is encoded in an OSPF link state
  4936. advertisement as the following mapping of the Delay (D), Throughput (T)
  4937. and Reliability (R) flags found in the IP packet header's TOS field (see
  4938. [RFC 791]).
  4939.  
  4940.  
  4941.  
  4942.                          OSPF encoding   D   T   R
  4943.                          _________________________
  4944.                          0               0   0   0
  4945.                          4               0   0   1
  4946.                          8               0   1   0
  4947.                          12              0   1   1
  4948.                          16              1   0   0
  4949.                          20              1   0   1
  4950.                          24              1   1   0
  4951.                          28              1   1   1
  4952.  
  4953.  
  4954.                     Table 17: Representing TOS in OSPF.
  4955.  
  4956.  
  4957. Each OSPF link state advertisement must specify the TOS 0 metric.  Other
  4958. TOS metrics, if they appear, must appear in order of increasing TOS
  4959. encoding.  For example, the TOS 8 (high throughput) metric must always
  4960. appear before the TOS 16 (low delay) metric when both are specified.  If
  4961. a metric for some non-zero TOS is not specified, its cost defaults to
  4962. the cost for TOS 0, unless the T-bit is reset in the advertisement's
  4963. options field (see Section 12.1.2 for more details).
  4964.  
  4965. Note that if more TOS types are defined in a future IP architecture,
  4966. OSPF's TOS encoding can be extended in a straightforward manner.
  4967.  
  4968.  
  4969. 12.4 Originating link state advertisements
  4970.  
  4971. A router may originate many types of link state advertisements.  A
  4972. router originates a router links advertisement for each area to which it
  4973. belongs.  If the router is also the Designated Router for any of its
  4974. attached networks, it will originate a network links advertisement for
  4975. that network.
  4976.  
  4977. Area border routers originate a single summary links advertisement for
  4978. each known inter-area destination.  AS boundary routers originate a
  4979. single AS external links advertisement for each known AS external
  4980. destination.  Destinations are advertised one at a time so that the
  4981.  
  4982.  
  4983.  
  4984. [Moy]                                                          [Page 89]
  4985.  
  4986. RFC 1247                     OSPF Version 2                    July 1991
  4987.  
  4988.  
  4989. change in any single route can be flooded without reflooding the entire
  4990. collection of routes.  During the flooding procedure, many link state
  4991. advertisements can be carried by a single Link State Update packet.
  4992.  
  4993. As an example, consider router RT4 in Figure 6.  It is an area border
  4994. router, having a connection to Area 1 and the backbone.  Router RT4
  4995. originates 5 distinct link state advertisements into the backbone (one
  4996. router links, and one summary link for each of the networks N1-N4).
  4997. Router RT4 will also originate 8 distinct link state advertisements into
  4998. Area 1 (one router links and seven summary link advertisements as
  4999. pictured in Figure 7).  If RT4 has been selected as Designated Router
  5000. for network N3, it will also originate a network links advertisement for
  5001. N3 into Area 1.
  5002.  
  5003. In this same figure, router RT5 will be originating 3 distinct AS
  5004. external link advertisements (one for each of the networks N12-N14).
  5005. These will be flooded throughout the entire AS, assuming that none of
  5006. the areas have been configured as stubs.  However, if area 3 has been
  5007. configured as a stub area, the external advertisements for networks
  5008. N12-N14 will not be flooded into area 3 (see Section 3.6).  Instead,
  5009. router RT11 would originate a default summary link advertisement that
  5010. would be flooded throughout area 3 (see Section 12.4.3).  This instructs
  5011. all of area 3's internal routers to send their AS external traffic to
  5012. RT11.
  5013.  
  5014. Whenever a new instance of a link state advertisement is originated, its
  5015. LS sequence number is incremented, its LS age is set to 0, its LS
  5016. checksum is calculated, and the advertisement is added to the link state
  5017. database and flooded out the appropriate interfaces.  See Section 13.2
  5018. for details concerning the installation of the advertisement into the
  5019. link state database.  See Section 13.3 for details concerning the
  5020. flooding of newly originated advertisements.
  5021.  
  5022.  
  5023. The eight events that cause a new instance of a link state advertisement
  5024. to be originated are:
  5025.  
  5026.  
  5027. (1) The LS refresh timer firing.  There is a LS refresh timer for each
  5028.     link state advertisement that the router has originated.  The LS
  5029.     refresh timer is an interval timer, with length LSRefreshTimer.  The
  5030.     LS refresh timer guarantees periodic originations regardless of any
  5031.     other events that cause new instances.  This periodic updating of
  5032.     link state advertisements adds robustness to the link state
  5033.     algorithm.  Link state advertisements that solely describe
  5034.     unreachable destinations should not be refreshed, but should instead
  5035.     be flushed from the routing domain (see Section 14.1).
  5036.  
  5037.  
  5038.  
  5039.  
  5040. [Moy]                                                          [Page 90]
  5041.  
  5042. RFC 1247                     OSPF Version 2                    July 1991
  5043.  
  5044.  
  5045. When whatever is being described by a link state advertisement changes,
  5046. a new advertisement is originated.  Two instances of the same link state
  5047. advertisement may not be originated within the time period
  5048. MinLSInterval.  This may require that the generation of the next
  5049. instance to be delayed by up to MinLSInterval.  The following changes
  5050. may cause a router to originate a new instance of an advertisement.
  5051. These changes should cause new originations only if the contents of the
  5052. new advertisement would be different.
  5053.  
  5054.  
  5055. (2) An interface's state changes (see Section 9.1).  This may mean that
  5056.     it is necessary to produce a new instance of the router links
  5057.     advertisement.
  5058.  
  5059. (3) An attached network's Designated Router changes.  A new router links
  5060.     advertisement should be originated.  Also, if the router itself is
  5061.     now the Designated Router, a new network links advertisement should
  5062.     be produced.
  5063.  
  5064. (4) One of the neighboring routers changes to/from the FULL state.  This
  5065.     may mean that it is necessary to produce a new instance of the
  5066.     router links advertisement.  Also, if the router is itself the
  5067.     Designated Router for the attached network, a new network links
  5068.     advertisement should be produced.
  5069.  
  5070.  
  5071. The next three events concern area border routers only.
  5072.  
  5073.  
  5074. (5) An intra-area route has been added/deleted/modified in the routing
  5075.     table.  This may cause a new instance of a summary links
  5076.     advertisement (for this route) to be originated in each attached
  5077.     area (this includes the backbone).
  5078.  
  5079. (6) An inter-area route has been added/deleted/modified in the routing
  5080.     table.  This may cause a new instance of a summary links
  5081.     advertisement (for this route) to be originated in each attached
  5082.     area (but NEVER for the backbone).
  5083.  
  5084. (7) The router becomes newly attached to an area.  The router must then
  5085.     originate summary link advertisements into the newly attached area
  5086.     for all pertinent intra-area and inter-area routes in its routing
  5087.     table.  See Section 12.4.3 for more details.
  5088.  
  5089.  
  5090. The last event concerns AS boundary routers only.
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096. [Moy]                                                          [Page 91]
  5097.  
  5098. RFC 1247                     OSPF Version 2                    July 1991
  5099.  
  5100.  
  5101. (8) An external route gained through direct experience with an external
  5102.     routing protocol (like EGP) changes.  This will cause the AS
  5103.     boundary router to originate a new instance of an external links
  5104.     advertisement.
  5105.  
  5106.  
  5107. The construction of each type of the link state advertisement is
  5108. explained below.  In general, these sections describe the contents of
  5109. the advertisement body (i.e., the part coming after the 20-byte
  5110. advertisement header).  For information concerning the building of the
  5111. link state advertisement header, see Section 12.1.
  5112.  
  5113.  
  5114.  
  5115. 12.4.1 Router links
  5116.  
  5117. A router originates a router links advertisement for each area that it
  5118. belongs to.  Such an advertisement describes the collected states of the
  5119. router's links to the area.  The advertisement is flooded throughout the
  5120. particular area, and no further.
  5121.  
  5122. The format of a router links advertisement is shown in Appendix A
  5123. (Section A.4.2).  The first 20 bytes of the advertisement consist of the
  5124. generic link state header that was discussed in Section 12.1.  Router
  5125. links advertisements have LS type = 1.  The router indicates whether it
  5126. is willing to calculate separate routes for each IP TOS by setting (or
  5127. resetting) the T-bit of the link state advertisement's Options field.
  5128.  
  5129. A router also indicates whether it is an area border router, or an AS
  5130. boundary router, by setting the appropriate bits in its router links
  5131. advertisements.  This enables paths to those types of routers to be
  5132. saved in the routing table, for later processing of summary link
  5133. advertisements and AS external link advertisements.
  5134.  
  5135. The router links advertisement then describes the router's working
  5136. connections (links) to the area.  Each link is typed according to the
  5137.  
  5138.  
  5139.                _________________________________________
  5140.  
  5141.                 (Figure not included in text version.)
  5142.  
  5143.                Figure 15: Area 1 with IP addresses shown
  5144.                  Figure 16: Forwarding address example
  5145.                _________________________________________
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152. [Moy]                                                          [Page 92]
  5153.  
  5154. RFC 1247                     OSPF Version 2                    July 1991
  5155.  
  5156.  
  5157. kind of attached network.  Each link is also labelled with its Link ID.
  5158. This ID gives a name to the entity that is on the other end of the link.
  5159. Table 18 summarizes the values used for the type and Link ID fields.
  5160.  
  5161.  
  5162.  
  5163. Link type   Description               Link ID
  5164. ____________________________________________________________________________
  5165. 1           Point-to-point link       Neighbor Router ID
  5166. 2           Link to transit network   Interface address of Designated Router
  5167. 3           Link to stub network      IP network number
  5168. 4           Virtual link              Neighbor Router ID
  5169.  
  5170.  
  5171.        Table 18: Link descriptions in the router links advertisement.
  5172.  
  5173.  
  5174. In addition, the Link Data field is specified for each link.  This field
  5175. gives 32 bits of extra information for the link.  For links to routers
  5176. and transit networks, this field specifies the IP interface address of
  5177. the associated router interface (this is needed by the routing table
  5178. calculation, see Section 16.3).  For links to stub networks, this field
  5179. specifies the network's IP address mask.
  5180.  
  5181. Finally, the cost of using the link for output (possibly specifying a
  5182. different cost for each type of service) is specified.  The output cost
  5183. of a link is configurable.  It must always be non-zero.
  5184.  
  5185. To further describe the process of building the list of link records,
  5186. suppose a router wishes to build router links advertisement for an Area
  5187. A.  The router examines its collection of interface data structures.
  5188. For each interface, the following steps are taken:
  5189.  
  5190.  
  5191. o   If the attached network does not belong to Area A, no links are
  5192.     added to the advertisement, and the next interface should be
  5193.     examined.
  5194.  
  5195. o   Else, if the state of the interface is Down, no links are added.
  5196.  
  5197. o   Else, if the state of the interface is Point-to-Point, then add
  5198.     links according to the following:
  5199.  
  5200.     -   If the neighboring router is fully adjacent, add a Type 1 link
  5201.         (point-to-point) if this is an interface to a point-to-point
  5202.         network, or add a type 4 link (virtual link) if this is a
  5203.         virtual link.  The Link ID should be set to the Router ID of the
  5204.         neighboring router, and the Link Data should specify the
  5205.  
  5206.  
  5207.  
  5208. [Moy]                                                          [Page 93]
  5209.  
  5210. RFC 1247                     OSPF Version 2                    July 1991
  5211.  
  5212.  
  5213.         interface IP address.
  5214.  
  5215.     -   If this is a numbered point-to-point network (i.e, not a virtual
  5216.         link and not an unnumbered point-to-point network) and the
  5217.         neighboring router's IP address is known, add a Type 3 link
  5218.         (stub network) whose Link ID is the neighbor's IP address, whose
  5219.         Link Data is the mask 0xffffffff indicating a host route, and
  5220.         whose cost is the interface's configured output cost.
  5221.  
  5222. o   Else if the state of the interface is Loopback, add a Type 3 link
  5223.     (stub network) as long as this is not an interface to an unnumbered
  5224.     serial line.  The Link ID should be set to the IP interface address,
  5225.     the Link Data set to the mask 0xffffffff (indicating a host route),
  5226.     and the cost set to 0.
  5227.  
  5228. o   Else if the state of the interface is Waiting, add a Type 3 link
  5229.     (stub network) whose Link ID is the IP network number of the
  5230.     attached network and whose Link Data is the attached network's
  5231.     address mask.
  5232.  
  5233. o   Else, there has been a Designated Router selected for the attached
  5234.     network.  If the router is fully adjacent to the Designated Router,
  5235.     or if the router itself is Designated Router and is fully adjacent
  5236.     to at least one other router, add a single Type 2 link (transit
  5237.     network) whose whose link ID is the IP interface address of the
  5238.     attached network's Designated Router (which may be the router
  5239.     itself) and whose Link Data is the interface IP address.  Otherwise,
  5240.     add a link as if the interface state were Waiting (see above).
  5241.  
  5242.  
  5243. Unless otherwise specified, the cost of each link generated by the above
  5244. procedure is equal to the output cost of the associated interface.  Note
  5245. that in the case of serial lines, multiple links may be generated by a
  5246. single interface.
  5247.  
  5248. After consideration of all the router interfaces, host links are added
  5249. to the advertisement by examining the list of attached hosts.  A host
  5250. route is represented as a Type 3 link (stub network) whose link ID is
  5251. the host's IP address and whose Link Data is the mask of all ones
  5252. (0xffffffff).
  5253.  
  5254. As an example, consider the router links advertisements generated by
  5255. router RT3, as pictured in Figure 6.  The area containing router RT3
  5256. (Area 1) has been redrawn, with actual network addresses, in Figure 15.
  5257. Assume that the last byte of all of RT3's interface addresses is 3,
  5258. giving it the interface addresses 192.1.1.3 and 192.1.4.3, and that the
  5259. other routers have similar addressing schemes.  In addition, assume that
  5260. all links are functional, and that Router IDs are assigned as the
  5261.  
  5262.  
  5263.  
  5264. [Moy]                                                          [Page 94]
  5265.  
  5266. RFC 1247                     OSPF Version 2                    July 1991
  5267.  
  5268.  
  5269. smallest IP interface address.
  5270.  
  5271. RT3 originates two router links advertisements, one for Area 1 and one
  5272. for the backbone.  Assume that router RT4 has been selected as the
  5273. Designated router for network 192.1.1.0.  RT3's router links
  5274. advertisement for Area 1 is then shown below.  It indicates that RT3 has
  5275. two connections to Area 1, the first a link to the transit network
  5276. 192.1.1.0 and the second a link to the stub network 192.1.4.0.  Note
  5277. that the transit network is identified by the IP interface of its
  5278. Designated Router (i.e., the Link ID = 192.1.1.4 which is the Designated
  5279. Router RT4's IP interface to 192.1.1.0).  Note also that RT3 has
  5280. indicated that it is capable of calculating separate routes based on IP
  5281. TOS, through setting the T-bit in the Options field.  It has also
  5282. indicated that it is an area border router.
  5283.  
  5284.        ; RT3's router links advertisement for Area 1
  5285.  
  5286.        LS age = 0                     ;always true on origination
  5287.        Options = (T-bit|E-bit)        ;TOS-capable
  5288.        LS type = 1                    ;indicates router links
  5289.        Link State ID = 192.1.1.3      ;RT3's Router ID
  5290.        Advertising Router = 192.1.1.3 ;RT3's Router ID
  5291.        bit E = 0                      ;not an AS boundary router
  5292.        bit B = 1                      ;RT3 is an area border router
  5293.        #links = 2
  5294.                Link ID = 192.1.1.4    ;IP address of Designated Router
  5295.                Link Data = 192.1.1.3  ;RT3's IP interface to net
  5296.                Type = 2               ;connects to transit network
  5297.                # other metrics = 0
  5298.                TOS 0 metric = 1
  5299.  
  5300.                Link ID = 192.1.4.0    ;IP Network number
  5301.                Link Data = 0xffffff00 ;Network mask
  5302.                Type = 3               ;connects to stub network
  5303.                # other metrics = 0
  5304.                TOS 0 metric = 2
  5305.  
  5306. Next RT3's router links advertisement for the backbone is shown.  It
  5307. indicates that RT3 has a single attachment to the backbone.  This
  5308. attachment is via an unnumbered point-to-point link to router RT6.  RT3
  5309. has again indicated that it is TOS-capable, and that it is an area
  5310. border router.
  5311.  
  5312.        ; RT3's router links advertisement for the backbone
  5313.  
  5314.        LS age = 0                     ;always true on origination
  5315.        Options = (T-bit|E-bit)        ;TOS-capable
  5316.        LS type = 1                    ;indicates router links
  5317.  
  5318.  
  5319.  
  5320. [Moy]                                                          [Page 95]
  5321.  
  5322. RFC 1247                     OSPF Version 2                    July 1991
  5323.  
  5324.  
  5325.        Link State ID = 192.1.1.3      ;RT3's router ID
  5326.        Advertising Router = 192.1.1.3 ;RT3's router ID
  5327.        bit E = 0                      ;not an AS boundary router
  5328.        bit B = 1                      ;RT3 is an area border router
  5329.        #links = 1
  5330.                Link ID = 18.10.0.6    ;Neighbor's Router ID
  5331.                Link Data = 0.0.0.0    ;Interface to unnumbered SL
  5332.                Type = 1               ;connects to router
  5333.                # other metrics = 0
  5334.                TOS 0 metric = 8
  5335.  
  5336. Even though router RT3 has indicated that it is TOS-capable in the above
  5337. examples, only a single metric (the TOS 0 metric) has been specified for
  5338. each interface.  Different metrics can be specified for each TOS.  The
  5339. encoding of TOS in OSPF link state advertisements is described in
  5340. Section 12.3.
  5341.  
  5342. As an example, suppose the point-to-point link between routers RT3 and
  5343. RT6 in Figure 15 is a satellite link.  The AS administrator may want to
  5344. encourage the use of the line for high bandwidth traffic.  This would be
  5345. done by setting the metric artificially low for that TOS.  Router RT3
  5346. would then originate the following router links advertisement for the
  5347. backbone (IP TOS 8 = high bandwidth):
  5348.  
  5349.        ; RT3's router links advertisement for the backbone
  5350.  
  5351.        LS age = 0                  ;always true on origination
  5352.        Options = (T-bit|E-bit)     ;TOS-capable
  5353.        LS type = 1                 ;indicates router links
  5354.        Link State ID = 192.1.1.3   ;RT3's Router ID
  5355.        Advertising Router = 192.1.1.3
  5356.        bit E = 0                   ;not an AS boundary router
  5357.        bit B = 1                   ;RT3 is an area border router
  5358.        #links = 1
  5359.                Link ID = 18.10.0.6 ; Neighbor's Router ID
  5360.                Link Data = 0.0.0.0 ;Interface to unnumbered SL
  5361.                Type = 1            ;connects to router
  5362.                # other metrics = 1
  5363.                TOS 0 metric = 8
  5364.                        TOS = 8     ;High bandwidth
  5365.                        metric = 1  ;traffic preferred
  5366.  
  5367.  
  5368. 12.4.2 Network links
  5369.  
  5370. A network links advertisement is generated for every transit multi-
  5371. access network.  (A transit network is a network having two or more
  5372. attached routers).  The network links advertisement describes all the
  5373.  
  5374.  
  5375.  
  5376. [Moy]                                                          [Page 96]
  5377.  
  5378. RFC 1247                     OSPF Version 2                    July 1991
  5379.  
  5380.  
  5381. routers that are attached to the network.
  5382.  
  5383. The Designated Router for the network originates the advertisement.  The
  5384. Designated Router originates the advertisement only if it is fully
  5385. adjacent to at least one other router on the network.  The network links
  5386. advertisement is flooded throughout the area that contains the transit
  5387. network, and no further.  The networks links advertisement lists those
  5388. routers that are fully adjacent to the Designated Router; each fully
  5389. adjacent router is identified by its OSPF Router ID.  The Designated
  5390. Router includes itself in this list.
  5391.  
  5392. The Link State ID for a network links advertisement is the IP interface
  5393. address of the Designated Router.  This value, masked by the network's
  5394. address mask (which is also contained in the network links
  5395. advertisement) yields the network's IP address.
  5396.  
  5397. A router that has formerly been the Designated Router for a network, but
  5398. is no longer, should flush the network links advertisement that it had
  5399. previously originated.  This advertisement is no longer used in the
  5400. routing table calculation.  It is flushed by prematurely incrementing
  5401. the advertisement's age to MaxAge and reflooding (see Section 14.1).
  5402.  
  5403. As an example of a network links advertisement, again consider the area
  5404. configuration in Figure 6.  Network links advertisements are originated
  5405. for network N3 in Area 1, networks N6 and N8 in Area 2, and network N9
  5406. in Area 3.  Assuming that router RT4 has been selected as the Designated
  5407. Router for network N3, the following network links advertisement is
  5408. generated by RT4 on behalf of network N3 (see Figure 15 for the address
  5409. assignments):
  5410.  
  5411.        ; network links advertisement for network N3
  5412.  
  5413.        LS age = 0                     ;always true on origination
  5414.        Options = (T-bit|E-bit)        ;TOS-capable
  5415.        LS type = 2                    ;indicates network links
  5416.        Link State ID = 192.1.1.4      ;IP address of Designated Router
  5417.        Advertising Router = 192.1.1.4 ;RT4's Router ID
  5418.        Network Mask = 0xffffff00
  5419.                Attached Router = 192.1.1.4    ;Router ID
  5420.                Attached Router = 192.1.1.1    ;Router ID
  5421.                Attached Router = 192.1.1.2    ;Router ID
  5422.                Attached Router = 192.1.1.3    ;Router ID
  5423.  
  5424.  
  5425. 12.4.3 Summary links
  5426.  
  5427. Each summary link advertisement describes a route to a single
  5428. destination.  Summary link advertisements are flooded throughout a
  5429.  
  5430.  
  5431.  
  5432. [Moy]                                                          [Page 97]
  5433.  
  5434. RFC 1247                     OSPF Version 2                    July 1991
  5435.  
  5436.  
  5437. single area only.  The destination described is one that is external to
  5438. the area, yet still belonging to the Autonomous System.
  5439.  
  5440. The DefaultDestination can also be specified in summary link
  5441. advertisements.  This is used when implementing OSPF's stub area
  5442. functionality (see Section 3.6).  In a stub area, instead of importing
  5443. external routes each area border router originates a "default summary
  5444. link" (Link State ID = DefaultDestination) into the area.
  5445.  
  5446. Summary link advertisements are originated by area border routers.  The
  5447. precise summary routes to advertise into an area are determined by
  5448. examining the routing table structure (see Section 11).  Only intra-area
  5449. routes are advertised into the backbone.  Both intra-area and inter-area
  5450. routes are advertised into the other areas.
  5451.  
  5452. To determine which routes to advertise into an attached Area A, each
  5453. routing table entry is processed as follows:
  5454.  
  5455.  
  5456. o   Only Destination types of network and AS boundary router are
  5457.     advertised in summary link advertisements.  If the routing table
  5458.     entry's Destination type is area border router, examine the next
  5459.     routing table entry.
  5460.  
  5461. o   AS external routes are never advertised in summary link
  5462.     advertisements.  If the routing table entry has Path-type type 1
  5463.     external or type 2 external, examine the next routing table entry.
  5464.  
  5465. o   Else, if the area associated with this set of paths is the Area A
  5466.     itself, do not generate a summary link advertisement for the
  5467.     route.[14]
  5468.  
  5469. o   Else, if the destination of this route is an AS boundary router,
  5470.     generate a Type 4 link state advertisement for the destination, with
  5471.     Link State ID equal to the AS boundary router's ID and metric equal
  5472.     to the routing table entry's cost.  These advertisements should not
  5473.     be generated if area A has been configured as a stub area.
  5474.  
  5475. o   Else, the Destination type is network.  If this is an inter-area
  5476.     route, generate a Type 3 advertisement for the destination, with
  5477.     Link State ID equal to the network's address and metric equal to the
  5478.     routing table cost.
  5479.  
  5480. o   The one remaining case is an intra-area route to a network.  This
  5481.     means that the network is contained in one of the router's directly
  5482.     attached areas.  In general, this information must be condensed
  5483.     before appearing in summary link advertisements.  Remember that an
  5484.     area has been defined as a list of address ranges, each range
  5485.  
  5486.  
  5487.  
  5488. [Moy]                                                          [Page 98]
  5489.  
  5490. RFC 1247                     OSPF Version 2                    July 1991
  5491.  
  5492.  
  5493.     consisting of an [address,mask] pair.  A single Type 3 advertisement
  5494.     must be made for each range, with Link State ID equal to the range's
  5495.     address and cost equal to the smallest cost of any of the component
  5496.     networks.
  5497.  
  5498.     If virtual links are being used to provide/increase connectivity of
  5499.     the backbone, routing information concerning the backbone networks
  5500.     should not be condensed before being summarized into the virtual
  5501.     links' transit areas.  In other words, the backbone ranges should be
  5502.     ignored when originating summary links into these areas.  The
  5503.     existence of virtual links can be determined during the shortest
  5504.     path calculation for the backbone (see Section 16.1).
  5505.  
  5506.  
  5507. In addition, if area A has been configured as a stub area and the router
  5508. is an area border router, it should advertise a default summary link
  5509. into Area A.  The Link State ID for the advertisement should be set to
  5510. DefaultDestination, and the metric set to the (per-area) configurable
  5511. parameter StubDefaultCost.
  5512.  
  5513. If a router advertises a summary advertisement for a destination which
  5514. then becomes unreachable, the router must then flush the advertisement
  5515. from the routing domain by setting its age to MaxAge and reflooding (see
  5516. Section 14.1).  Also, if the destination is still reachable, yet can no
  5517. longer be advertised according to the above procedure (e.g., it is now
  5518. an inter-area route, when it used to be an intra-area route associated
  5519. with some non-backbone area; it would thus no longer be advertisable to
  5520. the backbone), the advertisement should also be flushed from the routing
  5521. domain.
  5522.  
  5523. For an example of summary link advertisements, consider again the area
  5524. configuration in Figure 6.  Routers RT3, RT4, RT7, RT10 and RT11 are all
  5525. area border routers, and therefore are originating summary links
  5526. advertisements.  Consider in particular router RT4.  Its routing table
  5527. was calculated as the example in Section 11.3.  RT4 originates summary
  5528. link advertisements into both the backbone and Area 1.  Into the
  5529. backbone, router RT4 originates separate advertisements for each of the
  5530. networks N1-N4.  Into Area 1, router RT4 originates separate
  5531. advertisements for networks N6-N8 and the AS boundary routers RT5,RT7.
  5532. It also condenses host routes Ia and Ib into a single summary
  5533. advertisement.  Finally, the routes to networks N9,N10,N11 and host H9
  5534. are advertised by a single summary link.  This condensation was
  5535. originally performed by the router RT11.
  5536.  
  5537. These advertisements are illustrated graphically in Figures 7 and 8.
  5538. Two of the summary link advertisements originated by router RT4 follow.
  5539. The actual IP addresses for the networks and routers in question have
  5540. been assigned in Figure 15.
  5541.  
  5542.  
  5543.  
  5544. [Moy]                                                          [Page 99]
  5545.  
  5546. RFC 1247                     OSPF Version 2                    July 1991
  5547.  
  5548.  
  5549.        ; summary link advertisement for network N1,
  5550.        ; originated by router RT4 into the backbone
  5551.  
  5552.        LS age = 0                  ;always true on origination
  5553.        Options = (T-bit|E-bit)     ;TOS-capable
  5554.        LS type = 3                 ;indicates summary link to IP net
  5555.        Link State ID = 192.1.2.0   ;N1's IP network number
  5556.        Advertising Router = 192.1.1.4       ;RT4's ID
  5557.                TOS = 0
  5558.                metric = 4
  5559.  
  5560.        ; summary link advertisement for AS boundary router RT7
  5561.        ; originated by router RT4 into Area 1
  5562.  
  5563.        LS age = 0                  ;always true on origination
  5564.        Options = (T-bit|E-bit)     ;TOS-capable
  5565.        LS type = 4                 ;indicates summary link to ASBR
  5566.        Link State ID = router RT7's ID
  5567.        Advertising Router = 192.1.1.4       ;RT4's ID
  5568.                TOS = 0
  5569.                metric = 14
  5570.  
  5571. Summary link advertisements pertain to a single destination (IP network
  5572. or AS boundary router).  However, for a single destination there may be
  5573. separate sets of paths, and therefore separate routing table entries,
  5574. for each Type of Service.  All these entries must be considered when
  5575. building the summary link advertisement for the destination; a single
  5576. advertisement must specify the separate costs (if they exist) for each
  5577. TOS.  The encoding of TOS in OSPF link state advertisements is described
  5578. in Section 12.3.
  5579.  
  5580. Clearing the T-bit in the Options field of a summary link advertisement
  5581. indicates that there is a TOS 0 path to the destination, but no paths
  5582. for non-zero TOS.  This can happen when non-TOS capable routers exist in
  5583. the routing domain (see Section 2.4).
  5584.  
  5585.  
  5586. 12.4.4 AS external links
  5587.  
  5588. AS external link advertisements describe routes to destinations external
  5589. to the Autonomous System.  Most AS external link advertisements describe
  5590. routes to specific external destinations.  However, a default route for
  5591. the Autonomous System can be described in an AS external advertisement
  5592. by setting the advertisement's Link State ID to DefaultDestination
  5593. (0.0.0.0).  AS external link advertisements are originated by AS
  5594. boundary routers.  An AS boundary router originates a single AS external
  5595. link advertisement for each external route that it has learned, either
  5596. through another routing protocol (such as EGP), or through configuration
  5597.  
  5598.  
  5599.  
  5600. [Moy]                                                         [Page 100]
  5601.  
  5602. RFC 1247                     OSPF Version 2                    July 1991
  5603.  
  5604.  
  5605. information.
  5606.  
  5607. In general, AS external link advertisements are the only type of link
  5608. state advertisements that are flooded throughout the entire Autonomous
  5609. System; all other types of link state advertisements are specific to a
  5610. single area.  However, AS external advertisements are not flooded
  5611. into/throughout stub areas (see Section 3.6).  This enables a reduction
  5612. in link state database size for routers internal to stub areas.
  5613.  
  5614. The metric that is advertised for an external route can be one of two
  5615. types.  Type 1 metrics are comparable to the link state metric.  Type 2
  5616. metrics are assumed to be larger than the cost of any intra-AS path.  As
  5617. with summary link advertisements, if separate paths exist based on TOS,
  5618. separate TOS costs can be included in the AS external link
  5619. advertisement.  The encoding of TOS in OSPF link state advertisements is
  5620. described in Section 12.3.  If the T-bit of the advertisement's Options
  5621. field is clear, no non-zero TOS paths to the destination exist.
  5622.  
  5623. If a router advertises an AS external link advertisement for a
  5624. destination which then becomes unreachable, the router must then flush
  5625. the advertisement from the routing domain by setting its age to MaxAge
  5626. and reflooding (see Section 14.1).
  5627.  
  5628. For an example of AS external link advertisements, consider once again
  5629. the AS pictured in Figure 6.  There are two AS boundary routers: RT5 and
  5630. RT7.  Router RT5 originates three external link advertisements, for
  5631. networks N12-N14.  Router RT7 originates two external link
  5632. advertisements, for networks N12 and N15.  Assume that RT7 has learned
  5633. its route to N12 via EGP, and that it wishes to advertise a Type 2
  5634. metric to the AS.  RT7 would then originate the following advertisement
  5635. for N12:
  5636.  
  5637.        ; AS external link advertisement for network N12,
  5638.        ; originated by router RT7
  5639.  
  5640.        LS age = 0                  ;always true on origination
  5641.        Options = (T-bit|E-bit)     ;TOS-capable
  5642.        LS type = 5                 ;indicates AS external link
  5643.        Link State ID = N12's IP network number
  5644.        Advertising Router = Router RT7's ID
  5645.                bit E = 1           ;Type 2 metric
  5646.                TOS = 0
  5647.                metric = 2
  5648.                Forwarding address = 0.0.0.0
  5649.  
  5650. In the above example, the forwarding address field has been set to
  5651. 0.0.0.0, indicating that packets for the external destination should be
  5652. forwarded to the advertising OSPF router (RT7).  This is not always
  5653.  
  5654.  
  5655.  
  5656. [Moy]                                                         [Page 101]
  5657.  
  5658. RFC 1247                     OSPF Version 2                    July 1991
  5659.  
  5660.  
  5661. desirable.  Consider the example pictured in Figure 16.  There are three
  5662. OSPF routers (RTA, RTB and RTC) connected to a common network.  Only one
  5663. of these routers, RTA, is exchanging EGP information with the non-OSPF
  5664. router RTX.  RTA must then originate AS external link state
  5665. advertisements for those destinations it has learned from RTX.  By using
  5666. the AS external advertisement's forwarding address field, RTA can
  5667. specify that packets for these destinations be forwarded directly to
  5668. RTX.  Without this feature, routers RTB and RTC would take an extra hop
  5669. to get to these destinations.
  5670.  
  5671. Note that when the forwarding address field is non-zero, it should point
  5672. to a router belonging to another Autonomous System.
  5673.  
  5674. A forwarding address can also be specified for the default route.  For
  5675. example, in figure 16 RTA may want to specify that all externally-
  5676. destined packets should by default be forwarded to its EGP peer RTX.
  5677. The resulting AS external link advertisement is pictured below.  Note
  5678. that the Link State ID is set to DefaultDestination.
  5679.  
  5680.        ; Default route, originated by router RTA
  5681.        ; Packets forwarded through RTX
  5682.  
  5683.        LS age = 0                  ;always true on origination
  5684.        Options = (T-bit|E-bit)     ;TOS-capable
  5685.        LS type = 5                 ;indicates AS external link
  5686.        Link State ID = DefaultDestination  ; default route
  5687.        Advertising Router = Router RTA's ID
  5688.                bit E = 1           ;Type 2 metric
  5689.                TOS = 0
  5690.                metric = 1
  5691.                Forwarding address = RTX's IP address
  5692.  
  5693. In figure 16, suppose instead that both RTA and RTB exchange EGP
  5694. information with RTX.  In this case, RTA and RTB would originate the
  5695. same set of external advertisements.  These advertisements, if they
  5696. specify the same metric, would be functionally equivalent since they
  5697. would specify the same destination and forwarding address (RTX).  This
  5698. leads to a clear duplication of effort.  If only one of RTA or RTB
  5699. originated the set of external advertisements, the routing would remain
  5700. the same, and the size of the link state database would decrease.
  5701. However, it must be unambiguously defined as to which router originates
  5702. the advertisements (otherwise neither may, or the identity of the
  5703. originator may oscillate).  The following rule is thereby established:
  5704. if two routers, both reachable from one another, originate functionally
  5705. equivalent AS external advertisements (i.e., same destination, cost and
  5706. non-zero forwarding address), then the advertisement originated by the
  5707. router having the highest OSPF Router ID is used.  The router having the
  5708. lower OSPF Router ID can then flush its advertisement.  Flushing a link
  5709.  
  5710.  
  5711.  
  5712. [Moy]                                                         [Page 102]
  5713.  
  5714. RFC 1247                     OSPF Version 2                    July 1991
  5715.  
  5716.  
  5717. state advertisement is discussed in Section 14.1.
  5718.  
  5719.  
  5720. 13. The Flooding Procedure
  5721.  
  5722. Link State Update packets provide the mechanism for flooding link state
  5723. advertisements.  A Link State Update packet may contain several distinct
  5724. advertisements, and floods each advertisement one hop further from its
  5725. point of origination.  To make the flooding procedure reliable, each
  5726. advertisement must be acknowledged separately.  Acknowledgments are
  5727. transmitted in Link State Acknowledgment packets.  Many separate
  5728. acknowledgments can be grouped together into a single packet.
  5729.  
  5730. The flooding procedure starts when a Link State Update packet has been
  5731. received.  Many consistency checks have been made on the received packet
  5732. before being handed to the flooding procedure (see Section 8.2).  In
  5733. particular, the Link State Update packet has been associated with a
  5734. particular neighbor, and a particular area.  If the neighbor is in a
  5735. lesser state than Exchange, the packet should be dropped without further
  5736. processing.
  5737.  
  5738. All types of link state advertisements, other than AS external links,
  5739. are associated with a specific area.  However, link state advertisements
  5740. do not contain an area field.  A link state advertisement's area must be
  5741. deduced from the Link State Update packet header.
  5742.  
  5743. For each link state advertisement contained in the packet, the following
  5744. steps are taken:
  5745.  
  5746.  
  5747. (1) Validate the advertisement's link state checksum.  If the checksum
  5748.     turns out to be invalid, discard the advertisement and get the next
  5749.     one from the Link State Update packet.
  5750.  
  5751. (2) Examine the link state advertisement's LS type.  If the LS type is
  5752.     unknown, discard the advertisement and get the next one from the
  5753.     Link State Update Packet.  This specification defines LS Types 1-5
  5754.     (see Section 4.3).
  5755.  
  5756. (3) Else if this is a AS external advertisement (LS type = 5), and the
  5757.     area has been configured as a stub area, discard the advertisement
  5758.     and get the next one from the Link State Update Packet.  AS external
  5759.     advertisements are not flooded into/throughout stub areas (see
  5760.     Section 3.6).
  5761.  
  5762. (4) Else if the advertisement's age is equal to MaxAge, and there is
  5763.     currently no instance of the advertisement in the router's link
  5764.     state database, then take the following actions:
  5765.  
  5766.  
  5767.  
  5768. [Moy]                                                         [Page 103]
  5769.  
  5770. RFC 1247                     OSPF Version 2                    July 1991
  5771.  
  5772.  
  5773.     (a) Acknowledge the receipt of the advertisement by sending a Link
  5774.         State Acknowledgment packet back to the sending neighbor (see
  5775.         Section 13.5).
  5776.  
  5777.     (b) Purge all outstanding requests for equal or previous instances
  5778.         of the advertisement from the sending neighbor's Link State
  5779.         Request list (see Section 10).
  5780.  
  5781.     (c) If the sending neighbor is in state Exchange or in state
  5782.         Loading, then install the MaxAge advertisement in the link state
  5783.         database.  Otherwise, simply discard the advertisement.  In
  5784.         either case, examine the next advertisement (if any) listed in
  5785.         the Link State Update packet.
  5786.  
  5787. (5) Otherwise, find the instance of this advertisement that is currently
  5788.     contained in the router's link state database.  If there is no
  5789.     database copy, or the received advertisement is more recent than the
  5790.     database copy (see Section 13.1 below for the determination of which
  5791.     advertisement is more recent) the following steps must be performed:
  5792.  
  5793.     (a) If there is already a database copy, and if the database copy
  5794.         was installed less than MinLSInterval seconds ago, discard the
  5795.         new advertisement (without acknowledging it) and examine the
  5796.         next advertisement (if any) listed in the Link State Update
  5797.         packet.
  5798.  
  5799.     (b) Otherwise immediately flood the new advertisement out some
  5800.         subset of the router's interfaces (see Section 13.3).  In some
  5801.         cases (e.g., the state of the receiving interface is DR and the
  5802.         advertisement was received from a router other than the Backup
  5803.         DR) the advertisement will be flooded back out the receiving
  5804.         interface.  This occurrence should be noted for later use by the
  5805.         acknowledgment process (Section 13.5).
  5806.  
  5807.     (c) Remove the current database copy from all neighbors' Link state
  5808.         retransmission lists.
  5809.  
  5810.     (d) Install the new advertisement in the link state database
  5811.         (replacing the current database copy).  This may cause the
  5812.         routing table calculation to be scheduled.  In addition,
  5813.         timestamp the new advertisement with the current time (i.e., the
  5814.         time it was received).  The flooding procedure cannot overwrite
  5815.         the newly installed advertisement until MinLSInterval seconds
  5816.         have elapsed.  The advertisement installation process is
  5817.         discussed further in Section 13.2.
  5818.  
  5819.     (e) Possibly acknowledge the receipt of the advertisement by sending
  5820.         a Link State Acknowledgment packet back out the receiving
  5821.  
  5822.  
  5823.  
  5824. [Moy]                                                         [Page 104]
  5825.  
  5826. RFC 1247                     OSPF Version 2                    July 1991
  5827.  
  5828.  
  5829.         interface.  This is explained below in Section 13.5.
  5830.  
  5831.     (f) If this new link state advertisement indicates that it was
  5832.         originated by this router itself, the router must advance the
  5833.         advertisement's link state sequence number, and issue a new
  5834.         instance of the advertisement (see Section 13.4).
  5835.  
  5836. (6) Else, if there is an instance of the advertisement on the sending
  5837.     neighbor's Link state request list, an error has occurred in the
  5838.     Database Description process.  In this case, restart the Database
  5839.     Description process by generating the neighbor event BadLSReq for
  5840.     the sending neighbor and stop processing the Link State Update
  5841.     packet.
  5842.  
  5843. (7) Else, if the received advertisement is the same instance as the
  5844.     database copy (i.e., neither one is more recent) the following two
  5845.     steps should be performed:
  5846.  
  5847.     (a) If the advertisement is listed in the Link state retransmission
  5848.         list for the receiving adjacency, the router itself is expecting
  5849.         an acknowledgment for this advertisement.  The router should
  5850.         treat the received advertisement as an acknowledgment, by
  5851.         removing the advertisement from the Link state retransmission
  5852.         list.  This is termed an "implied acknowledgment".  Its
  5853.         occurrence should be noted for later use by the acknowledgment
  5854.         process (Section 13.5).
  5855.  
  5856.     (b) Possibly acknowledge the receipt of the advertisement by sending
  5857.         a Link State Acknowledgment packet back out the receiving
  5858.         interface.  This is explained below in Section 13.5.
  5859.  
  5860. (8) Else, the database copy is more recent.  Note an unusual event to
  5861.     network management, discard the advertisement and process the next
  5862.     link state advertisement contained in the packet.
  5863.  
  5864.  
  5865. 13.1 Determining which link state is newer
  5866.  
  5867. When a router encounters two instances of a link state advertisement, it
  5868. must determine which is more recent.  This occurred above when comparing
  5869. a received advertisement to the database copy.  This comparison must
  5870. also be done during the database exchange procedure which occurs during
  5871. adjacency bring-up.
  5872.  
  5873. A link state advertisement is identified by its LS type, Link State ID
  5874. and Advertising Router.  For two instances of the same advertisement,
  5875. the LS sequence number, LS age, and LS checksum fields are used to
  5876. determine which instance is more recent:
  5877.  
  5878.  
  5879.  
  5880. [Moy]                                                         [Page 105]
  5881.  
  5882. RFC 1247                     OSPF Version 2                    July 1991
  5883.  
  5884.  
  5885. o   The advertisement having the newer LS sequence number is more
  5886.     recent.  See Section 12.1.6 for an explanation of the LS sequence
  5887.     number space.  If both instances have the same LS sequence number,
  5888.     then:
  5889.  
  5890. o   If the two instances have different LS checksums, then the instance
  5891.     having the larger LS checksum (when considered as a 16-bit unsigned
  5892.     integer) is considered more recent.
  5893.  
  5894. o   Else, if only one of the instances is of age MaxAge, the instance of
  5895.     age MaxAge is considered to be more recent.
  5896.  
  5897. o   Else, if the ages of the two instances differ by more than
  5898.     MaxAgeDiff, the instance having the smaller (younger) age is
  5899.     considered to be more recent.
  5900.  
  5901. o   Else, the two instances are considered to be identical.
  5902.  
  5903.  
  5904. 13.2 Installing link state advertisements in the database
  5905.  
  5906. Installing a new link state advertisement in the database, either as the
  5907. result of flooding or a newly self originated advertisement, may cause
  5908. the routing table structure to be recalculated.  The contents of the new
  5909. advertisement should be compared to the old instance, if present.  If
  5910. there is no difference, there is no need to recalculate the routing
  5911. table.  (Note that even if the contents are the same, the LS checksum
  5912. will probably be different, since the checksum covers the LS sequence
  5913. number.)
  5914.  
  5915. If the contents are different, the following pieces of the routing table
  5916. must be recalculated, depending on the LS type field:
  5917.  
  5918.  
  5919. Router links, network links
  5920.     The entire routing table must be recalculated, starting with the
  5921.     shortest path calculations for each area (not just the area whose
  5922.     topological database has changed).  The reason that the shortest
  5923.     path calculation cannot be restricted to the single changed area has
  5924.     to do with the fact that AS boundary routers may belong to multiple
  5925.     areas.  A change in the area currently providing the best route may
  5926.     force the router to use an intra-area route provided by a different
  5927.     area.[15]
  5928.  
  5929. Summary link
  5930.     The best route to the destination described by the summary link
  5931.     advertisement must be re-examined (see Section 16.5).  If this
  5932.     destination is an AS boundary router, it may also be necessary to
  5933.  
  5934.  
  5935.  
  5936. [Moy]                                                         [Page 106]
  5937.  
  5938. RFC 1247                     OSPF Version 2                    July 1991
  5939.  
  5940.  
  5941.     re-examine all the AS external link advertisements.
  5942.  
  5943. AS external link
  5944.     The best route to the destination described by the AS external link
  5945.     advertisement must be re-examined (see Section 16.6).
  5946.  
  5947.  
  5948. Also, any old instance of the advertisement must be removed from the
  5949. database when the new advertisement is installed.  This old instance
  5950. must also be removed from all neighbors' Link state retransmission lists
  5951. (see Section 10).
  5952.  
  5953.  
  5954. 13.3 Next step in the flooding procedure
  5955.  
  5956. When a new (and more recent) advertisement has been received, it must be
  5957. flooded out some set of the router's interfaces.  This section describes
  5958. the second part of flooding procedure (the first part being the
  5959. processing that occurred in Section 13), namely, selecting the outgoing
  5960. interfaces and adding the advertisement to the appropriate neighbors'
  5961. Link state retransmission lists.  Also included in this part of the
  5962. flooding procedure is the maintenance of the neighbors' Link state
  5963. request lists.
  5964.  
  5965. This section is equally applicable to the flooding of an advertisement
  5966. that the router itself has just originated (see Section 12.4).  For
  5967. these advertisements, this section provides the entirety of the flooding
  5968. procedure (i.e., the processing of Section 13 is not performed, since,
  5969. for example, the advertisement has not been received from a neighbor and
  5970. therefore does not need to be acknowledged).
  5971.  
  5972. Depending upon the advertisement's LS type, the advertisement can be
  5973. flooded out only certain interfaces.  These interfaces, defined by the
  5974. following, are called the eligible interfaces:
  5975.  
  5976.  
  5977. AS external links (LS Type = 5)
  5978.     AS external links are flooded throughout the entire AS, with the
  5979.     exception of stub areas (see Section 3.6).  The eligible interfaces
  5980.     are all the router's interfaces, excluding virtual links and those
  5981.     interfaces attaching to stub areas.
  5982.  
  5983. All other types
  5984.     All other types are specific to a single area (Area A).  The
  5985.     eligible interfaces are all those interfaces attaching to the Area
  5986.     A.  If Area A is the backbone, this includes all the virtual links.
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992. [Moy]                                                         [Page 107]
  5993.  
  5994. RFC 1247                     OSPF Version 2                    July 1991
  5995.  
  5996.  
  5997. Link state databases must remain synchronized over all adjacencies
  5998. associated with the above eligible interfaces.  This is accomplished by
  5999. executing the following steps on each eligible interface.  It should be
  6000. noted that this procedure may decide not to flood a link state
  6001. advertisement out a particular interface, if there is a high probability
  6002. that the attached neighbors have already received the advertisement.
  6003. However, in these cases the flooding procedure must be absolutely sure
  6004. that the neighbors eventually do receive the advertisement, so the
  6005. advertisement is still added to each adjacency's Link state
  6006. retransmission list.  For each eligible interface:
  6007.  
  6008.  
  6009. (1) Each of the neighbors attached to this interface are examined, to
  6010.     determine whether they must receive the new advertisement.  The
  6011.     following steps are executed for each neighbor:
  6012.  
  6013.     (a) If the neighbor is in a lesser state than Exchange, it does not
  6014.         participate in flooding, and the next neighbor should be
  6015.         examined.
  6016.  
  6017.     (b) Else, if the adjacency is not yet full (neighbor state is
  6018.         Exchange or Loading), examine the Link state request list
  6019.         associated with this adjacency.  If there is an instance of the
  6020.         new advertisement on the list, it indicates that the neighboring
  6021.         router has an instance of the advertisement already.  Compare
  6022.         the new advertisement to the neighbor's copy:
  6023.  
  6024.         o   If the new advertisement is less recent, then try the next
  6025.             neighbor.
  6026.  
  6027.         o   If the two copies are the same instance, then delete the
  6028.             advertisement from the Link state request list, and try the
  6029.             next neighbor.[16]
  6030.  
  6031.         o   Else, the new advertisement is more recent.  Delete the
  6032.             advertisement from the Link state request list.
  6033.  
  6034.     (c) If the new advertisement was received from this neighbor, try
  6035.         the next neighbor.
  6036.  
  6037.     (d) At this point we are not positive that the new neighbor has an
  6038.         up-to-date instance of this new advertisement.  Add the new
  6039.         advertisement to the Link state retransmission list for the
  6040.         adjacency.  This ensures that the flooding procedure is
  6041.         reliable; the advertisement will be retransmitted at intervals
  6042.         until an acknowledgment is seen from the neighbor.
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048. [Moy]                                                         [Page 108]
  6049.  
  6050. RFC 1247                     OSPF Version 2                    July 1991
  6051.  
  6052.  
  6053. (2) The router must now decide whether to flood the new link state
  6054.     advertisement out this interface.  If in the previous step, the link
  6055.     state advertisement was NOT added to any of the Link state
  6056.     retransmission lists, there is no need to flood the advertisement
  6057.     and the next interface should be examined.
  6058.  
  6059. (3) If the new advertisement was received on this interface, and it was
  6060.     received from either the Designated Router or the Backup Designated
  6061.     Router, chances are all the neighbors have received the
  6062.     advertisement already.  Therefore, examine the next interface.
  6063.  
  6064. (4) If the new advertisement was received on this interface, and the
  6065.     interface state is Backup (i.e., the router itself is the Backup
  6066.     Designated Router), examine the next interface.  The Designated
  6067.     Router will do the flooding on this interface.  If the Designated
  6068.     Router fails, this router will end up retransmitting the updates.
  6069.  
  6070. (5) If this step is reached, the advertisement must be flooded out the
  6071.     interface.  Send a Link State Update packet (with the new
  6072.     advertisement as contents) out the interface.  The advertisement's
  6073.     LS age must be incremented by InfTransDelay (which must be > 0) when
  6074.     copied into the outgoing packet (until the LS age field reaches its
  6075.     maximum value of MaxAge).
  6076.  
  6077.     On broadcast networks, the Link State Update packets are multicast.
  6078.     The destination IP address specified for the Link State Update
  6079.     Packet depends on the state of the interface.  If the interface
  6080.     state is DR or Backup, the address AllSPFRouters should be used.
  6081.     Otherwise, the address AllDRouters should be used.
  6082.  
  6083.     On non-broadcast, multi-access networks, separate Link State Update
  6084.     packets must be sent, as unicasts, to each adjacent neighbor (i.e.,
  6085.     those in state Exchange or greater).  The destination IP addresses
  6086.     for these packets are the neighbors' IP addresses.
  6087.  
  6088.  
  6089. 13.4 Receiving self-originated link state
  6090.  
  6091. It is a common occurrence to receive a self-originated link state
  6092. advertisement via the flooding procedure.  If the advertisement received
  6093. is a newer instance than the last instance that the router actually
  6094. originated, the router must take special action.
  6095.  
  6096. The reception of such an advertisement indicates that there are link
  6097. state advertisements in the routing domain that were originated before
  6098. the last time the router was restarted.  In this case, the router must
  6099. advance the sequence number for the advertisement one past the received
  6100. sequence number, and originate a new instance of the advertisement.
  6101.  
  6102.  
  6103.  
  6104. [Moy]                                                         [Page 109]
  6105.  
  6106. RFC 1247                     OSPF Version 2                    July 1991
  6107.  
  6108.  
  6109. Note also that if the type of the advertisement is Summary link or AS
  6110. external link, the router may no longer have an (advertisable) route to
  6111. the destination.  In this case, the advertisement should be flushed from
  6112. the routing domain by incrementing the advertisement's LS age to MaxAge
  6113. and reflooding (see Section 14.1).
  6114.  
  6115.  
  6116. 13.5 Sending Link State Acknowledgment packets
  6117.  
  6118. Each newly received link state advertisement must be acknowledged.  This
  6119. is usually done by sending Link State Acknowledgment packets.  However,
  6120. acknowledgments can also be accomplished implicitly by sending Link
  6121. State Update packets (see step 7a of Section 13).
  6122.  
  6123. Many acknowledgments may be grouped together into a single Link State
  6124. Acknowledgment packet.  Such a packet is sent back out the interface
  6125. that has received the advertisements.  The packet can be sent in one of
  6126. two ways: delayed and sent on an interval timer, or sent directly (as a
  6127. unicast) to a particular neighbor.  The particular acknowledgment
  6128. strategy used depends on the circumstances surrounding the receipt of
  6129. the advertisement.
  6130.  
  6131. Sending delayed acknowledgments accomplishes several things: it
  6132. facilitates the packaging of multiple acknowledgments in a single
  6133. packet; it enables a single packet to indicate acknowledgments to
  6134. several neighbors at once (through multicasting); and it randomizes the
  6135. acknowledgment packets sent by the various routers attached to a multi-
  6136. access network.  The fixed interval between a router's delayed
  6137. transmissions must be short (less than RxmtInterval) or needless
  6138. retransmissions will ensue.
  6139.  
  6140. Direct acknowledgments are sent to a particular neighbor in response to
  6141. the receipt of duplicate link state advertisements.  These
  6142. acknowledgments are sent as unicasts, and are sent immediately when the
  6143. duplicate is received.
  6144.  
  6145. The precise procedure for sending Link State Acknowledgment packets is
  6146. described in Table 19.  The circumstances surrounding the receipt of the
  6147. advertisement are listed in the left column.  The acknowledgment action
  6148. then taken is listed in one of the two right columns.  This action
  6149. depends on the state of the concerned interface; interfaces in state
  6150. Backup behave differently from interfaces in all other states.
  6151.  
  6152.  
  6153.                                      Action taken in state
  6154.      Circumstances          Backup               All other states
  6155.      ______________________________________________________________
  6156.  
  6157.  
  6158.  
  6159.  
  6160. [Moy]                                                         [Page 110]
  6161.  
  6162. RFC 1247                     OSPF Version 2                    July 1991
  6163.  
  6164.  
  6165.                                      Action taken in state
  6166.      Circumstances          Backup               All other states
  6167.      ______________________________________________________________
  6168. Advertisement  has     No  acknowledgment   No  acknowledgment
  6169. been  flooded back     sent.                sent.
  6170. out receiving  in-
  6171. terface  (see Sec-
  6172. tion 13, step 5b).
  6173. ______________________________________________________________
  6174. Advertisement   is     Delayed       ack-   Delayed       ack-
  6175. more  recent  than     nowledgment   sent   nowledgment sent.
  6176. database copy, but     if   advertisement
  6177. was   not  flooded     received  from DR,
  6178. back out receiving     otherwise do noth-
  6179. interface              ing
  6180. ______________________________________________________________
  6181. Advertisement is a     Delayed       ack-   No  acknowledgment
  6182. duplicate, and was     nowledgment   sent   sent.
  6183. treated as an  im-     if   advertisement
  6184. plied  acknowledg-     received  from DR,
  6185. ment (see  Section     otherwise do noth-
  6186. 13, step 7a).          ing
  6187. ______________________________________________________________
  6188. Advertisement is a     Direct acknowledg-   Direct acknowledg-
  6189. duplicate, and was     ment sent.           ment sent.
  6190. not treated as  an
  6191. implied       ack-
  6192. nowledgment.
  6193. ______________________________________________________________
  6194. Advertisement's age    Direct acknowledg-   Direct acknowledg-
  6195. is equal to MaxAge,    ment sent.           ment sent.
  6196. and there is no
  6197. current instance of
  6198. the advertisement in
  6199. the link state
  6200. database (see
  6201. Section 13, step 4).
  6202.  
  6203.  
  6204.              Table 19: Sending link state acknowledgements.
  6205.  
  6206. Delayed acknowledgments must be delivered to all adjacent routers
  6207. associated with the interface.  On broadcast networks, this is
  6208. accomplished by sending the delayed Link State Acknowledgment packets as
  6209. multicasts.  The Destination IP address used depends on the state of the
  6210. interface.  If the state is DR or Backup, the destination AllSPFRouters
  6211. is used.  In other states, the destination AllDRouters is used.  On
  6212. non-broadcast networks, delayed acks must be unicast separately over
  6213.  
  6214.  
  6215.  
  6216. [Moy]                                                         [Page 111]
  6217.  
  6218. RFC 1247                     OSPF Version 2                    July 1991
  6219.  
  6220.  
  6221. each adjacency (neighbor whose state is >= Exchange).
  6222.  
  6223. The reasoning behind sending the above packets as multicasts is best
  6224. explained by an example.  Consider the network configuration depicted in
  6225. Figure 15.  Suppose RT4 has been elected as DR, and RT3 as Backup for
  6226. the network N3.  When router RT4 floods a new advertisement to network
  6227. N3, it is received by routers RT1, RT2, and RT3.  These routers will not
  6228. flood the advertisement back onto net N3, but they still must ensure
  6229. that their topological databases remain synchronized with their adjacent
  6230. neighbors.  So RT1, RT2, and RT4 are waiting to see an acknowledgment
  6231. from RT3.  Likewise, RT4 and RT3 are both waiting to see acknowledgments
  6232. from RT1 and RT2.  This is best achieved by sending the acknowledgments
  6233. as multicasts.
  6234.  
  6235. The reason that the acknowledgment logic for Backup DRs is slightly
  6236. different is because they perform differently during the flooding of
  6237. link state advertisements (see Section 13.3, step 4).
  6238.  
  6239.  
  6240.  
  6241. 13.6 Retransmitting link state advertisements
  6242.  
  6243. Advertisements flooded out an adjacency are placed on the adjacency's
  6244. Link state retransmission list.  In order to ensure that flooding is
  6245. reliable, these advertisements are retransmitted until they are
  6246. acknowledged.  The length of time between retransmissions is a
  6247. configurable per-interface value, RxmtInterval.  If this is set too low
  6248. for an interface, needless retransmissions will ensue.  If the value is
  6249. set too high, the speed of the flooding, in the face of lost packets,
  6250. may be affected.
  6251.  
  6252. Several retransmitted advertisements may fit into a single Link State
  6253. Update packet.  When advertisements are to be retransmitted, only the
  6254. number fitting in a single Link State Update packet should be
  6255. transmitted.  Another packet of retransmissions can be sent when some of
  6256. the advertisements are acknowledged, or on the next firing of the
  6257. retransmission timer.
  6258.  
  6259. Link State Update Packets carrying retransmissions are always sent as
  6260. unicasts (directly to the physical address of the neighbor).  They are
  6261. never sent as multicasts.  Each advertisement's LS age must be
  6262. incremented by InfTransDelay (which must be > 0) when copied into the
  6263. outgoing packet (until the LS age field reaches its maximum value of
  6264. MaxAge).
  6265.  
  6266. If the adjacent router goes down, retransmissions may occur until the
  6267. adjacency is destroyed by OSPF's Hello Protocol.  When the adjacency is
  6268. destroyed, the Link state retransmission list is cleared.
  6269.  
  6270.  
  6271.  
  6272. [Moy]                                                         [Page 112]
  6273.  
  6274. RFC 1247                     OSPF Version 2                    July 1991
  6275.  
  6276.  
  6277. 13.7 Receiving link state acknowledgments
  6278.  
  6279. Many consistency checks have been made on a received Link State
  6280. Acknowledgment packet before it is handed to the flooding procedure.  In
  6281. particular, it has been associated with a particular neighbor.  If this
  6282. neighbor is in a lesser state than Exchange, the packet is discarded.
  6283.  
  6284. Otherwise, for each acknowledgment in the packet, the following steps
  6285. are performed:
  6286.  
  6287.  
  6288. o   Does the advertisement acknowledged have an instance on the Link
  6289.     state retransmission list for the neighbor?  If not, examine the
  6290.     next acknowledgment.  Otherwise:
  6291.  
  6292. o   If the acknowledgment is for the same instance that is contained on
  6293.     the list, remove the item from the list and examine the next
  6294.     acknowledgment.  Otherwise:
  6295.  
  6296. o   Log the questionable acknowledgment, and examine the next one.
  6297.  
  6298.  
  6299. 14. Aging The Link State Database
  6300.  
  6301. Each link state advertisement has an age field.  The age is expressed in
  6302. seconds.  An advertisement's age field is incremented while it is
  6303. contained in a router's database.  Also, when copied into a Link State
  6304. Update Packet for flooding out a particular interface, the
  6305. advertisement's age is incremented by InfTransDelay.
  6306.  
  6307. An advertisement's age is never incremented past the value MaxAge.
  6308. Advertisements having age MaxAge are not used in the routing table
  6309. calculation.  As a router ages its link state database, an
  6310. advertisement's age may reach MaxAge.[17] At this time, the router must
  6311. attempt to flush the advertisement from the routing domain.  This is
  6312. done simply by reflooding the MaxAge advertisement just as if it was a
  6313. newly originated advertisement (see Section 13.3).
  6314.  
  6315. When a Database summary list for a newly adjacent neighbor is formed,
  6316. any MaxAge advertisements present in the link state database are added
  6317. to the neighbor's Link state retransmission list instead of the
  6318. neighbor's Database summary list.  See Section 10.3 for more details.
  6319.  
  6320. A MaxAge advertisement is removed entirely from the router's link state
  6321. database when a) it is no longer contained on any neighbor Link state
  6322. retransmission lists and b) none of the router's neighbors are in states
  6323. Exchange or Loading.
  6324.  
  6325.  
  6326.  
  6327.  
  6328. [Moy]                                                         [Page 113]
  6329.  
  6330. RFC 1247                     OSPF Version 2                    July 1991
  6331.  
  6332.  
  6333. When, in the process of aging the link state database, an
  6334. advertisement's age hits a multiple of CheckAge, its checksum should be
  6335. verified.  If the checksum is incorrect, a program or memory error has
  6336. been detected, and at the very least the router itself should be
  6337. restarted.
  6338.  
  6339.  
  6340. 14.1 Premature aging of advertisements
  6341.  
  6342. A link state advertisement can be flushed from the routing domain by
  6343. setting its age to MaxAge and reflooding the advertisement.  This
  6344. procedure follows the same course as flushing an advertisement whose age
  6345. has naturally reached the value MaxAge (see Section 14).  In particular,
  6346. the MaxAge advertisement is removed from the router's link state
  6347. database as soon as a) it is no longer contained on any neighbor Link
  6348. state retransmission lists and b) none of the router's neighbors are in
  6349. states Exchange or Loading.  We call the setting of an advertisement's
  6350. age to MaxAge premature aging.
  6351.  
  6352. Premature aging is used when it is time for a self-originated
  6353. advertisement's sequence number field to wrap.  At this point, the
  6354. current advertisement instance (having LS sequence number of 0x7fffffff)
  6355. must be prematurely aged and flushed from the routing domain before a
  6356. new instance with sequence number 0x80000001 can be originated.  See
  6357. Section 12.1.6 for more information.
  6358.  
  6359. Premature aging can also be used when, for example, one of the router's
  6360. previously advertised external routes is no longer reachable.  In this
  6361. circumstance, the router can flush its external advertisement from the
  6362. routing domain via premature aging.  This procedure is preferable to the
  6363. alternative, which is to originate a new advertisement for the
  6364. destination specifying a metric of LSInfinity.
  6365.  
  6366. A router may only prematurely age its own (self-originated) link state
  6367. advertisements.  These are the link state advertisements having the
  6368. router's own OSPF Router ID in the Advertising Router field.
  6369.  
  6370.  
  6371. 15. Virtual Links
  6372.  
  6373. The single backbone area (Area ID = 0) cannot be disconnected, or some
  6374. areas of the Autonomous System will become unreachable.  To
  6375. establish/maintain connectivity of the backbone, virtual links can be
  6376. configured through non-backbone areas.  Virtual links serve to connect
  6377. separate components of the backbone.  The two endpoints of a virtual
  6378. link are area border routers.  The virtual link must be configured in
  6379. both routers.  The configuration information in each router consists of
  6380. the other virtual endpoint (the other area border router), and the non-
  6381.  
  6382.  
  6383.  
  6384. [Moy]                                                         [Page 114]
  6385.  
  6386. RFC 1247                     OSPF Version 2                    July 1991
  6387.  
  6388.  
  6389. backbone area the two routers have in common (called the transit area).
  6390. Virtual links cannot be configured through stub areas (see Section 3.6).
  6391.  
  6392. The virtual link is treated as if it were an unnumbered point-to-point
  6393. network (belonging to the backbone) joining the two area border routers.
  6394. An attempt is made to establish an adjacency over the virtual link.
  6395. When this adjacency is established, the virtual link will be included in
  6396. backbone router links advertisements, and OSPF packets pertaining to the
  6397. backbone area will flow over the adjacency.  Such an adjacency has been
  6398. referred to as a "virtual adjacency".
  6399.  
  6400. In each endpoint router, the cost and viability of the virtual link is
  6401. discovered by examining the routing table entry for the other endpoint
  6402. router.  (The entry's associated area must be the configured transit
  6403. area).  Actually, there may be a separate routing table entry for each
  6404. Type of Service.  These are called the virtual link's corresponding
  6405. routing table entries.  The Interface Up event occurs for a virtual link
  6406. when its corresponding TOS 0 routing table entry becomes reachable.
  6407. Conversely, the Interface Down event occurs when its TOS 0 routing table
  6408. entry becomes unreachable.[18] In other words, the virtual link's
  6409. viability is determined by the existence of an intra-area path, through
  6410. the transit area, between the two endpoints.  The other details
  6411. concerning virtual links are as follows:
  6412.  
  6413. o   AS external links are NEVER flooded over virtual adjacencies.  This
  6414.     would be duplication of effort, since the same AS external links are
  6415.     already flooded throughout the virtual link's transit area.  For
  6416.     this same reason, AS external link advertisements are not summarized
  6417.     over virtual adjacencies during the database exchange process.
  6418.  
  6419. o   The cost of a virtual link is NOT configured.  It is defined to be
  6420.     the cost of the intra-area path between the two defining area border
  6421.     routers.  This cost appears in the virtual link's corresponding
  6422.     routing table entry.  When the cost of a virtual link changes, a new
  6423.     router links advertisement should be originated for the backbone
  6424.     area.
  6425.  
  6426. o   Just as the virtual link's cost and viability are determined by the
  6427.     routing table build process (through construction of the routing
  6428.     table entry for the other endpoint), so are the IP interface address
  6429.     for the virtual interface and the virtual neighbor's IP address.
  6430.     These are used when sending protocol packets over the virtual link.
  6431.  
  6432. o   In each endpoint's router links advertisement for the backbone, the
  6433.     virtual link is represented as a link having link type 4, Link ID
  6434.     set to the virtual neighbor's OSPF Router ID and Link Data set to
  6435.     the virtual interface's IP address.  See Section 12.4.1 for more
  6436.     information.  Also, it may be the case that there is a TOS 0 path,
  6437.  
  6438.  
  6439.  
  6440. [Moy]                                                         [Page 115]
  6441.  
  6442. RFC 1247                     OSPF Version 2                    July 1991
  6443.  
  6444.  
  6445.     but no non-zero TOS paths to the other endpoint router.  In this
  6446.     case, non-zero TOS costs must be set to LSInfinity in the router
  6447.     links advertisement.
  6448.  
  6449. o   When virtual links are configured for the backbone, information
  6450.     concerning backbone networks should not be condensed before being
  6451.     summarized for the transit areas.  In other words, each backbone
  6452.     network should be advertised in a separate summary link
  6453.     advertisement, regardless of the backbone's configured area address
  6454.     ranges.  See Section 12.4.3 for more information.
  6455.  
  6456. o   The time between link state retransmissions, RxmtInterval, is
  6457.     configured for a virtual link.  This should be well over the
  6458.     expected round-trip delay between the two routers.  This may be hard
  6459.     to estimate for a virtual link.  It is better to err on the side of
  6460.     making it too large.
  6461.  
  6462.  
  6463. 16. Calculation Of The Routing Table
  6464.  
  6465. This section details the OSPF routing table calculation.  Using its
  6466. attached areas' link state databases as input, a router runs the
  6467. following algorithm, building its routing table step by step.  At each
  6468. step, the router must access individual pieces of the link state
  6469. databases (e.g., a router links advertisement originated by a certain
  6470. router).  This access is performed by the lookup function discussed in
  6471. Section 12.2.  The lookup process may return a link state advertisement
  6472. whose LS age is equal to MaxAge.  Such an advertisement should not be
  6473. used in the routing table calculation, and is treated just as if the
  6474. lookup process had failed.
  6475.  
  6476. The OSPF routing table's organization is explained in Section 11.  Two
  6477. examples of the routing table build process are presented in Sections
  6478. 11.2 and 11.3.  This process can be broken into the following steps:
  6479.  
  6480.  
  6481. (1) The present routing table is invalidated.  The routing table is
  6482.     built again from scratch.  The old routing table is saved so that
  6483.     changes in routing table entries can be identified.
  6484.  
  6485. (2) The intra-area routes are calculated by building the shortest path
  6486.     tree for each attached area.  In particular, all routing table
  6487.     entries whose Destination type is "area border router" are
  6488.     calculated in this step.  This step is described in two parts.  At
  6489.     first the tree is constructed by only considering those links
  6490.     between routers and transit networks.  Then the stub networks are
  6491.     incorporated into the tree.
  6492.  
  6493.  
  6494.  
  6495.  
  6496. [Moy]                                                         [Page 116]
  6497.  
  6498. RFC 1247                     OSPF Version 2                    July 1991
  6499.  
  6500.  
  6501. (3) The inter-area routes are calculated, through examination of summary
  6502.     link advertisements.  If the router is attached to multiple areas
  6503.     (i.e., it is an area border router), only backbone summary link
  6504.     advertisements are examined.
  6505.  
  6506. (4) For those routing entries whose next hop is over a virtual link, a
  6507.     real (physical) next hop is calculated.  The real next hop will be
  6508.     on one of the router's directly attached networks.  This step only
  6509.     concerns routers having configured virtual links.
  6510.  
  6511. (5) Routes to external destinations are calculated, through examination
  6512.     of AS external link advertisements.  The location of the AS boundary
  6513.     routers (which originate the AS external link advertisements) has
  6514.     been determined in steps 2-4.
  6515.  
  6516.  
  6517. Steps 2-5 are explained in further detail below.  The explanations
  6518. describe the calculations for TOS 0 only.  It may also be necessary to
  6519. perform each step (separately) for each of the non-zero TOS values.[19]
  6520. For more information concerning the building of non-zero TOS routes see
  6521. Section 16.9.
  6522.  
  6523. Changes made to routing table entries as a result of these calculations
  6524. can cause the OSPF protocol to take further actions.  For example, a
  6525. change to an intra-area route will cause an area border router to
  6526. originate new summary link advertisements (see Section 12.4).  See
  6527. Section 16.7 for a complete list of the OSPF protocol actions resulting
  6528. from routing table table changes.
  6529.  
  6530.  
  6531. 16.1 Calculating the shortest-path tree for an area
  6532.  
  6533. This calculation yields the set of intra-area routes associated with an
  6534. area (called hereafter Area A).  A router calculates the shortest-path
  6535. tree using itself as the root.[20] The formation of the shortest path
  6536. tree is done here in two stages.  In the first stage, only links between
  6537. routers and transit networks are considered.  Using the Dijkstra
  6538. algorithm, a tree is formed from this subset of the link state database.
  6539. In the second stage, leaves are added to the tree by considering the
  6540. links to stub networks.
  6541.  
  6542. The procedure will be explained using the graph terminology that was
  6543. introduced in Section 2.  The area's link state database is represented
  6544. as a directed graph.  The graph's vertices are routers, transit networks
  6545. and stub networks.  The first stage of the procedure concerns only the
  6546. transit vertices (routers and transit networks) and their connecting
  6547. links.  Throughout the shortest path calculation, the following data is
  6548. also associated with each transit vertex:
  6549.  
  6550.  
  6551.  
  6552. [Moy]                                                         [Page 117]
  6553.  
  6554. RFC 1247                     OSPF Version 2                    July 1991
  6555.  
  6556.  
  6557. Vertex (node) ID
  6558.     A 32-bit number uniquely identifying the vertex.  For router
  6559.     vertices this is the OSPF Router ID.  For network vertices, this is
  6560.     the IP address of the network's Designated Router.
  6561.  
  6562. A link state advertisement
  6563.     Each transit vertex has an associated link state advertisement.  For
  6564.     router vertices, this is a router links advertisement.  For transit
  6565.     networks, this is a network links advertisement (which is actually
  6566.     originated by the network's Designated Router).  In any case, the
  6567.     advertisement's Link State ID is always equal to the above Vertex
  6568.     ID.
  6569.  
  6570. List of next hops
  6571.     The list of next hops for the current shortest paths from the root
  6572.     to this vertex.  There can be multiple shortest paths due to the
  6573.     equal-cost multipath capability.  Each next hop indicates the
  6574.     outgoing router interface to use when forwarding traffic to the
  6575.     destination.  On multi-access networks, the next hop also includes
  6576.     the IP address of the next router (if any) in the path towards the
  6577.     destination.
  6578.  
  6579. Distance from root
  6580.     The link state cost of the current shortest path(s) from the root to
  6581.     the vertex.  The link state cost of a path is calculated as the sum
  6582.     of the costs of the path's constituent links (as advertised in
  6583.     router links and network links advertisements).  One path is said to
  6584.     be "shorter" than another if it has a smaller link state cost.
  6585.  
  6586.  
  6587. The first stage of the procedure can now be summarized as follows.  At
  6588. each iteration of the algorithm, there is a list of candidate vertices.
  6589. The shortest paths from the root to these vertices have not
  6590. (necessarily) been found.  The candidate vertex closest to the root is
  6591. added to the shortest-path tree, removed from the candidate list, and
  6592. its adjacent vertices are examined for possible addition to/modification
  6593. of the candidate list.  The algorithm then iterates again.  It
  6594. terminates when the candidate list becomes empty.
  6595.  
  6596. The following steps describe the first stage in detail.  Remember that
  6597. we are computing the shortest path tree for Area A.  All references to
  6598. link state database lookup below are from Area A's database.
  6599.  
  6600.  
  6601. (1) Initialize the algorithm's data structures.  Clear the list of
  6602.     candidate vertices.  Initialize the shortest-path tree to only the
  6603.     root (which is the router doing the calculation).
  6604.  
  6605.  
  6606.  
  6607.  
  6608. [Moy]                                                         [Page 118]
  6609.  
  6610. RFC 1247                     OSPF Version 2                    July 1991
  6611.  
  6612.  
  6613. (2) Call the vertex just added to the tree vertex V.  Examine the link
  6614.     state advertisement associated with vertex V.  This is a lookup in
  6615.     the area link state database based on the Vertex ID.  Each link
  6616.     described by the advertisement gives the cost to an adjacent vertex.
  6617.     For each described link, (say it joins vertex V to vertex W):
  6618.  
  6619.     (a) If this is a link to a stub network, examine the next link in
  6620.         V's advertisement.  Links to stub networks will be considered in
  6621.         the second stage of the shortest path calculation.
  6622.  
  6623.     (b) Otherwise, W is a transit vertex (router or transit network).
  6624.         Look up the vertex W's link state advertisement (router links or
  6625.         network links) in Area A's link state database.  If the
  6626.         advertisement does not exist, or its age is equal to MaxAge, or
  6627.         it does not have a link back to vertex V, examine the next link
  6628.         in V's advertisement.  Both ends of a link must advertise the
  6629.         link before it will be used for data traffic.[21]
  6630.  
  6631.     (c) If vertex W is already on the shortest-path tree, examine the
  6632.         next link in the advertisement.
  6633.  
  6634.     (d) If the cost of the link (from V to W) is LSInfinity, the link
  6635.         should not be used for data traffic.  In this case, examine the
  6636.         next link in the advertisement.
  6637.  
  6638.     (e) Calculate the link state cost D of the resulting path from the
  6639.         root to vertex W.  D is equal to the sum of the link state cost
  6640.         of the (already calculated) shortest path to vertex V and the
  6641.         advertised cost of the link between vertices V and W.  If D is:
  6642.  
  6643.         o   Greater than the value that already appears for vertex W on
  6644.             the candidate list, then examine the next link.
  6645.  
  6646.         o   Equal to the value that appears for vertex W on the the
  6647.             candidate list, calculate the set of next hops that result
  6648.             from using the advertised link.  Input to this calculation
  6649.             is the destination (W), and its parent (V).  This
  6650.             calculation is shown in Section 16.1.1.  This set of hops
  6651.             should be added to the next hop values that appear for W on
  6652.             the candidate list.
  6653.  
  6654.         o   Less than the value that appears for vertex W on the the
  6655.             candidate list, or if W does not yet appear on the candidate
  6656.             list, then set the entry for W on the candidate list to
  6657.             indicate a distance of D from the root.  Also calculate the
  6658.             list of next hops that result from using the advertised
  6659.             link, setting the next hop values for W accordingly.  The
  6660.             next hop calculation is described in Section 16.1.1; it
  6661.  
  6662.  
  6663.  
  6664. [Moy]                                                         [Page 119]
  6665.  
  6666. RFC 1247                     OSPF Version 2                    July 1991
  6667.  
  6668.  
  6669.             takes as input the destination (W) and its parent (V).
  6670.  
  6671. (3) If at this step the candidate list is empty, the shortest-path tree
  6672.     (of transit vertices) has been completely built and this stage of
  6673.     the algorithm terminates.  Otherwise, choose the vertex belonging to
  6674.     the candidate list that is closest to the root, and add it to the
  6675.     shortest-path tree (removing it from the candidate list in the
  6676.     process).
  6677.  
  6678. (4) Possibly modify the routing table.  For those routing table entries
  6679.     modified, the associated area will be set to Area A, the path type
  6680.     will be set to intra-area, and the cost will be set to the newly
  6681.     discovered shortest path's calculated distance.
  6682.  
  6683.     If the newly added vertex is an area border router, a routing table
  6684.     entry is added whose destination type is "area border router".  The
  6685.     Options field found in the associated router links advertisement is
  6686.     copied into the routing table entry's Optional capabilities field.
  6687.  
  6688.     If the newly added vertex is an AS boundary router, the routing
  6689.     table entry of type "AS boundary router" for the destination is
  6690.     located.  Since routers can belong to more than one area, it is
  6691.     possible that several sets of intra-area paths exist to the AS
  6692.     boundary router, each set using a different area.  However, the AS
  6693.     boundary router's routing table entry must indicate a set of paths
  6694.     which utilize a single area.  The area leading to the routing table
  6695.     entry is selected as follows: A set of intra-area paths having no
  6696.     virtual next hops is always preferred over a set of intra-area paths
  6697.     in which some virtual next hops appear[22] ; all other things being
  6698.     equal the set of paths having lower cost is preferred.  Note that
  6699.     whenever an AS boundary router's routing table entry is
  6700.     added/modified, the Options found in the associated router links
  6701.     advertisement is copied into the routing table entry's Optional
  6702.     capabilities field.
  6703.  
  6704.     If the newly added vertex is a transit network, the routing table
  6705.     entry for the network is located.  The entry's destination ID is the
  6706.     IP network number, which can be obtained by masking the Vertex ID
  6707.     (Link State ID) with its associated subnet mask (found in the
  6708.     associated network links advertisement).  If the routing table entry
  6709.     already exists (i.e., there is already an intra-area route to the
  6710.     destination installed in the routing table), multiple vertices have
  6711.     mapped to the same IP network.  For example, this can occur when a
  6712.     new Designated Router is being established.  In this case, the
  6713.     current routing table entry should be overwritten if and only if the
  6714.     newly found path is just as short and the current routing table
  6715.     entry's Link State Origin has a smaller Link State ID than the newly
  6716.     added vertex' link state advertisement.
  6717.  
  6718.  
  6719.  
  6720. [Moy]                                                         [Page 120]
  6721.  
  6722. RFC 1247                     OSPF Version 2                    July 1991
  6723.  
  6724.  
  6725.     If there is no routing table entry for the network (the usual case),
  6726.     a routing table entry for the IP network should be added.  The
  6727.     routing table entry's Link State origin should be set to the newly
  6728.     added vertex' link state advertisement.
  6729.  
  6730. (5) Iterate the algorithm by returning to Step 2.
  6731.  
  6732.  
  6733. The stub networks are added to the tree in the procedure's second stage.
  6734. In this stage, all router vertices are again examined.  Those that have
  6735. been determined to be unreachable in the above first phase are
  6736. discarded.  For each reachable router vertex (call it V), the associated
  6737. router links advertisement is found in the link state database.  Each
  6738. stub network link appearing in the advertisement is then examined, and
  6739. the following steps are executed:
  6740.  
  6741.  
  6742. (1) If the cost of the stub network link is LSInfinity, the link should
  6743.     not be used for data traffic.  In this case, go on to examine the
  6744.     next stub network link in the advertisement.
  6745.  
  6746. (2) Otherwise, Calculate the distance D of stub network from the root.
  6747.     D is equal to the distance from the root to the router vertex
  6748.     (calculated in stage 1), plus the stub network link's advertised
  6749.     cost.  Compare this distance to the current best cost to the stub
  6750.     network.  This is done by looking up the network's current routing
  6751.     table entry.  If the calculated distance D is larger, go on to
  6752.     examine the next stub network link in the advertisement.
  6753.  
  6754. (3) If this step is reached, the stub network's routing table entry must
  6755.     be updated.  Calculate the set of next hops that would result from
  6756.     using the stub network link.  This calculation is shown in Section
  6757.     16.1.1; input to this calculation is the destination (the stub
  6758.     network) and the parent vertex (the router vertex).  If the distance
  6759.     D is the same as the current routing table cost, simply add this set
  6760.     of next hops to the routing table entry's list of next hops.  In
  6761.     this case, the routing table already has a Link State origin.  If
  6762.     this Link State origin is a router links advertisement whose Link
  6763.     State ID is smaller than V's Router ID, reset the Link State origin
  6764.     to V's router links advertisement.
  6765.  
  6766.     Otherwise D is smaller than the routing table cost.  Overwrite the
  6767.     current routing table entry by setting the routing table entry's
  6768.     cost to D, and by setting the entry's list of next hops to the newly
  6769.     calculated set.  Set the routing table entry's Link State origin to
  6770.     V's router links advertisement.  Then go on to examine the next stub
  6771.     network link.
  6772.  
  6773.  
  6774.  
  6775.  
  6776. [Moy]                                                         [Page 121]
  6777.  
  6778. RFC 1247                     OSPF Version 2                    July 1991
  6779.  
  6780.  
  6781. For all routing table entries added/modified in the second stage, the
  6782. associated area will be set to Area A and the path type will be set to
  6783. intra-area.  When the list of reachable router links is exhausted, the
  6784. second stage is completed.  At this time, all intra-area routes
  6785. associated with Area A have been determined.
  6786.  
  6787. The specification does not require that the above two stage method be
  6788. used to calculate the shortest path tree.  However, if another algorithm
  6789. is used, an identical tree must be produced.  For this reason, it is
  6790. important to note that links between transit vertices must be
  6791. bidirectional in ordered to be included in the above tree.  It should
  6792. also be mentioned that algorithms exist for incrementally updating the
  6793. shortest-path tree (see [BBN]).
  6794.  
  6795.  
  6796. 16.1.1 The next hop calculation
  6797.  
  6798. This section explains how to calculate the current set of next hops to
  6799. use for a destination.  Each next hop consists of the outgoing interface
  6800. to use in forwarding packets to the destination together with the next
  6801. hop router (if any).  The next hop calculation is invoked each time a
  6802. shorter path to the destination is discovered.  This can happen in
  6803. either stage of the shortest-path tree calculation (see Section 16.1).
  6804. In stage 1 of the shortest-path tree calculation a shorter path is found
  6805. as the destination is added to the candidate list, or when the
  6806. destination's entry on the candidate list is modified (Step 2e of Stage
  6807. 1).  In stage 2 a shorter path is discovered each time the destination's
  6808. routing table entry is modified (Step 3 of Stage 2).
  6809.  
  6810. The set of next hops to use for the destination may be recalculated
  6811. several times during the shortest-path tree calculation, as shorter and
  6812. shorter paths are discovered.  In the end, the destination's routing
  6813. table entry will always reflect the next hops resulting from the
  6814. absolute shortest path(s).
  6815.  
  6816. Input to the next hop calculation is a) the destination and b) its
  6817. parent in the current shortest path between the root (the calculating
  6818. router) and the destination.  The parent is always a transit vertex
  6819. (i.e., always a router or a transit network).
  6820.  
  6821. If there is at least one intervening router in the current shortest path
  6822. between the destination and the root, the destination simply inherits
  6823. the set of next hops from the parent.  Otherwise, there are two cases.
  6824. In the first case, the parent vertex is the root (the calculating router
  6825. itself).  This means that the destination is either a directly connected
  6826. network or directly connected router.  The next hop in this case is
  6827. simply the OSPF interface connecting to the network/router; no next hop
  6828. router is required.
  6829.  
  6830.  
  6831.  
  6832. [Moy]                                                         [Page 122]
  6833.  
  6834. RFC 1247                     OSPF Version 2                    July 1991
  6835.  
  6836.  
  6837. In the second case, the destination is a router, and its parent vertex
  6838. is a network.  The list of next hops is then determined by examining the
  6839. destination's router links advertisement.  For each link in the
  6840. advertisement that points back to the parent network, the link's Link
  6841. Data field provides the IP address of a next hop router.  The outgoing
  6842. interface to use can then be derived from the next hop IP address (or it
  6843. can be inherited from the parent network).
  6844.  
  6845.  
  6846. 16.2 Calculating the inter-area routes
  6847.  
  6848. The inter-area routes are calculated by examining summary link
  6849. advertisements.  If the router has active attachments to multiple areas,
  6850. only backbone summary link advertisements are examined.  Routers
  6851. attached to a single area examine that area's summary links.  In either
  6852. case, the summary links examined below are all part of a single area's
  6853. link state database (call it Area A).
  6854.  
  6855. Summary link advertisements are originated by the area border routers.
  6856. Each summary link advertisement in Area A is considered in turn.
  6857. Remember that the destination described by a summary link advertisement
  6858. is either a network (type 3 summary link advertisements) or an AS
  6859. boundary router (type 4 summary link advertisements).  For each summary
  6860. link advertisement:
  6861.  
  6862.  
  6863. (1) If the cost specified by the advertisement is LSInfinity, then
  6864.     examine the next advertisement.
  6865.  
  6866. (2) If the advertisement was originated by the calculating router
  6867.     itself, examine the next advertisement.
  6868.  
  6869. (3) If the collection of destinations described by the summary link
  6870.     falls into one of the router's configured area address ranges (see
  6871.     Section 3.5) and the particular area address range is active, the
  6872.     summary link should be ignored.  Active means that there are one or
  6873.     more reachable (by intra-area paths) networks contained in the area
  6874.     range.  In this case, all addresses in the area range are assumed to
  6875.     be either reachable via intra-area paths, or else to be unreachable
  6876.     by any other means.
  6877.  
  6878. (4) Else, call the destination described by the advertisement N, and the
  6879.     area border originating the advertisement BR.  Look up the routing
  6880.     table entry for BR having A as its associated area.  If no such
  6881.     entry exists for router BR (i.e., BR is unreachable in Area A), do
  6882.     nothing with this advertisement and consider the next in the list.
  6883.     Else, this advertisement describes an inter-area path to destination
  6884.     N, whose cost is the distance to BR plus the cost specified in the
  6885.  
  6886.  
  6887.  
  6888. [Moy]                                                         [Page 123]
  6889.  
  6890. RFC 1247                     OSPF Version 2                    July 1991
  6891.  
  6892.  
  6893.     advertisement.  Call the cost of this inter-area path IAC.
  6894.  
  6895. (5) Next, look up the routing table entry for the destination N.  (The
  6896.     entry's Destination type is either Network or AS boundary router.)
  6897.     If no entry exists for N or if the entry's path type is "AS
  6898.     external", install the inter-area path to N, with associated area A,
  6899.     cost IAC, next hop equal to the list of next hops to router BR, and
  6900.     advertising router equal to BR.
  6901.  
  6902. (6) Else, if the paths present in the table are intra-area paths, do
  6903.     nothing with the advertisement (intra-area paths are always
  6904.     preferred).
  6905.  
  6906. (7) Else, the paths present in the routing table are also inter-area
  6907.     paths.  Install the new path through BR if it is cheaper, overriding
  6908.     the paths in the routing table.  Otherwise, if the new path is the
  6909.     same cost, add it to the list of paths that appear in the routing
  6910.     table entry.
  6911.  
  6912.  
  6913. 16.3 Resolving virtual next hops
  6914.  
  6915. This step is only necessary in area-border routers having configured
  6916. virtual links.  In these routers, some of the routing table entries may
  6917. have virtual next hops.  That is, one or more of the next hops installed
  6918. in Sections 16.1 and 16.2 may be over a virtual link.  However, when
  6919. forwarding data traffic to a destination, the next hops must always be
  6920. on a directly attached network.
  6921.  
  6922. In this section, each virtual next hop is replaced by a real next hop.
  6923. In the process a new routing table distance is calculated that may be
  6924. smaller than the previously calculated distance.  In this case, the list
  6925. of next hops is pruned so that only those giving rise to the new
  6926. shortest distance are included, and the routing table entry's distance
  6927. is updated accordingly.
  6928.  
  6929.  
  6930.  
  6931.  
  6932.                  ______________________________________
  6933.  
  6934.                  (Figure not included in text version.)
  6935.  
  6936.                  Figure 17: Resolving virtual next hops
  6937.                  ______________________________________
  6938.  
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944. [Moy]                                                         [Page 124]
  6945.  
  6946. RFC 1247                     OSPF Version 2                    July 1991
  6947.  
  6948.  
  6949. This resolution of virtual next hops is done only for Destination types
  6950. Network or AS Boundary router.  Suppose that one of a routing table
  6951. entry's next hops is a virtual link.  This is determined by the
  6952. following combination: the routing table entry's path type is either
  6953. intra-area or inter-area, the area associated with the routing table
  6954. entry must be the backbone, yet the next hop belongs to a different area
  6955. (the virtual link's transit area).
  6956.  
  6957. Let N be the above entry's destination, and A the virtual link's transit
  6958. area.  The real next hop (and new distance) is calculated as follows.
  6959. Let D be a distance counter, and set the real next hop NH to null.
  6960. Then, look up all the summary link advertisements for N in area A's
  6961. database, performing the following steps for each advertisement:[23]
  6962.  
  6963.  
  6964. (1) Call the border router that originated the advertisement BR.  If
  6965.     there is no routing table entry for BR having A as associated area
  6966.     (i.e., BR is unreachable through Area A), examine the next
  6967.     advertisement.
  6968.  
  6969. (2) Else, let X be the distance to BR via Area A.  If the cost
  6970.     advertised by BR (call it Y) to the destination is LSInfinity,
  6971.     examine the next summary link advertisement.  Else, the cost to
  6972.     destination N through area border router BR is X+Y.
  6973.  
  6974. (3) If next hop NH is null or X+Y is smaller is smaller than D, set D to
  6975.     X+Y and set the next hop NH to the next hop specified in router BR's
  6976.     routing table entry.
  6977.  
  6978.  
  6979. At this point, the real next hop NH should be set, and the distance D
  6980. calculated should be less than or equal to the cost originally specified
  6981. in destination N's routing table entry.  This same calculation should be
  6982. done for all of N's virtual next hops, and then N's new cost set to the
  6983. minimum calculated distance, with the its new set of next hops that
  6984. combination of non-virtual and recalculated next hops that correspond to
  6985. this (possibly same as original) distance.
  6986.  
  6987. The resolving of virtual next hops may produce unexpected results.
  6988. After the virtual next hops are resolved, traffic that was originally
  6989. scheduled to go over the virtual link may instead take a different path
  6990. through the virtual link's transit area.  In other words, virtual links
  6991. allow transit traffic to be forwarded through an area, but do not
  6992. dictate the precise path that the traffic will take.
  6993.  
  6994. As an example, consider the Autonomous System pictured in Figure 17.
  6995. There is a single non-backbone area (Area 1) that physically divides the
  6996. backbone into two separate pieces.  To maintain connectivity of the
  6997.  
  6998.  
  6999.  
  7000. [Moy]                                                         [Page 125]
  7001.  
  7002. RFC 1247                     OSPF Version 2                    July 1991
  7003.  
  7004.  
  7005. backbone, a virtual link has been configured between routers RT1 and
  7006. RT4.  On the right side of the figure, network N1 belongs to the
  7007. backbone.  The dotted lines indicate that there is a much shorter
  7008. intra-area backbone path between router RT5 and network N1 (cost 20)
  7009. than there is between router RT4 and network N1 (cost 100).  Both router
  7010. RT4 and router RT5 will inject summary link advertisements for network
  7011. N1 into Area 1.
  7012.  
  7013. After the shortest-path tree has been calculated for the backbone,
  7014. router RT1 (one end of the virtual link) will have selected router RT4
  7015. as the virtual next hop for all data traffic destined for network N1.
  7016. However, since router RT5 is so much closer to network N1, all routers
  7017. internal to Area 1 (e.g., routers RT2 and RT3) will forward their
  7018. network N1 traffic towards router RT5, instead of RT4.  And indeed,
  7019. after resolving the virtual next hop by the above calculation, router
  7020. RT1 will also forward network N1 traffic towards RT5.  So, in this
  7021. example the virtual link enables network N1 traffic to be forwarded
  7022. through the transit Area 1, but the actual path the data traffic takes
  7023. does not follow the virtual link.
  7024.  
  7025.  
  7026. 16.4 Calculating AS external routes
  7027.  
  7028. AS external routes are calculated by examining AS external link
  7029. advertisements.  Each of the AS external link advertisements is
  7030. considered in turn.  Most AS external advertisements describe routes to
  7031. specific IP destinations.  An AS external advertisement can also
  7032. describe a default route for the Autonomous System (destination =
  7033. DefaultDestination).  For each AS external link advertisement:
  7034.  
  7035.  
  7036. (1) If the cost specified by the advertisement is LSInfinity, then
  7037.     examine the next advertisement.
  7038.  
  7039. (2) If the advertisement was originated by the calculating router
  7040.     itself, examine the next advertisement.
  7041.  
  7042. (3) Call the destination described by the advertisement N.  Look up the
  7043.     routing table entry for the AS boundary router (ASBR) that
  7044.     originated the advertisement.  If no entry exists for router ASBR
  7045.     (i.e., ASBR is unreachable), do nothing with this advertisement and
  7046.     consider the next in the list.
  7047.  
  7048.     Else, this advertisement describes an AS external path to
  7049.     destination N.  Examine the forwarding address specified in the
  7050.     external advertisement.  This indicates the IP address to which
  7051.     packets for the destination should be forwarded.  If forwarding
  7052.     address is set to 0.0.0.0, packets should be sent to the ASBR
  7053.  
  7054.  
  7055.  
  7056. [Moy]                                                         [Page 126]
  7057.  
  7058. RFC 1247                     OSPF Version 2                    July 1991
  7059.  
  7060.  
  7061.     itself.  Otherwise, look up the forwarding address in the routing
  7062.     table.[24] An intra-area or inter-area path must exist to the
  7063.     forwarding address.  If no such path exists, do nothing with the
  7064.     advertisement and consider the next in the list.
  7065.  
  7066.     Call the routing table distance to the forwarding address X (when
  7067.     the forwarding address is set to 0.0.0.0, this is the distance to
  7068.     the ASBR itself), and the cost specified in the advertisement Y.  X
  7069.     is in terms of the link state metric, and Y is a Type 1 or 2
  7070.     external metric.
  7071.  
  7072. (4) Next, look up the routing table entry for the destination N.  If no
  7073.     entry exists for N, install the AS external path to N, with next hop
  7074.     equal to the list of next hops to the forwarding address, and
  7075.     advertising router equal to ASBR.  If the external metric type is 1,
  7076.     then the path-type is set to type 1 external and the cost is equal
  7077.     to X+Y.  If the external metric type is 2, the the path-type is set
  7078.     to type 2 external, the link state component of the route's cost is
  7079.     X, and the Type 2 cost is Y.
  7080.  
  7081. (5) Else, if the paths present in the table are not type 1 or type 2
  7082.     external paths, do nothing (AS external paths have the lowest
  7083.     priority).
  7084.  
  7085. (6) Otherwise, compare the cost of this new AS external path to the ones
  7086.     present in the table.  Type 1 external paths are always shorter than
  7087.     Type 2 external paths.  Type 1 external paths are compared by
  7088.     looking at the sum of the distance to the forwarding address and the
  7089.     advertised Type 1 metric (X+Y).  Type 2 external paths are compared
  7090.     by looking at the advertised Type 2 metrics, and then if necessary,
  7091.     the distance to the forwarding addresses.
  7092.  
  7093.     If the new path is shorter, it replaces the present paths in the
  7094.     routing table entry.  If the new path is the same cost, it is added
  7095.     to the routing table entry's list of paths.
  7096.  
  7097.  
  7098. 16.5 Incremental updates --- summary links
  7099.  
  7100. When a new summary link advertisement is received, it is not necessary
  7101. to recalculate the entire routing table.  Call the destination described
  7102. by the summary link advertisement N, and let A be the area to which the
  7103. advertisement belongs.
  7104.  
  7105. Look up the routing table entry for N.  If the next hop to N is a
  7106. virtual link through Area A (this means that the entry's associated area
  7107. is the backbone, and the listed next hop does not belong to the
  7108. backbone, but instead belongs to Area A), the real next hop must again
  7109.  
  7110.  
  7111.  
  7112. [Moy]                                                         [Page 127]
  7113.  
  7114. RFC 1247                     OSPF Version 2                    July 1991
  7115.  
  7116.  
  7117. be resolved.  This means running the algorithm in Section 16.3 for
  7118. destination N only.
  7119.  
  7120. Else, if there is an intra-area route to destination N nothing need be
  7121. done (intra-area routes always take precedence).  Otherwise, if Area A
  7122. is the router's sole attached area, or Area A is the backbone, the
  7123. procedure in Section 16.2 will have to be performed, but only for those
  7124. summary link advertisements whose destination is N.  Before this
  7125. procedure is performed, the present routing table entry for N should be
  7126. invalidated (but kept for comparison purposes).  If this procedure leads
  7127. to a virtual next hop, the algorithm in Section 16.3 will again have to
  7128. be performed in order to calculate the real next hop.
  7129.  
  7130. If N's routing table entry changes, and N is an AS boundary router, the
  7131. AS external links will have to be reexamined (Section 16.4).
  7132.  
  7133.  
  7134. 16.6 Incremental updates --- AS external links
  7135.  
  7136. When a new AS external link advertisement is received, it is not
  7137. necessary to recalculate the entire routing table.  Call the destination
  7138. described by the AS external link advertisement N.  If there is already
  7139. an intra-area or inter-area route to the destination, no recalculation
  7140. is necessary (these routes take precedence).
  7141.  
  7142. Otherwise, the procedure in Section 16.4 will have to be performed, but
  7143. only for those AS external link advertisements whose destination is N.
  7144. Before this procedure is performed, the present routing table entry for
  7145. N should be invalidated.
  7146.  
  7147.  
  7148. 16.7 Events generated as a result of routing table changes
  7149.  
  7150. Changes to routing table entries sometimes cause the OSPF area border
  7151. routers to take additional actions.  These routers need to act on the
  7152. following routing table changes:
  7153.  
  7154.  
  7155. o   The cost or path type of a routing table entry has changed.  If the
  7156.     destination described by this entry is a Network or AS boundary
  7157.     router, and this is not simply a change of AS external routes, new
  7158.     summary link advertisements may have to be generated (potentially
  7159.     one for each attached area, including the backbone).  See Section
  7160.     12.4.3 for more information.  If a previously advertised entry has
  7161.     been deleted, or is no longer advertisable to a particular area, the
  7162.     advertisement must be flushed from the routing domain by setting its
  7163.     age to MaxAge and reflooding (see Section 14.1).
  7164.  
  7165.  
  7166.  
  7167.  
  7168. [Moy]                                                         [Page 128]
  7169.  
  7170. RFC 1247                     OSPF Version 2                    July 1991
  7171.  
  7172.  
  7173. o   A routing table entry associated with a configured virtual link has
  7174.     changed.  The destination of such a routing table entry is an area
  7175.     border router.  The change indicates a modification to the virtual
  7176.     link's cost or viability.
  7177.  
  7178.     If the entry indicates that the area border router is newly
  7179.     reachable (via TOS 0), the corresponding virtual link is now
  7180.     operational.  An Interface Up event should be generated for the
  7181.     virtual link, which will cause a virtual adjacency to begin to form
  7182.     (see Section 10.3).  At this time the virtual interface's IP address
  7183.     and the virtual neighbor's IP address are also calculated.
  7184.  
  7185.     If the entry indicates that the area border router is no longer
  7186.     reachable (via TOS 0), the virtual link and its associated adjacency
  7187.     should be destroyed.  This means an Interface Down event should be
  7188.     generated for the associated virtual link.
  7189.  
  7190.     If the cost of the entry has changed, and there is a fully
  7191.     established virtual adjacency, a new router links advertisement for
  7192.     the backbone must be originated.  This in turn may cause further
  7193.     routing table changes.
  7194.  
  7195.  
  7196. 16.8 Equal-cost multipath
  7197.  
  7198. The OSPF protocol maintains multiple equal-cost routes to all
  7199. destinations.  This can be seen in the steps used above to calculate the
  7200. routing table, and in the definition of the routing table structure.
  7201.  
  7202. Each one of the multiple routes will be of the same type (intra-area,
  7203. inter-area, type 1 external or type 2 external), cost, and will have the
  7204. same associated area.  However, each route specifies a separate next hop
  7205. and advertising router.
  7206.  
  7207. There is no requirement that a router running OSPF keep track of all
  7208. possible equal-cost routes to a destination.  An implementation may
  7209. choose to keep only a fixed number of routes to any given destination.
  7210. This does not affect any of the algorithms presented in this
  7211. specification.
  7212.  
  7213.  
  7214. 16.9 Building the non-zero-TOS portion of the routing table
  7215.  
  7216. The OSPF protocol can calculate a different set of routes for each IP
  7217. TOS (see Section 2.4).  Support for TOS-based routing is optional.
  7218. TOS-capable and non-TOS-capable routers can be mixed in an OSPF routing
  7219. domain.  Routers not supporting TOS calculate only the TOS 0 route to
  7220. each destination.  These routes are then used to forward all data
  7221.  
  7222.  
  7223.  
  7224. [Moy]                                                         [Page 129]
  7225.  
  7226. RFC 1247                     OSPF Version 2                    July 1991
  7227.  
  7228.  
  7229. traffic, regardless of the TOS indications in the data packet's IP
  7230. header.  A router that does not support TOS indicates this fact to the
  7231. other OSPF routers by clearing the T-bit in the Options field of its
  7232. router links advertisement.
  7233.  
  7234. The above sections detailing the routing table calculations handle the
  7235. TOS 0 case only.  In general, for routers supporting TOS-based routing,
  7236. each piece of the routing table calculation must be rerun separately for
  7237. the non-zero TOS values.  When calculating routes for TOS X, only TOS X
  7238. metrics can be used.  Any link state advertisement may specify a
  7239. separate cost for each TOS (a cost for TOS 0 must always be specified).
  7240. The encoding of TOS in OSPF link state advertisements is described in
  7241. Section 12.3.
  7242.  
  7243. An advertisement can specify that it is restricted to TOS 0 (i.e., non-
  7244. zero TOS is not handled) by clearing the T-bit in the link state
  7245. advertisement's Option field.  Such advertisements are not used when
  7246. calculating routes for non-zero TOS.  For this reason, it is possible
  7247. that a destination is unreachable for some non-zero TOS.  In this case,
  7248. the TOS 0 path is used when forwarding packets (see Section 11.1).
  7249.  
  7250. The following lists the modifications needed when running the routing
  7251. table calculation for a non-zero TOS value (called TOS X).  In general,
  7252. routers and advertisements that do not support TOS are omitted from the
  7253. calculation.
  7254.  
  7255.  
  7256. Calculating the shortest-path tree (Section  16.1).
  7257.     Routers that do not support TOS-based routing should be omitted from
  7258.     the shortest-path tree calculation.  These routers are identified as
  7259.     those having the T-bit reset in their router links advertisements.
  7260.     Such routers should never be added to the Dijktra algorithm's
  7261.     candidate list, nor should their router links advertisements be
  7262.     examined when adding the stub networks to the tree.
  7263.  
  7264. Calculating the inter-area routes (Section  16.2).
  7265.     Inter-area paths are the concatenation of a path to an area border
  7266.     router with a summary link.  When calculating TOS X routes, both
  7267.     path components must also specify TOS X.  In other words, only TOS X
  7268.     paths to the area border router are examined, and the area border
  7269.     router must be advertising a TOS X route to the destination.  Note
  7270.     that this means that summary link advertisements having the T-bit
  7271.     reset in their Options field are not considered.
  7272.  
  7273. Resolving virtual next hops (Section 16.3).
  7274.     This calculation again considers the concatenation of a path to an
  7275.     area border router with a summary link.  As with inter-area routes,
  7276.     only TOS X paths to the area border router are examined, and the
  7277.  
  7278.  
  7279.  
  7280. [Moy]                                                         [Page 130]
  7281.  
  7282. RFC 1247                     OSPF Version 2                    July 1991
  7283.  
  7284.  
  7285.     area border router must be advertising a TOS X route to the
  7286.     destination.
  7287.  
  7288. Calculating AS external routes (Section 16.4).
  7289.     This calculation considers the concatenation of a path to a
  7290.     forwarding address with an AS external link.  Only TOS X paths to
  7291.     the forwarding address are examined, and the AS boundary router must
  7292.     be advertising a TOS X route to the destination.  Note that this
  7293.     means that AS external link advertisements having the T-bit reset in
  7294.     their Options field are not considered.
  7295.  
  7296.     In addition, the advertising AS boundary router must also be
  7297.     reachable for its advertisements to be considered (see Section
  7298.     16.4).  However, if the advertising router and the forwarding
  7299.     address are not one in the same, the advertising router need only be
  7300.     reachable via TOS 0.
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.  
  7320.  
  7321.  
  7322.  
  7323.  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.  
  7335.  
  7336. [Moy]                                                         [Page 131]
  7337.  
  7338. RFC 1247                     OSPF Version 2                    July 1991
  7339.  
  7340.  
  7341.     [1]The graph's vertices represent either routers, transit networks,
  7342.     or stub networks.  Since routers may belong to multiple areas, it is
  7343.     not possible to color the graph's vertices.
  7344.  
  7345.     [2]It is possible for all of a router's interfaces to be unnumbered
  7346.     point-to-point links.  In this case, an IP address must be assigned
  7347.     to the router.  This address will then be advertised in the router's
  7348.     router links advertisement as a host route.
  7349.  
  7350.     [3]Note that in these cases both interfaces, the non-virtual and the
  7351.     virtual, would have the same IP address.
  7352.  
  7353.     [4]Note that no host route is generated for, and no IP packets can
  7354.     be addressed to, interfaces to unnumbered point-to-point networks.
  7355.     This is regardless of such an interface's state.
  7356.  
  7357.     [5]It is instructive to see what happens when the Designated Router
  7358.     for the network crashes.  Call the Designated Router for the network
  7359.     RT1, and the the Backup Designated Router RT2.  If router RT1
  7360.     crashes (or maybe its interface to the network dies), the other
  7361.     routers on the network will detect RT1's absence within
  7362.     RouterDeadInterval seconds.  All routers may not detect this at
  7363.     precisely the same time; the routers that detect RT1's absence
  7364.     before RT2 does will, for a time, select RT2 to be both Designated
  7365.     Router and Backup Designated Router.  When RT2 detects that RT1 is
  7366.     gone it will move itself to Designated Router.  At this time, the
  7367.     remaining router having highest Router Priority will be selected as
  7368.     Backup Designated Router.
  7369.  
  7370.     [6]On point-to-point networks, the lower level protocols indicate
  7371.     whether the neighbor is up and running.  Likewise, existence of the
  7372.     neighbor on virtual links is indicated by the routing table
  7373.     calculation.  However, in both these cases, the Hello Protocol is
  7374.     still used.  This ensures that communication between the neighbors
  7375.     is bidirectional, and that each of the neighbors has a functioning
  7376.     routing protocol layer.
  7377.  
  7378.     [7]When the identity of the Designated Router is changing, it may be
  7379.     quite common for a neighbor in this state to send the router a
  7380.     Database Description packet; this means that there is some momentary
  7381.     disagreement on the Designated Router's identity.
  7382.  
  7383.     [8]Note that it is possible for a router to resynchronize any of its
  7384.     fully established adjacencies by setting the adjacency's state back
  7385.     to ExStart.  This will cause the other end of the adjacency to
  7386.     process a Seq Number Mismatch event, and therefore to also go back
  7387.     to ExStart state.
  7388.  
  7389.  
  7390.  
  7391.  
  7392. [Moy]                                                         [Page 132]
  7393.  
  7394. RFC 1247                     OSPF Version 2                    July 1991
  7395.  
  7396.  
  7397.     [9]The address space of IP networks and the address space of OSPF
  7398.     Router IDs may overlap.  That is, a network may have an IP address
  7399.     which is identical (when considered as a 32-bit number) to some
  7400.     router's Router ID.
  7401.  
  7402.     [10]It is assumed that, for two different address ranges matching
  7403.     the destination, one range is more specific than the other. Non-
  7404.     contiguous subnet masks can be configured to violate this
  7405.     assumption. Such subnet mask configurations cannot be handled by the
  7406.     OSPF protocol.
  7407.  
  7408.     [11]MaxAgeDiff is an architectural constant.  It indicates the
  7409.     maximum dispersion of ages, in seconds, that can occur for a single
  7410.     link state instance as it is flooded throughout the routing domain.
  7411.     If two advertisements differ by more than this, they are assumed to
  7412.     be different instances of the same advertisement.  This can occur
  7413.     when a router restarts and loses track of its previous sequence
  7414.     number.  See Section 13.4 for more details.
  7415.  
  7416.     [12]When two advertisements have different checksums, they are
  7417.     assumed to be separate instances.  This can occur when a router
  7418.     restarts, and loses track of its previous sequence number.  In this
  7419.     case, since the two advertisements have the same sequence number, it
  7420.     is not possible to determine which link state is actually newer.  If
  7421.     the wrong advertisement is accepted as newer, the originating router
  7422.     will originate another instance.  See Section 13.4 for further
  7423.     details.
  7424.  
  7425.     [13]There is one instance where a lookup must be done based on
  7426.     partial information.  This is during the routing table calculation,
  7427.     when a network links advertisement must be found based solely on its
  7428.     Link State ID.  The lookup in this case is still well defined, since
  7429.     no two network advertisements can have the same Link State ID.
  7430.  
  7431.     [14]This clause covers the case: Inter-area routes are not
  7432.     summarized to the backbone.  This is because inter-area routes are
  7433.     always associated with the backbone area.
  7434.  
  7435.     [15]By keeping more information in the routing table, it is possible
  7436.     for an implementation to recalculate the shortest path tree only for
  7437.     a single area.  In fact, there are incremental algorithms that allow
  7438.     an implementation to recalculate only a portion of the shortest path
  7439.     tree [BBN].  These algorithms are beyond the scope of this
  7440.     specification.
  7441.  
  7442.     [16]This is how the Link state request list is emptied, which
  7443.     eventually causes the neighbor state to transition to Full.  See
  7444.     Section 10.9 for more details.
  7445.  
  7446.  
  7447.  
  7448. [Moy]                                                         [Page 133]
  7449.  
  7450. RFC 1247                     OSPF Version 2                    July 1991
  7451.  
  7452.  
  7453.     [17]It should be a relatively rare occurrence for an advertisement's
  7454.     age to reach MaxAge.  Usually, the advertisement will be replaced by
  7455.     a more recent instance before it ages out.
  7456.  
  7457.     [18]Only the TOS 0 routes are important here.  This is because all
  7458.     routing protocol packets are sent with TOS= 0.  See Appendix A.
  7459.  
  7460.     [19]It may be the case that paths to certain destinations do not
  7461.     vary based on TOS.  For these destinations, the routing calculation
  7462.     need not be repeated for each TOS value.  In addition, there need
  7463.     only be a single routing table entry for these destinations (instead
  7464.     of a separate entry for each TOS value).
  7465.  
  7466.     [20]Strictly speaking, because of equal-cost multipath, the
  7467.     algorithm does not create a tree.  We continue to use the "tree"
  7468.     terminology because that is what occurs most often in the existing
  7469.     literature.
  7470.  
  7471.     [21]This means that before data traffic will flow between a pair of
  7472.     neighboring routers, their link state databases must be
  7473.     synchronized.  Before synchronization (neighbor state < Full), a
  7474.     router will not include the connection to its neighbor in its link
  7475.     state advertisements.
  7476.  
  7477.     [22]As a result of this clause, when a virtual link exists between
  7478.     the calculating router and an AS boundary router, the intra-area
  7479.     path through the virtual link's transit area is always preferred
  7480.     over the virtual link itself.
  7481.  
  7482.     [23]Note the similarity between this procedure and the calculation
  7483.     of inter-area routes by a router internal to Area A.
  7484.  
  7485.     [24]When the forwarding address is non-zero, it should point to a
  7486.     router belonging to another Autonomous System.  See Section 12.4.4
  7487.     for more details.
  7488.  
  7489.  
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504. [Moy]                                                         [Page 134]
  7505.  
  7506. RFC 1247                     OSPF Version 2                    July 1991
  7507.  
  7508.  
  7509. References
  7510.  
  7511.  
  7512. [BBN]       McQuillan, J.M., Richer, I.  and Rosen, E.C.  ARPANET
  7513.             Routing Algorithm Improvements.  BBN Technical Report 3803,
  7514.             April 1978.
  7515.  
  7516. [DEC]       Digital Equipment Corporation.  Information processing
  7517.             systems -- Data communications -- Intermediate System to
  7518.             Intermediate System Intra-Domain Routing Protocol.  October
  7519.             1987.
  7520.  
  7521. [McQuillan] McQuillan, J.  et.al.  The New Routing Algorithm for the
  7522.             Arpanet.  IEEE Transactions on Communications, May 1980.
  7523.  
  7524. [Perlman]   Perlman, Radia.  Fault-Tolerant Broadcast of Routing
  7525.             Information.  Computer Networks, Dec.  1983.
  7526.  
  7527. [RFC 791]   Postel, Jon.  Internet Protocol.  September 1981
  7528.  
  7529. [RFC 944]   ANSI X3S3.3 86-60.  Final Text of DIS 8473, Protocol for
  7530.             Providing the Connectionless-mode Network Service.  March
  7531.             1986.
  7532.  
  7533. [RFC 1060]  Reynolds, J.  and Postel, J.  Assigned Numbers.  March 1990.
  7534.  
  7535. [RFC 1112]  Deering, S.E.  Host extensions for IP multicasting.  May
  7536.             1988.
  7537.  
  7538. [RFC 1131]  Moy, J.  The OSPF Specification.  October 1989.
  7539.  
  7540. [RS-85-153] Leiner, Dr.  Barry M., et.al.  The DARPA Internet Protocol
  7541.             Suite.  DDN Protocol Handbook, April 1985.
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.  
  7553.  
  7554.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.  
  7560. [Moy]                                                         [Page 135]
  7561.  
  7562. RFC 1247                     OSPF Version 2                    July 1991
  7563.  
  7564.  
  7565. A. OSPF data formats
  7566.  
  7567. This appendix describes the format of OSPF protocol packets and OSPF
  7568. link state advertisements.  The OSPF protocol runs directly over the IP
  7569. network layer.  Before any data formats are described, the details of
  7570. the OSPF encapsulation are explained.
  7571.  
  7572. Next the OSPF options field is described.  This field describes various
  7573. capabilities that may or may not be supported by pieces of the OSPF
  7574. routing domain.  It is contained both in OSPF protocol packets and in
  7575. OSPF link state advertisements.
  7576.  
  7577. OSPF packet formats are detailed in Section A.3.  A description of OSPF
  7578. link state advertisements appears in Section A.4.
  7579.  
  7580.  
  7581. A.1 Encapsulation of OSPF packets
  7582.  
  7583. OSPF runs directly over the Internet Protocol's network layer.  OSPF
  7584. packets are therefore encapsulated solely by IP and local network
  7585. headers.
  7586.  
  7587. OSPF does not define a way to fragment its protocol packets, and depends
  7588. on IP fragmentation when transmitting packets larger than the network
  7589. MTU.  The OSPF packet types that are likely to be large (Database
  7590. Description Packets, Link State Request, Link State Update, and Link
  7591. State Acknowledgment packets) can usually be split into several separate
  7592. protocol packets, without loss of functionality.  This is recommended;
  7593. IP fragmentation should be avoided whenever possible.  Using this
  7594. reasoning, an attempt should be made to limit the sizes of packets sent
  7595. over virtual links to 576 bytes.  However, if necessary, the length of
  7596. OSPF packets can be up to 65,535 bytes (including the IP header).
  7597.  
  7598. The other important features of OSPF's IP encapsulation are:
  7599.  
  7600.  
  7601. o   Use of IP multicast.  Some OSPF messages are multicast, when sent
  7602.     over multi-access networks.  Two distinct IP multicast addresses are
  7603.     used.  Packets destined to these multicast addresses should never be
  7604.     forwarded.  Such packets are meant to travel a single hop only.  To
  7605.     ensure that these packets will not travel multiple hops, their IP
  7606.     TTL must be set to 1.
  7607.  
  7608.     AllSPFRouters
  7609.         This multicast address has been assigned the value 224.0.0.5.
  7610.         All routers running OSPF should be prepared to receive packets
  7611.         sent to this address.  Hello packets are always sent to this
  7612.         destination.  Also, certain protocol packets are sent to this
  7613.  
  7614.  
  7615.  
  7616. [Moy]                                                         [Page 136]
  7617.  
  7618. RFC 1247                     OSPF Version 2                    July 1991
  7619.  
  7620.  
  7621.         address during the flooding procedure.
  7622.  
  7623.     AllDRouters
  7624.         This multicast address has been assigned the value 224.0.0.6.
  7625.         Both the Designated Router and Backup Designated Router must be
  7626.         prepared to receive packets destined to this address.  Certain
  7627.         packets are sent to this address during the flooding procedure.
  7628.  
  7629. o   OSPF is IP protocol number 89.  This number has been registered with
  7630.     the Network Information Center.  IP protocol number assignments are
  7631.     documented in [RFC 1060].
  7632.  
  7633. o   Routing protocol packets are sent with IP TOS of 0.  The OSPF
  7634.     protocol supports TOS-based routing.  Routes to any particular
  7635.     destination may vary based on TOS.  However, all OSPF routing
  7636.     protocol packets are sent with the DTR bits in the IP header's TOS
  7637.     field (see [RFC 791]) set to 0.
  7638.  
  7639. o   Routing protocol packets are sent with IP precedence set to
  7640.     Internetwork Control.  OSPF protocol packets should be given
  7641.     precedence over regular IP data traffic, in both sending and
  7642.     receiving.  Setting the IP precedence field in the IP header to
  7643.     Internetwork Control [RFC 791] may help implement this objective.
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.  
  7663.  
  7664.  
  7665.  
  7666.  
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  
  7672. [Moy]                                                         [Page 137]
  7673.  
  7674. RFC 1247                     OSPF Version 2                    July 1991
  7675.  
  7676.  
  7677. A.2 The options field
  7678.  
  7679. The OSPF options field is present in OSPF Hello packets, Database
  7680. Description packets and all link state advertisements.  The options
  7681. field enables OSPF routers to support (or not support) optional
  7682. capabilities, and to communicate their capability level to other OSPF
  7683. routers.  Through this mechanism routers of differing capabilities can
  7684. be mixed within an OSPF routing domain.
  7685.  
  7686. When used in Hello packets, the options field allows a router to reject
  7687. a neighbor because of a capability mismatch.  Alternatively, when
  7688. capabilities are exchanged in Database Description packets a router can
  7689. choose not to forward certain LSA types to a neighbor because of its
  7690. reduced functionality.  Lastly, listing capabilities in LSAs allows
  7691. routers to route traffic around reduced functionality routers, by
  7692. excluding them from parts of the routing table calculation.
  7693.  
  7694. Two capabilities are currently defined.  For each capability, the effect
  7695. of the capability's appearance (or lack of appearance) in Hello packets,
  7696. Database Description packets and link state advertisements is specified
  7697. below.  For example, the external routing capability (below called the
  7698. E-bit) has meaning only in OSPF Hello Packets.  Routers should reset
  7699. (i.e.  clear) the unassigned part of the capability field when sending
  7700. Hello packets or Database Description packets and when originating link
  7701. state advertisements.
  7702.  
  7703. Additional capabilities may be assigned in the future.  Routers
  7704. encountering unrecognized capabilities in received Hello Packets,
  7705. Database Description packets or link state advertisements should ignore
  7706. the capability and process the packet/advertisement normally.
  7707.  
  7708.                            +-+-+-+-+-+-+-+-+
  7709.                            | | | | | | |E|T|
  7710.                            +-+-+-+-+-+-+-+-+
  7711.  
  7712.                            The options field
  7713.  
  7714.  
  7715. T-bit
  7716.     This describes the router's TOS capability.  If the T-bit is reset,
  7717.     then the router supports only a single TOS (TOS 0).  Such a router
  7718.     is also said to be incapable of TOS-routing.  The absence of the T-
  7719.     bit in a router links advertisement causes the router to be skipped
  7720.     when building a non-zero TOS shortest-path tree (see Section 16.9).
  7721.     In other words, routers incapable of TOS routing will be avoided as
  7722.     much as possible when forwarding data traffic requesting a non-zero
  7723.     TOS.  The absence of the T-bit in a summary link advertisement or an
  7724.     AS external link advertisement indicates that the advertisement is
  7725.  
  7726.  
  7727.  
  7728. [Moy]                                                         [Page 138]
  7729.  
  7730. RFC 1247                     OSPF Version 2                    July 1991
  7731.  
  7732.  
  7733.     describing a TOS 0 route only (and not routes for non-zero TOS).
  7734.  
  7735. E-bit
  7736.     AS external link advertisements are not flooded into/through OSPF
  7737.     stub areas (see Section 3.6).  The E-bit ensures that all members of
  7738.     a stub area agree on that area's configuration.  The E-bit is
  7739.     meaningful only in OSPF Hello packets.  When the E-bit is reset in
  7740.     the Hello packet sent out a particular interface, it means that the
  7741.     router will neither send nor receive AS external link state
  7742.     advertisements on that interface (in other words, the interface
  7743.     connects to a stub area).  Two routers will not become neighbors
  7744.     unless they agree on the state of the E-bit.
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755.  
  7756.  
  7757.  
  7758.  
  7759.  
  7760.  
  7761.  
  7762.  
  7763.  
  7764.  
  7765.  
  7766.  
  7767.  
  7768.  
  7769.  
  7770.  
  7771.  
  7772.  
  7773.  
  7774.  
  7775.  
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784. [Moy]                                                         [Page 139]
  7785.  
  7786. RFC 1247                     OSPF Version 2                    July 1991
  7787.  
  7788.  
  7789. A.3 OSPF Packet Formats
  7790.  
  7791. There are five distinct OSPF packet types.  All OSPF packet types begin
  7792. with a standard 24 byte header.  This header is described first.  Each
  7793. packet type is then described in a succeeding section.  In these
  7794. sections each packet's division into fields is displayed, and then the
  7795. field definitions are enumerated.
  7796.  
  7797. All OSPF packet types (other than the OSPF Hello packets) deal with
  7798. lists of link state advertisements.  For example, Link State Update
  7799. packets implement the flooding of advertisements throughout the OSPF
  7800. routing domain.  Because of this, OSPF protocol packets cannot be parsed
  7801. unless the format of link state advertisements is also understood.  The
  7802. format of Link state advertisements is described in Section A.4.
  7803.  
  7804. The receive processing of OSPF packets is detailed in Section 8.2.  The
  7805. sending of OSPF packets is explained in Section 8.1.
  7806.  
  7807.  
  7808.  
  7809.  
  7810.  
  7811.  
  7812.  
  7813.  
  7814.  
  7815.  
  7816.  
  7817.  
  7818.  
  7819.  
  7820.  
  7821.  
  7822.  
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840. [Moy]                                                         [Page 140]
  7841.  
  7842. RFC 1247                     OSPF Version 2                    July 1991
  7843.  
  7844.  
  7845. A.3.1 The OSPF packet header
  7846.  
  7847. Every OSPF packet starts with a common 24 byte header.  This header
  7848. contains all the necessary information to determine whether the packet
  7849. should be accepted for further processing.  This determination is
  7850. described in Section 8.2 of the specification.
  7851.  
  7852.  
  7853.     0                   1                   2                   3
  7854.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  7855.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7856.    |   Version #   |     Type      |         Packet length         |
  7857.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7858.    |                          Router ID                            |
  7859.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7860.    |                           Area ID                             |
  7861.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7862.    |           Checksum            |             Autype            |
  7863.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7864.    |                       Authentication                          |
  7865.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7866.    |                       Authentication                          |
  7867.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7868.  
  7869.  
  7870.  
  7871. Version #
  7872.     The OSPF version number.  This specification documents version 2 of
  7873.     the protocol.
  7874.  
  7875. Type
  7876.     The OSPF packet types are as follows.  The format of each of these
  7877.     packet types is described in a succeeding section.
  7878.  
  7879.  
  7880.  
  7881.                         Type   Description
  7882.                         ________________________________
  7883.                         1      Hello
  7884.                         2      Database Description
  7885.                         3      Link State Request
  7886.                         4      Link State Update
  7887.                         5      Link State Acknowledgment
  7888.  
  7889.  
  7890.  
  7891.  
  7892.  
  7893.  
  7894.  
  7895.  
  7896. [Moy]                                                         [Page 141]
  7897.  
  7898. RFC 1247                     OSPF Version 2                    July 1991
  7899.  
  7900.  
  7901. Packet length
  7902.     The length of the protocol packet in bytes.  This length includes
  7903.     the standard OSPF header.
  7904.  
  7905. Router ID
  7906.     The Router ID of the packet's source.  In OSPF, the source and
  7907.     destination of a routing protocol packet are the two ends of an
  7908.     (potential) adjacency.
  7909.  
  7910. Area ID
  7911.     A 32 bit number identifying the area that this packet belongs to.
  7912.     All OSPF packets are associated with a single area.  Most travel a
  7913.     single hop only.  Packets travelling over a virtual link are
  7914.     labelled with the backbone area ID of 0.
  7915.  
  7916. Checksum
  7917.     The standard IP checksum of the entire contents of the packet,
  7918.     excluding the 64-bit authentication field.  This checksum is
  7919.     calculated as the 16-bit one's complement of the one's complement
  7920.     sum of all the 16-bit words in the packet, excepting the
  7921.     authentication field.  If the packet's length is not an integral
  7922.     number of 16-bit words, the packet is padded with a byte of zero
  7923.     before checksumming.
  7924.  
  7925. AuType
  7926.     Identifies the authentication scheme to be used for the packet.
  7927.     Authentication is discussed in Appendix E of the specification.
  7928.     Consult Appendix E for a list of the currently defined
  7929.     authentication types.
  7930.  
  7931. Authentication
  7932.     A 64-bit field for use by the authentication scheme.
  7933.  
  7934.  
  7935.  
  7936.  
  7937.  
  7938.  
  7939.  
  7940.  
  7941.  
  7942.  
  7943.  
  7944.  
  7945.  
  7946.  
  7947.  
  7948.  
  7949.  
  7950.  
  7951.  
  7952. [Moy]                                                         [Page 142]
  7953.  
  7954. RFC 1247                     OSPF Version 2                    July 1991
  7955.  
  7956.  
  7957. A.3.2 The Hello packet
  7958.  
  7959. Hello packets are OSPF packet type 1.  These packets are sent
  7960. periodically on all interfaces (including virtual links) in order to
  7961. establish and maintain neighbor relationships.  In addition, Hellos are
  7962. multicast on those physical networks having a multicast or broadcast
  7963. capability, enabling dynamic discovery of neighboring routers.
  7964.  
  7965. All routers connected to a common network must agree on certain
  7966. parameters (network mask, hello and dead intervals).  These parameters
  7967. are included in Hello packets, so that differences can inhibit the
  7968. forming of neighbor relationships.  A detailed explanation of the
  7969. receive processing for Hello packets is presented in Section 10.5.  The
  7970. sending of Hello packets is covered in Section 9.5.
  7971.  
  7972.  
  7973.     0                   1                   2                   3
  7974.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  7975.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7976.    |   Version #   |       1       |         Packet length         |
  7977.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7978.    |                          Router ID                            |
  7979.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7980.    |                           Area ID                             |
  7981.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7982.    |           Checksum            |             Autype            |
  7983.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7984.    |                       Authentication                          |
  7985.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7986.    |                       Authentication                          |
  7987.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7988.    |                        Network Mask                           |
  7989.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7990.    |         HelloInt              |    Options    |    Rtr Pri    |
  7991.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7992.    |                           DeadInt                             |
  7993.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7994.    |                      Designated Router                        |
  7995.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7996.    |                   Backup Designated Router                    |
  7997.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  7998.    |                          Neighbor                             |
  7999.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8000.    |                              ...                              |
  8001.  
  8002.  
  8003.  
  8004.  
  8005.  
  8006.  
  8007.  
  8008. [Moy]                                                         [Page 143]
  8009.  
  8010. RFC 1247                     OSPF Version 2                    July 1991
  8011.  
  8012.  
  8013. Network mask
  8014.     The network mask associated with this interface.  For example, if
  8015.     the interface is to a class B network whose third byte is used for
  8016.     subnetting, the network mask is 0xffffff00.
  8017.  
  8018. Options
  8019.     The optional capabilities supported by the router, as documented in
  8020.     Section A.2.
  8021.  
  8022. HelloInt
  8023.     The number of seconds between this router's Hello packets.
  8024.  
  8025. Rtr Pri
  8026.     This router's Router Priority.  Used in (Backup) Designated Router
  8027.     election.  If set to 0, the router will be ineligible to become
  8028.     (Backup) Designated Router.
  8029.  
  8030. Deadint
  8031.     The number of seconds before declaring a silent router down.
  8032.  
  8033. Designated Router
  8034.     The identity of the Designated Router for this network, in the view
  8035.     of the advertising router.  The Designated Router is identified here
  8036.     by its IP interface address on the network.  Set to 0 if there is no
  8037.     Designated Router.
  8038.  
  8039. Backup Designated Router
  8040.     The identity of the Backup Designated Router for this network, in
  8041.     the view of the advertising router.  The Backup Designated Router is
  8042.     identified here by its IP interface address on the network.  Set to
  8043.     0 if there is no backup Designated Router.
  8044.  
  8045. Neighbor
  8046.     The Router IDs of each router from whom valid Hello packets have
  8047.     been seen recently on the network.  Recently means in the last
  8048.     DeadInt seconds.
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.  
  8060.  
  8061.  
  8062.  
  8063.  
  8064. [Moy]                                                         [Page 144]
  8065.  
  8066. RFC 1247                     OSPF Version 2                    July 1991
  8067.  
  8068.  
  8069. A.3.3 The Database Description packet
  8070.  
  8071. Database Description packets are OSPF packet type 2.  These packets are
  8072. exchanged when an adjacency is being initialized.  They describe the
  8073. contents of the topological database.  Multiple packets may be used to
  8074. describe the database.  For this purpose a poll-response procedure is
  8075. used.  One of the routers is designated to be master, the other a slave.
  8076. The master sends Database Description packets (polls) which are
  8077. acknowledged by Database Description packets sent by the slave
  8078. (responses).  The responses are linked to the polls via the packets'
  8079. sequence numbers.
  8080.  
  8081. The format of the Database Description packet is very similar to both
  8082. the Link State Request and Link State Acknowledgment packets.  The main
  8083. part of all three is a list of items, each item describing a piece of
  8084. the topological database.  The sending of Database Description Packets
  8085. is documented in Section 10.8.  The reception of Database Description
  8086. packets is documented in Section 10.6.
  8087.  
  8088.  
  8089.     0                   1                   2                   3
  8090.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8091.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8092.    |   Version #   |       2       |         Packet length         |
  8093.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8094.    |                          Router ID                            |
  8095.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8096.    |                           Area ID                             |
  8097.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8098.    |           Checksum            |             Autype            |
  8099.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8100.    |                       Authentication                          |
  8101.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8102.    |                       Authentication                          |
  8103.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8104.    |       0       |       0       |    Options    |0|0|0|0|0|I|M|MS
  8105.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8106.    |                     DD sequence number                        |
  8107.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8108.    |                                                               |
  8109.    +-                                                             -+
  8110.    |                             A                                 |
  8111.    +-                 Link State Advertisement                    -+
  8112.    |                           Header                              |
  8113.    +-                                                             -+
  8114.    |                                                               |
  8115.    +-                                                             -+
  8116.    |                                                               |
  8117.  
  8118.  
  8119.  
  8120. [Moy]                                                         [Page 145]
  8121.  
  8122. RFC 1247                     OSPF Version 2                    July 1991
  8123.  
  8124.  
  8125.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8126.    |                              ...                              |
  8127.  
  8128.  
  8129.  
  8130.  
  8131. 0   These fields are reserved.  They must be 0.
  8132.  
  8133. Options
  8134.     The optional capabilities supported by the router, as documented in
  8135.     Section A.2.
  8136.  
  8137. I-bit
  8138.     The Init bit.  When set to 1, this packet is the first in the
  8139.     sequence of database descriptions.
  8140.  
  8141. M-bit
  8142.     The More bit.  When set to 1, it indicates that more database
  8143.     descriptions are to follow.
  8144.  
  8145. MS-bit
  8146.     The Master/Slave bit.  When set to 1, it indicates that the router
  8147.     is the master during the database exchange process.  Otherwise, the
  8148.     router is the slave.
  8149.  
  8150. DD sequence number
  8151.     Used to sequence the collection of database description packets.
  8152.     The initial value (indicated by the Init bit being set) should be
  8153.     unique.  The sequence number then increments until the complete
  8154.     database description has been sent.
  8155.  
  8156.  
  8157. The rest of the packet consists of a (possibly partial) list of the
  8158. topological database's pieces.  Each link state advertisement in the
  8159. database is described by its link state header.  The link state header
  8160. is documented in Section A.4.1.  It contains all the information
  8161. required to uniquely identify both the advertisement and the
  8162. advertisement's current instance.
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176. [Moy]                                                         [Page 146]
  8177.  
  8178. RFC 1247                     OSPF Version 2                    July 1991
  8179.  
  8180.  
  8181. A.3.4 The Link State Request packet
  8182.  
  8183. Link State Request packets are OSPF packet type 3.  After exchanging
  8184. Database Description packets with a neighboring router, a router may
  8185. find that parts of its topological database are out of date.  The Link
  8186. State Request packet is used to request the pieces of the neighbor's
  8187. database that are more up to date.  Multiple Link State Request packets
  8188. may need to be used.  The sending of Link State Request packets is the
  8189. last step in bringing up an adjacency.
  8190.  
  8191. A router that sends a Link State Request packet has in mind the precise
  8192. instance of the database pieces it is requesting (defined by LS sequence
  8193. number, LS checksum, and LS age).  It may receive even more recent
  8194. instances in response.
  8195.  
  8196. The sending of Link State Request packets is documented in Section 10.9.
  8197. The reception of Link State Request packets is documented in Section
  8198. 10.7.
  8199.  
  8200.  
  8201.     0                   1                   2                   3
  8202.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8203.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8204.    |   Version #   |       3       |         Packet length         |
  8205.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8206.    |                          Router ID                            |
  8207.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8208.    |                           Area ID                             |
  8209.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8210.    |           Checksum            |             Autype            |
  8211.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8212.    |                       Authentication                          |
  8213.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8214.    |                       Authentication                          |
  8215.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8216.    |                          LS type                              |
  8217.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8218.    |                       Link State ID                           |
  8219.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8220.    |                     Advertising Router                        |
  8221.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8222.    |                              ...                              |
  8223.  
  8224.  
  8225. Each advertisement requested is specified by its LS type, Link State ID,
  8226. and Advertising Router.  This uniquely identifies the advertisement, but
  8227. not its instance.  Link State Request packets are understood to be
  8228. requests for the most recent instance (whatever that might be).
  8229.  
  8230.  
  8231.  
  8232. [Moy]                                                         [Page 147]
  8233.  
  8234. RFC 1247                     OSPF Version 2                    July 1991
  8235.  
  8236.  
  8237. A.3.5 The Link State Update packet
  8238.  
  8239. Link State Update packets are OSPF packet type 4.  These packets
  8240. implement the flooding of link state advertisements.  Each Link State
  8241. Update packet carries a collection of link state advertisements one hop
  8242. further from its origin.  Several link state advertisements may be
  8243. included in a single packet.
  8244.  
  8245. Link State Update packets are multicast on those physical networks that
  8246. support multicast/broadcast.  In order to make the flooding procedure
  8247. reliable, flooded advertisements are acknowledged in Link State
  8248. Acknowledgment packets.  If retransmission of certain advertisements is
  8249. necessary, the retransmitted advertisements are always carried by
  8250. unicast Link State Update packets.  For more information on the reliable
  8251. flooding of link state advertisements, consult Section 13.
  8252.  
  8253.  
  8254.     0                   1                   2                   3
  8255.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8256.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8257.    |   Version #   |       4       |         Packet length         |
  8258.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8259.    |                          Router ID                            |
  8260.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8261.    |                           Area ID                             |
  8262.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8263.    |           Checksum            |             Autype            |
  8264.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8265.    |                       Authentication                          |
  8266.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8267.    |                       Authentication                          |
  8268.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8269.    |                      # advertisements                         |
  8270.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8271.    |                                                               |
  8272.    +-                                                            +-+
  8273.    |                  Link state advertisements                    |
  8274.    +-                                                            +-+
  8275.    |                              ...                              |
  8276.  
  8277.  
  8278.  
  8279. # advertisements
  8280.     The number of link state advertisements included in this update.
  8281.  
  8282.  
  8283. The body of the Link State Update packet consists of a list of link
  8284. state advertisements.  Each advertisement begins with a common 20 byte
  8285.  
  8286.  
  8287.  
  8288. [Moy]                                                         [Page 148]
  8289.  
  8290. RFC 1247                     OSPF Version 2                    July 1991
  8291.  
  8292.  
  8293. header, the link state advertisement header.  This header is described
  8294. in Section A.4.1.  Otherwise, the format of each of the five types of
  8295. link state advertisements is different.  Their formats are described in
  8296. Section A.4.
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344. [Moy]                                                         [Page 149]
  8345.  
  8346. RFC 1247                     OSPF Version 2                    July 1991
  8347.  
  8348.  
  8349. A.3.6 The Link State Acknowledgment packet
  8350.  
  8351. Link State Acknowledgment Packets are OSPF packet type 5.  To make the
  8352. flooding of link state advertisements reliable, flooded advertisements
  8353. are explicitly acknowledged.  This acknowledgment is accomplished
  8354. through the sending and receiving of Link State Acknowledgment packets.
  8355. Multiple link state advertisements can be acknowledged in a single
  8356. packet.
  8357.  
  8358. Depending on the state of the sending interface and the source of the
  8359. advertisements being acknowledged, a Link State Acknowledgment packet is
  8360. sent either to the multicast address AllSPFRouters, to the multicast
  8361. address AllDRouters, or as a unicast.  The sending of Link State
  8362. Acknowledgement packets is documented in Section 13.5.  The reception of
  8363. Link State Acknowledgement packets is documented in Section 13.7.
  8364.  
  8365. The format of this packet is similar to that of the Data Description
  8366. packet.  The body of both packets is simply a list of link state
  8367. advertisement headers.
  8368.  
  8369.  
  8370.     0                   1                   2                   3
  8371.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8372.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8373.    |   Version #   |       5       |         Packet length         |
  8374.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8375.    |                          Router ID                            |
  8376.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8377.    |                           Area ID                             |
  8378.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8379.    |           Checksum            |             Autype            |
  8380.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8381.    |                       Authentication                          |
  8382.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8383.    |                       Authentication                          |
  8384.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8385.    |                                                               |
  8386.    +-                                                             -+
  8387.    |                             A                                 |
  8388.    +-                 Link State Advertisement                    -+
  8389.    |                           Header                              |
  8390.    +-                                                             -+
  8391.    |                                                               |
  8392.    +-                                                             -+
  8393.    |                                                               |
  8394.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8395.    |                              ...                              |
  8396.  
  8397.  
  8398.  
  8399.  
  8400. [Moy]                                                         [Page 150]
  8401.  
  8402. RFC 1247                     OSPF Version 2                    July 1991
  8403.  
  8404.  
  8405. Each acknowledged link state advertisement is described by its link
  8406. state header.  The link state header is documented in Section A.4.1.  It
  8407. contains all the information required to uniquely identify both the
  8408. advertisement and the advertisement's current instance.
  8409.  
  8410.  
  8411.  
  8412.  
  8413.  
  8414.  
  8415.  
  8416.  
  8417.  
  8418.  
  8419.  
  8420.  
  8421.  
  8422.  
  8423.  
  8424.  
  8425.  
  8426.  
  8427.  
  8428.  
  8429.  
  8430.  
  8431.  
  8432.  
  8433.  
  8434.  
  8435.  
  8436.  
  8437.  
  8438.  
  8439.  
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456. [Moy]                                                         [Page 151]
  8457.  
  8458. RFC 1247                     OSPF Version 2                    July 1991
  8459.  
  8460.  
  8461. A.4 Link state advertisement formats
  8462.  
  8463. There are five distinct types of link state advertisements.  Each link
  8464. state advertisement begins with a standard 20-byte link state header.
  8465. This header is explained in Section A.4.1.  Succeeding sections then
  8466. diagram the separate link state advertisement types.
  8467.  
  8468. Each link state advertisement describes a piece of the OSPF routing
  8469. domain.  Every router originates a router links advertisement.  In
  8470. addition, whenever the router is elected Designated Router, it
  8471. originates a network links advertisement.  Other types of link state
  8472. advertisements may also be originated (see Section 12.4).  All link
  8473. state advertisements are then flooded throughout the OSPF routing
  8474. domain.  The flooding algorithm is reliable, ensuring that all routers
  8475. have the same collection of link state advertisements.  (See Section 13
  8476. for more information concerning the flooding algorithm).  This
  8477. collection of advertisements is called the link state (or topological)
  8478. database.
  8479.  
  8480. From the link state database, each router constructs a shortest path
  8481. tree with itself as root.  This yields a routing table (see Section 11).
  8482. For the details of the routing table build process, see Section 16.
  8483.  
  8484.  
  8485.  
  8486.  
  8487.  
  8488.  
  8489.  
  8490.  
  8491.  
  8492.  
  8493.  
  8494.  
  8495.  
  8496.  
  8497.  
  8498.  
  8499.  
  8500.  
  8501.  
  8502.  
  8503.  
  8504.  
  8505.  
  8506.  
  8507.  
  8508.  
  8509.  
  8510.  
  8511.  
  8512. [Moy]                                                         [Page 152]
  8513.  
  8514. RFC 1247                     OSPF Version 2                    July 1991
  8515.  
  8516.  
  8517. A.4.1 The Link State Advertisement header
  8518.  
  8519. All link state advertisements begin with a common 20 byte header.  This
  8520. header contains enough information to uniquely identify the
  8521. advertisement (LS type, Link State ID, and Advertising Router).
  8522. Multiple instances of the link state advertisement may exist in the
  8523. routing domain at the same time.  It is then necessary to determine
  8524. which instance is more recent.  This is accomplished by examining the LS
  8525. age, LS sequence number and LS checksum fields that are also contained
  8526. in the link state advertisement header.
  8527.  
  8528.  
  8529.     0                   1                   2                   3
  8530.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8531.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8532.    |            LS age             |    Options    |    LS type    |
  8533.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8534.    |                        Link State ID                          |
  8535.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8536.    |                     Advertising Router                        |
  8537.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8538.    |                     LS sequence number                        |
  8539.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8540.    |         LS checksum           |             length            |
  8541.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8542.  
  8543.  
  8544.  
  8545. LS age
  8546.     The time in seconds since the link state advertisement was
  8547.     originated.
  8548.  
  8549. Options
  8550.     The optional capabilities supported by the described portion of the
  8551.     routing domain.  OSPF's optional capabilities are documented in
  8552.     Section A.2.
  8553.  
  8554. LS type
  8555.     The type of the link state advertisement.  Each link state type has
  8556.     a separate advertisement format.  The link state types are as
  8557.     follows (see Section 12.1.3 for further explanation):
  8558.  
  8559.  
  8560.  
  8561.  
  8562.  
  8563.  
  8564.  
  8565.  
  8566.  
  8567.  
  8568. [Moy]                                                         [Page 153]
  8569.  
  8570. RFC 1247                     OSPF Version 2                    July 1991
  8571.  
  8572.  
  8573.  
  8574.                       LS Type   Description
  8575.                       ___________________________________
  8576.                       1         Router links
  8577.                       2         Network links
  8578.                       3         Summary link (IP network)
  8579.                       4         Summary link (ASBR)
  8580.                       5         AS external link
  8581.  
  8582.  
  8583.  
  8584.  
  8585. Link State ID
  8586.     This field identifies the portion of the internet environment that
  8587.     is being described by the advertisement.  The contents of this field
  8588.     depend on the advertisement's LS type.  For example, in network
  8589.     links advertisements the Link State ID is set to the IP interface
  8590.     address of the network's Designated Router (from which the network's
  8591.     IP address can be derived).  The Link State ID is further discussed
  8592.     in Section 12.1.4.
  8593.  
  8594. Advertising Router
  8595.     The Router ID of the router that originated the link state
  8596.     advertisement.  For example, in network links advertisements this
  8597.     field is set to the Router ID of the network's Designated Router.
  8598.  
  8599. LS sequence number
  8600.     Detects old or duplicate link state advertisements.  Successive
  8601.     instances of a link state advertisement are given successive LS
  8602.     sequence numbers.  See Section 12.1.6 for more details.
  8603.  
  8604. LS checksum
  8605.     The Fletcher checksum of the complete contents of the link state
  8606.     advertisement.  See Section 12.1.7 for more details.
  8607.  
  8608. length
  8609.     The length in bytes of the link state advertisement.  This includes
  8610.     the 20 byte link state header.
  8611.  
  8612.  
  8613.  
  8614.  
  8615.  
  8616.  
  8617.  
  8618.  
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624. [Moy]                                                         [Page 154]
  8625.  
  8626. RFC 1247                     OSPF Version 2                    July 1991
  8627.  
  8628.  
  8629. A.4.2 Router links advertisements
  8630.  
  8631. Router links advertisements are the Type 1 link state advertisements.
  8632. Each router in an area originates a router links advertisement.  The
  8633. advertisement describes the state and cost of the router's links (or
  8634. interfaces) to the area.  All of the router's links to the area must be
  8635. described in a single router links advertisement.  For details
  8636. concerning the construction of router links advertisements, see Section
  8637. 12.4.1.
  8638.  
  8639. In router links advertisements, the Link State ID field is set to the
  8640. router's OSPF Router ID.  The T-bit is set in the advertisement's Option
  8641. field if and only if the router is able to calculate a separate set of
  8642. routes for each IP TOS.  Router links advertisements are flooded
  8643. throughout a single area only.
  8644.  
  8645.  
  8646.     0                   1                   2                   3
  8647.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8648.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8649.    |            LS age             |     Options   |       1       |
  8650.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8651.    |                        Link State ID                          |
  8652.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8653.    |                     Advertising Router                        |
  8654.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8655.    |                     LS sequence number                        |
  8656.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8657.    |         LS checksum           |             length            |
  8658.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8659.    |      0    |E|B|        0      |            # links            |
  8660.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8661.    |                          Link ID                              |
  8662.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8663.    |                         Link Data                             |
  8664.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8665.    |     Type      |     # TOS     |        TOS 0 metric           |
  8666.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8667.    |      TOS      |        0      |            metric             |
  8668.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8669.    |                              ...                              |
  8670.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8671.    |      TOS      |        0      |            metric             |
  8672.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8673.    |                          Link ID                              |
  8674.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8675.    |                         Link Data                             |
  8676.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8677.  
  8678.  
  8679.  
  8680. [Moy]                                                         [Page 155]
  8681.  
  8682. RFC 1247                     OSPF Version 2                    July 1991
  8683.  
  8684.  
  8685.    |                              ...                              |
  8686.  
  8687.  
  8688.  
  8689. bit E
  8690.     When set, the router is an AS boundary router (E is for external)
  8691.  
  8692. bit B
  8693.     When set, the router is an area border router (B is for border)
  8694.  
  8695. # links
  8696.     The number of router links described by this advertisement.  This
  8697.     must be the total collection of router links to the area.
  8698.  
  8699.  
  8700. The following fields are used to describe each router link.  Each router
  8701. link is typed (see the below Type field).  The type field indicates the
  8702. kind of link being described.  It may be a link to a transit network, to
  8703. another router or to a stub network.  The values of all the other fields
  8704. describing a router link depend on the link's type.  For example, each
  8705. link has an associated 32-bit data field.  For links to stub networks
  8706. this field specifies the network's IP address mask.  For the other link
  8707. types the Link Data specifies the router's associated IP interface
  8708. address.
  8709.  
  8710.  
  8711. Type
  8712.     A quick description of the router link.  One of the following.  Note
  8713.     that host routes are classified as links to stub networks whose
  8714.     network mask is 0xffffffff.
  8715.  
  8716.  
  8717.  
  8718.                Type   Description
  8719.                __________________________________________________
  8720.                1      Point-to-point connection to another router
  8721.                2      Connection to a transit network
  8722.                3      Connection to a stub network
  8723.                4      Virtual link
  8724.  
  8725.  
  8726.  
  8727.  
  8728. Link ID
  8729.     Identifies the object that this router link connects to.  Value
  8730.     depends on the link's type.  When connecting to an object that also
  8731.     originates a link state advertisement (i.e., another router or a
  8732.     transit network) the Link ID is equal to the other advertisement's
  8733.  
  8734.  
  8735.  
  8736. [Moy]                                                         [Page 156]
  8737.  
  8738. RFC 1247                     OSPF Version 2                    July 1991
  8739.  
  8740.  
  8741.     Link State ID.  This provides the key for looking up said
  8742.     advertisement in the link state database.  See Section 12.2 for more
  8743.     details.
  8744.  
  8745.  
  8746.  
  8747.                      Type   Link ID
  8748.                      ______________________________________
  8749.                      1      Neighboring router's ID
  8750.                      2      IP address of Designated Router
  8751.                      3      IP network/subnet number
  8752.                      4      Neighboring router's ID
  8753.  
  8754.  
  8755.  
  8756.  
  8757. Link Data
  8758.     Contents again depend on the link's Type field.  For connections to
  8759.     stub network, it specifies the network mask.  For the other link
  8760.     types it specifies the router's associated IP interface address.
  8761.     This latter piece of information is needed during the routing table
  8762.     build process, when calculating the IP address of the next hop.  See
  8763.     Section 16.1.1 for more details.
  8764.  
  8765. #metrics
  8766.     The number of different TOS metrics given for this link, not
  8767.     counting the required metric for TOS 0.  For example, if no
  8768.     additional TOS metrics are given, this field should be set to 0.
  8769.  
  8770. TOS 0 metric
  8771.     The cost of using this router link for TOS 0.
  8772.  
  8773.  
  8774. For each link, separate metrics may be specified for each Type of
  8775. Service (TOS).  The metric for TOS 0 must always be included, and was
  8776. discussed above.  Metrics for non-zero TOS are described below.  The
  8777. encoding of TOS in OSPF link state advertisements is described in
  8778. Section 12.3.  Note that the cost for non-zero TOS values that are not
  8779. specified defaults to the TOS 0 cost.  Metrics must be listed in order
  8780. of increasing TOS encoding.  For example, the metric for TOS 16 must
  8781. always follow the metric for TOS 8 when both are specified.
  8782.  
  8783.  
  8784. TOS IP type of service that this metric refers to.  The encoding of TOS
  8785.     in OSPF link state advertisements is described in Section 12.3.
  8786.  
  8787. metric
  8788.     The cost of using this outbound router link, for traffic of the
  8789.  
  8790.  
  8791.  
  8792. [Moy]                                                         [Page 157]
  8793.  
  8794. RFC 1247                     OSPF Version 2                    July 1991
  8795.  
  8796.  
  8797.     specified TOS.
  8798.  
  8799.  
  8800.  
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.  
  8839.  
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848. [Moy]                                                         [Page 158]
  8849.  
  8850. RFC 1247                     OSPF Version 2                    July 1991
  8851.  
  8852.  
  8853. A.4.3 Network links advertisements
  8854.  
  8855. Network links advertisements are the Type 2 link state advertisements.
  8856. A network links advertisement is originated for each transit network in
  8857. the area.  A transit network is a multi-access network that has more
  8858. than one attached router.  The network links advertisement is originated
  8859. by the network's Designated Router.  The advertisement describes all
  8860. routers attached to the network, including the Designated Router itself.
  8861. The advertisement's Link State ID field lists the IP interface address
  8862. of the Designated Router.
  8863.  
  8864. The distance from the network to all attached routers is zero, for all
  8865. types of service.  This is why the TOS and metric fields need not be
  8866. specified in the network links advertisement.  For details concerning
  8867. the construction of network links advertisements, see Section 12.4.2.
  8868.  
  8869.  
  8870.     0                   1                   2                   3
  8871.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8872.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8873.    |            LS age             |      Options  |      2        |
  8874.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8875.    |                        Link State ID                          |
  8876.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8877.    |                     Advertising Router                        |
  8878.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8879.    |                     LS sequence number                        |
  8880.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8881.    |         LS checksum           |             length            |
  8882.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8883.    |                         Network Mask                          |
  8884.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8885.    |                        Attached Router                        |
  8886.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8887.    |                              ...                              |
  8888.  
  8889.  
  8890.  
  8891. Network Mask
  8892.     The IP address mask for the network.  For example, a class A network
  8893.     would have the mask 0xff000000.
  8894.  
  8895. Attached Router
  8896.     The Router IDs of each of the routers attached to the network.
  8897.     Actually, only those routers that are fully adjacent to the
  8898.     Designated Router are listed.  The Designated Router includes itself
  8899.     in this list.  The number of routers included can be deduced from
  8900.     the link state advertisement's length field.
  8901.  
  8902.  
  8903.  
  8904. [Moy]                                                         [Page 159]
  8905.  
  8906. RFC 1247                     OSPF Version 2                    July 1991
  8907.  
  8908.  
  8909. A.4.4 Summary link advertisements
  8910.  
  8911. Summary link advertisements are the Type 3 and 4 link state
  8912. advertisements.  These advertisements are originated by area border
  8913. routers.  A separate summary link advertisement is made for each
  8914. destination (known to the router) which belongs to the AS, yet is
  8915. outside the area.  For details concerning the construction of summary
  8916. link advertisements, see Section 12.4.3.
  8917.  
  8918. Type 3 link state advertisements are used when the destination is an IP
  8919. network.  In this case the advertisement's Link State ID field is an IP
  8920. network number.  When the destination is an AS boundary router, a Type 4
  8921. advertisement is used, and the Link State ID field is the AS boundary
  8922. router's OSPF Router ID.  (To see why it is necessary to advertise the
  8923. location of each ASBR, consult Section 16.4.)  Other than the difference
  8924. in the Link State ID field, the format of Type 3 and 4 link state
  8925. advertisements is identical.
  8926.  
  8927. For stub areas, type 3 summary link advertisements can also be used to
  8928. describe a (per-area) default route.  Default summary routes are used in
  8929. stub areas instead of flooding a complete set of external routes.  When
  8930. describing a default summary route, the advertisement's Link State ID is
  8931. always set to DefaultDestination (0.0.0.0) and the Network Mask is set
  8932. to 0.0.0.0.
  8933.  
  8934. Separate costs may be advertised for each IP Type of Service.  The
  8935. encoding of TOS in OSPF link state advertisements is described in
  8936. Section 12.3.  Note that the cost for TOS 0 must be included, and is
  8937. always listed first.  If the T-bit is reset in the advertisement's
  8938. Option field, only a route for TOS 0 is described by the advertisement.
  8939. Otherwise, routes for the other TOS values are also described; if a cost
  8940. for a certain TOS is not included, its cost defaults to that specified
  8941. for TOS 0.
  8942.  
  8943.  
  8944.     0                   1                   2                   3
  8945.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  8946.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8947.    |            LS age             |     Options   |    3 or 4     |
  8948.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8949.    |                        Link State ID                          |
  8950.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8951.    |                     Advertising Router                        |
  8952.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8953.    |                     LS sequence number                        |
  8954.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8955.    |         LS checksum           |             length            |
  8956.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8957.  
  8958.  
  8959.  
  8960. [Moy]                                                         [Page 160]
  8961.  
  8962. RFC 1247                     OSPF Version 2                    July 1991
  8963.  
  8964.  
  8965.    |                         Network Mask                          |
  8966.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8967.    |     TOS       |                  metric                       |
  8968.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  8969.    |                              ...                              |
  8970.  
  8971.  
  8972.  
  8973. Network Mask
  8974.     For Type 3 link state advertisements, this indicates the
  8975.     destination's IP network mask.  For example, when advertising the
  8976.     location of a class A network the value 0xff000000 would be used.
  8977.     This field is not meaningful and must be zero for Type 4 link state
  8978.     advertisements.
  8979.  
  8980.  
  8981. For each specified type of service, the following fields are defined.
  8982. The number of TOS routes included can be calculated from the link state
  8983. advertisement's length field.  Values for TOS 0 must be specified; they
  8984. are listed first.  Other values must be listed in order of increasing
  8985. TOS encoding.  For example, the cost for TOS 16 must always follow the
  8986. cost for TOS 8 when both are specified.
  8987.  
  8988.  
  8989. TOS The Type of Service that the following cost concerns.  The encoding
  8990.     of TOS in OSPF link state advertisements is described in Section
  8991.     12.3.
  8992.  
  8993. metric
  8994.     The cost of this route.  Expressed in the same units as the
  8995.     interface costs in the router links advertisements.
  8996.  
  8997.  
  8998.  
  8999.  
  9000.  
  9001.  
  9002.  
  9003.  
  9004.  
  9005.  
  9006.  
  9007.  
  9008.  
  9009.  
  9010.  
  9011.  
  9012.  
  9013.  
  9014.  
  9015.  
  9016. [Moy]                                                         [Page 161]
  9017.  
  9018. RFC 1247                     OSPF Version 2                    July 1991
  9019.  
  9020.  
  9021. A.4.5 AS external link advertisements
  9022.  
  9023. AS external link advertisements are the Type 5 link state
  9024. advertisements.  These advertisements are originated by AS boundary
  9025. routers.  A separate advertisement is made for each destination (known
  9026. to the router) which is external to the AS.  For details concerning the
  9027. construction of AS external link advertisements, see Section 12.4.3.
  9028.  
  9029. AS external link advertisements usually describe a particular external
  9030. destination.  For these advertisements the Link State ID field specifies
  9031. an IP network number.  AS external link advertisements are also used to
  9032. describe a default route.  Default routes are used when no specific
  9033. route exists to the destination.  When describing a default route, the
  9034. Link State ID is always set to DefaultDestination (0.0.0.0) and the
  9035. Network Mask is set to 0.0.0.0.
  9036.  
  9037. Separate costs may be advertised for each IP Type of Service.  The
  9038. encoding of TOS in OSPF link state advertisements is described in
  9039. Section 12.3.  Note that the cost for TOS 0 must be included, and is
  9040. always listed first.  If the T-bit is reset in the advertisement's
  9041. Option field, only a route for TOS 0 is described by the advertisement.
  9042. Otherwise, routes for the other TOS values are also described; if a cost
  9043. for a certain TOS is not included, its cost defaults to that specified
  9044. for TOS 0.
  9045.  
  9046.  
  9047.     0                   1                   2                   3
  9048.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  9049.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9050.    |            LS age             |     Options   |      5        |
  9051.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9052.    |                        Link State ID                          |
  9053.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9054.    |                     Advertising Router                        |
  9055.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9056.    |                     LS sequence number                        |
  9057.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9058.    |         LS checksum           |             length            |
  9059.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9060.    |                         Network Mask                          |
  9061.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9062.    |E|    TOS      |                  metric                       |
  9063.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9064.    |                      Forwarding address                       |
  9065.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9066.    |                      External Route Tag                       |
  9067.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9068.    |                              ...                              |
  9069.  
  9070.  
  9071.  
  9072. [Moy]                                                         [Page 162]
  9073.  
  9074. RFC 1247                     OSPF Version 2                    July 1991
  9075.  
  9076.  
  9077. Network Mask
  9078.     The IP network mask for the advertised destination.  For example,
  9079.     when advertising a class A network the mask 0xff000000 would be
  9080.     used.
  9081.  
  9082.  
  9083. For each specified type of service, the following fields are defined.
  9084. The number of TOS routes included can be calculated from the link state
  9085. advertisement's length field.  Values for TOS 0 must be specified; they
  9086. are listed first.  Other values must be listed in order of increasing
  9087. TOS encoding.  For example, the cost for TOS 16 must always follow the
  9088. cost for TOS 8 when both are specified.
  9089.  
  9090.  
  9091. bit E
  9092.     The type of external metric.  If bit E is set, the metric specified
  9093.     is a Type 2 external metric.  This means the metric is considered
  9094.     larger than any link state path.  If bit E is zero, the specified
  9095.     metric is a Type 1 external metric.  This means that is is
  9096.     comparable directly (without translation) to the link state metric.
  9097.  
  9098. Forwarding address
  9099.     Data traffic for the advertised destination will be forwarded to
  9100.     this address.  If the Forwarding address is set to 0.0.0.0, data
  9101.     traffic will be forwarded instead to the advertisement's originator
  9102.     (i.e., the responsible AS boundary router).
  9103.  
  9104. TOS The Type of Service that the following cost concerns.  The encoding
  9105.     of TOS in OSPF link state advertisements is described in Section
  9106.     12.3.
  9107.  
  9108. metric
  9109.     The cost of this route.  Interpretation depends on the external type
  9110.     indication (bit E above).
  9111.  
  9112. External Route Tag
  9113.     A 32-bit field attached to each external route.  This is not used by
  9114.     the OSPF protocol itself.  It may be used to communicate information
  9115.     between AS boundary routers; the precise nature of such information
  9116.     is outside the scope of this specification.
  9117.  
  9118.  
  9119.  
  9120.  
  9121.  
  9122.  
  9123.  
  9124.  
  9125.  
  9126.  
  9127.  
  9128. [Moy]                                                         [Page 163]
  9129.  
  9130. RFC 1247                     OSPF Version 2                    July 1991
  9131.  
  9132.  
  9133. B. Architectural Constants
  9134.  
  9135. Several OSPF protocol parameters have fixed architectural values.  These
  9136. parameters have been referred to in the text by names such as
  9137. LSRefreshTimer.  The same naming convention is used for the configurable
  9138. protocol parameters.  They are defined in appendix C.
  9139.  
  9140. The name of each architectural constant follows, together with its value
  9141. and a short description of its function.
  9142.  
  9143.  
  9144. LSRefreshTime
  9145.     The maximum time between distinct originations of any particular
  9146.     link state advertisement.  For each link state advertisement that a
  9147.     router originates, an interval timer should be set to this value.
  9148.     Firing of this timer causes a new instance of the link state
  9149.     advertisement to be originated.  The value of LSRefreshTime is set
  9150.     to 30 minutes.
  9151.  
  9152. MinLSInterval
  9153.     The minimum time between distinct originations of any particular
  9154.     link state advertisement.  The value of MinLSInterval is set to 5
  9155.     seconds.
  9156.  
  9157. MaxAge
  9158.     The maximum age that a link state advertisement can attain.  When an
  9159.     advertisement's age reaches MaxAge, it is reflooded.  It is then
  9160.     removed from the database as soon as this flood is acknowledged,
  9161.     i.e., as soon as it has been removed from all neighbor Link state
  9162.     retransmission lists.  Advertisements having age MaxAge are not used
  9163.     in the routing table calculation.  The value of MaxAge must be
  9164.     greater than LSRefreshTime.  The value of MaxAge is set to 1 hour.
  9165.  
  9166. CheckAge
  9167.     When the age of a link state advertisement (that is contained in the
  9168.     link state database) hits a multiple of CheckAge, the
  9169.     advertisement's checksum is verified.  An incorrect checksum at this
  9170.     time indicates a serious error.  The value of CheckAge is set to 5
  9171.     minutes.
  9172.  
  9173. MaxAgeDiff
  9174.     The maximum time dispersion that can occur, as a link state
  9175.     advertisement is flooded throughout the AS.  Most of this time is
  9176.     accounted for by the link state advertisements sitting on router
  9177.     output queues (and therefore not aging) during the flooding process.
  9178.     The value of MaxAgeDiff is set to 15 minutes.
  9179.  
  9180.  
  9181.  
  9182.  
  9183.  
  9184. [Moy]                                                         [Page 164]
  9185.  
  9186. RFC 1247                     OSPF Version 2                    July 1991
  9187.  
  9188.  
  9189. LSInfinity
  9190.     The link state metric value indicating that the destination is
  9191.     unreachable.  It is defined to be the binary value of all ones.  It
  9192.     depends on the size of the metric field, which is 16 bits in router
  9193.     links advertisements, and 24 bits in both summary and AS external
  9194.     links advertisements.
  9195.  
  9196. DefaultDestination
  9197.     The Destination ID that indicates the default route.  This route is
  9198.     used when no other matching routing table entry can be found.  The
  9199.     default destination can only be advertised in AS external link
  9200.     advertisements and in type 3 summary link advertisements for stub
  9201.     areas.  Its value is the IP address 0.0.0.0.
  9202.  
  9203.  
  9204.  
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240. [Moy]                                                         [Page 165]
  9241.  
  9242. RFC 1247                     OSPF Version 2                    July 1991
  9243.  
  9244.  
  9245. C. Configurable Constants
  9246.  
  9247. The OSPF protocol has quite a few configurable parameters.  These
  9248. parameters are listed below.  They are grouped into general functional
  9249. categories (area parameters, interface parameters, etc.).  Sample values
  9250. are given for some of the parameters.
  9251.  
  9252. Some parameter settings need to be consistent among groups of routers.
  9253. For example, all routers in an area must agree on that area's
  9254. parameters, and all routers attached to a network must agree on that
  9255. network's IP network number and mask.
  9256.  
  9257. Some parameters may be determined by router algorithms outside of this
  9258. specification (e.g., the address of a host connected to the router via a
  9259. SLIP line).  From OSPF's point of view, these items are still
  9260. configurable.
  9261.  
  9262.  
  9263. C.1 Global parameters
  9264.  
  9265. In general, a separate copy of the OSPF protocol is run for each area.
  9266. Because of this, most configuration parameters are defined on a per-area
  9267. basis.  The few global configuration parameters are listed below.
  9268.  
  9269.  
  9270. Router ID
  9271.     This is a 32-bit number that uniquely identifies the router in the
  9272.     Autonomous System.  One algorithm for Router ID assignment is to
  9273.     choose the largest or smallest IP address assigned to the router.
  9274.     If a router's OSPF Router ID is changed, the router's OSPF software
  9275.     should be restarted before the new Router ID takes effect.
  9276.  
  9277. TOS capability
  9278.     This item indicates whether the router will calculate separate
  9279.     routes based on TOS.  For more information, see Sections 4.5 and
  9280.     16.9.
  9281.  
  9282.  
  9283. C.2 Area parameters
  9284.  
  9285. All routers belonging to an area must agree on that area's
  9286. configuration.  Disagreements between two routers will lead to an
  9287. inability for adjacencies to form between them, with a resulting
  9288. hindrance to the flow of routing protocol traffic.  The following items
  9289. must be configured for an area:
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296. [Moy]                                                         [Page 166]
  9297.  
  9298. RFC 1247                     OSPF Version 2                    July 1991
  9299.  
  9300.  
  9301. Area ID
  9302.     This is a 32-bit number that identifies the area.  The Area ID of 0
  9303.     is reserved for the backbone.  If the area represents a subnetted
  9304.     network, the IP network number of the subnetted network may be used
  9305.     for the area ID.
  9306.  
  9307. List of address ranges
  9308.     An OSPF area is defined as a list of [IP address, mask] pairs.  Each
  9309.     pair describes a range of IP addresses.  Networks and hosts are
  9310.     assigned to an area depending on whether their addresses fall into
  9311.     one of the area's defining address ranges.  Routers are viewed as
  9312.     belonging to multiple areas, depending on their attached networks'
  9313.     area membership.  Routing information is condensed at area
  9314.     boundaries.  External to the area, a single route is advertised for
  9315.     each address range.
  9316.  
  9317.     As an example, suppose an IP subnetted network is to be its own OSPF
  9318.     area.  The area would be configured as a single address range, whose
  9319.     IP address is the address of the subnetted network, and whose mask
  9320.     is the natural class A, B, or C internet mask.  A single route would
  9321.     be advertised external to the area, describing the entire subnetted
  9322.     network.
  9323.  
  9324. Authentication type
  9325.     Each  area  can  be  configured  for  a  separate  type  of
  9326.     authentication.    See Appendix  E  for  a  discussion  of  the
  9327.     defined authentication  types.
  9328.  
  9329. External routing capability
  9330.     Whether AS external advertisements will be flooded into/throughout
  9331.     the area.  If AS external advertisements are excluded from the area,
  9332.     the area is called a "stub".  Internal to stub areas, routing to
  9333.     external destinations will be based solely on a default summary
  9334.     route.  The backbone cannot be configured as a stub area.  Also,
  9335.     virtual links cannot be configured through stub areas.  For more
  9336.     information, see Section 3.6.
  9337.  
  9338. StubDefaultCost
  9339.     If the area has been configured as a stub area, and the router
  9340.     itself is an area border router, then the StubDefaultCost indicates
  9341.     the cost of the default summary link that the router should
  9342.     advertise into the area.  There can be a separate cost configured
  9343.     for each IP TOS.  See Section 12.4.3 for more information.
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352. [Moy]                                                         [Page 167]
  9353.  
  9354. RFC 1247                     OSPF Version 2                    July 1991
  9355.  
  9356.  
  9357. C.3 Router interface parameters
  9358.  
  9359. Some of the configurable router interface parameters (such as IP
  9360. interface address and subnet mask) actually imply properties of the
  9361. attached networks, and therefore must be consistent across all the
  9362. routers attached to that network.  The parameters that must be
  9363. configured for a router interface are:
  9364.  
  9365.  
  9366. IP interface address
  9367.     The IP protocol address for this interface.  This uniquely
  9368.     identifies the router over the entire internet.  An IP address is
  9369.     not required on serial lines.  Such a serial line is called
  9370.     "unnumbered".
  9371.  
  9372. IP interface mask
  9373.     This  denotes  the  portion  of  the  IP  interface  address  that
  9374.     identifies  the  attached  network.   This  is  often  referred  to
  9375.     as  the subnet  mask.
  9376.  
  9377. Interface output cost(s)
  9378.     The cost of sending a packet on the interface, expressed in the link
  9379.     state metric.  This is advertised as the link cost for this
  9380.     interface in the router's router links advertisement.  There may be
  9381.     a separate cost for each IP Type of Service.  The interface output
  9382.     cost(s) must always be greater than 0.
  9383.  
  9384. RxmtInterval
  9385.     The number of seconds between link state advertisement
  9386.     retransmissions, for adjacencies belonging to this interface.  Also
  9387.     used when retransmitting Database Description and Link State Request
  9388.     Packets.  This should be well over the expected round-trip delay
  9389.     between any two routers on the attached network.  The setting of
  9390.     this value should be conservative or needless retransmissions will
  9391.     result.  It will need to be larger on low speed serial lines and
  9392.     virtual links.  Sample value for a local area network: 5 seconds.
  9393.  
  9394. InfTransDelay
  9395.     The estimated number of seconds it takes to transmit a Link State
  9396.     Update Packet over this interface.  Link state advertisements
  9397.     contained in the update packet must have their age incremented by
  9398.     this amount before transmission.  This value should take into
  9399.     account the transmission and propagation delays for the interface.
  9400.     It must be greater than 0.  Sample value for a local area network: 1
  9401.     second.
  9402.  
  9403. Router Priority
  9404.     An 8-bit unsigned integer.  When two routers attached to a network
  9405.  
  9406.  
  9407.  
  9408. [Moy]                                                         [Page 168]
  9409.  
  9410. RFC 1247                     OSPF Version 2                    July 1991
  9411.  
  9412.  
  9413.     both attempt to become Designated Router, the one with the highest
  9414.     Router Priority takes precedence.  If there is still a tie, the
  9415.     router with the highest Router ID takes precedence.  A router whose
  9416.     Router Priority is set to 0 is ineligible to become Designated
  9417.     Router on the attached network.  Router Priority is only configured
  9418.     for interfaces to multi-access networks.
  9419.  
  9420. HelloInterval
  9421.     The length of time, in seconds, between the Hello packets that the
  9422.     router sends on the interface.  This value is advertised in the
  9423.     router's Hello packets.  It must be the same for all routers
  9424.     attached to a common network.  The smaller the hello interval, the
  9425.     faster topological changes will be detected, but more routing
  9426.     traffic will ensue.  Sample value for a X.25 PDN network: 30
  9427.     seconds.  Sample value for a local area network: 10 seconds.
  9428.  
  9429. RouterDeadInterval
  9430.     The number of seconds that a router's Hellos have not been seen
  9431.     before its neighbors declare the router down.  This is also
  9432.     advertised in the router's Hello Packets in the DeadInt field.  This
  9433.     should be some multiple of the HelloInterval (say 4).  This value
  9434.     again must be the same for all routers attached to a common network.
  9435.  
  9436. Authentication key
  9437.     This configured data allows the authentication procedure to generate
  9438.     and/or verify the authentication field in the OSPF header.  For
  9439.     example, if the authentication type indicates simple password, the
  9440.     authentication key would be a 64-bit password.  This key would be
  9441.     inserted directly into the OSPF header when originating routing
  9442.     protocol packets.  There could be a separate password for each
  9443.     network.
  9444.  
  9445.  
  9446. C.4 Virtual link parameters
  9447.  
  9448. Virtual links are used to restore/increase connectivity of the backbone.
  9449. Virtual links may be configured between any pair of area border routers
  9450. having interfaces to a common (non-backbone) area.  The virtual link
  9451. appears as an unnumbered point-to-point link in the graph for the
  9452. backbone.  The virtual link must be configured in both of the area
  9453. border routers.
  9454.  
  9455. A virtual link appears in router links advertisements (for the backbone)
  9456. as if it were a separate router interface to the backbone.  As such, it
  9457. has all of the parameters associated with a router interface (see
  9458. Section C.3).  Although a virtual link acts like an unnumbered point-
  9459. to-point link, it does have an associated IP interface address.  This
  9460. address is used as the IP source in protocol packets it sends along the
  9461.  
  9462.  
  9463.  
  9464. [Moy]                                                         [Page 169]
  9465.  
  9466. RFC 1247                     OSPF Version 2                    July 1991
  9467.  
  9468.  
  9469. virtual link, and is set dynamically during the routing table build
  9470. process.  Interface output cost is also set dynamically on virtual links
  9471. to be the cost of the intra-area path between the two routers.  The
  9472. parameter RxmtInterval must be configured, and should be well over the
  9473. expected round-trip delay between the two routers.  This may be hard to
  9474. estimate for a virtual link.  It is better to err on the side of making
  9475. it too large.  Router Priority is not used on virtual links.
  9476.  
  9477. A virtual link is defined by the following two configurable parameters:
  9478. the Router ID of the virtual link's other endpoint, and the (non-
  9479. backbone) area through which the virtual link runs (referred to as the
  9480. virtual link's transit area).  Virtual links cannot be configured
  9481. through stub areas.
  9482.  
  9483.  
  9484. C.5 Non-broadcast, multi-access network parameters
  9485.  
  9486. OSPF treats a non-broadcast, multi-access network much like it treats a
  9487. broadcast network.  Since there many be many routers attached to the
  9488. network, a Designated Router is selected for the network.  This
  9489. Designated Router then originates a networks links advertisement, which
  9490. lists all routers attached to the non-broadcast network.
  9491.  
  9492. However, due to the lack of broadcast capabilities, it is necessary to
  9493. use configuration parameters in the Designated Router selection.  These
  9494. parameters need only be configured in those routers that are themselves
  9495. eligible to become Designated Router (i.e., those router's whose DR
  9496. Priority for the network is non-zero):
  9497.  
  9498.  
  9499. List of all other attached routers
  9500.     The list of all other routers attached to the non-broadcast network.
  9501.     Each router is listed by its IP interface address on the network.
  9502.     Also, for each router listed, that router's eligibility to become
  9503.     Designated Router must be defined.  When an interface to a non-
  9504.     broadcast network comes up, the router sends Hello packets only to
  9505.     those neighbors eligible to become Designated Router, until the
  9506.     identity of the Designated Router is discovered.
  9507.  
  9508. PollInterval
  9509.     If a neighboring router has become inactive (hellos have not been
  9510.     seen for RouterDeadInterval seconds), it may still be necessary to
  9511.     send Hellos to the dead neighbor.  These Hellos will be sent at the
  9512.     reduced rate PollInterval, which should be much larger than
  9513.     HelloInterval.  Sample value for a PDN X.25 network: 2 minutes.
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520. [Moy]                                                         [Page 170]
  9521.  
  9522. RFC 1247                     OSPF Version 2                    July 1991
  9523.  
  9524.  
  9525. C.6 Host route parameters
  9526.  
  9527. Host routes are advertised in network links advertisements as stub
  9528. networks with mask 0xffffffff.  They indicate either router interfaces
  9529. to point-to-point networks, looped router interfaces, or IP hosts that
  9530. are directly connected to the router (e.g., via a SLIP line).  For each
  9531. host directly connected to the router, the following items must be
  9532. configured:
  9533.  
  9534.  
  9535. Host IP address
  9536.     The IP address of the host.
  9537.  
  9538. Cost of link to host
  9539.     The cost of sending a packet to the host, in terms of the link state
  9540.     metric.  There may be multiple costs configured, one for each IP
  9541.     TOS.  However, since the host probably has only a single connection
  9542.     to the internet, the actual configured cost(s) in many cases is
  9543.     unimportant (i.e., will have no effect on routing).
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.  
  9557.  
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576. [Moy]                                                         [Page 171]
  9577.  
  9578. RFC 1247                     OSPF Version 2                    July 1991
  9579.  
  9580.  
  9581. D. Required Statistics
  9582.  
  9583. An OSPF implementation must provide a minimum set of statistics
  9584. indicating the operational state of the protocol.  These statistics must
  9585. be accessible to the user; this will probably be accomplished through
  9586. some sort of network management interface.
  9587.  
  9588. It is hoped that these statistics will aid in the debugging of the
  9589. implementation, and in the analysis of the protocol's performance.
  9590.  
  9591. The statistics can be broken into two broad categories.  The first
  9592. consists of what we will call logging messages.  These are messages
  9593. produced in real time, with generally a single message produced as the
  9594. result of a single protocol event.  Such messages are also commonly
  9595. referred to as traps.
  9596.  
  9597. The second category will be referred to as cumulative statistics.  These
  9598. are counters whose value have collected over time, such as the count of
  9599. link state retransmissions over the last hour.  Also falling into this
  9600. category are dumps of the various routing data structures.
  9601.  
  9602.  
  9603. D.1 Logging messages
  9604.  
  9605. A logging message should be produced on every significant protocol
  9606. event.  The major events are listed below.  Most of these events
  9607. indicate a topological change in the routing domain.  However, some
  9608. number of logging messages can be expected even when the routing domain
  9609. remains intact for long periods of time.  For example, link state
  9610. originations will still happen due to the link state refresh timer
  9611. firing.
  9612.  
  9613. Any of the messages that refer to link state advertisements should print
  9614. the area associated with the advertisement.  There is no area associated
  9615. with AS external link advertisements.
  9616.  
  9617. The following list of logging messages indicate topological changes in
  9618. the routing domain:
  9619.  
  9620.  
  9621. T1  The state of a router interface changes.  Interface state changes
  9622.     are documented in Section 9.3.  In general, they will cause new link
  9623.     state advertisements to be originated.  The logging message produced
  9624.     should include the interface's IP address (or other name), interface
  9625.     type (virtual link, etc.)  and old and new state values (as
  9626.     documented in Section 9.1).
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632. [Moy]                                                         [Page 172]
  9633.  
  9634. RFC 1247                     OSPF Version 2                    July 1991
  9635.  
  9636.  
  9637. T2  The state of a neighbor changes.  Neighbor state changes are
  9638.     documented in Section 10.3.  The logging message produced should
  9639.     include the neighbor IP address, and old and new state values.
  9640.  
  9641. T3  The (Backup) Designated Router has changed on one of the attached
  9642.     networks.  See Section 9.4.  The logging message produced should
  9643.     include the network IP address, and the old and new (Backup)
  9644.     Designated Routers.
  9645.  
  9646. T4  The router is originating a new instance of a link state
  9647.     advertisement.  The logging message produced should indicate the LS
  9648.     type, Link State ID and Advertising Router associated with the
  9649.     advertisement (see Section 12.4).
  9650.  
  9651. T5  The router has received a new instance of a link state
  9652.     advertisement.  The router receives these in Link State Update
  9653.     packets.  This will cause recalculation of the routing table.  The
  9654.     logging message produced should indicate the advertisement's LS
  9655.     type, Link State ID and Advertising Router.  The message should also
  9656.     include the neighbor from whom the advertisement was received.
  9657.  
  9658. T6  An entry in the routing table has changed (see Section 11).  The
  9659.     logging message produced should indicate the Destination type,
  9660.     Destination ID, and the old and new paths to the destination.
  9661.  
  9662.  
  9663. The following logging messages may indicate that there is a network
  9664. configuration error:
  9665.  
  9666.  
  9667. C1  A received OSPF packet is rejected due to errors in its IP/OSPF
  9668.     header.  The reasons for rejection are documented in Section 8.2.
  9669.     They include OSPF checksum failure, authentication failure, and
  9670.     inability to match the source with an active OSPF neighbor.  The
  9671.     logging message produced should include the IP source and
  9672.     destination addresses, the router ID in the OSPF header, and the
  9673.     reason for the rejection.
  9674.  
  9675. C2  An incoming Hello packet is rejected due to mismatches between the
  9676.     Hello's parameters and those configured for the receiving interface
  9677.     (see Section 10.5).  This indicates a configuration problem on the
  9678.     attached network.  The logging message should include the Hello's
  9679.     source, the receiving interface, and the non-matching parameters.
  9680.  
  9681. C3  An incoming Database Description packet, Link State Request Packet,
  9682.     Link State Acknowledgment Packet or Link State Update packet is
  9683.     rejected due to the source neighbor being in the wrong state (see
  9684.     Sections 10.6, 10.7, 13.7 , and 13 respectively).  This can be
  9685.  
  9686.  
  9687.  
  9688. [Moy]                                                         [Page 173]
  9689.  
  9690. RFC 1247                     OSPF Version 2                    July 1991
  9691.  
  9692.  
  9693.     normal when the identity of the network's Designated Router changes,
  9694.     causing momentary disagreements over the validity of adjacencies.
  9695.     The logging message should include the source neighbor, its state,
  9696.     and the packet's type.
  9697.  
  9698. C4  A Database Description packet has been retransmitted.  This may mean
  9699.     that the value of RxmtInterval that has been configured for the
  9700.     associated interface is too small.  The logging message should
  9701.     include the neighbor to whom the packet is being sent.
  9702.  
  9703.  
  9704. The following messages can be caused by packet transmission errors, or
  9705. software errors in an OSPF implementation:
  9706.  
  9707.  
  9708. E1  The checksum in a received link state advertisement is incorrect.
  9709.     The advertisement is discarded (see Section 13).  The logging
  9710.     message should include the advertisement's LS type, Link State ID
  9711.     and Advertising Router (which may be incorrect).  The message should
  9712.     also include the neighbor from whom the advertisement was received.
  9713.  
  9714. E2  During the aging process, it is discovered that one of the link
  9715.     state advertisements in the database has an incorrect checksum.
  9716.     This indicates memory corruption or a software error in the router
  9717.     itself.  The router should be dumped and restarted.
  9718.  
  9719.  
  9720. The following messages are an indication that a router has restarted,
  9721. losing track of its previous LS sequence number.  Should these messages
  9722. continue, it may indicate the presence of duplicate Router IDs:
  9723.  
  9724.  
  9725. R1  Two link state advertisements have been seen, whose LS type, Link
  9726.     State ID, Advertising Router and LS sequence number are the same,
  9727.     yet with differing LS checksums.  These are considered to be
  9728.     different instances of the same advertisement.  The instance with
  9729.     the larger checksum is accepted as more recent (see Section 12.1.7,
  9730.     13.1).  The logging message should include the LS type, Link State
  9731.     ID, Advertising Router, LS sequence number and the two differing
  9732.     checksums.
  9733.  
  9734. R2  Two link state advertisements have been seen, whose LS type, Link
  9735.     State ID, Advertising Router, LS sequence number and LS checksum are
  9736.     the same, yet can be distinguished by their LS age fields.  This
  9737.     means that one of the advertisement's LS age is MaxAge, or the two
  9738.     LS age fields differ by more than MaxAgeDiff.  The logging message
  9739.     should include the LS type, Link State ID, Advertising Router, LS
  9740.     sequence number and the two differing ages.
  9741.  
  9742.  
  9743.  
  9744. [Moy]                                                         [Page 174]
  9745.  
  9746. RFC 1247                     OSPF Version 2                    July 1991
  9747.  
  9748.  
  9749. R3  The router has received an instance of one of its self-originated
  9750.     advertisements, that is considered to be more recent.  This forces
  9751.     the router to originate a new advertisement (see Section 13.4).  The
  9752.     logging message should include the advertisement's LS type, Link
  9753.     State ID, and Advertising Router along with the neighbor from whom
  9754.     the advertisement was received.
  9755.  
  9756. R4  An acknowledgment has been received for an instance of an
  9757.     advertisement that is not currently contained in the router's
  9758.     database (see Section 13.7).  The logging message should detail the
  9759.     instance being acknowledged and the database copy (if any), along
  9760.     with the neighbor from whom the acknowledgment was received.
  9761.  
  9762. R5  An advertisement has been received through the flooding procedure
  9763.     that is LESS recent the the router's current database copy (see
  9764.     Section 13).  The logging message should include the received
  9765.     advertisement's LS type, Link State ID, Advertising Router, LS
  9766.     sequence number, LS age and LS checksum.  Also, the message should
  9767.     display the neighbor from whom the advertisement was received.
  9768.  
  9769.  
  9770. The following messages are indication of normal, yet infrequent protocol
  9771. events.  These messages will help in the interpretation of some of the
  9772. above messages:
  9773.  
  9774.  
  9775. N1  The Link state refresh timer has fired for one of the router's
  9776.     self-originated advertisements (see Section 12.4).  A new instance
  9777.     of the advertisement must be originated.  The message should include
  9778.     the advertisement's LS type, Link State ID and Advertising Router.
  9779.  
  9780. N2  One of the advertisements in the router's link state database has
  9781.     aged to MaxAge (see Section 14).  At this point, the advertisement
  9782.     is no longer included in the routing table calculation, and is
  9783.     reflooded.  The message should list the advertisement's LS type,
  9784.     Link State ID and Advertising Router.
  9785.  
  9786. N3  An advertisement of age MaxAge has been flushed from the router's
  9787.     database.  This occurs after the advertisement has been acknowledged
  9788.     by all adjacent neighbors.  The message should list the
  9789.     advertisement's LS type, Link State ID and Advertising Router.
  9790.  
  9791.  
  9792. D.2 Cumulative statistics
  9793.  
  9794. These statistics display collections of the routing data structures.
  9795. They should be able to be obtained interactively, through some kind of
  9796. network management facility.
  9797.  
  9798.  
  9799.  
  9800. [Moy]                                                         [Page 175]
  9801.  
  9802. RFC 1247                     OSPF Version 2                    July 1991
  9803.  
  9804.  
  9805. All the following statistics displays, with the exception of the area
  9806. list, routing table and the AS external links, are specific to a single
  9807. area.  As noted in Section 4, most OSPF protocol mechanisms work on each
  9808. area separately.
  9809.  
  9810. The following statistics displays should be available:
  9811.  
  9812.  
  9813. (1) A list of all the areas attached to the router, along with the
  9814.     authentication type to use for the area, the number of router
  9815.     interfaces attaching to the area, and the total number of nets and
  9816.     routers belonging to the area.
  9817.  
  9818.     For example, consider the router RT3 pictured in Figure 15.  It has
  9819.     interfaces to two separate areas, Area 1 and the backbone (Area 0).
  9820.     Table 20 then indicates that the backbone is using a simple password
  9821.     for authentication, and that Area 1 is not using any authentication.
  9822.     The number of nets includes IP networks, subnets, and hosts (this is
  9823.     the reason for 2 backbone nets -- they are the host routes
  9824.     corresponding to the serial line between backbone routers RT6 and
  9825.     RT10).
  9826.  
  9827.  
  9828.  
  9829.                  Area ID   # ifcs   AuType   # nets   # routers
  9830.                  ______________________________________________
  9831.                  0         1        1        2        7
  9832.                  1         2        0        4        4
  9833.  
  9834.  
  9835.                       Table 20: Sample OSPF area display.
  9836.  
  9837.  
  9838.  
  9839. (2) A list of all the router's interfaces to an area, along with their
  9840.     addresses, output cost, current state, the (Backup) Designated
  9841.     Router for the attached network, and the number of neighbors
  9842.     currently associated with the interface.  Some number of these
  9843.     neighbors will have become adjacent, the number of these is noted in
  9844.     the display also.
  9845.  
  9846.     Again consider router RT3 in Figure 15.  Table 21 below indicates
  9847.     that RT4 has been selected as Designated Router for network N3, and
  9848.     router RT1 has been selected as Backup.  Adjacencies have been
  9849.     established to both of these routers.  There are no routers besides
  9850.     RT3 attached to network N4, so it becomes DR, yet still advertises
  9851.     the network as a stub in its router links advertisements.
  9852.  
  9853.  
  9854.  
  9855.  
  9856. [Moy]                                                         [Page 176]
  9857.  
  9858. RFC 1247                     OSPF Version 2                    July 1991
  9859.  
  9860.  
  9861.  
  9862.    Ifc IP address   state      cost   DR          Backup      # nbrs   # adjs
  9863.    __________________________________________________________________________
  9864.    192.1.1.3        DR other   1      192.1.1.4   192.1.1.1   3        2
  9865.    192.1.4.3        DR         2      192.1.4.3   none        0        0
  9866.  
  9867.  
  9868.                     Table 21: Sample OSPF interface display.
  9869.  
  9870.  
  9871.  
  9872. (3) The list of neighbors associated with a particular interface.  Each
  9873.     neighbor's IP address, router ID, state, and the length of the three
  9874.     link state advertisement queues (see Section 10) to the neighbor is
  9875.     displayed.
  9876.  
  9877.     Suppose router RT4 is the Designated Router for network N3, and
  9878.     router RT1 is the Backup Designated router.  Suppose also that the
  9879.     adjacency between router RT3 and RT1 has not yet fully formed.  The
  9880.     display of router RT3's neighbors (associated with its interface to
  9881.     network N3) may then look like Table 22.  The display indicates that
  9882.     RT3 and RT1 are still in the database exchange procedure, Router RT3
  9883.     has more Database Description packets to send to RT1, and RT1 has at
  9884.     least one link state advertisement that RT3 doesn't.  Also, there is
  9885.     a single link state advertisement that has been flooded, but not
  9886.     acknowledged, to each neighbor that participates in the flooding
  9887.     procedure (state >= Exchng).  (In the following examples we assume
  9888.     that a router's Router ID is assigned to be its smallest IP
  9889.     interface address).
  9890.  
  9891.  
  9892.  
  9893.   Nbr IP address   Router ID   state    LS rxmt len   DB summ len   LS req len
  9894.   ____________________________________________________________________________
  9895.   192.1.1.1        192.1.1.1   Exchng   1             10            1
  9896.   192.1.1.2        192.1.1.2   2-Way    0             0             0
  9897.   192.1.1.4        192.1.1.4   Full     1             0             0
  9898.  
  9899.  
  9900.                     Table 22: Sample OSPF neighbor display.
  9901.  
  9902.  
  9903.  
  9904. (4) A list of the area's link state database.  This is the same in all
  9905.     of the routers attached to the area.  It is composed of that area's
  9906.     router links, network links, and summary links advertisements.
  9907.     Also, the AS external link advertisements are a part of all the
  9908.     areas' databases.
  9909.  
  9910.  
  9911.  
  9912. [Moy]                                                         [Page 177]
  9913.  
  9914. RFC 1247                     OSPF Version 2                    July 1991
  9915.  
  9916.  
  9917.     The link state database for Area 1 in Figure 15 might look like
  9918.     Table 23 (compare this with Figure 7).  Assume the the Designated
  9919.     Router for network N3 is router RT4, as above.  Both routers RT3 and
  9920.     RT4 are originating summary link advertisements into Area 1, since
  9921.     they are area border routers.  Routers RT5 and RT7 are AS external
  9922.     routers.  Their location must be described in summary links
  9923.     advertisements.  Also, their AS external link advertisements are
  9924.     flooded throughout the entire AS.
  9925.  
  9926.     Router RT3 can locate its self-originated advertisements by looking
  9927.     for its own router ID (192.1.1.3) in advertisements' Advertising
  9928.     Router fields.
  9929.  
  9930.     The LS sequence number, LS age, and LS checksum fields indicate the
  9931.     advertisement's instance.  Their values are stored in the
  9932.     advertisement's link state header; we have not bothered to make up
  9933.     values for the example.
  9934.  
  9935.  
  9936. LS type   Link State ID   Advertising Router   LS seq no   LS age   LS checksum
  9937. _______________________________________________________________________________
  9938. 1         192.1.1.1       192.1.1.1            *           *        *
  9939. 1         192.1.1.2       192.1.1.2            *           *        *
  9940. 1         192.1.1.3       192.1.1.3            *           *        *
  9941. 1         192.1.1.4       192.1.1.4            *           *        *
  9942. _______________________________________________________________________________
  9943. 2         192.1.1.4       192.1.1.4            *           *        *
  9944. _______________________________________________________________________________
  9945. 3         Ia,Ib           192.1.1.3            *           *        *
  9946. 3         N6              192.1.1.3            *           *        *
  9947. 3         N7              192.1.1.3            *           *        *
  9948. 3         N8              192.1.1.3            *           *        *
  9949. 3         N9-N11,H1       192.1.1.3            *           *        *
  9950. 3         Ia,Ib           192.1.1.4            *           *        *
  9951. 3         N6              192.1.1.4            *           *        *
  9952. 3         N7              192.1.1.4            *           *        *
  9953. 3         N8              192.1.1.4            *           *        *
  9954. 3         N9-N11,H1       192.1.1.4            *           *        *
  9955. 4         RT5             192.1.1.3            *           *        *
  9956. 4         RT7             192.1.1.3            *           *        *
  9957. 4         RT5             192.1.1.4            *           *        *
  9958. 4         RT7             192.1.1.4            *           *        *
  9959. _______________________________________________________________________________
  9960. 4         N12             RT5's ID             *           *        *
  9961. 4         N13             RT5's ID             *           *        *
  9962. 4         N14             RT5's ID             *           *        *
  9963. 4         N12             RT7's ID             *           *        *
  9964.  
  9965.  
  9966.  
  9967.  
  9968. [Moy]                                                         [Page 178]
  9969.  
  9970. RFC 1247                     OSPF Version 2                    July 1991
  9971.  
  9972.  
  9973. LS type   Link State ID   Advertising Router   LS seq no   LS age   LS checksum
  9974. _______________________________________________________________________________
  9975. 4         N15             RT7's ID             *           *        *
  9976.  
  9977.  
  9978.              Table 23: Sample OSPF link state database display.
  9979.  
  9980.  
  9981. (5) The contents of any particular link state advertisement.  For
  9982.     example, a listing of the router links advertisement for Area 1,
  9983.     with LS type = 1 and Link State ID = 192.1.1.3 is shown in Section
  9984.     12.4.1.
  9985.  
  9986. (6) A listing of the entire routing table.  Several examples are shown
  9987.     in Section 11.  The routing table is calculated from the combined
  9988.     databases of each attached area (see Section 16).  It may be
  9989.     desirable to sort the routing table by Type of Service, or by
  9990.     destination, or a combination of the two.
  9991.  
  9992.  
  9993.  
  9994.  
  9995.  
  9996.  
  9997.  
  9998.  
  9999.  
  10000.  
  10001.  
  10002.  
  10003.  
  10004.  
  10005.  
  10006.  
  10007.  
  10008.  
  10009.  
  10010.  
  10011.  
  10012.  
  10013.  
  10014.  
  10015.  
  10016.  
  10017.  
  10018.  
  10019.  
  10020.  
  10021.  
  10022.  
  10023.  
  10024. [Moy]                                                         [Page 179]
  10025.  
  10026. RFC 1247                     OSPF Version 2                    July 1991
  10027.  
  10028.  
  10029. E. Authentication
  10030.  
  10031. All OSPF protocol exchanges are authenticated.  The OSPF packet header
  10032. (see Section A.3.1) includes an authentication type field, and 64-bits
  10033. of data for use by the appropriate authentication scheme (determined by
  10034. the type field).
  10035.  
  10036. The authentication type is configurable on a per-area basis.  Additional
  10037. authentication data is configurable on a per-interface basis.  For
  10038. example, if an area uses a simple password scheme for authentication, a
  10039. separate password may be configured for each network contained in the
  10040. area.
  10041.  
  10042. Authentication types 0 and 1 are defined by this specification.  All
  10043. other authentication types are reserved for definition by the IANA
  10044. (iana@ISI.EDU).  The current list of authentication types is described
  10045. below in Table 24.
  10046.  
  10047.  
  10048.  
  10049.       AuType       Description
  10050.       _______________________________________________________________
  10051.       0            No authentication
  10052.       1            Simple password
  10053.       All others   Reserved for assignment by the IANA (iana@ISI.EDU)
  10054.  
  10055.  
  10056.                     Table 24: OSPF authentication types.
  10057.  
  10058.  
  10059.  
  10060. E.1 Autype 0 -- No authentication
  10061.  
  10062. Use of this authentication type means that routing exchanges in the area
  10063. are not authenticated.  The 64-bit field in the OSPF header can contain
  10064. anything; it is not examined on packet reception.
  10065.  
  10066.  
  10067. E.2 Autype 1 -- Simple password
  10068.  
  10069. Using this authentication type, a 64-bit field is configured on a per-
  10070. network basis.  All packets sent on a particular network must have this
  10071. configured value in their OSPF header 64-bit authentication field.  This
  10072. essentially serves as a "clear" 64-bit password.
  10073.  
  10074. This guards against routers inadvertently coming up in the area.  They
  10075. must first be configured with their attached networks' passwords before
  10076. they can join the routing domain.
  10077.  
  10078.  
  10079.  
  10080. [Moy]                                                         [Page 180]
  10081.  
  10082. RFC 1247                     OSPF Version 2                    July 1991
  10083.  
  10084.  
  10085. F. Version 1 differences
  10086.  
  10087. This section documents the changes between OSPF version 1 and OSPF
  10088. version 2.  The impetus for these changes derives from comments received
  10089. on RFC 1131 and recent field experience with the OSPF protocol.
  10090. Unfortunately, the changes are not backward-compatible.  For that
  10091. reason, OSPF version 1 will not interoperate with OSPF version 2.
  10092. However, the changes are small in scope and should not greatly affect
  10093. any existing implementations.  In addition, some of the proposed changes
  10094. should enable future protocol additions to be made in a backward-
  10095. compatible manner (see Section F.4).
  10096.  
  10097.  
  10098. F.1 Protocol Enhancements
  10099.  
  10100. The following enhancements were made to the OSPF protocol.
  10101.  
  10102.  
  10103. F.1.1 Stub area support
  10104.  
  10105. In many Autonomous Systems, the majority of the OSPF link state database
  10106. consists of AS external advertisements.  In these Autonomous Systems,
  10107. some OSPF areas may be organized in such a way that external
  10108. advertisements can be safely ignored, enabling a reduction of the area's
  10109. database size.  This applies to OSPF areas where there is only a single
  10110. exit/entry that is used by all externally addressed packets, or to cases
  10111. where some sub-optimality of external routing is acceptable.
  10112.  
  10113. Therefore, an OSPF area configuration option has been added (see
  10114. Sections 3.6 and C.2) allowing the import of external advertisements to
  10115. be disabled for an area.  When this option is enabled, no AS external
  10116. advertisements will be flooded into the area (Sections 13, 13.3 and
  10117. 10.3).  Instead, within the area all data traffic to external
  10118. destinations will follow a (per-area) default route.  These areas are
  10119. called "stub" areas.
  10120.  
  10121. To implement this, all area border routers attached to stub areas will
  10122. originate a default summary link advertisement for the area (Section
  10123. 12.4.3).  This will direct all internal routers to an area border router
  10124. when forwarding externally addressed packets.  In addition, to ensure
  10125. that stub areas are configured consistently, an Options field has been
  10126. added to OSPF Hello packets (Sections A.2 and A.3.2).  A bit is reset in
  10127. the Options field indicating that the attached area is a stub area
  10128. (Section 9.5).  A router will not accept a neighbor's hellos unless they
  10129. both agree on the area's ability to process AS external advertisements
  10130. (Section 10.5).  In this way, a system administrator will be able to
  10131. discover incorrectly configured routers, and data traffic will be routed
  10132. around them (in order to avoid potential looping situations) until their
  10133.  
  10134.  
  10135.  
  10136. [Moy]                                                         [Page 181]
  10137.  
  10138. RFC 1247                     OSPF Version 2                    July 1991
  10139.  
  10140.  
  10141. configuration can be repaired.
  10142.  
  10143.  
  10144. F.1.2 Optional TOS support
  10145.  
  10146. In OSPF there is conceptually a separate routing table for each TOS; the
  10147. calculations detailed in steps 1-5 of Section 16 must be done separately
  10148. for each TOS.  (Note however that link and summary costs need not be
  10149. specified separately for each TOS; costs for unspecified TOS values
  10150. default to the cost of TOS 0).
  10151.  
  10152. In version 1 of the OSPF specification, all OSPF routers were required
  10153. to route based on TOS.  However, producing a separate routing table for
  10154. each TOS may prove costly, both in terms of memory and processor
  10155. resources.  For this reason, version 2 allows the system administrator
  10156. to configure routers to calculate/use only a single routing table (the
  10157. TOS 0 table).  When this is done, some traffic may take non-optimal
  10158. routes.  But all packets will still be delivered, and routing will
  10159. remain loop free (see Section 2.4).
  10160.  
  10161. In order to avoid routing loops, a router (router X) using a single
  10162. table must communicate this information to its peers.  This is done by
  10163. resetting the new TOS-capable bit in the router X's router links
  10164. advertisement (Section 12.4.1).  Then, when its peers perform the
  10165. Dijkstra calculation (Section 16.1) for non-zero TOS values, they will
  10166. omit router X from the calculation.  In effect, an attempt will be made
  10167. to bypass router X when forwarding non-zero TOS traffic.  Summary link
  10168. and AS external link advertisements can also indicate their non-
  10169. availability for non-zero TOS traffic (Sections 12.4.3 and 12.4.4).
  10170.  
  10171. The result may be that no route can be found for some non-zero value of
  10172. TOS.  When this happens, the packet is routed along the TOS 0 route
  10173. instead (Section 11.1).
  10174.  
  10175. It is still mandatory for all OSPF implementations to be able to
  10176. construct separate routing tables for each TOS value, if desired by the
  10177. system administrator.
  10178.  
  10179.  
  10180. F.1.3 Preventing external extra-hops
  10181.  
  10182. In some cases, version 1 of the OSPF specification will introduce
  10183. extra-hops when calculating routes to external destinations.  This is
  10184. because it is implicit in the format of AS external advertisements that
  10185. packets should be forwarded through the advertising router.  However,
  10186. consider the situation where multiple OSPF routers share a LAN with an
  10187. external router (call it router Y) , and only one OSPF router (call it
  10188. router X) exchanges routing information with Y.  The OSPF routers on the
  10189.  
  10190.  
  10191.  
  10192. [Moy]                                                         [Page 182]
  10193.  
  10194. RFC 1247                     OSPF Version 2                    July 1991
  10195.  
  10196.  
  10197. LAN other than X will forward packets destined for Y and beyond through
  10198. X, generating an extra hop (see Section 2.2).
  10199.  
  10200. To fix this, a new field has been added to AS external advertisements.
  10201. This field (called the forwarding address) will indicate the router
  10202. address to which packets should be forwarded (Section 12.4.4).  In the
  10203. above example, router X will put Y's IP address into this field.  If the
  10204. field is 0, packets are (as before) forwarded to the originator of the
  10205. advertisement.  A different forwarding address can be specified for each
  10206. TOS value.
  10207.  
  10208. Whenever possible, this new field should be set to 0.  This is because
  10209. setting it to an actual router address incurs additional cost during the
  10210. routing table build process (Section 16.4).
  10211.  
  10212. Besides preventing extra-hops, there are two other applications for this
  10213. field.  The first is for use by "route servers".  Using the forwarding
  10214. address, a router in the middle of the Autonomous System can gather
  10215. external routing information and originate AS external advertisements
  10216. that specify the correct exit route to use for each external destination
  10217. (Section 2.2).
  10218.  
  10219. The other application possibly enables the reduction of the number of AS
  10220. external advertisements that need be imported.  Suppose in the example
  10221. at the beginning of this section that there are two routers (X and Z)
  10222. exchanging EGP information with the non-OSPF router Y.  It is then
  10223. likely that both X and Z will originate the same set of external routes.
  10224. Two AS external advertisements that specify the same (non-zero)
  10225. forwarding address, destination and cost are obviously functionally
  10226. equivalent, regardless of their originators (advertising routers).  The
  10227. OSPF specification dictates that the advertisement originated by the
  10228. router with the largest Router ID will always be used.  This allows the
  10229. other router to flush its equivalent advertisement (Section 12.4.4).
  10230.  
  10231.  
  10232. F.2 Corrected problems
  10233.  
  10234. The following problems in OSPF version 1 have been corrected in version
  10235. 2.
  10236.  
  10237.  
  10238. F.2.1 LS sequence number space changes
  10239.  
  10240. The LS sequence number space has been changed from version 1's lollipop
  10241. shape to a linear sequence space (Section 12.1.6).  Sequence numbers
  10242. will now be compared as signed 32-bit integers.  Link state
  10243. advertisements having larger sequence numbers will be considered more
  10244. recent.  The sequence number space will still begin at (-N+1) (where N =
  10245.  
  10246.  
  10247.  
  10248. [Moy]                                                         [Page 183]
  10249.  
  10250. RFC 1247                     OSPF Version 2                    July 1991
  10251.  
  10252.  
  10253. 2**31).  The value of -N remains reserved.  The LS sequence number of
  10254. successive instances of an advertisement will continue to be incremented
  10255. until it reaches the maximum possible value: N-1.  At this point, when a
  10256. new instance of the advertisement must be originated (due either to
  10257. topological change of the expiration of the LS refresh timer) the
  10258. current instance must first be "prematurely aged".
  10259.  
  10260. There will be a new section discussing premature aging (Section 14.1).
  10261. This is a method for flushing a link state advertisement from the
  10262. routing domain: the advertisement's age is set to MaxAge and
  10263. advertisement is reflooded just as if it were a newly received
  10264. advertisement.  As soon as the new flooding is acknowledged by all of
  10265. the router's adjacent neighbors, the advertisement is flushed from the
  10266. database.
  10267.  
  10268. Premature aging can also be used when, for example, a previously
  10269. advertised external route is no longer reachable.  In this circumstance,
  10270. premature aging is preferable to the alternative, which is to originate
  10271. a new advertisement for the destination specifying a metric of
  10272. LSInfinity.
  10273.  
  10274. A router may only prematurely age its own (self-originated) link state
  10275. advertisements.  These are the link state advertisements having the
  10276. router's own OSPF router ID in the Advertising Router field.
  10277.  
  10278.  
  10279. F.2.2 Flooding of unexpected MaxAge advertisements
  10280.  
  10281. Version 1 of the OSPF omitted the handling of a special case in the
  10282. flooding procedure: the reception of a MaxAge advertisement that has no
  10283. database instance.  A paragraph has been added to Section 13 to deal
  10284. with this occurrence.  Without this paragraph, retransmissions of MaxAge
  10285. advertisements could possibly delay their being flushed from the routing
  10286. domain.
  10287.  
  10288.  
  10289. F.2.3 Virtual links and address ranges
  10290.  
  10291. When summarizing information into a virtual link's transit area, version
  10292. 2 of the OSPF specification prohibits the collapsing of multiple
  10293. backbone IP networks/subnets into a single summary link.  This
  10294. restriction has been added to deal with certain anomalous OSPF area
  10295. configurations.  See Sections 15 and 12.4.3 for more information.
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.  
  10304. [Moy]                                                         [Page 184]
  10305.  
  10306. RFC 1247                     OSPF Version 2                    July 1991
  10307.  
  10308.  
  10309. F.2.4 Routing table lookup explained
  10310.  
  10311. When forwarding an IP data packet, a router looks up the packet's IP
  10312. destination in the routing table.  This determines the packet's next
  10313. hop.  A new section (Section 11.1) has been added describing the routing
  10314. table lookup (instead of just specifying a "best match").  This section
  10315. clarifies OSPF's four level routing hierarchy (i.e., intra-area, inter-
  10316. area, external type 1 and external type 2 routes).  It also specifies
  10317. the effect of TOS on routing.
  10318.  
  10319.  
  10320. F.2.5 Sending Link State Request packets
  10321.  
  10322. OSPF Version 2 eases the restrictions on the sending of Link State
  10323. Request packets.  Link State Request packets can now be sent to a
  10324. neighboring router before a complete set of Database Description packets
  10325. have been exchanged.  This enables a more efficient use of a router's
  10326. memory resources; an OSPF version 2 implementation may limit the size of
  10327. the neighbor Link state request lists.  See Sections 10.9, 10.7 and 10.3
  10328. for more details.
  10329.  
  10330.  
  10331. F.2.6 Changes to the Database description process
  10332.  
  10333. The specification has been modified to ensure that, when two routers are
  10334. synchronizing their databases during the Database Description process,
  10335. none of the component link state advertisements can have their sequence
  10336. numbers decrease.  A link state advertisement's sequence number
  10337. decreases when it is flushed from the routing domain via premature-
  10338. aging, and then reoriginated with the smallest sequence number
  10339. 0x80000001 (see Section 14.1).  So the specification now dictates that
  10340. an advertisement cannot be flushed from a router's database until both
  10341. a) it no longer appears on any neighbor Link State Retransmission lists
  10342. and b) none of the router's neighbors are in states Exchange or Loading.
  10343. See Sections 13 (step 4c) and 14.1 for more details.
  10344.  
  10345. In addition, a new step has been added to the flooding procedure
  10346. (Section 13) in order to make the Database Description process more
  10347. robust.  This step detects when a neighbor lists one instance of an
  10348. advertisement in its Database Description packets, but responds to Link
  10349. State Request packets by sending another (earlier) instance.  This
  10350. behavior now causes the event BadLSReq to be generated, which restarts
  10351. the Database Description process with the neighbor.  In OSPF version 1,
  10352. the neighbor event BadLSReq erroneously did not restart the Database
  10353. Description process.
  10354.  
  10355.  
  10356.  
  10357.  
  10358.  
  10359.  
  10360. [Moy]                                                         [Page 185]
  10361.  
  10362. RFC 1247                     OSPF Version 2                    July 1991
  10363.  
  10364.  
  10365. F.2.7 Receiving OSPF Hello packets
  10366.  
  10367. The section detailing the receive processing of OSPF Hello packets
  10368. (Section 10.5) has been modified to include the generation of the
  10369. neighbor Backup Seen event.  In addition, the section detailing the
  10370. Designated Router election algorithm (Section 9.4) has been modified to
  10371. include the algorithm's initial state.
  10372.  
  10373.  
  10374. F.2.8 Network mask defined for default route
  10375.  
  10376. The network mask for the default route, when it appears as the
  10377. destination in either an AS external link advertisement or in a summary
  10378. link advertisement, has been set to 0.0.0.0.  See Sections A.4.4 and
  10379. A.4.5 for more details.
  10380.  
  10381.  
  10382. F.2.9 Rate limit imposed on flooding
  10383.  
  10384. When an advertisement is installed in the link state database, it is
  10385. timestamped.  The flooding procedure is then not allowed to install a
  10386. new instance of the advertisement until MinLSInterval seconds have
  10387. elapsed.  This enforces a rate limit on the flooding procedure; a new
  10388. instance can be flooded only once every MinLSInterval seconds.  This
  10389. guards against routers that disregard the limit on self-originated
  10390. advertisements (already present in OSPF version 1) of one origination
  10391. every MinLSInterval seconds.  For more information, see Section 13.
  10392.  
  10393.  
  10394. F.3 Packet format changes
  10395.  
  10396. The following changes have been made to the format of OSPF packets and
  10397. link state advertisements.  Some of these changes were required to
  10398. support the added functionality listed above.  Other changes were made
  10399. to further simplify the parsing of OSPF packets.
  10400.  
  10401.  
  10402. F.3.1 Adding a Capability bitfield
  10403.  
  10404. To support the new "stub area" and "optional TOS" features, a bitfield
  10405. listing protocol capabilities has been added to the Hello packet,
  10406. Database Description packet and all link state advertisements.  When
  10407. used in Hello packets, this allows a router to reject a neighbor because
  10408. of a capability mismatch.  Alternatively, when capabilities are
  10409. exchanged in Database Description packets a router can choose not to
  10410. forward certain link state advertisements to a neighbor because of its
  10411. reduced functionality.  Lastly, listing capabilities in link state
  10412. advertisements allows routers to route traffic around reduced
  10413.  
  10414.  
  10415.  
  10416. [Moy]                                                         [Page 186]
  10417.  
  10418. RFC 1247                     OSPF Version 2                    July 1991
  10419.  
  10420.  
  10421. functionality router, by excluding them from parts of the routing table
  10422. calculation.  See Section A.2 for more details.
  10423.  
  10424.  
  10425. F.3.2 Packet simplification
  10426.  
  10427. To simplify the format of Database Description packets and Link State
  10428. Acknowledgment packets, their description of link state advertisements
  10429. has been modified.  Each advertisement is now be described by its 20-
  10430. byte link state header (see Section A.4).  This does not consume any
  10431. additional space in the packets.  The one additional piece of
  10432. information that will be present is the LS length.  However, this field
  10433. need not be used when processing the Database Description and Link State
  10434. Acknowledgment packets.
  10435.  
  10436.  
  10437. F.3.3 Adding forwarding addresses to AS external advertisements
  10438.  
  10439. As discussed in Section F.1.3, a forwarding address field has been added
  10440. to the AS external advertisement.
  10441.  
  10442.  
  10443. F.3.4 Labelling of virtual links
  10444.  
  10445. Virtual links will be labelled as such in router links advertisements.
  10446. This separates virtual links from unnumbered point-to-point links,
  10447. allowing all backbone routers to discover whether any virtual links are
  10448. in use.  See Section 12.4.1 for more details.
  10449.  
  10450.  
  10451. F.3.5 TOS costs ordered
  10452.  
  10453. When a link state advertisement specifies a separate cost depending on
  10454. TOS, these costs must be ordered by increasing TOS value.  For example,
  10455. the cost for TOS 16 must always follow the cost for TOS 8.
  10456.  
  10457.  
  10458. F.3.6 OSPF's TOS encoding redefined
  10459.  
  10460. The way that OSPF encodes TOS in its link state advertisements has been
  10461. redefined in version 2. OSPF's encoding of the Delay (D), Throughput (T)
  10462. and Reliability (R) TOS flags defined by [RFC 791] is described in
  10463. Section 12.3.
  10464.  
  10465.  
  10466.  
  10467.  
  10468.  
  10469.  
  10470.  
  10471.  
  10472. [Moy]                                                         [Page 187]
  10473.  
  10474. RFC 1247                     OSPF Version 2                    July 1991
  10475.  
  10476.  
  10477. F.4 Backward-compatibility provisions
  10478.  
  10479. Additional functionality will probably be added to OSPF in the future.
  10480. One example of this is a multicast routing capability, which is
  10481. currently under development.  In order to be able to add such features
  10482. in a backward-compatible manner, the following provisions have been made
  10483. in the OSPF specification.
  10484.  
  10485. New capabilities will probably involve the introduction of new link
  10486. state advertisements.  If a router receives a link state advertisement
  10487. of unknown type during the flooding procedure, the advertisement is
  10488. simply ignored (Section 13.  The router should not attempt to further
  10489. flood the advertisement, nor acknowledge it.  The advertisement should
  10490. not be installed into the link state database.  If the router receives
  10491. an advertisement of unknown type during the Database Description
  10492. process, this is an error (see Sections 10.6 and 10.3).  The Database
  10493. Description process is then restarted.
  10494.  
  10495. There is also an Options field in both the Hello packets, Database
  10496. Description packets and the link state advertisement headers.
  10497. Unrecognized capabilities found in these places should be ignored, and
  10498. should not affect the normal processing of protocol packets/link state
  10499. advertisements (see Sections 10.5 and 10.6).  Routers will originate
  10500. their Hello packets, Database Description packets and link state
  10501. advertisements with unrecognized capabilities set to 0 (see Sections
  10502. 9.5, 10.8 and 12.1.2).
  10503.  
  10504.  
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.  
  10512.  
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.  
  10526.  
  10527.  
  10528. [Moy]                                                         [Page 188]
  10529.  
  10530. RFC 1247                     OSPF Version 2                    July 1991
  10531.  
  10532.  
  10533. Security Considerations
  10534.  
  10535. All OSPF protocol exchanges are authenticated. This is accomplished
  10536. through authentication fields contained in the OSPF packet header. For
  10537. more information, see Sections 8.1, 8.2, and Appendix E.
  10538.  
  10539.  
  10540. Author's Address
  10541.  
  10542. John Moy
  10543. Proteon, Inc.
  10544. 2 Technology Drive
  10545. Westborough, MA 01581
  10546.  
  10547. Phone: (508) 898-2800
  10548. EMail: jmoy@proteon.com
  10549.  
  10550.  
  10551.  
  10552.  
  10553.  
  10554.  
  10555.  
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.  
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.  
  10568.  
  10569.  
  10570.  
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584. [Moy]                                                         [Page 189]
  10585.  
  10586.