home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / rfc / 3 / rfc2328.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  436.9 KB  |  12,203 lines

  1.  
  2.  
  3.  
  4.  
  5. Network    Working    Group                          J. Moy
  6. Request    for Comments: 2328             Ascend Communications, Inc.
  7. STD: 54                                  April 1998
  8. Obsoletes: 2178
  9. Category: Standards Track
  10.  
  11.  
  12.                  OSPF Version 2
  13.  
  14.  
  15. Status of this Memo
  16.  
  17.     This document specifies an Internet    standards track    protocol for the
  18.     Internet community,    and requests discussion    and suggestions    for
  19.     improvements.  Please refer    to the current edition of the "Internet
  20.     Official Protocol Standards" (STD 1) for the standardization state
  21.     and    status of this protocol.  Distribution of this memo is
  22.     unlimited.
  23.  
  24. Copyright Notice
  25.  
  26.     Copyright (C) The Internet Society (1998).    All Rights Reserved.
  27.  
  28. Abstract
  29.  
  30.     This memo documents    version    2 of the OSPF protocol.     OSPF is a
  31.     link-state routing protocol.  It is    designed to be run internal to a
  32.     single Autonomous System.  Each OSPF router    maintains an identical
  33.     database describing    the Autonomous System's    topology.  From    this
  34.     database, a    routing    table is calculated by constructing a shortest-
  35.     path tree.
  36.  
  37.     OSPF recalculates routes quickly in    the face of topological    changes,
  38.     utilizing a    minimum    of routing protocol traffic.  OSPF provides
  39.     support for    equal-cost multipath.  An area routing capability is
  40.     provided, enabling an additional level of routing protection and a
  41.     reduction in routing protocol traffic.  In addition, all OSPF
  42.     routing protocol exchanges are authenticated.
  43.  
  44.     The    differences between this memo and RFC 2178 are explained in
  45.     Appendix G.    All differences    are backward-compatible    in nature.
  46.  
  47.  
  48.  
  49.  
  50. Moy                Standards Track            [Page 1]
  51.  
  52. RFC 2328             OSPF Version 2              April 1998
  53.  
  54.  
  55.     Implementations of this memo and of    RFCs 2178, 1583, and 1247 will
  56.     interoperate.
  57.  
  58.     Please send    comments to ospf@gated.cornell.edu.
  59.  
  60. Table of Contents
  61.  
  62.     1         Introduction ........................................... 6
  63.     1.1         Protocol Overview ...................................... 6
  64.     1.2         Definitions of commonly used terms    ..................... 8
  65.     1.3         Brief history of link-state routing technology ........ 11
  66.     1.4         Organization of this document ......................... 12
  67.     1.5         Acknowledgments ....................................... 12
  68.     2         The link-state database: organization and calculations  13
  69.     2.1         Representation of routers and networks ................ 13
  70.     2.1.1    Representation of non-broadcast networks .............. 15
  71.     2.1.2    An    example    link-state database ........................ 18
  72.     2.2         The shortest-path tree ................................ 21
  73.     2.3         Use of external routing information ................... 23
  74.     2.4         Equal-cost    multipath .................................. 26
  75.     3         Splitting the AS into Areas ........................... 26
  76.     3.1         The backbone of the Autonomous System ................. 27
  77.     3.2         Inter-area    routing    .................................... 27
  78.     3.3         Classification of routers ............................. 28
  79.     3.4         A sample area configuration ........................... 29
  80.     3.5         IP    subnetting support ................................. 35
  81.     3.6         Supporting    stub areas ................................. 37
  82.     3.7         Partitions    of areas ................................... 38
  83.     4         Functional    Summary    .................................... 40
  84.     4.1         Inter-area    routing    .................................... 41
  85.     4.2         AS    external routes    .................................... 41
  86.     4.3         Routing protocol packets .............................. 42
  87.     4.4         Basic implementation requirements ..................... 43
  88.     4.5         Optional OSPF capabilities    ............................ 46
  89.     5         Protocol data structures .............................. 47
  90.     6         The Area Data Structure ............................... 49
  91.     7         Bringing Up Adjacencies ............................... 52
  92.     7.1         The Hello Protocol    .................................... 52
  93.     7.2         The Synchronization of Databases ...................... 53
  94.     7.3         The Designated Router ................................. 54
  95.     7.4         The Backup    Designated Router .......................... 56
  96.     7.5         The graph of adjacencies .............................. 56
  97.  
  98.  
  99.  
  100. Moy                Standards Track            [Page 2]
  101.  
  102. RFC 2328             OSPF Version 2              April 1998
  103.  
  104.  
  105.     8         Protocol Packet Processing    ............................ 58
  106.     8.1         Sending protocol packets .............................. 58
  107.     8.2         Receiving protocol    packets    ............................ 61
  108.     9         The Interface Data    Structure .......................... 63
  109.     9.1         Interface states ...................................... 67
  110.     9.2         Events causing interface state changes ................ 70
  111.     9.3         The Interface state machine ........................... 72
  112.     9.4         Electing the Designated Router ........................ 75
  113.     9.5         Sending Hello packets ................................. 77
  114.     9.5.1    Sending Hello packets on NBMA networks ................ 79
  115.     10         The Neighbor Data Structure ........................... 80
  116.     10.1     Neighbor states ....................................... 83
  117.     10.2     Events causing neighbor state changes ................. 87
  118.     10.3     The Neighbor state    machine    ............................ 89
  119.     10.4     Whether to    become adjacent    ............................ 95
  120.     10.5     Receiving Hello Packets ............................... 96
  121.     10.6     Receiving Database    Description Packets ................ 99
  122.     10.7     Receiving Link State Request Packets ................. 102
  123.     10.8     Sending Database Description Packets ................. 103
  124.     10.9     Sending Link State    Request    Packets    ................... 104
  125.     10.10    An    Example    ........................................... 105
  126.     11         The Routing Table Structure .......................... 107
  127.     11.1     Routing table lookup ................................. 111
  128.     11.2     Sample routing table, without areas .................. 111
  129.     11.3     Sample routing table, with    areas ..................... 112
  130.     12         Link State    Advertisements (LSAs) ..................... 115
  131.     12.1     The LSA Header ....................................... 116
  132.     12.1.1   LS    age ............................................... 116
  133.     12.1.2   Options .............................................. 117
  134.     12.1.3   LS    type .............................................. 117
  135.     12.1.4   Link State    ID ........................................ 117
  136.     12.1.5   Advertising Router    ................................... 119
  137.     12.1.6   LS    sequence number    ................................... 120
  138.     12.1.7   LS    checksum .......................................... 121
  139.     12.2     The link state database .............................. 121
  140.     12.3     Representation of TOS ................................ 122
  141.     12.4     Originating LSAs ..................................... 123
  142.     12.4.1   Router-LSAs .......................................... 126
  143.     12.4.1.1 Describing    point-to-point interfaces ................. 130
  144.     12.4.1.2 Describing    broadcast and NBMA interfaces ............. 130
  145.     12.4.1.3 Describing    virtual    links ............................. 131
  146.     12.4.1.4 Describing    Point-to-MultiPoint interfaces ............ 131
  147.  
  148.  
  149.  
  150. Moy                Standards Track            [Page 3]
  151.  
  152. RFC 2328             OSPF Version 2              April 1998
  153.  
  154.  
  155.     12.4.1.5 Examples of router-LSAs .............................. 132
  156.     12.4.2   Network-LSAs ......................................... 133
  157.     12.4.2.1 Examples of network-LSAs ............................. 134
  158.     12.4.3   Summary-LSAs ......................................... 135
  159.     12.4.3.1 Originating summary-LSAs into stub    areas ............. 137
  160.     12.4.3.2 Examples of summary-LSAs ............................. 138
  161.     12.4.4   AS-external-LSAs ..................................... 139
  162.     12.4.4.1 Examples of AS-external-LSAs ......................... 140
  163.     13         The Flooding Procedure ............................... 143
  164.     13.1     Determining which LSA is newer ....................... 146
  165.     13.2     Installing    LSAs in    the database ...................... 147
  166.     13.3     Next step in the flooding procedure .................. 148
  167.     13.4     Receiving self-originated LSAs ....................... 151
  168.     13.5     Sending Link State    Acknowledgment packets ............ 152
  169.     13.6     Retransmitting LSAs .................................. 154
  170.     13.7     Receiving link state acknowledgments ................. 155
  171.     14         Aging The Link State Database ........................ 156
  172.     14.1     Premature aging of    LSAs .............................. 157
  173.     15         Virtual Links ........................................ 158
  174.     16         Calculation of the    routing    table ..................... 160
  175.     16.1     Calculating the shortest-path tree    for an area ....... 161
  176.     16.1.1   The next hop calculation ............................. 167
  177.     16.2     Calculating the inter-area    routes .................... 178
  178.     16.3     Examining transit areas' summary-LSAs ................ 170
  179.     16.4     Calculating AS external routes ....................... 173
  180.     16.4.1   External path preferences ............................ 175
  181.     16.5     Incremental updates -- summary-LSAs .................. 175
  182.     16.6     Incremental updates -- AS-external-LSAs .............. 177
  183.     16.7     Events generated as a result of routing table changes  177
  184.     16.8     Equal-cost    multipath ................................. 178
  185.          Footnotes ............................................ 179
  186.          References    ........................................... 183
  187.     A         OSPF data formats .................................... 185
  188.     A.1         Encapsulation of OSPF packets ........................ 185
  189.     A.2         The Options field .................................... 187
  190.     A.3         OSPF Packet Formats .................................. 189
  191.     A.3.1    The OSPF packet header ............................... 190
  192.     A.3.2    The Hello packet ..................................... 193
  193.     A.3.3    The Database Description packet ...................... 195
  194.     A.3.4    The Link State Request packet ........................ 197
  195.     A.3.5    The Link State Update packet ......................... 199
  196.     A.3.6    The Link State Acknowledgment packet ................. 201
  197.  
  198.  
  199.  
  200. Moy                Standards Track            [Page 4]
  201.  
  202. RFC 2328             OSPF Version 2              April 1998
  203.  
  204.  
  205.     A.4         LSA formats .......................................... 203
  206.     A.4.1    The LSA header ....................................... 204
  207.     A.4.2    Router-LSAs .......................................... 206
  208.     A.4.3    Network-LSAs ......................................... 210
  209.     A.4.4    Summary-LSAs ......................................... 212
  210.     A.4.5    AS-external-LSAs ..................................... 214
  211.     B         Architectural Constants .............................. 217
  212.     C         Configurable Constants ............................... 219
  213.     C.1         Global parameters .................................... 219
  214.     C.2         Area parameters ...................................... 220
  215.     C.3         Router interface parameters .......................... 221
  216.     C.4         Virtual link parameters .............................. 224
  217.     C.5         NBMA network parameters .............................. 224
  218.     C.6         Point-to-MultiPoint network parameters ............... 225
  219.     C.7         Host route    parameters ................................ 226
  220.     D         Authentication ....................................... 227
  221.     D.1         Null authentication .................................. 227
  222.     D.2         Simple password authentication ....................... 228
  223.     D.3         Cryptographic authentication ......................... 228
  224.     D.4         Message generation    ................................... 231
  225.     D.4.1    Generating    Null authentication ....................... 231
  226.     D.4.2    Generating    Simple password    authentication ............ 232
  227.     D.4.3    Generating    Cryptographic authentication .............. 232
  228.     D.5         Message verification ................................. 234
  229.     D.5.1    Verifying Null authentication ........................ 234
  230.     D.5.2    Verifying Simple password authentication ............. 234
  231.     D.5.3    Verifying Cryptographic authentication ............... 235
  232.     E         An    algorithm for assigning    Link State IDs ............ 236
  233.     F         Multiple interfaces to the    same network/subnet ....... 239
  234.     G         Differences from RFC 2178 ............................ 240
  235.     G.1         Flooding modifications ............................... 240
  236.     G.2         Changes to    external path preferences ................. 241
  237.     G.3         Incomplete    resolution of virtual next hops    ........... 241
  238.     G.4         Routing table lookup ................................. 241
  239.          Security Considerations .............................. 243
  240.          Author's Address ..................................... 243
  241.          Full Copyright Statement ............................. 244
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250. Moy                Standards Track            [Page 5]
  251.  
  252. RFC 2328             OSPF Version 2              April 1998
  253.  
  254.  
  255. 1.  Introduction
  256.  
  257.     This document is a specification of    the Open Shortest Path First
  258.     (OSPF) TCP/IP internet routing protocol.  OSPF is classified as an
  259.     Interior Gateway Protocol (IGP).  This means that it distributes
  260.     routing information    between    routers    belonging to a single Autonomous
  261.     System.  The OSPF protocol is based    on link-state or SPF technology.
  262.     This is a dep 6
  263.     1.1         Protoan-Ford base used    by traditional
  264.     TCP/IP internet routing protocols.
  265.  
  266.     The    OSPF protocol was developed by the OSPF    working    group of the
  267.     Internet Engineering Task Force.  It has been designed expressly for
  268.     the    TCP/IP internet    environment, including explicit    support    for CIDR
  269.     and    the tagging of externally-derived routing information.    OSPF
  270.     also provides for the authentication of routing updates, and
  271.     utilizes IP    multicast when sending/receiving the updates.  In
  272.     addition, much work    has been done to produce a protocol that
  273.     responds quickly to    topology changes, yet involves small amounts of
  274.     routing protocol traffic.
  275.  
  276.     1.1.  Protocol overview
  277.  
  278.     OSPF routes IP packets based solely on the destination IP
  279.     address    found in the IP    packet header.    IP packets are routed
  280.     "as is"    -- they    are not    encapsulated in    any further protocol
  281.     headers    as they    transit    the Autonomous System.    OSPF is    a
  282.     dynamic    routing    protocol.  It quickly detects topological
  283.     changes    in the AS (such    as router interface failures) and
  284.     calculates new loop-free routes    after a    period of convergence.
  285.     This period of convergence is short and    involves a minimum of
  286.     routing    traffic.
  287.  
  288.     In a link-state    routing    protocol, each router maintains    a
  289.     database describing the    Autonomous System's topology.  This
  290.     database is referred to    as the link-state database. Each
  291.     participating router has an identical database.     Each individual
  292.     piece of this database is a particular router's    local state
  293.     (e.g., the router's usable interfaces and reachable neighbors).
  294.     The router distributes its local state throughout the Autonomous
  295.     System by flooding.
  296.  
  297.  
  298.  
  299.  
  300.  
  301. Moy                Standards Track            [Page 6]
  302.  
  303. RFC 2328             OSPF Version 2              April 1998
  304.  
  305.  
  306.     All routers run    the exact same algorithm, in parallel.    From the
  307.     link-state database, each router constructs a tree of shortest
  308.     paths with itself as root.  This shortest-path tree gives the
  309.     route to each destination in the Autonomous System.  Externally
  310.     derived    routing    information appears on the tree    as leaves.
  311.  
  312.     When several equal-cost    routes to a destination    exist, traffic
  313.     is distributed equally among them.  The    cost of    a route    is
  314.     described by a single dimensionless metric.
  315.  
  316.     OSPF allows sets of networks to    be grouped together.  Such a
  317.     grouping is called an area.  The topology of an    area is    hidden
  318.     from the rest of the Autonomous    System.     This information hiding
  319.     enables    a significant reduction    in routing traffic.  Also,
  320.     routing    within the area    is determined only by the area's own
  321.     topology, lending the area protection from bad routing data.  An
  322.     area is    a generalization of an IP subnetted network.
  323.  
  324.     OSPF enables the flexible configuration    of IP subnets.    Each
  325.     route distributed by OSPF has a    destination and    mask.  Two
  326.     different subnets of the same IP network number    may have
  327.     different sizes    (i.e., different masks).  This is commonly
  328.     referred to as variable    length subnetting.  A packet is    routed
  329.     to the best (i.e., longest or most specific) match.  Host routes
  330.     are considered to be subnets whose masks are "all ones"
  331.     (0xffffffff).
  332.  
  333.     All OSPF protocol exchanges are    authenticated.    This means that
  334.     only trusted routers can participate in    the Autonomous System's
  335.     routing.  A variety of authentication schemes can be used; in
  336.     fact, separate authentication schemes can be configured    for each
  337.     IP subnet.
  338.  
  339.     Externally derived routing data    (e.g., routes learned from an
  340.     Exterior Gateway Protocol such as BGP; see [Ref23]) is
  341.     advertised throughout the Autonomous System.  This externally
  342.     derived    data is    kept separate from the OSPF protocol's link
  343.     state data.  Each external route can also be tagged by the
  344.     advertising router, enabling the passing of additional
  345.     information between routers on the boundary of the Autonomous
  346.     System.
  347.  
  348.  
  349.  
  350.  
  351. Moy                Standards Track            [Page 7]
  352.  
  353. RFC 2328             OSPF Version 2              April 1998
  354.  
  355.  
  356.     1.2.  Definitions of commonly used terms
  357.  
  358.     This section provides definitions for terms that have a    specific
  359.     meaning    to the OSPF protocol and that are used throughout the
  360.     text.  The reader unfamiliar with the Internet Protocol    Suite is
  361.     referred to [Ref13] for    an introduction    to IP.
  362.  
  363.  
  364.     Router
  365.         A level three Internet Protocol packet switch.  Formerly
  366.         called a gateway in    much of    the IP literature.
  367.  
  368.     Autonomous System
  369.         A group of routers exchanging routing information via a
  370.         common routing protocol.  Abbreviated as AS.
  371.  
  372.     Interior Gateway Protocol
  373.         The    routing    protocol spoken    by the routers belonging to an
  374.         Autonomous system.    Abbreviated as IGP.  Each Autonomous
  375.         System has a single    IGP.  Separate Autonomous Systems may be
  376.         running different IGPs.
  377.  
  378.     Router ID
  379.         A 32-bit number assigned to    each router running the    OSPF
  380.         protocol.  This number uniquely identifies the router within
  381.         an Autonomous System.
  382.  
  383.     Network
  384.         In this memo, an IP    network/subnet/supernet.  It is    possible
  385.         for    one physical network to    be assigned multiple IP
  386.         network/subnet numbers.  We    consider these to be separate
  387.         networks.  Point-to-point physical networks    are an exception
  388.         - they are considered a single network no matter how many
  389.         (if    any at all) IP network/subnet numbers are assigned to
  390.         them.
  391.  
  392.     Network    mask
  393.         A 32-bit number indicating the range of IP addresses
  394.         residing on    a single IP network/subnet/supernet.  This
  395.         specification displays network masks as hexadecimal    numbers.
  396.  
  397.  
  398.  
  399.  
  400.  
  401. Moy                Standards Track            [Page 8]
  402.  
  403. RFC 2328             OSPF Version 2              April 1998
  404.  
  405.  
  406.         For    example, the network mask for a    class C    IP network is
  407.         displayed as 0xffffff00.  Such a mask is often displayed
  408.         elsewhere in the literature    as 255.255.255.0.
  409.  
  410.     Point-to-point networks
  411.         A network that joins a single pair of routers.  A 56Kb
  412.         serial line    is an example of a point-to-point network.
  413.  
  414.     Broadcast networks
  415.         Networks supporting    many (more than    two) attached routers,
  416.         together with the capability to address a single physical
  417.         message to all of the attached routers (broadcast).
  418.         Neighboring    routers    are discovered dynamically on these nets
  419.         using OSPF's Hello Protocol.  The Hello Protocol itself
  420.         takes advantage of the broadcast capability.  The OSPF
  421.         protocol makes further use of multicast capabilities, if
  422.         they exist.     Each pair of routers on a broadcast network is
  423.         assumed to be able to communicate directly.    An ethernet is
  424.         an example of a broadcast network.
  425.  
  426.     Non-broadcast networks
  427.         Networks supporting    many (more than    two) routers, but having
  428.         no broadcast capability.  Neighboring routers are maintained
  429.         on these nets using    OSPF's Hello Protocol.    However, due to
  430.         the    lack of    broadcast capability, some configuration
  431.         information    may be necessary to aid    in the discovery of
  432.         neighbors.    On non-broadcast networks, OSPF    protocol packets
  433.         that are normally multicast    need to    be sent    to each
  434.         neighboring    router,    in turn. An X.25 Public    Data Network
  435.         (PDN) is an    example    of a non-broadcast network.
  436.  
  437.         OSPF runs in one of    two modes over non-broadcast networks.
  438.         The    first mode, called non-broadcast multi-access or NBMA,
  439.         simulates the operation of OSPF on a broadcast network. The
  440.         second mode, called    Point-to-MultiPoint, treats the    non-
  441.         broadcast network as a collection of point-to-point    links.
  442.         Non-broadcast networks are referred    to as NBMA networks or
  443.         Point-to-MultiPoint    networks, depending on OSPF's mode of
  444.         operation over the network.
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451. Moy                Standards Track            [Page 9]
  452.  
  453. RFC 2328             OSPF Version 2              April 1998
  454.  
  455.  
  456.     Interface
  457.         The    connection between a router and    one of its attached
  458.         networks.  An interface has    state information associated
  459.         with it, which is obtained from the    underlying lower level
  460.         protocols and the routing protocol itself.    An interface to
  461.         a network has associated with it a single IP address and
  462.         mask (unless the network is    an unnumbered point-to-point
  463.         network).  An interface is sometimes also referred to as a
  464.         link.
  465.  
  466.     Neighboring routers
  467.         Two    routers    that have interfaces to    a common network.
  468.         Neighbor relationships are maintained by, and usually
  469.         dynamically    discovered by, OSPF's Hello Protocol.
  470.  
  471.     Adjacency
  472.         A relationship formed between selected neighboring routers
  473.         for    the purpose of exchanging routing information.    Not
  474.         every pair of neighboring routers become adjacent.
  475.  
  476.     Link state advertisement
  477.         Unit of data describing the    local state of a router    or
  478.         network. For a router, this    includes the state of the
  479.         router's interfaces    and adjacencies.  Each link state
  480.         advertisement is flooded throughout    the routing domain. The
  481.         collected link state advertisements    of all routers and
  482.         networks forms the protocol's link state database.
  483.         Throughout this memo, link state advertisement is
  484.         abbreviated    as LSA.
  485.  
  486.     Hello Protocol
  487.         The    part of    the OSPF protocol used to establish and    maintain
  488.         neighbor relationships.  On    broadcast networks the Hello
  489.         Protocol can also dynamically discover neighboring routers.
  490.  
  491.     Flooding
  492.         The    part of    the OSPF protocol that distributes and
  493.         synchronizes the link-state    database between OSPF routers.
  494.  
  495.     Designated Router
  496.         Each broadcast and NBMA network that has at    least two
  497.         attached routers has a Designated Router.  The Designated
  498.  
  499.  
  500.  
  501. Moy                Standards Track               [Page 10]
  502.  
  503. RFC 2328             OSPF Version 2              April 1998
  504.  
  505.  
  506.         Router generates an    LSA for    the network and    has other
  507.         special responsibilities in    the running of the protocol.
  508.         The    Designated Router is elected by    the Hello Protocol.
  509.  
  510.         The    Designated Router concept enables a reduction in the
  511.         number of adjacencies required on a    broadcast or NBMA
  512.         network.  This in turn reduces the amount of routing
  513.         protocol traffic and the size of the link-state database.
  514.  
  515.     Lower-level protocols
  516.         The    underlying network access protocols that provide
  517.         services to    the Internet Protocol and in turn the OSPF
  518.         protocol.  Examples    of these are the X.25 packet and frame
  519.         levels for X.25 PDNs, and the ethernet data    link layer for
  520.         ethernets.
  521.  
  522.  
  523.     1.3.  Brief    history    of link-state routing technology
  524.  
  525.     OSPF is    a link state routing protocol.    Such protocols are also
  526.     referred to in the literature as SPF-based or distributed-
  527.     database protocols.  This section gives    a brief    description of
  528.     the developments in link-state technology that have influenced
  529.     the OSPF protocol.
  530.  
  531.     The first link-state routing protocol was developed for    use in
  532.     the ARPANET packet switching network.  This protocol is
  533.     described in [Ref3].  It has formed the    starting point for all
  534.     other link-state protocols.  The homogeneous ARPANET
  535.     environment, i.e., single-vendor packet    switches connected by
  536.     synchronous serial lines, simplified the design    and
  537.     implementation of the original protocol.
  538.  
  539.     Modifications to this protocol were proposed in    [Ref4].     These
  540.     modifications dealt with increasing the    fault tolerance    of the
  541.     routing    protocol through, among    other things, adding a checksum
  542.     to the LSAs (thereby detecting database    corruption).  The paper
  543.     also included means for    reducing the routing traffic overhead in
  544.     a link-state protocol.    This was accomplished by introducing
  545.     mechanisms which enabled the interval between LSA originations
  546.     to be increased    by an order of magnitude.
  547.  
  548.  
  549.  
  550.  
  551. Moy                Standards Track               [Page 11]
  552.  
  553. RFC 2328             OSPF Version 2              April 1998
  554.  
  555.  
  556.     A link-state algorithm has also    been proposed for use as an ISO
  557.     IS-IS routing protocol.     This protocol is described in [Ref2].
  558.     The protocol includes methods for data and routing traffic
  559.     reduction when operating over broadcast    networks.  This    is
  560.     accomplished by    election of a Designated Router    for each
  561.     broadcast network, which then originates an LSA    for the    network.
  562.  
  563.     The OSPF Working Group of the IETF has extended    this work in
  564.     developing the OSPF protocol.  The Designated Router concept has
  565.     been greatly enhanced to further reduce    the amount of routing
  566.     traffic    required.  Multicast capabilities are utilized for
  567.     additional routing bandwidth reduction.     An area routing scheme
  568.     has been developed enabling information
  569.     hiding/protection/reduction.  Finally, the algorithms have been
  570.     tailored for efficient operation in TCP/IP internets.
  571.  
  572.  
  573.     1.4.  Organization of this document
  574.  
  575.     The first three    sections of this specification give a general
  576.     overview of the    protocol's capabilities    and functions.    Sections
  577.     4-16 explain the protocol's mechanisms in detail.  Packet
  578.     formats, protocol constants and    configuration items are
  579.     specified in the appendices.
  580.  
  581.     Labels such as HelloInterval encountered in the    text refer to
  582.     protocol constants.  They may or may not be configurable.
  583.     Architectural constants    are summarized in Appendix B.
  584.     Configurable constants are summarized in Appendix C.
  585.  
  586.     The detailed specification of the protocol is presented    in terms
  587.     of data    structures.  This is done in order to make the
  588.     explanation more precise.  Implementations of the protocol are
  589.     required to support the    functionality described, but need not
  590.     use the    precise    data structures    that appear in this memo.
  591.  
  592.  
  593.     1.5.  Acknowledgments
  594.  
  595.     The author would like to thank Ran Atkinson, Fred Baker, Jeffrey
  596.     Burgan,    Rob Coltun, Dino Farinacci, Vince Fuller, Phanindra
  597.     Jujjavarapu, Milo Medin, Tom Pusateri, Kannan Varadhan,    Zhaohui
  598.  
  599.  
  600.  
  601. Moy                Standards Track               [Page 12]
  602.  
  603. RFC 2328             OSPF Version 2              April 1998
  604.  
  605.  
  606.     Zhang and the rest of the OSPF Working Group for the ideas and
  607.     support    they have given    to this    project.
  608.  
  609.     The OSPF Point-to-MultiPoint interface is based    on work    done by
  610.     Fred Baker.
  611.  
  612.     The OSPF Cryptographic Authentication option was developed by
  613.     Fred Baker and Ran Atkinson.
  614.  
  615.  
  616. 2.  The    Link-state Database: organization and calculations
  617.  
  618.     The    following subsections describe the organization    of OSPF's link-
  619.     state database, and    the routing calculations that are performed on
  620.     the    database in order to produce a router's    routing    table.
  621.  
  622.  
  623.     2.1.  Representation of routers and    networks
  624.  
  625.     The Autonomous System's    link-state database describes a    directed
  626.     graph.    The vertices of    the graph consist of routers and
  627.     networks.  A graph edge    connects two routers when they are
  628.     attached via a physical    point-to-point network.     An edge
  629.     connecting a router to a network indicates that    the router has
  630.     an interface on    the network. Networks can be either transit or
  631.     stub networks. Transit networks    are those capable of carrying
  632.     data traffic that is neither locally originated    nor locally
  633.     destined. A transit network is represented by a    graph vertex
  634.     having both incoming and outgoing edges. A stub    network's vertex
  635.     has only incoming edges.
  636.  
  637.     The neighborhood of each network node in the graph depends on
  638.     the network's type (point-to-point, broadcast, NBMA or Point-
  639.     to-MultiPoint) and the number of routers having    an interface to
  640.     the network.  Three cases are depicted in Figure 1a.  Rectangles
  641.     indicate routers.  Circles and oblongs indicate    networks.
  642.     Router names are prefixed with the letters RT and network names
  643.     with the letter    N.  Router interface names are prefixed    by the
  644.     letter I.  Lines between routers indicate point-to-point
  645.     networks.  The left side of the    figure shows networks with their
  646.     connected routers, with    the resulting graphs shown on the right.
  647.  
  648.  
  649.  
  650.  
  651. Moy                Standards Track               [Page 13]
  652.  
  653. RFC 2328             OSPF Version 2              April 1998
  654.  
  655.  
  656.  
  657.  
  658.  
  659.                           **FROM**
  660.  
  661.                        *      |RT1|RT2|
  662.         +---+Ia       +---+       *   ------------
  663.         |RT1|------|RT2|       T   RT1|   |    X |
  664.         +---+     Ib+---+       O   RT2| X |      |
  665.                        *    Ia|   |    X |
  666.                        *    Ib| X |      |
  667.  
  668.              Physical point-to-point networks
  669.  
  670.  
  671.                           **FROM**
  672.               +---+           *
  673.               |RT7|           *      |RT7|    N3|
  674.               +---+           T   ------------
  675.             |           O   RT7|   |      |
  676.         +----------------------+       *    N3| X |      |
  677.                N3           *
  678.  
  679.                   Stub networks
  680.  
  681.                           **FROM**
  682.         +---+       +---+
  683.         |RT3|       |RT4|          |RT3|RT4|RT5|RT6|N2 |
  684.         +---+       +---+    *  ------------------------
  685.           |    N2    |        *  RT3|      |   |      |   |    X |
  686.         +----------------------+    T  RT4|      |   |      |   |    X |
  687.           |         |        O  RT5|      |   |      |   |    X |
  688.         +---+       +---+    *  RT6|      |   |      |   |    X |
  689.         |RT5|       |RT6|    *   N2|    X | X |    X | X |      |
  690.         +---+       +---+
  691.  
  692.               Broadcast or NBMA networks
  693.  
  694.  
  695.  
  696.             Figure 1a: Network map components
  697.  
  698.  
  699.  
  700.  
  701. Moy                Standards Track               [Page 14]
  702.  
  703. RFC 2328             OSPF Version 2              April 1998
  704.  
  705.  
  706.          Networks and routers are represented by vertices.
  707.          An    edge connects Vertex A to Vertex B iff the
  708.          intersection of Column A and Row B    is marked with
  709.                   an X.
  710.  
  711.  
  712.  
  713.     The top    of Figure 1a shows two routers connected by a point-to-
  714.     point link. In the resulting link-state    database graph,    the two
  715.     router vertices    are directly connected by a pair of edges, one
  716.     in each    direction. Interfaces to point-to-point    networks need
  717.     not be assigned    IP addresses.  When interface addresses    are
  718.     assigned, they are modelled as stub links, with    each router
  719.     advertising a stub connection to the other router's interface
  720.     address. Optionally, an    IP subnet can be assigned to the point-
  721.     to-point network. In this case,    both routers advertise a stub
  722.     link to    the IP subnet, instead of advertising each others' IP
  723.     interface addresses.
  724.  
  725.     The middle of Figure 1a    shows a    network    with only one attached
  726.     router (i.e., a    stub network). In this case, the network appears
  727.     on the end of a    stub connection    in the link-state database's
  728.     graph.
  729.  
  730.     When multiple routers are attached to a    broadcast network, the
  731.     link-state database graph shows    all routers bidirectionally
  732.     connected to the network vertex. This is pictured at the bottom
  733.     of Figure 1a.
  734.  
  735.     Each network (stub or transit) in the graph has    an IP address
  736.     and associated network mask.  The mask indicates the number of
  737.     nodes on the network.  Hosts attached directly to routers
  738.     (referred to as    host routes) appear on the graph as stub
  739.     networks.  The network mask for    a host route is    always
  740.     0xffffffff, which indicates the    presence of a single node.
  741.  
  742.  
  743.     2.1.1.    Representation of non-broadcast    networks
  744.  
  745.         As mentioned previously, OSPF can run over non-broadcast
  746.         networks in    one of two modes: NBMA or Point-to-MultiPoint.
  747.         The    choice of mode determines the way that the Hello
  748.  
  749.  
  750.  
  751. Moy                Standards Track               [Page 15]
  752.  
  753. RFC 2328             OSPF Version 2              April 1998
  754.  
  755.  
  756.         protocol and flooding work over the    non-broadcast network,
  757.         and    the way    that the network is represented    in the link-
  758.         state database.
  759.  
  760.         In NBMA mode, OSPF emulates    operation over a broadcast
  761.         network: a Designated Router is elected for    the NBMA
  762.         network, and the Designated    Router originates an LSA for the
  763.         network. The graph representation for broadcast networks and
  764.         NBMA networks is identical.    This representation is pictured
  765.         in the middle of Figure 1a.
  766.  
  767.         NBMA mode is the most efficient way    to run OSPF over non-
  768.         broadcast networks,    both in    terms of link-state database
  769.         size and in    terms of the amount of routing protocol    traffic.
  770.         However, it    has one    significant restriction: it requires all
  771.         routers attached to    the NBMA network to be able to
  772.         communicate    directly. This restriction may be met on some
  773.         non-broadcast networks, such as an ATM subnet utilizing
  774.         SVCs. But it is often not met on other non-broadcast
  775.         networks, such as PVC-only Frame Relay networks. On    non-
  776.         broadcast networks where not all routers can communicate
  777.         directly you can break the non-broadcast network into
  778.         logical subnets, with the routers on each subnet being able
  779.         to communicate directly, and then run each separate    subnet
  780.         as an NBMA network (see [Ref15]). This however requires
  781.         quite a bit    of administrative overhead, and    is prone to
  782.         misconfiguration. It is probably better to run such    a non-
  783.         broadcast network in Point-to-Multipoint mode.
  784.  
  785.         In Point-to-MultiPoint mode, OSPF treats all router-to-
  786.         router connections over the    non-broadcast network as if they
  787.         were point-to-point    links. No Designated Router is elected
  788.         for    the network, nor is there an LSA generated for the
  789.         network. In    fact, a    vertex for the Point-to-MultiPoint
  790.         network does not appear in the graph of the    link-state
  791.         database.
  792.  
  793.         Figure 1b illustrates the link-state database representation
  794.         of a Point-to-MultiPoint network. On the left side of the
  795.         figure, a Point-to-MultiPoint network is pictured. It is
  796.         assumed that all routers can communicate directly, except
  797.         for    routers    RT4 and    RT5. I3    though I6 indicate the routers'
  798.  
  799.  
  800.  
  801. Moy                Standards Track               [Page 16]
  802.  
  803. RFC 2328             OSPF Version 2              April 1998
  804.  
  805.  
  806.         IP interface addresses on the Point-to-MultiPoint network.
  807.         In the graphical representation of the link-state database,
  808.         routers that can communicate directly over the Point-to-
  809.         MultiPoint network are joined by bidirectional edges, and
  810.         each router    also has a stub    connection to its own IP
  811.         interface address (which is    in contrast to the
  812.         representation of real point-to-point links; see Figure 1a).
  813.  
  814.         On some non-broadcast networks, use    of Point-to-MultiPoint
  815.         mode and data-link protocols such as Inverse ARP (see
  816.         [Ref14]) will allow    autodiscovery of OSPF neighbors    even
  817.         though broadcast support is    not available.
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.                           **FROM**
  825.         +---+       +---+
  826.         |RT3|       |RT4|          |RT3|RT4|RT5|RT6|
  827.         +---+       +---+    *  --------------------
  828.         I3|    N2    |I4    *  RT3|      | X |    X | X |
  829.         +----------------------+    T  RT4|    X |   |      | X |
  830.         I5|         |I6    O  RT5|    X |   |      | X |
  831.         +---+       +---+    *  RT6|    X | X |    X |   |
  832.         |RT5|       |RT6|    *   I3|    X |   |      |   |
  833.         +---+       +---+        I4|      | X |      |   |
  834.                         I5|      |   |    X |   |
  835.                         I6|      |   |      | X |
  836.  
  837.  
  838.  
  839.             Figure 1b: Network map components
  840.                Point-to-MultiPoint networks
  841.  
  842.          All routers can communicate directly over N2, except
  843.         routers    RT4 and    RT5. I3    through    I6 indicate IP
  844.                interface addresses
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851. Moy                Standards Track               [Page 17]
  852.  
  853. RFC 2328             OSPF Version 2              April 1998
  854.  
  855.  
  856.     2.1.2.    An example link-state database
  857.  
  858.         Figure 2 shows a sample map    of an Autonomous System.  The
  859.         rectangle labelled H1 indicates a host, which has a    SLIP
  860.         connection to Router RT12.    Router RT12 is therefore
  861.         advertising    a host route.  Lines between routers indicate
  862.         physical point-to-point networks.  The only    point-to-point
  863.         network that has been assigned interface addresses is the
  864.         one    joining    Routers    RT6 and    RT10.  Routers RT5 and RT7 have
  865.         BGP    connections to other Autonomous    Systems.  A set    of BGP-
  866.         learned routes have    been displayed for both    of these
  867.         routers.
  868.  
  869.         A cost is associated with the output side of each router
  870.         interface.    This cost is configurable by the system
  871.         administrator.  The    lower the cost,    the more likely    the
  872.         interface is to be used to forward data traffic.  Costs are
  873.         also associated with the externally    derived    routing    data
  874.         (e.g., the BGP-learned routes).
  875.  
  876.         The    directed graph resulting from the map in Figure    2 is
  877.         depicted in    Figure 3.  Arcs    are labelled with the cost of
  878.         the    corresponding router output interface.    Arcs having no
  879.         labelled cost have a cost of 0.  Note that arcs leading from
  880.         networks to    routers    always have cost 0; they are significant
  881.         nonetheless.  Note also that the externally    derived    routing
  882.         data appears on the    graph as stubs.
  883.  
  884.         The    link-state database is pieced together from LSAs
  885.         generated by the routers.  In the associated graphical
  886.         representation, the    neighborhood of    each router or transit
  887.         network is represented in a    single,    separate LSA.  Figure 4
  888.         shows these    LSAs graphically. Router RT12 has an interface
  889.         to two broadcast networks and a SLIP line to a host.
  890.         Network N6 is a broadcast network with three attached
  891.         routers.  The cost of all links from Network N6 to its
  892.         attached routers is    0.  Note that the LSA for Network N6 is
  893.         actually generated by one of the network's attached    routers:
  894.         the    router that has    been elected Designated    Router for the
  895.         network.
  896.  
  897.  
  898.  
  899.  
  900.  
  901. Moy                Standards Track               [Page 18]
  902.  
  903. RFC 2328             OSPF Version 2              April 1998
  904.  
  905.  
  906.  
  907.          +
  908.          | 3+---+              N12      N14
  909.            N1|--|RT1|\ 1            \ N13 /
  910.          |  +---+ \            8\ |8/8
  911.          +       \ ____          \|/
  912.                 /     \   1+---+8    8+---+6
  913.                *  N3  *---|RT4|------|RT5|--------+
  914.                 \____/    +---+     +---+          |
  915.           +        /    |           |7          |
  916.           | 3+---+ /    |           |          |
  917.         N2|--|RT2|/1    |1           |6          |
  918.           |  +---+    +---+8        6+---+          |
  919.           +          |RT3|--------------|RT6|          |
  920.                   +---+         +---+          |
  921.                 |2         Ia|7          |
  922.                 |           |          |
  923.                +---------+           |          |
  924.                    N4           |          |
  925.                            |          |
  926.                            |          |
  927.                N11               |          |
  928.            +---------+               |          |
  929.             |               |          |       N12
  930.             |3               |          |6 2/
  931.               +---+               |        +---+/
  932.               |RT9|               |        |RT7|---N15
  933.               +---+               |        +---+ 9
  934.             |1             +       |          |1
  935.                _|__             |     Ib|5        __|_
  936.               /       \      1+----+2   |    3+----+1   /    \
  937.              *    N9  *------|RT11|----|---|RT10|---*  N6     *
  938.               \____/       +----+    |     +----+       \____/
  939.             |             |              |
  940.             |1             +              |1
  941.          +--+   10+----+            N8            +---+
  942.          |H1|-----|RT12|                    |RT8|
  943.          +--+SLIP +----+                    +---+
  944.             |2                      |4
  945.             |                      |
  946.            +---------+                  +--------+
  947.                N10                      N7
  948.  
  949.  
  950.  
  951. Moy                Standards Track               [Page 19]
  952.  
  953. RFC 2328             OSPF Version 2              April 1998
  954.  
  955.  
  956.             Figure 2: A    sample Autonomous System
  957.  
  958.                 **FROM**
  959.  
  960.          |RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
  961.          |1 |2 |3 |4 |5    |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9|
  962.           ----- ---------------------------------------------
  963.           RT1|  |  |  |  |    |  |  |     |  |  |  |  |0    |  |  |     |
  964.           RT2|  |  |  |  |    |  |  |     |  |  |  |  |0    |  |  |     |
  965.           RT3|  |  |  |  |    |6 |  |     |  |  |  |  |0    |  |  |     |
  966.           RT4|  |  |  |  |8    |  |  |     |  |  |  |  |0    |  |  |     |
  967.           RT5|  |  |  |8 |    |6 |6 |     |  |  |  |  |    |  |  |     |
  968.           RT6|  |  |8 |  |7    |  |  |     |  |5 |  |  |    |  |  |     |
  969.           RT7|  |  |  |  |6    |  |  |     |  |  |  |  |    |0 |  |     |
  970.       *   RT8|  |  |  |  |    |  |  |     |  |  |  |  |    |0 |  |     |
  971.       *   RT9|  |  |  |  |    |  |  |     |  |  |  |  |    |  |  |0 |
  972.       T  RT10|  |  |  |  |    |7 |  |     |  |  |  |  |    |0 |0 |     |
  973.       O  RT11|  |  |  |  |    |  |  |     |  |  |  |  |    |  |0 |0 |
  974.       *  RT12|  |  |  |  |    |  |  |     |  |  |  |  |    |  |  |0 |
  975.       *    N1|3 |  |  |  |    |  |  |     |  |  |  |  |    |  |  |     |
  976.            N2|  |3 |  |  |    |  |  |     |  |  |  |  |    |  |  |     |
  977.            N3|1 |1 |1 |1 |    |  |  |     |  |  |  |  |    |  |  |     |
  978.            N4|  |  |2 |  |    |  |  |     |  |  |  |  |    |  |  |     |
  979.            N6|  |  |  |  |    |  |1 |1 |  |1 |  |  |    |  |  |     |
  980.            N7|  |  |  |  |    |  |  |4 |  |  |  |  |    |  |  |     |
  981.            N8|  |  |  |  |    |  |  |     |  |3 |2 |  |    |  |  |     |
  982.            N9|  |  |  |  |    |  |  |     |1 |  |1 |1 |    |  |  |     |
  983.           N10|  |  |  |  |    |  |  |     |  |  |  |2 |    |  |  |     |
  984.           N11|  |  |  |  |    |  |  |     |3 |  |  |  |    |  |  |     |
  985.           N12|  |  |  |  |8    |  |2 |     |  |  |  |  |    |  |  |     |
  986.           N13|  |  |  |  |8    |  |  |     |  |  |  |  |    |  |  |     |
  987.           N14|  |  |  |  |8    |  |  |     |  |  |  |  |    |  |  |     |
  988.           N15|  |  |  |  |    |  |9 |     |  |  |  |  |    |  |  |     |
  989.            H1|  |  |  |  |    |  |  |     |  |  |  |10|    |  |  |     |
  990.  
  991.  
  992.              Figure 3: The resulting directed graph
  993.  
  994.          Networks and routers are represented by vertices.
  995.          An edge of cost X connects Vertex A to    Vertex B iff
  996.          the intersection of Column A and Row B    is marked
  997.                      with an X.
  998.  
  999.  
  1000.  
  1001. Moy                Standards Track               [Page 20]
  1002.  
  1003. RFC 2328             OSPF Version 2              April 1998
  1004.  
  1005.  
  1006.              **FROM**                **FROM**
  1007.  
  1008.           |RT12|N9|N10|H1|           |RT9|RT11|RT12|N9|
  1009.        *  --------------------        *  ----------------------
  1010.        *  RT12|    |  |   |     |        *    RT9|   |    |     |0 |
  1011.        T    N9|1   |  |   |     |        T  RT11|   |    |     |0 |
  1012.        O   N10|2   |  |   |     |        O  RT12|   |    |     |0 |
  1013.        *    H1|10  |  |   |     |        *     N9|   |    |     |  |
  1014.        *                    *
  1015.         RT12's router-LSA           N9's network-LSA
  1016.  
  1017.           Figure 4: Individual link state components
  1018.  
  1019.           Networks and routers are represented by vertices.
  1020.           An edge of cost X    connects Vertex    A to Vertex B iff
  1021.           the intersection of Column A and Row B is    marked
  1022.                   with an X.
  1023.  
  1024.     2.2.  The shortest-path tree
  1025.  
  1026.     When no    OSPF areas are configured, each    router in the Autonomous
  1027.     System has an identical    link-state database, leading to    an
  1028.     identical graphical representation.  A router generates    its
  1029.     routing    table from this    graph by calculating a tree of shortest
  1030.     paths with the router itself as    root.  Obviously, the shortest-
  1031.     path tree depends on the router    doing the calculation.    The
  1032.     shortest-path tree for Router RT6 in our example is depicted in
  1033.     Figure 5.
  1034.  
  1035.     The tree gives the entire path to any destination network or
  1036.     host.  However,    only the next hop to the destination is    used in
  1037.     the forwarding process.     Note also that    the best route to any
  1038.     router has also    been calculated.  For the processing of    external
  1039.     data, we note the next hop and distance    to any router
  1040.     advertising external routes.  The resulting routing table for
  1041.     Router RT6 is pictured in Table    2.  Note that there is a
  1042.     separate route for each    end of a numbered point-to-point network
  1043.     (in this case, the serial line between Routers RT6 and RT10).
  1044.  
  1045.  
  1046.     Routes to networks belonging to    other AS'es (such as N12) appear
  1047.     as dashed lines    on the shortest    path tree in Figure 5.    Use of
  1048.  
  1049.  
  1050.  
  1051. Moy                Standards Track               [Page 21]
  1052.  
  1053. RFC 2328             OSPF Version 2              April 1998
  1054.  
  1055.  
  1056.  
  1057.                 RT6(origin)
  1058.             RT5    o------------o-----------o Ib
  1059.                /|\    6         |\        7
  1060.              8/8|8\         | \
  1061.              /    |  \        6|    \
  1062.             o    |   o         |     \7
  1063.            N12    o  N14         |      \
  1064.                N13      2  |       \
  1065.                 N4 o-----o RT3  \
  1066.                     /         \      5
  1067.                   1/     RT10 o-------o    Ia
  1068.                   /          |\
  1069.                RT4 o-----o N3         3|    \1
  1070.                 /|          |     \ N6      RT7
  1071.                    / |       N8 o      o---------o
  1072.                   /     |          |      |       /|
  1073.              RT2 o     o RT1          |      |     2/ |9
  1074.                 /     |          |      |RT8     /  |
  1075.                /3     |3     RT11 o      o    o   o
  1076.               /     |          |      |    N12 N15
  1077.               N2 o     o N1         1|      |4
  1078.                           |      |
  1079.                        N9 o      o N7
  1080.                          /|
  1081.                         / |
  1082.             N11     RT9       /  |RT12
  1083.              o--------o-------o   o--------o H1
  1084.                  3              |      10
  1085.                           |2
  1086.                           |
  1087.                           o    N10
  1088.  
  1089.  
  1090.              Figure 5: The SPF tree for    Router RT6
  1091.  
  1092.           Edges that are not marked    with a cost have a cost    of
  1093.           of zero (these are network-to-router links). Routes
  1094.           to networks N12-N15 are external information that    is
  1095.              considered in Section 2.3
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101. Moy                Standards Track               [Page 22]
  1102.  
  1103. RFC 2328             OSPF Version 2              April 1998
  1104.  
  1105.  
  1106.            Destination     Next  Hop   Distance
  1107.            __________________________________
  1108.            N1         RT3         10
  1109.            N2         RT3         10
  1110.            N3         RT3         7
  1111.            N4         RT3         8
  1112.            Ib         *         7
  1113.            Ia         RT10         12
  1114.            N6         RT10         8
  1115.            N7         RT10         12
  1116.            N8         RT10         10
  1117.            N9         RT10         11
  1118.            N10         RT10         13
  1119.            N11         RT10         14
  1120.            H1         RT10         21
  1121.            __________________________________
  1122.            RT5         RT5         6
  1123.            RT7         RT10         8
  1124.  
  1125.  
  1126.     Table 2: The portion of Router RT6's routing table listing local
  1127.                  destinations.
  1128.  
  1129.     this externally    derived    routing    information is considered in the
  1130.     next section.
  1131.  
  1132.  
  1133.     2.3.  Use of external routing information
  1134.  
  1135.     After the tree is created the external routing information is
  1136.     examined.  This    external routing information may originate from
  1137.     another    routing    protocol such as BGP, or be statically
  1138.     configured (static routes).  Default routes can    also be    included
  1139.     as part    of the Autonomous System's external routing information.
  1140.  
  1141.     External routing information is    flooded    unaltered throughout the
  1142.     AS.  In    our example, all the routers in    the Autonomous System
  1143.     know that Router RT7 has two external routes, with metrics 2 and
  1144.     9.
  1145.  
  1146.     OSPF supports two types    of external metrics.  Type 1 external
  1147.     metrics    are expressed in the same units    as OSPF    interface cost
  1148.  
  1149.  
  1150.  
  1151. Moy                Standards Track               [Page 23]
  1152.  
  1153. RFC 2328             OSPF Version 2              April 1998
  1154.  
  1155.  
  1156.     (i.e., in terms    of the link state metric).  Type 2 external
  1157.     metrics    are an order of    magnitude larger; any Type 2 metric is
  1158.     considered greater than    the cost of any    path internal to the AS.
  1159.     Use of Type 2 external metrics assumes that routing between
  1160.     AS'es is the major cost    of routing a packet, and eliminates the
  1161.     need for conversion of external    costs to internal link state
  1162.     metrics.
  1163.  
  1164.     As an example of Type 1    external metric    processing, suppose that
  1165.     the Routers RT7    and RT5    in Figure 2 are    advertising Type 1
  1166.     external metrics.  For each advertised external    route, the total
  1167.     cost from Router RT6 is    calculated as the sum of the external
  1168.     route's    advertised cost    and the    distance from Router RT6 to the
  1169.     advertising router.  When two routers are advertising the same
  1170.     external destination, RT6 picks    the advertising    router providing
  1171.     the minimum total cost.    RT6 then sets the next hop to the
  1172.     external destination equal to the next hop that    would be used
  1173.     when routing packets to    the chosen advertising router.
  1174.  
  1175.     In Figure 2, both Router RT5 and RT7 are advertising an    external
  1176.     route to destination Network N12.  Router RT7 is preferred since
  1177.     it is advertising N12 at a distance of 10 (8+2)    to Router RT6,
  1178.     which is better    than Router RT5's 14 (6+8).  Table 3 shows the
  1179.     entries    that are added to the routing table when external routes
  1180.     are examined:
  1181.  
  1182.  
  1183.  
  1184.              Destination   Next  Hop   Distance
  1185.              __________________________________
  1186.              N12           RT10       10
  1187.              N13           RT5       14
  1188.              N14           RT5       14
  1189.              N15           RT10       17
  1190.  
  1191.  
  1192.          Table 3: The portion of Router    RT6's routing table
  1193.                listing external destinations.
  1194.  
  1195.  
  1196.     Processing of Type 2 external metrics is simpler.  The AS
  1197.     boundary router    advertising the    smallest external metric is
  1198.  
  1199.  
  1200.  
  1201. Moy                Standards Track               [Page 24]
  1202.  
  1203. RFC 2328             OSPF Version 2              April 1998
  1204.  
  1205.  
  1206.     chosen,    regardless of the internal distance to the AS boundary
  1207.     router.     Suppose in our    example    both Router RT5    and Router RT7
  1208.     were advertising Type 2    external routes.  Then all traffic
  1209.     destined for Network N12 would be forwarded to Router RT7, since
  1210.     2 < 8.    When several equal-cost    Type 2 routes exist, the
  1211.     internal distance to the advertising routers is    used to    break
  1212.     the tie.
  1213.  
  1214.     Both Type 1 and    Type 2 external    metrics    can be present in the AS
  1215.     at the same time.  In that event, Type 1 external metrics always
  1216.     take precedence.
  1217.  
  1218.     This section has assumed that packets destined for external
  1219.     destinations are always    routed through the advertising AS
  1220.     boundary router.  This is not always desirable.     For example,
  1221.     suppose    in Figure 2 there is an    additional router attached to
  1222.     Network    N6, called Router RTX.    Suppose    further    that RTX does
  1223.     not participate    in OSPF    routing, but does exchange BGP
  1224.     information with the AS    boundary router    RT7.  Then, Router RT7
  1225.     would end up advertising OSPF external routes for all
  1226.     destinations that should be routed to RTX.  An extra hop will
  1227.     sometimes be introduced    if packets for these destinations need
  1228.     always be routed first to Router RT7 (the advertising router).
  1229.  
  1230.     To deal    with this situation, the OSPF protocol allows an AS
  1231.     boundary router    to specify a "forwarding address" in its AS-
  1232.     external-LSAs.    In the above example, Router RT7 would specify
  1233.     RTX's IP address as the    "forwarding address" for all those
  1234.     destinations whose packets should be routed directly to    RTX.
  1235.  
  1236.     The "forwarding    address" has one other application.  It    enables
  1237.     routers    in the Autonomous System's interior to function    as
  1238.     "route servers".  For example, in Figure 2 the router RT6 could
  1239.     become a route server, gaining external    routing    information
  1240.     through    a combination of static    configuration and external
  1241.     routing    protocols.  RT6    would then start advertising itself as
  1242.     an AS boundary router, and would originate a collection    of OSPF
  1243.     AS-external-LSAs.  In each AS-external-LSA, Router RT6 would
  1244.     specify    the correct Autonomous System exit point to use    for the
  1245.     destination through appropriate    setting    of the LSA's "forwarding
  1246.     address" field.
  1247.  
  1248.  
  1249.  
  1250.  
  1251. Moy                Standards Track               [Page 25]
  1252.  
  1253. RFC 2328             OSPF Version 2              April 1998
  1254.  
  1255.  
  1256.     2.4.  Equal-cost multipath
  1257.  
  1258.     The above discussion has been simplified by considering    only a
  1259.     single route to    any destination.  In reality, if multiple
  1260.     equal-cost routes to a destination exist, they are all
  1261.     discovered and used.  This requires no conceptual changes to the
  1262.     algorithm, and its discussion is postponed until we consider the
  1263.     tree-building process in more detail.
  1264.  
  1265.     With equal cost    multipath, a router potentially    has several
  1266.     available next hops towards any    given destination.
  1267.  
  1268.  
  1269. 3.  Splitting the AS into Areas
  1270.  
  1271.     OSPF allows    collections of contiguous networks and hosts to    be
  1272.     grouped together.  Such a group, together with the routers having
  1273.     interfaces to any one of the included networks, is called an area.
  1274.     Each area runs a separate copy of the basic    link-state routing
  1275.     algorithm.    This means that    each area has its own link-state
  1276.     database and corresponding graph, as explained in the previous
  1277.     section.
  1278.  
  1279.     The    topology of an area is invisible from the outside of the area.
  1280.     Conversely,    routers    internal to a given area know nothing of the
  1281.     detailed topology external to the area.  This isolation of knowledge
  1282.     enables the    protocol to effect a marked reduction in routing traffic
  1283.     as compared    to treating the    entire Autonomous System as a single
  1284.     link-state domain.
  1285.  
  1286.     With the introduction of areas, it is no longer true that all
  1287.     routers in the AS have an identical    link-state database.  A    router
  1288.     actually has a separate link-state database    for each area it is
  1289.     connected to.  (Routers connected to multiple areas    are called area
  1290.     border routers).  Two routers belonging to the same    area have, for
  1291.     that area, identical area link-state databases.
  1292.  
  1293.     Routing in the Autonomous System takes place on two    levels,
  1294.     depending on whether the source and    destination of a packet    reside
  1295.     in the same    area (intra-area routing is used) or different areas
  1296.     (inter-area    routing    is used).  In intra-area routing, the packet is
  1297.     routed solely on information obtained within the area; no routing
  1298.  
  1299.  
  1300.  
  1301. Moy                Standards Track               [Page 26]
  1302.  
  1303. RFC 2328             OSPF Version 2              April 1998
  1304.  
  1305.  
  1306.     information    obtained from outside the area can be used.  This
  1307.     protects intra-area    routing    from the injection of bad routing
  1308.     information.  We discuss inter-area    routing    in Section 3.2.
  1309.  
  1310.  
  1311.     3.1.  The backbone of the Autonomous System
  1312.  
  1313.     The OSPF backbone is the special OSPF Area 0 (often written as
  1314.     Area 0.0.0.0, since OSPF Area ID's are typically formatted as IP
  1315.     addresses). The    OSPF backbone always contains all area border
  1316.     routers. The backbone is responsible for distributing routing
  1317.     information between non-backbone areas.    The backbone must be
  1318.     contiguous. However, it    need not be physically contiguous;
  1319.     backbone connectivity can be established/maintained through the
  1320.     configuration of virtual links.
  1321.  
  1322.     Virtual    links can be configured    between    any two    backbone routers
  1323.     that have an interface to a common non-backbone    area.  Virtual
  1324.     links belong to    the backbone.  The protocol treats two routers
  1325.     joined by a virtual link as if they were connected by an
  1326.     unnumbered point-to-point backbone network.  On    the graph of the
  1327.     backbone, two such routers are joined by arcs whose costs are
  1328.     the intra-area distances between the two routers.  The routing
  1329.     protocol traffic that flows along the virtual link uses    intra-
  1330.     area routing only.
  1331.  
  1332.  
  1333.     3.2.  Inter-area routing
  1334.  
  1335.     When routing a packet between two non-backbone areas the
  1336.     backbone is used.  The path that the packet will travel    can be
  1337.     broken up into three contiguous    pieces:    an intra-area path from
  1338.     the source to an area border router, a backbone    path between the
  1339.     source and destination areas, and then another intra-area path
  1340.     to the destination.  The algorithm finds the set of such paths
  1341.     that have the smallest cost.
  1342.  
  1343.     Looking    at this    another    way, inter-area    routing    can be pictured
  1344.     as forcing a star configuration    on the Autonomous System, with
  1345.     the backbone as    hub and    each of    the non-backbone areas as
  1346.     spokes.
  1347.  
  1348.  
  1349.  
  1350.  
  1351. Moy                Standards Track               [Page 27]
  1352.  
  1353. RFC 2328             OSPF Version 2              April 1998
  1354.  
  1355.  
  1356.     The topology of    the backbone dictates the backbone paths used
  1357.     between    areas.    The topology of    the backbone can be enhanced by
  1358.     adding virtual links.  This gives the system administrator some
  1359.     control    over the routes    taken by inter-area traffic.
  1360.  
  1361.     The correct area border    router to use as the packet exits the
  1362.     source area is chosen in exactly the same way routers
  1363.     advertising external routes are    chosen.     Each area border router
  1364.     in an area summarizes for the area its cost to all networks
  1365.     external to the    area.  After the SPF tree is calculated    for the
  1366.     area, routes to    all inter-area destinations are    calculated by
  1367.     examining the summaries    of the area border routers.
  1368.  
  1369.  
  1370.     3.3.  Classification of routers
  1371.  
  1372.     Before the introduction    of areas, the only OSPF    routers    having a
  1373.     specialized function were those    advertising external routing
  1374.     information, such as Router RT5    in Figure 2.  When the AS is
  1375.     split into OSPF    areas, the routers are further divided according
  1376.     to function into the following four overlapping    categories:
  1377.  
  1378.  
  1379.     Internal routers
  1380.         A router with all directly connected networks belonging to
  1381.         the    same area. These routers run a single copy of the basic
  1382.         routing algorithm.
  1383.  
  1384.     Area border routers
  1385.         A router that attaches to multiple areas.  Area border
  1386.         routers run    multiple copies    of the basic algorithm,    one copy
  1387.         for    each attached area. Area border    routers    condense the
  1388.         topological    information of their attached areas for
  1389.         distribution to the    backbone.  The backbone    in turn
  1390.         distributes    the information    to the other areas.
  1391.  
  1392.     Backbone routers
  1393.         A router that has an interface to the backbone area.  This
  1394.         includes all routers that interface    to more    than one area
  1395.         (i.e., area    border routers).  However, backbone routers do
  1396.         not    have to    be area    border routers.     Routers with all
  1397.         interfaces connecting to the backbone area are supported.
  1398.  
  1399.  
  1400.  
  1401. Moy                Standards Track               [Page 28]
  1402.  
  1403. RFC 2328             OSPF Version 2              April 1998
  1404.  
  1405.  
  1406.     AS boundary routers
  1407.         A router that exchanges routing information    with routers
  1408.         belonging to other Autonomous Systems.  Such a router
  1409.         advertises AS external routing information throughout the
  1410.         Autonomous System.    The paths to each AS boundary router are
  1411.         known by every router in the AS.  This classification is
  1412.         completely independent of the previous classifications: AS
  1413.         boundary routers may be internal or    area border routers, and
  1414.         may    or may not participate in the backbone.
  1415.  
  1416.  
  1417.     3.4.  A sample area    configuration
  1418.  
  1419.     Figure 6 shows a sample    area configuration.  The first area
  1420.     consists of networks N1-N4, along with their attached routers
  1421.     RT1-RT4.  The second area consists of networks N6-N8, along with
  1422.     their attached routers RT7, RT8, RT10 and RT11.     The third area
  1423.     consists of networks N9-N11 and    Host H1, along with their
  1424.     attached routers RT9, RT11 and RT12.  The third    area has been
  1425.     configured so that networks N9-N11 and Host H1 will all    be
  1426.     grouped    into a single route, when advertised external to the
  1427.     area (see Section 3.5 for more details).
  1428.  
  1429.     In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are
  1430.     internal routers.  Routers RT3,    RT4, RT7, RT10 and RT11    are area
  1431.     border routers.     Finally, as before, Routers RT5 and RT7 are AS
  1432.     boundary routers.
  1433.  
  1434.     Figure 7 shows the resulting link-state    database for the Area 1.
  1435.     The figure completely describes    that area's intra-area routing.
  1436.     It also    shows the complete view    of the internet    for the    two
  1437.     internal routers RT1 and RT2.  It is the job of    the area border
  1438.     routers, RT3 and RT4, to advertise into    Area 1 the distances to
  1439.     all destinations external to the area.    These are indicated in
  1440.     Figure 7 by the    dashed stub routes.  Also, RT3 and RT4 must
  1441.     advertise into Area 1 the location of the AS boundary routers
  1442.     RT5 and    RT7.  Finally, AS-external-LSAs    from RT5 and RT7 are
  1443.     flooded    throughout the entire AS, and in particular throughout
  1444.     Area 1.     These LSAs are    included in Area 1's database, and yield
  1445.     routes to Networks N12-N15.
  1446.  
  1447.     Routers    RT3 and    RT4 must also summarize    Area 1's topology for
  1448.  
  1449.  
  1450.  
  1451. Moy                Standards Track               [Page 29]
  1452.  
  1453. RFC 2328             OSPF Version 2              April 1998
  1454.  
  1455.  
  1456.  
  1457.          ...........................
  1458.          .     +               .
  1459.          .     | 3+---+           .      N12      N14
  1460.          . N1|--|RT1|\ 1           .    \ N13 /
  1461.          .     |  +---+ \           .    8\ |8/8
  1462.          .     +       \ ____      .      \|/
  1463.          .            /     \   1+---+8    8+---+6
  1464.          .           *  N3  *---|RT4|------|RT5|--------+
  1465.          .            \____/    +---+     +---+          |
  1466.          .      +        /       \   .       |7          |
  1467.          .      | 3+---+ /        \  .       |          |
  1468.          .    N2|--|RT2|/1        1\ .       |6          |
  1469.          .      |  +---+          +---+8    6+---+          |
  1470.          .      +              |RT3|------|RT6|          |
  1471.          .                  +---+     +---+          |
  1472.          .                2/ .     Ia|7          |
  1473.          .                /  .       |          |
  1474.          .           +---------+ .       |          |
  1475.          .Area 1           N4      .       |          |
  1476.          ...........................       |          |
  1477.       ..........................           |          |
  1478.       .           N11       .           |          |
  1479.       .       +---------+       .           |          |
  1480.       .        |       .           |          |       N12
  1481.       .        |3       .         Ib|5          |6 2/
  1482.       .          +---+       .         +----+        +---+/
  1483.       .          |RT9|       .    .........|RT10|.....|RT7|---N15.
  1484.       .          +---+       .    .     +----+        +---+ 9    .
  1485.       .        |1       .    .    +    /3    1\      |1       .
  1486.       .           _|__       .    .    | /    \   __|_       .
  1487.       .          /       \      1+----+2   |/         \ /    \      .
  1488.       .         *    N9  *------|RT11|----|          *  N6     *     .
  1489.       .          \____/       +----+    |           \____/      .
  1490.       .        |       .    .    |              |           .
  1491.       .        |1       .    .    +              |1       .
  1492.       .  +--+   10+----+       .    .   N8            +---+      .
  1493.       .  |H1|-----|RT12|       .    .            |RT8|      .
  1494.       .  +--+SLIP +----+       .    .            +---+      .
  1495.       .        |2       .    .              |4       .
  1496.       .        |       .    .              |           .
  1497.       .       +---------+       .    .          +--------+   .
  1498.  
  1499.  
  1500.  
  1501. Moy                Standards Track               [Page 30]
  1502.  
  1503. RFC 2328             OSPF Version 2              April 1998
  1504.  
  1505.  
  1506.       .           N10       .    .              N7       .
  1507.       .               .    .Area 2                   .
  1508.       .Area    3           .    ................................
  1509.       ..........................
  1510.  
  1511.             Figure 6: A    sample OSPF area configuration
  1512.  
  1513.     distribution to    the backbone.  Their backbone LSAs are shown in
  1514.     Table 4.  These    summaries show which networks are contained in
  1515.     Area 1 (i.e., Networks N1-N4), and the distance    to these
  1516.     networks from the routers RT3 and RT4 respectively.
  1517.  
  1518.  
  1519.     The link-state database    for the    backbone is shown in Figure 8.
  1520.     The set    of routers pictured are    the backbone routers.  Router
  1521.     RT11 is    a backbone router because it belongs to    two areas.  In
  1522.     order to make the backbone connected, a    virtual    link has been
  1523.     configured between Routers R10 and R11.
  1524.  
  1525.     The area border    routers    RT3, RT4, RT7, RT10 and    RT11 condense
  1526.     the routing information    of their attached non-backbone areas for
  1527.     distribution via the backbone; these are the dashed stubs that
  1528.     appear in Figure 8.  Remember that the third area has been
  1529.     configured to condense Networks    N9-N11 and Host    H1 into    a single
  1530.     route.    This yields a single dashed line for networks N9-N11 and
  1531.     Host H1    in Figure 8.  Routers RT5 and RT7 are AS boundary
  1532.     routers; their externally derived information also appears on
  1533.     the graph in Figure 8 as stubs.
  1534.  
  1535.  
  1536.  
  1537.              Network   RT3 adv.      RT4 adv.
  1538.              _____________________________
  1539.              N1           4      4
  1540.              N2           4      4
  1541.              N3           1      1
  1542.              N4           2      3
  1543.  
  1544.           Table 4: Networks    advertised to the backbone
  1545.             by Routers RT3 and RT4.
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551. Moy                Standards Track               [Page 31]
  1552.  
  1553. RFC 2328             OSPF Version 2              April 1998
  1554.  
  1555.  
  1556.  
  1557.                    **FROM**
  1558.  
  1559.               |RT|RT|RT|RT|RT|RT|
  1560.               |1 |2    |3 |4 |5 |7 |N3|
  1561.                ----- -------------------
  1562.                RT1|  |    |  |  |     |  |0 |
  1563.                RT2|  |    |  |  |     |  |0 |
  1564.                RT3|  |    |  |  |     |  |0 |
  1565.            *   RT4|  |    |  |  |     |  |0 |
  1566.            *   RT5|  |    |14|8 |     |  |  |
  1567.            T   RT7|  |    |20|14|     |  |  |
  1568.            O    N1|3 |    |  |  |     |  |  |
  1569.            *    N2|  |3    |  |  |     |  |  |
  1570.            *    N3|1 |1    |1 |1 |     |  |  |
  1571.             N4|  |    |2 |  |     |  |  |
  1572.              Ia,Ib|  |    |20|27|     |  |  |
  1573.             N6|  |    |16|15|     |  |  |
  1574.             N7|  |    |20|19|     |  |  |
  1575.             N8|  |    |18|18|     |  |  |
  1576.          N9-N11,H1|  |    |29|36|     |  |  |
  1577.                N12|  |    |  |  |8 |2 |  |
  1578.                N13|  |    |  |  |8 |  |  |
  1579.                N14|  |    |  |  |8 |  |  |
  1580.                N15|  |    |  |  |     |9 |  |
  1581.  
  1582.               Figure 7:    Area 1's Database.
  1583.  
  1584.           Networks and routers are represented by vertices.
  1585.           An edge of cost X    connects Vertex    A to Vertex B iff
  1586.           the intersection of Column A and Row B is    marked
  1587.                    with an X.
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601. Moy                Standards Track               [Page 32]
  1602.  
  1603. RFC 2328             OSPF Version 2              April 1998
  1604.  
  1605.  
  1606.                   **FROM**
  1607.  
  1608.                 |RT|RT|RT|RT|RT|RT|RT
  1609.                 |3 |4 |5 |6    |7 |10|11|
  1610.              ------------------------
  1611.              RT3|  |  |  |6    |  |  |     |
  1612.              RT4|  |  |8 |    |  |  |     |
  1613.              RT5|  |8 |  |6    |6 |  |     |
  1614.              RT6|8 |  |7 |    |  |5 |     |
  1615.              RT7|  |  |6 |    |  |  |     |
  1616.              *    RT10|  |  |  |7    |  |  |2 |
  1617.              *    RT11|  |  |  |    |  |3 |     |
  1618.              T      N1|4 |4 |  |    |  |  |     |
  1619.              O      N2|4 |4 |  |    |  |  |     |
  1620.              *      N3|1 |1 |  |    |  |  |     |
  1621.              *      N4|2 |3 |  |    |  |  |     |
  1622.               Ia|  |  |  |    |  |5 |     |
  1623.               Ib|  |  |  |7    |  |  |     |
  1624.               N6|  |  |  |    |1 |1 |3 |
  1625.               N7|  |  |  |    |5 |5 |7 |
  1626.               N8|  |  |  |    |4 |3 |2 |
  1627.            N9-N11,H1|  |  |  |    |  |  |11|
  1628.              N12|  |  |8 |    |2 |  |     |
  1629.              N13|  |  |8 |    |  |  |     |
  1630.              N14|  |  |8 |    |  |  |     |
  1631.              N15|  |  |  |    |9 |  |     |
  1632.  
  1633.  
  1634.              Figure 8: The backbone's database.
  1635.  
  1636.           Networks and routers are represented by vertices.
  1637.           An edge of cost X    connects Vertex    A to Vertex B iff
  1638.           the intersection of Column A and Row B is    marked
  1639.                  with an X.
  1640.  
  1641.     The backbone enables the exchange of summary information between
  1642.     area border routers.  Every area border    router hears the area
  1643.     summaries from all other area border routers.  It then forms a
  1644.     picture    of the distance    to all networks    outside    of its area by
  1645.     examining the collected    LSAs, and adding in the    backbone
  1646.     distance to each advertising router.
  1647.  
  1648.  
  1649.  
  1650.  
  1651. Moy                Standards Track               [Page 33]
  1652.  
  1653. RFC 2328             OSPF Version 2              April 1998
  1654.  
  1655.  
  1656.     Again using Routers RT3    and RT4    as an example, the procedure
  1657.     goes as    follows: They first calculate the SPF tree for the
  1658.     backbone.  This    gives the distances to all other area border
  1659.     routers.  Also noted are the distances to networks (Ia and Ib)
  1660.     and AS boundary    routers    (RT5 and RT7) that belong to the
  1661.     backbone.  This    calculation is shown in    Table 5.
  1662.  
  1663.  
  1664.     Next, by looking at the    area summaries from these area border
  1665.     routers, RT3 and RT4 can determine the distance    to all networks
  1666.     outside    their area.  These distances are then advertised
  1667.     internally to the area by RT3 and RT4.    The advertisements that
  1668.     Router RT3 and RT4 will    make into Area 1 are shown in Table 6.
  1669.     Note that Table    6 assumes that an area range has been configured
  1670.     for the    backbone which groups Ia and Ib    into a single LSA.
  1671.  
  1672.  
  1673.     The information    imported into Area 1 by    Routers    RT3 and    RT4
  1674.     enables    an internal router, such as RT1, to choose an area
  1675.     border router intelligently.  Router RT1 would use RT4 for
  1676.     traffic    to Network N6, RT3 for traffic to Network N10, and would
  1677.  
  1678.  
  1679.                   dist  from   dist     from
  1680.                   RT3       RT4
  1681.            __________________________________
  1682.            to  RT3    *           21
  1683.            to  RT4    22       *
  1684.            to  RT7    20       14
  1685.            to  RT10   15       22
  1686.            to  RT11   18       25
  1687.            __________________________________
  1688.            to  Ia     20       27
  1689.            to  Ib     15       22
  1690.            __________________________________
  1691.            to  RT5    14       8
  1692.            to  RT7    20       14
  1693.  
  1694.          Table 5: Backbone distances calculated
  1695.             by Routers RT3 and RT4.
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701. Moy                Standards Track               [Page 34]
  1702.  
  1703. RFC 2328             OSPF Version 2              April 1998
  1704.  
  1705.  
  1706.  
  1707.  
  1708.            Destination     RT3 adv.   RT4    adv.
  1709.            _________________________________
  1710.            Ia,Ib     20        27
  1711.            N6         16        15
  1712.            N7         20        19
  1713.            N8         18        18
  1714.            N9-N11,H1     29        36
  1715.            _________________________________
  1716.            RT5         14        8
  1717.            RT7         20        14
  1718.  
  1719.           Table 6: Destinations advertised into Area 1
  1720.             by Routers RT3 and RT4.
  1721.  
  1722.     load share between the two for traffic to Network N8.
  1723.  
  1724.     Router RT1 can also determine in this manner the shortest path
  1725.     to the AS boundary routers RT5 and RT7.     Then, by looking at RT5
  1726.     and RT7's AS-external-LSAs, Router RT1 can decide between RT5 or
  1727.     RT7 when sending to a destination in another Autonomous    System
  1728.     (one of    the networks N12-N15).
  1729.  
  1730.     Note that a failure of the line    between    Routers    RT6 and    RT10
  1731.     will cause the backbone    to become disconnected.     Configuring a
  1732.     virtual    link between Routers RT7 and RT10 will give the    backbone
  1733.     more connectivity and more resistance to such failures.
  1734.  
  1735.  
  1736.     3.5.  IP subnetting    support
  1737.  
  1738.     OSPF attaches an IP address mask to each advertised route.  The
  1739.     mask indicates the range of addresses being described by the
  1740.     particular route.  For example,    a summary-LSA for the
  1741.     destination 128.185.0.0    with a mask of 0xffff0000 actually is
  1742.     describing a single route to the collection of destinations
  1743.     128.185.0.0 - 128.185.255.255.    Similarly, host    routes are
  1744.     always advertised with a mask of 0xffffffff, indicating    the
  1745.     presence of only a single destination.
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751. Moy                Standards Track               [Page 35]
  1752.  
  1753. RFC 2328             OSPF Version 2              April 1998
  1754.  
  1755.  
  1756.     Including the mask with    each advertised    destination enables the
  1757.     implementation of what is commonly referred to as variable-
  1758.     length subnetting.  This means that a single IP    class A, B, or C
  1759.     network    number can be broken up    into many subnets of various
  1760.     sizes.    For example, the network 128.185.0.0 could be broken up
  1761.     into 62    variable-sized subnets:    15 subnets of size 4K, 15
  1762.     subnets    of size    256, and 32 subnets of size 8.    Table 7    shows
  1763.     some of    the resulting network addresses    together with their
  1764.     masks.
  1765.  
  1766.  
  1767.  
  1768.           Network address   IP address mask   Subnet size
  1769.           _______________________________________________
  1770.           128.185.16.0        0xfffff000          4K
  1771.           128.185.1.0        0xffffff00          256
  1772.           128.185.0.8        0xfffffff8          8
  1773.  
  1774.  
  1775.              Table 7: Some sample subnet sizes.
  1776.  
  1777.  
  1778.     There are many possible    ways of    dividing up a class A, B, and C
  1779.     network    into variable sized subnets.  The precise procedure for
  1780.     doing so is beyond the scope of    this specification.  This
  1781.     specification however establishes the following    guideline: When
  1782.     an IP packet is    forwarded, it is always    forwarded to the network
  1783.     that is    the best match for the packet's    destination.  Here best
  1784.     match is synonymous with the longest or    most specific match.
  1785.     For example, the default route with destination    of 0.0.0.0 and
  1786.     mask 0x00000000    is always a match for every IP destination.  Yet
  1787.     it is always less specific than    any other match.  Subnet masks
  1788.     must be    assigned so that the best match    for any    IP destination
  1789.     is unambiguous.
  1790.  
  1791.     Attaching an address mask to each route    also enables the support
  1792.     of IP supernetting. For    example, a single physical network
  1793.     segment    could be assigned the [address,mask] pair
  1794.     [192.9.4.0,0xfffffc00].    The segment would then be single IP
  1795.     network, containing addresses from the four consecutive    class C
  1796.     network    numbers    192.9.4.0 through 192.9.7.0. Such addressing is
  1797.     now becoming commonplace with the advent of CIDR (see [Ref10]).
  1798.  
  1799.  
  1800.  
  1801. Moy                Standards Track               [Page 36]
  1802.  
  1803. RFC 2328             OSPF Version 2              April 1998
  1804.  
  1805.  
  1806.     In order to get    better aggregation at area boundaries, area
  1807.     address    ranges can be employed (see Section C.2    for more
  1808.     details).  Each    address    range is defined as an [address,mask]
  1809.     pair.  Many separate networks may then be contained in a single
  1810.     address    range, just as a subnetted network is composed of many
  1811.     separate subnets.  Area    border routers then summarize the area
  1812.     contents (for distribution to the backbone) by advertising a
  1813.     single route for each address range.  The cost of the route is
  1814.     the maximum cost to any    of the networks    falling    in the specified
  1815.     range.
  1816.  
  1817.     For example, an    IP subnetted network might be configured as a
  1818.     single OSPF area.  In that case, a single address range    could be
  1819.     configured:  a class A,    B, or C    network    number along with its
  1820.     natural    IP mask.  Inside the area, any number of variable sized
  1821.     subnets    could be defined.  However, external to    the area a
  1822.     single route for the entire subnetted network would be
  1823.     distributed, hiding even the fact that the network is subnetted
  1824.     at all.     The cost of this route    is the maximum of the set of
  1825.     costs to the component subnets.
  1826.  
  1827.  
  1828.     3.6.  Supporting stub areas
  1829.  
  1830.     In some    Autonomous Systems, the    majority of the    link-state
  1831.     database may consist of    AS-external-LSAs.  An OSPF AS-external-
  1832.     LSA is usually flooded throughout the entire AS.  However, OSPF
  1833.     allows certain areas to    be configured as "stub areas".    AS-
  1834.     external-LSAs are not flooded into/throughout stub areas;
  1835.     routing    to AS external destinations in these areas is based on a
  1836.     (per-area) default only.  This reduces the link-state database
  1837.     size, and therefore the    memory requirements, for a stub    area's
  1838.     internal routers.
  1839.  
  1840.     In order to take advantage of the OSPF stub area support,
  1841.     default    routing    must be    used in    the stub area.    This is
  1842.     accomplished as    follows.  One or more of the stub area's area
  1843.     border routers must advertise a    default    route into the stub area
  1844.     via summary-LSAs.  These summary defaults are flooded throughout
  1845.     the stub area, but no further.    (For this reason these defaults
  1846.     pertain    only to    the particular stub area).  These summary
  1847.     default    routes will be used for    any destination    that is    not
  1848.  
  1849.  
  1850.  
  1851. Moy                Standards Track               [Page 37]
  1852.  
  1853. RFC 2328             OSPF Version 2              April 1998
  1854.  
  1855.  
  1856.     explicitly reachable by    an intra-area or inter-area path (i.e.,
  1857.     AS external destinations).
  1858.  
  1859.     An area    can be configured as a stub when there is a single exit
  1860.     point from the area, or    when the choice    of exit    point need not
  1861.     be made    on a per-external-destination basis.  For example, Area
  1862.     3 in Figure 6 could be configured as a stub area, because all
  1863.     external traffic must travel though its    single area border
  1864.     router RT11.  If Area 3    were configured    as a stub, Router RT11
  1865.     would advertise    a default route    for distribution inside    Area 3
  1866.     (in a summary-LSA), instead of flooding    the AS-external-LSAs for
  1867.     Networks N12-N15 into/throughout the area.
  1868.  
  1869.     The OSPF protocol ensures that all routers belonging to    an area
  1870.     agree on whether the area has been configured as a stub.  This
  1871.     guarantees that    no confusion will arise    in the flooding    of AS-
  1872.     external-LSAs.
  1873.  
  1874.     There are a couple of restrictions on the use of stub areas.
  1875.     Virtual    links cannot be    configured through stub    areas.    In
  1876.     addition, AS boundary routers cannot be    placed internal    to stub
  1877.     areas.
  1878.  
  1879.  
  1880.     3.7.  Partitions of    areas
  1881.  
  1882.     OSPF does not actively attempt to repair area partitions.  When
  1883.     an area    becomes    partitioned, each component simply becomes a
  1884.     separate area.    The backbone then performs routing between the
  1885.     new areas.  Some destinations reachable    via intra-area routing
  1886.     before the partition will now require inter-area routing.
  1887.  
  1888.     However, in order to maintain full routing after the partition,
  1889.     an address range must not be split across multiple components of
  1890.     the area partition. Also, the backbone itself must not
  1891.     partition.  If it does,    parts of the Autonomous    System will
  1892.     become unreachable.  Backbone partitions can be    repaired by
  1893.     configuring virtual links (see Section 15).
  1894.  
  1895.     Another    way to think about area    partitions is to look at the
  1896.     Autonomous System graph    that was introduced in Section 2.  Area
  1897.     IDs can    be viewed as colors for    the graph's edges.[1] Each edge
  1898.  
  1899.  
  1900.  
  1901. Moy                Standards Track               [Page 38]
  1902.  
  1903. RFC 2328             OSPF Version 2              April 1998
  1904.  
  1905.  
  1906.     of the graph connects to a network, or is itself a point-to-
  1907.     point network.    In either case,    the edge is colored with the
  1908.     network's Area ID.
  1909.  
  1910.     A group    of edges, all having the same color, and interconnected
  1911.     by vertices, represents    an area.  If the topology of the
  1912.     Autonomous System is intact, the graph will have several regions
  1913.     of color, each color being a distinct Area ID.
  1914.  
  1915.     When the AS topology changes, one of the areas may become
  1916.     partitioned.  The graph    of the AS will then have multiple
  1917.     regions    of the same color (Area    ID).  The routing in the
  1918.     Autonomous System will continue    to function as long as these
  1919.     regions    of same    color are connected by the single backbone
  1920.     region.
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951. Moy                Standards Track               [Page 39]
  1952.  
  1953. RFC 2328             OSPF Version 2              April 1998
  1954.  
  1955.  
  1956. 4.  Functional Summary
  1957.  
  1958.     A separate copy of OSPF's basic routing algorithm runs in each area.
  1959.     Routers having interfaces to multiple areas    run multiple copies of
  1960.     the    algorithm.  A brief summary of the routing algorithm follows.
  1961.  
  1962.     When a router starts, it first initializes the routing protocol data
  1963.     structures.     The router then waits for indications from the    lower-
  1964.     level protocols that its interfaces    are functional.
  1965.  
  1966.     A router then uses the OSPF's Hello    Protocol to acquire neighbors.
  1967.     The    router sends Hello packets to its neighbors, and in turn
  1968.     receives their Hello packets.  On broadcast    and point-to-point
  1969.     networks, the router dynamically detects its neighboring routers by
  1970.     sending its    Hello packets to the multicast address AllSPFRouters.
  1971.     On non-broadcast networks, some configuration information may be
  1972.     necessary in order to discover neighbors.  On broadcast and    NBMA
  1973.     networks the Hello Protocol    also elects a Designated router    for the
  1974.     network.
  1975.  
  1976.     The    router will attempt to form adjacencies    with some of its newly
  1977.     acquired neighbors.     Link-state databases are synchronized between
  1978.     pairs of adjacent routers.    On broadcast and NBMA networks,    the
  1979.     Designated Router determines which routers should become adjacent.
  1980.  
  1981.     Adjacencies    control    the distribution of routing information.
  1982.     Routing updates are    sent and received only on adjacencies.
  1983.  
  1984.     A router periodically advertises its state,    which is also called
  1985.     link state.     Link state is also advertised when a router's state
  1986.     changes.  A    router's adjacencies are reflected in the contents of
  1987.     its    LSAs.  This relationship between adjacencies and link state
  1988.     allows the protocol    to detect dead routers in a timely fashion.
  1989.  
  1990.     LSAs are flooded throughout    the area.  The flooding    algorithm is
  1991.     reliable, ensuring that all    routers    in an area have    exactly    the same
  1992.     link-state database.  This database    consists of the    collection of
  1993.     LSAs originated by each router belonging to    the area.  From    this
  1994.     database each router calculates a shortest-path tree, with itself as
  1995.     root.  This    shortest-path tree in turn yields a routing table for
  1996.     the    protocol.
  1997.  
  1998.  
  1999.  
  2000.  
  2001. Moy                Standards Track               [Page 40]
  2002.  
  2003. RFC 2328             OSPF Version 2              April 1998
  2004.  
  2005.  
  2006.     4.1.  Inter-area routing
  2007.  
  2008.     The previous section described the operation of    the protocol
  2009.     within a single    area.  For intra-area routing, no other    routing
  2010.     information is pertinent.  In order to be able to route    to
  2011.     destinations outside of    the area, the area border routers inject
  2012.     additional routing information into the    area.  This additional
  2013.     information is a distillation of the rest of the Autonomous
  2014.     System's topology.
  2015.  
  2016.     This distillation is accomplished as follows: Each area    border
  2017.     router is by definition    connected to the backbone.  Each area
  2018.     border router summarizes the topology of its attached non-
  2019.     backbone areas for transmission    on the backbone, and hence to
  2020.     all other area border routers.    An area    border router then has
  2021.     complete topological information concerning the    backbone, and
  2022.     the area summaries from    each of    the other area border routers.
  2023.     From this information, the router calculates paths to all
  2024.     inter-area destinations.  The router then advertises these paths
  2025.     into its attached areas.  This enables the area's internal
  2026.     routers    to pick    the best exit router when forwarding traffic
  2027.     inter-area destinations.
  2028.  
  2029.  
  2030.     4.2.  AS external routes
  2031.  
  2032.     Routers    that have information regarding    other Autonomous Systems
  2033.     can flood this information throughout the AS.  This external
  2034.     routing    information is distributed verbatim to every
  2035.     participating router.  There is    one exception: external    routing
  2036.     information is not flooded into    "stub" areas (see Section 3.6).
  2037.  
  2038.     To utilize external routing information, the path to all routers
  2039.     advertising external information must be known throughout the AS
  2040.     (excepting the stub areas).  For that reason, the locations of
  2041.     these AS boundary routers are summarized by the    (non-stub) area
  2042.     border routers.
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051. Moy                Standards Track               [Page 41]
  2052.  
  2053. RFC 2328             OSPF Version 2              April 1998
  2054.  
  2055.  
  2056.     4.3.  Routing protocol packets
  2057.  
  2058.     The OSPF protocol runs directly    over IP, using IP protocol 89.
  2059.     OSPF does not provide any explicit fragmentation/reassembly
  2060.     support.  When fragmentation is    necessary, IP
  2061.     fragmentation/reassembly is used.  OSPF    protocol packets have
  2062.     been designed so that large protocol packets can generally be
  2063.     split into several smaller protocol packets.  This practice is
  2064.     recommended; IP    fragmentation should be    avoided    whenever
  2065.     possible.
  2066.  
  2067.     Routing    protocol packets should    always be sent with the    IP TOS
  2068.     field set to 0.     If at all possible, routing protocol packets
  2069.     should be given    preference over    regular    IP data    traffic, both
  2070.     when being sent    and received.  As an aid to accomplishing this,
  2071.     OSPF protocol packets should have their    IP precedence field set
  2072.     to the value Internetwork Control (see [Ref5]).
  2073.  
  2074.     All OSPF protocol packets share    a common protocol header that is
  2075.     described in Appendix A.  The OSPF packet types    are listed below
  2076.     in Table 8.  Their formats are also described in Appendix A.
  2077.  
  2078.  
  2079.  
  2080.          Type   Packet  name       Protocol  function
  2081.          __________________________________________________________
  2082.          1        Hello           Discover/maintain  neighbors
  2083.          2        Database Description   Summarize database contents
  2084.          3        Link State Request       Database download
  2085.          4        Link State Update       Database update
  2086.          5        Link State Ack       Flooding acknowledgment
  2087.  
  2088.  
  2089.                 Table 8: OSPF packet types.
  2090.  
  2091.  
  2092.     OSPF's Hello protocol uses Hello packets to discover and
  2093.     maintain neighbor relationships.  The Database Description and
  2094.     Link State Request packets are used in the forming of
  2095.     adjacencies.  OSPF's reliable update mechanism is implemented by
  2096.     the Link State Update and Link State Acknowledgment packets.
  2097.  
  2098.  
  2099.  
  2100.  
  2101. Moy                Standards Track               [Page 42]
  2102.  
  2103. RFC 2328             OSPF Version 2              April 1998
  2104.  
  2105.  
  2106.     Each Link State    Update packet carries a    set of new link    state
  2107.     advertisements (LSAs) one hop further away from    their point of
  2108.     origination.  A    single Link State Update packet    may contain the
  2109.     LSAs of    several    routers.  Each LSA is tagged with the ID of the
  2110.     originating router and a checksum of its link state contents.
  2111.     Each LSA also has a type field;    the different types of OSPF LSAs
  2112.     are listed below in Table 9.
  2113.  
  2114.     OSPF routing packets (with the exception of Hellos) are    sent
  2115.     only over adjacencies.    This means that    all OSPF protocol
  2116.     packets    travel a single    IP hop,    except those that are sent over
  2117.     virtual    adjacencies.  The IP source address of an OSPF protocol
  2118.     packet is one end of a router adjacency, and the IP destination
  2119.     address    is either the other end    of the adjacency or an IP
  2120.     multicast address.
  2121.  
  2122.  
  2123.     4.4.  Basic    implementation requirements
  2124.  
  2125.     An implementation of OSPF requires the following pieces    of
  2126.     system support:
  2127.  
  2128.  
  2129.     Timers
  2130.         Two    different kind of timers are required.    The first kind,
  2131.         called "single shot    timers", fire once and cause a protocol
  2132.         event to be    processed.  The    second kind, called "interval
  2133.         timers", fire at continuous    intervals.  These are used for
  2134.         the    sending    of packets at regular intervals.  A good example
  2135.         of this is the regular broadcast of    Hello packets. The
  2136.         granularity    of both    kinds of timers    is one second.
  2137.  
  2138.         Interval timers should be implemented to avoid drift.  In
  2139.         some router    implementations, packet    processing can affect
  2140.         timer execution.  When multiple routers are    attached to a
  2141.         single network, all    doing broadcasts, this can lead    to the
  2142.         synchronization of routing packets (which should be
  2143.         avoided).  If timers cannot    be implemented to avoid    drift,
  2144.         small random amounts should    be added to/subtracted from the
  2145.         interval timer at each firing.
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151. Moy                Standards Track               [Page 43]
  2152.  
  2153. RFC 2328             OSPF Version 2              April 1998
  2154.  
  2155.  
  2156.  
  2157.  
  2158.     LS     LSA          LSA description
  2159.     type   name
  2160.     ________________________________________________________
  2161.     1      Router-LSAs      Originated by    all routers.
  2162.                   This LSA describes
  2163.                   the collected    states of the
  2164.                   router's interfaces to an
  2165.                   area.    Flooded    throughout a
  2166.                   single area only.
  2167.     ________________________________________________________
  2168.     2      Network-LSAs      Originated for broadcast
  2169.                   and NBMA networks by
  2170.                   the Designated Router. This
  2171.                   LSA contains the
  2172.                   list of routers connected
  2173.                   to the network. Flooded
  2174.                   throughout a single area only.
  2175.     ________________________________________________________
  2176.     3,4    Summary-LSAs      Originated by    area border
  2177.                   routers, and flooded through-
  2178.                   out the LSA's    associated
  2179.                   area.    Each summary-LSA
  2180.                   describes a route to a
  2181.                   destination outside the area,
  2182.                   yet still inside the AS
  2183.                   (i.e., an inter-area route).
  2184.                   Type 3 summary-LSAs describe
  2185.                   routes to networks. Type 4
  2186.                   summary-LSAs describe
  2187.                   routes to AS boundary    routers.
  2188.     ________________________________________________________
  2189.     5      AS-external-LSAs      Originated by    AS boundary
  2190.                   routers, and flooded through-
  2191.                   out the AS. Each
  2192.                   AS-external-LSA describes
  2193.                   a route to a destination in
  2194.                   another Autonomous System.
  2195.                   Default routes for the AS can
  2196.                   also be described by
  2197.                   AS-external-LSAs.
  2198.  
  2199.  
  2200.  
  2201. Moy                Standards Track               [Page 44]
  2202.  
  2203. RFC 2328             OSPF Version 2              April 1998
  2204.  
  2205.  
  2206.         Table 9: OSPF link state advertisements (LSAs).
  2207.  
  2208.  
  2209.  
  2210.     IP multicast
  2211.         Certain OSPF packets take the form of IP multicast
  2212.         datagrams.    Support    for receiving and sending IP multicast
  2213.         datagrams, along with the appropriate lower-level protocol
  2214.         support, is    required.  The IP multicast datagrams used by
  2215.         OSPF never travel more than    one hop. For this reason, the
  2216.         ability to forward IP multicast datagrams is not required.
  2217.         For    information on IP multicast, see [Ref7].
  2218.  
  2219.     Variable-length    subnet support
  2220.         The    router's IP protocol support must include the ability to
  2221.         divide a single IP class A,    B, or C    network    number into many
  2222.         subnets of various sizes.  This is commonly    called
  2223.         variable-length subnetting;    see Section 3.5    for details.
  2224.  
  2225.     IP supernetting    support
  2226.         The    router's IP protocol support must include the ability to
  2227.         aggregate contiguous collections of    IP class A, B, and C
  2228.         networks into larger quantities called supernets.
  2229.         Supernetting has been proposed as one way to improve the
  2230.         scaling of IP routing in the worldwide Internet. For more
  2231.         information    on IP supernetting, see    [Ref10].
  2232.  
  2233.     Lower-level protocol support
  2234.         The    lower level protocols referred to here are the network
  2235.         access protocols, such as the Ethernet data    link layer.
  2236.         Indications    must be    passed from these protocols to OSPF as
  2237.         the    network    interface goes up and down.  For example, on an
  2238.         ethernet it    would be valuable to know when the ethernet
  2239.         transceiver    cable becomes unplugged.
  2240.  
  2241.     Non-broadcast lower-level protocol support
  2242.         On non-broadcast networks, the OSPF    Hello Protocol can be
  2243.         aided by providing an indication when an attempt is    made to
  2244.         send a packet to a dead or non-existent router.  For
  2245.         example, on    an X.25    PDN a dead neighboring router may be
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251. Moy                Standards Track               [Page 45]
  2252.  
  2253. RFC 2328             OSPF Version 2              April 1998
  2254.  
  2255.  
  2256.         indicated by the reception of a X.25 clear with an
  2257.         appropriate    cause and diagnostic, and this information would
  2258.         be passed to OSPF.
  2259.  
  2260.     List manipulation primitives
  2261.         Much of the    OSPF functionality is described    in terms of its
  2262.         operation on lists of LSAs.     For example, the collection of
  2263.         LSAs that will be retransmitted to an adjacent router until
  2264.         acknowledged are described as a list.  Any particular LSA
  2265.         may    be on many such    lists.    An OSPF    implementation needs to
  2266.         be able to manipulate these    lists, adding and deleting
  2267.         constituent    LSAs as    necessary.
  2268.  
  2269.     Tasking    support
  2270.         Certain procedures described in this specification invoke
  2271.         other procedures.  At times, these other procedures    should
  2272.         be executed    in-line, that is, before the current procedure
  2273.         is finished.  This is indicated in the text    by instructions
  2274.         to execute a procedure.  At    other times, the other
  2275.         procedures are to be executed only when the    current
  2276.         procedure has finished.  This is indicated by instructions
  2277.         to schedule    a task.
  2278.  
  2279.  
  2280.     4.5.  Optional OSPF    capabilities
  2281.  
  2282.     The OSPF protocol defines several optional capabilities.  A
  2283.     router indicates the optional capabilities that    it supports in
  2284.     its OSPF Hello packets,    Database Description packets and in its
  2285.     LSAs.  This enables routers supporting a mix of    optional
  2286.     capabilities to    coexist    in a single Autonomous System.
  2287.  
  2288.     Some capabilities must be supported by all routers attached to a
  2289.     specific area.    In this    case, a    router will not    accept a
  2290.     neighbor's Hello Packet    unless there is    a match    in reported
  2291.     capabilities (i.e., a capability mismatch prevents a neighbor
  2292.     relationship from forming).  An    example    of this    is the
  2293.     ExternalRoutingCapability (see below).
  2294.  
  2295.     Other capabilities can be negotiated during the    Database
  2296.     Exchange process.  This    is accomplished    by specifying the
  2297.     optional capabilities in Database Description packets.    A
  2298.  
  2299.  
  2300.  
  2301. Moy                Standards Track               [Page 46]
  2302.  
  2303. RFC 2328             OSPF Version 2              April 1998
  2304.  
  2305.  
  2306.     capability mismatch with a neighbor in this case will result in
  2307.     only a subset of the link state    database being exchanged between
  2308.     the two    neighbors.
  2309.  
  2310.     The routing table build    process    can also be affected by    the
  2311.     presence/absence of optional capabilities.  For    example, since
  2312.     the optional capabilities are reported in LSAs,    routers
  2313.     incapable of certain functions can be avoided when building the
  2314.     shortest path tree.
  2315.  
  2316.     The OSPF optional capabilities defined in this memo are    listed
  2317.     below.    See Section A.2    for more information.
  2318.  
  2319.  
  2320.     ExternalRoutingCapability
  2321.         Entire OSPF    areas can be configured    as "stubs" (see    Section
  2322.         3.6).  AS-external-LSAs will not be    flooded    into stub areas.
  2323.         This capability is represented by the E-bit    in the OSPF
  2324.         Options field (see Section A.2).  In order to ensure
  2325.         consistent configuration of    stub areas, all    routers
  2326.         interfacing    to such    an area    must have the E-bit clear in
  2327.         their Hello    packets    (see Sections 9.5 and 10.5).
  2328.  
  2329.  
  2330. 5.  Protocol Data Structures
  2331.  
  2332.     The    OSPF protocol is described herein in terms of its operation on
  2333.     various protocol data structures.  The following list comprises the
  2334.     top-level OSPF data    structures.  Any initialization    that needs to be
  2335.     done is noted.  OSPF areas,    interfaces and neighbors also have
  2336.     associated data structures that are    described later    in this
  2337.     specification.
  2338.  
  2339.     Router ID
  2340.     A 32-bit number    that uniquely identifies this router in    the AS.
  2341.     One possible implementation strategy would be to use the
  2342.     smallest IP interface address belonging    to the router. If a
  2343.     router's OSPF Router ID    is changed, the    router's OSPF software
  2344.     should be restarted before the new Router ID takes effect.  In
  2345.     this case the router should flush its self-originated LSAs from
  2346.     the routing domain (see    Section    14.1) before restarting, or they
  2347.     will persist for up to MaxAge minutes.
  2348.  
  2349.  
  2350.  
  2351. Moy                Standards Track               [Page 47]
  2352.  
  2353. RFC 2328             OSPF Version 2              April 1998
  2354.  
  2355.  
  2356.     Area structures
  2357.     Each one of the    areas to which the router is connected has its
  2358.     own data structure.  This data structure describes the working
  2359.     of the basic OSPF algorithm.  Remember that each area runs a
  2360.     separate copy of the basic OSPF    algorithm.
  2361.  
  2362.     Backbone (area) structure
  2363.     The OSPF backbone area is responsible for the dissemination of
  2364.     inter-area routing information.
  2365.  
  2366.     Virtual links configured
  2367.     The virtual links configured with this router as one endpoint.
  2368.     In order to have configured virtual links, the router itself
  2369.     must be    an area    border router.    Virtual    links are identified by
  2370.     the Router ID of the other endpoint -- which is    another    area
  2371.     border router.    These two endpoint routers must    be attached to a
  2372.     common area, called the    virtual    link's Transit area.  Virtual
  2373.     links are part of the backbone,    and behave as if they were
  2374.     unnumbered point-to-point networks between the two routers.  A
  2375.     virtual    link uses the intra-area routing of its    Transit    area to
  2376.     forward    packets.  Virtual links    are brought up and down    through
  2377.     the building of    the shortest-path trees    for the    Transit    area.
  2378.  
  2379.     List of external routes
  2380.     These are routes to destinations external to the Autonomous
  2381.     System,    that have been gained either through direct experience
  2382.     with another routing protocol (such as BGP), or    through
  2383.     configuration information, or through a    combination of the two
  2384.     (e.g., dynamic external    information to be advertised by    OSPF
  2385.     with configured    metric). Any router having these external routes
  2386.     is called an AS    boundary router.  These    routes are advertised by
  2387.     the router into    the OSPF routing domain    via AS-external-LSAs.
  2388.  
  2389.     List of AS-external-LSAs
  2390.     Part of    the link-state database.  These    have originated    from the
  2391.     AS boundary routers.  They comprise routes to destinations
  2392.     external to the    Autonomous System.  Note that, if the router is
  2393.     itself an AS boundary router, some of these AS-external-LSAs
  2394.     have been self-originated.
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401. Moy                Standards Track               [Page 48]
  2402.  
  2403. RFC 2328             OSPF Version 2              April 1998
  2404.  
  2405.  
  2406.     The    routing    table
  2407.     Derived    from the link-state database.  Each entry in the routing
  2408.     table is indexed by a destination, and contains    the
  2409.     destination's cost and a set of    paths to use in    forwarding
  2410.     packets    to the destination. A path is described    by its type and
  2411.     next hop.  For more information, see Section 11.
  2412.  
  2413.     Figure 9 shows the collection of data structures present in    a
  2414.     typical router.  The router    pictured is RT10, from the map in Figure
  2415.     6.    Note that Router RT10 has a virtual link configured to Router
  2416.     RT11, with Area 2 as the link's Transit area.  This    is indicated by
  2417.     the    dashed line in Figure 9.  When the virtual link    becomes    active,
  2418.     through the    building of the    shortest path tree for Area 2, it
  2419.     becomes an interface to the    backbone (see the two backbone
  2420.     interfaces depicted    in Figure 9).
  2421.  
  2422. 6.  The    Area Data Structure
  2423.  
  2424.     The    area data structure contains all the information used to run the
  2425.     basic OSPF routing algorithm. Each area maintains its own link-state
  2426.     database. A    network    belongs    to a single area, and a    router interface
  2427.     connects to    a single area. Each router adjacency also belongs to a
  2428.     single area.
  2429.  
  2430.     The    OSPF backbone is the special OSPF area responsible for
  2431.     disseminating inter-area routing information.
  2432.  
  2433.     The    area link-state    database consists of the collection of router-
  2434.     LSAs, network-LSAs and summary-LSAs    that have originated from the
  2435.     area's routers.  This information is flooded throughout a single
  2436.     area only.    The list of AS-external-LSAs (see Section 5) is    also
  2437.     considered to be part of each area's link-state database.
  2438.  
  2439.     Area ID
  2440.     A 32-bit number    identifying the    area. The Area ID of 0.0.0.0 is
  2441.     reserved for the backbone.
  2442.  
  2443.     List of area address ranges
  2444.     In order to aggregate routing information at area boundaries,
  2445.     area address ranges can    be employed. Each address range    is
  2446.     specified by an    [address,mask] pair and    a status indication of
  2447.     either Advertise or DoNotAdvertise (see    Section    12.4.3).
  2448.  
  2449.  
  2450.  
  2451. Moy                Standards Track               [Page 49]
  2452.  
  2453. RFC 2328             OSPF Version 2              April 1998
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.                   +----+
  2460.                   |RT10|------+
  2461.                   +----+       \+-------------+
  2462.                  /        \        |Routing Table|
  2463.                 /         \        +-------------+
  2464.                /          \
  2465.           +------+      /           \    +--------+
  2466.           |Area 2|---+        +---|Backbone|
  2467.           +------+***********+        +--------+
  2468.          /          \          *       /          \
  2469.         /           \       *      /           \
  2470.        +---------+  +---------+       +------------+    +------------+
  2471.        |Interface|  |Interface|       |Virtual Link|    |Interface Ib|
  2472.        |  to N6     |  |  to N8  |       |   to RT11    |    +------------+
  2473.        +---------+  +---------+       +------------+          |
  2474.        /  \          |          |              |
  2475.       /    \      |          |              |
  2476.    +--------+ +--------+  |       +-------------+    +------------+
  2477.    |Neighbor| |Neighbor|  |       |Neighbor RT11|    |Neighbor RT6|
  2478.    |  RT8   | |     RT7   |  |       +-------------+    +------------+
  2479.    +--------+ +--------+  |
  2480.               |
  2481.              +-------------+
  2482.              |Neighbor RT11|
  2483.              +-------------+
  2484.  
  2485.  
  2486.         Figure 9: Router RT10's    Data structures
  2487.  
  2488.     Associated router interfaces
  2489.     This router's interfaces connecting to the area.  A router
  2490.     interface belongs to one and only one area (or the backbone).
  2491.     For the    backbone area this list    includes all the virtual links.
  2492.     A virtual link is identified by    the Router ID of its other
  2493.     endpoint; its cost is the cost of the shortest intra-area path
  2494.     through    the Transit area that exists between the two routers.
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501. Moy                Standards Track               [Page 50]
  2502.  
  2503. RFC 2328             OSPF Version 2              April 1998
  2504.  
  2505.  
  2506.     List of router-LSAs
  2507.     A router-LSA is    generated by each router in the    area.  It
  2508.     describes the state of the router's interfaces to the area.
  2509.  
  2510.     List of network-LSAs
  2511.     One network-LSA    is generated for each transit broadcast    and NBMA
  2512.     network    in the area.  A    network-LSA describes the set of routers
  2513.     currently connected to the network.
  2514.  
  2515.     List of summary-LSAs
  2516.     Summary-LSAs originate from the    area's area border routers.
  2517.     They describe routes to    destinations internal to the Autonomous
  2518.     System,    yet external to    the area (i.e.,    inter-area
  2519.     destinations).
  2520.  
  2521.     Shortest-path tree
  2522.     The shortest-path tree for the area, with this router itself as
  2523.     root.  Derived from the    collected router-LSAs and network-LSAs
  2524.     by the Dijkstra    algorithm (see Section 16.1).
  2525.  
  2526.     TransitCapability
  2527.     This parameter indicates whether the area can carry data traffic
  2528.     that neither originates    nor terminates in the area itself. This
  2529.     parameter is calculated    when the area's    shortest-path tree is
  2530.     built (see Section 16.1, where TransitCapability is set    to TRUE
  2531.     if and only if there are one or    more fully adjacent virtual
  2532.     links using the    area as    Transit    area), and is used as an input
  2533.     to a subsequent    step of    the routing table build    process    (see
  2534.     Section    16.3). When an area's TransitCapability    is set to TRUE,
  2535.     the area is said to be a "transit area".
  2536.  
  2537.     ExternalRoutingCapability
  2538.     Whether    AS-external-LSAs will be flooded into/throughout the
  2539.     area.  This is a configurable parameter.  If AS-external-LSAs
  2540.     are excluded from the area, the    area is    called a "stub". Within
  2541.     stub areas, routing to AS external destinations    will be    based
  2542.     solely on a default summary route.  The    backbone cannot    be
  2543.     configured as a    stub area.  Also, virtual links    cannot be
  2544.     configured through stub    areas.    For more information, see
  2545.     Section    3.6.
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551. Moy                Standards Track               [Page 51]
  2552.  
  2553. RFC 2328             OSPF Version 2              April 1998
  2554.  
  2555.  
  2556.     StubDefaultCost
  2557.     If the area has    been configured    as a stub area,    and the    router
  2558.     itself is an area border router, then the StubDefaultCost
  2559.     indicates the cost of the default summary-LSA that the router
  2560.     should advertise into the area.    See Section 12.4.3 for more
  2561.     information.
  2562.  
  2563.  
  2564.     Unless otherwise specified,    the remaining sections of this document
  2565.     refer to the operation of the OSPF protocol    within a single    area.
  2566.  
  2567.  
  2568. 7.  Bringing Up    Adjacencies
  2569.  
  2570.     OSPF creates adjacencies between neighboring routers for the purpose
  2571.     of exchanging routing information.    Not every two neighboring
  2572.     routers will become    adjacent.  This    section    covers the generalities
  2573.     involved in    creating adjacencies.  For further details consult
  2574.     Section 10.
  2575.  
  2576.  
  2577.     7.1.  The Hello Protocol
  2578.  
  2579.     The Hello Protocol is responsible for establishing and
  2580.     maintaining neighbor relationships.  It    also ensures that
  2581.     communication between neighbors    is bidirectional.  Hello packets
  2582.     are sent periodically out all router interfaces.  Bidirectional
  2583.     communication is indicated when    the router sees    itself listed in
  2584.     the neighbor's Hello Packet.  On broadcast and NBMA networks,
  2585.     the Hello Protocol elects a Designated Router for the network.
  2586.  
  2587.     The Hello Protocol works differently on    broadcast networks, NBMA
  2588.     networks and Point-to-MultiPoint networks.  On broadcast
  2589.     networks, each router advertises itself    by periodically
  2590.     multicasting Hello Packets.  This allows neighbors to be
  2591.     discovered dynamically.     These Hello Packets contain the
  2592.     router's view of the Designated    Router's identity, and the list
  2593.     of routers whose Hello Packets have been seen recently.
  2594.  
  2595.     On NBMA    networks some configuration information    may be necessary
  2596.     for the    operation of the Hello Protocol.  Each router that may
  2597.     potentially become Designated Router has a list    of all other
  2598.  
  2599.  
  2600.  
  2601. Moy                Standards Track               [Page 52]
  2602.  
  2603. RFC 2328             OSPF Version 2              April 1998
  2604.  
  2605.  
  2606.     routers    attached to the    network.  A router, having Designated
  2607.     Router potential, sends    Hello Packets to all other potential
  2608.     Designated Routers when    its interface to the NBMA network first
  2609.     becomes    operational.  This is an attempt to find the Designated
  2610.     Router for the network.     If the    router itself is elected
  2611.     Designated Router, it begins sending Hello Packets to all other
  2612.     routers    attached to the    network.
  2613.  
  2614.     On Point-to-MultiPoint networks, a router sends    Hello Packets to
  2615.     all neighbors with which it can    communicate directly. These
  2616.     neighbors may be discovered dynamically    through    a protocol such
  2617.     as Inverse ARP (see [Ref14]), or they may be configured.
  2618.  
  2619.     After a    neighbor has been discovered, bidirectional
  2620.     communication ensured, and (if on a broadcast or NBMA network) a
  2621.     Designated Router elected, a decision is made regarding    whether
  2622.     or not an adjacency should be formed with the neighbor (see
  2623.     Section    10.4). If an adjacency is to be    formed,    the first step
  2624.     is to synchronize the neighbors' link-state databases.    This is
  2625.     covered    in the next section.
  2626.  
  2627.  
  2628.     7.2.  The Synchronization of Databases
  2629.  
  2630.     In a link-state    routing    algorithm, it is very important    for all
  2631.     routers' link-state databases to stay synchronized.  OSPF
  2632.     simplifies this    by requiring only adjacent routers to remain
  2633.     synchronized.  The synchronization process begins as soon as the
  2634.     routers    attempt    to bring up the    adjacency.  Each router
  2635.     describes its database by sending a sequence of    Database
  2636.     Description packets to its neighbor.  Each Database Description
  2637.     Packet describes a set of LSAs belonging to the    router's
  2638.     database.  When    the neighbor sees an LSA that is more recent
  2639.     than its own database copy, it makes a note that this newer LSA
  2640.     should be requested.
  2641.  
  2642.     This sending and receiving of Database Description packets is
  2643.     called the "Database Exchange Process".     During    this process,
  2644.     the two    routers    form a master/slave relationship.  Each    Database
  2645.     Description Packet has a sequence number.  Database Description
  2646.     Packets    sent by    the master (polls) are acknowledged by the slave
  2647.     through    echoing    of the sequence    number.     Both polls and    their
  2648.  
  2649.  
  2650.  
  2651. Moy                Standards Track               [Page 53]
  2652.  
  2653. RFC 2328             OSPF Version 2              April 1998
  2654.  
  2655.  
  2656.     responses contain summaries of link state data.     The master is
  2657.     the only one allowed to    retransmit Database Description    Packets.
  2658.     It does    so only    at fixed intervals, the    length of which    is the
  2659.     configured per-interface constant RxmtInterval.
  2660.  
  2661.     Each Database Description contains an indication that there are
  2662.     more packets to    follow --- the M-bit.  The Database Exchange
  2663.     Process    is over    when a router has received and sent Database
  2664.     Description Packets with the M-bit off.
  2665.  
  2666.     During and after the Database Exchange Process,    each router has
  2667.     a list of those    LSAs for which the neighbor has    more up-to-date
  2668.     instances.  These LSAs are requested in    Link State Request
  2669.     Packets.  Link State Request packets that are not satisfied are
  2670.     retransmitted at fixed intervals of time RxmtInterval.    When the
  2671.     Database Description Process has completed and all Link    State
  2672.     Requests have been satisfied, the databases are    deemed
  2673.     synchronized and the routers are marked    fully adjacent.     At this
  2674.     time the adjacency is fully functional and is advertised in the
  2675.     two routers' router-LSAs.
  2676.  
  2677.     The adjacency is used by the flooding procedure    as soon    as the
  2678.     Database Exchange Process begins.  This    simplifies database
  2679.     synchronization, and guarantees    that it    finishes in a
  2680.     predictable period of time.
  2681.  
  2682.  
  2683.     7.3.  The Designated Router
  2684.  
  2685.     Every broadcast    and NBMA network has a Designated Router.  The
  2686.     Designated Router performs two main functions for the routing
  2687.     protocol:
  2688.  
  2689.     o   The    Designated Router originates a network-LSA on behalf of
  2690.         the    network.  This LSA lists the set of routers (including
  2691.         the    Designated Router itself) currently attached to    the
  2692.         network.  The Link State ID    for this LSA (see Section
  2693.         12.1.4) is the IP interface    address    of the Designated
  2694.         Router.  The IP network number can then be obtained    by using
  2695.         the    network's subnet/network mask.
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701. Moy                Standards Track               [Page 54]
  2702.  
  2703. RFC 2328             OSPF Version 2              April 1998
  2704.  
  2705.  
  2706.     o   The    Designated Router becomes adjacent to all other    routers
  2707.         on the network.  Since the link state databases are
  2708.         synchronized across    adjacencies (through adjacency bring-up
  2709.         and    then the flooding procedure), the Designated Router
  2710.         plays a central part in the    synchronization    process.
  2711.  
  2712.  
  2713.     The Designated Router is elected by the    Hello Protocol.     A
  2714.     router's Hello Packet contains its Router Priority, which is
  2715.     configurable on    a per-interface    basis.    In general, when a
  2716.     router's interface to a    network    first becomes functional, it
  2717.     checks to see whether there is currently a Designated Router for
  2718.     the network.  If there is, it accepts that Designated Router,
  2719.     regardless of its Router Priority.  (This makes    it harder to
  2720.     predict    the identity of    the Designated Router, but ensures that
  2721.     the Designated Router changes less often.  See below.)
  2722.     Otherwise, the router itself becomes Designated    Router if it has
  2723.     the highest Router Priority on the network.  A more detailed
  2724.     (and more accurate) description    of Designated Router election is
  2725.     presented in Section 9.4.
  2726.  
  2727.     The Designated Router is the endpoint of many adjacencies.  In
  2728.     order to optimize the flooding procedure on broadcast networks,
  2729.     the Designated Router multicasts its Link State    Update Packets
  2730.     to the address AllSPFRouters, rather than sending separate
  2731.     packets    over each adjacency.
  2732.  
  2733.     Section    2 of this document discusses the directed graph
  2734.     representation of an area.  Router nodes are labelled with their
  2735.     Router ID.  Transit network nodes are actually labelled    with the
  2736.     IP address of their Designated Router.    It follows that    when the
  2737.     Designated Router changes, it appears as if the    network    node on
  2738.     the graph is replaced by an entirely new node.    This will cause
  2739.     the network and    all its    attached routers to originate new LSAs.
  2740.     Until the link-state databases again converge, some temporary
  2741.     loss of    connectivity may result.  This may result in ICMP
  2742.     unreachable messages being sent    in response to data traffic.
  2743.     For that reason, the Designated    Router should change only
  2744.     infrequently.  Router Priorities should    be configured so that
  2745.     the most dependable router on a    network    eventually becomes
  2746.     Designated Router.
  2747.  
  2748.  
  2749.  
  2750.  
  2751. Moy                Standards Track               [Page 55]
  2752.  
  2753. RFC 2328             OSPF Version 2              April 1998
  2754.  
  2755.  
  2756.     7.4.  The Backup Designated    Router
  2757.  
  2758.     In order to make the transition    to a new Designated Router
  2759.     smoother, there    is a Backup Designated Router for each broadcast
  2760.     and NBMA network.  The Backup Designated Router    is also    adjacent
  2761.     to all routers on the network, and becomes Designated Router
  2762.     when the previous Designated Router fails.  If there were no
  2763.     Backup Designated Router, when a new Designated    Router became
  2764.     necessary, new adjacencies would have to be formed between the
  2765.     new Designated Router and all other routers attached to    the
  2766.     network.  Part of the adjacency    forming    process    is the
  2767.     synchronizing of link-state databases, which can potentially
  2768.     take quite a long time.     During    this time, the network would not
  2769.     be available for transit data traffic.    The Backup Designated
  2770.     obviates the need to form these    adjacencies, since they    already
  2771.     exist.    This means the period of disruption in transit traffic
  2772.     lasts only as long as it takes to flood    the new    LSAs (which
  2773.     announce the new Designated Router).
  2774.  
  2775.     The Backup Designated Router does not generate a network-LSA for
  2776.     the network.  (If it did, the transition to a new Designated
  2777.     Router would be    even faster.  However, this is a tradeoff
  2778.     between    database size and speed    of convergence when the
  2779.     Designated Router disappears.)
  2780.  
  2781.     The Backup Designated Router is    also elected by    the Hello
  2782.     Protocol.  Each    Hello Packet has a field that specifies    the
  2783.     Backup Designated Router for the network.
  2784.  
  2785.     In some    steps of the flooding procedure, the Backup Designated
  2786.     Router plays a passive role, letting the Designated Router do
  2787.     more of    the work.  This    cuts down on the amount    of local routing
  2788.     traffic.  See Section 13.3 for more information.
  2789.  
  2790.  
  2791.     7.5.  The graph of adjacencies
  2792.  
  2793.     An adjacency is    bound to the network that the two routers have
  2794.     in common.  If two routers have    multiple networks in common,
  2795.     they may have multiple adjacencies between them.
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801. Moy                Standards Track               [Page 56]
  2802.  
  2803. RFC 2328             OSPF Version 2              April 1998
  2804.  
  2805.  
  2806.     One can    picture    the collection of adjacencies on a network as
  2807.     forming    an undirected graph.  The vertices consist of routers,
  2808.     with an    edge joining two routers if they are adjacent.    The
  2809.     graph of adjacencies describes the flow    of routing protocol
  2810.     packets, and in    particular Link    State Update Packets, through
  2811.     the Autonomous System.
  2812.  
  2813.     Two graphs are possible, depending on whether a    Designated
  2814.     Router is elected for the network.  On physical    point-to-point
  2815.     networks, Point-to-MultiPoint networks and virtual links,
  2816.     neighboring routers become adjacent whenever they can
  2817.     communicate directly.  In contrast, on broadcast and NBMA
  2818.     networks only the Designated Router and    the Backup Designated
  2819.     Router become adjacent to all other routers attached to    the
  2820.     network.
  2821.  
  2822.  
  2823.  
  2824.       +---+           +---+
  2825.       |RT1|------------|RT2|        o---------------o
  2826.       +---+       N1       +---+       RT1           RT2
  2827.  
  2828.  
  2829.  
  2830.                          RT7
  2831.                           o---------+
  2832.         +---+   +---+   +---+         /|\        |
  2833.         |RT7|   |RT3|   |RT4|        / | \        |
  2834.         +---+   +---+   +---+           /  |  \        |
  2835.           |          |          |              /      |   \        |
  2836.      +-----------------------+      RT5o RT6o    oRT4 |
  2837.           |      |    N2          *      *   *        |
  2838.         +---+    +---+               *  *  *        |
  2839.         |RT5|    |RT6|            * * *        |
  2840.         +---+    +---+             ***        |
  2841.                           o---------+
  2842.                          RT3
  2843.  
  2844.  
  2845.           Figure 10: The graph of adjacencies
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851. Moy                Standards Track               [Page 57]
  2852.  
  2853. RFC 2328             OSPF Version 2              April 1998
  2854.  
  2855.  
  2856.     These graphs are shown in Figure 10.  It is assumed that Router
  2857.     RT7 has    become the Designated Router, and Router RT3 the Backup
  2858.     Designated Router, for the Network N2.    The Backup Designated
  2859.     Router performs    a lesser function during the flooding procedure
  2860.     than the Designated Router (see    Section    13.3).    This is    the
  2861.     reason for the dashed lines connecting the Backup Designated
  2862.     Router RT3.
  2863.  
  2864.  
  2865. 8.  Protocol Packet Processing
  2866.  
  2867.     This section discusses the general processing of OSPF routing
  2868.     protocol packets.  It is very important that the router link-state
  2869.     databases remain synchronized.  For    this reason, routing protocol
  2870.     packets should get preferential treatment over ordinary data
  2871.     packets, both in sending and receiving.
  2872.  
  2873.     Routing protocol packets are sent along adjacencies    only (with the
  2874.     exception of Hello packets,    which are used to discover the
  2875.     adjacencies).  This    means that all routing protocol    packets    travel a
  2876.     single IP hop, except those    sent over virtual links.
  2877.  
  2878.     All    routing    protocol packets begin with a standard header.    The
  2879.     sections below provide details on how to fill in and verify    this
  2880.     standard header.  Then, for    each packet type, the section giving
  2881.     more details on that particular packet type's processing is    listed.
  2882.  
  2883.     8.1.  Sending protocol packets
  2884.  
  2885.     When a router sends a routing protocol packet, it fills    in the
  2886.     fields of the standard OSPF packet header as follows.  For more
  2887.     details    on the header format consult Section A.3.1:
  2888.  
  2889.     Version    #
  2890.         Set    to 2, the version number of the    protocol as documented
  2891.         in this specification.
  2892.  
  2893.     Packet type
  2894.         The    type of    OSPF packet, such as Link state    Update or Hello
  2895.         Packet.
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901. Moy                Standards Track               [Page 58]
  2902.  
  2903. RFC 2328             OSPF Version 2              April 1998
  2904.  
  2905.  
  2906.     Packet length
  2907.         The    length of the entire OSPF packet in bytes, including the
  2908.         standard OSPF packet header.
  2909.  
  2910.     Router ID
  2911.         The    identity of the    router itself (who is originating the
  2912.         packet).
  2913.  
  2914.     Area ID
  2915.         The    OSPF area that the packet is being sent    into.
  2916.  
  2917.     Checksum
  2918.         The    standard IP 16-bit one's complement checksum of    the
  2919.         entire OSPF    packet,    excluding the 64-bit authentication
  2920.         field.  This checksum is calculated    as part    of the
  2921.         appropriate    authentication procedure; for some OSPF
  2922.         authentication types, the checksum calculation is omitted.
  2923.         See    Section    D.4 for    details.
  2924.  
  2925.     AuType and Authentication
  2926.         Each OSPF packet exchange is authenticated.     Authentication
  2927.         types are assigned by the protocol and are documented in
  2928.         Appendix D.     A different authentication procedure can be
  2929.         used for each IP network/subnet.  Autype indicates the type
  2930.         of authentication procedure    in use.    The 64-bit
  2931.         authentication field is then for use by the    chosen
  2932.         authentication procedure.  This procedure should be    the last
  2933.         called when    forming    the packet to be sent. See Section D.4
  2934.         for    details.
  2935.  
  2936.  
  2937.     The IP destination address for the packet is selected as
  2938.     follows.  On physical point-to-point networks, the IP
  2939.     destination is always set to the address AllSPFRouters.     On all
  2940.     other network types (including virtual links), the majority of
  2941.     OSPF packets are sent as unicasts, i.e., sent directly to the
  2942.     other end of the adjacency.  In    this case, the IP destination is
  2943.     just the Neighbor IP address associated    with the other end of
  2944.     the adjacency (see Section 10).     The only packets not sent as
  2945.     unicasts are on    broadcast networks; on these networks Hello
  2946.     packets    are sent to the    multicast destination AllSPFRouters, the
  2947.     Designated Router and its Backup send both Link    State Update
  2948.  
  2949.  
  2950.  
  2951. Moy                Standards Track               [Page 59]
  2952.  
  2953. RFC 2328             OSPF Version 2              April 1998
  2954.  
  2955.  
  2956.     Packets    and Link State Acknowledgment Packets to the multicast
  2957.     address    AllSPFRouters, while all other routers send both their
  2958.     Link State Update and Link State Acknowledgment    Packets    to the
  2959.     multicast address AllDRouters.
  2960.  
  2961.     Retransmissions    of Link    State Update packets are ALWAYS    sent
  2962.     directly to the    neighbor. On multi-access networks, this means
  2963.     that retransmissions should be sent to the neighbor's IP
  2964.     address.
  2965.  
  2966.     The IP source address should be    set to the IP address of the
  2967.     sending    interface.  Interfaces to unnumbered point-to-point
  2968.     networks have no associated IP address.     On these interfaces,
  2969.     the IP source should be    set to any of the other    IP addresses
  2970.     belonging to the router.  For this reason, there must be at
  2971.     least one IP address assigned to the router.[2]    Note that, for
  2972.     most purposes, virtual links act precisely the same as
  2973.     unnumbered point-to-point networks.  However, each virtual link
  2974.     does have an IP    interface address (discovered during the routing
  2975.     table build process) which is used as the IP source when sending
  2976.     packets    over the virtual link.
  2977.  
  2978.     For more information on    the format of specific OSPF packet
  2979.     types, consult the sections listed in Table 10.
  2980.  
  2981.  
  2982.  
  2983.          Type   Packet name           detailed section (transmit)
  2984.          _________________________________________________________
  2985.          1        Hello           Section  9.5
  2986.          2        Database description   Section 10.8
  2987.          3        Link state request       Section 10.9
  2988.          4        Link state update       Section 13.3
  2989.          5        Link state ack       Section 13.5
  2990.  
  2991.  
  2992.       Table 10:    Sections describing OSPF protocol packet transmission.
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001. Moy                Standards Track               [Page 60]
  3002.  
  3003. RFC 2328             OSPF Version 2              April 1998
  3004.  
  3005.  
  3006.     8.2.  Receiving protocol packets
  3007.  
  3008.     Whenever a protocol packet is received by the router it    is
  3009.     marked with the    interface it was received on.  For routers that
  3010.     have virtual links configured, it may not be immediately obvious
  3011.     which interface    to associate the packet    with.  For example,
  3012.     consider the Router RT11 depicted in Figure 6.    If RT11    receives
  3013.     an OSPF    protocol packet    on its interface to Network N8,    it may
  3014.     want to    associate the packet with the interface    to Area    2, or
  3015.     with the virtual link to Router    RT10 (which is part of the
  3016.     backbone).  In the following, we assume    that the packet    is
  3017.     initially associated with the non-virtual  link.[3]
  3018.  
  3019.     In order for the packet    to be accepted at the IP level,    it must
  3020.     pass a number of tests,    even before the    packet is passed to OSPF
  3021.     for processing:
  3022.  
  3023.  
  3024.     o   The    IP checksum must be correct.
  3025.  
  3026.     o   The    packet's IP destination    address    must be    the IP address
  3027.         of the receiving interface,    or one of the IP multicast
  3028.         addresses AllSPFRouters or AllDRouters.
  3029.  
  3030.     o   The    IP protocol specified must be OSPF (89).
  3031.  
  3032.     o   Locally originated packets should not be passed on to OSPF.
  3033.         That is, the source    IP address should be examined to make
  3034.         sure this is not a multicast packet    that the router    itself
  3035.         generated.
  3036.  
  3037.  
  3038.     Next, the OSPF packet header is    verified.  The fields specified
  3039.     in the header must match those configured for the receiving
  3040.     interface.  If they do not, the    packet should be discarded:
  3041.  
  3042.  
  3043.     o   The    version    number field must specify protocol version 2.
  3044.  
  3045.     o   The    Area ID    found in the OSPF header must be verified.  If
  3046.         both of the    following cases    fail, the packet should    be
  3047.         discarded.    The Area ID specified in the header must either:
  3048.  
  3049.  
  3050.  
  3051. Moy                Standards Track               [Page 61]
  3052.  
  3053. RFC 2328             OSPF Version 2              April 1998
  3054.  
  3055.  
  3056.         (1)    Match the Area ID of the receiving interface.  In this
  3057.         case, the packet has been sent over a single hop.
  3058.         Therefore, the packet's    IP source address is required to
  3059.         be on the same network as the receiving    interface.  This
  3060.         can be verified    by comparing the packet's IP source
  3061.         address    to the interface's IP address, after masking
  3062.         both addresses with the    interface mask.     This comparison
  3063.         should not be performed    on point-to-point networks. On
  3064.         point-to-point networks, the interface addresses of each
  3065.         end of the link    are assigned independently, if they are
  3066.         assigned at all.
  3067.  
  3068.         (2)    Indicate the backbone.    In this    case, the packet has
  3069.         been sent over a virtual link.    The receiving router
  3070.         must be    an area    border router, and the Router ID
  3071.         specified in the packet    (the source router) must be the
  3072.         other end of a configured virtual link.     The receiving
  3073.         interface must also attach to the virtual link's
  3074.         configured Transit area.  If all of these checks
  3075.         succeed, the packet is accepted    and is from now    on
  3076.         associated with    the virtual link (and the backbone
  3077.         area).
  3078.  
  3079.     o   Packets whose IP destination is AllDRouters    should only be
  3080.         accepted if    the state of the receiving interface is    DR or
  3081.         Backup (see    Section    9.1).
  3082.  
  3083.     o   The    AuType specified in the    packet must match the AuType
  3084.         specified for the associated area.
  3085.  
  3086.     o   The    packet must be authenticated.  The authentication
  3087.         procedure is indicated by the setting of AuType (see
  3088.         Appendix D).  The authentication procedure may use one or
  3089.         more Authentication    keys, which can    be configured on a per-
  3090.         interface basis.  The authentication procedure may also
  3091.         verify the checksum    field in the OSPF packet header    (which,
  3092.         when used, is set to the standard IP 16-bit    one's complement
  3093.         checksum of    the OSPF packet's contents after excluding the
  3094.         64-bit authentication field).  If the authentication
  3095.         procedure fails, the packet    should be discarded.
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101. Moy                Standards Track               [Page 62]
  3102.  
  3103. RFC 2328             OSPF Version 2              April 1998
  3104.  
  3105.  
  3106.     If the packet type is Hello, it    should then be further processed
  3107.     by the Hello Protocol (see Section 10.5).  All other packet
  3108.     types are sent/received    only on    adjacencies.  This means that
  3109.     the packet must    have been sent by one of the router's active
  3110.     neighbors.  If the receiving interface connects    to a broadcast
  3111.     network, Point-to-MultiPoint network or    NBMA network the sender
  3112.     is identified by the IP    source address found in    the packet's IP
  3113.     header.     If the    receiving interface connects to    a point-to-point
  3114.     network    or a virtual link, the sender is identified by the
  3115.     Router ID (source router) found    in the packet's    OSPF header.
  3116.     The data structure associated with the receiving interface
  3117.     contains the list of active neighbors.    Packets    not matching any
  3118.     active neighbor    are discarded.
  3119.  
  3120.     At this    point all received protocol packets are    associated with
  3121.     an active neighbor.  For the further input processing of
  3122.     specific packet    types, consult the sections listed in Table 11.
  3123.  
  3124.  
  3125.  
  3126.           Type   Packet name        detailed section (receive)
  3127.           ________________________________________________________
  3128.           1         Hello            Section 10.5
  3129.           2         Database description   Section 10.6
  3130.           3         Link state    request        Section 10.7
  3131.           4         Link state    update        Section 13
  3132.           5         Link state    ack        Section 13.7
  3133.  
  3134.  
  3135.       Table 11:    Sections describing OSPF protocol packet reception.
  3136.  
  3137.  
  3138.  
  3139. 9.  The    Interface Data Structure
  3140.  
  3141.     An OSPF interface is the connection    between    a router and a network.
  3142.     We assume a    single OSPF interface to each attached network/subnet,
  3143.     although supporting    multiple interfaces on a single    network    is
  3144.     considered in Appendix F. Each interface structure has at most one
  3145.     IP interface address.
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151. Moy                Standards Track               [Page 63]
  3152.  
  3153. RFC 2328             OSPF Version 2              April 1998
  3154.  
  3155.  
  3156.     An OSPF interface can be considered    to belong to the area that
  3157.     contains the attached network.  All    routing    protocol packets
  3158.     originated by the router over this interface are labelled with the
  3159.     interface's    Area ID.  One or more router adjacencies may develop
  3160.     over an interface.    A router's LSAs    reflect    the state of its
  3161.     interfaces and their associated adjacencies.
  3162.  
  3163.     The    following data items are associated with an interface.    Note
  3164.     that a number of these items are actually configuration for    the
  3165.     attached network; such items must be the same for all routers
  3166.     connected to the network.
  3167.  
  3168.     Type
  3169.     The OSPF interface type    is either point-to-point, broadcast,
  3170.     NBMA, Point-to-MultiPoint or virtual link.
  3171.  
  3172.     State
  3173.     The functional level of    an interface.  State determines    whether
  3174.     or not full adjacencies    are allowed to form over the interface.
  3175.     State is also reflected    in the router's    LSAs.
  3176.  
  3177.     IP interface address
  3178.     The IP address associated with the interface.  This appears as
  3179.     the IP source address in all routing protocol packets originated
  3180.     over this interface.  Interfaces to unnumbered point-to-point
  3181.     networks do not    have an    associated IP address.
  3182.  
  3183.     IP interface mask
  3184.     Also referred to as the    subnet mask, this indicates the    portion
  3185.     of the IP interface address that identifies the    attached
  3186.     network.  Masking the IP interface address with    the IP interface
  3187.     mask yields the    IP network number of the attached network.  On
  3188.     point-to-point networks    and virtual links, the IP interface mask
  3189.     is not defined.    On these networks, the link itself is not
  3190.     assigned an IP network number, and so the addresses of each side
  3191.     of the link are    assigned independently,    if they    are assigned at
  3192.     all.
  3193.  
  3194.     Area ID
  3195.     The Area ID of the area    to which the attached network belongs.
  3196.     All routing protocol packets originating from the interface are
  3197.     labelled with this Area    ID.
  3198.  
  3199.  
  3200.  
  3201. Moy                Standards Track               [Page 64]
  3202.  
  3203. RFC 2328             OSPF Version 2              April 1998
  3204.  
  3205.  
  3206.     HelloInterval
  3207.     The length of time, in seconds,    between    the Hello packets that
  3208.     the router sends on the    interface.  Advertised in Hello    packets
  3209.     sent out this interface.
  3210.  
  3211.     RouterDeadInterval
  3212.     The number of seconds before the router's neighbors will declare
  3213.     it down, when they stop    hearing    the router's Hello Packets.
  3214.     Advertised in Hello packets sent out this interface.
  3215.  
  3216.     InfTransDelay
  3217.     The estimated number of    seconds    it takes to transmit a Link
  3218.     State Update Packet over this interface.  LSAs contained in the
  3219.     Link State Update packet will have their age incremented by this
  3220.     amount before transmission.  This value    should take into account
  3221.     transmission and propagation delays; it    must be    greater    than
  3222.     zero.
  3223.  
  3224.     Router Priority
  3225.     An 8-bit unsigned integer.  When two routers attached to a
  3226.     network    both attempt to    become Designated Router, the one with
  3227.     the highest Router Priority takes precedence.  A router    whose
  3228.     Router Priority    is set to 0 is ineligible to become Designated
  3229.     Router on the attached network.     Advertised in Hello packets
  3230.     sent out this interface.
  3231.  
  3232.     Hello Timer
  3233.     An interval timer that causes the interface to send a Hello
  3234.     packet.     This timer fires every    HelloInterval seconds.    Note
  3235.     that on    non-broadcast networks a separate Hello    packet is sent
  3236.     to each    qualified neighbor.
  3237.  
  3238.     Wait Timer
  3239.     A single shot timer that causes    the interface to exit the
  3240.     Waiting    state, and as a    consequence select a Designated    Router
  3241.     on the network.     The length of the timer is RouterDeadInterval
  3242.     seconds.
  3243.  
  3244.     List of neighboring    routers
  3245.     The other routers attached to this network.  This list is formed
  3246.     by the Hello Protocol.    Adjacencies will be formed to some of
  3247.  
  3248.  
  3249.  
  3250.  
  3251. Moy                Standards Track               [Page 65]
  3252.  
  3253. RFC 2328             OSPF Version 2              April 1998
  3254.  
  3255.  
  3256.     these neighbors.  The set of adjacent neighbors    can be
  3257.     determined by an examination of    all of the neighbors' states.
  3258.  
  3259.     Designated Router
  3260.     The Designated Router selected for the attached    network.  The
  3261.     Designated Router is selected on all broadcast and NBMA    networks
  3262.     by the Hello Protocol.    Two pieces of identification are kept
  3263.     for the    Designated Router: its Router ID and its IP interface
  3264.     address    on the network.     The Designated    Router advertises link
  3265.     state for the network; this network-LSA    is labelled with the
  3266.     Designated Router's IP address.     The Designated    Router is
  3267.     initialized to 0.0.0.0,    which indicates    the lack of a Designated
  3268.     Router.
  3269.  
  3270.     Backup Designated Router
  3271.     The Backup Designated Router is    also selected on all broadcast
  3272.     and NBMA networks by the Hello Protocol.  All routers on the
  3273.     attached network become    adjacent to both the Designated    Router
  3274.     and the    Backup Designated Router.  The Backup Designated Router
  3275.     becomes    Designated Router when the current Designated Router
  3276.     fails.    The Backup Designated Router is    initialized to 0.0.0.0,
  3277.     indicating the lack of a Backup    Designated Router.
  3278.  
  3279.     Interface output cost(s)
  3280.     The cost of sending a data packet on the interface, expressed in
  3281.     the link state metric.    This is    advertised as the link cost for
  3282.     this interface in the router-LSA. The cost of an interface must
  3283.     be greater than    zero.
  3284.  
  3285.     RxmtInterval
  3286.     The number of seconds between LSA retransmissions, for
  3287.     adjacencies belonging to this interface.  Also used when
  3288.     retransmitting Database    Description and    Link State Request
  3289.     Packets.
  3290.  
  3291.     AuType
  3292.     The type of authentication used    on the attached    network/subnet.
  3293.     Authentication types are defined in Appendix D.     All OSPF packet
  3294.     exchanges are authenticated.  Different    authentication schemes
  3295.     may be used on different networks/subnets.
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301. Moy                Standards Track               [Page 66]
  3302.  
  3303. RFC 2328             OSPF Version 2              April 1998
  3304.  
  3305.  
  3306.     Authentication key
  3307.     This configured    data allows the    authentication procedure to
  3308.     generate and/or    verify OSPF protocol packets.  The
  3309.     Authentication key can be configured on    a per-interface    basis.
  3310.     For example, if    the AuType indicates simple password, the
  3311.     Authentication key would be a 64-bit clear password which is
  3312.     inserted into the OSPF packet header. If instead Autype
  3313.     indicates Cryptographic    authentication,    then the Authentication
  3314.     key is a shared    secret which enables the generation/verification
  3315.     of message digests which are appended to the OSPF protocol
  3316.     packets. When Cryptographic authentication is used, multiple
  3317.     simultaneous keys are supported    in order to achieve smooth key
  3318.     transition (see    Section    D.3).
  3319.  
  3320.  
  3321.     9.1.  Interface states
  3322.  
  3323.     The various states that    router interfaces may attain is
  3324.     documented in this section.  The states    are listed in order of
  3325.     progressing functionality.  For    example, the inoperative state
  3326.     is listed first, followed by a list of intermediate states
  3327.     before the final, fully    functional state is achieved.  The
  3328.     specification makes use    of this    ordering by sometimes making
  3329.     references such    as "those interfaces in    state greater than X".
  3330.     Figure 11 shows    the graph of interface state changes.  The arcs
  3331.     of the graph are labelled with the event causing the state
  3332.     change.     These events are documented in    Section    9.2.  The
  3333.     interface state    machine    is described in    more detail in Section
  3334.     9.3.
  3335.  
  3336.  
  3337.     Down
  3338.         This is the    initial    interface state.  In this state, the
  3339.         lower-level    protocols have indicated that the interface is
  3340.         unusable.  No protocol traffic at all will be sent or
  3341.         received on    such a interface.  In this state, interface
  3342.         parameters should be set to    their initial values.  All
  3343.         interface timers should be disabled, and there should be no
  3344.         adjacencies    associated with    the interface.
  3345.  
  3346.     Loopback
  3347.         In this state, the router's    interface to the network is
  3348.  
  3349.  
  3350.  
  3351. Moy                Standards Track               [Page 67]
  3352.  
  3353. RFC 2328             OSPF Version 2              April 1998
  3354.  
  3355.  
  3356.  
  3357.                   +----+   UnloopInd   +--------+
  3358.                   |Down|<--------------|Loopback|
  3359.                   +----+           +--------+
  3360.                      |
  3361.                      |InterfaceUp
  3362.               +-------+  |             +--------------+
  3363.               |Waiting|<-+-------------->|Point-to-point|
  3364.               +-------+             +--------------+
  3365.                   |
  3366.              WaitTimer|BackupSeen
  3367.                   |
  3368.                   |
  3369.                   |      NeighborChange
  3370.       +------+         +-+<---------------- +-------+
  3371.       |Backup|<----------|?|----------------->|DROther|
  3372.       +------+---------->+-+<-----+          +-------+
  3373.             Neighbor  |          |
  3374.             Change    |          |Neighbor
  3375.                   |          |Change
  3376.                   |        +--+
  3377.                   +---->|DR|
  3378.                     +--+
  3379.  
  3380.               Figure 11: Interface State changes
  3381.  
  3382.          In addition to    the state transitions pictured,
  3383.          Event InterfaceDown always forces Down    State, and
  3384.          Event LoopInd always forces Loopback State
  3385.  
  3386.  
  3387.         looped back.  The interface    may be looped back in hardware
  3388.         or software.  The interface    will be    unavailable for    regular
  3389.         data traffic.  However, it may still be desirable to gain
  3390.         information    on the quality of this interface, either through
  3391.         sending ICMP pings to the interface    or through something
  3392.         like a bit error test.  For    this reason, IP    packets    may
  3393.         still be addressed to an interface in Loopback state.  To
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401. Moy                Standards Track               [Page 68]
  3402.  
  3403. RFC 2328             OSPF Version 2              April 1998
  3404.  
  3405.  
  3406.         facilitate this, such interfaces are advertised in router-
  3407.         LSAs as single host    routes,    whose destination is the IP
  3408.         interface address.[4]
  3409.  
  3410.     Waiting
  3411.         In this state, the router is trying    to determine the
  3412.         identity of    the (Backup) Designated    Router for the network.
  3413.         To do this,    the router monitors the    Hello Packets it
  3414.         receives.  The router is not allowed to elect a Backup
  3415.         Designated Router nor a Designated Router until it
  3416.         transitions    out of Waiting state.  This prevents unnecessary
  3417.         changes of (Backup)    Designated Router.
  3418.  
  3419.     Point-to-point
  3420.         In this state, the interface is operational, and connects
  3421.         either to a    physical point-to-point    network    or to a    virtual
  3422.         link.  Upon    entering this state, the router    attempts to form
  3423.         an adjacency with the neighboring router.  Hello Packets are
  3424.         sent to the    neighbor every HelloInterval seconds.
  3425.  
  3426.     DR Other
  3427.         The    interface is to    a broadcast or NBMA network on which
  3428.         another router has been selected to    be the Designated
  3429.         Router.  In    this state, the    router itself has not been
  3430.         selected Backup Designated Router either.  The router forms
  3431.         adjacencies    to both    the Designated Router and the Backup
  3432.         Designated Router (if they exist).
  3433.  
  3434.     Backup
  3435.         In this state, the router itself is    the Backup Designated
  3436.         Router on the attached network.  It    will be    promoted to
  3437.         Designated Router when the present Designated Router fails.
  3438.         The    router establishes adjacencies to all other routers
  3439.         attached to    the network.  The Backup Designated Router
  3440.         performs slightly different    functions during the Flooding
  3441.         Procedure, as compared to the Designated Router (see Section
  3442.         13.3).  See    Section    7.4 for    more details on    the functions
  3443.         performed by the Backup Designated Router.
  3444.  
  3445.     DR  In this state, this    router itself is the Designated    Router
  3446.         on the attached network.  Adjacencies are established to all
  3447.         other routers attached to the network.  The    router must also
  3448.  
  3449.  
  3450.  
  3451. Moy                Standards Track               [Page 69]
  3452.  
  3453. RFC 2328             OSPF Version 2              April 1998
  3454.  
  3455.  
  3456.         originate a    network-LSA for    the network node.  The network-
  3457.         LSA    will contain links to all routers (including the
  3458.         Designated Router itself) attached to the network.    See
  3459.         Section 7.3    for more details on the    functions performed by
  3460.         the    Designated Router.
  3461.  
  3462.  
  3463.     9.2.  Events causing interface state changes
  3464.  
  3465.     State changes can be effected by a number of events.  These
  3466.     events are pictured as the labelled arcs in Figure 11.    The
  3467.     label definitions are listed below.  For a detailed explanation
  3468.     of the effect of these events on OSPF protocol operation,
  3469.     consult    Section    9.3.
  3470.  
  3471.  
  3472.     InterfaceUp
  3473.         Lower-level    protocols have indicated that the network
  3474.         interface is operational.  This enables the    interface to
  3475.         transition out of Down state.  On virtual links, the
  3476.         interface operational indication is    actually a result of the
  3477.         shortest path calculation (see Section 16.7).
  3478.  
  3479.     WaitTimer
  3480.         The    Wait Timer has fired, indicating the end of the    waiting
  3481.         period that    is required before electing a (Backup)
  3482.         Designated Router.
  3483.  
  3484.     BackupSeen
  3485.         The    router has detected the    existence or non-existence of a
  3486.         Backup Designated Router for the network.  This is done in
  3487.         one    of two ways.  First, an    Hello Packet may be received
  3488.         from a neighbor claiming to    be itself the Backup Designated
  3489.         Router.  Alternatively, an Hello Packet may    be received from
  3490.         a neighbor claiming    to be itself the Designated Router, and
  3491.         indicating that there is no    Backup Designated Router.  In
  3492.         either case    there must be bidirectional communication with
  3493.         the    neighbor, i.e.,    the router must    also appear in the
  3494.         neighbor's Hello Packet.  This event signals an end    to the
  3495.         Waiting state.
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501. Moy                Standards Track               [Page 70]
  3502.  
  3503. RFC 2328             OSPF Version 2              April 1998
  3504.  
  3505.  
  3506.     NeighborChange
  3507.         There has been a change in the set of bidirectional
  3508.         neighbors associated with the interface.  The (Backup)
  3509.         Designated Router needs to be recalculated.     The following
  3510.         neighbor changes lead to the NeighborChange    event.    For an
  3511.         explanation    of neighbor states, see    Section    10.1.
  3512.  
  3513.         o    Bidirectional communication has    been established to a
  3514.         neighbor.  In other words, the state of    the neighbor has
  3515.         transitioned to    2-Way or higher.
  3516.  
  3517.         o    There is no longer bidirectional communication with a
  3518.         neighbor.  In other words, the state of    the neighbor has
  3519.         transitioned to    Init or    lower.
  3520.  
  3521.         o    One of the bidirectional neighbors is newly declaring
  3522.         itself as either Designated Router or Backup Designated
  3523.         Router.     This is detected through examination of that
  3524.         neighbor's Hello Packets.
  3525.  
  3526.         o    One of the bidirectional neighbors is no longer
  3527.         declaring itself as Designated Router, or is no    longer
  3528.         declaring itself as Backup Designated Router.  This is
  3529.         again detected through examination of that neighbor's
  3530.         Hello Packets.
  3531.  
  3532.         o    The advertised Router Priority for a bidirectional
  3533.         neighbor has changed.  This is again detected through
  3534.         examination of that neighbor's Hello Packets.
  3535.  
  3536.     LoopInd
  3537.         An indication has been received that the interface is now
  3538.         looped back    to itself.  This indication can    be received
  3539.         either from    network    management or from the lower level
  3540.         protocols.
  3541.  
  3542.     UnloopInd
  3543.         An indication has been received that the interface is no
  3544.         longer looped back.     As with the LoopInd event, this
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551. Moy                Standards Track               [Page 71]
  3552.  
  3553. RFC 2328             OSPF Version 2              April 1998
  3554.  
  3555.  
  3556.         indication can be received either from network management or
  3557.         from the lower level protocols.
  3558.  
  3559.     InterfaceDown
  3560.         Lower-level    protocols indicate that    this interface is no
  3561.         longer functional.    No matter what the current interface
  3562.         state is, the new interface    state will be Down.
  3563.  
  3564.     9.3.  The Interface    state machine
  3565.  
  3566.     A detailed description of the interface    state changes follows.
  3567.     Each state change is invoked by    an event (Section 9.2).     This
  3568.     event may produce different effects, depending on the current
  3569.     state of the interface.     For this reason, the state machine
  3570.     below is organized by current interface    state and received
  3571.     event.    Each entry in the state    machine    describes the resulting
  3572.     new interface state and    the required set of additional actions.
  3573.  
  3574.     When an    interface's state changes, it may be necessary to
  3575.     originate a new    router-LSA.  See Section 12.4 for more details.
  3576.  
  3577.     Some of    the required actions below involve generating events for
  3578.     the neighbor state machine.  For example, when an interface
  3579.     becomes    inoperative, all neighbor connections associated with
  3580.     the interface must be destroyed.  For more information on the
  3581.     neighbor state machine,    see Section 10.3.
  3582.  
  3583.  
  3584.      State(s):  Down
  3585.  
  3586.         Event:  InterfaceUp
  3587.  
  3588.     New state:  Depends upon action    routine
  3589.  
  3590.        Action:  Start the interval Hello Timer, enabling the
  3591.             periodic sending of    Hello packets out the interface.
  3592.             If the attached network is a physical point-to-point
  3593.             network, Point-to-MultiPoint network or virtual
  3594.             link, the interface    state transitions to Point-to-
  3595.             Point.  Else, if the router    is not eligible    to
  3596.             become Designated Router the interface state
  3597.             transitions    to DR Other.
  3598.  
  3599.  
  3600.  
  3601. Moy                Standards Track               [Page 72]
  3602.  
  3603. RFC 2328             OSPF Version 2              April 1998
  3604.  
  3605.  
  3606.             Otherwise, the attached network is a broadcast or
  3607.             NBMA network and the router    is eligible to become
  3608.             Designated Router.    In this    case, in an attempt to
  3609.             discover the attached network's Designated Router
  3610.             the    interface state    is set to Waiting and the single
  3611.             shot Wait Timer is started.     Additionally, if the
  3612.             network is an NBMA network examine the configured
  3613.             list of neighbors for this interface and generate
  3614.             the    neighbor event Start for each neighbor that is
  3615.             also eligible to become Designated Router.
  3616.  
  3617.  
  3618.      State(s):  Waiting
  3619.  
  3620.         Event:  BackupSeen
  3621.  
  3622.     New state:  Depends upon action    routine.
  3623.  
  3624.        Action:  Calculate the attached network's Backup Designated
  3625.             Router and Designated Router, as shown in Section
  3626.             9.4.  As a result of this calculation, the new state
  3627.             of the interface will be either DR Other, Backup or
  3628.             DR.
  3629.  
  3630.  
  3631.      State(s):  Waiting
  3632.  
  3633.         Event:  WaitTimer
  3634.  
  3635.     New state:  Depends upon action    routine.
  3636.  
  3637.        Action:  Calculate the attached network's Backup Designated
  3638.             Router and Designated Router, as shown in Section
  3639.             9.4.  As a result of this calculation, the new state
  3640.             of the interface will be either DR Other, Backup or
  3641.             DR.
  3642.  
  3643.  
  3644.      State(s):  DR Other, Backup or    DR
  3645.  
  3646.         Event:  NeighborChange
  3647.  
  3648.  
  3649.  
  3650.  
  3651. Moy                Standards Track               [Page 73]
  3652.  
  3653. RFC 2328             OSPF Version 2              April 1998
  3654.  
  3655.  
  3656.     New state:  Depends upon action    routine.
  3657.  
  3658.        Action:  Recalculate    the attached network's Backup Designated
  3659.             Router and Designated Router, as shown in Section
  3660.             9.4.  As a result of this calculation, the new state
  3661.             of the interface will be either DR Other, Backup or
  3662.             DR.
  3663.  
  3664.  
  3665.      State(s):  Any    State
  3666.  
  3667.         Event:  InterfaceDown
  3668.  
  3669.     New state:  Down
  3670.  
  3671.        Action:  All    interface variables are    reset, and interface
  3672.             timers disabled.  Also, all    neighbor connections
  3673.             associated with the    interface are destroyed.  This
  3674.             is done by generating the event KillNbr on all
  3675.             associated neighbors (see Section 10.2).
  3676.  
  3677.  
  3678.      State(s):  Any    State
  3679.  
  3680.         Event:  LoopInd
  3681.  
  3682.     New state:  Loopback
  3683.  
  3684.        Action:  Since this interface is no longer connected    to the
  3685.             attached network the actions associated with the
  3686.             above InterfaceDown    event are executed.
  3687.  
  3688.  
  3689.      State(s):  Loopback
  3690.  
  3691.         Event:  UnloopInd
  3692.  
  3693.     New state:  Down
  3694.  
  3695.        Action:  No actions are necessary.  For example, the
  3696.             interface variables    have already been reset    upon
  3697.             entering the Loopback state.  Note that reception of
  3698.  
  3699.  
  3700.  
  3701. Moy                Standards Track               [Page 74]
  3702.  
  3703. RFC 2328             OSPF Version 2              April 1998
  3704.  
  3705.  
  3706.             an InterfaceUp event is necessary before the
  3707.             interface again becomes fully functional.
  3708.  
  3709.  
  3710.     9.4.  Electing the Designated Router
  3711.  
  3712.     This section describes the algorithm used for calculating a
  3713.     network's Designated Router and    Backup Designated Router.  This
  3714.     algorithm is invoked by    the Interface state machine.  The
  3715.     initial    time a router runs the election    algorithm for a    network,
  3716.     the network's Designated Router    and Backup Designated Router are
  3717.     initialized to 0.0.0.0.     This indicates    the lack of both a
  3718.     Designated Router and a    Backup Designated Router.
  3719.  
  3720.     The Designated Router election algorithm proceeds as follows:
  3721.     Call the router    doing the calculation Router X.     The list of
  3722.     neighbors attached to the network and having established
  3723.     bidirectional communication with Router    X is examined.    This
  3724.     list is    precisely the collection of Router X's neighbors (on
  3725.     this network) whose state is greater than or equal to 2-Way (see
  3726.     Section    10.1).    Router X itself    is also    considered to be on the
  3727.     list.  Discard all routers from    the list that are ineligible to
  3728.     become Designated Router.  (Routers having Router Priority of 0
  3729.     are ineligible to become Designated Router.)  The following
  3730.     steps are then executed, considering only those    routers    that
  3731.     remain on the list:
  3732.  
  3733.     (1) Note the current values for    the network's Designated Router
  3734.         and    Backup Designated Router.  This    is used    later for
  3735.         comparison purposes.
  3736.  
  3737.     (2) Calculate the new Backup Designated    Router for the network
  3738.         as follows.     Only those routers on the list    that have not
  3739.         declared themselves    to be Designated Router    are eligible to
  3740.         become Backup Designated Router.  If one or    more of    these
  3741.         routers have declared themselves Backup Designated Router
  3742.         (i.e., they    are currently listing themselves as Backup
  3743.         Designated Router, but not as Designated Router, in    their
  3744.         Hello Packets) the one having highest Router Priority is
  3745.         declared to    be Backup Designated Router.  In case of a tie,
  3746.         the    one having the highest Router ID is chosen.  If    no
  3747.         routers have declared themselves Backup Designated Router,
  3748.  
  3749.  
  3750.  
  3751. Moy                Standards Track               [Page 75]
  3752.  
  3753. RFC 2328             OSPF Version 2              April 1998
  3754.  
  3755.  
  3756.         choose the router having highest Router Priority, (again
  3757.         excluding those routers who    have declared themselves
  3758.         Designated Router),    and again use the Router ID to break
  3759.         ties.
  3760.  
  3761.     (3) Calculate the new Designated Router    for the    network    as
  3762.         follows.  If one or    more of    the routers have declared
  3763.         themselves Designated Router (i.e.,    they are currently
  3764.         listing themselves as Designated Router in their Hello
  3765.         Packets) the one having highest Router Priority is declared
  3766.         to be Designated Router.  In case of a tie,    the one    having
  3767.         the    highest    Router ID is chosen.  If no routers have
  3768.         declared themselves    Designated Router, assign the Designated
  3769.         Router to be the same as the newly elected Backup Designated
  3770.         Router.
  3771.  
  3772.     (4) If Router X    is now newly the Designated Router or newly the
  3773.         Backup Designated Router, or is now    no longer the Designated
  3774.         Router or no longer    the Backup Designated Router, repeat
  3775.         steps 2 and    3, and then proceed to step 5.    For example, if
  3776.         Router X is    now the    Designated Router, when    step 2 is
  3777.         repeated X will no longer be eligible for Backup Designated
  3778.         Router election.  Among other things, this will ensure that
  3779.         no router will declare itself both Backup Designated Router
  3780.         and    Designated Router.[5]
  3781.  
  3782.     (5) As a result    of these calculations, the router itself may now
  3783.         be Designated Router or Backup Designated Router.  See
  3784.         Sections 7.3 and 7.4 for the additional duties this    would
  3785.         entail.  The router's interface state should be set
  3786.         accordingly.  If the router    itself is now Designated Router,
  3787.         the    new interface state is DR.  If the router itself is now
  3788.         Backup Designated Router, the new interface    state is Backup.
  3789.         Otherwise, the new interface state is DR Other.
  3790.  
  3791.     (6) If the attached network is an NBMA network,    and the    router
  3792.         itself has just become either Designated Router or Backup
  3793.         Designated Router, it must start sending Hello Packets to
  3794.         those neighbors that are not eligible to become Designated
  3795.         Router (see    Section    9.5.1).     This is done by invoking the
  3796.         neighbor event Start for each neighbor having a Router
  3797.         Priority of    0.
  3798.  
  3799.  
  3800.  
  3801. Moy                Standards Track               [Page 76]
  3802.  
  3803. RFC 2328             OSPF Version 2              April 1998
  3804.  
  3805.  
  3806.     (7) If the above calculations have caused the identity of either
  3807.         the    Designated Router or Backup Designated Router to change,
  3808.         the    set of adjacencies associated with this    interface will
  3809.         need to be modified.  Some adjacencies may need to be
  3810.         formed, and    others may need    to be broken.  To accomplish
  3811.         this, invoke the event AdjOK?  on all neighbors whose state
  3812.         is at least    2-Way.    This will cause    their eligibility for
  3813.         adjacency to be reexamined (see Sections 10.3 and 10.4).
  3814.  
  3815.  
  3816.     The reason behind the election algorithm's complexity is the
  3817.     desire for an orderly transition from Backup Designated    Router
  3818.     to Designated Router, when the current Designated Router fails.
  3819.     This orderly transition    is ensured through the introduction of
  3820.     hysteresis: no new Backup Designated Router can    be chosen until
  3821.     the old    Backup accepts its new Designated Router
  3822.     responsibilities.
  3823.  
  3824.     The above procedure may    elect the same router to be both
  3825.     Designated Router and Backup Designated    Router,    although that
  3826.     router will never be the calculating router (Router X) itself.
  3827.     The elected Designated Router may not be the router having the
  3828.     highest    Router Priority, nor will the Backup Designated    Router
  3829.     necessarily have the second highest Router Priority.  If Router
  3830.     X is not itself    eligible to become Designated Router, it is
  3831.     possible that neither a    Backup Designated Router nor a
  3832.     Designated Router will be selected in the above    procedure.  Note
  3833.     also that if Router X is the only attached router that is
  3834.     eligible to become Designated Router, it will select itself as
  3835.     Designated Router and there will be no Backup Designated Router
  3836.     for the    network.
  3837.  
  3838.  
  3839.     9.5.  Sending Hello    packets
  3840.  
  3841.     Hello packets are sent out each    functioning router interface.
  3842.     They are used to discover and maintain neighbor
  3843.     relationships.[6] On broadcast and NBMA    networks, Hello    Packets
  3844.     are also used to elect the Designated Router and Backup
  3845.     Designated Router.
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851. Moy                Standards Track               [Page 77]
  3852.  
  3853. RFC 2328             OSPF Version 2              April 1998
  3854.  
  3855.  
  3856.     The format of an Hello packet is detailed in Section A.3.2.  The
  3857.     Hello Packet contains the router's Router Priority (used in
  3858.     choosing the Designated    Router), and the interval between Hello
  3859.     Packets    sent out the interface (HelloInterval).     The Hello
  3860.     Packet also indicates how often    a neighbor must    be heard from to
  3861.     remain active (RouterDeadInterval).  Both HelloInterval    and
  3862.     RouterDeadInterval must    be the same for    all routers attached to
  3863.     a common network.  The Hello packet also contains the IP address
  3864.     mask of    the attached network (Network Mask).  On unnumbered
  3865.     point-to-point networks    and on virtual links this field    should
  3866.     be set to 0.0.0.0.
  3867.  
  3868.     The Hello packet's Options field describes the router's    optional
  3869.     OSPF capabilities.  One    optional capability is defined in this
  3870.     specification (see Sections 4.5    and A.2).  The E-bit of    the
  3871.     Options    field should be    set if and only    if the attached    area is
  3872.     capable    of processing AS-external-LSAs (i.e., it is not    a stub
  3873.     area).    If the E-bit is    set incorrectly    the neighboring    routers
  3874.     will refuse to accept the Hello    Packet (see Section 10.5).
  3875.     Unrecognized bits in the Hello Packet's    Options    field should be
  3876.     set to zero.
  3877.  
  3878.     In order to ensure two-way communication between adjacent
  3879.     routers, the Hello packet contains the list of all routers on
  3880.     the network from which Hello Packets have been seen recently.
  3881.     The Hello packet also contains the router's current choice for
  3882.     Designated Router and Backup Designated    Router.     A value of
  3883.     0.0.0.0    in these fields    means that one has not yet been
  3884.     selected.
  3885.  
  3886.     On broadcast networks and physical point-to-point networks,
  3887.     Hello packets are sent every HelloInterval seconds to the IP
  3888.     multicast address AllSPFRouters.  On virtual links, Hello
  3889.     packets    are sent as unicasts (addressed    directly to the    other
  3890.     end of the virtual link) every HelloInterval seconds. On Point-
  3891.     to-MultiPoint networks,    separate Hello packets are sent    to each
  3892.     attached neighbor every    HelloInterval seconds. Sending of Hello
  3893.     packets    on NBMA    networks is covered in the next    section.
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901. Moy                Standards Track               [Page 78]
  3902.  
  3903. RFC 2328             OSPF Version 2              April 1998
  3904.  
  3905.  
  3906.     9.5.1.    Sending    Hello packets on NBMA networks
  3907.  
  3908.         Static configuration information may be necessary in order
  3909.         for    the Hello Protocol to function on non-broadcast    networks
  3910.         (see Sections C.5 and C.6).     On NBMA networks, every
  3911.         attached router which is eligible to become    Designated
  3912.         Router becomes aware of all    of its neighbors on the    network
  3913.         (either through configuration or by    some unspecified
  3914.         mechanism).     Each neighbor is labelled with    the neighbor's
  3915.         Designated Router eligibility.
  3916.  
  3917.         The    interface state    must be    at least Waiting for any Hello
  3918.         Packets to be sent out the NBMA interface.    Hello Packets
  3919.         are    then sent directly (as unicasts) to some subset    of a
  3920.         router's neighbors.     Sometimes an Hello Packet is sent
  3921.         periodically on a timer; at    other times it is sent as a
  3922.         response to    a received Hello Packet.  A router's hello-
  3923.         sending behavior varies depending on whether the router
  3924.         itself is eligible to become Designated Router.
  3925.  
  3926.         If the router is eligible to become    Designated Router, it
  3927.         must periodically send Hello Packets to all    neighbors that
  3928.         are    also eligible.    In addition, if    the router is itself the
  3929.         Designated Router or Backup    Designated Router, it must also
  3930.         send periodic Hello    Packets    to all other neighbors.     This
  3931.         means that any two eligible    routers    are always exchanging
  3932.         Hello Packets, which is necessary for the correct operation
  3933.         of the Designated Router election algorithm.  To minimize
  3934.         the    number of Hello    Packets    sent, the number of eligible
  3935.         routers on an NBMA network should be kept small.
  3936.  
  3937.         If the router is not eligible to become Designated Router,
  3938.         it must periodically send Hello Packets to both the
  3939.         Designated Router and the Backup Designated    Router (if they
  3940.         exist).  It    must also send an Hello    Packet in reply    to an
  3941.         Hello Packet received from any eligible neighbor (other than
  3942.         the    current    Designated Router and Backup Designated    Router).
  3943.         This is needed to establish    an initial bidirectional
  3944.         relationship with any potential Designated Router.
  3945.  
  3946.         When sending Hello packets periodically to any neighbor, the
  3947.         interval between Hello Packets is determined by the
  3948.  
  3949.  
  3950.  
  3951. Moy                Standards Track               [Page 79]
  3952.  
  3953. RFC 2328             OSPF Version 2              April 1998
  3954.  
  3955.  
  3956.         neighbor's state.  If the neighbor is in state Down, Hello
  3957.         Packets are    sent every PollInterval    seconds.  Otherwise,
  3958.         Hello Packets are sent every HelloInterval seconds.
  3959.  
  3960.  
  3961. 10.  The Neighbor Data Structure
  3962.  
  3963.     An OSPF router converses with its neighboring routers.  Each
  3964.     separate conversation is described by a "neighbor data structure".
  3965.     Each conversation is bound to a particular OSPF router interface,
  3966.     and    is identified either by    the neighboring    router's OSPF Router ID
  3967.     or by its Neighbor IP address (see below).    Thus if    the OSPF router
  3968.     and    another    router have multiple attached networks in common,
  3969.     multiple conversations ensue, each described by a unique neighbor
  3970.     data structure.  Each separate conversation    is loosely referred to
  3971.     in the text    as being a separate "neighbor".
  3972.  
  3973.     The    neighbor data structure    contains all information pertinent to
  3974.     the    forming    or formed adjacency between the    two neighbors.
  3975.     (However, remember that not    all neighbors become adjacent.)     An
  3976.     adjacency can be viewed as a highly    developed conversation between
  3977.     two    routers.
  3978.  
  3979.  
  3980.     State
  3981.     The functional level of    the neighbor conversation.  This is
  3982.     described in more detail in Section 10.1.
  3983.  
  3984.     Inactivity Timer
  3985.     A single shot timer whose firing indicates that    no Hello Packet
  3986.     has been seen from this    neighbor recently.  The    length of the
  3987.     timer is RouterDeadInterval seconds.
  3988.  
  3989.     Master/Slave
  3990.     When the two neighbors are exchanging databases, they form a
  3991.     master/slave relationship.  The    master sends the first Database
  3992.     Description Packet, and    is the only part that is allowed to
  3993.     retransmit.  The slave can only    respond    to the master's    Database
  3994.     Description Packets.  The master/slave relationship is
  3995.     negotiated in state ExStart.
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001. Moy                Standards Track               [Page 80]
  4002.  
  4003. RFC 2328             OSPF Version 2              April 1998
  4004.  
  4005.  
  4006.     DD Sequence    Number
  4007.     The DD Sequence    number of the Database Description packet that
  4008.     is currently being sent    to the neighbor.
  4009.  
  4010.     Last received Database Description packet
  4011.     The initialize(I), more    (M) and    master(MS) bits, Options field,
  4012.     and DD sequence    number contained in the    last Database
  4013.     Description packet received from the neighbor. Used to determine
  4014.     whether    the next Database Description packet received from the
  4015.     neighbor is a duplicate.
  4016.  
  4017.     Neighbor ID
  4018.     The OSPF Router    ID of the neighboring router.  The Neighbor ID
  4019.     is learned when    Hello packets are received from    the neighbor, or
  4020.     is configured if this is a virtual adjacency (see Section C.4).
  4021.  
  4022.     Neighbor Priority
  4023.     The Router Priority of the neighboring router.    Contained in the
  4024.     neighbor's Hello packets, this item is used when selecting the
  4025.     Designated Router for the attached network.
  4026.  
  4027.     Neighbor IP    address
  4028.     The IP address of the neighboring router's interface to    the
  4029.     attached network.  Used    as the Destination IP address when
  4030.     protocol packets are sent as unicasts along this adjacency.
  4031.     Also used in router-LSAs as the    Link ID    for the    attached network
  4032.     if the neighboring router is selected to be Designated Router
  4033.     (see Section 12.4.1).  The Neighbor IP address is learned when
  4034.     Hello packets are received from    the neighbor.  For virtual
  4035.     links, the Neighbor IP address is learned during the routing
  4036.     table build process (see Section 15).
  4037.  
  4038.     Neighbor Options
  4039.     The optional OSPF capabilities supported by the    neighbor.
  4040.     Learned    during the Database Exchange process (see Section 10.6).
  4041.     The neighbor's optional    OSPF capabilities are also listed in its
  4042.     Hello packets.    This enables received Hello Packets to be
  4043.     rejected (i.e.,    neighbor relationships will not    even start to
  4044.     form) if there is a mismatch in    certain    crucial    OSPF
  4045.     capabilities (see Section 10.5).  The optional OSPF capabilities
  4046.     are documented in Section 4.5.
  4047.  
  4048.  
  4049.  
  4050.  
  4051. Moy                Standards Track               [Page 81]
  4052.  
  4053. RFC 2328             OSPF Version 2              April 1998
  4054.  
  4055.  
  4056.     Neighbor's Designated Router
  4057.     The neighbor's idea of the Designated Router.  If this is the
  4058.     neighbor itself, this is important in the local    calculation of
  4059.     the Designated Router.    Defined    only on    broadcast and NBMA
  4060.     networks.
  4061.  
  4062.     Neighbor's Backup Designated Router
  4063.     The neighbor's idea of the Backup Designated Router.  If this is
  4064.     the neighbor itself, this is important in the local calculation
  4065.     of the Backup Designated Router.  Defined only on broadcast and
  4066.     NBMA networks.
  4067.  
  4068.  
  4069.     The    next set of variables are lists    of LSAs.  These    lists describe
  4070.     subsets of the area    link-state database.  This memo    defines    five
  4071.     distinct types of LSAs, all    of which may be    present    in an area
  4072.     link-state database: router-LSAs, network-LSAs, and    Type 3 and 4
  4073.     summary-LSAs (all stored in    the area data structure), and AS-
  4074.     external-LSAs (stored in the global    data structure).
  4075.  
  4076.  
  4077.     Link state retransmission list
  4078.     The list of LSAs that have been    flooded    but not    acknowledged on
  4079.     this adjacency.     These will be retransmitted at    intervals until
  4080.     they are acknowledged, or until    the adjacency is destroyed.
  4081.  
  4082.     Database summary list
  4083.     The complete list of LSAs that make up the area    link-state
  4084.     database, at the moment    the neighbor goes into Database    Exchange
  4085.     state.    This list is sent to the neighbor in Database
  4086.     Description packets.
  4087.  
  4088.     Link state request list
  4089.     The list of LSAs that need to be received from this neighbor in
  4090.     order to synchronize the two neighbors'    link-state databases.
  4091.     This list is created as    Database Description packets are
  4092.     received, and is then sent to the neighbor in Link State Request
  4093.     packets.  The list is depleted as appropriate Link State Update
  4094.     packets    are received.
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101. Moy                Standards Track               [Page 82]
  4102.  
  4103. RFC 2328             OSPF Version 2              April 1998
  4104.  
  4105.  
  4106.     10.1.  Neighbor states
  4107.  
  4108.     The state of a neighbor    (really, the state of a    conversation
  4109.     being held with    a neighboring router) is documented in the
  4110.     following sections.  The states    are listed in order of
  4111.     progressing functionality.  For    example, the inoperative state
  4112.     is listed first, followed by a list of intermediate states
  4113.     before the final, fully    functional state is achieved.  The
  4114.     specification makes use    of this    ordering by sometimes making
  4115.     references such    as "those neighbors/adjacencies    in state greater
  4116.     than X".  Figures 12 and 13 show the graph of neighbor state
  4117.     changes.  The arcs of the graphs are labelled with the event
  4118.     causing    the state change.  The neighbor    events are documented in
  4119.     Section    10.2.
  4120.  
  4121.     The graph in Figure 12 shows the state changes effected    by the
  4122.     Hello Protocol.     The Hello Protocol is responsible for neighbor
  4123.     acquisition and    maintenance, and for ensuring two way
  4124.     communication between neighbors.
  4125.  
  4126.     The graph in Figure 13 shows the forming of an adjacency.  Not
  4127.     every two neighboring routers become adjacent (see Section
  4128.     10.4).    The adjacency starts to    form when the neighbor is in
  4129.     state ExStart.    After the two routers discover their
  4130.     master/slave status, the state transitions to Exchange.     At this
  4131.     point the neighbor starts to be    used in    the flooding procedure,
  4132.     and the    two neighboring    routers    begin synchronizing their
  4133.     databases.  When this synchronization is finished, the neighbor
  4134.     is in state Full and we    say that the two routers are fully
  4135.     adjacent.  At this point the adjacency is listed in LSAs.
  4136.  
  4137.     For a more detailed description    of neighbor state changes,
  4138.     together with the additional actions involved in each change,
  4139.     see Section 10.3.
  4140.  
  4141.  
  4142.     Down
  4143.         This is the    initial    state of a neighbor conversation.  It
  4144.         indicates that there has been no recent information    received
  4145.         from the neighbor.    On NBMA    networks, Hello    packets    may
  4146.         still be sent to "Down" neighbors, although    at a reduced
  4147.         frequency (see Section 9.5.1).
  4148.  
  4149.  
  4150.  
  4151. Moy                Standards Track               [Page 83]
  4152.  
  4153. RFC 2328             OSPF Version 2              April 1998
  4154.  
  4155.  
  4156.  
  4157.                    +----+
  4158.                    |Down|
  4159.                    +----+
  4160.                      |\
  4161.                      | \Start
  4162.                      |    \      +-------+
  4163.                  Hello   |     +---->|Attempt|
  4164.                 Received |           +-------+
  4165.                      |           |
  4166.                  +----+<-+           |HelloReceived
  4167.                  |Init|<---------------+
  4168.                  +----+<--------+
  4169.                 |        |
  4170.                 |2-Way        |1-Way
  4171.                 |Received   |Received
  4172.                 |        |
  4173.           +-------+        |     +-----+
  4174.           |ExStart|<--------+------->|2-Way|
  4175.           +-------+             +-----+
  4176.  
  4177.           Figure 12: Neighbor state    changes    (Hello Protocol)
  4178.  
  4179.           In addition to the state transitions pictured,
  4180.           Event    KillNbr    always forces Down State,
  4181.           Event    InactivityTimer    always forces Down State,
  4182.           Event    LLDown always forces Down State
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201. Moy                Standards Track               [Page 84]
  4202.  
  4203. RFC 2328             OSPF Version 2              April 1998
  4204.  
  4205.  
  4206.                   +-------+
  4207.                   |ExStart|
  4208.                   +-------+
  4209.                     |
  4210.              NegotiationDone|
  4211.                     +->+--------+
  4212.                        |Exchange|
  4213.                     +--+--------+
  4214.                     |
  4215.                 Exchange|
  4216.                   Done  |
  4217.             +----+        |       +-------+
  4218.             |Full|<---------+----->|Loading|
  4219.             +----+<-+           +-------+
  4220.                 |  LoadingDone     |
  4221.                 +------------------+
  4222.  
  4223.         Figure 13: Neighbor    state changes (Database    Exchange)
  4224.  
  4225.         In addition to the state transitions pictured,
  4226.         Event SeqNumberMismatch    forces ExStart state,
  4227.         Event BadLSReq forces ExStart state,
  4228.         Event 1-Way forces Init    state,
  4229.         Event KillNbr always forces Down State,
  4230.         Event InactivityTimer always forces Down State,
  4231.         Event LLDown always forces Down    State,
  4232.         Event AdjOK? leads to adjacency    forming/breaking
  4233.  
  4234.     Attempt
  4235.         This state is only valid for neighbors attached to NBMA
  4236.         networks.  It indicates that no recent information has been
  4237.         received from the neighbor,    but that a more    concerted effort
  4238.         should be made to contact the neighbor.  This is done by
  4239.         sending the    neighbor Hello packets at intervals of
  4240.         HelloInterval (see Section 9.5.1).
  4241.  
  4242.     Init
  4243.         In this state, an Hello packet has recently    been seen from
  4244.         the    neighbor.  However, bidirectional communication    has not
  4245.         yet    been established with the neighbor (i.e., the router
  4246.         itself did not appear in the neighbor's Hello packet).  All
  4247.  
  4248.  
  4249.  
  4250.  
  4251. Moy                Standards Track               [Page 85]
  4252.  
  4253. RFC 2328             OSPF Version 2              April 1998
  4254.  
  4255.  
  4256.         neighbors in this state (or    higher)    are listed in the Hello
  4257.         packets sent from the associated interface.
  4258.  
  4259.     2-Way
  4260.         In this state, communication between the two routers is
  4261.         bidirectional.  This has been assured by the operation of
  4262.         the    Hello Protocol.     This is the most advanced state short
  4263.         of beginning adjacency establishment.  The (Backup)
  4264.         Designated Router is selected from the set of neighbors in
  4265.         state 2-Way    or greater.
  4266.  
  4267.     ExStart
  4268.         This is the    first step in creating an adjacency between the
  4269.         two    neighboring routers.  The goal of this step is to decide
  4270.         which router is the    master,    and to decide upon the initial
  4271.         DD sequence    number.     Neighbor conversations    in this    state or
  4272.         greater are    called adjacencies.
  4273.  
  4274.     Exchange
  4275.         In this state the router is    describing its entire link state
  4276.         database by    sending    Database Description packets to    the
  4277.         neighbor.  Each Database Description Packet    has a DD
  4278.         sequence number, and is explicitly acknowledged.  Only one
  4279.         Database Description Packet    is allowed outstanding at any
  4280.         one    time.  In this state, Link State Request Packets may
  4281.         also be sent asking    for the    neighbor's more    recent LSAs.
  4282.         All    adjacencies in Exchange    state or greater are used by the
  4283.         flooding procedure.     In fact, these    adjacencies are    fully
  4284.         capable of transmitting and    receiving all types of OSPF
  4285.         routing protocol packets.
  4286.  
  4287.     Loading
  4288.         In this state, Link    State Request packets are sent to the
  4289.         neighbor asking for    the more recent    LSAs that have been
  4290.         discovered (but not    yet received) in the Exchange state.
  4291.  
  4292.     Full
  4293.         In this state, the neighboring routers are fully adjacent.
  4294.         These adjacencies will now appear in router-LSAs and
  4295.         network-LSAs.
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301. Moy                Standards Track               [Page 86]
  4302.  
  4303. RFC 2328             OSPF Version 2              April 1998
  4304.  
  4305.  
  4306.     10.2.  Events causing neighbor state changes
  4307.  
  4308.     State changes can be effected by a number of events.  These
  4309.     events are shown in the    labels of the arcs in Figures 12 and 13.
  4310.     The label definitions are as follows:
  4311.  
  4312.  
  4313.     HelloReceived
  4314.         An Hello packet has    been received from the neighbor.
  4315.  
  4316.     Start
  4317.         This is an indication that Hello Packets should now    be sent
  4318.         to the neighbor at intervals of HelloInterval seconds.  This
  4319.         event is generated only for    neighbors associated with NBMA
  4320.         networks.
  4321.  
  4322.     2-WayReceived
  4323.         Bidirectional communication    has been realized between the
  4324.         two    neighboring routers.  This is indicated    by the router
  4325.         seeing itself in the neighbor's Hello packet.
  4326.  
  4327.     NegotiationDone
  4328.         The    Master/Slave relationship has been negotiated, and DD
  4329.         sequence numbers have been exchanged.  This    signals    the
  4330.         start of the sending/receiving of Database Description
  4331.         packets.  For more information on the generation of    this
  4332.         event, consult Section 10.8.
  4333.  
  4334.     ExchangeDone
  4335.         Both routers have successfully transmitted a full sequence
  4336.         of Database    Description packets.  Each router now knows what
  4337.         parts of its link state database are out of    date.  For more
  4338.         information    on the generation of this event, consult Section
  4339.         10.8.
  4340.  
  4341.     BadLSReq
  4342.         A Link State Request has been received for an LSA not
  4343.         contained in the database.    This indicates an error    in the
  4344.         Database Exchange process.
  4345.  
  4346.     Loading    Done
  4347.         Link State Updates have been received for all out-of-date
  4348.  
  4349.  
  4350.  
  4351. Moy                Standards Track               [Page 87]
  4352.  
  4353. RFC 2328             OSPF Version 2              April 1998
  4354.  
  4355.  
  4356.         portions of    the database.  This is indicated by the    Link
  4357.         state request list becoming    empty after the    Database
  4358.         Exchange process has completed.
  4359.  
  4360.     AdjOK?
  4361.         A decision must be made as to whether an adjacency should be
  4362.         established/maintained with    the neighbor.  This event will
  4363.         start some adjacencies forming, and    destroy    others.
  4364.  
  4365.  
  4366.     The following events cause well    developed neighbors to revert to
  4367.     lesser states.    Unlike the above events, these events may occur
  4368.     when the neighbor conversation is in any of a number of    states.
  4369.  
  4370.  
  4371.     SeqNumberMismatch
  4372.         A Database Description packet has been received that either
  4373.         a) has an unexpected DD sequence number, b)    unexpectedly has
  4374.         the    Init bit set or    c) has an Options field    differing from
  4375.         the    last Options field received in a Database Description
  4376.         packet.  Any of these conditions indicate that some    error
  4377.         has    occurred during    adjacency establishment.
  4378.  
  4379.     1-Way
  4380.         An Hello packet has    been received from the neighbor, in
  4381.         which the router is    not mentioned.    This indicates that
  4382.         communication with the neighbor is not bidirectional.
  4383.  
  4384.     KillNbr
  4385.         This  is  an  indication that  all    communication  with  the
  4386.         neighbor  is now  impossible,  forcing  the     neighbor  to
  4387.         revert  to    Down  state.
  4388.  
  4389.     InactivityTimer
  4390.         The    inactivity Timer has fired.  This means    that no    Hello
  4391.         packets have been seen recently from the neighbor.    The
  4392.         neighbor reverts to    Down state.
  4393.  
  4394.     LLDown
  4395.         This is an indication from the lower level protocols that
  4396.         the    neighbor is now    unreachable.  For example, on an X.25
  4397.         network this could be indicated by an X.25 clear indication
  4398.  
  4399.  
  4400.  
  4401. Moy                Standards Track               [Page 88]
  4402.  
  4403. RFC 2328             OSPF Version 2              April 1998
  4404.  
  4405.  
  4406.         with appropriate cause and diagnostic fields.  This    event
  4407.         forces the neighbor    into Down state.
  4408.  
  4409.  
  4410.     10.3.  The Neighbor    state machine
  4411.  
  4412.     A detailed description of the neighbor state changes follows.
  4413.     Each state change is invoked by    an event (Section 10.2).  This
  4414.     event may produce different effects, depending on the current
  4415.     state of the neighbor.    For this reason, the state machine below
  4416.     is organized by    current    neighbor state and received event.  Each
  4417.     entry in the state machine describes the resulting new neighbor
  4418.     state and the required set of additional actions.
  4419.  
  4420.     When a neighbor's state    changes, it may    be necessary to    rerun
  4421.     the Designated Router election algorithm.  This    is determined by
  4422.     whether    the interface NeighborChange event is generated    (see
  4423.     Section    9.2).  Also, if    the Interface is in DR state (the router
  4424.     is itself Designated Router), changes in neighbor state    may
  4425.     cause a    new network-LSA    to be originated (see Section 12.4).
  4426.  
  4427.     When the neighbor state    machine    needs to invoke    the interface
  4428.     state machine, it should be done as a scheduled    task (see
  4429.     Section    4.4).  This simplifies things, by ensuring that    neither
  4430.     state machine will be executed recursively.
  4431.  
  4432.  
  4433.      State(s):  Down
  4434.  
  4435.         Event:  Start
  4436.  
  4437.     New state:  Attempt
  4438.  
  4439.        Action:  Send an Hello Packet to the    neighbor (this neighbor
  4440.             is always associated with an NBMA network) and start
  4441.             the    Inactivity Timer for the neighbor.  The    timer's
  4442.             later firing would indicate    that communication with
  4443.             the    neighbor was not attained.
  4444.  
  4445.  
  4446.      State(s):  Attempt
  4447.  
  4448.  
  4449.  
  4450.  
  4451. Moy                Standards Track               [Page 89]
  4452.  
  4453. RFC 2328             OSPF Version 2              April 1998
  4454.  
  4455.  
  4456.         Event:  HelloReceived
  4457.  
  4458.     New state:  Init
  4459.  
  4460.        Action:  Restart the    Inactivity Timer for the neighbor, since
  4461.             the    neighbor has now been heard from.
  4462.  
  4463.  
  4464.      State(s):  Down
  4465.  
  4466.         Event:  HelloReceived
  4467.  
  4468.     New state:  Init
  4469.  
  4470.        Action:  Start the Inactivity Timer for the neighbor.  The
  4471.             timer's later firing would indicate    that the
  4472.             neighbor is    dead.
  4473.  
  4474.  
  4475.      State(s):  Init or greater
  4476.  
  4477.         Event:  HelloReceived
  4478.  
  4479.     New state:  No state change.
  4480.  
  4481.        Action:  Restart the    Inactivity Timer for the neighbor, since
  4482.             the    neighbor has again been    heard from.
  4483.  
  4484.  
  4485.      State(s):  Init
  4486.  
  4487.         Event:  2-WayReceived
  4488.  
  4489.     New state:  Depends upon action    routine.
  4490.  
  4491.        Action:  Determine whether an adjacency should be established
  4492.             with the neighbor (see Section 10.4).  If not, the
  4493.             new    neighbor state is 2-Way.
  4494.  
  4495.             Otherwise (an adjacency should be established) the
  4496.             neighbor state transitions to ExStart.  Upon
  4497.             entering this state, the router increments the DD
  4498.  
  4499.  
  4500.  
  4501. Moy                Standards Track               [Page 90]
  4502.  
  4503. RFC 2328             OSPF Version 2              April 1998
  4504.  
  4505.  
  4506.             sequence number in the neighbor data structure.  If
  4507.             this is the    first time that    an adjacency has been
  4508.             attempted, the DD sequence number should be    assigned
  4509.             some unique    value (like the    time of    day clock).  It
  4510.             then declares itself master    (sets the master/slave
  4511.             bit    to master), and    starts sending Database
  4512.             Description    Packets, with the initialize (I), more
  4513.             (M)    and master (MS)    bits set.  This    Database
  4514.             Description    Packet should be otherwise empty.  This
  4515.             Database Description Packet    should be retransmitted
  4516.             at intervals of RxmtInterval until the next    state is
  4517.             entered (see Section 10.8).
  4518.  
  4519.  
  4520.      State(s):  ExStart
  4521.  
  4522.         Event:  NegotiationDone
  4523.  
  4524.     New state:  Exchange
  4525.  
  4526.        Action:  The    router must list the contents of its entire area
  4527.             link state database    in the neighbor    Database summary
  4528.             list.  The area link state database    consists of the
  4529.             router-LSAs, network-LSAs and summary-LSAs contained
  4530.             in the area    structure, along with the AS-external-
  4531.             LSAs contained in the global structure.  AS-
  4532.             external-LSAs are omitted from a virtual neighbor's
  4533.             Database summary list.  AS-external-LSAs are omitted
  4534.             from the Database summary list if the area has been
  4535.             configured as a stub (see Section 3.6).  LSAs whose
  4536.             age    is equal to MaxAge are instead added to    the
  4537.             neighbor's Link state retransmission list.    A
  4538.             summary of the Database summary list will be sent to
  4539.             the    neighbor in Database Description packets.  Each
  4540.             Database Description Packet    has a DD sequence
  4541.             number, and    is explicitly acknowledged.  Only one
  4542.             Database Description Packet    is allowed outstanding
  4543.             at any one time.  For more detail on the sending and
  4544.             receiving of Database Description packets, see
  4545.             Sections 10.8 and 10.6.
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551. Moy                Standards Track               [Page 91]
  4552.  
  4553. RFC 2328             OSPF Version 2              April 1998
  4554.  
  4555.  
  4556.      State(s):  Exchange
  4557.  
  4558.         Event:  ExchangeDone
  4559.  
  4560.     New state:  Depends upon action    routine.
  4561.  
  4562.        Action:  If the neighbor Link state request list is empty,
  4563.             the    new neighbor state is Full.  No    other action is
  4564.             required.  This is an adjacency's final state.
  4565.  
  4566.             Otherwise, the new neighbor    state is Loading.  Start
  4567.             (or    continue) sending Link State Request packets to
  4568.             the    neighbor (see Section 10.9).  These are    requests
  4569.             for    the neighbor's more recent LSAs    (which were
  4570.             discovered but not yet received in the Exchange
  4571.             state).  These LSAs    are listed in the Link state
  4572.             request list associated with the neighbor.
  4573.  
  4574.  
  4575.      State(s):  Loading
  4576.  
  4577.         Event:  Loading Done
  4578.  
  4579.     New state:  Full
  4580.  
  4581.        Action:  No action required.     This is an adjacency's    final
  4582.             state.
  4583.  
  4584.  
  4585.      State(s):  2-Way
  4586.  
  4587.         Event:  AdjOK?
  4588.  
  4589.     New state:  Depends upon action    routine.
  4590.  
  4591.        Action:  Determine whether an adjacency should be formed with
  4592.             the    neighboring router (see    Section    10.4).    If not,
  4593.             the    neighbor state remains at 2-Way.  Otherwise,
  4594.             transition the neighbor state to ExStart and perform
  4595.             the    actions    associated with    the above state    machine
  4596.             entry for state Init and event 2-WayReceived.
  4597.  
  4598.  
  4599.  
  4600.  
  4601. Moy                Standards Track               [Page 92]
  4602.  
  4603. RFC 2328             OSPF Version 2              April 1998
  4604.  
  4605.  
  4606.      State(s):  ExStart or greater
  4607.  
  4608.         Event:  AdjOK?
  4609.  
  4610.     New state:  Depends upon action    routine.
  4611.  
  4612.        Action:  Determine whether the neighboring router should
  4613.             still be adjacent.    If yes,    there is no state change
  4614.             and    no further action is necessary.
  4615.  
  4616.             Otherwise, the (possibly partially formed) adjacency
  4617.             must be destroyed.    The neighbor state transitions
  4618.             to 2-Way.  The Link    state retransmission list,
  4619.             Database summary list and Link state request list
  4620.             are    cleared    of LSAs.
  4621.  
  4622.  
  4623.      State(s):  Exchange or    greater
  4624.  
  4625.         Event:  SeqNumberMismatch
  4626.  
  4627.     New state:  ExStart
  4628.  
  4629.        Action:  The    (possibly partially formed) adjacency is torn
  4630.             down, and then an attempt is made at
  4631.             reestablishment.  The neighbor state first
  4632.             transitions    to ExStart.  The Link state
  4633.             retransmission list, Database summary list and Link
  4634.             state request list are cleared of LSAs.  Then the
  4635.             router increments the DD sequence number in    the
  4636.             neighbor data structure, declares itself master
  4637.             (sets the master/slave bit to master), and starts
  4638.             sending Database Description Packets, with the
  4639.             initialize (I), more (M) and master    (MS) bits set.
  4640.             This Database Description Packet should be otherwise
  4641.             empty (see Section 10.8).
  4642.  
  4643.  
  4644.      State(s):  Exchange or    greater
  4645.  
  4646.         Event:  BadLSReq
  4647.  
  4648.  
  4649.  
  4650.  
  4651. Moy                Standards Track               [Page 93]
  4652.  
  4653. RFC 2328             OSPF Version 2              April 1998
  4654.  
  4655.  
  4656.     New state:  ExStart
  4657.  
  4658.        Action:  The    action for event BadLSReq is exactly the same as
  4659.             for    the neighbor event SeqNumberMismatch.  The
  4660.             (possibly partially    formed)    adjacency is torn down,
  4661.             and    then an    attempt    is made    at reestablishment.  For
  4662.             more information, see the neighbor state machine
  4663.             entry that is invoked when event SeqNumberMismatch
  4664.             is generated in state Exchange or greater.
  4665.  
  4666.  
  4667.      State(s):  Any    state
  4668.  
  4669.         Event:  KillNbr
  4670.  
  4671.     New state:  Down
  4672.  
  4673.        Action:  The    Link state retransmission list,    Database summary
  4674.             list and Link state    request    list are cleared of
  4675.             LSAs.  Also, the Inactivity    Timer is disabled.
  4676.  
  4677.  
  4678.      State(s):  Any    state
  4679.  
  4680.         Event:  LLDown
  4681.  
  4682.     New state:  Down
  4683.  
  4684.        Action:  The    Link state retransmission list,    Database summary
  4685.             list and Link state    request    list are cleared of
  4686.             LSAs.  Also, the Inactivity    Timer is disabled.
  4687.  
  4688.  
  4689.      State(s):  Any    state
  4690.  
  4691.         Event:  InactivityTimer
  4692.  
  4693.     New state:  Down
  4694.  
  4695.        Action:  The    Link state retransmission list,    Database summary
  4696.             list and Link state    request    list are cleared of
  4697.             LSAs.
  4698.  
  4699.  
  4700.  
  4701. Moy                Standards Track               [Page 94]
  4702.  
  4703. RFC 2328             OSPF Version 2              April 1998
  4704.  
  4705.  
  4706.      State(s):  2-Way or greater
  4707.  
  4708.         Event:  1-WayReceived
  4709.  
  4710.     New state:  Init
  4711.  
  4712.        Action:  The    Link state retransmission list,    Database summary
  4713.             list and Link state    request    list are cleared of
  4714.             LSAs.
  4715.  
  4716.  
  4717.      State(s):  2-Way or greater
  4718.  
  4719.         Event:  2-WayReceived
  4720.  
  4721.     New state:  No state change.
  4722.  
  4723.        Action:  No action required.
  4724.  
  4725.  
  4726.      State(s):  Init
  4727.  
  4728.         Event:  1-WayReceived
  4729.  
  4730.     New state:  No state change.
  4731.  
  4732.        Action:  No action required.
  4733.  
  4734.  
  4735.     10.4.  Whether to become adjacent
  4736.  
  4737.     Adjacencies are    established with some subset of    the router's
  4738.     neighbors.  Routers connected by point-to-point    networks,
  4739.     Point-to-MultiPoint networks and virtual links always become
  4740.     adjacent.  On broadcast    and NBMA networks, all routers become
  4741.     adjacent to both the Designated    Router and the Backup Designated
  4742.     Router.
  4743.  
  4744.     The adjacency-forming decision occurs in two places in the
  4745.     neighbor state machine.     First,    when bidirectional communication
  4746.     is initially established with the neighbor, and    secondly, when
  4747.     the identity of    the attached network's (Backup)    Designated
  4748.  
  4749.  
  4750.  
  4751. Moy                Standards Track               [Page 95]
  4752.  
  4753. RFC 2328             OSPF Version 2              April 1998
  4754.  
  4755.  
  4756.     Router changes.     If the    decision is made to not    attempt    an
  4757.     adjacency, the state of    the neighbor communication stops at 2-
  4758.     Way.
  4759.  
  4760.     An adjacency should be established with    a bidirectional    neighbor
  4761.     when at    least one of the following conditions holds:
  4762.  
  4763.  
  4764.     o   The    underlying network type    is point-to-point
  4765.  
  4766.     o   The    underlying network type    is Point-to-MultiPoint
  4767.  
  4768.     o   The    underlying network type    is virtual link
  4769.  
  4770.     o   The    router itself is the Designated    Router
  4771.  
  4772.     o   The    router itself is the Backup Designated Router
  4773.  
  4774.     o   The    neighboring router is the Designated Router
  4775.  
  4776.     o   The    neighboring router is the Backup Designated Router
  4777.  
  4778.  
  4779.     10.5.  Receiving Hello Packets
  4780.  
  4781.     This section explains the detailed processing of a received
  4782.     Hello Packet.  (See Section A.3.2 for the format of Hello
  4783.     packets.)  The generic input processing    of OSPF    packets    will
  4784.     have checked the validity of the IP header and the OSPF    packet
  4785.     header.     Next, the values of the Network Mask, HelloInterval,
  4786.     and RouterDeadInterval fields in the received Hello packet must
  4787.     be checked against the values configured for the receiving
  4788.     interface.  Any    mismatch causes    processing to stop and the
  4789.     packet to be dropped.  In other    words, the above fields    are
  4790.     really describing the attached network's configuration.    However,
  4791.     there is one exception to the above rule: on point-to-point
  4792.     networks and on    virtual    links, the Network Mask    in the received
  4793.     Hello Packet should be ignored.
  4794.  
  4795.     The receiving interface    attaches to a single OSPF area (this
  4796.     could be the backbone).     The setting of    the E-bit found    in the
  4797.     Hello Packet's Options field must match    this area's
  4798.  
  4799.  
  4800.  
  4801. Moy                Standards Track               [Page 96]
  4802.  
  4803. RFC 2328             OSPF Version 2              April 1998
  4804.  
  4805.  
  4806.     ExternalRoutingCapability.  If AS-external-LSAs    are not    flooded
  4807.     into/throughout    the area (i.e, the area    is a "stub") the E-bit
  4808.     must be    clear in received Hello    Packets, otherwise the E-bit
  4809.     must be    set.  A    mismatch causes    processing to stop and the
  4810.     packet to be dropped.  The setting of the rest of the bits in
  4811.     the Hello Packet's Options field should    be ignored.
  4812.  
  4813.     At this    point, an attempt is made to match the source of the
  4814.     Hello Packet to    one of the receiving interface's neighbors.  If
  4815.     the receiving interface    connects to a broadcast, Point-to-
  4816.     MultiPoint or NBMA network the source is identified by the IP
  4817.     source address found in    the Hello's IP header.    If the receiving
  4818.     interface connects to a    point-to-point link or a virtual link,
  4819.     the source is identified by the    Router ID found    in the Hello's
  4820.     OSPF packet header.  The interface's current list of neighbors
  4821.     is contained in    the interface's    data structure.     If a matching
  4822.     neighbor structure cannot be found, (i.e., this    is the first
  4823.     time the neighbor has been detected), one is created.  The
  4824.     initial    state of a newly created neighbor is set to Down.
  4825.  
  4826.     When receiving an Hello    Packet from a neighbor on a broadcast,
  4827.     Point-to-MultiPoint or NBMA network, set the neighbor
  4828.     structure's Neighbor ID    equal to the Router ID found in    the
  4829.     packet's OSPF header.  For these network types,    the neighbor
  4830.     structure's Router Priority field, Neighbor's Designated Router
  4831.     field, and Neighbor's Backup Designated    Router field are also
  4832.     set equal to the corresponding fields found in the received
  4833.     Hello Packet; changes in these fields should be    noted for
  4834.     possible use in    the steps below.  When receiving an Hello on a
  4835.     point-to-point network (but not    on a virtual link) set the
  4836.     neighbor structure's Neighbor IP address to the    packet's IP
  4837.     source address.
  4838.  
  4839.     Now the    rest of    the Hello Packet is examined, generating events
  4840.     to be given to the neighbor and    interface state    machines.  These
  4841.     state machines are specified either to be executed or scheduled
  4842.     (see Section 4.4).  For    example, by specifying below that the
  4843.     neighbor state machine be executed in line, several neighbor
  4844.     state transitions may be effected by a single received Hello:
  4845.  
  4846.  
  4847.  
  4848.  
  4849.  
  4850.  
  4851. Moy                Standards Track               [Page 97]
  4852.  
  4853. RFC 2328             OSPF Version 2              April 1998
  4854.  
  4855.  
  4856.     o   Each Hello Packet causes the neighbor state    machine    to be
  4857.         executed with the event HelloReceived.
  4858.  
  4859.     o   Then the list of neighbors contained in the    Hello Packet is
  4860.         examined.  If the router itself appears in this list, the
  4861.         neighbor state machine should be executed with the event 2-
  4862.         WayReceived.  Otherwise, the neighbor state    machine    should
  4863.         be executed    with the event 1-WayReceived, and the processing
  4864.         of the packet stops.
  4865.  
  4866.     o   Next, if a change in the neighbor's    Router Priority    field
  4867.         was    noted, the receiving interface's state machine is
  4868.         scheduled with the event NeighborChange.
  4869.  
  4870.     o   If the neighbor is both declaring itself to    be Designated
  4871.         Router (Hello Packet's Designated Router field = Neighbor IP
  4872.         address) and the Backup Designated Router field in the
  4873.         packet is equal to 0.0.0.0 and the receiving interface is in
  4874.         state Waiting, the receiving interface's state machine is
  4875.         scheduled with the event BackupSeen.  Otherwise, if    the
  4876.         neighbor is    declaring itself to be Designated Router and it
  4877.         had    not previously,    or the neighbor    is not declaring itself
  4878.         Designated Router where it had previously, the receiving
  4879.         interface's    state machine is scheduled with    the event
  4880.         NeighborChange.
  4881.  
  4882.     o   If the neighbor is declaring itself    to be Backup Designated
  4883.         Router (Hello Packet's Backup Designated Router field =
  4884.         Neighbor IP    address) and the receiving interface is    in state
  4885.         Waiting, the receiving interface's state machine is
  4886.         scheduled with the event BackupSeen.  Otherwise, if    the
  4887.         neighbor is    declaring itself to be Backup Designated Router
  4888.         and    it had not previously, or the neighbor is not declaring
  4889.         itself Backup Designated Router where it had previously, the
  4890.         receiving interface's state    machine    is scheduled with the
  4891.         event NeighborChange.
  4892.  
  4893.     On NBMA    networks, receipt of an    Hello Packet may also cause an
  4894.     Hello Packet to    be sent    back to    the neighbor in    response. See
  4895.     Section    9.5.1 for more details.
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901. Moy                Standards Track               [Page 98]
  4902.  
  4903. RFC 2328             OSPF Version 2              April 1998
  4904.  
  4905.  
  4906.     10.6.  Receiving Database Description Packets
  4907.  
  4908.     This section explains the detailed processing of a received
  4909.     Database Description Packet.  The incoming Database Description
  4910.     Packet has already been    associated with    a neighbor and receiving
  4911.     interface by the generic input packet processing (Section 8.2).
  4912.     Whether    the Database Description packet    should be accepted, and
  4913.     if so, how it should be    further    processed depends upon the
  4914.     neighbor state.
  4915.  
  4916.     If a Database Description packet is accepted, the following
  4917.     packet fields should be    saved in the corresponding neighbor data
  4918.     structure under    "last received Database    Description packet":
  4919.     the packet's initialize(I), more (M) and master(MS) bits,
  4920.     Options    field, and DD sequence number. If these    fields are set
  4921.     identically in two consecutive Database    Description packets
  4922.     received from the neighbor, the    second Database    Description
  4923.     packet is considered to    be a "duplicate" in the    processing
  4924.     described below.
  4925.  
  4926.     If the Interface MTU field in the Database Description packet
  4927.     indicates an IP    datagram size that is larger than the router can
  4928.     accept on the receiving    interface without fragmentation, the
  4929.     Database Description packet is rejected.  Otherwise, if    the
  4930.     neighbor state is:
  4931.  
  4932.     Down
  4933.         The    packet should be rejected.
  4934.  
  4935.     Attempt
  4936.         The    packet should be rejected.
  4937.  
  4938.     Init
  4939.         The    neighbor state machine should be executed with the event
  4940.         2-WayReceived.  This causes    an immediate state change to
  4941.         either state 2-Way or state    ExStart. If the    new state is
  4942.         ExStart, the processing of the current packet should then
  4943.         continue in    this new state by falling through to case
  4944.         ExStart below.
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951. Moy                Standards Track               [Page 99]
  4952.  
  4953. RFC 2328             OSPF Version 2              April 1998
  4954.  
  4955.  
  4956.     2-Way
  4957.         The    packet should be ignored.  Database Description    Packets
  4958.         are    used only for the purpose of bringing up adjacencies.[7]
  4959.  
  4960.     ExStart
  4961.         If the received packet matches one of the following    cases,
  4962.         then the neighbor state machine should be executed with the
  4963.         event NegotiationDone (causing the state to    transition to
  4964.         Exchange), the packet's Options field should be recorded in
  4965.         the    neighbor structure's Neighbor Options field and    the
  4966.         packet should be accepted as next in sequence and processed
  4967.         further (see below).  Otherwise, the packet    should be
  4968.         ignored.
  4969.  
  4970.         o    The initialize(I), more    (M) and    master(MS) bits    are set,
  4971.         the contents of    the packet are empty, and the neighbor's
  4972.         Router ID is larger than the router's own.  In this case
  4973.         the router is now Slave.  Set the master/slave bit to
  4974.         slave, and set the neighbor data structure's DD    sequence
  4975.         number to that specified by the    master.
  4976.  
  4977.         o    The initialize(I) and master(MS) bits are off, the
  4978.         packet's DD sequence number equals the neighbor    data
  4979.         structure's DD sequence    number (indicating
  4980.         acknowledgment)    and the    neighbor's Router ID is    smaller
  4981.         than the router's own.    In this    case the router    is
  4982.         Master.
  4983.  
  4984.     Exchange
  4985.         Duplicate Database Description packets are discarded by the
  4986.         master, and    cause the slave    to retransmit the last Database
  4987.         Description    packet that it had sent. Otherwise (the    packet
  4988.         is not a duplicate):
  4989.  
  4990.         o    If the state of    the MS-bit is inconsistent with    the
  4991.         master/slave state of the connection, generate the
  4992.         neighbor event SeqNumberMismatch and stop processing the
  4993.         packet.
  4994.  
  4995.         o    If the initialize(I) bit is set, generate the neighbor
  4996.         event SeqNumberMismatch    and stop processing the    packet.
  4997.  
  4998.  
  4999.  
  5000.  
  5001. Moy                Standards Track              [Page 100]
  5002.  
  5003. RFC 2328             OSPF Version 2              April 1998
  5004.  
  5005.  
  5006.         o    If the packet's    Options    field indicates    a different set
  5007.         of optional OSPF capabilities than were    previously
  5008.         received from the neighbor (recorded in    the Neighbor
  5009.         Options    field of the neighbor structure), generate the
  5010.         neighbor event SeqNumberMismatch and stop processing the
  5011.         packet.
  5012.  
  5013.         o    Database Description packets must be processed in
  5014.         sequence, as indicated by the packets' DD sequence
  5015.         numbers. If the    router is master, the next packet
  5016.         received should    have DD    sequence number    equal to the DD
  5017.         sequence number    in the neighbor    data structure.    If the
  5018.         router is slave, the next packet received should have DD
  5019.         sequence number    equal to one more than the DD sequence
  5020.         number stored in the neighbor data structure. In either
  5021.         case, if the packet is the next    in sequence it should be
  5022.         accepted and its contents processed as specified below.
  5023.  
  5024.         o    Else, generate the neighbor event SeqNumberMismatch and
  5025.         stop processing    the packet.
  5026.  
  5027.     Loading    or Full
  5028.         In this state, the router has sent and received an entire
  5029.         sequence of    Database Description Packets.  The only    packets
  5030.         received should be duplicates (see above).    In particular,
  5031.         the    packet's Options field should match the    set of optional
  5032.         OSPF capabilities previously indicated by the neighbor
  5033.         (stored in the neighbor structure's    Neighbor Options field).
  5034.         Any    other packets received,    including the reception    of a
  5035.         packet with    the Initialize(I) bit set, should generate the
  5036.         neighbor event SeqNumberMismatch.[8] Duplicates should be
  5037.         discarded by the master.  The slave    must respond to
  5038.         duplicates by repeating the    last Database Description packet
  5039.         that it had    sent.
  5040.  
  5041.  
  5042.     When the router    accepts    a received Database Description    Packet
  5043.     as the next in sequence    the packet contents are    processed as
  5044.     follows.  For each LSA listed, the LSA's LS type is checked for
  5045.     validity.  If the LS type is unknown (e.g., not    one of the LS
  5046.     types 1-5 defined by this specification), or if    this is    an AS-
  5047.     external-LSA (LS type =    5) and the neighbor is associated with a
  5048.  
  5049.  
  5050.  
  5051. Moy                Standards Track              [Page 101]
  5052.  
  5053. RFC 2328             OSPF Version 2              April 1998
  5054.  
  5055.  
  5056.     stub area, generate the    neighbor event SeqNumberMismatch and
  5057.     stop processing    the packet.  Otherwise,    the router looks up the
  5058.     LSA in its database to see whether it also has an instance of
  5059.     the LSA.  If it    does not, or if    the database copy is less recent
  5060.     (see Section 13.1), the    LSA is put on the Link state request
  5061.     list so    that it    can be requested (immediately or at some later
  5062.     time) in Link State Request Packets.
  5063.  
  5064.     When the router    accepts    a received Database Description    Packet
  5065.     as the next in sequence, it also performs the following    actions,
  5066.     depending on whether it    is master or slave:
  5067.  
  5068.  
  5069.     Master
  5070.         Increments the DD sequence number in the neighbor data
  5071.         structure.    If the router has already sent its entire
  5072.         sequence of    Database Description Packets, and the just
  5073.         accepted packet has    the more bit (M) set to    0, the neighbor
  5074.         event ExchangeDone is generated.  Otherwise, it should send
  5075.         a new Database Description to the slave.
  5076.  
  5077.     Slave
  5078.         Sets the DD    sequence number    in the neighbor    data structure
  5079.         to the DD sequence number appearing    in the received    packet.
  5080.         The    slave must send    a Database Description Packet in reply.
  5081.         If the received packet has the more    bit (M)    set to 0, and
  5082.         the    packet to be sent by the slave will also have the M-bit
  5083.         set    to 0, the neighbor event ExchangeDone is generated.
  5084.         Note that the slave    always generates this event before the
  5085.         master.
  5086.  
  5087.  
  5088.     10.7.  Receiving Link State    Request    Packets
  5089.  
  5090.     This section explains the detailed processing of received Link
  5091.     State Request packets.    Received Link State Request Packets
  5092.     specify    a list of LSAs that the    neighbor wishes    to receive.
  5093.     Link State Request Packets should be accepted when the neighbor
  5094.     is in states Exchange, Loading,    or Full.  In all other states
  5095.     Link State Request Packets should be ignored.
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101. Moy                Standards Track              [Page 102]
  5102.  
  5103. RFC 2328             OSPF Version 2              April 1998
  5104.  
  5105.  
  5106.     Each LSA specified in the Link State Request packet should be
  5107.     located    in the router's    database, and copied into Link State
  5108.     Update packets for transmission    to the neighbor.  These    LSAs
  5109.     should NOT be placed on    the Link state retransmission list for
  5110.     the neighbor.  If an LSA cannot    be found in the    database,
  5111.     something has gone wrong with the Database Exchange process, and
  5112.     neighbor event BadLSReq    should be generated.
  5113.  
  5114.  
  5115.     10.8.  Sending Database Description    Packets
  5116.  
  5117.     This section describes how Database Description    Packets    are sent
  5118.     to a neighbor. The Database Description    packet's Interface MTU
  5119.     field is set to    the size of the    largest    IP datagram that can be
  5120.     sent out the sending interface,    without    fragmentation.    Common
  5121.     MTUs in    use in the Internet can    be found in Table 7-1 of
  5122.     [Ref22]. Interface MTU should be set to    0 in Database
  5123.     Description packets sent over virtual links.
  5124.  
  5125.     The router's optional OSPF capabilities    (see Section 4.5) are
  5126.     transmitted to the neighbor in the Options field of the    Database
  5127.     Description packet.  The router    should maintain    the same set of
  5128.     optional capabilities throughout the Database Exchange and
  5129.     flooding procedures.  If for some reason the router's optional
  5130.     capabilities change, the Database Exchange procedure should be
  5131.     restarted by reverting to neighbor state ExStart.  One optional
  5132.     capability is defined in this specification (see Sections 4.5
  5133.     and A.2). The E-bit should be set if and only if the attached
  5134.     network    belongs    to a non-stub area. Unrecognized bits in the
  5135.     Options    field should be    set to zero.
  5136.  
  5137.     The sending of Database    Description packets depends on the
  5138.     neighbor's state.  In state ExStart the    router sends empty
  5139.     Database Description packets, with the initialize (I), more (M)
  5140.     and master (MS)    bits set.  These packets are retransmitted every
  5141.     RxmtInterval seconds.
  5142.  
  5143.     In state Exchange the Database Description Packets actually
  5144.     contain    summaries of the link state information    contained in the
  5145.     router's database.  Each LSA in    the area's link-state database
  5146.     (at the    time the neighbor transitions into Exchange state) is
  5147.     listed in the neighbor Database    summary    list.  Each new    Database
  5148.  
  5149.  
  5150.  
  5151. Moy                Standards Track              [Page 103]
  5152.  
  5153. RFC 2328             OSPF Version 2              April 1998
  5154.  
  5155.  
  5156.     Description Packet copies its DD sequence number from the
  5157.     neighbor data structure    and then describes the current top of
  5158.     the Database summary list.  Items are removed from the Database
  5159.     summary    list when the previous packet is acknowledged.
  5160.  
  5161.     In state Exchange, the determination of    when to    send a Database
  5162.     Description packet depends on whether the router is master or
  5163.     slave:
  5164.  
  5165.  
  5166.     Master
  5167.         Database Description packets are sent when either a) the
  5168.         slave acknowledges the previous Database Description packet
  5169.         by echoing the DD sequence number or b) RxmtInterval seconds
  5170.         elapse without an acknowledgment, in which case the    previous
  5171.         Database Description packet    is retransmitted.
  5172.  
  5173.     Slave
  5174.         Database Description packets are sent only in response to
  5175.         Database Description packets received from the master.  If
  5176.         the    Database Description packet received from the master is
  5177.         new, a new Database    Description packet is sent, otherwise
  5178.         the    previous Database Description packet is    resent.
  5179.  
  5180.  
  5181.     In states Loading and Full the slave must resend its last
  5182.     Database Description packet in response    to duplicate Database
  5183.     Description packets received from the master.  For this    reason
  5184.     the slave must wait RouterDeadInterval seconds before freeing
  5185.     the last Database Description packet.  Reception of a Database
  5186.     Description packet from    the master after this interval will
  5187.     generate a SeqNumberMismatch neighbor event.
  5188.  
  5189.  
  5190.     10.9.  Sending Link    State Request Packets
  5191.  
  5192.     In neighbor states Exchange or Loading,    the Link state request
  5193.     list contains a    list of    those LSAs that    need to    be obtained from
  5194.     the neighbor.  To request these    LSAs, a    router sends the
  5195.     neighbor the beginning of the Link state request list, packaged
  5196.     in a Link State    Request    packet.
  5197.  
  5198.  
  5199.  
  5200.  
  5201. Moy                Standards Track              [Page 104]
  5202.  
  5203. RFC 2328             OSPF Version 2              April 1998
  5204.  
  5205.  
  5206.     When the neighbor responds to these requests with the proper
  5207.     Link State Update packet(s), the Link state request list is
  5208.     truncated and a    new Link State Request packet is sent.    This
  5209.     process    continues until    the Link state request list becomes
  5210.     empty. LSAs on the Link    state request list that    have been
  5211.     requested, but not yet received, are packaged into Link    State
  5212.     Request    packets    for retransmission at intervals    of RxmtInterval.
  5213.     There should be    at most    one Link State Request packet
  5214.     outstanding at any one time.
  5215.  
  5216.     When the Link state request list becomes empty,    and the    neighbor
  5217.     state is Loading (i.e.,    a complete sequence of Database
  5218.     Description packets has    been sent to and received from the
  5219.     neighbor), the Loading Done neighbor event is generated.
  5220.  
  5221.  
  5222.     10.10.  An Example
  5223.  
  5224.     Figure 14 shows    an example of an adjacency forming.  Routers RT1
  5225.     and RT2    are both connected to a    broadcast network.  It is
  5226.     assumed    that RT2 is the    Designated Router for the network, and
  5227.     that RT2 has a higher Router ID    than Router RT1.
  5228.  
  5229.     The neighbor state changes realized by each router are listed on
  5230.     the sides of the figure.
  5231.  
  5232.     At the beginning of Figure 14, Router RT1's interface to the
  5233.     network    becomes    operational.  It begins    sending    Hello Packets,
  5234.     although it doesn't know the identity of the Designated    Router
  5235.     or of any other    neighboring routers.  Router RT2 hears this
  5236.     hello (moving the neighbor to Init state), and in its next Hello
  5237.     Packet indicates that it is itself the Designated Router and
  5238.     that it    has heard Hello    Packets    from RT1.  This    in turn    causes
  5239.     RT1 to go to state ExStart, as it starts to bring up the
  5240.     adjacency.
  5241.  
  5242.     RT1 begins by asserting    itself as the master.  When it sees that
  5243.     RT2 is indeed the master (because of RT2's higher Router ID),
  5244.     RT1 transitions    to slave state and adopts its neighbor's DD
  5245.     sequence number.  Database Description packets are then
  5246.     exchanged, with    polls coming from the master (RT2) and responses
  5247.     from the slave (RT1).  This sequence of    Database Description
  5248.  
  5249.  
  5250.  
  5251. Moy                Standards Track              [Page 105]
  5252.  
  5253. RFC 2328             OSPF Version 2              April 1998
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.         +---+                      +---+
  5262.         |RT1|                      |RT2|
  5263.         +---+                      +---+
  5264.  
  5265.         Down                      Down
  5266.                 Hello(DR=0,seen=0)
  5267.                ------------------------------>
  5268.              Hello (DR=RT2,seen=RT1,...)      Init
  5269.                <------------------------------
  5270.         ExStart       D-D (Seq=x,I,M,Master)
  5271.                ------------------------------>
  5272.                D-D (Seq=y,I,M,Master)      ExStart
  5273.                <------------------------------
  5274.         Exchange       D-D (Seq=y,M,Slave)
  5275.                ------------------------------>
  5276.                D-D (Seq=y+1,M,Master)      Exchange
  5277.                <------------------------------
  5278.                D-D (Seq=y+1,M,Slave)
  5279.                ------------------------------>
  5280.                      ...
  5281.                      ...
  5282.                      ...
  5283.                D-D (Seq=y+n, Master)
  5284.                <------------------------------
  5285.                D-D (Seq=y+n, Slave)
  5286.          Loading   ------------------------------>
  5287.                  LS Request           Full
  5288.                ------------------------------>
  5289.                  LS Update
  5290.                <------------------------------
  5291.                  LS Request
  5292.                ------------------------------>
  5293.                  LS Update
  5294.                <------------------------------
  5295.          Full
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301. Moy                Standards Track              [Page 106]
  5302.  
  5303. RFC 2328             OSPF Version 2              April 1998
  5304.  
  5305.  
  5306.            Figure 14: An adjacency bring-up example
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.     Packets    ends when both the poll    and associated response    has the
  5313.     M-bit off.
  5314.  
  5315.     In this    example, it is assumed that RT2    has a completely up to
  5316.     date database.    In that    case, RT2 goes immediately into    Full
  5317.     state.    RT1 will go into Full state after updating the necessary
  5318.     parts of its database.    This is    done by    sending    Link State
  5319.     Request    Packets, and receiving Link State Update Packets in
  5320.     response.  Note    that, while RT1    has waited until a complete set
  5321.     of Database Description    Packets    has been received (from    RT2)
  5322.     before sending any Link    State Request Packets, this need not be
  5323.     the case.  RT1 could have interleaved the sending of Link State
  5324.     Request    Packets    with the reception of Database Description
  5325.     Packets.
  5326.  
  5327.  
  5328. 11.  The Routing Table Structure
  5329.  
  5330.     The    routing    table data structure contains all the information
  5331.     necessary to forward an IP data packet toward its destination.  Each
  5332.     routing table entry    describes the collection of best paths to a
  5333.     particular destination.  When forwarding an    IP data    packet,    the
  5334.     routing table entry    providing the best match for the packet's IP
  5335.     destination    is located.  The matching routing table    entry then
  5336.     provides the next hop towards the packet's destination.  OSPF also
  5337.     provides for the existence of a default route (Destination ID =
  5338.     DefaultDestination,    Address    Mask =    0x00000000).  When the default
  5339.     route exists, it matches all IP destinations (although any other
  5340.     matching entry is a    better match).    Finding    the routing table entry
  5341.     that best matches an IP destination    is further described in    Section
  5342.     11.1.
  5343.  
  5344.     There is a single routing table in each router.  Two sample    routing
  5345.     tables are described in Sections 11.2 and 11.3.  The building of the
  5346.     routing table is discussed in Section 16.
  5347.  
  5348.  
  5349.  
  5350.  
  5351. Moy                Standards Track              [Page 107]
  5352.  
  5353. RFC 2328             OSPF Version 2              April 1998
  5354.  
  5355.  
  5356.     The    rest of    this section defines the fields    found in a routing table
  5357.     entry.  The    first set of fields describes the routing table    entry's
  5358.     destination.
  5359.  
  5360.  
  5361.     Destination    Type
  5362.     Destination type is either "network" or    "router". Only network
  5363.     entries    are actually used when forwarding IP data traffic.
  5364.     Router routing table entries are used solely as    intermediate
  5365.     steps in the routing table build process.
  5366.  
  5367.     A network is a range of    IP addresses, to which IP data traffic
  5368.     may be forwarded.  This    includes IP networks (class A, B, or C),
  5369.     IP subnets, IP supernets and single IP hosts.  The default route
  5370.     also falls into    this category.
  5371.  
  5372.     Router entries are kept    for area border    routers    and AS boundary
  5373.     routers.  Routing table    entries    for area border    routers    are used
  5374.     when calculating the inter-area    routes (see Section 16.2), and
  5375.     when maintaining configured virtual links (see Section 15).
  5376.     Routing    table entries for AS boundary routers are used when
  5377.     calculating the    AS external routes (see    Section    16.4).
  5378.  
  5379.     Destination    ID
  5380.     The destination's identifier or    name.  This depends on the
  5381.     Destination Type.  For networks, the identifier    is their
  5382.     associated IP address.    For routers, the identifier is the OSPF
  5383.     Router ID.[9]
  5384.  
  5385.     Address Mask
  5386.     Only defined for networks.  The    network's IP address together
  5387.     with its address mask defines a    range of IP addresses.    For IP
  5388.     subnets, the address mask is referred to as the    subnet mask.
  5389.     For host routes, the mask is "all ones"    (0xffffffff).
  5390.  
  5391.     Optional Capabilities
  5392.     When the destination is    a router this field indicates the
  5393.     optional OSPF capabilities supported by    the destination    router.
  5394.     The only optional capability defined by    this specification is
  5395.     the ability to process AS-external-LSAs.  For a    further
  5396.     discussion of OSPF's optional capabilities, see    Section    4.5.
  5397.  
  5398.  
  5399.  
  5400.  
  5401. Moy                Standards Track              [Page 108]
  5402.  
  5403. RFC 2328             OSPF Version 2              April 1998
  5404.  
  5405.  
  5406.     The    set of paths to    use for    a destination may vary based on    the OSPF
  5407.     area to which the paths belong.  This means    that there may be
  5408.     multiple routing table entries for the same    destination, depending
  5409.     on the values of the next field.
  5410.  
  5411.  
  5412.     Area
  5413.     This field indicates the area whose link state information has
  5414.     led to the routing table entry's collection of paths.  This is
  5415.     called the entry's associated area.  For sets of AS external
  5416.     paths, this field is not defined.  For destinations of type
  5417.     "router", there    may be separate    sets of    paths (and therefore
  5418.     separate routing table entries)    associated with    each of    several
  5419.     areas. For example, this will happen when two area border
  5420.     routers    share multiple areas in    common.     For destinations of
  5421.     type "network",    only the set of    paths associated with the best
  5422.     area (the one providing    the preferred route) is    kept.
  5423.  
  5424.  
  5425.     The    rest of    the routing table entry    describes the set of paths to
  5426.     the    destination.  The following fields pertain to the set of paths
  5427.     as a whole.     In other words, each one of the paths contained in a
  5428.     routing table entry    is of the same path-type and cost (see below).
  5429.  
  5430.  
  5431.     Path-type
  5432.     There are four possible    types of paths used to route traffic to
  5433.     the destination, listed    here in    decreasing order of preference:
  5434.     intra-area, inter-area,    type 1 external    or type    2 external.
  5435.     Intra-area paths indicate destinations belonging to one    of the
  5436.     router's attached areas.  Inter-area paths are paths to
  5437.     destinations in    other OSPF areas.  These are discovered    through
  5438.     the examination    of received summary-LSAs.  AS external paths are
  5439.     paths to destinations external to the AS.  These are detected
  5440.     through    the examination    of received AS-external-LSAs.
  5441.  
  5442.     Cost
  5443.     The link state cost of the path    to the destination.  For all
  5444.     paths except type 2 external paths this    describes the entire
  5445.     path's cost.  For Type 2 external paths, this field describes
  5446.     the cost of the    portion    of the path internal to    the AS.     This
  5447.  
  5448.  
  5449.  
  5450.  
  5451. Moy                Standards Track              [Page 109]
  5452.  
  5453. RFC 2328             OSPF Version 2              April 1998
  5454.  
  5455.  
  5456.     cost is    calculated as the sum of the costs of the path's
  5457.     constituent links.
  5458.  
  5459.     Type 2 cost
  5460.     Only valid for type 2 external paths.  For these paths,    this
  5461.     field indicates    the cost of the    path's external    portion.  This
  5462.     cost has been advertised by an AS boundary router, and is the
  5463.     most significant part of the total path    cost.  For example, a
  5464.     type 2 external    path with type 2 cost of 5 is always preferred
  5465.     over a path with type 2    cost of    10, regardless of the cost of
  5466.     the two    paths' internal    components.
  5467.  
  5468.     Link State Origin
  5469.     Valid only for intra-area paths, this field indicates the LSA
  5470.     (router-LSA or network-LSA) that directly references the
  5471.     destination.  For example, if the destination is a transit
  5472.     network, this is the transit network's network-LSA.  If    the
  5473.     destination is a stub network, this is the router-LSA for the
  5474.     attached router.  The LSA is discovered    during the shortest-path
  5475.     tree calculation (see Section 16.1).  Multiple LSAs may
  5476.     reference the destination, however a tie-breaking scheme always
  5477.     reduces    the choice to a    single LSA. The    Link State Origin field
  5478.     is not used by the OSPF    protocol, but it is used by the    routing
  5479.     table calculation in OSPF's Multicast routing extensions
  5480.     (MOSPF).
  5481.  
  5482.     When multiple paths    of equal path-type and cost exist to a
  5483.     destination    (called    elsewhere "equal-cost" paths), they are    stored
  5484.     in a single    routing    table entry.  Each one of the "equal-cost" paths
  5485.     is distinguished by    the following fields:
  5486.  
  5487.     Next hop
  5488.     The outgoing router interface to use when forwarding traffic to
  5489.     the destination.  On broadcast,    Point-to-MultiPoint and    NBMA
  5490.     networks, the next hop also includes the IP address of the next
  5491.     router (if any)    in the path towards the    destination.
  5492.  
  5493.     Advertising    router
  5494.     Valid only for inter-area and AS external paths.  This field
  5495.     indicates the Router ID    of the router advertising the summary-
  5496.     LSA or AS-external-LSA that led    to this    path.
  5497.  
  5498.  
  5499.  
  5500.  
  5501. Moy                Standards Track              [Page 110]
  5502.  
  5503. RFC 2328             OSPF Version 2              April 1998
  5504.  
  5505.  
  5506.     11.1.  Routing table lookup
  5507.  
  5508.     When an    IP data    packet is received, an OSPF router finds the
  5509.     routing    table entry that best matches the packet's destination.
  5510.     This routing table entry then provides the outgoing interface
  5511.     and next hop router to use in forwarding the packet. This
  5512.     section    describes the process of finding the best matching
  5513.     routing    table entry.
  5514.  
  5515.     Before the lookup begins, "discard" routing table entries should
  5516.     be inserted into the routing table for each of the router's
  5517.     active area address ranges (see    Section    3.5).  (An area    range is
  5518.     considered "active" if the range contains one or more networks
  5519.     reachable by intra-area    paths.)    The destination    of a "discard"
  5520.     entry is the set of addresses described    by its associated active
  5521.     area address range, and    the path type of each "discard"    entry is
  5522.     set to "inter-area".[10]
  5523.  
  5524.     Several    routing    table entries may match    the destination    address.
  5525.     In this    case, the "best    match" is the routing table entry that
  5526.     provides the most specific (longest) match. Another way    of
  5527.     saying this is to choose the entry that    specifies the narrowest
  5528.     range of IP addresses.[11] For example,    the entry for the
  5529.     address/mask pair of (128.185.1.0, 0xffffff00) is more specific
  5530.     than an    entry for the pair (128.185.0.0, 0xffff0000). The
  5531.     default    route is the least specific match, since it matches all
  5532.     destinations. (Note that for any single    routing    table entry,
  5533.     multiple paths may be possible.    In these cases,    the calculations
  5534.     in Sections 16.1, 16.2,    and 16.4 always    yield the paths    having
  5535.     the most preferential path-type, as described in Section 11).
  5536.  
  5537.     If there is no matching    routing    table entry, or    the best match
  5538.     routing    table entry is one of the above    "discard" routing table
  5539.     entries, then the packet's IP destination is considered
  5540.     unreachable. Instead of    being forwarded, the packet should then
  5541.     be discarded and an ICMP destination unreachable message should
  5542.     be returned to the packet's source.
  5543.  
  5544.     11.2.  Sample routing table, without areas
  5545.  
  5546.     Consider the Autonomous    System pictured    in Figure 2.  No OSPF
  5547.     areas have been    configured.  A single metric is    shown per
  5548.  
  5549.  
  5550.  
  5551. Moy                Standards Track              [Page 111]
  5552.  
  5553. RFC 2328             OSPF Version 2              April 1998
  5554.  
  5555.  
  5556.     outbound interface.  The calculation of    Router RT6's routing
  5557.     table proceeds as described in Section 2.2.  The resulting
  5558.     routing    table is shown in Table    12.  Destination types are
  5559.     abbreviated: Network as    "N", Router as "R".
  5560.  
  5561.     There are no instances of multiple equal-cost shortest paths in
  5562.     this example.  Also, since there are no    areas, there are no
  5563.     inter-area paths.
  5564.  
  5565.     Routers    RT5 and    RT7 are    AS boundary routers.  Intra-area routes
  5566.     have been calculated to    Routers    RT5 and    RT7.  This allows
  5567.     external routes    to be calculated to the    destinations advertised
  5568.     by RT5 and RT7 (i.e., Networks N12, N13, N14 and N15).    It is
  5569.     assumed    all AS-external-LSAs originated    by RT5 and RT7 are
  5570.     advertising type 1 external metrics.  This results in type 1
  5571.     external paths being calculated    to destinations    N12-N15.
  5572.  
  5573.  
  5574.  
  5575.     11.3.  Sample routing table, with areas
  5576.  
  5577.     Consider the previous example, this time split into OSPF areas.
  5578.     An OSPF    area configuration is pictured in Figure 6.  Router
  5579.     RT4's routing table will be described for this area
  5580.     configuration.    Router RT4 has a connection to Area 1 and a
  5581.     backbone connection.  This causes Router RT4 to    view the AS as
  5582.     the concatenation of the two graphs shown in Figures 7 and 8.
  5583.     The resulting routing table is displayed in Table 13.
  5584.  
  5585.     Again, Routers RT5 and RT7 are AS boundary routers.  Routers
  5586.     RT3, RT4, RT7, RT10 and    RT11 are area border routers.  Note that
  5587.     there are two routing entries for the area border router RT3,
  5588.     since it has two areas in common with RT4 (Area    1 and the
  5589.     backbone).
  5590.  
  5591.     Backbone paths have been calculated to all area    border routers.
  5592.     These are used when determining    the inter-area routes.    Note
  5593.     that all of the    inter-area routes are associated with the
  5594.     backbone; this is always the case when the calculating router is
  5595.     itself an area border router.  Routing information is condensed
  5596.     at area    boundaries.  In    this example, we assume    that Area 3 has
  5597.     been defined so    that networks N9-N11 and the host route    to H1
  5598.  
  5599.  
  5600.  
  5601. Moy                Standards Track              [Page 112]
  5602.  
  5603. RFC 2328             OSPF Version 2              April 1998
  5604.  
  5605.  
  5606.  
  5607.  
  5608.       Type   Dest   Area   Path     Type     Cost    Next     Adv.
  5609.                         Hop(s)     Router(s)
  5610.       ____________________________________________________________
  5611.       N         N1        0       intra-area     10    RT3     *
  5612.       N         N2        0       intra-area     10    RT3     *
  5613.       N         N3        0       intra-area     7    RT3     *
  5614.       N         N4        0       intra-area     8    RT3     *
  5615.       N         Ib        0       intra-area     7    *     *
  5616.       N         Ia        0       intra-area     12    RT10     *
  5617.       N         N6        0       intra-area     8    RT10     *
  5618.       N         N7        0       intra-area     12    RT10     *
  5619.       N         N8        0       intra-area     10    RT10     *
  5620.       N         N9        0       intra-area     11    RT10     *
  5621.       N         N10    0       intra-area     13    RT10     *
  5622.       N         N11    0       intra-area     14    RT10     *
  5623.       N         H1        0       intra-area     21    RT10     *
  5624.       R         RT5    0       intra-area     6    RT5     *
  5625.       R         RT7    0       intra-area     8    RT10     *
  5626.       ____________________________________________________________
  5627.       N         N12    *       type    1 ext.     10    RT10     RT7
  5628.       N         N13    *       type    1 ext.     14    RT5     RT5
  5629.       N         N14    *       type    1 ext.     14    RT5     RT5
  5630.       N         N15    *       type    1 ext.     17    RT10     RT7
  5631.  
  5632.  
  5633.            Table 12: The routing table for Router RT6
  5634.              (no configured    areas).
  5635.  
  5636.     are all    condensed to a single route when advertised into the
  5637.     backbone (by Router RT11).  Note that the cost of this route is
  5638.     the maximum of the set of costs    to its individual components.
  5639.  
  5640.     There is a virtual link    configured between Routers RT10    and
  5641.     RT11.  Without this configured virtual link, RT11 would    be
  5642.     unable to advertise a route for    networks N9-N11    and Host H1 into
  5643.     the backbone, and there    would not be an    entry for these    networks
  5644.     in Router RT4's    routing    table.
  5645.  
  5646.     In this    example    there are two equal-cost paths to Network N12.
  5647.     However, they both use the same    next hop (Router RT5).
  5648.  
  5649.  
  5650.  
  5651. Moy                Standards Track              [Page 113]
  5652.  
  5653. RFC 2328             OSPF Version 2              April 1998
  5654.  
  5655.  
  5656.     Router RT4's routing table would improve (i.e.,    some of    the
  5657.     paths in the routing table would become    shorter) if an
  5658.     additional virtual link    were configured    between    Router RT4 and
  5659.     Router RT3.  The new virtual link would    itself be associated
  5660.     with the first entry for area border router RT3    in Table 13 (an
  5661.     intra-area path    through    Area 1).  This would yield a cost of 1
  5662.     for the    virtual    link.  The routing table entries changes that
  5663.     would be caused    by the addition    of this    virtual    link are shown
  5664.  
  5665.  
  5666.    Type      Dest          Area   Path  Type       Cost      Next        Adv.
  5667.                           Hops(s)   Router(s)
  5668.    __________________________________________________________________
  5669.    N      N1          1         intra-area       4      RT1        *
  5670.    N      N2          1         intra-area       4      RT2        *
  5671.    N      N3          1         intra-area       1      *        *
  5672.    N      N4          1         intra-area       3      RT3        *
  5673.    R      RT3          1         intra-area       1      *        *
  5674.    __________________________________________________________________
  5675.    N      Ib          0         intra-area       22      RT5        *
  5676.    N      Ia          0         intra-area       27      RT5        *
  5677.    R      RT3          0         intra-area       21      RT5        *
  5678.    R      RT5          0         intra-area       8      *        *
  5679.    R      RT7          0         intra-area       14      RT5        *
  5680.    R      RT10          0         intra-area       22      RT5        *
  5681.    R      RT11          0         intra-area       25      RT5        *
  5682.    __________________________________________________________________
  5683.    N      N6          0         inter-area       15      RT5        RT7
  5684.    N      N7          0         inter-area       19      RT5        RT7
  5685.    N      N8          0         inter-area       18      RT5        RT7
  5686.    N      N9-N11,H1   0         inter-area       36      RT5        RT11
  5687.    __________________________________________________________________
  5688.    N      N12          *         type 1 ext.   16      RT5        RT5,RT7
  5689.    N      N13          *         type 1 ext.   16      RT5        RT5
  5690.    N      N14          *         type 1 ext.   16      RT5        RT5
  5691.    N      N15          *         type 1 ext.   23      RT5        RT7
  5692.  
  5693.  
  5694.           Table    13: Router RT4's routing table
  5695.                in the presence of areas.
  5696.  
  5697.  
  5698.  
  5699.  
  5700.  
  5701. Moy                Standards Track              [Page 114]
  5702.  
  5703. RFC 2328             OSPF Version 2              April 1998
  5704.  
  5705.  
  5706.     in Table 14.
  5707.  
  5708.  
  5709.  
  5710. 12.  Link State    Advertisements (LSAs)
  5711.  
  5712.     Each router    in the Autonomous System originates one    or more    link
  5713.     state advertisements (LSAs).  This memo defines five distinct types
  5714.     of LSAs, which are described in Section 4.3.  The collection of LSAs
  5715.     forms the link-state database.  Each separate type of LSA has a
  5716.     separate function.    Router-LSAs and    network-LSAs describe how an
  5717.     area's routers and networks    are interconnected.  Summary-LSAs
  5718.     provide a way of condensing    an area's routing information.    AS-
  5719.     external-LSAs provide a way    of transparently advertising
  5720.     externally-derived routing information throughout the Autonomous
  5721.     System.
  5722.  
  5723.     Each LSA begins with a standard 20-byte header.  This LSA header is
  5724.     discussed below.
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.     Type   Dest           Area   Path  Type   Cost      Next       Adv.
  5733.                           Hop(s)   Router(s)
  5734.     ________________________________________________________________
  5735.     N       Ib           0      intra-area   16      RT3       *
  5736.     N       Ia           0      intra-area   21      RT3       *
  5737.     R       RT3           0      intra-area   1      *       *
  5738.     R       RT10           0      intra-area   16      RT3       *
  5739.     R       RT11           0      intra-area   19      RT3       *
  5740.     ________________________________________________________________
  5741.     N       N9-N11,H1   0      inter-area   30      RT3       RT11
  5742.  
  5743.  
  5744.           Table    14: Changes resulting from an
  5745.             additional virtual link.
  5746.  
  5747.  
  5748.  
  5749.  
  5750.  
  5751. Moy                Standards Track              [Page 115]
  5752.  
  5753. RFC 2328             OSPF Version 2              April 1998
  5754.  
  5755.  
  5756.     12.1.  The LSA Header
  5757.  
  5758.     The LSA    header contains    the LS type, Link State    ID and
  5759.     Advertising Router fields.  The    combination of these three
  5760.     fields uniquely    identifies the LSA.
  5761.  
  5762.     There may be several instances of an LSA present in the
  5763.     Autonomous System, all at the same time.  It must then be
  5764.     determined which instance is more recent.  This    determination is
  5765.     made by    examining the LS sequence, LS checksum and LS age
  5766.     fields.     These fields are also contained in the    20-byte    LSA
  5767.     header.
  5768.  
  5769.     Several    of the OSPF packet types list LSAs.  When the instance
  5770.     is not important, an LSA is referred to    by its LS type,    Link
  5771.     State ID and Advertising Router    (see Link State    Request
  5772.     Packets).  Otherwise, the LS sequence number, LS age and LS
  5773.     checksum fields    must also be referenced.
  5774.  
  5775.     A detailed explanation of the fields contained in the LSA header
  5776.     follows.
  5777.  
  5778.  
  5779.     12.1.1.     LS age
  5780.  
  5781.         This field is the age of the LSA in    seconds.  It should be
  5782.         processed as an unsigned 16-bit integer.  It is set    to 0
  5783.         when the LSA is originated.     It must be incremented    by
  5784.         InfTransDelay on every hop of the flooding procedure.  LSAs
  5785.         are    also aged as they are held in each router's database.
  5786.  
  5787.         The    age of an LSA is never incremented past    MaxAge.     LSAs
  5788.         having age MaxAge are not used in the routing table
  5789.         calculation.  When an LSA's    age first reaches MaxAge, it is
  5790.         reflooded.    An LSA of age MaxAge is    finally    flushed    from the
  5791.         database when it is    no longer needed to ensure database
  5792.         synchronization.  For more information on the aging    of LSAs,
  5793.         consult Section 14.
  5794.  
  5795.         The    LS age field is    examined when a    router receives    two
  5796.         instances of an LSA, both having identical LS sequence
  5797.         numbers and    LS checksums.  An instance of age MaxAge is then
  5798.  
  5799.  
  5800.  
  5801. Moy                Standards Track              [Page 116]
  5802.  
  5803. RFC 2328             OSPF Version 2              April 1998
  5804.  
  5805.  
  5806.         always accepted as most recent; this allows    old LSAs to be
  5807.         flushed quickly from the routing domain.  Otherwise, if the
  5808.         ages differ    by more    than MaxAgeDiff, the instance having the
  5809.         smaller age    is accepted as most recent.[12]    See Section 13.1
  5810.         for    more details.
  5811.  
  5812.  
  5813.     12.1.2.     Options
  5814.  
  5815.         The    Options    field in the LSA header    indicates which    optional
  5816.         capabilities are associated    with the LSA.  OSPF's optional
  5817.         capabilities are described in Section 4.5.    One optional
  5818.         capability is defined by this specification, represented by
  5819.         the    E-bit found in the Options field.  The unrecognized bits
  5820.         in the Options field should    be set to zero.
  5821.  
  5822.         The    E-bit represents OSPF's    ExternalRoutingCapability.  This
  5823.         bit    should be set in all LSAs associated with the backbone,
  5824.         and    all LSAs associated with non-stub areas    (see Section
  5825.         3.6).  It should also be set in all    AS-external-LSAs.  It
  5826.         should be reset in all router-LSAs,    network-LSAs and
  5827.         summary-LSAs associated with a stub    area.  For all LSAs, the
  5828.         setting of the E-bit is for    informational purposes only; it
  5829.         does not affect the    routing    table calculation.
  5830.  
  5831.  
  5832.     12.1.3.     LS type
  5833.  
  5834.         The    LS type    field dictates the format and function of the
  5835.         LSA.  LSAs of different types have different names (e.g.,
  5836.         router-LSAs    or network-LSAs).  All LSA types defined by this
  5837.         memo, except the AS-external-LSAs (LS type = 5), are flooded
  5838.         throughout a single    area only.  AS-external-LSAs are flooded
  5839.         throughout the entire Autonomous System, excepting stub
  5840.         areas (see Section 3.6).  Each separate LSA    type is    briefly
  5841.         described below in Table 15.
  5842.  
  5843.     12.1.4.     Link State ID
  5844.  
  5845.         This field identifies the piece of the routing domain that
  5846.         is being described by the LSA.  Depending on the LSA's LS
  5847.         type, the Link State ID takes on the values    listed in Table
  5848.  
  5849.  
  5850.  
  5851. Moy                Standards Track              [Page 117]
  5852.  
  5853. RFC 2328             OSPF Version 2              April 1998
  5854.  
  5855.  
  5856.  
  5857.  
  5858.         LS Type   LSA description
  5859.         ________________________________________________
  5860.         1          These are    the router-LSAs.
  5861.               They describe the    collected
  5862.                states of the router's
  5863.               interfaces. For more information,
  5864.               consult Section 12.4.1.
  5865.         ________________________________________________
  5866.         2          These are    the network-LSAs.
  5867.               They describe the    set of routers
  5868.               attached to the network. For
  5869.               more information,    consult
  5870.               Section 12.4.2.
  5871.         ________________________________________________
  5872.         3 or 4    These are    the summary-LSAs.
  5873.               They describe inter-area routes,
  5874.               and enable the condensation of
  5875.               routing information at area
  5876.               borders. Originated by area border
  5877.               routers, the Type    3 summary-LSAs
  5878.               describe routes to networks while    the
  5879.               Type 4 summary-LSAs describe routes to
  5880.               AS boundary routers.
  5881.         ________________________________________________
  5882.         5          These are    the AS-external-LSAs.
  5883.               Originated by AS boundary    routers,
  5884.               they describe routes
  5885.               to destinations external to the
  5886.               Autonomous System. A default route for
  5887.               the Autonomous System can    also be
  5888.               described    by an AS-external-LSA.
  5889.  
  5890.  
  5891.         Table 15: OSPF link    state advertisements (LSAs).
  5892.  
  5893.         16.
  5894.  
  5895.  
  5896.         Actually, for Type 3 summary-LSAs (LS type = 3) and    AS-
  5897.         external-LSAs (LS type = 5), the Link State    ID may
  5898.  
  5899.  
  5900.  
  5901. Moy                Standards Track              [Page 118]
  5902.  
  5903. RFC 2328             OSPF Version 2              April 1998
  5904.  
  5905.  
  5906.  
  5907.  
  5908.         LS Type   Link State ID
  5909.         _______________________________________________
  5910.         1          The originating router's Router ID.
  5911.         2          The IP interface address of the
  5912.               network's    Designated Router.
  5913.         3          The destination network's    IP address.
  5914.         4          The Router ID of the described AS
  5915.               boundary router.
  5916.         5          The destination network's    IP address.
  5917.  
  5918.  
  5919.            Table 16: The LSA's Link State ID.
  5920.  
  5921.         additionally have one or more of the destination network's
  5922.         "host" bits    set. For example, when originating an AS-
  5923.         external-LSA for the network 10.0.0.0 with mask of
  5924.         255.0.0.0, the Link    State ID can be    set to anything    in the
  5925.         range 10.0.0.0 through 10.255.255.255 inclusive (although
  5926.         10.0.0.0 should be used whenever possible).    The freedom to
  5927.         set    certain    host bits allows a router to originate separate
  5928.         LSAs for two networks having the same address but different
  5929.         masks. See Appendix    E for details.
  5930.  
  5931.         When the LSA is describing a network (LS type = 2, 3 or 5),
  5932.         the    network's IP address is    easily derived by masking the
  5933.         Link State ID with the network/subnet mask contained in the
  5934.         body of the    LSA.  When the LSA is describing a router (LS
  5935.         type = 1 or    4), the    Link State ID is always    the described
  5936.         router's OSPF Router ID.
  5937.  
  5938.         When an AS-external-LSA (LS    Type = 5) is describing    a
  5939.         default route, its Link State ID is    set to
  5940.         DefaultDestination (0.0.0.0).
  5941.  
  5942.  
  5943.     12.1.5.     Advertising Router
  5944.  
  5945.         This field specifies the OSPF Router ID of the LSA's
  5946.         originator.     For router-LSAs, this field is    identical to the
  5947.         Link State ID field.  Network-LSAs are originated by the
  5948.  
  5949.  
  5950.  
  5951. Moy                Standards Track              [Page 119]
  5952.  
  5953. RFC 2328             OSPF Version 2              April 1998
  5954.  
  5955.  
  5956.         network's Designated Router.  Summary-LSAs originated by
  5957.         area border    routers.  AS-external-LSAs are originated by AS
  5958.         boundary routers.
  5959.  
  5960.  
  5961.     12.1.6.     LS sequence number
  5962.  
  5963.         The    sequence number    field is a signed 32-bit integer.  It is
  5964.         used to detect old and duplicate LSAs.  The    space of
  5965.         sequence numbers is    linearly ordered.  The larger the
  5966.         sequence number (when compared as signed 32-bit integers)
  5967.         the    more recent the    LSA.  To describe to sequence number
  5968.         space more precisely, let N    refer in the discussion    below to
  5969.         the    constant 2**31.
  5970.  
  5971.         The    sequence number    -N (0x80000000)    is reserved (and
  5972.         unused).  This leaves -N + 1 (0x80000001) as the smallest
  5973.         (and therefore oldest) sequence number; this sequence number
  5974.         is referred    to as the constant InitialSequenceNumber. A
  5975.         router uses    InitialSequenceNumber the first    time it
  5976.         originates any LSA.     Afterwards, the LSA's sequence    number
  5977.         is incremented each    time the router    originates a new
  5978.         instance of    the LSA.  When an attempt is made to increment
  5979.         the    sequence number    past the maximum value of N - 1
  5980.         (0x7fffffff; also referred to as MaxSequenceNumber), the
  5981.         current instance of    the LSA    must first be flushed from the
  5982.         routing domain.  This is done by prematurely aging the LSA
  5983.         (see Section 14.1) and reflooding it.  As soon as this flood
  5984.         has    been acknowledged by all adjacent neighbors, a new
  5985.         instance can be originated with sequence number of
  5986.         InitialSequenceNumber.
  5987.  
  5988.         The    router may be forced to    promote    the sequence number of
  5989.         one    of its LSAs when a more    recent instance    of the LSA is
  5990.         unexpectedly received during the flooding process.    This
  5991.         should be a    rare event.  This may indicate that an out-of-
  5992.         date LSA, originated by the    router itself before its last
  5993.         restart/reload, still exists in the    Autonomous System.  For
  5994.         more information see Section 13.4.
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001. Moy                Standards Track              [Page 120]
  6002.  
  6003. RFC 2328             OSPF Version 2              April 1998
  6004.  
  6005.  
  6006.     12.1.7.     LS checksum
  6007.  
  6008.         This field is the checksum of the complete contents    of the
  6009.         LSA, excepting the LS age field.  The LS age field is
  6010.         excepted so    that an    LSA's age can be incremented without
  6011.         updating the checksum.  The    checksum used is the same that
  6012.         is used for    ISO connectionless datagrams; it is commonly
  6013.         referred to    as the Fletcher    checksum.  It is documented in
  6014.         Annex B of [Ref6].    The LSA    header also contains the length
  6015.         of the LSA in bytes; subtracting the size of the LS    age
  6016.         field (two bytes) yields the amount    of data    to checksum.
  6017.  
  6018.         The    checksum is used to detect data    corruption of an LSA.
  6019.         This corruption can    occur while an LSA is being flooded, or
  6020.         while it is    being held in a    router's memory.  The LS
  6021.         checksum field cannot take on the value of zero; the
  6022.         occurrence of such a value should be considered a checksum
  6023.         failure.  In other words, calculation of the checksum is not
  6024.         optional.
  6025.  
  6026.         The    checksum of an LSA is verified in two cases:  a) when it
  6027.         is received    in a Link State    Update Packet and b) at    times
  6028.         during the aging of    the link state database.  The detection
  6029.         of a checksum failure leads    to separate actions in each
  6030.         case.  See Sections    13 and 14 for more details.
  6031.  
  6032.         Whenever the LS sequence number field indicates that two
  6033.         instances of an LSA    are the    same, the LS checksum field is
  6034.         examined.  If there    is a difference, the instance with the
  6035.         larger LS checksum is considered to    be most    recent.[13] See
  6036.         Section 13.1 for more details.
  6037.  
  6038.  
  6039.     12.2.  The link state database
  6040.  
  6041.     A router has a separate    link state database for    every area to
  6042.     which it belongs. All routers belonging    to the same area have
  6043.     identical link state databases for the area.
  6044.  
  6045.     The databases for each individual area are always dealt    with
  6046.     separately.  The shortest path calculation is performed
  6047.     separately for each area (see Section 16).  Components of the
  6048.  
  6049.  
  6050.  
  6051. Moy                Standards Track              [Page 121]
  6052.  
  6053. RFC 2328             OSPF Version 2              April 1998
  6054.  
  6055.  
  6056.     area link-state    database are flooded throughout    the area only.
  6057.     Finally, when an adjacency (belonging to Area A) is being
  6058.     brought    up, only the database for Area A is synchronized between
  6059.     the two    routers.
  6060.  
  6061.     The area database is composed of router-LSAs, network-LSAs and
  6062.     summary-LSAs (all listed in the    area data structure).  In
  6063.     addition, external routes (AS-external-LSAs) are included in all
  6064.     non-stub area databases    (see Section 3.6).
  6065.  
  6066.     An implementation of OSPF must be able to access individual
  6067.     pieces of an area database.  This lookup function is based on an
  6068.     LSA's LS type, Link State ID and Advertising Router.[14] There
  6069.     will be    a single instance (the most up-to-date)    of each    LSA in
  6070.     the database.  The database lookup function is invoked during
  6071.     the LSA    flooding procedure (Section 13)    and the    routing    table
  6072.     calculation (Section 16).  In addition,    using this lookup
  6073.     function the router can    determine whether it has itself    ever
  6074.     originated a particular    LSA, and if so,    with what LS sequence
  6075.     number.
  6076.  
  6077.     An LSA is added    to a router's database when either a) it is
  6078.     received during    the flooding process (Section 13) or b)    it is
  6079.     originated by the router itself    (Section 12.4).     An LSA    is
  6080.     deleted    from a router's    database when either a)    it has been
  6081.     overwritten by a newer instance    during the flooding process
  6082.     (Section 13) or    b) the router originates a newer instance of one
  6083.     of its self-originated LSAs (Section 12.4) or c) the LSA ages
  6084.     out and    is flushed from    the routing domain (Section 14).
  6085.     Whenever an LSA    is deleted from    the database it    must also be
  6086.     removed    from all neighbors' Link state retransmission lists (see
  6087.     Section    10).
  6088.  
  6089.  
  6090.     12.3.  Representation of TOS
  6091.  
  6092.     For backward compatibility with    previous versions of the OSPF
  6093.     specification ([Ref9]),    TOS-specific information can be    included
  6094.     in router-LSAs,    summary-LSAs and AS-external-LSAs.  The    encoding
  6095.     of TOS in OSPF LSAs is specified in Table 17. That table relates
  6096.     the OSPF encoding to the IP packet header's TOS    field (defined
  6097.     in [Ref12]).  The OSPF encoding    is expressed as    a decimal
  6098.  
  6099.  
  6100.  
  6101. Moy                Standards Track              [Page 122]
  6102.  
  6103. RFC 2328             OSPF Version 2              April 1998
  6104.  
  6105.  
  6106.     integer, and the IP packet header's TOS    field is expressed in
  6107.     the binary TOS values used in [Ref12].
  6108.  
  6109.  
  6110.  
  6111.             OSPF encoding   RFC    1349 TOS values
  6112.             ___________________________________________
  6113.             0            0000 normal    service
  6114.             2            0001 minimize monetary cost
  6115.             4            0010 maximize reliability
  6116.             6            0011
  6117.             8            0100 maximize throughput
  6118.             10            0101
  6119.             12            0110
  6120.             14            0111
  6121.             16            1000 minimize delay
  6122.             18            1001
  6123.             20            1010
  6124.             22            1011
  6125.             24            1100
  6126.             26            1101
  6127.             28            1110
  6128.             30            1111
  6129.  
  6130.  
  6131.             Table 17: Representing TOS in OSPF.
  6132.  
  6133.  
  6134.     12.4.  Originating LSAs
  6135.  
  6136.     Into any given OSPF area, a router will    originate several LSAs.
  6137.     Each router originates a router-LSA.  If the router is also the
  6138.     Designated Router for any of the area's    networks, it will
  6139.     originate network-LSAs for those networks.
  6140.  
  6141.     Area border routers originate a    single summary-LSA for each
  6142.     known inter-area destination.  AS boundary routers originate a
  6143.     single AS-external-LSA for each    known AS external destination.
  6144.     Destinations are advertised one    at a time so that the change in
  6145.     any single route can be    flooded    without    reflooding the entire
  6146.     collection of routes.  During the flooding procedure, many LSAs
  6147.     can be carried by a single Link    State Update packet.
  6148.  
  6149.  
  6150.  
  6151. Moy                Standards Track              [Page 123]
  6152.  
  6153. RFC 2328             OSPF Version 2              April 1998
  6154.  
  6155.  
  6156.     As an example, consider    Router RT4 in Figure 6.     It is an area
  6157.     border router, having a    connection to Area 1 and the backbone.
  6158.     Router RT4 originates 5    distinct LSAs into the backbone    (one
  6159.     router-LSA, and    one summary-LSA    for each of the    networks N1-N4).
  6160.     Router RT4 will    also originate 8 distinct LSAs into Area 1 (one
  6161.     router-LSA and seven summary-LSAs as pictured in Figure    7).  If
  6162.     RT4 has    been selected as Designated Router for Network N3, it
  6163.     will also originate a network-LSA for N3 into Area 1.
  6164.  
  6165.     In this    same figure, Router RT5    will be    originating 3 distinct
  6166.     AS-external-LSAs (one for each of the networks N12-N14).  These
  6167.     will be    flooded    throughout the entire AS, assuming that    none of
  6168.     the areas have been configured as stubs.  However, if area 3 has
  6169.     been configured    as a stub area,    the AS-external-LSAs for
  6170.     networks N12-N14 will not be flooded into area 3 (see Section
  6171.     3.6).  Instead,    Router RT11 would originate a default summary-
  6172.     LSA that would be flooded throughout area 3 (see Section
  6173.     12.4.3).  This instructs all of    area 3's internal routers to
  6174.     send their AS external traffic to RT11.
  6175.  
  6176.     Whenever a new instance    of an LSA is originated, its LS    sequence
  6177.     number is incremented, its LS age is set to 0, its LS checksum
  6178.     is calculated, and the LSA is added to the link    state database
  6179.     and flooded out    the appropriate    interfaces.  See Section 13.2
  6180.     for details concerning the installation    of the LSA into    the link
  6181.     state database.     See Section 13.3 for details concerning the
  6182.     flooding of newly originated LSAs.
  6183.  
  6184.  
  6185.     The ten    events that can    cause a    new instance of    an LSA to be
  6186.     originated are:
  6187.  
  6188.  
  6189.     (1) The    LS age field of    one of the router's self-originated LSAs
  6190.         reaches the    value LSRefreshTime. In    this case, a new
  6191.         instance of    the LSA    is originated, even though the contents
  6192.         of the LSA (apart from the LSA header) will    be the same.
  6193.         This guarantees periodic originations of all LSAs.    This
  6194.         periodic updating of LSAs adds robustness to the link state
  6195.         algorithm.    LSAs that solely describe unreachable
  6196.         destinations should    not be refreshed, but should instead be
  6197.         flushed from the routing domain (see Section 14.1).
  6198.  
  6199.  
  6200.  
  6201. Moy                Standards Track              [Page 124]
  6202.  
  6203. RFC 2328             OSPF Version 2              April 1998
  6204.  
  6205.  
  6206.     When whatever is being described by an LSA changes, a new LSA is
  6207.     originated.  However, two instances of the same    LSA may    not be
  6208.     originated within the time period MinLSInterval.  This may
  6209.     require    that the generation of the next    instance be delayed by
  6210.     up to MinLSInterval.  The following events may cause the
  6211.     contents of an LSA to change.  These events should cause new
  6212.     originations if    and only if the    contents of the    new LSA    would be
  6213.     different:
  6214.  
  6215.  
  6216.     (2) An interface's state changes (see Section 9.1).  This may
  6217.         mean that it is necessary to produce a new instance    of the
  6218.         router-LSA.
  6219.  
  6220.     (3) An attached    network's Designated Router changes.  A    new
  6221.         router-LSA should be originated.  Also, if the router itself
  6222.         is now the Designated Router, a new    network-LSA should be
  6223.         produced.  If the router itself is no longer the Designated
  6224.         Router, any    network-LSA that it might have originated for
  6225.         the    network    should be flushed from the routing domain (see
  6226.         Section 14.1).
  6227.  
  6228.     (4) One    of the neighboring routers changes to/from the FULL
  6229.         state.  This may mean that it is necessary to produce a new
  6230.         instance of    the router-LSA.     Also, if the router is    itself
  6231.         the    Designated Router for the attached network, a new
  6232.         network-LSA    should be produced.
  6233.  
  6234.  
  6235.     The next four events concern area border routers only:
  6236.  
  6237.  
  6238.     (5) An intra-area route    has been added/deleted/modified    in the
  6239.         routing table.  This may cause a new instance of a summary-
  6240.         LSA    (for this route) to be originated in each attached area
  6241.         (possibly including    the backbone).
  6242.  
  6243.     (6) An inter-area route    has been added/deleted/modified    in the
  6244.         routing table.  This may cause a new instance of a summary-
  6245.         LSA    (for this route) to be originated in each attached area
  6246.         (but NEVER for the backbone).
  6247.  
  6248.  
  6249.  
  6250.  
  6251. Moy                Standards Track              [Page 125]
  6252.  
  6253. RFC 2328             OSPF Version 2              April 1998
  6254.  
  6255.  
  6256.     (7) The    router becomes newly attached to an area.  The router
  6257.         must then originate    summary-LSAs into the newly attached
  6258.         area for all pertinent intra-area and inter-area routes in
  6259.         the    router's routing table.     See Section 12.4.3 for    more
  6260.         details.
  6261.  
  6262.     (8) When the state of one of the router's configured virtual
  6263.         links changes, it may be necessary to originate a new
  6264.         router-LSA into the    virtual    link's Transit area (see the
  6265.         discussion of the router-LSA's bit V in Section 12.4.1), as
  6266.         well as originating    a new router-LSA into the backbone.
  6267.  
  6268.  
  6269.     The last two events concern AS boundary    routers    (and former AS
  6270.     boundary routers) only:
  6271.  
  6272.  
  6273.     (9) An external    route gained through direct experience with an
  6274.         external routing protocol (like BGP) changes.  This    will
  6275.         cause an AS    boundary router    to originate a new instance of
  6276.         an AS-external-LSA.
  6277.  
  6278.     (10)
  6279.         A router ceases to be an AS    boundary router, perhaps after
  6280.         restarting.    In this    situation the router should flush all
  6281.         AS-external-LSAs that it had previously originated.     These
  6282.         LSAs can be    flushed    via the    premature aging    procedure
  6283.         specified in Section 14.1.
  6284.  
  6285.  
  6286.     The construction of each type of LSA is    explained in detail
  6287.     below.    In general, these sections describe the    contents of the
  6288.     LSA body (i.e.,    the part coming    after the 20-byte LSA header).
  6289.     For information    concerning the building    of the LSA header, see
  6290.     Section    12.1.
  6291.  
  6292.     12.4.1.     Router-LSAs
  6293.  
  6294.         A router originates    a router-LSA for each area that    it
  6295.         belongs to.     Such an LSA describes the collected states of
  6296.         the    router's links to the area.  The LSA is    flooded
  6297.         throughout the particular area, and    no further.
  6298.  
  6299.  
  6300.  
  6301. Moy                Standards Track              [Page 126]
  6302.  
  6303. RFC 2328             OSPF Version 2              April 1998
  6304.  
  6305.  
  6306.  
  6307.           ....................................
  6308.           . 192.1.2              Area 1 .
  6309.           .    +                 .
  6310.           .    |                 .
  6311.           .    | 3+---+1             .
  6312.           .  N1    |--|RT1|-----+             .
  6313.           .    |  +---+      \             .
  6314.           .    |           \  _______N3  .
  6315.           .    +        \/     \   .    1+---+
  6316.           .            * 192.1.1 *------|RT4|
  6317.           .    +        /\_______/   .     +---+
  6318.           .    |           /     |         .
  6319.           .    | 3+---+1     /         |         .
  6320.           .  N2    |--|RT2|-----+        1|         .
  6321.           .    |  +---+       +---+8    .           6+---+
  6322.           .    |           |RT3|----------------|RT6|
  6323.           .    +           +---+     .        +---+
  6324.           . 192.1.3             |2         .     18.10.0.6|7
  6325.           .                 |         .          |
  6326.           .              +------------+ .
  6327.           .            192.1.4    (N4) .
  6328.           ....................................
  6329.  
  6330.  
  6331.             Figure 15: Area 1 with IP addresses    shown
  6332.  
  6333.         The    format of a router-LSA is shown    in Appendix A (Section
  6334.         A.4.2).  The first 20 bytes    of the LSA consist of the
  6335.         generic LSA    header that was    discussed in Section 12.1.
  6336.         router-LSAs    have LS    type = 1.
  6337.  
  6338.         A router also indicates whether it is an area border router,
  6339.         or an AS boundary router, by setting the appropriate bits
  6340.         (bit B and bit E, respectively) in its router-LSAs.    This
  6341.         enables paths to those types of routers to be saved    in the
  6342.         routing table, for later processing    of summary-LSAs    and AS-
  6343.         external-LSAs.  Bit    B should be set    whenever the router is
  6344.         actively attached to two or    more areas, even if the    router
  6345.         is not currently attached to the OSPF backbone area.  Bit E
  6346.         should never be set    in a router-LSA    for a stub area    (stub
  6347.         areas cannot contain AS boundary routers).
  6348.  
  6349.  
  6350.  
  6351. Moy                Standards Track              [Page 127]
  6352.  
  6353. RFC 2328             OSPF Version 2              April 1998
  6354.  
  6355.  
  6356.         In addition, the router sets bit V in its router-LSA for
  6357.         Area A if and only if the router is    the endpoint of    one or
  6358.         more fully adjacent    virtual    links having Area A as their
  6359.         Transit area. The setting of bit V enables other routers in
  6360.         Area A to discover whether the area    supports transit traffic
  6361.         (see TransitCapability in Section 6).
  6362.  
  6363.         The    router-LSA then    describes the router's working
  6364.         connections    (i.e., interfaces or links) to the area.  Each
  6365.         link is typed according to the kind    of attached network.
  6366.         Each link is also labelled with its    Link ID.  This Link ID
  6367.         gives a name to the    entity that is on the other end    of the
  6368.         link.  Table 18 summarizes the values used for the Type and
  6369.         Link ID fields.
  6370.  
  6371.  
  6372.  
  6373.            Link    type   Description     Link ID
  6374.            __________________________________________________
  6375.            1           Point-to-point     Neighbor Router ID
  6376.                    link
  6377.            2           Link to transit     Interface address of
  6378.                    network         Designated Router
  6379.            3           Link to stub     IP network number
  6380.                    network
  6381.            4           Virtual link     Neighbor Router ID
  6382.  
  6383.  
  6384.                Table 18: Link descriptions in the
  6385.                       router-LSA.
  6386.  
  6387.  
  6388.         In addition, the Link Data field is    specified for each link.
  6389.         This field gives 32    bits of    extra information for the link.
  6390.         For    links to transit networks, numbered point-to-point links
  6391.         and    virtual    links, this field specifies the    IP interface
  6392.         address of the associated router interface (this is    needed
  6393.         by the routing table calculation, see Section 16.1.1).  For
  6394.         links to stub networks, this field specifies the stub
  6395.         network's IP address mask.    For unnumbered point-to-point
  6396.         links, the Link Data field should be set to    the unnumbered
  6397.         interface's    MIB-II [Ref8] ifIndex value.
  6398.  
  6399.  
  6400.  
  6401. Moy                Standards Track              [Page 128]
  6402.  
  6403. RFC 2328             OSPF Version 2              April 1998
  6404.  
  6405.  
  6406.         Finally, the cost of using the link    for output is specified.
  6407.         The    output cost of a link is configurable.    With the
  6408.         exception of links to stub networks, the output cost must
  6409.         always be non-zero.
  6410.  
  6411.         To further describe    the process of building    the list of link
  6412.         descriptions, suppose a router wishes to build a router-LSA
  6413.         for    Area A.     The router examines its collection of interface
  6414.         data structures.  For each interface, the following    steps
  6415.         are    taken:
  6416.  
  6417.  
  6418.         o    If the attached    network    does not belong    to Area    A, no
  6419.         links are added    to the LSA, and    the next interface
  6420.         should be examined.
  6421.  
  6422.         o    If the state of    the interface is Down, no links    are
  6423.         added.
  6424.  
  6425.         o    If the state of    the interface is Loopback, add a Type 3
  6426.         link (stub network) as long as this is not an interface
  6427.         to an unnumbered point-to-point    network.  The Link ID
  6428.         should be set to the IP    interface address, the Link Data
  6429.         set to the mask    0xffffffff (indicating a host route),
  6430.         and the    cost set to 0.
  6431.  
  6432.         o    Otherwise, the link descriptions added to the router-LSA
  6433.         depend on the OSPF interface type. Link    descriptions
  6434.         used for point-to-point    interfaces are specified in
  6435.         Section    12.4.1.1, for virtual links in Section 12.4.1.2,
  6436.         for broadcast and NBMA interfaces in 12.4.1.3, and for
  6437.         Point-to-MultiPoint interfaces in 12.4.1.4.
  6438.  
  6439.         After consideration    of all the router interfaces, host links
  6440.         are    added to the router-LSA    by examining the list of
  6441.         attached hosts belonging to    Area A.     A host    route is
  6442.         represented    as a Type 3 link (stub network)    whose Link ID is
  6443.         the    host's IP address, Link    Data is    the mask of all    ones
  6444.         (0xffffffff), and cost the host's configured cost (see
  6445.         Section C.7).
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451. Moy                Standards Track              [Page 129]
  6452.  
  6453. RFC 2328             OSPF Version 2              April 1998
  6454.  
  6455.  
  6456.         12.4.1.1.  Describing point-to-point interfaces
  6457.  
  6458.         For point-to-point interfaces, one or more link
  6459.         descriptions are added to the router-LSA as follows:
  6460.  
  6461.         o   If the neighboring router is fully adjacent, add a
  6462.             Type 1 link    (point-to-point). The Link ID should be
  6463.             set    to the Router ID of the    neighboring router. For
  6464.             numbered point-to-point networks, the Link Data
  6465.             should specify the IP interface address. For
  6466.             unnumbered point-to-point networks,    the Link Data
  6467.             field should specify the interface's MIB-II    [Ref8]
  6468.             ifIndex value. The cost should be set to the output
  6469.             cost of the    point-to-point interface.
  6470.  
  6471.         o   In addition, as long as the    state of the interface
  6472.             is "Point-to-Point"    (and regardless    of the
  6473.             neighboring    router state), a Type 3    link (stub
  6474.             network) should be added. There are    two forms that
  6475.             this stub link can take:
  6476.  
  6477.             Option 1
  6478.             Assuming that the neighboring router's IP
  6479.             address    is known, set the Link ID of the Type 3
  6480.             link to    the neighbor's IP address, the Link Data
  6481.             to the mask 0xffffffff (indicating a host
  6482.             route),    and the    cost to    the interface's
  6483.             configured output cost.[15]
  6484.  
  6485.             Option 2
  6486.             If a subnet has    been assigned to the point-to-
  6487.             point link, set    the Link ID of the Type    3 link
  6488.             to the subnet's    IP address, the    Link Data to the
  6489.             subnet's mask, and the cost to the interface's
  6490.             configured output cost.[16]
  6491.  
  6492.  
  6493.         12.4.1.2.  Describing broadcast and    NBMA interfaces
  6494.  
  6495.         For operational    broadcast and NBMA interfaces, a single
  6496.         link description is added to the router-LSA as follows:
  6497.  
  6498.  
  6499.  
  6500.  
  6501. Moy                Standards Track              [Page 130]
  6502.  
  6503. RFC 2328             OSPF Version 2              April 1998
  6504.  
  6505.  
  6506.         o   If the state of the    interface is Waiting, add a Type
  6507.             3 link (stub network) with Link ID set to the IP
  6508.             network number of the attached network, Link Data
  6509.             set    to the attached    network's address mask,    and cost
  6510.             equal to the interface's configured    output cost.
  6511.  
  6512.         o   Else, there    has been a Designated Router elected for
  6513.             the    attached network.  If the router is fully
  6514.             adjacent to    the Designated Router, or if the router
  6515.             itself is Designated Router    and is fully adjacent to
  6516.             at least one other router, add a single Type 2 link
  6517.             (transit network) with Link    ID set to the IP
  6518.             interface address of the attached network's
  6519.             Designated Router (which may be the    router itself),
  6520.             Link Data set to the router's own IP interface
  6521.             address, and cost equal to the interface's
  6522.             configured output cost.  Otherwise,    add a link as if
  6523.             the    interface state    were Waiting (see above).
  6524.  
  6525.  
  6526.         12.4.1.3.  Describing virtual links
  6527.  
  6528.         For virtual links, a link description is added to the
  6529.         router-LSA only    when the virtual neighbor is fully
  6530.         adjacent. In this case,    add a Type 4 link (virtual link)
  6531.         with Link ID set to the    Router ID of the virtual
  6532.         neighbor, Link Data set    to the IP interface address
  6533.         associated with    the virtual link and cost set to the
  6534.         cost calculated    for the    virtual    link during the    routing
  6535.         table calculation (see Section 15).
  6536.  
  6537.  
  6538.         12.4.1.4.  Describing Point-to-MultiPoint interfaces
  6539.  
  6540.         For operational    Point-to-MultiPoint interfaces,    one or
  6541.         more link descriptions are added to the    router-LSA as
  6542.         follows:
  6543.  
  6544.         o   A single Type 3 link (stub network)    is added with
  6545.             Link ID set    to the router's    own IP interface
  6546.             address, Link Data set to the mask 0xffffffff
  6547.             (indicating    a host route), and cost    set to 0.
  6548.  
  6549.  
  6550.  
  6551. Moy                Standards Track              [Page 131]
  6552.  
  6553. RFC 2328             OSPF Version 2              April 1998
  6554.  
  6555.  
  6556.         o   For    each fully adjacent neighbor associated    with the
  6557.             interface, add an additional Type 1    link (point-to-
  6558.             point) with    Link ID    set to the Router ID of    the
  6559.             neighboring    router,    Link Data set to the IP
  6560.             interface address and cost equal to    the interface's
  6561.             configured output cost.
  6562.  
  6563.  
  6564.         12.4.1.5.  Examples    of router-LSAs
  6565.  
  6566.         Consider the router-LSAs generated by Router RT3, as
  6567.         pictured in Figure 6.  The area    containing Router RT3
  6568.         (Area 1) has been redrawn, with    actual network
  6569.         addresses, in Figure 15.  Assume that the last byte of
  6570.         all of RT3's interface addresses is 3, giving it the
  6571.         interface addresses 192.1.1.3 and 192.1.4.3, and that
  6572.         the other routers have similar addressing schemes.  In
  6573.         addition, assume that all links    are functional,    and that
  6574.         Router IDs are assigned    as the smallest    IP interface
  6575.         address.
  6576.  
  6577.         RT3 originates two router-LSAs,    one for    Area 1 and one
  6578.         for the    backbone.  Assume that Router RT4 has been
  6579.         selected as the    Designated router for network 192.1.1.0.
  6580.         RT3's router-LSA for Area 1 is then shown below.  It
  6581.         indicates that RT3 has two connections to Area 1, the
  6582.         first a    link to    the transit network 192.1.1.0 and the
  6583.         second a link to the stub network 192.1.4.0.  Note that
  6584.         the transit network is identified by the IP interface of
  6585.         its Designated Router (i.e., the Link ID = 192.1.1.4
  6586.         which is the Designated    Router RT4's IP    interface to
  6587.         192.1.1.0).  Note also that RT3    has indicated that it is
  6588.         an area    border router.
  6589.  
  6590.     ; RT3's    router-LSA for Area 1
  6591.  
  6592.     LS age = 0               ;always true on origination
  6593.     Options    = (E-bit)           ;
  6594.     LS type    = 1               ;indicates router-LSA
  6595.     Link State ID =    192.1.1.3      ;RT3's Router ID
  6596.     Advertising Router = 192.1.1.3 ;RT3's Router ID
  6597.     bit E =    0               ;not an AS boundary router
  6598.  
  6599.  
  6600.  
  6601. Moy                Standards Track              [Page 132]
  6602.  
  6603. RFC 2328             OSPF Version 2              April 1998
  6604.  
  6605.  
  6606.     bit B =    1               ;area border router
  6607.     #links = 2
  6608.            Link ID = 192.1.1.4     ;IP address of Desig. Rtr.
  6609.            Link Data = 192.1.1.3   ;RT3's IP interface to net
  6610.            Type = 2               ;connects to transit network
  6611.            # TOS metrics = 0
  6612.            metric =    1
  6613.  
  6614.            Link ID = 192.1.4.0     ;IP Network number
  6615.            Link Data = 0xffffff00  ;Network    mask
  6616.            Type = 3               ;connects to stub network
  6617.            # TOS metrics = 0
  6618.            metric =    2
  6619.  
  6620.             Next RT3's router-LSA for the backbone is shown.  It
  6621.             indicates that RT3 has a single attachment to the
  6622.             backbone.  This attachment is via an unnumbered
  6623.             point-to-point link    to Router RT6.    RT3 has    again
  6624.             indicated that it is an area border    router.
  6625.  
  6626.     ; RT3's    router-LSA for the backbone
  6627.  
  6628.     LS age = 0               ;always true on origination
  6629.     Options    = (E-bit)           ;
  6630.     LS type    = 1               ;indicates router-LSA
  6631.     Link State ID =    192.1.1.3      ;RT3's router ID
  6632.     Advertising Router = 192.1.1.3 ;RT3's router ID
  6633.     bit E =    0               ;not an AS boundary router
  6634.     bit B =    1               ;area border router
  6635.     #links = 1
  6636.            Link ID = 18.10.0.6     ;Neighbor's Router ID
  6637.            Link Data = 0.0.0.3     ;MIB-II ifIndex of P-P link
  6638.            Type = 1               ;connects to router
  6639.            # TOS metrics = 0
  6640.            metric =    8
  6641.  
  6642.     12.4.2.     Network-LSAs
  6643.  
  6644.         A network-LSA is generated for every transit broadcast or
  6645.         NBMA network.  (A transit network is a network having two or
  6646.         more attached routers).  The network-LSA describes all the
  6647.         routers that are attached to the network.
  6648.  
  6649.  
  6650.  
  6651. Moy                Standards Track              [Page 133]
  6652.  
  6653. RFC 2328             OSPF Version 2              April 1998
  6654.  
  6655.  
  6656.         The    Designated Router for the network originates the LSA.
  6657.         The    Designated Router originates the LSA only if it    is fully
  6658.         adjacent to    at least one other router on the network.  The
  6659.         network-LSA    is flooded throughout the area that contains the
  6660.         transit network, and no further.  The network-LSA lists
  6661.         those routers that are fully adjacent to the Designated
  6662.         Router; each fully adjacent    router is identified by    its OSPF
  6663.         Router ID.    The Designated Router includes itself in this
  6664.         list.
  6665.  
  6666.         The    Link State ID for a network-LSA    is the IP interface
  6667.         address of the Designated Router.  This value, masked by the
  6668.         network's address mask (which is also contained in the
  6669.         network-LSA) yields    the network's IP address.
  6670.  
  6671.         A router that has formerly been the    Designated Router for a
  6672.         network, but is no longer, should flush the    network-LSA that
  6673.         it had previously originated.  This    LSA is no longer used in
  6674.         the    routing    table calculation.  It is flushed by prematurely
  6675.         incrementing the LSA's age to MaxAge and reflooding    (see
  6676.         Section 14.1). In addition,    in those rare cases where a
  6677.         router's Router ID has changed, any    network-LSAs that were
  6678.         originated with the    router's previous Router ID must be
  6679.         flushed. Since the router may have no idea what it's
  6680.         previous Router ID might have been,    these network-LSAs are
  6681.         indicated by having    their Link State ID equal to one of the
  6682.         router's IP    interface addresses and    their Advertising Router
  6683.         equal to some value    other than the router's    current    Router
  6684.         ID (see Section 13.4 for more details).
  6685.  
  6686.  
  6687.         12.4.2.1.  Examples    of network-LSAs
  6688.  
  6689.         Again consider the area    configuration in Figure    6.
  6690.         Network-LSAs are originated for    Network    N3 in Area 1,
  6691.         Networks N6 and    N8 in Area 2, and Network N9 in    Area 3.
  6692.         Assuming that Router RT4 has been selected as the
  6693.         Designated Router for Network N3, the following
  6694.         network-LSA is generated by RT4    on behalf of Network N3
  6695.         (see Figure 15 for the address assignments):
  6696.  
  6697.     ; Network-LSA for Network N3
  6698.  
  6699.  
  6700.  
  6701. Moy                Standards Track              [Page 134]
  6702.  
  6703. RFC 2328             OSPF Version 2              April 1998
  6704.  
  6705.  
  6706.     LS age = 0               ;always true on origination
  6707.     Options    = (E-bit)           ;
  6708.     LS type    = 2               ;indicates network-LSA
  6709.     Link State ID =    192.1.1.4      ;IP address of Desig. Rtr.
  6710.     Advertising Router = 192.1.1.4 ;RT4's Router ID
  6711.     Network    Mask = 0xffffff00
  6712.            Attached    Router = 192.1.1.4    ;Router ID
  6713.            Attached    Router = 192.1.1.1    ;Router ID
  6714.            Attached    Router = 192.1.1.2    ;Router ID
  6715.            Attached    Router = 192.1.1.3    ;Router ID
  6716.  
  6717.     12.4.3.     Summary-LSAs
  6718.  
  6719.         The    destination described by a summary-LSA is either an IP
  6720.         network, an    AS boundary router or a    range of IP addresses.
  6721.         Summary-LSAs are flooded throughout    a single area only.  The
  6722.         destination    described is one that is external to the area,
  6723.         yet    still belongs to the Autonomous    System.
  6724.  
  6725.         Summary-LSAs are originated    by area    border routers.     The
  6726.         precise summary routes to advertise    into an    area are
  6727.         determined by examining the    routing    table structure    (see
  6728.         Section 11)    in accordance with the algorithm described
  6729.         below. Note    that only intra-area routes are    advertised into
  6730.         the    backbone, while    both intra-area    and inter-area routes
  6731.         are    advertised into    the other areas.
  6732.  
  6733.         To determine which routes to advertise into    an attached Area
  6734.         A, each routing table entry    is processed as    follows.
  6735.         Remember that each routing table entry describes a set of
  6736.         equal-cost best paths to a particular destination:
  6737.  
  6738.         o    Only Destination Types of network and AS boundary router
  6739.         are advertised in summary-LSAs.     If the    routing    table
  6740.         entry's    Destination Type is area border    router,    examine
  6741.         the next routing table entry.
  6742.  
  6743.         o    AS external routes are never advertised    in summary-LSAs.
  6744.         If the routing table entry has Path-type of type 1
  6745.         external or type 2 external, examine the next routing
  6746.         table entry.
  6747.  
  6748.  
  6749.  
  6750.  
  6751. Moy                Standards Track              [Page 135]
  6752.  
  6753. RFC 2328             OSPF Version 2              April 1998
  6754.  
  6755.  
  6756.         o    Else, if the area associated with this set of paths is
  6757.         the Area A itself, do not generate a summary-LSA for the
  6758.         route.[17]
  6759.  
  6760.         o    Else, if the next hops associated with this set    of paths
  6761.         belong to Area A itself, do not    generate a summary-LSA
  6762.         for the    route.[18] This    is the logical equivalent of a
  6763.         Distance Vector    protocol's split horizon logic.
  6764.  
  6765.         o    Else, if the routing table cost    equals or exceeds the
  6766.         value LSInfinity, a summary-LSA    cannot be generated for
  6767.         this route.
  6768.  
  6769.         o    Else, if the destination of this route is an AS    boundary
  6770.         router,    a summary-LSA should be    originated if and only
  6771.         if the routing table entry describes the preferred path
  6772.         to the AS boundary router (see Step 3 of Section 16.4).
  6773.         If so, a Type 4    summary-LSA is originated for the
  6774.         destination, with Link State ID    equal to the AS    boundary
  6775.         router's Router    ID and metric equal to the routing table
  6776.         entry's    cost. Note: these LSAs should not be generated
  6777.         if Area    A has been configured as a stub    area.
  6778.  
  6779.         o    Else, the Destination type is network. If this is an
  6780.         inter-area route, generate a Type 3 summary-LSA    for the
  6781.         destination, with Link State ID    equal to the network's
  6782.         address    (if necessary, the Link    State ID can also have
  6783.         one or more of the network's host bits set; see    Appendix
  6784.         E for details) and metric equal    to the routing table
  6785.         cost.
  6786.  
  6787.         o    The one    remaining case is an intra-area    route to a
  6788.         network.  This means that the network is contained in
  6789.         one of the router's directly attached areas.  In
  6790.         general, this information must be condensed before
  6791.         appearing in summary-LSAs.  Remember that an area has a
  6792.         configured list    of address ranges, each    range consisting
  6793.         of an [address,mask] pair and a    status indication of
  6794.         either Advertise or DoNotAdvertise.  At    most a single
  6795.         Type 3 summary-LSA is originated for each range. When
  6796.         the range's status indicates Advertise,    a Type 3
  6797.         summary-LSA is generated with Link State ID equal to the
  6798.  
  6799.  
  6800.  
  6801. Moy                Standards Track              [Page 136]
  6802.  
  6803. RFC 2328             OSPF Version 2              April 1998
  6804.  
  6805.  
  6806.         range's    address    (if necessary, the Link    State ID can
  6807.         also have one or more of the range's "host" bits set;
  6808.         see Appendix E for details) and    cost equal to the
  6809.         largest    cost of    any of the component networks. When the
  6810.         range's    status indicates DoNotAdvertise, the Type 3
  6811.         summary-LSA is suppressed and the component networks
  6812.         remain hidden from other areas.
  6813.  
  6814.         By default, if a network is not    contained in any
  6815.         explicitly configured address range, a Type 3 summary-
  6816.         LSA is generated with Link State ID equal to the
  6817.         network's address (if necessary, the Link State    ID can
  6818.         also have one or more of the network's "host" bits set;
  6819.         see Appendix E for details) and    metric equal to    the
  6820.         network's routing table    cost.
  6821.  
  6822.         If an area is capable of carrying transit traffic (i.e.,
  6823.         its TransitCapability is set to    TRUE), routing
  6824.         information concerning backbone    networks should    not be
  6825.         condensed before being summarized into the area.  Nor
  6826.         should the advertisement of backbone networks into
  6827.         transit    areas be suppressed.  In other words, the
  6828.         backbone's configured ranges should be ignored when
  6829.         originating summary-LSAs into transit areas.
  6830.  
  6831.         If a router    advertises a summary-LSA for a destination which
  6832.         then becomes unreachable, the router must then flush the LSA
  6833.         from the routing domain by setting its age to MaxAge and
  6834.         reflooding (see Section 14.1).  Also, if the destination is
  6835.         still reachable, yet can no    longer be advertised according
  6836.         to the above procedure (e.g., it is    now an inter-area route,
  6837.         when it used to be an intra-area route associated with some
  6838.         non-backbone area; it would    thus no    longer be advertisable
  6839.         to the backbone), the LSA should also be flushed from the
  6840.         routing domain.
  6841.  
  6842.  
  6843.         12.4.3.1.  Originating summary-LSAs    into stub areas
  6844.  
  6845.         The algorithm in Section 12.4.3    is optional when Area A
  6846.         is an OSPF stub    area. Area border routers connecting to
  6847.         a stub area can    originate summary-LSAs into the    area
  6848.  
  6849.  
  6850.  
  6851. Moy                Standards Track              [Page 137]
  6852.  
  6853. RFC 2328             OSPF Version 2              April 1998
  6854.  
  6855.  
  6856.         according to the Section 12.4.3's algorithm, or    can
  6857.         choose to originate only a subset of the summary-LSAs,
  6858.         possibly under configuration control.  The fewer LSAs
  6859.         originated, the    smaller    the stub area's    link state
  6860.         database, further reducing the demands on its routers'
  6861.         resources. However, omitting LSAs may also lead    to sub-
  6862.         optimal    inter-area routing, although routing will
  6863.         continue to function.
  6864.  
  6865.         As specified in    Section    12.4.3,    Type 4 summary-LSAs
  6866.         (ASBR-summary-LSAs) are    never originated into stub
  6867.         areas.
  6868.  
  6869.         In a stub area,    instead    of importing external routes
  6870.         each area border router    originates a "default summary-
  6871.         LSA" into the area. The    Link State ID for the default
  6872.         summary-LSA is set to DefaultDestination, and the metric
  6873.         set to the (per-area) configurable parameter
  6874.         StubDefaultCost.  Note that StubDefaultCost need not be
  6875.         configured identically in all of the stub area's area
  6876.         border routers.
  6877.  
  6878.  
  6879.         12.4.3.2.  Examples    of summary-LSAs
  6880.  
  6881.         Consider again the area    configuration in Figure    6.
  6882.         Routers    RT3, RT4, RT7, RT10 and    RT11 are all area border
  6883.         routers, and therefore are originating summary-LSAs.
  6884.         Consider in particular Router RT4.  Its    routing    table
  6885.         was calculated as the example in Section 11.3.    RT4
  6886.         originates summary-LSAs    into both the backbone and Area
  6887.         1.  Into the backbone, Router RT4 originates separate
  6888.         LSAs for each of the networks N1-N4.  Into Area    1,
  6889.         Router RT4 originates separate LSAs for    networks N6-N8
  6890.         and the    AS boundary routers RT5,RT7.  It also condenses
  6891.         host routes Ia and Ib into a single summary-LSA.
  6892.         Finally, the routes to networks    N9,N10,N11 and Host H1
  6893.         are advertised by a single summary-LSA.     This
  6894.         condensation was originally performed by the router
  6895.         RT11.
  6896.  
  6897.  
  6898.  
  6899.  
  6900.  
  6901. Moy                Standards Track              [Page 138]
  6902.  
  6903. RFC 2328             OSPF Version 2              April 1998
  6904.  
  6905.  
  6906.         These LSAs are illustrated graphically in Figures 7 and
  6907.         8.  Two    of the summary-LSAs originated by Router RT4
  6908.         follow.     The actual IP addresses for the networks and
  6909.         routers    in question have been assigned in Figure 15.
  6910.  
  6911.     ; Summary-LSA for Network N1,
  6912.     ; originated by    Router RT4 into    the backbone
  6913.  
  6914.     LS age = 0            ;always true on origination
  6915.     Options    = (E-bit)        ;
  6916.     LS type    = 3            ;Type 3 summary-LSA
  6917.     Link State ID =    192.1.2.0   ;N1's IP network number
  6918.     Advertising Router = 192.1.1.4         ;RT4's ID
  6919.     metric = 4
  6920.  
  6921.     ; Summary-LSA for AS boundary router RT7
  6922.     ; originated by    Router RT4 into    Area 1
  6923.  
  6924.     LS age = 0            ;always true on origination
  6925.     Options    = (E-bit)        ;
  6926.     LS type    = 4            ;Type 4 summary-LSA
  6927.     Link State ID =    Router RT7's ID
  6928.     Advertising Router = 192.1.1.4         ;RT4's ID
  6929.     metric = 14
  6930.  
  6931.     12.4.4.     AS-external-LSAs
  6932.  
  6933.         AS-external-LSAs describe routes to    destinations external to
  6934.         the    Autonomous System.  Most AS-external-LSAs describe
  6935.         routes to specific external    destinations; in these cases the
  6936.         LSA's Link State ID    is set to the destination network's IP
  6937.         address (if    necessary, the Link State ID can also have one
  6938.         or more of the network's "host" bits set; see Appendix E for
  6939.         details).  However,    a default route    for the    Autonomous
  6940.         System can be described in an AS-external-LSA by setting the
  6941.         LSA's Link State ID    to DefaultDestination (0.0.0.0).  AS-
  6942.         external-LSAs are originated by AS boundary    routers.  An AS
  6943.         boundary router originates a single    AS-external-LSA    for each
  6944.         external route that    it has learned,    either through another
  6945.         routing protocol (such as BGP), or through configuration
  6946.         information.
  6947.  
  6948.  
  6949.  
  6950.  
  6951. Moy                Standards Track              [Page 139]
  6952.  
  6953. RFC 2328             OSPF Version 2              April 1998
  6954.  
  6955.  
  6956.         AS-external-LSAs are the only type of LSAs that are    flooded
  6957.         throughout the entire Autonomous System; all other types of
  6958.         LSAs are specific to a single area.     However, AS-external-
  6959.         LSAs are not flooded into/throughout stub areas (see Section
  6960.         3.6).  This    enables    a reduction in link state database size
  6961.         for    routers    internal to stub areas.
  6962.  
  6963.         The    metric that is advertised for an external route    can be
  6964.         one    of two types.  Type 1 metrics are comparable to    the link
  6965.         state metric.  Type    2 metrics are assumed to be larger than
  6966.         the    cost of    any intra-AS path.
  6967.  
  6968.         If a router    advertises an AS-external-LSA for a destination
  6969.         which then becomes unreachable, the    router must then flush
  6970.         the    LSA from the routing domain by setting its age to MaxAge
  6971.         and    reflooding (see    Section    14.1).
  6972.  
  6973.  
  6974.         12.4.4.1.  Examples    of AS-external-LSAs
  6975.  
  6976.         Consider once again the    AS pictured in Figure 6.  There
  6977.         are two    AS boundary routers: RT5 and RT7.  Router RT5
  6978.         originates three AS-external-LSAs, for networks    N12-N14.
  6979.         Router RT7 originates two AS-external-LSAs, for    networks
  6980.         N12 and    N15.  Assume that RT7 has learned its route to
  6981.         N12 via    BGP, and that it wishes    to advertise a Type 2
  6982.         metric to the AS.  RT7 would then originate the
  6983.         following LSA for N12:
  6984.  
  6985.     ; AS-external-LSA for Network N12,
  6986.     ; originated by    Router RT7
  6987.  
  6988.     LS age = 0            ;always true on origination
  6989.     Options    = (E-bit)        ;
  6990.     LS type    = 5            ;AS-external-LSA
  6991.     Link State ID =    N12's IP network number
  6992.     Advertising Router = Router RT7's ID
  6993.     bit E =    1            ;Type 2 metric
  6994.     metric = 2
  6995.     Forwarding address = 0.0.0.0
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001. Moy                Standards Track              [Page 140]
  7002.  
  7003. RFC 2328             OSPF Version 2              April 1998
  7004.  
  7005.  
  7006.             In the above example, the forwarding address field
  7007.             has    been set to 0.0.0.0, indicating    that packets for
  7008.             the    external destination should be forwarded to the
  7009.             advertising    OSPF router (RT7).  This is not    always
  7010.             desirable.    Consider the example pictured in Figure
  7011.             16.     There are three OSPF routers (RTA, RTB    and RTC)
  7012.             connected to a common network.  Only one of    these
  7013.             routers, RTA, is exchanging    BGP information    with the
  7014.             non-OSPF router RTX.  RTA must then    originate AS-
  7015.             external-LSAs for those destinations it has    learned
  7016.             from RTX.  By using    the AS-external-LSA's forwarding
  7017.             address field, RTA can specify that    packets    for
  7018.             these destinations be forwarded directly to    RTX.
  7019.             Without this feature, Routers RTB and RTC would take
  7020.             an extra hop to get    to these destinations.
  7021.  
  7022.             Note that when the forwarding address field    is non-
  7023.             zero, it should point to a router belonging    to
  7024.             another Autonomous System.
  7025.  
  7026.             A forwarding address can also be specified for the
  7027.             default route.  For    example, in figure 16 RTA may
  7028.             want to specify that all externally-destined packets
  7029.             should by default be forwarded to its BGP peer RTX.
  7030.             The    resulting AS-external-LSA is pictured below.
  7031.             Note that the Link State ID    is set to
  7032.             DefaultDestination.
  7033.  
  7034.     ; Default route, originated by Router RTA
  7035.     ; Packets forwarded through RTX
  7036.  
  7037.     LS age = 0            ;always true on origination
  7038.     Options    = (E-bit)        ;
  7039.     LS type    = 5            ;AS-external-LSA
  7040.     Link State ID =    DefaultDestination  ; default route
  7041.     Advertising Router = Router RTA's ID
  7042.     bit E =    1            ;Type 2 metric
  7043.     metric = 1
  7044.     Forwarding address = RTX's IP address
  7045.  
  7046.             In figure 16, suppose instead that both RTA    and RTB
  7047.             exchange BGP information with RTX.    In this    case,
  7048.  
  7049.  
  7050.  
  7051. Moy                Standards Track              [Page 141]
  7052.  
  7053. RFC 2328             OSPF Version 2              April 1998
  7054.  
  7055.  
  7056.             RTA    and RTB    would originate    the same set of    AS-
  7057.             external-LSAs.  These LSAs,    if they    specify    the same
  7058.             metric, would be functionally equivalent since they
  7059.             would specify the same destination and forwarding
  7060.             address (RTX).  This leads to a clear duplication of
  7061.             effort.  If    only one of RTA    or RTB originated the
  7062.             set    of AS-external-LSAs, the routing would remain
  7063.             the    same, and the size of the link state database
  7064.             would decrease.  However, it must be unambiguously
  7065.             defined as to which    router originates the LSAs
  7066.             (otherwise neither may, or the identity of the
  7067.             originator may oscillate).    The following rule is
  7068.             thereby established: if two    routers, both reachable
  7069.             from one another, originate    functionally equivalent
  7070.             AS-external-LSAs (i.e., same destination, cost and
  7071.             non-zero forwarding    address), then the LSA
  7072.             originated by the router having the    highest    OSPF
  7073.             Router ID is used.    The router having the lower OSPF
  7074.             Router ID can then flush its LSA.  Flushing    an LSA
  7075.             is discussed in Section 14.1.
  7076.  
  7077.  
  7078.                 +
  7079.                 |
  7080.               +---+.....|.BGP
  7081.               |RTA|-----|.....+---+
  7082.               +---+    |-----|RTX|
  7083.                 |     +---+
  7084.               +---+    |
  7085.               |RTB|-----|
  7086.               +---+    |
  7087.                 |
  7088.               +---+    |
  7089.               |RTC|-----|
  7090.               +---+    |
  7091.                 |
  7092.                 +
  7093.  
  7094.  
  7095.            Figure 16: Forwarding address example
  7096.  
  7097.  
  7098.  
  7099.  
  7100.  
  7101. Moy                Standards Track              [Page 142]
  7102.  
  7103. RFC 2328             OSPF Version 2              April 1998
  7104.  
  7105.  
  7106. 13.  The Flooding Procedure
  7107.  
  7108.     Link State Update packets provide the mechanism for    flooding LSAs.
  7109.     A Link State Update    packet may contain several distinct LSAs, and
  7110.     floods each    LSA one    hop further from its point of origination.  To
  7111.     make the flooding procedure    reliable, each LSA must    be acknowledged
  7112.     separately.     Acknowledgments are transmitted in Link State
  7113.     Acknowledgment packets.  Many separate acknowledgments can also be
  7114.     grouped together into a single packet.
  7115.  
  7116.     The    flooding procedure starts when a Link State Update packet has
  7117.     been received.  Many consistency checks have been made on the
  7118.     received packet before being handed    to the flooding    procedure (see
  7119.     Section 8.2).  In particular, the Link State Update    packet has been
  7120.     associated with a particular neighbor, and a particular area.  If
  7121.     the    neighbor is in a lesser    state than Exchange, the packet    should
  7122.     be dropped without further processing.
  7123.  
  7124.     All    types of LSAs, other than AS-external-LSAs, are    associated with
  7125.     a specific area.  However, LSAs do not contain an area field.  An
  7126.     LSA's area must be deduced from the    Link State Update packet header.
  7127.  
  7128.     For    each LSA contained in a    Link State Update packet, the following
  7129.     steps are taken:
  7130.  
  7131.  
  7132.     (1)    Validate the LSA's LS checksum.     If the    checksum turns out to be
  7133.     invalid, discard the LSA and get the next one from the Link
  7134.     State Update packet.
  7135.  
  7136.     (2)    Examine    the LSA's LS type.  If the LS type is unknown, discard
  7137.     the LSA    and get    the next one from the Link State Update    Packet.
  7138.     This specification defines LS types 1-5    (see Section 4.3).
  7139.  
  7140.     (3)    Else if    this is    an AS-external-LSA (LS type = 5), and the area
  7141.     has been configured as a stub area, discard the    LSA and    get the
  7142.     next one from the Link State Update Packet.  AS-external-LSAs
  7143.     are not    flooded    into/throughout    stub areas (see    Section    3.6).
  7144.  
  7145.     (4)    Else if    the LSA's LS age is equal to MaxAge, and there is
  7146.     currently no instance of the LSA in the    router's link state
  7147.     database, and none of router's neighbors are in    states Exchange
  7148.  
  7149.  
  7150.  
  7151. Moy                Standards Track              [Page 143]
  7152.  
  7153. RFC 2328             OSPF Version 2              April 1998
  7154.  
  7155.  
  7156.     or Loading, then take the following actions: a)    Acknowledge the
  7157.     receipt    of the LSA by sending a    Link State Acknowledgment packet
  7158.     back to    the sending neighbor (see Section 13.5), and b)    Discard
  7159.     the LSA    and examine the    next LSA (if any) listed in the    Link
  7160.     State Update packet.
  7161.  
  7162.     (5)    Otherwise, find    the instance of    this LSA that is currently
  7163.     contained in the router's link state database.    If there is no
  7164.     database copy, or the received LSA is more recent than the
  7165.     database copy (see Section 13.1    below for the determination of
  7166.     which LSA is more recent) the following    steps must be performed:
  7167.  
  7168.     (a) If there is    already    a database copy, and if    the database
  7169.         copy was received via flooding and installed less than
  7170.         MinLSArrival seconds ago, discard the new LSA (without
  7171.         acknowledging it) and examine the next LSA (if any)    listed
  7172.         in the Link    State Update packet.
  7173.  
  7174.     (b) Otherwise immediately flood    the new    LSA out    some subset of
  7175.         the    router's interfaces (see Section 13.3).     In some cases
  7176.         (e.g., the state of    the receiving interface    is DR and the
  7177.         LSA    was received from a router other than the Backup DR) the
  7178.         LSA    will be    flooded    back out the receiving interface.  This
  7179.         occurrence should be noted for later use by    the
  7180.         acknowledgment process (Section 13.5).
  7181.  
  7182.     (c) Remove the current database    copy from all neighbors' Link
  7183.         state retransmission lists.
  7184.  
  7185.     (d) Install the    new LSA    in the link state database (replacing
  7186.         the    current    database copy).     This may cause    the routing
  7187.         table calculation to be scheduled.    In addition, timestamp
  7188.         the    new LSA    with the current time (i.e., the time it was
  7189.         received).    The flooding procedure cannot overwrite    the
  7190.         newly installed LSA    until MinLSArrival seconds have    elapsed.
  7191.         The    LSA installation process is discussed further in Section
  7192.         13.2.
  7193.  
  7194.     (e) Possibly acknowledge the receipt of    the LSA    by sending a
  7195.         Link State Acknowledgment packet back out the receiving
  7196.         interface.    This is    explained below    in Section 13.5.
  7197.  
  7198.  
  7199.  
  7200.  
  7201. Moy                Standards Track              [Page 144]
  7202.  
  7203. RFC 2328             OSPF Version 2              April 1998
  7204.  
  7205.  
  7206.     (f) If this new    LSA indicates that it was originated by    the
  7207.         receiving router itself (i.e., is considered a self-
  7208.         originated LSA), the router    must take special action, either
  7209.         updating the LSA or    in some    cases flushing it from the
  7210.         routing domain. For    a description of how self-originated
  7211.         LSAs are detected and subsequently handled,    see Section
  7212.         13.4.
  7213.  
  7214.     (6)    Else, if there is an instance of the LSA on the    sending
  7215.     neighbor's Link    state request list, an error has occurred in the
  7216.     Database Exchange process.  In this case, restart the Database
  7217.     Exchange process by generating the neighbor event BadLSReq for
  7218.     the sending neighbor and stop processing the Link State    Update
  7219.     packet.
  7220.  
  7221.     (7)    Else, if the received LSA is the same instance as the database
  7222.     copy (i.e., neither one    is more    recent)    the following two steps
  7223.     should be performed:
  7224.  
  7225.     (a) If the LSA is listed in the    Link state retransmission list
  7226.         for    the receiving adjacency, the router itself is expecting
  7227.         an acknowledgment for this LSA.  The router    should treat the
  7228.         received LSA as an acknowledgment by removing the LSA from
  7229.         the    Link state retransmission list.     This is termed    an
  7230.         "implied acknowledgment".  Its occurrence should be    noted
  7231.         for    later use by the acknowledgment    process    (Section 13.5).
  7232.  
  7233.     (b) Possibly acknowledge the receipt of    the LSA    by sending a
  7234.         Link State Acknowledgment packet back out the receiving
  7235.         interface.    This is    explained below    in Section 13.5.
  7236.  
  7237.     (8)    Else, the database copy    is more    recent.     If the    database copy
  7238.     has LS age equal to MaxAge and LS sequence number equal    to
  7239.     MaxSequenceNumber, simply discard the received LSA without
  7240.     acknowledging it. (In this case, the LSA's LS sequence number is
  7241.     wrapping, and the MaxSequenceNumber LSA    must be    completely
  7242.     flushed    before any new LSA instance can    be introduced).
  7243.     Otherwise, as long as the database copy    has not    been sent in a
  7244.     Link State Update within the last MinLSArrival seconds,    send the
  7245.     database copy back to the sending neighbor, encapsulated within
  7246.     a Link State Update Packet. The    Link State Update Packet should
  7247.     be sent    directly to the    neighbor. In so    doing, do not put the
  7248.  
  7249.  
  7250.  
  7251. Moy                Standards Track              [Page 145]
  7252.  
  7253. RFC 2328             OSPF Version 2              April 1998
  7254.  
  7255.  
  7256.     database copy of the LSA on the    neighbor's link    state
  7257.     retransmission list, and do not    acknowledge the    received (less
  7258.     recent)    LSA instance.
  7259.  
  7260.  
  7261.     13.1.  Determining which LSA is newer
  7262.  
  7263.     When a router encounters two instances of an LSA, it must
  7264.     determine which    is more    recent.     This occurred above when
  7265.     comparing a received LSA to its    database copy.    This comparison
  7266.     must also be done during the Database Exchange procedure which
  7267.     occurs during adjacency    bring-up.
  7268.  
  7269.     An LSA is identified by    its LS type, Link State    ID and
  7270.     Advertising Router.  For two instances of the same LSA,    the LS
  7271.     sequence number, LS age, and LS    checksum fields    are used to
  7272.     determine which    instance is more recent:
  7273.  
  7274.  
  7275.     o   The    LSA having the newer LS    sequence number    is more    recent.
  7276.         See    Section    12.1.6 for an explanation of the LS sequence
  7277.         number space.  If both instances have the same LS sequence
  7278.         number, then:
  7279.  
  7280.     o   If the two instances have different    LS checksums, then the
  7281.         instance having the    larger LS checksum (when considered as a
  7282.         16-bit unsigned integer) is    considered more    recent.
  7283.  
  7284.     o   Else, if only one of the instances has its LS age field set
  7285.         to MaxAge, the instance of age MaxAge is considered    to be
  7286.         more recent.
  7287.  
  7288.     o   Else, if the LS age    fields of the two instances differ by
  7289.         more than MaxAgeDiff, the instance having the smaller
  7290.         (younger) LS age is    considered to be more recent.
  7291.  
  7292.     o   Else, the two instances are    considered to be identical.
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301. Moy                Standards Track              [Page 146]
  7302.  
  7303. RFC 2328             OSPF Version 2              April 1998
  7304.  
  7305.  
  7306.     13.2.  Installing LSAs in the database
  7307.  
  7308.     Installing a new LSA in    the database, either as    the result of
  7309.     flooding or a newly self-originated LSA, may cause the OSPF
  7310.     routing    table structure    to be recalculated.  The contents of the
  7311.     new LSA    should be compared to the old instance,    if present.  If
  7312.     there is no difference,    there is no need to recalculate    the
  7313.     routing    table. When comparing an LSA to    its previous instance,
  7314.     the following are all considered to be differences in contents:
  7315.  
  7316.         o    The LSA's Options field    has changed.
  7317.  
  7318.         o    One of the LSA instances has LS    age set    to MaxAge, and
  7319.         the other does not.
  7320.  
  7321.         o    The length field in the    LSA header has changed.
  7322.  
  7323.         o    The body of the    LSA (i.e., anything outside the    20-byte
  7324.         LSA header) has    changed. Note that this    excludes changes
  7325.         in LS Sequence Number and LS Checksum.
  7326.  
  7327.     If the contents    are different, the following pieces of the
  7328.     routing    table must be recalculated, depending on the new LSA's
  7329.     LS type    field:
  7330.  
  7331.  
  7332.     Router-LSAs and    network-LSAs
  7333.         The    entire routing table must be recalculated, starting with
  7334.         the    shortest path calculations for each area (not just the
  7335.         area whose link-state database has changed).  The reason
  7336.         that the shortest path calculation cannot be restricted to
  7337.         the    single changed area has    to do with the fact that AS
  7338.         boundary routers may belong    to multiple areas.  A change in
  7339.         the    area currently providing the best route    may force the
  7340.         router to use an intra-area    route provided by a different
  7341.         area.[19]
  7342.  
  7343.     Summary-LSAs
  7344.         The    best route to the destination described    by the summary-
  7345.         LSA    must be    recalculated (see Section 16.5).  If this
  7346.         destination    is an AS boundary router, it may also be
  7347.         necessary to re-examine all    the AS-external-LSAs.
  7348.  
  7349.  
  7350.  
  7351. Moy                Standards Track              [Page 147]
  7352.  
  7353. RFC 2328             OSPF Version 2              April 1998
  7354.  
  7355.  
  7356.     AS-external-LSAs
  7357.         The    best route to the destination described    by the AS-
  7358.         external-LSA must be recalculated (see Section 16.6).
  7359.  
  7360.  
  7361.     Also, any old instance of the LSA must be removed from the
  7362.     database when the new LSA is installed.     This old instance must
  7363.     also be    removed    from all neighbors' Link state retransmission
  7364.     lists (see Section 10).
  7365.  
  7366.  
  7367.     13.3.  Next    step in    the flooding procedure
  7368.  
  7369.     When a new (and    more recent) LSA has been received, it must be
  7370.     flooded    out some set of    the router's interfaces.  This section
  7371.     describes the second part of flooding procedure    (the first part
  7372.     being the processing that occurred in Section 13), namely,
  7373.     selecting the outgoing interfaces and adding the LSA to    the
  7374.     appropriate neighbors' Link state retransmission lists.     Also
  7375.     included in this part of the flooding procedure    is the
  7376.     maintenance of the neighbors' Link state request lists.
  7377.  
  7378.     This section is    equally    applicable to the flooding of an LSA
  7379.     that the router    itself has just    originated (see    Section    12.4).
  7380.     For these LSAs,    this section provides the entirety of the
  7381.     flooding procedure (i.e., the processing of Section 13 is not
  7382.     performed, since, for example, the LSA has not been received
  7383.     from a neighbor    and therefore does not need to be acknowledged).
  7384.  
  7385.     Depending upon the LSA's LS type, the LSA can be flooded out
  7386.     only certain interfaces.  These    interfaces, defined by the
  7387.     following, are called the eligible interfaces:
  7388.  
  7389.  
  7390.     AS-external-LSAs (LS Type = 5)
  7391.         AS-external-LSAs are flooded throughout the    entire AS, with
  7392.         the    exception of stub areas    (see Section 3.6).  The    eligible
  7393.         interfaces are all the router's interfaces,    excluding
  7394.         virtual links and those interfaces attaching to stub areas.
  7395.  
  7396.     All other LS types
  7397.         All    other types are    specific to a single area (Area    A).  The
  7398.  
  7399.  
  7400.  
  7401. Moy                Standards Track              [Page 148]
  7402.  
  7403. RFC 2328             OSPF Version 2              April 1998
  7404.  
  7405.  
  7406.         eligible interfaces    are all    those interfaces attaching to
  7407.         the    Area A.     If Area A is the backbone, this includes all
  7408.         the    virtual    links.
  7409.  
  7410.  
  7411.     Link state databases must remain synchronized over all
  7412.     adjacencies associated with the    above eligible interfaces.  This
  7413.     is accomplished    by executing the following steps on each
  7414.     eligible interface.  It    should be noted    that this procedure may
  7415.     decide not to flood an LSA out a particular interface, if there
  7416.     is a high probability that the attached    neighbors have already
  7417.     received the LSA.  However, in these cases the flooding
  7418.     procedure must be absolutely sure that the neighbors eventually
  7419.     do receive the LSA, so the LSA is still    added to each
  7420.     adjacency's Link state retransmission list.  For each eligible
  7421.     interface:
  7422.  
  7423.  
  7424.     (1) Each of the    neighbors attached to this interface are
  7425.         examined, to determine whether they    must receive the new
  7426.         LSA.  The following    steps are executed for each neighbor:
  7427.  
  7428.         (a)    If the neighbor    is in a    lesser state than Exchange, it
  7429.         does not participate in    flooding, and the next neighbor
  7430.         should be examined.
  7431.  
  7432.         (b)    Else, if the adjacency is not yet full (neighbor state
  7433.         is Exchange or Loading), examine the Link state    request
  7434.         list associated    with this adjacency.  If there is an
  7435.         instance of the    new LSA    on the list, it    indicates that
  7436.         the neighboring    router has an instance of the LSA
  7437.         already.  Compare the new LSA to the neighbor's    copy:
  7438.  
  7439.         o   If the new LSA is less recent, then    examine    the next
  7440.             neighbor.
  7441.  
  7442.         o   If the two copies are the same instance, then delete
  7443.             the    LSA from the Link state    request    list, and
  7444.             examine the    next neighbor.[20]
  7445.  
  7446.         o   Else, the new LSA is more recent.  Delete the LSA
  7447.             from the Link state    request    list.
  7448.  
  7449.  
  7450.  
  7451. Moy                Standards Track              [Page 149]
  7452.  
  7453. RFC 2328             OSPF Version 2              April 1998
  7454.  
  7455.  
  7456.         (c)    If the new LSA was received from this neighbor,    examine
  7457.         the next neighbor.
  7458.  
  7459.         (d)    At this    point we are not positive that the neighbor has
  7460.         an up-to-date instance of this new LSA.     Add the new LSA
  7461.         to the Link state retransmission list for the adjacency.
  7462.         This ensures that the flooding procedure is reliable;
  7463.         the LSA    will be    retransmitted at intervals until an
  7464.         acknowledgment is seen from the    neighbor.
  7465.  
  7466.     (2) The    router must now    decide whether to flood    the new    LSA out
  7467.         this interface.  If    in the previous    step, the LSA was NOT
  7468.         added to any of the    Link state retransmission lists, there
  7469.         is no need to flood    the LSA    out the    interface and the next
  7470.         interface should be    examined.
  7471.  
  7472.     (3) If the new LSA was received    on this    interface, and it was
  7473.         received from either the Designated    Router or the Backup
  7474.         Designated Router, chances are that    all the    neighbors have
  7475.         received the LSA already.  Therefore, examine the next
  7476.         interface.
  7477.  
  7478.     (4) If the new LSA was received    on this    interface, and the
  7479.         interface state is Backup (i.e., the router    itself is the
  7480.         Backup Designated Router), examine the next    interface.  The
  7481.         Designated Router will do the flooding on this interface.
  7482.         However, if    the Designated Router fails the    router (i.e.,
  7483.         the    Backup Designated Router) will end up retransmitting the
  7484.         updates.
  7485.  
  7486.     (5) If this step is reached, the LSA must be flooded out the
  7487.         interface.    Send a Link State Update packet    (including the
  7488.         new    LSA as contents) out the interface.  The LSA's LS age
  7489.         must be incremented    by InfTransDelay (which    must be    > 0)
  7490.         when it is copied into the outgoing    Link State Update packet
  7491.         (until the LS age field reaches the    maximum    value of
  7492.         MaxAge).
  7493.  
  7494.         On broadcast networks, the Link State Update packets are
  7495.         multicast.    The destination    IP address specified for the
  7496.         Link State Update Packet depends on    the state of the
  7497.         interface.    If the interface state is DR or    Backup,    the
  7498.  
  7499.  
  7500.  
  7501. Moy                Standards Track              [Page 150]
  7502.  
  7503. RFC 2328             OSPF Version 2              April 1998
  7504.  
  7505.  
  7506.         address AllSPFRouters should be used.  Otherwise, the
  7507.         address AllDRouters    should be used.
  7508.  
  7509.         On non-broadcast networks, separate    Link State Update
  7510.         packets must be sent, as unicasts, to each adjacent    neighbor
  7511.         (i.e., those in state Exchange or greater).     The destination
  7512.         IP addresses for these packets are the neighbors' IP
  7513.         addresses.
  7514.  
  7515.  
  7516.     13.4.  Receiving self-originated LSAs
  7517.  
  7518.     It is a    common occurrence for a    router to receive self-
  7519.     originated LSAs    via the    flooding procedure. A self-originated
  7520.     LSA is detected    when either 1) the LSA's Advertising Router is
  7521.     equal to the router's own Router ID or 2) the LSA is a network-
  7522.     LSA and    its Link State ID is equal to one of the router's own IP
  7523.     interface addresses.
  7524.  
  7525.     However, if the    received self-originated LSA is    newer than the
  7526.     last instance that the router actually originated, the router
  7527.     must take special action.  The reception of such an LSA
  7528.     indicates that there are LSAs in the routing domain that were
  7529.     originated by the router before    the last time it was restarted.
  7530.     In most    cases, the router must then advance the    LSA's LS
  7531.     sequence number    one past the received LS sequence number, and
  7532.     originate a new    instance of the    LSA.
  7533.  
  7534.     It may be the case the router no longer    wishes to originate the
  7535.     received LSA. Possible examples    include: 1) the    LSA is a
  7536.     summary-LSA or AS-external-LSA and the router no longer    has an
  7537.     (advertisable) route to    the destination, 2) the    LSA is a
  7538.     network-LSA but    the router is no longer    Designated Router for
  7539.     the network or 3) the LSA is a network-LSA whose Link State ID
  7540.     is one of the router's own IP interface    addresses but whose
  7541.     Advertising Router is not equal    to the router's    own Router ID
  7542.     (this latter case should be rare, and it indicates that    the
  7543.     router's Router    ID has changed since originating the LSA).  In
  7544.     all these cases, instead of updating the LSA, the LSA should be
  7545.     flushed    from the routing domain    by incrementing    the received
  7546.     LSA's LS age to    MaxAge and reflooding (see Section 14.1).
  7547.  
  7548.  
  7549.  
  7550.  
  7551. Moy                Standards Track              [Page 151]
  7552.  
  7553. RFC 2328             OSPF Version 2              April 1998
  7554.  
  7555.  
  7556.     13.5.  Sending Link    State Acknowledgment packets
  7557.  
  7558.     Each newly received LSA    must be    acknowledged.  This is usually
  7559.     done by    sending    Link State Acknowledgment packets.  However,
  7560.     acknowledgments    can also be accomplished implicitly by sending
  7561.     Link State Update packets (see step 7a of Section 13).
  7562.  
  7563.     Many acknowledgments may be grouped together into a single Link
  7564.     State Acknowledgment packet.  Such a packet is sent back out the
  7565.     interface which    received the LSAs.  The    packet can be sent in
  7566.     one of two ways: delayed and sent on an    interval timer,    or sent
  7567.     directly to a particular neighbor.  The    particular
  7568.     acknowledgment strategy    used depends on    the circumstances
  7569.     surrounding the    receipt    of the LSA.
  7570.  
  7571.     Sending    delayed    acknowledgments    accomplishes several things: 1)
  7572.     it facilitates the packaging of    multiple acknowledgments in a
  7573.     single Link State Acknowledgment packet, 2) it enables a single
  7574.     Link State Acknowledgment packet to indicate acknowledgments to
  7575.     several    neighbors at once (through multicasting) and 3)    it
  7576.     randomizes the Link State Acknowledgment packets sent by the
  7577.     various    routers    attached to a common network.  The fixed
  7578.     interval between a router's delayed transmissions must be short
  7579.     (less than RxmtInterval) or needless retransmissions will ensue.
  7580.  
  7581.     Direct acknowledgments are sent    directly to a particular
  7582.     neighbor ving the    larger Le receipt of duplicate LSAs. Direct
  7583.     acknowledgments    are sent immediately when the duplicate    is
  7584.     received. On multi-access networks, these acknowledgments are
  7585.     sent directly to the neighbor's    IP address.
  7586.  
  7587.     The precise procedure for sending Link State Acknowledgment
  7588.     packets    is described in    Table 19.  The circumstances surrounding
  7589.     the receipt of the LSA are listed in the left column.  The
  7590.     acknowledgment action then taken is listed in one of the two
  7591.     right columns.    This action depends on the state of the
  7592.     concerned interface; interfaces    in state Backup    behave
  7593.     differently from interfaces in all other states.  Delayed
  7594.     acknowledgments    must be    delivered to all adjacent routers
  7595.     associated with    the interface.    On broadcast networks, this is
  7596.     accomplished by    sending    the delayed Link State Acknowledgment
  7597.     packets    as multicasts.    The Destination    IP address used    depends
  7598.  
  7599.  
  7600.  
  7601. Moy                Standards Track              [Page 152]
  7602.  
  7603. RFC 2328             OSPF Version 2              April 1998
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.  
  7610.                      Action taken in state
  7611.    Circumstances        Backup          All other states
  7612.    _________________________________________________________________
  7613.    LSA    has            No    acknowledgment      No  acknowledgment
  7614.    been     flooded back        sent.          sent.
  7615.    out receiving  in-
  7616.    terface  (see Sec-
  7617.    tion    13, step 5b).
  7618.    _________________________________________________________________
  7619.    LSA     is            Delayed acknowledg-      Delayed    ack-
  7620.    more     recent     than        ment sent if adver-      nowledgment sent.
  7621.    database copy, but        tisement   received
  7622.    was     not  flooded        from    Designated
  7623.    back    out receiving        Router,  otherwise
  7624.    interface            do nothing
  7625.    _________________________________________________________________
  7626.    LSA is a            Delayed acknowledg-      No  acknowledgment
  7627.    duplicate, and was        ment sent if adver-      sent.
  7628.    treated as an  im-        tisement   received
  7629.    plied  acknowledg-        from    Designated
  7630.    ment    (see  Section        Router,  otherwise
  7631.    13, step 7a).        do nothing
  7632.    _________________________________________________________________
  7633.    LSA is a            Direct acknowledg-      Direct acknowledg-
  7634.    duplicate, and was        ment sent.          ment sent.
  7635.    not treated as  an
  7636.    implied     ack-
  7637.    nowledgment.
  7638.    _________________________________________________________________
  7639.    LSA's LS            Direct acknowledg-      Direct acknowledg-
  7640.    age is equal    to        ment sent.          ment sent.
  7641.    MaxAge, and there is
  7642.    no current instance
  7643.    of the LSA
  7644.    in the link state
  7645.    database, and none
  7646.    of router's neighbors
  7647.    are in states Exchange
  7648.  
  7649.  
  7650.  
  7651. Moy                Standards Track              [Page 153]
  7652.  
  7653. RFC 2328             OSPF Version 2              April 1998
  7654.  
  7655.  
  7656.    or Loading (see
  7657.    Section 13, step 4).
  7658.  
  7659.  
  7660.          Table 19: Sending link state acknowledgements.
  7661.  
  7662.  
  7663.  
  7664.  
  7665.     on the state of    the interface.    If the interface state is DR or
  7666.     Backup,    the destination    AllSPFRouters is used.    In all other
  7667.     states,    the destination    AllDRouters is used.  On non-broadcast
  7668.     networks, delayed Link State Acknowledgment packets must be
  7669.     unicast    separately over    each adjacency (i.e., neighbor whose
  7670.     state is >= Exchange).
  7671.  
  7672.     The reasoning behind sending the above packets as multicasts is
  7673.     best explained by an example.  Consider    the network
  7674.     configuration depicted in Figure 15.  Suppose RT4 has been
  7675.     elected    as Designated Router, and RT3 as Backup    Designated
  7676.     Router for the network N3.  When Router    RT4 floods a new LSA to
  7677.     Network    N3, it is received by routers RT1, RT2,    and RT3.  These
  7678.     routers    will not flood the LSA back onto net N3, but they still
  7679.     must ensure that their link-state databases remain synchronized
  7680.     with their adjacent neighbors.    So RT1,    RT2, and RT4 are waiting
  7681.     to see an acknowledgment from RT3.  Likewise, RT4 and RT3 are
  7682.     both waiting to    see acknowledgments from RT1 and RT2.  This is
  7683.     best achieved by sending the acknowledgments as    multicasts.
  7684.  
  7685.     The reason that    the acknowledgment logic for Backup DRs    is
  7686.     slightly different is because they perform differently during
  7687.     the flooding of    LSAs (see Section 13.3,    step 4).
  7688.  
  7689.  
  7690.  
  7691.     13.6.  Retransmitting LSAs
  7692.  
  7693.     LSAs flooded out an adjacency are placed on the    adjacency's Link
  7694.     state retransmission list.  In order to    ensure that flooding is
  7695.     reliable, these    LSAs are retransmitted until they are
  7696.     acknowledged.  The length of time between retransmissions is a
  7697.     configurable per-interface value, RxmtInterval.     If this is set
  7698.  
  7699.  
  7700.  
  7701. Moy                Standards Track              [Page 154]
  7702.  
  7703. RFC 2328             OSPF Version 2              April 1998
  7704.  
  7705.  
  7706.     too low    for an interface, needless retransmissions will    ensue.
  7707.     If the value is    set too    high, the speed    of the flooding, in the
  7708.     face of    lost packets, may be affected.
  7709.  
  7710.     Several    retransmitted LSAs may fit into    a single Link State
  7711.     Update packet.    When LSAs are to be retransmitted, only    the
  7712.     number fitting in a single Link    State Update packet should be
  7713.     sent.  Another packet of retransmissions can be    sent whenever
  7714.     some of    the LSAs are acknowledged, or on the next firing of the
  7715.     retransmission timer.
  7716.  
  7717.     Link State Update Packets carrying retransmissions are always
  7718.     sent directly to the neighbor. On multi-access networks, this
  7719.     means that retransmissions are sent directly to    the neighbor's
  7720.     IP address.  Each LSA's    LS age must be incremented by
  7721.     InfTransDelay (which must be > 0) when it is copied into the
  7722.     outgoing Link State Update packet (until the LS    age field
  7723.     reaches    the maximum value of MaxAge).
  7724.  
  7725.     If an adjacent router goes down, retransmissions may occur until
  7726.     the adjacency is destroyed by OSPF's Hello Protocol.  When the
  7727.     adjacency is destroyed,    the Link state retransmission list is
  7728.     cleared.
  7729.  
  7730.  
  7731.     13.7.  Receiving link state    acknowledgments
  7732.  
  7733.     Many consistency checks    have been made on a received Link State
  7734.     Acknowledgment packet before it    is handed to the flooding
  7735.     procedure.  In particular, it has been associated with a
  7736.     particular neighbor.  If this neighbor is in a lesser state than
  7737.     Exchange, the Link State Acknowledgment    packet is discarded.
  7738.  
  7739.     Otherwise, for each acknowledgment in the Link State
  7740.     Acknowledgment packet, the following steps are performed:
  7741.  
  7742.  
  7743.     o   Does the LSA acknowledged have an instance on the Link state
  7744.         retransmission list    for the    neighbor?  If not, examine the
  7745.         next acknowledgment.  Otherwise:
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751. Moy                Standards Track              [Page 155]
  7752.  
  7753. RFC 2328             OSPF Version 2              April 1998
  7754.  
  7755.  
  7756.     o   If the acknowledgment is for the same instance that    is
  7757.         contained on the list, remove the item from    the list and
  7758.         examine the    next acknowledgment.  Otherwise:
  7759.  
  7760.     o   Log    the questionable acknowledgment, and examine the next
  7761.         one.
  7762.  
  7763.  
  7764. 14.  Aging The Link State Database
  7765.  
  7766.     Each LSA has an LS age field.  The LS age is expressed in seconds.
  7767.     An LSA's LS    age field is incremented while it is contained in a
  7768.     router's database.    Also, when copied into a Link State Update
  7769.     Packet for flooding    out a particular interface, the    LSA's LS age is
  7770.     incremented    by InfTransDelay.
  7771.  
  7772.     An LSA's LS    age is never incremented past the value    MaxAge.     LSAs
  7773.     having age MaxAge are not used in the routing table    calculation.  As
  7774.     a router ages its link state database, an LSA's LS age may reach
  7775.     MaxAge.[21]    At this    time, the router must attempt to flush the LSA
  7776.     from the routing domain.  This is done simply by reflooding    the
  7777.     MaxAge LSA just as if it was a newly originated LSA    (see Section
  7778.     13.3).
  7779.  
  7780.     When creating a Database summary list for a    newly forming adjacency,
  7781.     any    MaxAge LSAs present in the link    state database are added to the
  7782.     neighbor's Link state retransmission list instead of the neighbor's
  7783.     Database summary list.  See    Section    10.3 for more details.
  7784.  
  7785.     A MaxAge LSA must be removed immediately from the router's link
  7786.     state database as soon as both a) it is no longer contained    on any
  7787.     neighbor Link state    retransmission lists and b) none of the    router's
  7788.     neighbors are in states Exchange or    Loading.
  7789.  
  7790.     When, in the process of aging the link state database, an LSA's LS
  7791.     age    hits a multiple    of CheckAge, its LS checksum should be verified.
  7792.     If the LS checksum is incorrect, a program or memory error has been
  7793.     detected, and at the very least the    router itself should be
  7794.     restarted.
  7795.  
  7796.  
  7797.  
  7798.  
  7799.  
  7800.  
  7801. Moy                Standards Track              [Page 156]
  7802.  
  7803. RFC 2328             OSPF Version 2              April 1998
  7804.  
  7805.  
  7806.     14.1.  Premature aging of LSAs
  7807.  
  7808.     An LSA can be flushed from the routing domain by setting its LS
  7809.     age to MaxAge, while leaving its LS sequence number alone, and
  7810.     then reflooding    the LSA.  This procedure follows the same course
  7811.     as flushing an LSA whose LS age    has naturally reached the value
  7812.     MaxAge (see Section 14).  In particular, the MaxAge LSA    is
  7813.     removed    from the router's link state database as soon as a) it
  7814.     is no longer contained on any neighbor Link state retransmission
  7815.     lists and b) none of the router's neighbors are    in states
  7816.     Exchange or Loading.  We call the setting of an    LSA's LS age to
  7817.     MaxAge "premature aging".
  7818.  
  7819.     Premature aging    is used    when it    is time    for a self-originated
  7820.     LSA's sequence number field to wrap.  At this point, the current
  7821.     LSA instance (having LS    sequence number    MaxSequenceNumber) must
  7822.     be prematurely aged and    flushed    from the routing domain    before a
  7823.     new instance with sequence number equal    to InitialSequenceNumber
  7824.     can be originated.  See    Section    12.1.6 for more    information.
  7825.  
  7826.     Premature aging    can also be used when, for example, one    of the
  7827.     router's previously advertised external    routes is no longer
  7828.     reachable.  In this circumstance, the router can flush its AS-
  7829.     external-LSA from the routing domain via premature aging. This
  7830.     procedure is preferable    to the alternative, which is to
  7831.     originate a new    LSA for    the destination    specifying a metric of
  7832.     LSInfinity.  Premature aging is    also be    used when unexpectedly
  7833.     receiving self-originated LSAs during the flooding procedure
  7834.     (see Section 13.4).
  7835.  
  7836.     A router may only prematurely age its own self-originated LSAs.
  7837.     The router may not prematurely age LSAs    that have been
  7838.     originated by other routers. An    LSA is considered self-
  7839.     originated when    either 1) the LSA's Advertising    Router is equal
  7840.     to the router's    own Router ID or 2) the    LSA is a network-LSA and
  7841.     its Link State ID is equal to one of the router's own IP
  7842.     interface addresses.
  7843.  
  7844.  
  7845.  
  7846.  
  7847.  
  7848.  
  7849.  
  7850.  
  7851. Moy                Standards Track              [Page 157]
  7852.  
  7853. RFC 2328             OSPF Version 2              April 1998
  7854.  
  7855.  
  7856. 15.  Virtual Links
  7857.  
  7858.     The    single backbone    area (Area ID =    0.0.0.0) cannot    be disconnected,
  7859.     or some areas of the Autonomous System will    become unreachable.  To
  7860.     establish/maintain connectivity of the backbone, virtual links can
  7861.     be configured through non-backbone areas.  Virtual links serve to
  7862.     connect physically separate    components of the backbone.  The two
  7863.     endpoints of a virtual link    are area border    routers.  The virtual
  7864.     link must be configured in both routers.  The configuration
  7865.     information    in each    router consists    of the other virtual endpoint
  7866.     (the other area border router), and    the non-backbone area the two
  7867.     routers have in common (called the Transit area).  Virtual links
  7868.     cannot be configured through stub areas (see Section 3.6).
  7869.  
  7870.     The    virtual    link is    treated    as if it were an unnumbered point-to-
  7871.     point network belonging to the backbone and    joining    the two    area
  7872.     border routers.  An    attempt    is made    to establish an    adjacency over
  7873.     the    virtual    link.  When this adjacency is established, the virtual
  7874.     link will be included in backbone router-LSAs, and OSPF packets
  7875.     pertaining to the backbone area will flow over the adjacency.  Such
  7876.     an adjacency has been referred to in this document as a "virtual
  7877.     adjacency".
  7878.  
  7879.     In each endpoint router, the cost and viability of the virtual link
  7880.     is discovered by examining the routing table entry for the other
  7881.     endpoint router.  (The entry's associated area must    be the
  7882.     configured Transit area).  This is called the virtual link's
  7883.     corresponding routing table    entry.    The InterfaceUp    event occurs for
  7884.     a virtual link when    its corresponding routing table    entry becomes
  7885.     reachable.    Conversely, the    InterfaceDown event occurs when    its
  7886.     routing table entry    becomes    unreachable.  In other words, the
  7887.     virtual link's viability is    determined by the existence of an
  7888.     intra-area path, through the Transit area, between the two
  7889.     endpoints.    Note that a virtual link whose underlying path has cost
  7890.     greater than hexadecimal 0xffff (the maximum size of an interface
  7891.     cost in a router-LSA) should be considered inoperational (i.e.,
  7892.     treated the    same as    if the path did    not exist).
  7893.  
  7894.     The    other details concerning virtual links are as follows:
  7895.  
  7896.     o    AS-external-LSAs are NEVER flooded over    virtual    adjacencies.
  7897.     This would be duplication of effort, since the same AS-
  7898.  
  7899.  
  7900.  
  7901. Moy                Standards Track              [Page 158]
  7902.  
  7903. RFC 2328             OSPF Version 2              April 1998
  7904.  
  7905.  
  7906.     external-LSAs are already flooded throughout the virtual link's
  7907.     Transit    area.  For this    same reason, AS-external-LSAs are not
  7908.     summarized over    virtual    adjacencies during the Database    Exchange
  7909.     process.
  7910.  
  7911.     o    The cost of a virtual link is NOT configured.  It is defined to
  7912.     be the cost of the intra-area path between the two defining area
  7913.     border routers.     This cost appears in the virtual link's
  7914.     corresponding routing table entry.  When the cost of a virtual
  7915.     link changes, a    new router-LSA should be originated for    the
  7916.     backbone area.
  7917.  
  7918.     o    Just as    the virtual link's cost    and viability are determined by
  7919.     the routing table build    process    (through construction of the
  7920.     routing    table entry for    the other endpoint), so    are the    IP
  7921.     interface address for the virtual interface and    the virtual
  7922.     neighbor's IP address.    These are used when sending OSPF
  7923.     protocol packets over the virtual link.    Note that when one (or
  7924.     both) of the virtual link endpoints connect to the Transit area
  7925.     via an unnumbered point-to-point link, it may be impossible to
  7926.     calculate either the virtual interface's IP address and/or the
  7927.     virtual    neighbor's IP address, thereby causing the virtual link
  7928.     to fail.
  7929.  
  7930.     o    In each    endpoint's router-LSA for the backbone,    the virtual link
  7931.     is represented as a Type 4 link    whose Link ID is set to    the
  7932.     virtual    neighbor's OSPF    Router ID and whose Link Data is set to
  7933.     the virtual interface's    IP address.  See Section 12.4.1    for more
  7934.     information.
  7935.  
  7936.     o    A non-backbone area can    carry transit data traffic (i.e., is
  7937.     considered a "transit area") if    and only if it serves as the
  7938.     Transit    area for one or    more fully adjacent virtual links (see
  7939.     TransitCapability in Sections 6    and 16.1). Such    an area    requires
  7940.     special    treatment when summarizing backbone networks into it
  7941.     (see Section 12.4.3), and during the routing calculation (see
  7942.     Section    16.3).
  7943.  
  7944.     o    The time between link state retransmissions, RxmtInterval, is
  7945.     configured for a virtual link.    This should be well over the
  7946.     expected round-trip delay between the two routers.  This may be
  7947.  
  7948.  
  7949.  
  7950.  
  7951. Moy                Standards Track              [Page 159]
  7952.  
  7953. RFC 2328             OSPF Version 2              April 1998
  7954.  
  7955.  
  7956.     hard to    estimate for a virtual link; it    is better to err on the
  7957.     side of    making it too large.
  7958.  
  7959.  
  7960. 16.  Calculation of the    routing    table
  7961.  
  7962.     This section details the OSPF routing table    calculation.  Using its
  7963.     attached areas' link state databases as input, a router runs the
  7964.     following algorithm, building its routing table step by step.  At
  7965.     each step, the router must access individual pieces    of the link
  7966.     state databases (e.g., a router-LSA    originated by a    certain    router).
  7967.     This access    is performed by    the lookup function discussed in Section
  7968.     12.2.  The lookup process may return an LSA    whose LS age is    equal to
  7969.     MaxAge.  Such an LSA should    not be used in the routing table
  7970.     calculation, and is    treated    just as    if the lookup process had
  7971.     failed.
  7972.  
  7973.     The    OSPF routing table's organization is explained in Section 11.
  7974.     Two    examples of the    routing    table build process are    presented in
  7975.     Sections 11.2 and 11.3.  This process can be broken    into the
  7976.     following steps:
  7977.  
  7978.     (1)    The present routing table is invalidated.  The routing table is
  7979.     built again from scratch.  The old routing table is saved so
  7980.     that changes in    routing    table entries can be identified.
  7981.  
  7982.     (2)    The intra-area routes are calculated by    building the shortest-
  7983.     path tree for each attached area.  In particular, all routing
  7984.     table entries whose Destination    Type is    "area border router" are
  7985.     calculated in this step.  This step is described in two    parts.
  7986.     At first the tree is constructed by only considering those links
  7987.     between    routers    and transit networks.  Then the    stub networks
  7988.     are incorporated into the tree.    During the area's shortest-path
  7989.     tree calculation, the area's TransitCapability is also
  7990.     calculated for later use in Step 4.
  7991.  
  7992.     (3)    The inter-area routes are calculated, through examination of
  7993.     summary-LSAs.  If the router is    attached to multiple areas
  7994.     (i.e., it is an    area border router), only backbone summary-LSAs
  7995.     are examined.
  7996.  
  7997.  
  7998.  
  7999.  
  8000.  
  8001. Moy                Standards Track              [Page 160]
  8002.  
  8003. RFC 2328             OSPF Version 2              April 1998
  8004.  
  8005.  
  8006.     (4)    In area    border routers connecting to one or more transit areas
  8007.     (i.e, non-backbone areas whose TransitCapability is found to be
  8008.     TRUE), the transit areas' summary-LSAs are examined to see
  8009.     whether    better paths exist using the transit areas than    were
  8010.     found in Steps 2-3 above.
  8011.  
  8012.     (5)    Routes to external destinations    are calculated,    through
  8013.     examination of AS-external-LSAs.  The locations    of the AS
  8014.     boundary routers (which    originate the AS-external-LSAs)    have
  8015.     been determined    in steps 2-4.
  8016.  
  8017.  
  8018.     Steps 2-5 are explained in further detail below.
  8019.  
  8020.     Changes made to routing table entries as a result of these
  8021.     calculations can cause the OSPF protocol to    take further actions.
  8022.     For    example, a change to an    intra-area route will cause an area
  8023.     border router to originate new summary-LSAs    (see Section 12.4).  See
  8024.     Section 16.7 for a complete    list of    the OSPF protocol actions
  8025.     resulting from routing table changes.
  8026.  
  8027.  
  8028.     16.1.  Calculating the shortest-path tree for an area
  8029.  
  8030.     This calculation yields    the set    of intra-area routes associated
  8031.     with an    area (called hereafter Area A).     A router calculates the
  8032.     shortest-path tree using itself    as the root.[22] The formation
  8033.     of the shortest    path tree is done here in two stages.  In the
  8034.     first stage, only links    between    routers    and transit networks are
  8035.     considered.  Using the Dijkstra    algorithm, a tree is formed from
  8036.     this subset of the link    state database.     In the    second stage,
  8037.     leaves are added to the    tree by    considering the    links to stub
  8038.     networks.
  8039.  
  8040.     The procedure will be explained    using the graph    terminology that
  8041.     was introduced in Section 2.  The area's link state database is
  8042.     represented as a directed graph.  The graph's vertices are
  8043.     routers, transit networks and stub networks.  The first    stage of
  8044.     the procedure concerns only the    transit    vertices (routers and
  8045.     transit    networks) and their connecting links.  Throughout the
  8046.     shortest path calculation, the following data is also associated
  8047.     with each transit vertex:
  8048.  
  8049.  
  8050.  
  8051. Moy                Standards Track              [Page 161]
  8052.  
  8053. RFC 2328             OSPF Version 2              April 1998
  8054.  
  8055.  
  8056.     Vertex (node) ID
  8057.         A 32-bit number which together with    the vertex type    (router
  8058.         or network)    uniquely identifies the    vertex.     For router
  8059.         vertices the Vertex    ID is the router's OSPF    Router ID.  For
  8060.         network vertices, it is the    IP address of the network's
  8061.         Designated Router.
  8062.  
  8063.     An LSA
  8064.         Each transit vertex    has an associated LSA.    For router
  8065.         vertices, this is a    router-LSA.  For transit networks, this
  8066.         is a network-LSA (which is actually    originated by the
  8067.         network's Designated Router).  In any case,    the LSA's Link
  8068.         State ID is    always equal to    the above Vertex ID.
  8069.  
  8070.     List of    next hops
  8071.         The    list of    next hops for the current set of shortest paths
  8072.         from the root to this vertex.  There can be    multiple
  8073.         shortest paths due to the equal-cost multipath capability.
  8074.         Each next hop indicates the    outgoing router    interface to use
  8075.         when forwarding traffic to the destination.     On broadcast,
  8076.         Point-to-MultiPoint    and NBMA networks, the next hop    also
  8077.         includes the IP address of the next    router (if any)    in the
  8078.         path towards the destination.
  8079.  
  8080.     Distance from root
  8081.         The    link state cost    of the current set of shortest paths
  8082.         from the root to the vertex.  The link state cost of a path
  8083.         is calculated as the sum of    the costs of the path's
  8084.         constituent    links (as advertised in    router-LSAs and
  8085.         network-LSAs).  One    path is    said to    be "shorter" than
  8086.         another if it has a    smaller    link state cost.
  8087.  
  8088.  
  8089.     The first stage    of the procedure (i.e.,    the Dijkstra algorithm)
  8090.     can now    be summarized as follows. At each iteration of the
  8091.     algorithm, there is a list of candidate    vertices.  Paths from
  8092.     the root to these vertices have    been found, but    not necessarily
  8093.     the shortest ones.  However, the paths to the candidate    vertex
  8094.     that is    closest    to the root are    guaranteed to be shortest; this
  8095.     vertex is added    to the shortest-path tree, removed from    the
  8096.     candidate list,    and its    adjacent vertices are examined for
  8097.     possible addition to/modification of the candidate list.  The
  8098.  
  8099.  
  8100.  
  8101. Moy                Standards Track              [Page 162]
  8102.  
  8103. RFC 2328             OSPF Version 2              April 1998
  8104.  
  8105.  
  8106.     algorithm then iterates    again.    It terminates when the candidate
  8107.     list becomes empty.
  8108.  
  8109.     The following steps describe the algorithm in detail.  Remember
  8110.     that we    are computing the shortest path    tree for Area A.  All
  8111.     references to link state database lookup below are from    Area A's
  8112.     database.
  8113.  
  8114.     (1) Initialize the algorithm's data structures.     Clear the list
  8115.         of candidate vertices.  Initialize the shortest-path tree to
  8116.         only the root (which is the    router doing the calculation).
  8117.         Set    Area A's TransitCapability to FALSE.
  8118.  
  8119.     (2) Call the vertex just added to the tree vertex V.  Examine
  8120.         the    LSA associated with vertex V.  This is a lookup    in the
  8121.         Area A's link state    database based on the Vertex ID.  If
  8122.         this is a router-LSA, and bit V of the router-LSA (see
  8123.         Section A.4.2) is set, set Area A's    TransitCapability to
  8124.         TRUE.  In any case,    each link described by the LSA gives the
  8125.         cost to an adjacent    vertex.     For each described link, (say
  8126.         it joins vertex V to vertex    W):
  8127.  
  8128.         (a)    If this    is a link to a stub network, examine the next
  8129.         link in    V's LSA.  Links    to stub    networks will be
  8130.         considered in the second stage of the shortest path
  8131.         calculation.
  8132.  
  8133.         (b)    Otherwise, W is    a transit vertex (router or transit
  8134.         network).  Look    up the vertex W's LSA (router-LSA or
  8135.         network-LSA) in    Area A's link state database.  If the
  8136.         LSA does not exist, or its LS age is equal to MaxAge, or
  8137.         it does    not have a link    back to    vertex V, examine the
  8138.         next link in V's LSA.[23]
  8139.  
  8140.         (c)    If vertex W is already on the shortest-path tree,
  8141.         examine    the next link in the LSA.
  8142.  
  8143.         (d)    Calculate the link state cost D    of the resulting path
  8144.         from the root to vertex    W.  D is equal to the sum of the
  8145.         link state cost    of the (already    calculated) shortest
  8146.         path to    vertex V and the advertised cost of the    link
  8147.         between    vertices V and W.  If D    is:
  8148.  
  8149.  
  8150.  
  8151. Moy                Standards Track              [Page 163]
  8152.  
  8153. RFC 2328             OSPF Version 2              April 1998
  8154.  
  8155.  
  8156.         o   Greater than the value that    already    appears    for
  8157.             vertex W on    the candidate list, then examine the
  8158.             next link.
  8159.  
  8160.         o   Equal to the value that appears for    vertex W on the
  8161.             candidate list, calculate the set of next hops that
  8162.             result from    using the advertised link.  Input to
  8163.             this calculation is    the destination    (W), and its
  8164.             parent (V).     This calculation is shown in Section
  8165.             16.1.1.  This set of hops should be    added to the
  8166.             next hop values that appear    for W on the candidate
  8167.             list.
  8168.  
  8169.         o   Less than the value    that appears for vertex    W on the
  8170.             candidate list, or if W does not yet appear    on the
  8171.             candidate list, then set the entry for W on    the
  8172.             candidate list to indicate a distance of D from the
  8173.             root.  Also    calculate the list of next hops    that
  8174.             result from    using the advertised link, setting the
  8175.             next hop values for    W accordingly.    The next hop
  8176.             calculation    is described in    Section    16.1.1;    it takes
  8177.             as input the destination (W) and its parent    (V).
  8178.  
  8179.     (3) If at this step the    candidate list is empty, the shortest-
  8180.         path tree (of transit vertices) has    been completely    built
  8181.         and    this stage of the procedure terminates.     Otherwise,
  8182.         choose the vertex belonging    to the candidate list that is
  8183.         closest to the root, and add it to the shortest-path tree
  8184.         (removing it from the candidate list in the    process). Note
  8185.         that when there is a choice    of vertices closest to the root,
  8186.         network vertices must be chosen before router vertices in
  8187.         order to necessarily find all equal-cost paths. This is
  8188.         consistent with the    tie-breakers that were introduced in the
  8189.         modified Dijkstra algorithm    used by    OSPF's Multicast routing
  8190.         extensions (MOSPF).
  8191.  
  8192.     (4) Possibly modify the    routing    table.    For those routing table
  8193.         entries modified, the associated area will be set to Area A,
  8194.         the    path type will be set to intra-area, and the cost will
  8195.         be set to the newly    discovered shortest path's calculated
  8196.         distance.
  8197.  
  8198.  
  8199.  
  8200.  
  8201. Moy                Standards Track              [Page 164]
  8202.  
  8203. RFC 2328             OSPF Version 2              April 1998
  8204.  
  8205.  
  8206.         If the newly added vertex is an area border    router or AS
  8207.         boundary router, a routing table entry is added whose
  8208.         destination    type is    "router".  The Options field found in
  8209.         the    associated router-LSA is copied    into the routing table
  8210.         entry's Optional capabilities field. Call the newly    added
  8211.         vertex Router X.  If Router    X is the endpoint of one of the
  8212.         calculating    router's virtual links,    and the    virtual    link
  8213.         uses Area A    as Transit area:  the virtual link is declared
  8214.         up,    the IP address of the virtual interface    is set to the IP
  8215.         address of the outgoing interface calculated above for
  8216.         Router X, and the virtual neighbor's IP address is set to
  8217.         Router X's interface address (contained in Router X's
  8218.         router-LSA)    that points back to the    root of    the shortest-
  8219.         path tree; equivalently, this is the interface that    points
  8220.         back to Router X's parent vertex on    the shortest-path tree
  8221.         (similar to    the calculation    in Section 16.1.1).
  8222.  
  8223.         If the newly added vertex is a transit network, the    routing
  8224.         table entry    for the    network    is located.  The entry's
  8225.         Destination    ID is the IP network number, which can be
  8226.         obtained by    masking    the Vertex ID (Link State ID) with its
  8227.         associated subnet mask (found in the body of the associated
  8228.         network-LSA).  If the routing table    entry already exists
  8229.         (i.e., there is already an intra-area route    to the
  8230.         destination    installed in the routing table), multiple
  8231.         vertices have mapped to the    same IP    network.  For example,
  8232.         this can occur when    a new Designated Router    is being
  8233.         established.  In this case,    the current routing table entry
  8234.         should be overwritten if and only if the newly found path is
  8235.         just as short and the current routing table    entry's    Link
  8236.         State Origin has a smaller Link State ID than the newly
  8237.         added vertex' LSA.
  8238.  
  8239.         If there is    no routing table entry for the network (the
  8240.         usual case), a routing table entry for the IP network should
  8241.         be added.  The routing table entry's Link State Origin
  8242.         should be set to the newly added vertex' LSA.
  8243.  
  8244.     (5) Iterate the    algorithm by returning to Step 2.
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251. Moy                Standards Track              [Page 165]
  8252.  
  8253. RFC 2328             OSPF Version 2              April 1998
  8254.  
  8255.  
  8256.     The stub networks are added to the tree    in the procedure's
  8257.     second stage.  In this stage, all router vertices are again
  8258.     examined.  Those that have been    determined to be unreachable in
  8259.     the above first    phase are discarded.  For each reachable router
  8260.     vertex (call it    V), the    associated router-LSA is found in the
  8261.     link state database.  Each stub    network    link appearing in the
  8262.     LSA is then examined, and the following    steps are executed:
  8263.  
  8264.     (1) Calculate the distance D of    stub network from the root.  D
  8265.         is equal to    the distance from the root to the router vertex
  8266.         (calculated    in stage 1), plus the stub network link's
  8267.         advertised cost.  Compare this distance to the current best
  8268.         cost to the    stub network.  This is done by looking up the
  8269.         stub network's current routing table entry.     If the
  8270.         calculated distance    D is larger, go    on to examine the next
  8271.         stub network link in the LSA.
  8272.  
  8273.     (2) If this step is reached, the stub network's    routing    table
  8274.         entry must be updated.  Calculate the set of next hops that
  8275.         would result from using the    stub network link.  This
  8276.         calculation    is shown in Section 16.1.1; input to this
  8277.         calculation    is the destination (the    stub network) and the
  8278.         parent vertex (the router vertex).    If the distance    D is the
  8279.         same as the    current    routing    table cost, simply add this set
  8280.         of next hops to the    routing    table entry's list of next hops.
  8281.         In this case, the routing table already has    a Link State
  8282.         Origin.  If    this Link State    Origin is a router-LSA whose
  8283.         Link State ID is smaller than V's Router ID, reset the Link
  8284.         State Origin to V's    router-LSA.
  8285.  
  8286.         Otherwise D    is smaller than    the routing table cost.
  8287.         Overwrite the current routing table    entry by setting the
  8288.         routing table entry's cost to D, and by setting the    entry's
  8289.         list of next hops to the newly calculated set.  Set    the
  8290.         routing table entry's Link State Origin to V's router-LSA.
  8291.         Then go on to examine the next stub    network    link.
  8292.  
  8293.  
  8294.     For all    routing    table entries added/modified in    the second
  8295.     stage, the associated area will    be set to Area A and the path
  8296.     type will be set to intra-area.     When the list of reachable
  8297.     router-LSAs is exhausted, the second stage is completed.  At
  8298.  
  8299.  
  8300.  
  8301. Moy                Standards Track              [Page 166]
  8302.  
  8303. RFC 2328             OSPF Version 2              April 1998
  8304.  
  8305.  
  8306.     this time, all intra-area routes associated with Area A    have
  8307.     been determined.
  8308.  
  8309.     The specification does not require that    the above two stage
  8310.     method be used to calculate the    shortest path tree.  However, if
  8311.     another    algorithm is used, an identical    tree must be produced.
  8312.     For this reason, it is important to note that links between
  8313.     transit    vertices must be bidirectional in order    to be included
  8314.     in the above tree.  It should also be mentioned    that more
  8315.     efficient algorithms exist for calculating the tree; for
  8316.     example, the incremental SPF algorithm described in [Ref1].
  8317.  
  8318.  
  8319.     16.1.1.     The next hop calculation
  8320.  
  8321.         This section explains how to calculate the current set of
  8322.         next hops to use for a destination.     Each next hop consists
  8323.         of the outgoing interface to use in    forwarding packets to
  8324.         the    destination together with the IP address of the    next hop
  8325.         router (if any).  The next hop calculation is invoked each
  8326.         time a shorter path    to the destination is discovered.  This
  8327.         can    happen in either stage of the shortest-path tree
  8328.         calculation    (see Section 16.1).  In    stage 1    of the
  8329.         shortest-path tree calculation a shorter path is found as
  8330.         the    destination is added to    the candidate list, or when the
  8331.         destination's entry    on the candidate list is modified (Step
  8332.         2d of Stage    1).  In    stage 2    a shorter path is discovered
  8333.         each time the destination's    routing    table entry is modified
  8334.         (Step 2 of Stage 2).
  8335.  
  8336.         The    set of next hops to use    for the    destination may    be
  8337.         recalculated several times during the shortest-path    tree
  8338.         calculation, as shorter and    shorter    paths are discovered.
  8339.         In the end,    the destination's routing table    entry will
  8340.         always reflect the next hops resulting from    the absolute
  8341.         shortest path(s).
  8342.  
  8343.         Input to the next hop calculation is a) the    destination and
  8344.         b) its parent in the current shortest path between the root
  8345.         (the calculating router) and the destination.  The parent is
  8346.         always a transit vertex (i.e., always a router or a    transit
  8347.         network).
  8348.  
  8349.  
  8350.  
  8351. Moy                Standards Track              [Page 167]
  8352.  
  8353. RFC 2328             OSPF Version 2              April 1998
  8354.  
  8355.  
  8356.         If there is    at least one intervening router    in the current
  8357.         shortest path between the destination and the root,    the
  8358.         destination    simply inherits    the set    of next    hops from the
  8359.         parent.  Otherwise,    there are two cases.  In the first case,
  8360.         the    parent vertex is the root (the calculating router
  8361.         itself).  This means that the destination is either    a
  8362.         directly connected network or directly connected router.
  8363.         The    outgoing interface in this case    is simply the OSPF
  8364.         interface connecting to the    destination network/router. If
  8365.         the    destination is a router    which connects to the
  8366.         calculating    router via a Point-to-MultiPoint network, the
  8367.         destination's next hop IP address(es) can be determined by
  8368.         examining the destination's    router-LSA: each link pointing
  8369.         back to the    calculating router and having a    Link Data field
  8370.         belonging to the Point-to-MultiPoint network provides an IP
  8371.         address of the next    hop router. If the destination is a
  8372.         directly connected network,    or a router which connects to
  8373.         the    calculating router via a point-to-point    interface, no
  8374.         next hop IP    address    is required. If    the destination    is a
  8375.         router connected to    the calculating    router via a virtual
  8376.         link, the setting of the next hop should be    deferred until
  8377.         the    calculation in Section 16.3.
  8378.  
  8379.         In the second case,    the parent vertex is a network that
  8380.         directly connects the calculating router to    the destination
  8381.         router.  The list of next hops is then determined by
  8382.         examining the destination's    router-LSA.  For each link in
  8383.         the    router-LSA that    points back to the parent network, the
  8384.         link's Link    Data field provides the    IP address of a    next hop
  8385.         router.  The outgoing interface to use can then be derived
  8386.         from the next hop IP address (or it    can be inherited from
  8387.         the    parent network).
  8388.  
  8389.  
  8390.     16.2.  Calculating the inter-area routes
  8391.  
  8392.     The inter-area routes are calculated by    examining summary-LSAs.
  8393.     If the router has active attachments to    multiple areas,    only
  8394.     backbone summary-LSAs are examined.  Routers attached to a
  8395.     single area examine that area's    summary-LSAs.  In either case,
  8396.     the summary-LSAs examined below    are all    part of    a single area's
  8397.     link state database (call it Area A).
  8398.  
  8399.  
  8400.  
  8401. Moy                Standards Track              [Page 168]
  8402.  
  8403. RFC 2328             OSPF Version 2              April 1998
  8404.  
  8405.  
  8406.     Summary-LSAs are originated by the area    border routers.     Each
  8407.     summary-LSA in Area A is considered in turn.  Remember that the
  8408.     destination described by a summary-LSA is either a network (Type
  8409.     3 summary-LSAs)    or an AS boundary router (Type 4 summary-LSAs).
  8410.     For each summary-LSA:
  8411.  
  8412.  
  8413.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8414.         LSA's LS age is equal to MaxAge, then examine the the next
  8415.         LSA.
  8416.  
  8417.     (2) If the LSA was originated by the calculating router    itself,
  8418.         examine the    next LSA.
  8419.  
  8420.     (3) If it is a Type 3 summary-LSA, and the collection of
  8421.         destinations described by the summary-LSA equals one of the
  8422.         router's configured    area address ranges (see Section 3.5),
  8423.         and    the particular area address range is active, then the
  8424.         summary-LSA    should be ignored.  "Active" means that    there
  8425.         are    one or more reachable (by intra-area paths) networks
  8426.         contained in the area range.
  8427.  
  8428.     (4) Else, call the destination described by the    LSA N (for Type
  8429.         3 summary-LSAs, N's    address    is obtained by masking the LSA's
  8430.         Link State ID with the network/subnet mask contained in the
  8431.         body of the    LSA), and the area border originating the LSA
  8432.         BR.     Look up the routing table entry for BR    having Area A as
  8433.         its    associated area.  If no    such entry exists for router BR
  8434.         (i.e., BR is unreachable in    Area A), do nothing with this
  8435.         LSA    and consider the next in the list.  Else, this LSA
  8436.         describes an inter-area path to destination    N, whose cost is
  8437.         the    distance to BR plus the    cost specified in the LSA. Call
  8438.         the    cost of    this inter-area    path IAC.
  8439.  
  8440.     (5) Next, look up the routing table entry for the destination N.
  8441.         (If    N is an    AS boundary router, look up the    "router" routing
  8442.         table entry    associated with    Area A).  If no    entry exists for
  8443.         N or if the    entry's    path type is "type 1 external" or "type
  8444.         2 external", then install the inter-area path to N,    with
  8445.         associated area Area A, cost IAC, next hop equal to    the list
  8446.         of next hops to router BR, and Advertising router equal to
  8447.         BR.
  8448.  
  8449.  
  8450.  
  8451. Moy                Standards Track              [Page 169]
  8452.  
  8453. RFC 2328             OSPF Version 2              April 1998
  8454.  
  8455.  
  8456.     (6) Else, if the paths present in the table are    intra-area
  8457.         paths, do nothing with the LSA (intra-area paths are always
  8458.         preferred).
  8459.  
  8460.     (7) Else, the paths present in the routing table are also
  8461.         inter-area paths.  Install the new path through BR if it is
  8462.         cheaper, overriding    the paths in the routing table.
  8463.         Otherwise, if the new path is the same cost, add it    to the
  8464.         list of paths that appear in the routing table entry.
  8465.  
  8466.     16.3.  Examining transit areas' summary-LSAs
  8467.  
  8468.     This step is only performed by area border routers attached to
  8469.     one or more non-backbone areas that are    capable    of carrying
  8470.     transit    traffic    (i.e., "transit    areas",    or those areas whose
  8471.     TransitCapability parameter has    been set to TRUE in Step 2 of
  8472.     the Dijkstra algorithm (see Section 16.1).
  8473.  
  8474.     The purpose of the calculation below is    to examine the transit
  8475.     areas to see whether they provide any better (shorter) paths
  8476.     than the paths previously calculated in    Sections 16.1 and 16.2.
  8477.     Any paths found    that are better    than or    equal to previously
  8478.     discovered paths are installed in the routing table.
  8479.  
  8480.     The calculation    also determines    the actual next    hop(s) for those
  8481.     destinations whose next    hop was    calculated as a    virtual    link in
  8482.     Sections 16.1 and 16.2.     After completion of the calculation
  8483.     below, any paths calculated in Sections    16.1 and 16.2 that still
  8484.     have unresolved    virtual    next hops should be discarded.
  8485.  
  8486.     The calculation    proceeds as follows. All the transit areas'
  8487.     summary-LSAs are examined in turn.  Each such summary-LSA
  8488.     describes a route through a transit area Area A    to a Network N
  8489.     (N's address is    obtained by masking the    LSA's Link State ID with
  8490.     the network/subnet mask    contained in the body of the LSA) or in
  8491.     the case of a Type 4 summary-LSA, to an    AS boundary router N.
  8492.     Suppose    also that the summary-LSA was originated by an area
  8493.     border router BR.
  8494.  
  8495.     (1) If the cost    advertised by the summary-LSA is LSInfinity, or
  8496.         if the LSA's LS age    is equal to MaxAge, then examine the
  8497.         next LSA.
  8498.  
  8499.  
  8500.  
  8501. Moy                Standards Track              [Page 170]
  8502.  
  8503. RFC 2328             OSPF Version 2              April 1998
  8504.  
  8505.  
  8506.     (2) If the summary-LSA was originated by the calculating router
  8507.         itself, examine the    next LSA.
  8508.  
  8509.     (3) Look up the    routing    table entry for    N. (If N is an AS
  8510.         boundary router, look up the "router" routing table    entry
  8511.         associated with the    backbone area).    If it does not exist, or
  8512.         if the route type is other than intra-area or inter-area, or
  8513.         if the area    associated with    the routing table entry    is not
  8514.         the    backbone area, then examine the    next LSA. In other
  8515.         words, this    calculation only updates backbone intra-area
  8516.         routes found in Section 16.1 and inter-area    routes found in
  8517.         Section 16.2.
  8518.  
  8519.     (4) Look up the    routing    table entry for    the advertising    router
  8520.         BR associated with the Area    A. If it is unreachable, examine
  8521.         the    next LSA. Otherwise, the cost to destination N is the
  8522.         sum    of the cost in BR's Area A routing table entry and the
  8523.         cost advertised in the LSA.    Call this cost IAC.
  8524.  
  8525.     (5) If this cost is less than the cost occurring in N's    routing
  8526.         table entry, overwrite N's list of next hops with those used
  8527.         for    BR, and    set N's    routing    table cost to IAC. Else, if IAC
  8528.         is the same    as N's current cost, add BR's list of next hops
  8529.         to N's list    of next    hops. In any case, the area associated
  8530.         with N's routing table entry must remain the backbone area,
  8531.         and    the path type (either intra-area or inter-area)    must
  8532.         also remain    the same.
  8533.  
  8534.     It is important    to note    that the above calculation never makes
  8535.     unreachable destinations reachable, but    instead    just potentially
  8536.     finds better paths to already reachable    destinations.  The
  8537.     calculation installs any better    cost found into    the routing
  8538.     table entry, from which    it may be readvertised in summary-LSAs
  8539.     to other areas.
  8540.  
  8541.     As an example of the calculation, consider the Autonomous System
  8542.     pictured in Figure 17.    There is a single non-backbone area
  8543.     (Area 1) that physically divides the backbone into two separate
  8544.     pieces.    To maintain connectivity of the    backbone, a virtual link
  8545.     has been configured between routers RT1    and RT4. On the    right
  8546.     side of    the figure, Network N1 belongs to the backbone.    The
  8547.     dotted lines indicate that there is a much shorter intra-area
  8548.  
  8549.  
  8550.  
  8551. Moy                Standards Track              [Page 171]
  8552.  
  8553. RFC 2328             OSPF Version 2              April 1998
  8554.  
  8555.  
  8556.  
  8557.               ........................
  8558.               .    Area 1 (transit)     .          +
  8559.               .                 .          |
  8560.               .         +---+1       1+---+100      |
  8561.               .         |RT2|----------|RT4|=========|
  8562.               .       1/+---+********* +---+      |
  8563.               .       /*******         .          |
  8564.               .     1/*Virtual         .          |
  8565.            1+---+/*  Link         .           Net|work
  8566.          =======|RT1|*             .          | N1
  8567.             +---+\             .          |
  8568.               .      \             .          |
  8569.               .       \             .          |
  8570.               .       1\+---+1       1+---+20      |
  8571.               .         |RT3|----------|RT5|=========|
  8572.               .         +---+        +---+      |
  8573.               .                 .          |
  8574.               ........................          +
  8575.  
  8576.             Figure 17: Routing through transit areas
  8577.  
  8578.     backbone path between router RT5 and Network N1    (cost 20) than
  8579.     there is between Router    RT4 and    Network    N1 (cost 100). Both
  8580.     Router RT4 and Router RT5 will inject summary-LSAs for Network
  8581.     N1 into    Area 1.
  8582.  
  8583.     After the shortest-path    tree has been calculated for the
  8584.     backbone in Section 16.1, Router RT1 (left end of the virtual
  8585.     link) will have    calculated a path through Router RT4 for all
  8586.     data traffic destined for Network N1. However, since Router RT5
  8587.     is so much closer to Network N1, all routers internal to Area 1
  8588.     (e.g., Routers RT2 and RT3) will forward their Network N1
  8589.     traffic    towards    Router RT5, instead of RT4. And    indeed,    after
  8590.     examining Area 1's summary-LSAs    by the above calculation, Router
  8591.     RT1 will also forward Network N1 traffic towards RT5. Note that
  8592.     in this    example    the virtual link enables transit data traffic to
  8593.     be forwarded through Area 1, but the actual path the transit
  8594.     data traffic takes does    not follow the virtual link.  In other
  8595.     words, virtual links allow transit traffic to be forwarded
  8596.     through    an area, but do    not dictate the    precise    path that the
  8597.     traffic    will take.
  8598.  
  8599.  
  8600.  
  8601. Moy                Standards Track              [Page 172]
  8602.  
  8603. RFC 2328             OSPF Version 2              April 1998
  8604.  
  8605.  
  8606.     16.4.  Calculating AS external routes
  8607.  
  8608.     AS external routes are calculated by examining AS-external-LSAs.
  8609.     Each of    the AS-external-LSAs is    considered in turn.  Most AS-
  8610.     external-LSAs describe routes to specific IP destinations.  An
  8611.     AS-external-LSA    can also describe a default route for the
  8612.     Autonomous System (Destination ID = DefaultDestination,
  8613.     network/subnet mask = 0x00000000).  For    each AS-external-LSA:
  8614.  
  8615.  
  8616.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8617.         LSA's LS age is equal to MaxAge, then examine the next LSA.
  8618.  
  8619.     (2) If the LSA was originated by the calculating router    itself,
  8620.         examine the    next LSA.
  8621.  
  8622.     (3) Call the destination described by the LSA N.  N's address is
  8623.         obtained by    masking    the LSA's Link State ID    with the
  8624.         network/subnet mask    contained in the body of the LSA.  Look
  8625.         up the routing table entries (potentially one per attached
  8626.         area) for the AS boundary router (ASBR) that originated the
  8627.         LSA. If no entries exist for router    ASBR (i.e., ASBR is
  8628.         unreachable), do nothing with this LSA and consider    the next
  8629.         in the list.
  8630.  
  8631.         Else, this LSA describes an    AS external path to destination
  8632.         N.    Examine    the forwarding address specified in the    AS-
  8633.         external-LSA.  This    indicates the IP address to which
  8634.         packets for    the destination    should be forwarded.
  8635.  
  8636.         If the forwarding address is set to    0.0.0.0, packets should
  8637.         be sent to the ASBR    itself.    Among the multiple routing table
  8638.         entries for    the ASBR, select the preferred entry as    follows.
  8639.         If RFC1583Compatibility is set to "disabled", prune    the set
  8640.         of routing table entries for the ASBR as described in
  8641.         Section 16.4.1. In any case, among the remaining routing
  8642.         table entries, select the routing table entry with the least
  8643.         cost; when there are multiple least    cost routing table
  8644.         entries the    entry whose associated area has    the largest OSPF
  8645.         Area ID (when considered as    an unsigned 32-bit integer) is
  8646.         chosen.
  8647.  
  8648.  
  8649.  
  8650.  
  8651. Moy                Standards Track              [Page 173]
  8652.  
  8653. RFC 2328             OSPF Version 2              April 1998
  8654.  
  8655.  
  8656.         If the forwarding address is non-zero, look    up the
  8657.         forwarding address in the routing table.[24] The matching
  8658.         routing table entry    must specify an    intra-area or inter-area
  8659.         path; if no    such path exists, do nothing with the LSA and
  8660.         consider the next in the list.
  8661.  
  8662.     (4) Let    X be the cost specified    by the preferred routing table
  8663.         entry for the ASBR/forwarding address, and Y the cost
  8664.         specified in the LSA.  X is    in terms of the    link state
  8665.         metric, and    Y is a type 1 or 2 external metric.
  8666.  
  8667.     (5) Look up the    routing    table entry for    the destination    N.  If
  8668.         no entry exists for    N, install the AS external path    to N,
  8669.         with next hop equal    to the list of next hops to the
  8670.         forwarding address,    and advertising    router equal to    ASBR.
  8671.         If the external metric type    is 1, then the path-type is set
  8672.         to type 1 external and the cost is equal to    X+Y.  If the
  8673.         external metric type is 2, the path-type is    set to type 2
  8674.         external, the link state component of the route's cost is X,
  8675.         and    the type 2 cost    is Y.
  8676.  
  8677.     (6) Compare the    AS external path described by the LSA with the
  8678.         existing paths in N's routing table    entry, as follows. If
  8679.         the    new path is preferred, it replaces the present paths in
  8680.         N's    routing    table entry.  If the new path is of equal
  8681.         preference,    it is added to N's routing table entry's list of
  8682.         paths.
  8683.  
  8684.         (a)    Intra-area and inter-area paths    are always preferred
  8685.         over AS    external paths.
  8686.  
  8687.         (b)    Type 1 external    paths are always preferred over    type 2
  8688.         external paths.    When all paths are type    2 external
  8689.         paths, the paths with the smallest advertised type 2
  8690.         metric are always preferred.
  8691.  
  8692.         (c)    If the new AS external path is still indistinguishable
  8693.         from the current paths in the N's routing table    entry,
  8694.         and RFC1583Compatibility is set    to "disabled", select
  8695.         the preferred paths based on the intra-AS paths    to the
  8696.         ASBR/forwarding    addresses, as specified    in Section
  8697.         16.4.1.
  8698.  
  8699.  
  8700.  
  8701. Moy                Standards Track              [Page 174]
  8702.  
  8703. RFC 2328             OSPF Version 2              April 1998
  8704.  
  8705.  
  8706.         (d)    If the new AS external path is still indistinguishable
  8707.         from the current paths in the N's routing table    entry,
  8708.         select the preferred path based    on a least cost
  8709.         comparison.  Type 1 external paths are compared    by
  8710.         looking    at the sum of the distance to the forwarding
  8711.         address    and the    advertised type    1 metric (X+Y).     Type 2
  8712.         external paths advertising equal type 2    metrics    are
  8713.         compared by looking at the distance to the forwarding
  8714.         addresses.
  8715.  
  8716.     16.4.1.     External path preferences
  8717.  
  8718.         When multiple intra-AS paths are available to
  8719.         ASBRs/forwarding addresses,    the following rules indicate
  8720.         which paths    are preferred. These rules apply when the same
  8721.         ASBR is reachable through multiple areas, or when trying to
  8722.         decide which of several AS-external-LSAs should be
  8723.         preferred. In the former case the paths all    terminate at the
  8724.         same ASBR, while in    the latter the paths terminate at
  8725.         separate ASBRs/forwarding addresses. In either case, each
  8726.         path is represented    by a separate routing table entry as
  8727.         defined in Section 11.
  8728.  
  8729.         This section only applies when RFC1583Compatibility    is set
  8730.         to "disabled".
  8731.  
  8732.         The    path preference    rules, stated from highest to lowest
  8733.         preference,    are as follows.    Note that as a result of these
  8734.         rules, there may still be multiple paths of    the highest
  8735.         preference.    In this    case, the path to use must be determined
  8736.         based on cost, as described    in Section 16.4.
  8737.  
  8738.         o    Intra-area paths using non-backbone areas are always the
  8739.         most preferred.
  8740.  
  8741.         o    The other paths, intra-area backbone paths and inter-
  8742.         area paths, are    of equal preference.
  8743.  
  8744.     16.5.  Incremental updates -- summary-LSAs
  8745.  
  8746.     When a new summary-LSA is received, it is not necessary    to
  8747.     recalculate the    entire routing table.  Call the    destination
  8748.  
  8749.  
  8750.  
  8751. Moy                Standards Track              [Page 175]
  8752.  
  8753. RFC 2328             OSPF Version 2              April 1998
  8754.  
  8755.  
  8756.     described by the summary-LSA N (N's address is obtained    by
  8757.     masking    the LSA's Link State ID    with the network/subnet    mask
  8758.     contained in the body of the LSA), and let Area    A be the area to
  8759.     which the LSA belongs. There are then two separate cases:
  8760.  
  8761.     Case 1:    Area A is the backbone and/or the router is not    an area
  8762.         border router.
  8763.         In this case, the following    calculations must be performed.
  8764.         First, if there is presently an inter-area route to    the
  8765.         destination    N, N's routing table entry is invalidated,
  8766.         saving the entry's values for later    comparisons. Then the
  8767.         calculation    in Section 16.2    is run again for the single
  8768.         destination    N. In this calculation,    all of Area A's
  8769.         summary-LSAs that describe a route to N are    examined.  In
  8770.         addition, if the router is an area border router attached to
  8771.         one    or more    transit    areas, the calculation in Section 16.3
  8772.         must be run    again for the single destination.  If the
  8773.         results of these calculations have changed the cost/path to
  8774.         an AS boundary router (as would be the case    for a Type 4
  8775.         summary-LSA) or to any forwarding addresses, all AS-
  8776.         external-LSAs will have to be reexamined by    rerunning the
  8777.         calculation    in Section 16.4.  Otherwise, if    N is now newly
  8778.         unreachable, the calculation in Section 16.4 must be rerun
  8779.         for    the single destination N, in case an alternate external
  8780.         route to N exists.
  8781.  
  8782.     Case 2:    Area A is a transit area and the router    is an area
  8783.         border router.
  8784.         In this case, the following    calculations must be performed.
  8785.         First, if N's routing table    entry presently    contains one or
  8786.         more inter-area paths that utilize the transit area    Area A,
  8787.         these paths    should be removed. If this removes all paths
  8788.         from the routing table entry, the entry should be
  8789.         invalidated.  The entry's old values should    be saved for
  8790.         later comparisons. Next the    calculation in Section 16.3 must
  8791.         be run again for the single    destination N. If the results of
  8792.         this calculation have caused the cost to N to increase, the
  8793.         complete routing table calculation must be rerun starting
  8794.         with the Dijkstra algorithm    specified in Section 16.1.
  8795.         Otherwise, if the cost/path    to an AS boundary router (as
  8796.         would be the case for a Type 4 summary-LSA)    or to any
  8797.         forwarding addresses has changed, all AS-external-LSAs will
  8798.  
  8799.  
  8800.  
  8801. Moy                Standards Track              [Page 176]
  8802.  
  8803. RFC 2328             OSPF Version 2              April 1998
  8804.  
  8805.  
  8806.         have to be reexamined by rerunning the calculation in
  8807.         Section 16.4.  Otherwise, if N is now newly    unreachable, the
  8808.         calculation    in Section 16.4    must be    rerun for the single
  8809.         destination    N, in case an alternate    external route to N
  8810.         exists.
  8811.  
  8812.     16.6.  Incremental updates -- AS-external-LSAs
  8813.  
  8814.     When a new AS-external-LSA is received,    it is not necessary to
  8815.     recalculate the    entire routing table.  Call the    destination
  8816.     described by the AS-external-LSA N.  N's address is obtained by
  8817.     masking    the LSA's Link State ID    with the network/subnet    mask
  8818.     contained in the body of the LSA. If there is already an intra-
  8819.     area or    inter-area route to the    destination, no    recalculation is
  8820.     necessary (internal routes take    precedence).
  8821.  
  8822.     Otherwise, the procedure in Section 16.4 will have to be
  8823.     performed, but only for    those AS-external-LSAs whose destination
  8824.     is N.  Before this procedure is    performed, the present routing
  8825.     table entry for    N should be invalidated.
  8826.  
  8827.     16.7.  Events generated as a result    of routing table changes
  8828.  
  8829.     Changes    to routing table entries sometimes cause the OSPF area
  8830.     border routers to take additional actions.  These routers need
  8831.     to act on the following    routing    table changes:
  8832.  
  8833.     o   The    cost or    path type of a routing table entry has changed.
  8834.         If the destination described by this entry is a Network or
  8835.         AS boundary    router,    and this is not    simply a change    of AS
  8836.         external routes, new summary-LSAs may have to be generated
  8837.         (potentially one for each attached area, including the
  8838.         backbone).    See Section 12.4.3 for more information.  If a
  8839.         previously advertised entry    has been deleted, or is    no
  8840.         longer advertisable    to a particular    area, the LSA must be
  8841.         flushed from the routing domain by setting its LS age to
  8842.         MaxAge and reflooding (see Section 14.1).
  8843.  
  8844.     o   A routing table entry associated with a configured virtual
  8845.         link has changed.  The destination of such a routing table
  8846.         entry is an    area border router.  The change    indicates a
  8847.         modification to the    virtual    link's cost or viability.
  8848.  
  8849.  
  8850.  
  8851. Moy                Standards Track              [Page 177]
  8852.  
  8853. RFC 2328             OSPF Version 2              April 1998
  8854.  
  8855.  
  8856.         If the entry indicates that    the area border    router is newly
  8857.         reachable, the corresponding virtual link is now
  8858.         operational.  An InterfaceUp event should be generated for
  8859.         the    virtual    link, which will cause a virtual adjacency to
  8860.         begin to form (see Section 10.3).  At this time the    virtual
  8861.         link's IP interface    address    and the    virtual    neighbor's
  8862.         Neighbor IP    address    are also calculated.
  8863.  
  8864.         If the entry indicates that    the area border    router is no
  8865.         longer reachable, the virtual link and its associated
  8866.         adjacency should be    destroyed.  This means an InterfaceDown
  8867.         event should be generated for the associated virtual link.
  8868.  
  8869.         If the cost    of the entry has changed, and there is a fully
  8870.         established    virtual    adjacency, a new router-LSA for    the
  8871.         backbone must be originated.  This in turn may cause further
  8872.         routing table changes.
  8873.  
  8874.     16.8.  Equal-cost multipath
  8875.  
  8876.     The OSPF protocol maintains multiple equal-cost    routes to all
  8877.     destinations.  This can    be seen    in the steps used above    to
  8878.     calculate the routing table, and in the    definition of the
  8879.     routing    table structure.
  8880.  
  8881.     Each one of the    multiple routes    will be    of the same type
  8882.     (intra-area, inter-area, type 1    external or type 2 external),
  8883.     cost, and will have the    same associated    area.  However,    each
  8884.     route may specify a separate next hop and Advertising router.
  8885.  
  8886.     There is no requirement    that a router running OSPF keep    track of
  8887.     all possible equal-cost    routes to a destination.  An
  8888.     implementation may choose to keep only a fixed number of routes
  8889.     to any given destination.  This    does not affect    any of the
  8890.     algorithms presented in    this specification.
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901. Moy                Standards Track              [Page 178]
  8902.  
  8903. RFC 2328             OSPF Version 2              April 1998
  8904.  
  8905.  
  8906. Footnotes
  8907.  
  8908.  
  8909.     [1]The graph's vertices represent either routers, transit networks,
  8910.     or stub networks.  Since routers may belong    to multiple areas, it is
  8911.     not    possible to color the graph's vertices.
  8912.  
  8913.     [2]It is possible for all of a router's interfaces to be unnumbered
  8914.     point-to-point links.  In this case, an IP address must be assigned
  8915.     to the router.  This address will then be advertised in the    router's
  8916.     router-LSA as a host route.
  8917.  
  8918.     [3]Note that in these cases    both interfaces, the non-virtual and the
  8919.     virtual, would have    the same IP address.
  8920.  
  8921.     [4]Note that no host route is generated for, and no    IP packets can
  8922.     be addressed to, interfaces    to unnumbered point-to-point networks.
  8923.     This is regardless of such an interface's state.
  8924.  
  8925.     [5]It is instructive to see    what happens when the Designated Router
  8926.     for    the network crashes.  Call the Designated Router for the network
  8927.     RT1, and the Backup    Designated Router RT2.    If Router RT1 crashes
  8928.     (or    maybe its interface to the network dies), the other routers on
  8929.     the    network    will detect RT1's absence within RouterDeadInterval
  8930.     seconds.  All routers may not detect this at precisely the same
  8931.     time; the routers that detect RT1's    absence    before RT2 does    will,
  8932.     for    a time,    select RT2 to be both Designated Router    and Backup
  8933.     Designated Router.    When RT2 detects that RT1 is gone it will move
  8934.     itself to Designated Router.  At this time,    the remaining router
  8935.     having highest Router Priority will    be selected as Backup Designated
  8936.     Router.
  8937.  
  8938.     [6]On point-to-point networks, the lower level protocols indicate
  8939.     whether the    neighbor is up and running.  Likewise, existence of the
  8940.     neighbor on    virtual    links is indicated by the routing table
  8941.     calculation.  However, in both these cases,    the Hello Protocol is
  8942.     still used.     This ensures that communication between the neighbors
  8943.     is bidirectional, and that each of the neighbors has a functioning
  8944.     routing protocol layer.
  8945.  
  8946.     [7]When the    identity of the    Designated Router is changing, it may be
  8947.     quite common for a neighbor    in this    state to send the router a
  8948.  
  8949.  
  8950.  
  8951. Moy                Standards Track              [Page 179]
  8952.  
  8953. RFC 2328             OSPF Version 2              April 1998
  8954.  
  8955.  
  8956.     Database Description packet; this means that there is some momentary
  8957.     disagreement on the    Designated Router's identity.
  8958.  
  8959.     [8]Note that it is possible    for a router to    resynchronize any of its
  8960.     fully established adjacencies by setting the adjacency's state back
  8961.     to ExStart.     This will cause the other end of the adjacency    to
  8962.     process a SeqNumberMismatch    event, and therefore to    also go    back to
  8963.     ExStart state.
  8964.  
  8965.     [9]The address space of IP networks    and the    address    space of OSPF
  8966.     Router IDs may overlap.  That is, a    network    may have an IP address
  8967.     which is identical (when considered    as a 32-bit number) to some
  8968.     router's Router ID.
  8969.  
  8970.     [10]"Discard" entries are necessary    to ensure that route
  8971.     summarization at area boundaries will not cause packet looping.
  8972.  
  8973.     [11]It is assumed that, for    two different address ranges matching
  8974.     the    destination, one range is more specific    than the other.    Non-
  8975.     contiguous subnet masks can    be configured to violate this
  8976.     assumption.    Such subnet mask configurations    cannot be handled by the
  8977.     OSPF protocol.
  8978.  
  8979.     [12]MaxAgeDiff is an architectural constant.  It indicates the
  8980.     maximum dispersion of ages,    in seconds, that can occur for a single
  8981.     LSA    instance as it is flooded throughout the routing domain.  If two
  8982.     LSAs differ    by more    than this, they    are assumed to be different
  8983.     instances of the same LSA.    This can occur when a router restarts
  8984.     and    loses track of the LSA's previous LS sequence number.  See
  8985.     Section 13.4 for more details.
  8986.  
  8987.     [13]When two LSAs have different LS    checksums, they    are assumed to
  8988.     be separate    instances.  This can occur when    a router restarts, and
  8989.     loses track    of the LSA's previous LS sequence number.  In the case
  8990.     where the two LSAs have the    same LS    sequence number, it is not
  8991.     possible to    determine which    LSA is actually    newer.    However, if the
  8992.     wrong LSA is accepted as newer, the    originating router will    simply
  8993.     originate another instance.     See Section 13.4 for further details.
  8994.  
  8995.     [14]There is one instance where a lookup must be done based    on
  8996.     partial information.  This is during the routing table calculation,
  8997.     when a network-LSA must be found based solely on its Link State ID.
  8998.  
  8999.  
  9000.  
  9001. Moy                Standards Track              [Page 180]
  9002.  
  9003. RFC 2328             OSPF Version 2              April 1998
  9004.  
  9005.  
  9006.     The    lookup in this case is still well defined, since no two
  9007.     network-LSAs can have the same Link    State ID.
  9008.  
  9009.     [15]This is    the way    RFC 1583 specified point-to-point
  9010.     representation.  It    has three advantages: a) it does not require
  9011.     allocating a subnet    to the point-to-point link, b) it tends    to bias
  9012.     the    routing    so that    packets    destined for the point-to-point
  9013.     interface will actually be received    over the interface (which is
  9014.     useful for diagnostic purposes) and    c) it allows network
  9015.     bootstrapping of a neighbor, without requiring that    the bootstrap
  9016.     program contain an OSPF implementation.
  9017.  
  9018.     [16]This is    the more traditional point-to-point representation used
  9019.     by protocols such as RIP.
  9020.  
  9021.     [17]This clause covers the case: Inter-area    routes are not
  9022.     summarized to the backbone.     This is because inter-area routes are
  9023.     always associated with the backbone    area.
  9024.  
  9025.     [18]This clause is only invoked when a non-backbone    Area A supports
  9026.     transit data traffic (i.e.,    has TransitCapability set to TRUE).  For
  9027.     example, in    the area configuration of Figure 6, Area 2 can support
  9028.     transit traffic due    to the configured virtual link between Routers
  9029.     RT10 and RT11. As a    result,    Router RT11 need only originate    a single
  9030.     summary-LSA    into Area 2 (having the    collapsed destination N9-
  9031.     N11,H1), since all of Router RT11's    other eligible routes have next
  9032.     hops belonging to Area 2 itself (and as such only need be advertised
  9033.     by other area border routers; in this case,    Routers    RT10 and RT7).
  9034.  
  9035.     [19]By keeping more    information in the routing table, it is    possible
  9036.     for    an implementation to recalculate the shortest path tree    for only
  9037.     a single area.  In fact, there are incremental algorithms that allow
  9038.     an implementation to recalculate only a portion of a single    area's
  9039.     shortest path tree [Ref1].    However, these algorithms are beyond the
  9040.     scope of this specification.
  9041.  
  9042.     [20]This is    how the    Link state request list    is emptied, which
  9043.     eventually causes the neighbor state to transition to Full.     See
  9044.     Section 10.9 for more details.
  9045.  
  9046.     [21]It should be a relatively rare occurrence for an LSA's LS age to
  9047.     reach MaxAge in this fashion.  Usually, the    LSA will be replaced by
  9048.  
  9049.  
  9050.  
  9051. Moy                Standards Track              [Page 181]
  9052.  
  9053. RFC 2328             OSPF Version 2              April 1998
  9054.  
  9055.  
  9056.     a more recent instance before it ages out.
  9057.  
  9058.     [22]Strictly speaking, because of equal-cost multipath, the
  9059.     algorithm does not create a    tree.  We continue to use the "tree"
  9060.     terminology    because    that is    what occurs most often in the existing
  9061.     literature.
  9062.  
  9063.     [23]Note that the presence of any link back    to V is    sufficient; it
  9064.     need not be    the matching half of the link under consideration from V
  9065.     to W. This is enough to ensure that, before    data traffic flows
  9066.     between a pair of neighboring routers, their link state databases
  9067.     will be synchronized.
  9068.  
  9069.     [24]When the forwarding address is non-zero, it should point to a
  9070.     router belonging to    another    Autonomous System.  See    Section    12.4.4
  9071.     for    more details.
  9072.  
  9073.  
  9074.  
  9075.  
  9076.  
  9077.  
  9078.  
  9079.  
  9080.  
  9081.  
  9082.  
  9083.  
  9084.  
  9085.  
  9086.  
  9087.  
  9088.  
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.  
  9098.  
  9099.  
  9100.  
  9101. Moy                Standards Track              [Page 182]
  9102.  
  9103. RFC 2328             OSPF Version 2              April 1998
  9104.  
  9105.  
  9106. References
  9107.  
  9108.     [Ref1]  McQuillan, J., I. Richer and E. Rosen, "ARPANET Routing
  9109.         Algorithm Improvements", BBN Technical Report 3803,    April
  9110.         1978.
  9111.  
  9112.     [Ref2]  Digital Equipment Corporation, "Information    processing
  9113.         systems -- Data communications -- Intermediate System to
  9114.         Intermediate System    Intra-Domain Routing Protocol",    October
  9115.         1987.
  9116.  
  9117.     [Ref3]  McQuillan, J., et.al., "The    New Routing Algorithm for the
  9118.         ARPANET", IEEE Transactions    on Communications, May 1980.
  9119.  
  9120.     [Ref4]  Perlman, R., "Fault-Tolerant Broadcast of Routing
  9121.         Information", Computer Networks, December 1983.
  9122.  
  9123.     [Ref5]  Postel, J.,    "Internet Protocol", STD 5, RFC    791, September
  9124.         1981.
  9125.  
  9126.     [Ref6]  McKenzie, A., "ISO Transport Protocol specification    ISO DP
  9127.         8073", RFC 905, April 1984.
  9128.  
  9129.     [Ref7]  Deering, S., "Host extensions for IP multicasting",    STD 5,
  9130.         RFC    1112, May 1988.
  9131.  
  9132.     [Ref8]  McCloghrie,    K., and    M. Rose, "Management Information Base
  9133.         for    network    management of TCP/IP-based internets: MIB-II",
  9134.         STD    17, RFC    1213, March 1991.
  9135.  
  9136.     [Ref9]  Moy, J., "OSPF Version 2", RFC 1583, March 1994.
  9137.  
  9138.     [Ref10] Fuller, V.,    T. Li, J. Yu, and K. Varadhan, "Classless
  9139.         Inter-Domain Routing (CIDR): an Address Assignment and
  9140.         Aggregation    Strategy", RFC1519, September 1993.
  9141.  
  9142.     [Ref11] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
  9143.         1700, October 1994.
  9144.  
  9145.     [Ref12] Almquist, P., "Type    of Service in the Internet Protocol
  9146.         Suite", RFC    1349, July 1992.
  9147.  
  9148.  
  9149.  
  9150.  
  9151. Moy                Standards Track              [Page 183]
  9152.  
  9153. RFC 2328             OSPF Version 2              April 1998
  9154.  
  9155.  
  9156.     [Ref13] Leiner, B.,    et.al.,    "The DARPA Internet Protocol Suite", DDN
  9157.         Protocol Handbook, April 1985.
  9158.  
  9159.     [Ref14] Bradley, T., and C.    Brown, "Inverse    Address    Resolution
  9160.         Protocol", RFC 1293, January 1992.
  9161.  
  9162.     [Ref15] deSouza, O., and M.    Rodrigues, "Guidelines for Running OSPF
  9163.         Over Frame Relay Networks",    RFC 1586, March    1994.
  9164.  
  9165.     [Ref16] Bellovin, S., "Security Problems in    the TCP/IP Protocol
  9166.         Suite", ACM    Computer Communications    Review,    Volume 19,
  9167.         Number 2, pp. 32-38, April 1989.
  9168.  
  9169.     [Ref17] Rivest, R.,    "The MD5 Message-Digest    Algorithm", RFC    1321,
  9170.         April 1992.
  9171.  
  9172.     [Ref18] Moy, J., "Multicast    Extensions to OSPF", RFC 1584, March
  9173.         1994.
  9174.  
  9175.     [Ref19] Coltun, R.,    and V. Fuller, "The OSPF NSSA Option", RFC 1587,
  9176.         March 1994.
  9177.  
  9178.     [Ref20] Ferguson, D., "The OSPF External Attributes    LSA", work in
  9179.         progress.
  9180.  
  9181.     [Ref21] Moy, J., "Extending    OSPF to    Support    Demand Circuits", RFC
  9182.         1793, April    1995.
  9183.  
  9184.     [Ref22] Mogul, J., and S. Deering, "Path MTU Discovery", RFC 1191,
  9185.         November 1990.
  9186.  
  9187.     [Ref23] Rekhter, Y., and T.    Li, "A Border Gateway Protocol 4 (BGP-
  9188.         4)", RFC 1771, March 1995.
  9189.  
  9190.     [Ref24] Hinden, R.,    "Internet Routing Protocol Standardization
  9191.         Criteria", BBN, October 1991.
  9192.  
  9193.     [Ref25] Moy, J., "OSPF Version 2", RFC 2178, July 1997.
  9194.  
  9195.     [Ref26] Rosen, E., "Vulnerabilities    of Network Control Protocols: An
  9196.         Example", Computer Communication Review, July 1981.
  9197.  
  9198.  
  9199.  
  9200.  
  9201. Moy                Standards Track              [Page 184]
  9202.  
  9203. RFC 2328             OSPF Version 2              April 1998
  9204.  
  9205.  
  9206. A. OSPF    data formats
  9207.  
  9208.     This appendix describes the    format of OSPF protocol    packets    and OSPF
  9209.     LSAs.  The OSPF protocol runs directly over    the IP network layer.
  9210.     Before any data formats are    described, the details of the OSPF
  9211.     encapsulation are explained.
  9212.  
  9213.     Next the OSPF Options field    is described.  This field describes
  9214.     various capabilities that may or may not be    supported by pieces of
  9215.     the    OSPF routing domain. The OSPF Options field is contained in OSPF
  9216.     Hello packets, Database Description    packets    and in OSPF LSAs.
  9217.  
  9218.     OSPF packet    formats    are detailed in    Section    A.3.  A    description of
  9219.     OSPF LSAs appears in Section A.4.
  9220.  
  9221. A.1 Encapsulation of OSPF packets
  9222.  
  9223.     OSPF runs directly over the    Internet Protocol's network layer.  OSPF
  9224.     packets are    therefore encapsulated solely by IP and    local data-link
  9225.     headers.
  9226.  
  9227.     OSPF does not define a way to fragment its protocol    packets, and
  9228.     depends on IP fragmentation    when transmitting packets larger than
  9229.     the    network    MTU. If    necessary, the length of OSPF packets can be up
  9230.     to 65,535 bytes (including the IP header).    The OSPF packet    types
  9231.     that are likely to be large    (Database Description Packets, Link
  9232.     State Request, Link    State Update, and Link State Acknowledgment
  9233.     packets) can usually be split into several separate    protocol
  9234.     packets, without loss of functionality.  This is recommended; IP
  9235.     fragmentation should be avoided whenever possible.    Using this
  9236.     reasoning, an attempt should be made to limit the sizes of OSPF
  9237.     packets sent over virtual links to 576 bytes unless    Path MTU
  9238.     Discovery is being performed (see [Ref22]).
  9239.  
  9240.     The    other important    features of OSPF's IP encapsulation are:
  9241.  
  9242.     o    Use of IP multicast.  Some OSPF    messages are multicast,    when
  9243.     sent over broadcast networks.  Two distinct IP multicast
  9244.     addresses are used.  Packets sent to these multicast addresses
  9245.     should never be    forwarded; they    are meant to travel a single hop
  9246.     only.  To ensure that these packets will not travel multiple
  9247.     hops, their IP TTL must    be set to 1.
  9248.  
  9249.  
  9250.  
  9251. Moy                Standards Track              [Page 185]
  9252.  
  9253. RFC 2328             OSPF Version 2              April 1998
  9254.  
  9255.  
  9256.     AllSPFRouters
  9257.         This multicast address has been assigned the value
  9258.         224.0.0.5.    All routers running OSPF should    be prepared to
  9259.         receive packets sent to this address.  Hello packets are
  9260.         always sent    to this    destination.  Also, certain OSPF
  9261.         protocol packets are sent to this address during the
  9262.         flooding procedure.
  9263.  
  9264.     AllDRouters
  9265.         This multicast address has been assigned the value
  9266.         224.0.0.6.    Both the Designated Router and Backup Designated
  9267.         Router must    be prepared to receive packets destined    to this
  9268.         address.  Certain OSPF protocol packets are    sent to    this
  9269.         address during the flooding    procedure.
  9270.  
  9271.     o    OSPF is    IP protocol number 89.    This number has    been registered
  9272.     with the Network Information Center.  IP protocol number
  9273.     assignments are    documented in [Ref11].
  9274.  
  9275.     o    All OSPF routing protocol packets are sent using the normal
  9276.     service    TOS value of binary 0000 defined in [Ref12].
  9277.  
  9278.     o    Routing    protocol packets are sent with IP precedence set to
  9279.     Internetwork Control.  OSPF protocol packets should be given
  9280.     precedence over    regular    IP data    traffic, in both sending and
  9281.     receiving.  Setting the    IP precedence field in the IP header to
  9282.     Internetwork Control [Ref5] may    help implement this objective.
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.  
  9297.  
  9298.  
  9299.  
  9300.  
  9301. Moy                Standards Track              [Page 186]
  9302.  
  9303. RFC 2328             OSPF Version 2              April 1998
  9304.  
  9305.  
  9306. A.2 The    Options    field
  9307.  
  9308.     The    OSPF Options field is present in OSPF Hello packets, Database
  9309.     Description    packets    and all    LSAs.  The Options field enables OSPF
  9310.     routers to support (or not support)    optional capabilities, and to
  9311.     communicate    their capability level to other    OSPF routers.  Through
  9312.     this mechanism routers of differing    capabilities can be mixed within
  9313.     an OSPF routing domain.
  9314.  
  9315.     When used in Hello packets,    the Options field allows a router to
  9316.     reject a neighbor because of a capability mismatch.     Alternatively,
  9317.     when capabilities are exchanged in Database    Description packets a
  9318.     router can choose not to forward certain LSAs to a neighbor    because
  9319.     of its reduced functionality.  Lastly, listing capabilities    in LSAs
  9320.     allows routers to forward traffic around reduced functionality
  9321.     routers, by    excluding them from parts of the routing table
  9322.     calculation.
  9323.  
  9324.     Five bits of the OSPF Options field    have been assigned, although
  9325.     only one (the E-bit) is described completely by this memo. Each bit
  9326.     is described briefly below.    Routers    should reset (i.e.  clear)
  9327.     unrecognized bits in the Options field when    sending    Hello packets or
  9328.     Database Description packets and when originating LSAs. Conversely,
  9329.     routers encountering unrecognized Option bits in received Hello
  9330.     Packets, Database Description packets or LSAs should ignore    the
  9331.     capability and process the packet/LSA normally.
  9332.  
  9333.                +------------------------------------+
  9334.                | * | * | DC | EA | N/P | MC | E    | * |
  9335.                +------------------------------------+
  9336.  
  9337.                  The Options field
  9338.  
  9339.  
  9340.     E-bit
  9341.     This bit describes the way AS-external-LSAs are    flooded, as
  9342.     described in Sections 3.6, 9.5,    10.8 and 12.1.2    of this    memo.
  9343.  
  9344.     MC-bit
  9345.     This bit describes whether IP multicast    datagrams are forwarded
  9346.     according to the specifications    in [Ref18].
  9347.  
  9348.  
  9349.  
  9350.  
  9351. Moy                Standards Track              [Page 187]
  9352.  
  9353. RFC 2328             OSPF Version 2              April 1998
  9354.  
  9355.  
  9356.     N/P-bit
  9357.     This bit describes the handling    of Type-7 LSAs,    as specified in
  9358.     [Ref19].
  9359.  
  9360.     EA-bit
  9361.     This bit describes the router's    willingness to receive and
  9362.     forward    External-Attributes-LSAs, as specified in [Ref20].
  9363.  
  9364.     DC-bit
  9365.     This bit describes the router's    handling of demand circuits, as
  9366.     specified in [Ref21].
  9367.  
  9368.  
  9369.  
  9370.  
  9371.  
  9372.  
  9373.  
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.  
  9380.  
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401. Moy                Standards Track              [Page 188]
  9402.  
  9403. RFC 2328             OSPF Version 2              April 1998
  9404.  
  9405.  
  9406. A.3 OSPF Packet    Formats
  9407.  
  9408.     There are five distinct OSPF packet    types.    All OSPF packet    types
  9409.     begin with a standard 24 byte header.  This    header is described
  9410.     first.  Each packet    type is    then described in a succeeding section.
  9411.     In these sections each packet's division into fields is displayed,
  9412.     and    then the field definitions are enumerated.
  9413.  
  9414.     All    OSPF packet types (other than the OSPF Hello packets) deal with
  9415.     lists of LSAs.  For    example, Link State Update packets implement the
  9416.     flooding of    LSAs throughout    the OSPF routing domain.  Because of
  9417.     this, OSPF protocol    packets    cannot be parsed unless    the format of
  9418.     LSAs is also understood.  The format of LSAs is described in Section
  9419.     A.4.
  9420.  
  9421.     The    receive    processing of OSPF packets is detailed in Section 8.2.
  9422.     The    sending    of OSPF    packets    is explained in    Section    8.1.
  9423.  
  9424.  
  9425.  
  9426.  
  9427.  
  9428.  
  9429.  
  9430.  
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.  
  9437.  
  9438.  
  9439.  
  9440.  
  9441.  
  9442.  
  9443.  
  9444.  
  9445.  
  9446.  
  9447.  
  9448.  
  9449.  
  9450.  
  9451. Moy                Standards Track              [Page 189]
  9452.  
  9453. RFC 2328             OSPF Version 2              April 1998
  9454.  
  9455.  
  9456. A.3.1 The OSPF packet header
  9457.  
  9458.     Every OSPF packet starts with a standard 24    byte header.  This
  9459.     header contains all    the information    necessary to determine whether
  9460.     the    packet should be accepted for further processing.  This
  9461.     determination is described in Section 8.2 of the specification.
  9462.  
  9463.  
  9464.     0            1            2            3
  9465.     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
  9466.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9467.        |   Version #   |     Type      |     Packet    length           |
  9468.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9469.        |              Router ID                   |
  9470.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9471.        |               Area    ID                   |
  9472.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9473.        |       Checksum           |         AuType           |
  9474.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9475.        |               Authentication                   |
  9476.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9477.        |               Authentication                   |
  9478.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9479.  
  9480.  
  9481.  
  9482.     Version #
  9483.     The OSPF version number.  This specification documents version 2
  9484.     of the protocol.
  9485.  
  9486.     Type
  9487.     The OSPF packet    types are as follows. See Sections A.3.2 through
  9488.     A.3.6 for details.
  9489.  
  9490.  
  9491.  
  9492.  
  9493.  
  9494.  
  9495.  
  9496.  
  9497.  
  9498.  
  9499.  
  9500.  
  9501. Moy                Standards Track              [Page 190]
  9502.  
  9503. RFC 2328             OSPF Version 2              April 1998
  9504.  
  9505.  
  9506.  
  9507.               Type     Description
  9508.               ________________________________
  9509.               1     Hello
  9510.               2     Database Description
  9511.               3     Link State Request
  9512.               4     Link State Update
  9513.               5     Link State Acknowledgment
  9514.  
  9515.  
  9516.  
  9517.  
  9518.     Packet length
  9519.     The length of the OSPF protocol    packet in bytes.  This length
  9520.     includes the standard OSPF header.
  9521.  
  9522.     Router ID
  9523.     The Router ID of the packet's source.
  9524.  
  9525.     Area ID
  9526.     A 32 bit number    identifying the    area that this packet belongs
  9527.     to.  All OSPF packets are associated with a single area.  Most
  9528.     travel a single    hop only.  Packets travelling over a virtual
  9529.     link are labelled with the backbone Area ID of 0.0.0.0.
  9530.  
  9531.     Checksum
  9532.     The standard IP    checksum of the    entire contents    of the packet,
  9533.     starting with the OSPF packet header but excluding the 64-bit
  9534.     authentication field.  This checksum is    calculated as the 16-bit
  9535.     one's complement of the    one's complement sum of    all the    16-bit
  9536.     words in the packet, excepting the authentication field.  If the
  9537.     packet's length    is not an integral number of 16-bit words, the
  9538.     packet is padded with a    byte of    zero before checksumming.  The
  9539.     checksum is considered to be part of the packet    authentication
  9540.     procedure; for some authentication types the checksum
  9541.     calculation is omitted.
  9542.  
  9543.     AuType
  9544.     Identifies the authentication procedure    to be used for the
  9545.     packet.     Authentication    is discussed in    Appendix D of the
  9546.     specification.    Consult    Appendix D for a list of the currently
  9547.     defined    authentication types.
  9548.  
  9549.  
  9550.  
  9551. Moy                Standards Track              [Page 191]
  9552.  
  9553. RFC 2328             OSPF Version 2              April 1998
  9554.  
  9555.  
  9556.     Authentication
  9557.     A 64-bit field for use by the authentication scheme. See
  9558.     Appendix D for details.
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576.  
  9577.  
  9578.  
  9579.  
  9580.  
  9581.  
  9582.  
  9583.  
  9584.  
  9585.  
  9586.  
  9587.  
  9588.  
  9589.  
  9590.  
  9591.  
  9592.  
  9593.  
  9594.  
  9595.  
  9596.  
  9597.  
  9598.  
  9599.  
  9600.  
  9601. Moy                Standards Track              [Page 192]
  9602.  
  9603. RFC 2328             OSPF Version 2              April 1998
  9604.  
  9605.  
  9606. A.3.2 The Hello    packet
  9607.  
  9608.     Hello packets are OSPF packet type 1.  These packets are sent
  9609.     periodically on all    interfaces (including virtual links) in    order to
  9610.     establish and maintain neighbor relationships.  In addition, Hello
  9611.     Packets are    multicast on those physical networks having a multicast
  9612.     or broadcast capability, enabling dynamic discovery    of neighboring
  9613.     routers.
  9614.  
  9615.     All    routers    connected to a common network must agree on certain
  9616.     parameters (Network    mask, HelloInterval and    RouterDeadInterval).
  9617.     These parameters are included in Hello packets, so that differences
  9618.     can    inhibit    the forming of neighbor    relationships.    A detailed
  9619.     explanation    of the receive processing for Hello packets is presented
  9620.     in Section 10.5.  The sending of Hello packets is covered in Section
  9621.     9.5.
  9622.  
  9623.  
  9624.     0            1            2            3
  9625.     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
  9626.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9627.        |   Version #   |       1       |     Packet    length           |
  9628.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9629.        |              Router ID                   |
  9630.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9631.        |               Area    ID                   |
  9632.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9633.        |       Checksum           |         AuType           |
  9634.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9635.        |               Authentication                   |
  9636.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9637.        |               Authentication                   |
  9638.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9639.        |            Network    Mask                   |
  9640.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9641.        |     HelloInterval           |    Options    |    Rtr    Pri    |
  9642.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9643.        |             RouterDeadInterval                   |
  9644.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9645.        |              Designated Router                   |
  9646.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9647.        |           Backup Designated Router               |
  9648.  
  9649.  
  9650.  
  9651. Moy                Standards Track              [Page 193]
  9652.  
  9653. RFC 2328             OSPF Version 2              April 1998
  9654.  
  9655.  
  9656.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9657.        |              Neighbor                   |
  9658.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9659.        |                  ...                   |
  9660.  
  9661.  
  9662.     Network mask
  9663.     The network mask associated with this interface.  For example,
  9664.     if the interface is to a class B network whose third byte is
  9665.     used for subnetting, the network mask is 0xffffff00.
  9666.  
  9667.     Options
  9668.     The optional capabilities supported by the router, as documented
  9669.     in Section A.2.
  9670.  
  9671.     HelloInterval
  9672.     The number of seconds between this router's Hello packets.
  9673.  
  9674.     Rtr    Pri
  9675.     This router's Router Priority.    Used in    (Backup) Designated
  9676.     Router election.  If set to 0, the router will be ineligible to
  9677.     become (Backup)    Designated Router.
  9678.  
  9679.     RouterDeadInterval
  9680.     The number of seconds before declaring a silent    router down.
  9681.  
  9682.     Designated Router
  9683.     The identity of    the Designated Router for this network,    in the
  9684.     view of    the sending router.  The Designated Router is identified
  9685.     here by    its IP interface address on the    network.  Set to 0.0.0.0
  9686.     if there is no Designated Router.
  9687.  
  9688.     Backup Designated Router
  9689.     The identity of    the Backup Designated Router for this network,
  9690.     in the view of the sending router.  The    Backup Designated Router
  9691.     is identified here by its IP interface address on the network.
  9692.     Set to 0.0.0.0 if there    is no Backup Designated    Router.
  9693.  
  9694.     Neighbor
  9695.     The Router IDs of each router from whom    valid Hello packets have
  9696.     been seen recently on the network.  Recently means in the last
  9697.     RouterDeadInterval seconds.
  9698.  
  9699.  
  9700.  
  9701. Moy                Standards Track              [Page 194]
  9702.  
  9703. RFC 2328             OSPF Version 2              April 1998
  9704.  
  9705.  
  9706. A.3.3 The Database Description packet
  9707.  
  9708.     Database Description packets are OSPF packet type 2.  These    packets
  9709.     are    exchanged when an adjacency is being initialized.  They    describe
  9710.     the    contents of the    link-state database.  Multiple packets may be
  9711.     used to describe the database.  For    this purpose a poll-response
  9712.     procedure is used.    One of the routers is designated to be the
  9713.     master, the    other the slave.  The master sends Database Description
  9714.     packets (polls) which are acknowledged by Database Description
  9715.     packets sent by the    slave (responses).  The    responses are linked to
  9716.     the    polls via the packets' DD sequence numbers.
  9717.  
  9718.     0            1            2            3
  9719.     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
  9720.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9721.        |   Version #   |       2       |     Packet    length           |
  9722.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9723.        |              Router ID                   |
  9724.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9725.        |               Area    ID                   |
  9726.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9727.        |       Checksum           |         AuType           |
  9728.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9729.        |               Authentication                   |
  9730.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9731.        |               Authentication                   |
  9732.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9733.        |     Interface MTU           |    Options    |0|0|0|0|0|I|M|MS
  9734.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9735.        |             DD    sequence number                   |
  9736.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9737.        |                                   |
  9738.        +-                                  -+
  9739.        |                                   |
  9740.        +-               An LSA Header                  -+
  9741.        |                                   |
  9742.        +-                                  -+
  9743.        |                                   |
  9744.        +-                                  -+
  9745.        |                                   |
  9746.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9747.        |                  ...                   |
  9748.  
  9749.  
  9750.  
  9751. Moy                Standards Track              [Page 195]
  9752.  
  9753. RFC 2328             OSPF Version 2              April 1998
  9754.  
  9755.  
  9756.     The    format of the Database Description packet is very similar to
  9757.     both the Link State    Request    and Link State Acknowledgment packets.
  9758.     The    main part of all three is a list of items, each    item describing
  9759.     a piece of the link-state database.     The sending of    Database
  9760.     Description    Packets    is documented in Section 10.8.    The reception of
  9761.     Database Description packets is documented in Section 10.6.
  9762.  
  9763.     Interface MTU
  9764.     The size in bytes of the largest IP datagram that can be sent
  9765.     out the    associated interface, without fragmentation.  The MTUs
  9766.     of common Internet link    types can be found in Table 7-1    of
  9767.     [Ref22]. Interface MTU should be set to    0 in Database
  9768.     Description packets sent over virtual links.
  9769.  
  9770.     Options
  9771.     The optional capabilities supported by the router, as documented
  9772.     in Section A.2.
  9773.  
  9774.     I-bit
  9775.     The Init bit.  When set    to 1, this packet is the first in the
  9776.     sequence of Database Description Packets.
  9777.  
  9778.     M-bit
  9779.     The More bit.  When set    to 1, it indicates that    more Database
  9780.     Description Packets are    to follow.
  9781.  
  9782.     MS-bit
  9783.     The Master/Slave bit.  When set    to 1, it indicates that    the
  9784.     router is the master during the    Database Exchange process.
  9785.     Otherwise, the router is the slave.
  9786.  
  9787.     DD sequence    number
  9788.     Used to    sequence the collection    of Database Description    Packets.
  9789.     The initial value (indicated by    the Init bit being set)    should
  9790.     be unique.  The    DD sequence number then    increments until the
  9791.     complete database description has been sent.
  9792.  
  9793.     The    rest of    the packet consists of a (possibly partial) list of the
  9794.     link-state database's pieces.  Each    LSA in the database is described
  9795.     by its LSA header.    The LSA    header is documented in    Section    A.4.1.
  9796.     It contains    all the    information required to    uniquely identify both
  9797.     the    LSA and    the LSA's current instance.
  9798.  
  9799.  
  9800.  
  9801. Moy                Standards Track              [Page 196]
  9802.  
  9803. RFC 2328             OSPF Version 2              April 1998
  9804.  
  9805.  
  9806. A.3.4 The Link State Request packet
  9807.  
  9808.     Link State Request packets are OSPF    packet type 3.    After exchanging
  9809.     Database Description packets with a    neighboring router, a router may
  9810.     find that parts of its link-state database are out-of-date.     The
  9811.     Link State Request packet is used to request the pieces of the
  9812.     neighbor's database    that are more up-to-date.  Multiple Link State
  9813.     Request packets may    need to    be used.
  9814.  
  9815.     A router that sends    a Link State Request packet has    in mind    the
  9816.     precise instance of    the database pieces it is requesting. Each
  9817.     instance is    defined    by its LS sequence number, LS checksum,    and LS
  9818.     age, although these    fields are not specified in the    Link State
  9819.     Request Packet itself.  The    router may receive even    more recent
  9820.     instances in response.
  9821.  
  9822.     The    sending    of Link    State Request packets is documented in Section
  9823.     10.9.  The reception of Link State Request packets is documented in
  9824.     Section 10.7.
  9825.  
  9826.     0            1            2            3
  9827.     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
  9828.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9829.        |   Version #   |       3       |     Packet    length           |
  9830.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9831.        |              Router ID                   |
  9832.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9833.        |               Area    ID                   |
  9834.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9835.        |       Checksum           |         AuType           |
  9836.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9837.        |               Authentication                   |
  9838.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9839.        |               Authentication                   |
  9840.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9841.        |              LS type                   |
  9842.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9843.        |               Link State ID                   |
  9844.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9845.        |             Advertising Router                   |
  9846.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9847.        |                  ...                   |
  9848.  
  9849.  
  9850.  
  9851. Moy                Standards Track              [Page 197]
  9852.  
  9853. RFC 2328             OSPF Version 2              April 1998
  9854.  
  9855.  
  9856.     Each LSA requested is specified by its LS type, Link State ID, and
  9857.     Advertising    Router.     This uniquely identifies the LSA, but not its
  9858.     instance.  Link State Request packets are understood to be requests
  9859.     for    the most recent    instance (whatever that    might be).
  9860.  
  9861.  
  9862.  
  9863.  
  9864.  
  9865.  
  9866.  
  9867.  
  9868.  
  9869.  
  9870.  
  9871.  
  9872.  
  9873.  
  9874.  
  9875.  
  9876.  
  9877.  
  9878.  
  9879.  
  9880.  
  9881.  
  9882.  
  9883.  
  9884.  
  9885.  
  9886.  
  9887.  
  9888.  
  9889.  
  9890.  
  9891.  
  9892.  
  9893.  
  9894.  
  9895.  
  9896.  
  9897.  
  9898.  
  9899.  
  9900.  
  9901. Moy                Standards Track              [Page 198]
  9902.  
  9903. RFC 2328             OSPF Version 2              April 1998
  9904.  
  9905.  
  9906. A.3.5 The Link State Update packet
  9907.  
  9908.     Link State Update packets are OSPF packet type 4.  These packets
  9909.     implement the flooding of LSAs.  Each Link State Update packet
  9910.     carries a collection of LSAs one hop further from their origin.
  9911.     Several LSAs may be    included in a single packet.
  9912.  
  9913.     Link State Update packets are multicast on those physical networks
  9914.     that support multicast/broadcast.  In order    to make    the flooding
  9915.     procedure reliable,    flooded    LSAs are acknowledged in Link State
  9916.     Acknowledgment packets.  If    retransmission of certain LSAs is
  9917.     necessary, the retransmitted LSAs are always sent directly to the
  9918.     neighbor.  For more    information on the reliable flooding of    LSAs,
  9919.     consult Section 13.
  9920.  
  9921.     0            1            2            3
  9922.     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
  9923.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9924.        |   Version #   |       4       |     Packet    length           |
  9925.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9926.        |              Router ID                   |
  9927.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9928.        |               Area    ID                   |
  9929.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9930.        |       Checksum           |         AuType           |
  9931.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9932.        |               Authentication                   |
  9933.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9934.        |               Authentication                   |
  9935.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9936.        |                # LSAs                   |
  9937.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9938.        |                                   |
  9939.        +-                                 +-+
  9940.        |                 LSAs                   |
  9941.        +-                                 +-+
  9942.        |                  ...                   |
  9943.  
  9944.  
  9945.  
  9946.  
  9947.  
  9948.  
  9949.  
  9950.  
  9951. Moy                Standards Track              [Page 199]
  9952.  
  9953. RFC 2328             OSPF Version 2              April 1998
  9954.  
  9955.  
  9956.     # LSAs
  9957.     The number of LSAs included in this update.
  9958.  
  9959.  
  9960.     The    body of    the Link State Update packet consists of a list    of LSAs.
  9961.     Each LSA begins with a common 20 byte header, described in Section
  9962.     A.4.1. Detailed formats of the different types of LSAs are described
  9963.     in Section A.4.
  9964.  
  9965.  
  9966.  
  9967.  
  9968.  
  9969.  
  9970.  
  9971.  
  9972.  
  9973.  
  9974.  
  9975.  
  9976.  
  9977.  
  9978.  
  9979.  
  9980.  
  9981.  
  9982.  
  9983.  
  9984.  
  9985.  
  9986.  
  9987.  
  9988.  
  9989.  
  9990.  
  9991.  
  9992.  
  9993.  
  9994.  
  9995.  
  9996.  
  9997.  
  9998.  
  9999.  
  10000.  
  10001. Moy                Standards Track              [Page 200]
  10002.  
  10003. RFC 2328             OSPF Version 2              April 1998
  10004.  
  10005.  
  10006. A.3.6 The Link State Acknowledgment packet
  10007.  
  10008.     Link State Acknowledgment Packets are OSPF packet type 5.  To make
  10009.     the    flooding of LSAs reliable, flooded LSAs    are explicitly
  10010.     acknowledged.  This    acknowledgment is accomplished through the
  10011.     sending and    receiving of Link State    Acknowledgment packets.
  10012.     Multiple LSAs can be acknowledged in a single Link State
  10013.     Acknowledgment packet.
  10014.  
  10015.     Depending on the state of the sending interface and    the sender of
  10016.     the    corresponding Link State Update    packet,    a Link State
  10017.     Acknowledgment packet is sent either to the    multicast address
  10018.     AllSPFRouters, to the multicast address AllDRouters, or as a
  10019.     unicast.  The sending of Link State    Acknowledgement    packets    is
  10020.     documented in Section 13.5.     The reception of Link State
  10021.     Acknowledgement packets is documented in Section 13.7.
  10022.  
  10023.     The    format of this packet is similar to that of the    Data Description
  10024.     packet.  The body of both packets is simply    a list of LSA headers.
  10025.  
  10026.  
  10027.     0            1            2            3
  10028.     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
  10029.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10030.        |   Version #   |       5       |     Packet    length           |
  10031.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10032.        |              Router ID                   |
  10033.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10034.        |               Area    ID                   |
  10035.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10036.        |       Checksum           |         AuType           |
  10037.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10038.        |               Authentication                   |
  10039.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10040.        |               Authentication                   |
  10041.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10042.        |                                   |
  10043.        +-                                  -+
  10044.        |                                   |
  10045.        +-              An LSA Header                  -+
  10046.        |                                   |
  10047.        +-                                  -+
  10048.  
  10049.  
  10050.  
  10051. Moy                Standards Track              [Page 201]
  10052.  
  10053. RFC 2328             OSPF Version 2              April 1998
  10054.  
  10055.  
  10056.        |                                   |
  10057.        +-                                  -+
  10058.        |                                   |
  10059.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10060.        |                  ...                   |
  10061.  
  10062.  
  10063.     Each acknowledged LSA is described by its LSA header.  The LSA
  10064.     header is documented in Section A.4.1.  It contains    all the
  10065.     information    required to uniquely identify both the LSA and the LSA's
  10066.     current instance.
  10067.  
  10068.  
  10069.  
  10070.  
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080.  
  10081.  
  10082.  
  10083.  
  10084.  
  10085.  
  10086.  
  10087.  
  10088.  
  10089.  
  10090.  
  10091.  
  10092.  
  10093.  
  10094.  
  10095.  
  10096.  
  10097.  
  10098.  
  10099.  
  10100.  
  10101. Moy                Standards Track              [Page 202]
  10102.  
  10103. RFC 2328             OSPF Version 2              April 1998
  10104.  
  10105.  
  10106. A.4 LSA    formats
  10107.  
  10108.     This memo defines five distinct types of LSAs.  Each LSA begins with
  10109.     a standard 20 byte LSA header.  This header    is explained in    Section
  10110.     A.4.1.  Succeeding sections    then diagram the separate LSA types.
  10111.  
  10112.     Each LSA describes a piece of the OSPF routing domain.  Every router
  10113.     originates a router-LSA.  In addition, whenever the    router is
  10114.     elected Designated Router, it originates a network-LSA.  Other types
  10115.     of LSAs may    also be    originated (see    Section    12.4).    All LSAs are
  10116.     then flooded throughout the    OSPF routing domain.  The flooding
  10117.     algorithm is reliable, ensuring that all routers have the same
  10118.     collection of LSAs.     (See Section 13 for more information concerning
  10119.     the    flooding algorithm).  This collection of LSAs is called    the
  10120.     link-state database.
  10121.  
  10122.     From the link state    database, each router constructs a shortest path
  10123.     tree with itself as    root.  This yields a routing table (see    Section
  10124.     11).  For the details of the routing table build process, see
  10125.     Section 16.
  10126.  
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136.  
  10137.  
  10138.  
  10139.  
  10140.  
  10141.  
  10142.  
  10143.  
  10144.  
  10145.  
  10146.  
  10147.  
  10148.  
  10149.  
  10150.  
  10151. Moy                Standards Track              [Page 203]
  10152.  
  10153. RFC 2328             OSPF Version 2              April 1998
  10154.  
  10155.  
  10156. A.4.1 The LSA header
  10157.  
  10158.     All    LSAs begin with    a common 20 byte header.  This header contains
  10159.     enough information to uniquely identify the    LSA (LS    type, Link State
  10160.     ID,    and Advertising    Router).  Multiple instances of    the LSA    may
  10161.     exist in the routing domain    at the same time.  It is then necessary
  10162.     to determine which instance    is more    recent.     This is accomplished by
  10163.     examining the LS age, LS sequence number and LS checksum fields that
  10164.     are    also contained in the LSA header.
  10165.  
  10166.  
  10167.     0            1            2            3
  10168.     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
  10169.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10170.        |        LS age           |    Options    |    LS type    |
  10171.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10172.        |            Link State ID                   |
  10173.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10174.        |             Advertising Router                   |
  10175.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10176.        |             LS    sequence number                   |
  10177.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10178.        |     LS checksum           |         length           |
  10179.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10180.  
  10181.  
  10182.  
  10183.     LS age
  10184.     The time in seconds since the LSA was originated.
  10185.  
  10186.     Options
  10187.     The optional capabilities supported by the described portion of
  10188.     the routing domain.  OSPF's optional capabilities are documented
  10189.     in Section A.2.
  10190.  
  10191.     LS type
  10192.     The type of the    LSA.  Each LSA type has    a separate advertisement
  10193.     format.     The LSA types defined in this memo are    as follows (see
  10194.     Section    12.1.3 for further explanation):
  10195.  
  10196.  
  10197.  
  10198.  
  10199.  
  10200.  
  10201. Moy                Standards Track              [Page 204]
  10202.  
  10203. RFC 2328             OSPF Version 2              April 1998
  10204.  
  10205.  
  10206.  
  10207.             LS Type      Description
  10208.             ___________________________________
  10209.             1      Router-LSAs
  10210.             2      Network-LSAs
  10211.             3      Summary-LSAs (IP network)
  10212.             4      Summary-LSAs (ASBR)
  10213.             5      AS-external-LSAs
  10214.  
  10215.  
  10216.  
  10217.  
  10218.     Link State ID
  10219.     This field identifies the portion of the internet environment
  10220.     that is    being described    by the LSA.  The contents of this field
  10221.     depend on the LSA's LS type.  For example, in network-LSAs the
  10222.     Link State ID is set to    the IP interface address of the
  10223.     network's Designated Router (from which    the network's IP address
  10224.     can be derived).  The Link State ID is further discussed in
  10225.     Section    12.1.4.
  10226.  
  10227.     Advertising    Router
  10228.     The Router ID of the router that originated the    LSA.  For
  10229.     example, in network-LSAs this field is equal to    the Router ID of
  10230.     the network's Designated Router.
  10231.  
  10232.     LS sequence    number
  10233.     Detects    old or duplicate LSAs.    Successive instances of    an LSA
  10234.     are given successive LS    sequence numbers.  See Section 12.1.6
  10235.     for more details.
  10236.  
  10237.     LS checksum
  10238.     The Fletcher checksum of the complete contents of the LSA,
  10239.     including the LSA header but excluding the LS age field. See
  10240.     Section    12.1.7 for more    details.
  10241.  
  10242.     length
  10243.     The length in bytes of the LSA.     This includes the 20 byte LSA
  10244.     header.
  10245.  
  10246.  
  10247.  
  10248.  
  10249.  
  10250.  
  10251. Moy                Standards Track              [Page 205]
  10252.  
  10253. RFC 2328             OSPF Version 2              April 1998
  10254.  
  10255.  
  10256. A.4.2 Router-LSAs
  10257.  
  10258.     Router-LSAs    are the    Type 1 LSAs.  Each router in an    area originates
  10259.     a router-LSA.  The LSA describes the state and cost    of the router's
  10260.     links (i.e., interfaces) to    the area.  All of the router's links to
  10261.     the    area must be described in a single router-LSA.    For details
  10262.     concerning the construction    of router-LSAs,    see Section 12.4.1.
  10263.  
  10264.  
  10265.     0            1            2            3
  10266.     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
  10267.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10268.        |        LS age           |     Options   |       1       |
  10269.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10270.        |            Link State ID                   |
  10271.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10272.        |             Advertising Router                   |
  10273.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10274.        |             LS    sequence number                   |
  10275.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10276.        |     LS checksum           |         length           |
  10277.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10278.        |    0     |V|E|B|    0      |        # links           |
  10279.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10280.        |              Link ID                   |
  10281.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10282.        |             Link Data                   |
  10283.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10284.        |     Type      |     # TOS     |        metric           |
  10285.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10286.        |                  ...                   |
  10287.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10288.        |      TOS      |    0      |      TOS  metric           |
  10289.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10290.        |              Link ID                   |
  10291.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10292.        |             Link Data                   |
  10293.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10294.        |                  ...                   |
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301. Moy                Standards Track              [Page 206]
  10302.  
  10303. RFC 2328             OSPF Version 2              April 1998
  10304.  
  10305.  
  10306.     In router-LSAs, the    Link State ID field is set to the router's OSPF
  10307.     Router ID. Router-LSAs are flooded throughout a single area    only.
  10308.  
  10309.     bit    V
  10310.     When set, the router is    an endpoint of one or more fully
  10311.     adjacent virtual links having the described area as Transit area
  10312.     (V is for virtual link endpoint).
  10313.  
  10314.     bit    E
  10315.     When set, the router is    an AS boundary router (E is for
  10316.     external).
  10317.  
  10318.     bit    B
  10319.     When set, the router is    an area    border router (B is for    border).
  10320.  
  10321.     # links
  10322.     The number of router links described in    this LSA.  This    must be
  10323.     the total collection of    router links (i.e., interfaces)    to the
  10324.     area.
  10325.  
  10326.  
  10327.     The    following fields are used to describe each router link (i.e.,
  10328.     interface).    Each router link is typed (see the below Type field).
  10329.     The    Type field indicates the kind of link being described.    It may
  10330.     be a link to a transit network, to another router or to a stub
  10331.     network.  The values of all    the other fields describing a router
  10332.     link depend    on the link's Type.  For example, each link has    an
  10333.     associated 32-bit Link Data    field.    For links to stub networks this
  10334.     field specifies the    network's IP address mask.  For    other link types
  10335.     the    Link Data field    specifies the router interface's IP address.
  10336.  
  10337.  
  10338.     Type
  10339.     A quick    description of the router link.     One of    the following.
  10340.     Note that host routes are classified as    links to stub networks
  10341.     with network mask of 0xffffffff.
  10342.  
  10343.  
  10344.  
  10345.  
  10346.  
  10347.  
  10348.  
  10349.  
  10350.  
  10351. Moy                Standards Track              [Page 207]
  10352.  
  10353. RFC 2328             OSPF Version 2              April 1998
  10354.  
  10355.  
  10356.  
  10357.          Type    Description
  10358.          __________________________________________________
  10359.          1    Point-to-point connection to another router
  10360.          2    Connection to a    transit    network
  10361.          3    Connection to a    stub network
  10362.          4    Virtual    link
  10363.  
  10364.  
  10365.  
  10366.  
  10367.     Link ID
  10368.     Identifies the object that this    router link connects to.  Value
  10369.     depends    on the link's Type.  When connecting to    an object that
  10370.     also originates    an LSA (i.e., another router or    a transit
  10371.     network) the Link ID is    equal to the neighboring LSA's Link
  10372.     State ID.  This    provides the key for looking up    the neighboring
  10373.     LSA in the link    state database during the routing table
  10374.     calculation. See Section 12.2 for more details.
  10375.  
  10376.  
  10377.  
  10378.                Type   Link ID
  10379.                ______________________________________
  10380.                1      Neighboring router's Router ID
  10381.                2      IP address of Designated Router
  10382.                3      IP network/subnet    number
  10383.                4      Neighboring router's Router ID
  10384.  
  10385.  
  10386.  
  10387.  
  10388.     Link Data
  10389.     Value again depends on the link's Type field. For connections to
  10390.     stub networks, Link Data specifies the network's IP address
  10391.     mask. For unnumbered point-to-point connections, it specifies
  10392.     the interface's    MIB-II [Ref8] ifIndex value. For the other link
  10393.     types it specifies the router interface's IP address. This
  10394.     latter piece of    information is needed during the routing table
  10395.     build process, when calculating    the IP address of the next hop.
  10396.     See Section 16.1.1 for more details.
  10397.  
  10398.  
  10399.  
  10400.  
  10401. Moy                Standards Track              [Page 208]
  10402.  
  10403. RFC 2328             OSPF Version 2              April 1998
  10404.  
  10405.  
  10406.     # TOS
  10407.     The number of different    TOS metrics given for this link, not
  10408.     counting the required link metric (referred to as the TOS 0
  10409.     metric in [Ref9]).  For    example, if no additional TOS metrics
  10410.     are given, this    field is set to    0.
  10411.  
  10412.     metric
  10413.     The cost of using this router link.
  10414.  
  10415.  
  10416.     Additional TOS-specific information    may also be included, for
  10417.     backward compatibility with    previous versions of the OSPF
  10418.     specification ([Ref9]). Within each    link, and for each desired TOS,
  10419.     TOS    TOS-specific link information may be encoded as    follows:
  10420.  
  10421.     TOS    IP Type    of Service that    this metric refers to.    The encoding of
  10422.     TOS in OSPF LSAs is described in Section 12.3.
  10423.  
  10424.     TOS    metric
  10425.     TOS-specific metric information.
  10426.  
  10427.  
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436.  
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.  
  10451. Moy                Standards Track              [Page 209]
  10452.  
  10453. RFC 2328             OSPF Version 2              April 1998
  10454.  
  10455.  
  10456. A.4.3 Network-LSAs
  10457.  
  10458.     Network-LSAs are the Type 2    LSAs.  A network-LSA is    originated for
  10459.     each broadcast and NBMA network in the area    which supports two or
  10460.     more routers.  The network-LSA is originated by the    network's
  10461.     Designated Router.    The LSA    describes all routers attached to the
  10462.     network, including the Designated Router itself.  The LSA's    Link
  10463.     State ID field lists the IP    interface address of the Designated
  10464.     Router.
  10465.  
  10466.     The    distance from the network to all attached routers is zero.  This
  10467.     is why metric fields need not be specified in the network-LSA.  For
  10468.     details concerning the construction    of network-LSAs, see Section
  10469.     12.4.2.
  10470.  
  10471.  
  10472.     0            1            2            3
  10473.     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
  10474.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10475.        |        LS age           |      Options  |      2           |
  10476.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10477.        |            Link State ID                   |
  10478.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10479.        |             Advertising Router                   |
  10480.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10481.        |             LS    sequence number                   |
  10482.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10483.        |     LS checksum           |         length           |
  10484.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10485.        |             Network Mask                   |
  10486.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10487.        |            Attached Router                   |
  10488.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10489.        |                  ...                   |
  10490.  
  10491.  
  10492.  
  10493.     Network Mask
  10494.     The IP address mask for    the network.  For example, a class A
  10495.     network    would have the mask 0xff000000.
  10496.  
  10497.  
  10498.  
  10499.  
  10500.  
  10501. Moy                Standards Track              [Page 210]
  10502.  
  10503. RFC 2328             OSPF Version 2              April 1998
  10504.  
  10505.  
  10506.     Attached Router
  10507.     The Router IDs of each of the routers attached to the network.
  10508.     Actually, only those routers that are fully adjacent to    the
  10509.     Designated Router are listed.  The Designated Router includes
  10510.     itself in this list.  The number of routers included can be
  10511.     deduced    from the LSA header's length field.
  10512.  
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.  
  10526.  
  10527.  
  10528.  
  10529.  
  10530.  
  10531.  
  10532.  
  10533.  
  10534.  
  10535.  
  10536.  
  10537.  
  10538.  
  10539.  
  10540.  
  10541.  
  10542.  
  10543.  
  10544.  
  10545.  
  10546.  
  10547.  
  10548.  
  10549.  
  10550.  
  10551. Moy                Standards Track              [Page 211]
  10552.  
  10553. RFC 2328             OSPF Version 2              April 1998
  10554.  
  10555.  
  10556. A.4.4 Summary-LSAs
  10557.  
  10558.     Summary-LSAs are the Type 3    and 4 LSAs.  These LSAs    are originated
  10559.     by area border routers. Summary-LSAs describe inter-area
  10560.     destinations.  For details concerning the construction of summary-
  10561.     LSAs, see Section 12.4.3.
  10562.  
  10563.     Type 3 summary-LSAs    are used when the destination is an IP network.
  10564.     In this case the LSA's Link    State ID field is an IP    network    number
  10565.     (if    necessary, the Link State ID can also have one or more of the
  10566.     network's "host" bits set; see Appendix E for details). When the
  10567.     destination    is an AS boundary router, a Type 4 summary-LSA is used,
  10568.     and    the Link State ID field    is the AS boundary router's OSPF Router
  10569.     ID.     (To see why it    is necessary to    advertise the location of each
  10570.     ASBR, consult Section 16.4.)  Other    than the difference in the Link
  10571.     State ID field, the    format of Type 3 and 4 summary-LSAs is
  10572.     identical.
  10573.  
  10574.  
  10575.     0            1            2            3
  10576.     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
  10577.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10578.        |        LS age           |     Options   |    3 or 4     |
  10579.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10580.        |            Link State ID                   |
  10581.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10582.        |             Advertising Router                   |
  10583.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10584.        |             LS    sequence number                   |
  10585.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10586.        |     LS checksum           |         length           |
  10587.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10588.        |             Network Mask                   |
  10589.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10590.        |      0           |          metric               |
  10591.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10592.        |     TOS       |        TOS  metric               |
  10593.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10594.        |                  ...                   |
  10595.  
  10596.  
  10597.  
  10598.  
  10599.  
  10600.  
  10601. Moy                Standards Track              [Page 212]
  10602.  
  10603. RFC 2328             OSPF Version 2              April 1998
  10604.  
  10605.  
  10606.     For    stub areas, Type 3 summary-LSAs    can also be used to describe a
  10607.     (per-area) default route.  Default summary routes are used in stub
  10608.     areas instead of flooding a    complete set of    external routes.  When
  10609.     describing a default summary route,    the summary-LSA's Link State ID
  10610.     is always set to DefaultDestination    (0.0.0.0) and the Network Mask
  10611.     is set to 0.0.0.0.
  10612.  
  10613.     Network Mask
  10614.     For Type 3 summary-LSAs, this indicates    the destination
  10615.     network's IP address mask.  For    example, when advertising the
  10616.     location of a class A network the value    0xff000000 would be
  10617.     used.  This field is not meaningful and    must be    zero for Type 4
  10618.     summary-LSAs.
  10619.  
  10620.     metric
  10621.     The cost of this route.     Expressed in the same units as    the
  10622.     interface costs    in the router-LSAs.
  10623.  
  10624.     Additional TOS-specific information    may also be included, for
  10625.     backward compatibility with    previous versions of the OSPF
  10626.     specification ([Ref9]). For    each desired TOS, TOS-specific
  10627.     information    is encoded as follows:
  10628.  
  10629.     TOS    IP Type    of Service that    this metric refers to.    The encoding of
  10630.     TOS in OSPF LSAs is described in Section 12.3.
  10631.  
  10632.     TOS    metric
  10633.     TOS-specific metric information.
  10634.  
  10635.  
  10636.  
  10637.  
  10638.  
  10639.  
  10640.  
  10641.  
  10642.  
  10643.  
  10644.  
  10645.  
  10646.  
  10647.  
  10648.  
  10649.  
  10650.  
  10651. Moy                Standards Track              [Page 213]
  10652.  
  10653. RFC 2328             OSPF Version 2              April 1998
  10654.  
  10655.  
  10656. A.4.5 AS-external-LSAs
  10657.  
  10658.     AS-external-LSAs are the Type 5 LSAs.  These LSAs are originated by
  10659.     AS boundary    routers, and describe destinations external to the AS.
  10660.     For    details    concerning the construction of AS-external-LSAs, see
  10661.     Section 12.4.3.
  10662.  
  10663.     AS-external-LSAs usually describe a    particular external destination.
  10664.     For    these LSAs the Link State ID field specifies an    IP network
  10665.     number (if necessary, the Link State ID can    also have one or more of
  10666.     the    network's "host" bits set; see Appendix    E for details).     AS-
  10667.     external-LSAs are also used    to describe a default route.  Default
  10668.     routes are used when no specific route exists to the destination.
  10669.     When describing a default route, the Link State ID is always set to
  10670.     DefaultDestination (0.0.0.0) and the Network Mask is set to    0.0.0.0.
  10671.  
  10672.  
  10673.     0            1            2            3
  10674.     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
  10675.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10676.        |        LS age           |     Options   |      5           |
  10677.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10678.        |            Link State ID                   |
  10679.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10680.        |             Advertising Router                   |
  10681.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10682.        |             LS    sequence number                   |
  10683.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10684.        |     LS checksum           |         length           |
  10685.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10686.        |             Network Mask                   |
  10687.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10688.        |E|     0       |          metric               |
  10689.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10690.        |              Forwarding address               |
  10691.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10692.        |              External Route Tag               |
  10693.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10694.        |E|    TOS      |        TOS  metric               |
  10695.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10696.        |              Forwarding address               |
  10697.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10698.  
  10699.  
  10700.  
  10701. Moy                Standards Track              [Page 214]
  10702.  
  10703. RFC 2328             OSPF Version 2              April 1998
  10704.  
  10705.  
  10706.        |              External Route Tag               |
  10707.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10708.        |                  ...                   |
  10709.  
  10710.  
  10711.  
  10712.     Network Mask
  10713.     The IP address mask for    the advertised destination.  For
  10714.     example, when advertising a class A network the    mask 0xff000000
  10715.     would be used.
  10716.  
  10717.     bit    E
  10718.     The type of external metric.  If bit E is set, the metric
  10719.     specified is a Type 2 external metric.    This means the metric is
  10720.     considered larger than any link    state path.  If    bit E is zero,
  10721.     the specified metric is    a Type 1 external metric.  This    means
  10722.     that it    is expressed in    the same units as the link state metric
  10723.     (i.e., the same    units as interface cost).
  10724.  
  10725.     metric
  10726.     The cost of this route.     Interpretation    depends    on the external
  10727.     type indication    (bit E above).
  10728.  
  10729.     Forwarding address
  10730.     Data traffic for the advertised    destination will be forwarded to
  10731.     this address.  If the Forwarding address is set    to 0.0.0.0, data
  10732.     traffic    will be    forwarded instead to the LSA's originator (i.e.,
  10733.     the responsible    AS boundary router).
  10734.  
  10735.     External Route Tag
  10736.     A 32-bit field attached    to each    external route.     This is not
  10737.     used by    the OSPF protocol itself.  It may be used to communicate
  10738.     information between AS boundary    routers; the precise nature of
  10739.     such information is outside the    scope of this specification.
  10740.  
  10741.     Additional TOS-specific information    may also be included, for
  10742.     backward compatibility with    previous versions of the OSPF
  10743.     specification ([Ref9]). For    each desired TOS, TOS-specific
  10744.     information    is encoded as follows:
  10745.  
  10746.     TOS    The Type of Service that the following fields concern.    The
  10747.     encoding of TOS    in OSPF    LSAs is    described in Section 12.3.
  10748.  
  10749.  
  10750.  
  10751. Moy                Standards Track              [Page 215]
  10752.  
  10753. RFC 2328             OSPF Version 2              April 1998
  10754.  
  10755.  
  10756.     bit    E
  10757.     For backward-compatibility with    [Ref9].
  10758.  
  10759.     TOS    metric
  10760.     TOS-specific metric information.
  10761.  
  10762.     Forwarding address
  10763.     For backward-compatibility with    [Ref9].
  10764.  
  10765.     External Route Tag
  10766.     For backward-compatibility with    [Ref9].
  10767.  
  10768.  
  10769.  
  10770.  
  10771.  
  10772.  
  10773.  
  10774.  
  10775.  
  10776.  
  10777.  
  10778.  
  10779.  
  10780.  
  10781.  
  10782.  
  10783.  
  10784.  
  10785.  
  10786.  
  10787.  
  10788.  
  10789.  
  10790.  
  10791.  
  10792.  
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801. Moy                Standards Track              [Page 216]
  10802.  
  10803. RFC 2328             OSPF Version 2              April 1998
  10804.  
  10805.  
  10806. B. Architectural Constants
  10807.  
  10808.     Several OSPF protocol parameters have fixed    architectural values.
  10809.     These parameters have been referred    to in the text by names    such as
  10810.     LSRefreshTime.  The    same naming convention is used for the
  10811.     configurable protocol parameters.  They are    defined    in Appendix C.
  10812.  
  10813.     The    name of    each architectural constant follows, together with its
  10814.     value and a    short description of its function.
  10815.  
  10816.  
  10817.     LSRefreshTime
  10818.     The maximum time between distinct originations of any particular
  10819.     LSA.  If the LS    age field of one of the    router's self-originated
  10820.     LSAs reaches the value LSRefreshTime, a    new instance of    the LSA
  10821.     is originated, even though the contents    of the LSA (apart from
  10822.     the LSA    header)    will be    the same.  The value of    LSRefreshTime is
  10823.     set to 30 minutes.
  10824.  
  10825.     MinLSInterval
  10826.     The minimum time between distinct originations of any particular
  10827.     LSA.  The value    of MinLSInterval is set    to 5 seconds.
  10828.  
  10829.     MinLSArrival
  10830.     For any    particular LSA,    the minimum time that must elapse
  10831.     between    reception of new LSA instances during flooding.    LSA
  10832.     instances received at higher frequencies are discarded.    The
  10833.     value of MinLSArrival is set to    1 second.
  10834.  
  10835.     MaxAge
  10836.     The maximum age    that an    LSA can    attain.    When an    LSA's LS age
  10837.     field reaches MaxAge, it is reflooded in an attempt to flush the
  10838.     LSA from the routing domain (See Section 14). LSAs of age MaxAge
  10839.     are not    used in    the routing table calculation.    The value of
  10840.     MaxAge is set to 1 hour.
  10841.  
  10842.     CheckAge
  10843.     When the age of    an LSA in the link state database hits a
  10844.     multiple of CheckAge, the LSA's    checksum is verified.  An
  10845.     incorrect checksum at this time    indicates a serious error.  The
  10846.     value of CheckAge is set to 5 minutes.
  10847.  
  10848.  
  10849.  
  10850.  
  10851. Moy                Standards Track              [Page 217]
  10852.  
  10853. RFC 2328             OSPF Version 2              April 1998
  10854.  
  10855.  
  10856.     MaxAgeDiff
  10857.     The maximum time dispersion that can occur, as an LSA is flooded
  10858.     throughout the AS.  Most of this time is accounted for by the
  10859.     LSAs sitting on    router output queues (and therefore not    aging)
  10860.     during the flooding process.  The value    of MaxAgeDiff is set to
  10861.     15 minutes.
  10862.  
  10863.     LSInfinity
  10864.     The metric value indicating that the destination described by an
  10865.     LSA is unreachable. Used in summary-LSAs and AS-external-LSAs as
  10866.     an alternative to premature aging (see Section 14.1). It is
  10867.     defined    to be the 24-bit binary    value of all ones: 0xffffff.
  10868.  
  10869.     DefaultDestination
  10870.     The Destination    ID that    indicates the default route.  This route
  10871.     is used    when no    other matching routing table entry can be found.
  10872.     The default destination    can only be advertised in AS-external-
  10873.     LSAs and in stub areas'    type 3 summary-LSAs.  Its value    is the
  10874.     IP address 0.0.0.0. Its    associated Network Mask    is also    always
  10875.     0.0.0.0.
  10876.  
  10877.     InitialSequenceNumber
  10878.     The value used for LS Sequence Number when originating the first
  10879.     instance of any    LSA. Its value is the signed 32-bit integer
  10880.     0x80000001.
  10881.  
  10882.     MaxSequenceNumber
  10883.     The maximum value that LS Sequence Number can attain.  Its value
  10884.     is the signed 32-bit integer 0x7fffffff.
  10885.  
  10886.  
  10887.  
  10888.  
  10889.  
  10890.  
  10891.  
  10892.  
  10893.  
  10894.  
  10895.  
  10896.  
  10897.  
  10898.  
  10899.  
  10900.  
  10901. Moy                Standards Track              [Page 218]
  10902.  
  10903. RFC 2328             OSPF Version 2              April 1998
  10904.  
  10905.  
  10906. C. Configurable    Constants
  10907.  
  10908.     The    OSPF protocol has quite    a few configurable parameters.    These
  10909.     parameters are listed below.  They are grouped into    general
  10910.     functional categories (area    parameters, interface parameters, etc.).
  10911.     Sample values are given for    some of    the parameters.
  10912.  
  10913.     Some parameter settings need to be consistent among    groups of
  10914.     routers.  For example, all routers in an area must agree on    that
  10915.     area's parameters, and all routers attached    to a network must agree
  10916.     on that network's IP network number    and mask.
  10917.  
  10918.     Some parameters may    be determined by router    algorithms outside of
  10919.     this specification (e.g., the address of a host connected to the
  10920.     router via a SLIP line).  From OSPF's point    of view, these items are
  10921.     still configurable.
  10922.  
  10923.     C.1    Global parameters
  10924.  
  10925.     In general, a separate copy of the OSPF    protocol is run    for each
  10926.     area.  Because of this,    most configuration parameters are
  10927.     defined    on a per-area basis.  The few global configuration
  10928.     parameters are listed below.
  10929.  
  10930.  
  10931.     Router ID
  10932.         This is a 32-bit number that uniquely identifies the router
  10933.         in the Autonomous System.  One algorithm for Router    ID
  10934.         assignment is to choose the    largest    or smallest IP address
  10935.         assigned to    the router.  If    a router's OSPF    Router ID is
  10936.         changed, the router's OSPF software    should be restarted
  10937.         before the new Router ID takes effect. Before restarting in
  10938.         order to change its    Router ID, the router should flush its
  10939.         self-originated LSAs from the routing domain (see Section
  10940.         14.1), or they will    persist    for up to MaxAge minutes.
  10941.  
  10942.     RFC1583Compatibility
  10943.         Controls the preference rules used in Section 16.4 when
  10944.         choosing among multiple AS-external-LSAs advertising the
  10945.         same destination. When set to "enabled", the preference
  10946.         rules remain those specified by RFC    1583 ([Ref9]). When set
  10947.         to "disabled", the preference rules    are those stated in
  10948.  
  10949.  
  10950.  
  10951. Moy                Standards Track              [Page 219]
  10952.  
  10953. RFC 2328             OSPF Version 2              April 1998
  10954.  
  10955.  
  10956.         Section 16.4.1, which prevent routing loops    when AS-
  10957.         external-LSAs for the same destination have    been originated
  10958.         from different areas. Set to "enabled" by default.
  10959.  
  10960.         In order to    minimize the chance of routing loops, all OSPF
  10961.         routers in an OSPF routing domain should have
  10962.         RFC1583Compatibility set identically. When there are routers
  10963.         present that have not been updated with the    functionality
  10964.         specified in Section 16.4.1    of this    memo, all routers should
  10965.         have RFC1583Compatibility set to "enabled".    Otherwise, all
  10966.         routers should have    RFC1583Compatibility set to "disabled",
  10967.         preventing all routing loops.
  10968.  
  10969.     C.2    Area parameters
  10970.  
  10971.     All routers belonging to an area must agree on that area's
  10972.     configuration.    Disagreements between two routers will lead to
  10973.     an inability for adjacencies to    form between them, with    a
  10974.     resulting hindrance to the flow    of routing protocol and    data
  10975.     traffic.  The following    items must be configured for an    area:
  10976.  
  10977.  
  10978.     Area ID
  10979.         This is a 32-bit number that identifies the    area.  The Area
  10980.         ID of 0.0.0.0 is reserved for the backbone.     If the    area
  10981.         represents a subnetted network, the    IP network number of the
  10982.         subnetted network may be used for the Area ID.
  10983.  
  10984.     List of    address    ranges
  10985.         An OSPF area is defined as a list of address ranges. Each
  10986.         address range consists of the following items:
  10987.  
  10988.         [IP    address, mask]
  10989.             Describes the collection of    IP addresses contained
  10990.             in the address range. Networks and hosts are
  10991.             assigned to    an area    depending on whether their
  10992.             addresses fall into    one of the area's defining
  10993.             address ranges.  Routers are viewed    as belonging to
  10994.             multiple areas, depending on their attached
  10995.             networks' area membership.
  10996.  
  10997.  
  10998.  
  10999.  
  11000.  
  11001. Moy                Standards Track              [Page 220]
  11002.  
  11003. RFC 2328             OSPF Version 2              April 1998
  11004.  
  11005.  
  11006.         Status  Set    to either Advertise or DoNotAdvertise.    Routing
  11007.             information    is condensed at    area boundaries.
  11008.             External to    the area, at most a single route is
  11009.             advertised (via a summary-LSA) for each address
  11010.             range. The route is    advertised if and only if the
  11011.             address range's Status is set to Advertise.
  11012.             Unadvertised ranges    allow the existence of certain
  11013.             networks to    be intentionally hidden    from other
  11014.             areas. Status is set to Advertise by default.
  11015.  
  11016.         As an example, suppose an IP subnetted network is to be its
  11017.         own    OSPF area.  The    area would be configured as a single
  11018.         address range, whose IP address is the address of the
  11019.         subnetted network, and whose mask is the natural class A, B,
  11020.         or C address mask.    A single route would be    advertised
  11021.         external to    the area, describing the entire    subnetted
  11022.         network.
  11023.  
  11024.     ExternalRoutingCapability
  11025.         Whether AS-external-LSAs will be flooded into/throughout the
  11026.         area.  If AS-external-LSAs are excluded from the area, the
  11027.         area is called a "stub".  Internal to stub areas, routing to
  11028.         external destinations will be based    solely on a default
  11029.         summary route.  The    backbone cannot    be configured as a stub
  11030.         area.  Also, virtual links cannot be configured through stub
  11031.         areas.  For    more information, see Section 3.6.
  11032.  
  11033.     StubDefaultCost
  11034.         If the area    has been configured as a stub area, and    the
  11035.         router itself is an    area border router, then the
  11036.         StubDefaultCost indicates the cost of the default summary-
  11037.         LSA    that the router    should advertise into the area.
  11038.  
  11039.     C.3    Router interface parameters
  11040.  
  11041.     Some of    the configurable router    interface parameters (such as IP
  11042.     interface address and subnet mask) actually imply properties of
  11043.     the attached networks, and therefore must be consistent    across
  11044.     all the    routers    attached to that network.  The parameters that
  11045.     must be    configured for a router    interface are:
  11046.  
  11047.  
  11048.  
  11049.  
  11050.  
  11051. Moy                Standards Track              [Page 221]
  11052.  
  11053. RFC 2328             OSPF Version 2              April 1998
  11054.  
  11055.  
  11056.     IP interface address
  11057.         The    IP protocol address for    this interface.     This uniquely
  11058.         identifies the router over the entire internet.  An    IP
  11059.         address is not required on point-to-point networks.     Such a
  11060.         point-to-point network is called "unnumbered".
  11061.  
  11062.     IP interface mask
  11063.         Also referred to as    the subnet/network mask, this indicates
  11064.         the    portion    of the IP interface address that identifies the
  11065.         attached network.  Masking the IP interface    address    with the
  11066.         IP interface mask yields the IP network number of the
  11067.         attached network.  On point-to-point networks and virtual
  11068.         links, the IP interface mask is not    defined. On these
  11069.         networks, the link itself is not assigned an IP network
  11070.         number, and    so the addresses of each side of the link are
  11071.         assigned independently, if they are    assigned at all.
  11072.  
  11073.     Area ID
  11074.         The    OSPF area to which the attached    network    belongs.
  11075.  
  11076.     Interface output cost
  11077.         The    cost of    sending    a packet on the    interface, expressed in
  11078.         the    link state metric.  This is advertised as the link cost
  11079.         for    this interface in the router's router-LSA. The interface
  11080.         output cost    must always be greater than 0.
  11081.  
  11082.     RxmtInterval
  11083.         The    number of seconds between LSA retransmissions, for
  11084.         adjacencies    belonging to this interface.  Also used    when
  11085.         retransmitting Database Description    and Link State Request
  11086.         Packets.  This should be well over the expected round-trip
  11087.         delay between any two routers on the attached network.  The
  11088.         setting of this value should be conservative or needless
  11089.         retransmissions will result.  Sample value for a local area
  11090.         network: 5 seconds.
  11091.  
  11092.     InfTransDelay
  11093.         The    estimated number of seconds it takes to    transmit a Link
  11094.         State Update Packet    over this interface.  LSAs contained in
  11095.         the    update packet must have    their age incremented by this
  11096.         amount before transmission.     This value should take    into
  11097.         account the    transmission and propagation delays of the
  11098.  
  11099.  
  11100.  
  11101. Moy                Standards Track              [Page 222]
  11102.  
  11103. RFC 2328             OSPF Version 2              April 1998
  11104.  
  11105.  
  11106.         interface.    It must    be greater than    0.  Sample value for a
  11107.         local area network:    1 second.
  11108.  
  11109.     Router Priority
  11110.         An 8-bit unsigned integer.    When two routers attached to a
  11111.         network both attempt to become Designated Router, the one
  11112.         with the highest Router Priority takes precedence.    If there
  11113.         is still a tie, the    router with the    highest    Router ID takes
  11114.         precedence.     A router whose    Router Priority    is set to 0 is
  11115.         ineligible to become Designated Router on the attached
  11116.         network.  Router Priority is only configured for interfaces
  11117.         to broadcast and NBMA networks.
  11118.  
  11119.     HelloInterval
  11120.         The    length of time,    in seconds, between the    Hello Packets
  11121.         that the router sends on the interface.  This value    is
  11122.         advertised in the router's Hello Packets.  It must be the
  11123.         same for all routers attached to a common network.    The
  11124.         smaller the    HelloInterval, the faster topological changes
  11125.         will be detected; however, more OSPF routing protocol
  11126.         traffic will ensue.     Sample    value for a X.25 PDN network: 30
  11127.         seconds.  Sample value for a local area network: 10    seconds.
  11128.  
  11129.     RouterDeadInterval
  11130.         After ceasing to hear a router's Hello Packets, the    number
  11131.         of seconds before its neighbors declare the    router down.
  11132.         This is also advertised in the router's Hello Packets in
  11133.         their RouterDeadInterval field.  This should be some
  11134.         multiple of    the HelloInterval (say 4).  This value again
  11135.         must be the    same for all routers attached to a common
  11136.         network.
  11137.  
  11138.     AuType
  11139.         Identifies the authentication procedure to be used on the
  11140.         attached network.  This value must be the same for all
  11141.         routers attached to    the network.  See Appendix D for a
  11142.         discussion of the defined authentication types.
  11143.  
  11144.     Authentication key
  11145.         This configured data allows    the authentication procedure to
  11146.         verify OSPF    protocol packets received over the interface.
  11147.         For    example, if the    AuType indicates simple    password, the
  11148.  
  11149.  
  11150.  
  11151. Moy                Standards Track              [Page 223]
  11152.  
  11153. RFC 2328             OSPF Version 2              April 1998
  11154.  
  11155.  
  11156.         Authentication key would be    a clear    64-bit password.
  11157.         Authentication keys    associated with    the other OSPF
  11158.         authentication types are discussed in Appendix D.
  11159.  
  11160.     C.4    Virtual    link parameters
  11161.  
  11162.     Virtual    links are used to restore/increase connectivity    of the
  11163.     backbone.  Virtual links may be    configured between any pair of
  11164.     area border routers having interfaces to a common (non-backbone)
  11165.     area.  The virtual link    appears    as an unnumbered point-to-point
  11166.     link in    the graph for the backbone.  The virtual link must be
  11167.     configured in both of the area border routers.
  11168.  
  11169.     A virtual link appears in router-LSAs (for the backbone) as if
  11170.     it were    a separate router interface to the backbone.  As such,
  11171.     it has all of the parameters associated    with a router interface
  11172.     (see Section C.3).  Although a virtual link acts like an
  11173.     unnumbered point-to-point link,    it does    have an    associated IP
  11174.     interface address.  This address is used as the    IP source in
  11175.     OSPF protocol packets it sends along the virtual link, and is
  11176.     set dynamically    during the routing table build process.
  11177.     Interface output cost is also set dynamically on virtual links
  11178.     to be the cost of the intra-area path between the two routers.
  11179.     The parameter RxmtInterval must    be configured, and should be
  11180.     well over the expected round-trip delay    between    the two    routers.
  11181.     This may be hard to estimate for a virtual link; it is better to
  11182.     err on the side    of making it too large.     Router    Priority is not
  11183.     used on    virtual    links.
  11184.  
  11185.     A virtual link is defined by the following two configurable
  11186.     parameters: the    Router ID of the virtual link's    other endpoint,
  11187.     and the    (non-backbone) area through which the virtual link runs
  11188.     (referred to as    the virtual link's Transit area).  Virtual links
  11189.     cannot be configured through stub areas.
  11190.  
  11191.     C.5    NBMA network parameters
  11192.  
  11193.     OSPF treats an NBMA network much like it treats    a broadcast
  11194.     network.  Since    there may be many routers attached to the
  11195.     network, a Designated Router is    selected for the network.  This
  11196.     Designated Router then originates a network-LSA, which lists all
  11197.     routers    attached to the    NBMA network.
  11198.  
  11199.  
  11200.  
  11201. Moy                Standards Track              [Page 224]
  11202.  
  11203. RFC 2328             OSPF Version 2              April 1998
  11204.  
  11205.  
  11206.     However, due to    the lack of broadcast capabilities, it may be
  11207.     necessary to use configuration parameters in the Designated
  11208.     Router selection.  These parameters will only need to be
  11209.     configured in those routers that are themselves    eligible to
  11210.     become Designated Router (i.e.,    those router's whose Router
  11211.     Priority for the network is non-zero), and then    only if    no
  11212.     automatic procedure for    discovering neighbors exists:
  11213.  
  11214.  
  11215.     List of    all other attached routers
  11216.         The    list of    all other routers attached to the NBMA network.
  11217.         Each router    is listed by its IP interface address on the
  11218.         network.  Also, for    each router listed, that router's
  11219.         eligibility    to become Designated Router must be defined.
  11220.         When an interface to a NBMA    network    comes up, the router
  11221.         sends Hello    Packets    only to    those neighbors    eligible to
  11222.         become Designated Router, until the    identity of the
  11223.         Designated Router is discovered.
  11224.  
  11225.     PollInterval
  11226.         If a neighboring router has    become inactive    (Hello Packets
  11227.         have not been seen for RouterDeadInterval seconds),    it may
  11228.         still be necessary to send Hello Packets to    the dead
  11229.         neighbor.  These Hello Packets will    be sent    at the reduced
  11230.         rate PollInterval, which should be much larger than
  11231.         HelloInterval.  Sample value for a PDN X.25    network: 2
  11232.         minutes.
  11233.  
  11234.     C.6    Point-to-MultiPoint network parameters
  11235.  
  11236.     On Point-to-MultiPoint networks, it may    be necessary to
  11237.     configure the set of neighbors that are    directly reachable over
  11238.     the Point-to-MultiPoint    network. Each neighbor is identified by
  11239.     its IP address on the Point-to-MultiPoint network. Designated
  11240.     Routers    are not    elected    on Point-to-MultiPoint networks, so the
  11241.     Designated Router eligibility of configured neighbors is
  11242.     undefined.
  11243.  
  11244.     Alternatively, neighbors on Point-to-MultiPoint    networks may be
  11245.     dynamically discovered by lower-level protocols    such as    Inverse
  11246.     ARP ([Ref14]).
  11247.  
  11248.  
  11249.  
  11250.  
  11251. Moy                Standards Track              [Page 225]
  11252.  
  11253. RFC 2328             OSPF Version 2              April 1998
  11254.  
  11255.  
  11256.     C.7    Host route parameters
  11257.  
  11258.     Host routes are    advertised in router-LSAs as stub networks with
  11259.     mask 0xffffffff.  They indicate    either router interfaces to
  11260.     point-to-point networks, looped    router interfaces, or IP hosts
  11261.     that are directly connected to the router (e.g., via a SLIP
  11262.     line).    For each host directly connected to the    router,    the
  11263.     following items    must be    configured:
  11264.  
  11265.  
  11266.     Host IP    address
  11267.         The    IP address of the host.
  11268.  
  11269.     Cost of    link to    host
  11270.         The    cost of    sending    a packet to the    host, in terms of the
  11271.         link state metric.    However, since the host    probably has
  11272.         only a single connection to    the internet, the actual
  11273.         configured cost in many cases is unimportant (i.e.,    will
  11274.         have no effect on routing).
  11275.  
  11276.     Area ID
  11277.         The    OSPF area to which the host belongs.
  11278.  
  11279.  
  11280.  
  11281.  
  11282.  
  11283.  
  11284.  
  11285.  
  11286.  
  11287.  
  11288.  
  11289.  
  11290.  
  11291.  
  11292.  
  11293.  
  11294.  
  11295.  
  11296.  
  11297.  
  11298.  
  11299.  
  11300.  
  11301. Moy                Standards Track              [Page 226]
  11302.  
  11303. RFC 2328             OSPF Version 2              April 1998
  11304.  
  11305.  
  11306. D. Authentication
  11307.  
  11308.     All    OSPF protocol exchanges    are authenticated.  The    OSPF packet
  11309.     header (see    Section    A.3.1) includes    an authentication type field,
  11310.     and    64-bits    of data    for use    by the appropriate authentication scheme
  11311.     (determined    by the type field).
  11312.  
  11313.     The    authentication type is configurable on a per-interface (or
  11314.     equivalently, on a per-network/subnet) basis.  Additional
  11315.     authentication data    is also    configurable on    a per-interface    basis.
  11316.  
  11317.     Authentication types 0, 1 and 2 are    defined    by this    specification.
  11318.     All    other authentication types are reserved    for definition by the
  11319.     IANA (iana@ISI.EDU).  The current list of authentication types is
  11320.     described below in Table 20.
  11321.  
  11322.  
  11323.  
  11324.           AuType       Description
  11325.           ___________________________________________
  11326.           0           Null authentication
  11327.           1           Simple password
  11328.           2           Cryptographic authentication
  11329.           All others   Reserved    for assignment by the
  11330.                    IANA (iana@ISI.EDU)
  11331.  
  11332.  
  11333.               Table 20:    OSPF authentication types.
  11334.  
  11335.  
  11336.  
  11337.     D.1    Null authentication
  11338.  
  11339.     Use of this authentication type    means that routing exchanges
  11340.     over the network/subnet    are not    authenticated.    The 64-bit
  11341.     authentication field in    the OSPF header    can contain anything; it
  11342.     is not examined    on packet reception. When employing Null
  11343.     authentication,    the entire contents of each OSPF packet    (other
  11344.     than the 64-bit    authentication field) are checksummed in order
  11345.     to detect data corruption.
  11346.  
  11347.  
  11348.  
  11349.  
  11350.  
  11351. Moy                Standards Track              [Page 227]
  11352.  
  11353. RFC 2328             OSPF Version 2              April 1998
  11354.  
  11355.  
  11356.     D.2    Simple password    authentication
  11357.  
  11358.     Using this authentication type,    a 64-bit field is configured on
  11359.     a per-network basis.  All packets sent on a particular network
  11360.     must have this configured value    in their OSPF header 64-bit
  11361.     authentication field.  This essentially    serves as a "clear" 64-
  11362.     bit password. In addition, the entire contents of each OSPF
  11363.     packet (other than the 64-bit authentication field) are
  11364.     checksummed in order to    detect data corruption.
  11365.  
  11366.     Simple password    authentication guards against routers
  11367.     inadvertently joining the routing domain; each router must first
  11368.     be configured with its attached    networks' passwords before it
  11369.     can participate    in routing.  However, simple password
  11370.     authentication is vulnerable to    passive    attacks    currently
  11371.     widespread in the Internet (see    [Ref16]). Anyone with physical
  11372.     access to the network can learn    the password and compromise the
  11373.     security of the    OSPF routing domain.
  11374.  
  11375.     D.3    Cryptographic authentication
  11376.  
  11377.     Using this authentication type,    a shared secret    key is
  11378.     configured in all routers attached to a    common network/subnet.
  11379.     For each OSPF protocol packet, the key is used to
  11380.     generate/verify    a "message digest" that    is appended to the end
  11381.     of the OSPF packet. The    message    digest is a one-way function of
  11382.     the OSPF protocol packet and the secret    key. Since the secret
  11383.     key is never sent over the network in the clear, protection is
  11384.     provided against passive attacks.
  11385.  
  11386.     The algorithms used to generate    and verify the message digest
  11387.     are specified implicitly by the    secret key. This specification
  11388.     completely defines the use of OSPF Cryptographic authentication
  11389.     when the MD5 algorithm is used.
  11390.  
  11391.     In addition, a non-decreasing sequence number is included in
  11392.     each OSPF protocol packet to protect against replay attacks.
  11393.     This provides long term    protection; however, it    is still
  11394.     possible to replay an OSPF packet until    the sequence number
  11395.     changes. To implement this feature, each neighbor data structure
  11396.     contains a new field called the    "cryptographic sequence    number".
  11397.     This field is initialized to zero, and is also set to zero
  11398.  
  11399.  
  11400.  
  11401. Moy                Standards Track              [Page 228]
  11402.  
  11403. RFC 2328             OSPF Version 2              April 1998
  11404.  
  11405.  
  11406.  
  11407.  
  11408.     0            1            2            3
  11409.     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
  11410.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11411.        |          0               |    Key    ID     | Auth Data Len |
  11412.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11413.        |         Cryptographic sequence    number               |
  11414.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11415.  
  11416.            Figure 18: Usage of the Authentication field
  11417.            in the OSPF packet header when Cryptographic
  11418.               Authentication is employed
  11419.  
  11420.     whenever the neighbor's    state transitions to "Down". Whenever an
  11421.     OSPF packet is accepted    as authentic, the cryptographic    sequence
  11422.     number is set to the received packet's sequence    number.
  11423.  
  11424.     This specification does    not provide a rollover procedure for the
  11425.     cryptographic sequence number. When the    cryptographic sequence
  11426.     number that the    router is sending hits the maximum value, the
  11427.     router should reset the    cryptographic sequence number that it is
  11428.     sending    back to    0. After this is done, the router's neighbors
  11429.     will reject the    router's OSPF packets for a period of
  11430.     RouterDeadInterval, and    then the router    will be    forced to
  11431.     reestablish all    adjacencies over the interface.    However, it is
  11432.     expected that many implementations will    use "seconds since
  11433.     reboot"    (or "seconds since 1960", etc.)    as the cryptographic
  11434.     sequence number. Such a    choice will essentially    prevent
  11435.     rollover, since    the cryptographic sequence number field    is 32
  11436.     bits in    length.
  11437.  
  11438.     The OSPF Cryptographic authentication option does not provide
  11439.     confidentiality.
  11440.  
  11441.     When cryptographic authentication is used, the 64-bit
  11442.     Authentication field in    the standard OSPF packet header    is
  11443.     redefined as shown in Figure 18. The new field definitions are
  11444.     as follows:
  11445.  
  11446.  
  11447.  
  11448.  
  11449.  
  11450.  
  11451. Moy                Standards Track              [Page 229]
  11452.  
  11453. RFC 2328             OSPF Version 2              April 1998
  11454.  
  11455.  
  11456.     Key ID
  11457.         This field identifies the algorithm    and secret key used to
  11458.         create the message digest appended to the OSPF packet. Key
  11459.         Identifiers    are unique per-interface (or equivalently, per-
  11460.         subnet).
  11461.  
  11462.     Auth Data Len
  11463.         The    length in bytes    of the message digest appended to the
  11464.         OSPF packet.
  11465.  
  11466.     Cryptographic sequence number
  11467.         An unsigned    32-bit non-decreasing sequence number. Used to
  11468.         guard against replay attacks.
  11469.  
  11470.     The message digest appended to the OSPF    packet is not actually
  11471.     considered part    of the OSPF protocol packet: the message digest
  11472.     is not included    in the OSPF header's packet length, although it
  11473.     is included in the packet's IP header length field.
  11474.  
  11475.     Each key is identified by the combination of interface and Key
  11476.     ID. An interface may have multiple keys    active at any one time.
  11477.     This enables smooth transition from one    key to another.    Each key
  11478.     has four time constants    associated with    it. These time constants
  11479.     can be expressed in terms of a time-of-day clock, or in    terms of
  11480.     a router's local clock (e.g., number of    seconds    since last
  11481.     reboot):
  11482.  
  11483.     KeyStartAccept
  11484.         The    time that the router will start    accepting packets that
  11485.         have been created with the given key.
  11486.  
  11487.     KeyStartGenerate
  11488.         The    time that the router will start    using the key for packet
  11489.         generation.
  11490.  
  11491.     KeyStopGenerate
  11492.         The    time that the router will stop using the key for packet
  11493.         generation.
  11494.  
  11495.     KeyStopAccept
  11496.         The    time that the router will stop accepting packets that
  11497.         have been created with the given key.
  11498.  
  11499.  
  11500.  
  11501. Moy                Standards Track              [Page 230]
  11502.  
  11503. RFC 2328             OSPF Version 2              April 1998
  11504.  
  11505.  
  11506.     In order to achieve smooth key transition, KeyStartAccept should
  11507.     be less    than KeyStartGenerate and KeyStopGenerate should be less
  11508.     than KeyStopAccept. If KeyStopGenerate and KeyStopAccept are
  11509.     left unspecified, the key's lifetime is    infinite. When a new key
  11510.     replaces an old, the KeyStartGenerate time for the new key must
  11511.     be less    than or    equal to the KeyStopGenerate time of the old
  11512.     key.
  11513.  
  11514.     Key storage should persist across a system restart, warm or
  11515.     cold, to avoid operational issues. In the event    that the last
  11516.     key associated with an interface expires, it is    unacceptable to
  11517.     revert to an unauthenticated condition,    and not    advisable to
  11518.     disrupt    routing.  Therefore, the router    should send a "last
  11519.     authentication key expiration" notification to the network
  11520.     manager    and treat the key as having an infinite    lifetime until
  11521.     the lifetime is    extended, the key is deleted by    network
  11522.     management, or a new key is configured.
  11523.  
  11524.     D.4    Message    generation
  11525.  
  11526.     After building the contents of an OSPF packet, the
  11527.     authentication procedure indicated by the sending interface's
  11528.     Autype value is    called before the packet is sent. The
  11529.     authentication procedure modifies the OSPF packet as follows.
  11530.  
  11531.     D.4.1 Generating Null authentication
  11532.  
  11533.         When using Null authentication, the    packet is modified as
  11534.         follows:
  11535.  
  11536.         (1)    The Autype field in the    standard OSPF header is    set to
  11537.         0.
  11538.  
  11539.         (2)    The checksum field in the standard OSPF    header is set to
  11540.         the standard IP    checksum of the    entire contents    of the
  11541.         packet,    starting with the OSPF packet header but
  11542.         excluding the 64-bit authentication field.  This
  11543.         checksum is calculated as the 16-bit one's complement of
  11544.         the one's complement sum of all    the 16-bit words in the
  11545.         packet,    excepting the authentication field.  If    the
  11546.  
  11547.  
  11548.  
  11549.  
  11550.  
  11551. Moy                Standards Track              [Page 231]
  11552.  
  11553. RFC 2328             OSPF Version 2              April 1998
  11554.  
  11555.  
  11556.         packet's length    is not an integral number of 16-bit
  11557.         words, the packet is padded with a byte    of zero    before
  11558.         checksumming.
  11559.  
  11560.     D.4.2 Generating Simple    password authentication
  11561.  
  11562.         When using Simple password authentication, the packet is
  11563.         modified as    follows:
  11564.  
  11565.         (1)    The Autype field in the    standard OSPF header is    set to
  11566.         1.
  11567.  
  11568.         (2)    The checksum field in the standard OSPF    header is set to
  11569.         the standard IP    checksum of the    entire contents    of the
  11570.         packet,    starting with the OSPF packet header but
  11571.         excluding the 64-bit authentication field.  This
  11572.         checksum is calculated as the 16-bit one's complement of
  11573.         the one's complement sum of all    the 16-bit words in the
  11574.         packet,    excepting the authentication field.  If    the
  11575.         packet's length    is not an integral number of 16-bit
  11576.         words, the packet is padded with a byte    of zero    before
  11577.         checksumming.
  11578.  
  11579.         (3)    The 64-bit authentication field    in the OSPF packet
  11580.         header is set to the 64-bit password (i.e.,
  11581.         authentication key) that has been configured for the
  11582.         interface.
  11583.  
  11584.     D.4.3 Generating Cryptographic authentication
  11585.  
  11586.         When using Cryptographic authentication, there may be
  11587.         multiple keys configured for the interface.    In this    case,
  11588.         among the keys that    are valid for message generation (i.e,
  11589.         that have KeyStartGenerate <= current time <
  11590.         KeyStopGenerate) choose the    one with the most recent
  11591.         KeyStartGenerate time. Using this key, modify the packet as
  11592.         follows:
  11593.  
  11594.         (1)    The Autype field in the    standard OSPF header is    set to
  11595.         2.
  11596.  
  11597.  
  11598.  
  11599.  
  11600.  
  11601. Moy                Standards Track              [Page 232]
  11602.  
  11603. RFC 2328             OSPF Version 2              April 1998
  11604.  
  11605.  
  11606.         (2)    The checksum field in the standard OSPF    header is not
  11607.         calculated, but    is instead set to 0.
  11608.  
  11609.         (3)    The Key    ID (see    Figure 18) is set to the chosen    key's
  11610.         Key ID.
  11611.  
  11612.         (4)    The Auth Data Len field    is set to the length in    bytes of
  11613.         the message digest that    will be    appended to the    OSPF
  11614.         packet.    When using MD5 as the authentication algorithm,
  11615.         Auth Data Len will be 16.
  11616.  
  11617.         (5)    The 32-bit Cryptographic sequence number (see Figure 18)
  11618.         is set to a non-decreasing value (i.e.,    a value    at least
  11619.         as large as the    last value sent    out the    interface). The
  11620.         precise    values to use in the cryptographic sequence
  11621.         number field are implementation-specific. For example,
  11622.         it may be based    on a simple counter, or    be based on the
  11623.         system's clock.
  11624.  
  11625.         (6)    The message digest is then calculated and appended to
  11626.         the OSPF packet.  The authentication algorithm to be
  11627.         used in    calculating the    digest is indicated by the key
  11628.         itself.     Input to the authentication algorithm consists
  11629.         of the OSPF packet and the secret key. When using MD5 as
  11630.         the authentication algorithm, the message digest
  11631.         calculation proceeds as    follows:
  11632.  
  11633.         (a) The    16 byte    MD5 key    is appended to the OSPF    packet.
  11634.  
  11635.         (b) Trailing pad and length fields are added, as
  11636.             specified in [Ref17].
  11637.  
  11638.         (c) The    MD5 authentication algorithm is    run over the
  11639.             concatenation of the OSPF packet, secret key, pad
  11640.             and    length fields, producing a 16 byte message
  11641.             digest (see    [Ref17]).
  11642.  
  11643.         (d) The    MD5 digest is written over the OSPF key    (i.e.,
  11644.             appended to    the original OSPF packet). The digest is
  11645.             not    counted    in the OSPF packet's length field, but
  11646.  
  11647.  
  11648.  
  11649.  
  11650.  
  11651. Moy                Standards Track              [Page 233]
  11652.  
  11653. RFC 2328             OSPF Version 2              April 1998
  11654.  
  11655.  
  11656.             is included    in the packet's    IP length field. Any
  11657.             trailing pad or length fields beyond the digest are
  11658.             not    counted    or transmitted.
  11659.  
  11660.     D.5    Message    verification
  11661.  
  11662.     When an    OSPF packet has    been received on an interface, it must
  11663.     be authenticated. The authentication procedure is indicated by
  11664.     the setting of Autype in the standard OSPF packet header, which
  11665.     matches    the setting of Autype for the receiving    OSPF interface.
  11666.  
  11667.     If an OSPF protocol packet is accepted as authentic, processing
  11668.     of the packet continues    as specified in    Section    8.2. Packets
  11669.     which fail authentication are discarded.
  11670.  
  11671.     D.5.1 Verifying    Null authentication
  11672.  
  11673.         When using Null authentication, the    checksum field in the
  11674.         OSPF header    must be    verified. It must be set to the    16-bit
  11675.         one's complement of    the one's complement sum of all    the 16-
  11676.         bit    words in the packet, excepting the authentication field.
  11677.         (If    the packet's length is not an integral number of 16-bit
  11678.         words, the packet is padded    with a byte of zero before
  11679.         checksumming.)
  11680.  
  11681.     D.5.2 Verifying    Simple password    authentication
  11682.  
  11683.         When using Simple password authentication, the received OSPF
  11684.         packet is authenticated as follows:
  11685.  
  11686.         (1)    The checksum field in the OSPF header must be verified.
  11687.         It must    be set to the 16-bit one's complement of the
  11688.         one's complement sum of    all the    16-bit words in    the
  11689.         packet,    excepting the authentication field.  (If the
  11690.         packet's length    is not an integral number of 16-bit
  11691.         words, the packet is padded with a byte    of zero    before
  11692.         checksumming.)
  11693.  
  11694.         (2)    The 64-bit authentication field    in the OSPF packet
  11695.         header must be equal to    the 64-bit password (i.e.,
  11696.         authentication key) that has been configured for the
  11697.         interface.
  11698.  
  11699.  
  11700.  
  11701. Moy                Standards Track              [Page 234]
  11702.  
  11703. RFC 2328             OSPF Version 2              April 1998
  11704.  
  11705.  
  11706.     D.5.3 Verifying    Cryptographic authentication
  11707.  
  11708.         When using Cryptographic authentication, the received OSPF
  11709.         packet is authenticated as follows:
  11710.  
  11711.         (1)    Locate the receiving interface's configured key    having
  11712.         Key ID equal to    that specified in the received OSPF
  11713.         packet (see Figure 18).    If the key is not found, or if
  11714.         the key    is not valid for reception (i.e., current time <
  11715.         KeyStartAccept or current time >= KeyStopAccept), the
  11716.         OSPF packet is discarded.
  11717.  
  11718.         (2)    If the cryptographic sequence number found in the OSPF
  11719.         header (see Figure 18) is less than the    cryptographic
  11720.         sequence number    recorded in the    sending    neighbor's data
  11721.         structure, the OSPF packet is discarded.
  11722.  
  11723.         (3)    Verify the appended message digest in the following
  11724.         steps:
  11725.  
  11726.         (a) The    received digest    is set aside.
  11727.  
  11728.         (b) A new digest is calculated,    as specified in    Step 6
  11729.             of Section D.4.3.
  11730.  
  11731.         (c) The    calculated and received    digests    are compared. If
  11732.             they do not    match, the OSPF    packet is discarded. If
  11733.             they do match, the OSPF protocol packet is accepted
  11734.             as authentic, and the "cryptographic sequence
  11735.             number" in the neighbor's data structure is    set to
  11736.             the    sequence number    found in the packet's OSPF
  11737.             header.
  11738.  
  11739.  
  11740.  
  11741.  
  11742.  
  11743.  
  11744.  
  11745.  
  11746.  
  11747.  
  11748.  
  11749.  
  11750.  
  11751. Moy                Standards Track              [Page 235]
  11752.  
  11753. RFC 2328             OSPF Version 2              April 1998
  11754.  
  11755.  
  11756. E. An algorithm    for assigning Link State IDs
  11757.  
  11758.     The    Link State ID in AS-external-LSAs and summary-LSAs is usually
  11759.     set    to the described network's IP address. However,    if necessary one
  11760.     or more of the network's host bits may be set in the Link State ID.
  11761.     This allows    the router to originate    separate LSAs for networks
  11762.     having the same address, yet different masks. Such networks    can
  11763.     occur in the presence of supernetting and subnet 0s    (see [Ref10]).
  11764.  
  11765.     This appendix gives    one possible algorithm for setting the host bits
  11766.     in Link State IDs.    The choice of such an algorithm    is a local
  11767.     decision. Separate routers are free    to use different algorithms,
  11768.     since the only LSAs    affected are the ones that the router itself
  11769.     originates.    The only requirement on    the algorithms used is that the
  11770.     network's IP address should    be used    as the Link State ID whenever
  11771.     possible; this maximizes interoperability with OSPF    implementations
  11772.     predating RFC 1583.
  11773.  
  11774.     The    algorithm below    is stated for AS-external-LSAs.     This is only
  11775.     for    clarity; the exact same    algorithm can be used for summary-LSAs.
  11776.     Suppose that the router wishes to originate    an AS-external-LSA for a
  11777.     network having address NA and mask NM1. The    following steps    are then
  11778.     used to determine the LSA's    Link State ID:
  11779.  
  11780.     (1)    Determine whether the router is    already    originating an AS-
  11781.     external-LSA with Link State ID    equal to NA (in    such an    LSA the
  11782.     router itself will be listed as    the LSA's Advertising Router).
  11783.     If not,    the Link State ID is set equal to NA and the algorithm
  11784.     terminates. Otherwise,
  11785.  
  11786.     (2)    Obtain the network mask    from the body of the already existing
  11787.     AS-external-LSA. Call this mask    NM2. There are then two    cases:
  11788.  
  11789.     o   NM1    is longer (i.e., more specific)    than NM2. In this case,
  11790.         set    the Link State ID in the new LSA to be the network
  11791.         [NA,NM1] with all the host bits set    (i.e., equal to    NA or'ed
  11792.         together with all the bits that are    not set    in NM1,    which is
  11793.         network [NA,NM1]'s broadcast address).
  11794.  
  11795.     o   NM2    is longer than NM1. In this case, change the existing
  11796.         LSA    (having    Link State ID of NA) to    reference the new
  11797.         network [NA,NM1] by    incrementing the sequence number,
  11798.  
  11799.  
  11800.  
  11801. Moy                Standards Track              [Page 236]
  11802.  
  11803. RFC 2328             OSPF Version 2              April 1998
  11804.  
  11805.  
  11806.         changing the mask in the body to NM1 and inserting the cost
  11807.         of the new network.    Then originate a new LSA for the old
  11808.         network [NA,NM2], with Link    State ID equal to NA or'ed
  11809.         together with the bits that    are not    set in NM2 (i.e.,
  11810.         network [NA,NM2]'s broadcast address).
  11811.  
  11812.     The    above algorithm    assumes    that all masks are contiguous; this
  11813.     ensures that when two networks have    the same address, one mask is
  11814.     more specific than the other. The algorithm    also assumes that no
  11815.     network exists having an address equal to another network's
  11816.     broadcast address. Given these two assumptions, the    above algorithm
  11817.     always produces unique Link    State IDs. The above algorithm can also
  11818.     be reworded    as follows:  When originating an AS-external-LSA, try to
  11819.     use    the network number as the Link State ID.  If that produces a
  11820.     conflict, examine the two networks in conflict. One    will be    a subset
  11821.     of the other. For the less specific    network, use the network number
  11822.     as the Link    State ID and for the more specific use the network's
  11823.     broadcast address instead (i.e., flip all the "host" bits to 1).  If
  11824.     the    most specific network was originated first, this will cause you
  11825.     to originate two LSAs at once.
  11826.  
  11827.     As an example of the algorithm, consider its operation when    the
  11828.     following sequence of events occurs    in a single router (Router A).
  11829.  
  11830.  
  11831.     (1)    Router A wants to originate an AS-external-LSA for
  11832.     [10.0.0.0,255.255.255.0]:
  11833.  
  11834.     (a) A Link State ID of 10.0.0.0    is used.
  11835.  
  11836.     (2)    Router A then wants to originate an AS-external-LSA for
  11837.     [10.0.0.0,255.255.0.0]:
  11838.  
  11839.     (a) The    LSA for    [10.0.0,0,255.255.255.0] is reoriginated using a
  11840.         new    Link State ID of 10.0.0.255.
  11841.  
  11842.     (b) A Link State ID of 10.0.0.0    is used    for
  11843.         [10.0.0.0,255.255.0.0].
  11844.  
  11845.     (3)    Router A then wants to originate an AS-external-LSA for
  11846.     [10.0.0.0,255.0.0.0]:
  11847.  
  11848.  
  11849.  
  11850.  
  11851. Moy                Standards Track              [Page 237]
  11852.  
  11853. RFC 2328             OSPF Version 2              April 1998
  11854.  
  11855.  
  11856.     (a) The    LSA for    [10.0.0.0,255.255.0.0] is reoriginated using a
  11857.         new    Link State ID of 10.0.255.255.
  11858.  
  11859.     (b) A Link State ID of 10.0.0.0    is used    for
  11860.         [10.0.0.0,255.0.0.0].
  11861.  
  11862.     (c) The    network    [10.0.0.0,255.255.255.0] keeps its Link    State ID
  11863.         of 10.0.0.255.
  11864.  
  11865.  
  11866.  
  11867.  
  11868.  
  11869.  
  11870.  
  11871.  
  11872.  
  11873.  
  11874.  
  11875.  
  11876.  
  11877.  
  11878.  
  11879.  
  11880.  
  11881.  
  11882.  
  11883.  
  11884.  
  11885.  
  11886.  
  11887.  
  11888.  
  11889.  
  11890.  
  11891.  
  11892.  
  11893.  
  11894.  
  11895.  
  11896.  
  11897.  
  11898.  
  11899.  
  11900.  
  11901. Moy                Standards Track              [Page 238]
  11902.  
  11903. RFC 2328             OSPF Version 2              April 1998
  11904.  
  11905.  
  11906. F. Multiple interfaces to the same network/subnet
  11907.  
  11908.     There are at least two ways    to support multiple physical interfaces
  11909.     to the same    IP subnet. Both    methods    will interoperate with
  11910.     implementations of RFC 1583    (and of    course this memo). The two
  11911.     methods are    sketched briefly below.    An assumption has been made that
  11912.     each interface has been assigned a separate    IP address (otherwise,
  11913.     support for    multiple interfaces is more of a link-level or ARP issue
  11914.     than an OSPF issue).
  11915.  
  11916.     Method 1:
  11917.     Run the    entire OSPF functionality over both interfaces,    sending
  11918.     and receiving hellos, flooding,    supporting separate interface
  11919.     and neighbor FSMs for each interface, etc. When    doing this all
  11920.     other routers on the subnet will treat the two interfaces as
  11921.     separate neighbors, since neighbors are    identified (on broadcast
  11922.     and NBMA networks) by their IP address.
  11923.  
  11924.     Method 1 has the following disadvantages:
  11925.  
  11926.     (1) You    increase the total number of neighbors and adjacencies.
  11927.  
  11928.     (2) You    lose the bidirectionality test on both interfaces, since
  11929.         bidirectionality is    based on Router    ID.
  11930.  
  11931.     (3) You    have to    consider both interfaces together during the
  11932.         Designated Router election,    since if you declare both to be
  11933.         DR simultaneously you can confuse the tie-breaker (which is
  11934.         Router ID).
  11935.  
  11936.     Method 2:
  11937.     Run OSPF over only one interface (call it the primary
  11938.     interface), but    include    both the primary and secondary
  11939.     interfaces in your Router-LSA.
  11940.  
  11941.     Method 2 has the following disadvantages:
  11942.  
  11943.     (1) You    lose the bidirectionality test on the secondary
  11944.         interface.
  11945.  
  11946.     (2) When the primary interface fails, you need to promote the
  11947.         secondary interface    to primary status.
  11948.  
  11949.  
  11950.  
  11951. Moy                Standards Track              [Page 239]
  11952.  
  11953. RFC 2328             OSPF Version 2              April 1998
  11954.  
  11955.  
  11956. G. Differences from RFC    2178
  11957.  
  11958.     This section documents the differences between this    memo and RFC
  11959.     2178.  All differences are backward-compatible. Implementations of
  11960.     this memo and of RFCs 2178,    1583, and 1247 will interoperate.
  11961.  
  11962.     G.1    Flooding modifications
  11963.  
  11964.     Three changes have been    made to    the flooding procedure in
  11965.     Section    13.
  11966.  
  11967.     The first change is to step 4 in Section 13. Now MaxAge    LSAs are
  11968.     acknowledged and then discarded    only when both a) there    is no
  11969.     database copy of the LSA and b)    none of    router's neighbors are
  11970.     in states Exchange or Loading. In all other cases, the MaxAge
  11971.     LSA is processed like any other    LSA, installing    the LSA    in the
  11972.     database and flooding it out the appropriate interfaces    when the
  11973.     LSA is more recent than    the database copy (Step    5 of Section
  11974.     13). This change also affects the contents of Table 19.
  11975.  
  11976.     The second change is to    step 5a    in Section 13. The MinLSArrival
  11977.     check is meant only for    LSAs received during flooding, and
  11978.     should not be performed    on those LSAs that the router itself
  11979.     originates.
  11980.  
  11981.     The third change is to step 8 in Section 13. Confusion between
  11982.     routers    as to which LSA    instance is more recent    can cause a
  11983.     disastrous amount of flooding in a link-state protocol (see
  11984.     [Ref26]). OSPF guards against this problem in two ways:    a) the
  11985.     LS age field is    used like a TTL    field in flooding, to eventually
  11986.     remove looping LSAs from the network (see Section 13.3), and b)
  11987.     routers    refuse to accept LSA updates more frequently than once
  11988.     every MinLSArrival seconds (see    Section    13).  However, there is
  11989.     still one case in RFC 2178 where disagreements regarding which
  11990.     LSA is more recent can cause a lot of flooding traffic:
  11991.     responding to old LSAs by reflooding the database copy.     For
  11992.     this reason, Step 8 of Section 13 has been amended to only
  11993.     respond    with the database copy when that copy has not been sent
  11994.     in any Link State Update within    the last MinLSArrival seconds.
  11995.  
  11996.  
  11997.  
  11998.  
  11999.  
  12000.  
  12001. Moy                Standards Track              [Page 240]
  12002.  
  12003. RFC 2328             OSPF Version 2              April 1998
  12004.  
  12005.  
  12006.     G.2    Changes    to external path preferences
  12007.  
  12008.     There is still the possibility of a routing loop in RFC    2178
  12009.     when both a) virtual links are in use and b) the same external
  12010.     route is being imported    by multiple ASBRs, each    of which is in a
  12011.     separate area. To fix this problem, Section 16.4.1 has been
  12012.     revised. To choose the correct ASBR/forwarding address,    intra-
  12013.     area paths through non-backbone    areas are always preferred.
  12014.     However, intra-area paths through the backbone area (Area 0) and
  12015.     inter-area paths are now of equal preference, and must be
  12016.     compared solely    based on cost.
  12017.  
  12018.     The reasoning behind this change is as follows.    When virtual
  12019.     links are in use, an intra-area    backbone path for one router can
  12020.     turn into an inter-area    path in    a router several hops closer to
  12021.     the destination. Hence,    intra-area backbone paths and inter-area
  12022.     paths must be of equal preference. We can safely compare their
  12023.     costs, preferring the path with    the smallest cost, due to the
  12024.     calculations in    Section    16.3.
  12025.  
  12026.     Thanks to Michael Briggs and Jeremy McCooey of the UNH
  12027.     InterOperability Lab for pointing out this problem.
  12028.  
  12029.     G.3    Incomplete resolution of virtual next hops
  12030.  
  12031.     One of the functions of    the calculation    in Section 16.3    is to
  12032.     determine the actual next hop(s) for those destinations    whose
  12033.     next hop was calculated    as a virtual link in Sections 16.1 and
  12034.     16.2.  After completion    of the calculation in Section 16.3, any
  12035.     paths calculated in Sections 16.1 and 16.2 that    still have
  12036.     unresolved virtual next    hops should be discarded.
  12037.  
  12038.     G.4    Routing    table lookup
  12039.  
  12040.     The routing table lookup algorithm in Section 11.1 has been
  12041.     modified to reflect current practice. The "best    match" routing
  12042.     table entry is now always selected to be the one providing the
  12043.     most specific (longest)    match. Suppose for example a router is
  12044.     forwarding packets to the destination 192.9.1.1. A routing table
  12045.     entry for 192.9.1/24 will always be a better match than    the
  12046.     routing    table entry for    192.9/16, regardless of    the routing
  12047.     table entries' path-types. Note    however    that when multiple paths
  12048.  
  12049.  
  12050.  
  12051. Moy                Standards Track              [Page 241]
  12052.  
  12053. RFC 2328             OSPF Version 2              April 1998
  12054.  
  12055.  
  12056.     are available for a given routing table    entry, the calculations
  12057.     in Sections 16.1, 16.2,    and 16.4 always    yield the paths    having
  12058.     the most preferential path-type. (Intra-area paths are the most
  12059.     preferred, followed in order by    inter-area, type 1 external and
  12060.     type 2 external    paths; see Section 11).
  12061.  
  12062.  
  12063.  
  12064.  
  12065.  
  12066.  
  12067.  
  12068.  
  12069.  
  12070.  
  12071.  
  12072.  
  12073.  
  12074.  
  12075.  
  12076.  
  12077.  
  12078.  
  12079.  
  12080.  
  12081.  
  12082.  
  12083.  
  12084.  
  12085.  
  12086.  
  12087.  
  12088.  
  12089.  
  12090.  
  12091.  
  12092.  
  12093.  
  12094.  
  12095.  
  12096.  
  12097.  
  12098.  
  12099.  
  12100.  
  12101. Moy                Standards Track              [Page 242]
  12102.  
  12103. RFC 2328             OSPF Version 2              April 1998
  12104.  
  12105.  
  12106. Security Considerations
  12107.  
  12108.     All    OSPF protocol exchanges    are authenticated. OSPF    supports
  12109.     multiple types of authentication; the type of authentication in use
  12110.     can    be configured on a per network segment basis. One of OSPF's
  12111.     authentication types, namely the Cryptographic authentication
  12112.     option, is believed    to be secure against passive attacks and provide
  12113.     significant    protection against active attacks. When    using the
  12114.     Cryptographic authentication option, each router appends a "message
  12115.     digest" to its transmitted OSPF packets. Receivers then use    the
  12116.     shared secret key and received digest to verify that each received
  12117.     OSPF packet    is authentic.
  12118.  
  12119.     The    quality    of the security    provided by the    Cryptographic
  12120.     authentication option depends completely on    the strength of    the
  12121.     message digest algorithm (MD5 is currently the only    message    digest
  12122.     algorithm specified), the strength of the key being    used, and the
  12123.     correct implementation of the security mechanism in    all
  12124.     communicating OSPF implementations.     It also requires that all
  12125.     parties maintain the secrecy of the    shared secret key.
  12126.  
  12127.     None of the    OSPF authentication types provide confidentiality. Nor
  12128.     do they protect against traffic analysis. Key management is    also not
  12129.     addressed by this memo.
  12130.  
  12131.     For    more information, see Sections 8.1, 8.2, and Appendix D.
  12132.  
  12133. Author's Address
  12134.  
  12135.     John Moy
  12136.     Ascend Communications, Inc.
  12137.     1 Robbins Road
  12138.     Westford, MA 01886
  12139.  
  12140.     Phone: 978-952-1367
  12141.     Fax:   978-392-2075
  12142.     EMail: jmoy@casc.com
  12143.  
  12144.  
  12145.  
  12146.  
  12147.  
  12148.  
  12149.  
  12150.  
  12151. Moy                Standards Track              [Page 243]
  12152.  
  12153. RFC 2328             OSPF Version 2              April 1998
  12154.  
  12155.  
  12156. Full Copyright Statement
  12157.  
  12158.     Copyright (C) The Internet Society (1998).    All Rights Reserved.
  12159.  
  12160.     This document and translations of it may be    copied and furnished to
  12161.     others, and    derivative works that comment on or otherwise explain it
  12162.     or assist in its implementation may    be prepared, copied, published
  12163.     and    distributed, in    whole or in part, without restriction of any
  12164.     kind, provided that    the above copyright notice and this paragraph
  12165.     are    included on all    such copies and    derivative works.  However, this
  12166.     document itself may    not be modified    in any way, such as by removing
  12167.     the    copyright notice or references to the Internet Society or other
  12168.     Internet organizations, except as needed for the purpose of
  12169.     developing Internet    standards in which case    the procedures for
  12170.     copyrights defined in the Internet Standards process must be
  12171.     followed, or as required to    translate it into languages other than
  12172.     English.
  12173.  
  12174.     The    limited    permissions granted above are perpetual    and will not be
  12175.     revoked by the Internet Society or its successors or assigns.
  12176.  
  12177.     This document and the information contained    herein is provided on an
  12178.     "AS    IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  12179.     TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  12180.     BUT    NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE    INFORMATION
  12181.     HEREIN WILL    NOT INFRINGE ANY RIGHTS    OR ANY IMPLIED WARRANTIES OF
  12182.     MERCHANTABILITY OR FITNESS FOR A PARTICULAR    PURPOSE.
  12183.  
  12184.  
  12185.  
  12186.  
  12187.  
  12188.  
  12189.  
  12190.  
  12191.  
  12192.  
  12193.  
  12194.  
  12195.  
  12196.  
  12197.  
  12198.  
  12199.  
  12200.  
  12201. Moy                Standards Track              [Page 244]
  12202.  
  12203.