home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_j_p / draft-ietf-ospf-version2-09.txt < prev    next >
Text File  |  1997-01-10  |  467KB  |  12,602 lines

  1.  
  2.  
  3.  
  4.  
  5. Network    Working    Group                          J. Moy
  6. Internet Draft                    Cascade Communications Corp.
  7. Expiration Date: July 1997                    January 1997
  8. File name: draft-ietf-ospf-version2-09.txt
  9.  
  10.  
  11.                  OSPF Version 2
  12.  
  13.  
  14.  
  15. Status of this Memo
  16.  
  17.     This document is an    Internet-Draft.     Internet-Drafts are working
  18.     documents of the Internet Engineering Task Force (IETF), its areas,
  19.     and    its working groups.  Note that other groups may    also distribute
  20.     working documents as Internet-Drafts.
  21.  
  22.     Internet-Drafts are    draft documents    valid for a maximum of six
  23.     months and may be updated, replaced, or obsoleted by other documents
  24.     at any time.  It is    inappropriate to use Internet- Drafts as
  25.     reference material or to cite them other than as "work in progress".
  26.  
  27.     To learn the current status    of any Internet-Draft, please check the
  28.     "1id-abstracts.txt"    listing    contained in the Internet- Drafts Shadow
  29.     Directories    on ftp.is.co.za    (Africa), nic.nordu.net    (Europe),
  30.     munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  31.     ftp.isi.edu    (US West Coast).
  32.  
  33. Abstract
  34.  
  35.     This memo documents    version    2 of the OSPF protocol.     OSPF is a
  36.     link-state routing protocol.  It is    designed to be run internal to a
  37.     single Autonomous System.  Each OSPF router    maintains an identical
  38.     database describing    the Autonomous System's    topology.  From    this
  39.     database, a    routing    table is calculated by constructing a shortest-
  40.     path tree.
  41.  
  42.     OSPF recalculates routes quickly in    the face of topological    changes,
  43.     utilizing a    minimum    of routing protocol traffic.  OSPF provides
  44.     support for    equal-cost multipath.  Separate    routes can be calculated
  45.     for    each IP    Type of    Service.  An area routing capability is
  46.     provided, enabling an additional level of routing protection and a
  47.     reduction in routing protocol traffic.  In addition, all OSPF
  48.     routing protocol exchanges are authenticated.
  49.  
  50.     The    differences between this memo and RFC 1583 are explained in
  51.     Appendix G.    All differences    are backward-compatible    in nature.
  52.     Implementations of this memo and of    RFC 1583 will interoperate.
  53.  
  54.  
  55.  
  56. Moy                                [Page 1]
  57.  
  58. Internet Draft             OSPF Version 2            January 1997
  59.  
  60.  
  61.     Please send    comments to ospf@gated.cornell.edu.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112. Moy                                [Page 2]
  113.  
  114. Internet Draft             OSPF Version 2            January 1997
  115.  
  116.  
  117. Table of Contents
  118.  
  119.     1         Introduction ........................................... 7
  120.     1.1         Protocol Overview ...................................... 7
  121.     1.2         Definitions of commonly used terms    ..................... 8
  122.     1.3         Brief history of link-state routing technology ........ 11
  123.     1.4         Organization of this document ......................... 12
  124.     1.5         Acknowledgments ....................................... 13
  125.     2         The link-state database: organization and calculations  13
  126.     2.1         Representation of routers and networks ................ 13
  127.     2.1.1    Representation of non-broadcast networks .............. 15
  128.     2.1.2    An    example    link-state database ........................ 16
  129.     2.2         The shortest-path tree ................................ 20
  130.     2.3         Use of external routing information ................... 22
  131.     2.4         Equal-cost    multipath .................................. 24
  132.     2.5         TOS-based routing ..................................... 24
  133.     3         Splitting the AS into Areas ........................... 25
  134.     3.1         The backbone of the Autonomous System ................. 26
  135.     3.2         Inter-area    routing    .................................... 26
  136.     3.3         Classification of routers ............................. 27
  137.     3.4         A sample area configuration ........................... 28
  138.     3.5         IP    subnetting support ................................. 34
  139.     3.6         Supporting    stub areas ................................. 35
  140.     3.7         Partitions    of areas ................................... 36
  141.     4         Functional    Summary    .................................... 38
  142.     4.1         Inter-area    routing    .................................... 38
  143.     4.2         AS    external routes    .................................... 39
  144.     4.3         Routing protocol packets .............................. 39
  145.     4.4         Basic implementation requirements ..................... 41
  146.     4.5         Optional OSPF capabilities    ............................ 43
  147.     5         Protocol data structures .............................. 44
  148.     6         The Area Data Structure ............................... 46
  149.     7         Bringing Up Adjacencies ............................... 49
  150.     7.1         The Hello Protocol    .................................... 49
  151.     7.2         The Synchronization of Databases ...................... 50
  152.     7.3         The Designated Router ................................. 51
  153.     7.4         The Backup    Designated Router .......................... 52
  154.     7.5         The graph of adjacencies .............................. 53
  155.     8         Protocol Packet Processing    ............................ 54
  156.     8.1         Sending protocol packets .............................. 54
  157.     8.2         Receiving protocol    packets    ............................ 56
  158.     9         The Interface Data    Structure .......................... 59
  159.     9.1         Interface states ...................................... 62
  160.     9.2         Events causing interface state changes ................ 64
  161.     9.3         The Interface state machine ........................... 66
  162.     9.4         Electing the Designated Router ........................ 68
  163.     9.5         Sending Hello packets ................................. 71
  164.     9.5.1    Sending Hello packets on NBMA networks ................ 72
  165.  
  166.  
  167.  
  168. Moy                                [Page 3]
  169.  
  170. Internet Draft             OSPF Version 2            January 1997
  171.  
  172.  
  173.     10         The Neighbor Data Structure ........................... 73
  174.     10.1     Neighbor states ....................................... 75
  175.     10.2     Events causing neighbor state changes ................. 79
  176.     10.3     The Neighbor state    machine    ............................ 80
  177.     10.4     Whether to    become adjacent    ............................ 86
  178.     10.5     Receiving Hello Packets ............................... 87
  179.     10.6     Receiving Database    Description Packets ................ 89
  180.     10.7     Receiving Link State Request Packets .................. 92
  181.     10.8     Sending Database Description Packets .................. 93
  182.     10.9     Sending Link State    Request    Packets    .................... 94
  183.     10.10    An    Example    ............................................ 95
  184.     11         The Routing Table Structure ........................... 95
  185.     11.1     Routing table lookup ................................. 100
  186.     11.2     Sample routing table, without areas .................. 101
  187.     11.3     Sample routing table, with    areas ..................... 102
  188.     12         Link State    Advertisements (LSAs) ..................... 103
  189.     12.1     The LSA Header ....................................... 105
  190.     12.1.1   LS    age ............................................... 105
  191.     12.1.2   Options .............................................. 106
  192.     12.1.3   LS    type .............................................. 106
  193.     12.1.4   Link State    ID ........................................ 106
  194.     12.1.5   Advertising Router    ................................... 108
  195.     12.1.6   LS    sequence number    ................................... 108
  196.     12.1.7   LS    checksum .......................................... 109
  197.     12.2     The link state database .............................. 110
  198.     12.3     Representation of TOS ................................ 111
  199.     12.4     Originating LSAs ..................................... 112
  200.     12.4.1   Router-LSAs .......................................... 115
  201.     12.4.1.1 Describing    point-to-point interfaces ................. 117
  202.     12.4.1.2 Describing    broadcast and NBMA interfaces ............. 118
  203.     12.4.1.3 Describing    virtual    links ............................. 119
  204.     12.4.1.4 Describing    Point-to-MultiPoint interfaces ............ 119
  205.     12.4.1.5 Examples of router-LSAs .............................. 119
  206.     12.4.2   Network-LSAs ......................................... 122
  207.     12.4.2.1 Examples of network-LSAs ............................. 122
  208.     12.4.3   Summary-LSAs ......................................... 123
  209.     12.4.3.1 Originating summary-LSAs into stub    areas ............. 126
  210.     12.4.3.2 Examples of summary-LSAs ............................. 126
  211.     12.4.4   AS-external-LSAs ..................................... 127
  212.     12.4.4.1 Examples of AS-external-LSAs ......................... 128
  213.     13         The Flooding Procedure ............................... 130
  214.     13.1     Determining which LSA is newer ....................... 133
  215.     13.2     Installing    LSAs in    the database ...................... 134
  216.     13.3     Next step in the flooding procedure .................. 135
  217.     13.4     Receiving self-originated LSAs ....................... 138
  218.     13.5     Sending Link State    Acknowledgment packets ............ 138
  219.     13.6     Retransmitting LSAs .................................. 141
  220.     13.7     Receiving link state acknowledgments ................. 141
  221.  
  222.  
  223.  
  224. Moy                                [Page 4]
  225.  
  226. Internet Draft             OSPF Version 2            January 1997
  227.  
  228.  
  229.     14         Aging The Link State Database ........................ 142
  230.     14.1     Premature aging of    LSAs .............................. 142
  231.     15         Virtual Links ........................................ 143
  232.     16         Calculation of the    routing    table ..................... 145
  233.     16.1     Calculating the shortest-path tree    for an area ....... 146
  234.     16.1.1   The next hop calculation ............................. 152
  235.     16.2     Calculating the inter-area    routes .................... 153
  236.     16.3     Examining transit areas' summary-LSAs ................ 154
  237.     16.4     Calculating AS external routes ....................... 157
  238.     16.4.1   External path preferences ............................ 159
  239.     16.5     Incremental updates -- summary-LSAs .................. 159
  240.     16.6     Incremental updates -- AS-external-LSAs .............. 160
  241.     16.7     Events generated as a result of routing table changes  161
  242.     16.8     Equal-cost    multipath ................................. 161
  243.     16.9     Building the non-zero-TOS portion of the routing table 162
  244.          Footnotes ............................................ 164
  245.          References    ........................................... 168
  246.     A         OSPF data formats .................................... 170
  247.     A.1         Encapsulation of OSPF packets ........................ 170
  248.     A.2         The Options field .................................... 172
  249.     A.3         OSPF Packet Formats .................................. 174
  250.     A.3.1    The OSPF packet header ............................... 175
  251.     A.3.2    The Hello packet ..................................... 177
  252.     A.3.3    The Database Description packet ...................... 179
  253.     A.3.4    The Link State Request packet ........................ 181
  254.     A.3.5    The Link State Update packet ......................... 183
  255.     A.3.6    The Link State Acknowledgment packet ................. 185
  256.     A.4         LSA formats .......................................... 187
  257.     A.4.1    The LSA header ....................................... 188
  258.     A.4.2    Router-LSAs .......................................... 190
  259.     A.4.3    Network-LSAs ......................................... 194
  260.     A.4.4    Summary-LSAs ......................................... 195
  261.     A.4.5    AS-external-LSAs ..................................... 197
  262.     B         Architectural Constants .............................. 199
  263.     C         Configurable Constants ............................... 201
  264.     C.1         Global parameters .................................... 201
  265.     C.2         Area parameters ...................................... 202
  266.     C.3         Router interface parameters .......................... 203
  267.     C.4         Virtual link parameters .............................. 205
  268.     C.5         NBMA network parameters .............................. 206
  269.     C.6         Point-to-MultiPoint network parameters ............... 207
  270.     C.7         Host route    parameters ................................ 207
  271.     D         Authentication ....................................... 208
  272.     D.1         Null authentication .................................. 208
  273.     D.2         Simple password authentication ....................... 208
  274.     D.3         Cryptographic authentication ......................... 209
  275.     D.4         Message generation    ................................... 211
  276.     D.4.1    Generating    Null authentication ....................... 212
  277.  
  278.  
  279.  
  280. Moy                                [Page 5]
  281.  
  282. Internet Draft             OSPF Version 2            January 1997
  283.  
  284.  
  285.     D.4.2    Generating    Simple password    authentication ............ 212
  286.     D.4.3    Generating    Cryptographic authentication .............. 212
  287.     D.5         Message verification ................................. 214
  288.     D.5.1    Verifying Null authentication ........................ 214
  289.     D.5.2    Verifying Simple password authentication ............. 214
  290.     D.5.3    Verifying Cryptographic authentication ............... 214
  291.     E         An    algorithm for assigning    Link State IDs ............ 216
  292.     F         Multiple interfaces to the    same network/subnet ....... 218
  293.     G         Differences from RFC 1583 ............................ 219
  294.     G.1         Enhancements to OSPF authentication .................. 219
  295.     G.2         Addition of Point-to-MultiPoint interface ............ 219
  296.     G.3         Support for overlapping area ranges .................. 220
  297.     G.4         A modification to the flooding algorithm ............. 221
  298.     G.5         Introduction of the MinLSArrival constant ............ 221
  299.     G.6         Optionally    advertising point-to-point links as subnets 222
  300.     G.7         Advertising same external route from multiple areas .. 222
  301.     G.8         Retransmission of initial Database    Description packets 224
  302.     G.9         Detecting interface MTU mismatches    ................... 224
  303.          Security Considerations .............................. 225
  304.          Author's Address ..................................... 225
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. Moy                                [Page 6]
  337.  
  338. Internet Draft             OSPF Version 2            January 1997
  339.  
  340.  
  341. 1.  Introduction
  342.  
  343.     This document is a specification of    the Open Shortest Path First
  344.     (OSPF) TCP/IP internet routing protocol.  OSPF is classified as an
  345.     Interior Gateway Protocol (IGP).  This means that it distributes
  346.     routing information    between    routers    belonging to a single Autonomous
  347.     System.  The OSPF protocol is based    on link-state or SPF technology.
  348.     This is a departure    from the Bellman-Ford base used    by traditional
  349.     TCP/IP internet routing protocols.
  350.  
  351.     The    OSPF protocol was developed by the OSPF    working    group of the
  352.     Internet Engineering Task Force.  It has been designed expressly for
  353.     the    TCP/IP internet    environment, including explicit    support    for IP
  354.     subnetting,    TOS-based routing and the tagging of externally-derived
  355.     routing information.  OSPF also provides for the authentication of
  356.     routing updates, and utilizes IP multicast when sending/receiving
  357.     the    updates.  In addition, much work has been done to produce a
  358.     protocol that responds quickly to topology changes,    yet involves
  359.     small amounts of routing protocol traffic.
  360.  
  361.     1.1.  Protocol overview
  362.  
  363.     OSPF routes IP packets based solely on the destination IP
  364.     address    and IP Type of Service found in    the IP packet header.
  365.     IP packets are routed "as is" -- they are not encapsulated in
  366.     any further protocol headers as    they transit the Autonomous
  367.     System.     OSPF is a dynamic routing protocol.  It quickly detects
  368.     topological changes in the AS (such as router interface
  369.     failures) and calculates new loop-free routes after a period of
  370.     convergence.  This period of convergence is short and involves a
  371.     minimum    of routing traffic.
  372.  
  373.     In a link-state    routing    protocol, each router maintains    a
  374.     database describing the    Autonomous System's topology.  This
  375.     database is referred to    as the link-state database. Each
  376.     participating router has an identical database.     Each individual
  377.     piece of this database is a particular router's    local state
  378.     (e.g., the router's usable interfaces and reachable neighbors).
  379.     The router distributes its local state throughout the Autonomous
  380.     System by flooding.
  381.  
  382.     All routers run    the exact same algorithm, in parallel.    From the
  383.     link-state database, each router constructs a tree of shortest
  384.     paths with itself as root.  This shortest-path tree gives the
  385.     route to each destination in the Autonomous System.  Externally
  386.     derived    routing    information appears on the tree    as leaves.
  387.  
  388.     OSPF calculates    separate routes    for each Type of Service (TOS).
  389.  
  390.  
  391.  
  392. Moy                                [Page 7]
  393.  
  394. Internet Draft             OSPF Version 2            January 1997
  395.  
  396.  
  397.     When several equal-cost    routes to a destination    exist, traffic
  398.     is distributed equally among them.  The    cost of    a route    is
  399.     described by a single dimensionless metric.
  400.  
  401.     OSPF allows sets of networks to    be grouped together.  Such a
  402.     grouping is called an area.  The topology of an    area is    hidden
  403.     from the rest of the Autonomous    System.     This information hiding
  404.     enables    a significant reduction    in routing traffic.  Also,
  405.     routing    within the area    is determined only by the area's own
  406.     topology, lending the area protection from bad routing data.  An
  407.     area is    a generalization of an IP subnetted network.
  408.  
  409.     OSPF enables the flexible configuration    of IP subnets.    Each
  410.     route distributed by OSPF has a    destination and    mask.  Two
  411.     different subnets of the same IP network number    may have
  412.     different sizes    (i.e., different masks).  This is commonly
  413.     referred to as variable    length subnetting.  A packet is    routed
  414.     to the best (i.e., longest or most specific) match.  Host routes
  415.     are considered to be subnets whose masks are "all ones"
  416.     (0xffffffff).
  417.  
  418.     All OSPF protocol exchanges are    authenticated.    This means that
  419.     only trusted routers can participate in    the Autonomous System's
  420.     routing.  A variety of authentication schemes can be used; in
  421.     fact, separate authentication schemes can be configured    for each
  422.     IP subnet.
  423.  
  424.     Externally derived routing data    (e.g., routes learned from an
  425.     Exterior Gateway Protocol such as BGP; see [Ref23]) is
  426.     advertised throughout the Autonomous System.  This externally
  427.     derived    data is    kept separate from the OSPF protocol's link
  428.     state data.  Each external route can also be tagged by the
  429.     advertising router, enabling the passing of additional
  430.     information between routers on the boundary of the Autonomous
  431.     System.
  432.  
  433.  
  434.     1.2.  Definitions of commonly used terms
  435.  
  436.     This section provides definitions for terms that have a    specific
  437.     meaning    to the OSPF protocol and that are used throughout the
  438.     text.  The reader unfamiliar with the Internet Protocol    Suite is
  439.     referred to [Ref13] for    an introduction    to IP.
  440.  
  441.  
  442.     Router
  443.         A level three Internet Protocol packet switch.  Formerly
  444.         called a gateway in    much of    the IP literature.
  445.  
  446.  
  447.  
  448. Moy                                [Page 8]
  449.  
  450. Internet Draft             OSPF Version 2            January 1997
  451.  
  452.  
  453.     Autonomous System
  454.         A group of routers exchanging routing information via a
  455.         common routing protocol.  Abbreviated as AS.
  456.  
  457.     Interior Gateway Protocol
  458.         The    routing    protocol spoken    by the routers belonging to an
  459.         Autonomous system.    Abbreviated as IGP.  Each Autonomous
  460.         System has a single    IGP.  Separate Autonomous Systems may be
  461.         running different IGPs.
  462.  
  463.     Router ID
  464.         A 32-bit number assigned to    each router running the    OSPF
  465.         protocol.  This number uniquely identifies the router within
  466.         an Autonomous System.
  467.  
  468.     Network
  469.         In this memo, an IP    network/subnet/supernet.  It is    possible
  470.         for    one physical network to    be assigned multiple IP
  471.         network/subnet numbers.  We    consider these to be separate
  472.         networks.  Point-to-point physical networks    are an exception
  473.         - they are considered a single network no matter how many
  474.         (if    any at all) IP network/subnet numbers are assigned to
  475.         them.
  476.  
  477.     Network    mask
  478.         A 32-bit number indicating the range of IP addresses
  479.         residing on    a single IP network/subnet/supernet.  This
  480.         specification displays network masks as hexadecimal    numbers.
  481.         For    example, the network mask for a    class C    IP network is
  482.         displayed as 0xffffff00.  Such a mask is often displayed
  483.         elsewhere in the literature    as 255.255.255.0.
  484.  
  485.     Point-to-point networks
  486.         A network that joins a single pair of routers.  A 56Kb
  487.         serial line    is an example of a point-to-point network.
  488.  
  489.     Broadcast networks
  490.         Networks supporting    many (more than    two) attached routers,
  491.         together with the capability to address a single physical
  492.         message to all of the attached routers (broadcast).
  493.         Neighboring    routers    are discovered dynamically on these nets
  494.         using OSPF's Hello Protocol.  The Hello Protocol itself
  495.         takes advantage of the broadcast capability.  The OSPF
  496.         protocol makes further use of multicast capabilities, if
  497.         they exist.     Each pair of routers on a broadcast network is
  498.         assumed to be able to communicate directly.    An ethernet is
  499.         an example of a broadcast network.
  500.  
  501.  
  502.  
  503.  
  504. Moy                                [Page 9]
  505.  
  506. Internet Draft             OSPF Version 2            January 1997
  507.  
  508.  
  509.     Non-broadcast networks
  510.         Networks supporting    many (more than    two) routers, but having
  511.         no broadcast capability.  Neighboring routers are maintained
  512.         on these nets using    OSPF's Hello Protocol.    However, due to
  513.         the    lack of    broadcast capability, some configuration
  514.         information    may be necessary to aid    in the discovery of
  515.         neighbors.    On non-broadcast networks, OSPF    protocol packets
  516.         that are normally multicast    need to    be sent    to each
  517.         neighboring    router,    in turn. An X.25 Public    Data Network
  518.         (PDN) is an    example    of a non-broadcast network.
  519.  
  520.         OSPF runs in one of    two modes over non-broadcast networks.
  521.         The    first mode, called non-broadcast multi-access or NBMA,
  522.         simulates the operation of OSPF on a broadcast network. The
  523.         second mode, called    Point-to-MultiPoint, treats the    non-
  524.         broadcast network as a collection of point-to-point    links.
  525.         Non-broadcast networks are referred    to as NBMA networks or
  526.         Point-to-MultiPoint    networks, depending on OSPF's mode of
  527.         operation over the network.
  528.  
  529.     Interface
  530.         The    connection between a router and    one of its attached
  531.         networks.  An interface has    state information associated
  532.         with it, which is obtained from the    underlying lower level
  533.         protocols and the routing protocol itself.    An interface to
  534.         a network has associated with it a single IP address and
  535.         mask (unless the network is    an unnumbered point-to-point
  536.         network).  An interface is sometimes also referred to as a
  537.         link.
  538.  
  539.     Neighboring routers
  540.         Two    routers    that have interfaces to    a common network.
  541.         Neighbor relationships are maintained by, and usually
  542.         dynamically    discovered by, OSPF's Hello Protocol.
  543.  
  544.     Adjacency
  545.         A relationship formed between selected neighboring routers
  546.         for    the purpose of exchanging routing information.    Not
  547.         every pair of neighboring routers become adjacent.
  548.  
  549.     Link state advertisement
  550.         Unit of data describing the    local state of a router    or
  551.         network. For a router, this    includes the state of the
  552.         router's interfaces    and adjacencies.  Each link state
  553.         advertisement is flooded throughout    the routing domain. The
  554.         collected link state advertisements    of all routers and
  555.         networks forms the protocol's link state database.
  556.         Throughout this memo, link state advertisement is
  557.  
  558.  
  559.  
  560. Moy                                   [Page 10]
  561.  
  562. Internet Draft             OSPF Version 2            January 1997
  563.  
  564.  
  565.         abbreviated    as LSA.
  566.  
  567.     Hello Protocol
  568.         The    part of    the OSPF protocol used to establish and    maintain
  569.         neighbor relationships.  On    broadcast networks the Hello
  570.         Protocol can also dynamically discover neighboring routers.
  571.  
  572.     Flooding
  573.         The    part of    the OSPF protocol that distributes and
  574.         synchronizes the link-state    database between OSPF routers.
  575.  
  576.     Designated Router
  577.         Each broadcast and NBMA network that has at    least two
  578.         attached routers has a Designated Router.  The Designated
  579.         Router generates an    LSA for    the network and    has other
  580.         special responsibilities in    the running of the protocol.
  581.         The    Designated Router is elected by    the Hello Protocol.
  582.  
  583.         The    Designated Router concept enables a reduction in the
  584.         number of adjacencies required on a    broadcast or NBMA
  585.         network.  This in turn reduces the amount of routing
  586.         protocol traffic and the size of the link-state database.
  587.  
  588.     Lower-level protocols
  589.         The    underlying network access protocols that provide
  590.         services to    the Internet Protocol and in turn the OSPF
  591.         protocol.  Examples    of these are the X.25 packet and frame
  592.         levels for X.25 PDNs, and the ethernet data    link layer for
  593.         ethernets.
  594.  
  595.  
  596.     1.3.  Brief    history    of link-state routing technology
  597.  
  598.     OSPF is    a link state routing protocol.    Such protocols are also
  599.     referred to in the literature as SPF-based or distributed-
  600.     database protocols.  This section gives    a brief    description of
  601.     the developments in link-state technology that have influenced
  602.     the OSPF protocol.
  603.  
  604.     The first link-state routing protocol was developed for    use in
  605.     the ARPANET packet switching network.  This protocol is
  606.     described in [Ref3].  It has formed the    starting point for all
  607.     other link-state protocols.  The homogeneous ARPANET
  608.     environment, i.e., single-vendor packet    switches connected by
  609.     synchronous serial lines, simplified the design    and
  610.     implementation of the original protocol.
  611.  
  612.     Modifications to this protocol were proposed in    [Ref4].     These
  613.  
  614.  
  615.  
  616. Moy                                   [Page 11]
  617.  
  618. Internet Draft             OSPF Version 2            January 1997
  619.  
  620.  
  621.     modifications dealt with increasing the    fault tolerance    of the
  622.     routing    protocol through, among    other things, adding a checksum
  623.     to the LSAs (thereby detecting database    corruption).  The paper
  624.     also included means for    reducing the routing traffic overhead in
  625.     a link-state protocol.    This was accomplished by introducing
  626.     mechanisms which enabled the interval between LSA originations
  627.     to be increased    by an order of magnitude.
  628.  
  629.     A link-state algorithm has also    been proposed for use as an ISO
  630.     IS-IS routing protocol.     This protocol is described in [Ref2].
  631.     The protocol includes methods for data and routing traffic
  632.     reduction when operating over broadcast    networks.  This    is
  633.     accomplished by    election of a Designated Router    for each
  634.     broadcast network, which then originates an LSA    for the    network.
  635.  
  636.     The OSPF Working Group of the IETF has extended    this work in
  637.     developing the OSPF protocol.  The Designated Router concept has
  638.     been greatly enhanced to further reduce    the amount of routing
  639.     traffic    required.  Multicast capabilities are utilized for
  640.     additional routing bandwidth reduction.     An area routing scheme
  641.     has been developed enabling information
  642.     hiding/protection/reduction.  Finally, the algorithms have been
  643.     tailored for efficient operation in TCP/IP internets.
  644.  
  645.  
  646.     1.4.  Organization of this document
  647.  
  648.     The first three    sections of this specification give a general
  649.     overview of the    protocol's capabilities    and functions.    Sections
  650.     4-16 explain the protocol's mechanisms in detail.  Packet
  651.     formats, protocol constants and    configuration items are
  652.     specified in the appendices.
  653.  
  654.     Labels such as HelloInterval encountered in the    text refer to
  655.     protocol constants.  They may or may not be configurable.
  656.     Architectural constants    are summarized in Appendix B.
  657.     Configurable constants are summarized in Appendix C.
  658.  
  659.     The detailed specification of the protocol is presented    in terms
  660.     of data    structures.  This is done in order to make the
  661.     explanation more precise.  Implementations of the protocol are
  662.     required to support the    functionality described, but need not
  663.     use the    precise    data structures    that appear in this memo.
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672. Moy                                   [Page 12]
  673.  
  674. Internet Draft             OSPF Version 2            January 1997
  675.  
  676.  
  677.     1.5.  Acknowledgments
  678.  
  679.     The author would like to thank Ran Atkinson, Fred Baker, Jeffrey
  680.     Burgan,    Rob Coltun, Dino Farinacci, Vince Fuller, Phanindra
  681.     Jujjavarapu, Milo Medin, Tom Pusateri, Kannan Varadhan,    Zhaohui
  682.     Zhang and the rest of the OSPF Working Group for the ideas and
  683.     support    they have given    to this    project.
  684.  
  685.     The OSPF Point-to-MultiPoint interface is based    on work    done by
  686.     Fred Baker.
  687.  
  688.     The OSPF Cryptographic Authentication option was developed by
  689.     Fred Baker and Ran Atkinson.
  690.  
  691.  
  692. 2.  The    Link-state Database: organization and calculations
  693.  
  694.     The    following subsections describe the organization    of OSPF's link-
  695.     state database, and    the routing calculations that are performed on
  696.     the    database in order to produce a router's    routing    table.
  697.  
  698.  
  699.     2.1.  Representation of routers and    networks
  700.  
  701.     The Autonomous System's    link-state database describes a    directed
  702.     graph.    The vertices of    the graph consist of routers and
  703.     networks.  A graph edge    connects two routers when they are
  704.     attached via a physical    point-to-point network.     An edge
  705.     connecting a router to a network indicates that    the router has
  706.     an interface on    the network. Networks can be either transit or
  707.     stub networks. Transit networks    are those capable of carrying
  708.     data traffic that is neither locally originated    nor locally
  709.     destined. A transit network is represented by a    graph vertex
  710.     having both incoming and outgoing edges. A stub    network's vertex
  711.     has only incoming edges.
  712.  
  713.     The neighborhood of each network node in the graph depends on
  714.     the network's type (point-to-point, broadcast, NBMA or Point-
  715.     to-MultiPoint) and the number of routers having    an interface to
  716.     the network.  Three cases are depicted in Figure 1a.  Rectangles
  717.     indicate routers.  Circles and oblongs indicate    networks.
  718.     Router names are prefixed with the letters RT and network names
  719.     with the letter    N.  Router interface names are prefixed    by the
  720.     letter I.  Lines between routers indicate point-to-point
  721.     networks.  The left side of the    figure shows networks with their
  722.     connected routers, with    the resulting graphs shown on the right.
  723.  
  724.  
  725.  
  726.  
  727.  
  728. Moy                                   [Page 13]
  729.  
  730. Internet Draft             OSPF Version 2            January 1997
  731.  
  732.  
  733.  
  734.  
  735.  
  736.                           **FROM**
  737.  
  738.                        *      |RT1|RT2|
  739.         +---+Ia       +---+       *   ------------
  740.         |RT1|------|RT2|       T   RT1|   |    X |
  741.         +---+     Ib+---+       O   RT2| X |      |
  742.                        *    Ia|   |    X |
  743.                        *    Ib| X |      |
  744.  
  745.              Physical point-to-point networks
  746.  
  747.  
  748.                           **FROM**
  749.               +---+           *
  750.               |RT7|           *      |RT7|    N3|
  751.               +---+           T   ------------
  752.             |           O   RT7|   |      |
  753.         +----------------------+       *    N3| X |      |
  754.                N3           *
  755.  
  756.                   Stub networks
  757.  
  758.                           **FROM**
  759.         +---+       +---+
  760.         |RT3|       |RT4|          |RT3|RT4|RT5|RT6|N2 |
  761.         +---+       +---+    *  ------------------------
  762.           |    N2    |        *  RT3|      |   |      |   |    X |
  763.         +----------------------+    T  RT4|      |   |      |   |    X |
  764.           |         |        O  RT5|      |   |      |   |    X |
  765.         +---+       +---+    *  RT6|      |   |      |   |    X |
  766.         |RT5|       |RT6|    *   N2|    X | X |    X | X |      |
  767.         +---+       +---+
  768.  
  769.               Broadcast or NBMA networks
  770.  
  771.  
  772.  
  773.             Figure 1a: Network map components
  774.  
  775.          Networks and routers are represented by vertices.
  776.          An    edge connects Vertex A to Vertex B iff the
  777.          intersection of Column A and Row B    is marked with
  778.                   an X.
  779.  
  780.  
  781.  
  782.  
  783.  
  784. Moy                                   [Page 14]
  785.  
  786. Internet Draft             OSPF Version 2            January 1997
  787.  
  788.  
  789.     The top    of Figure 1a shows two routers connected by a point-to-
  790.     point link. In the resulting link-state    database graph,    the two
  791.     router vertices    are directly connected by a pair of edges, one
  792.     in each    direction. Interfaces to point-to-point    networks need
  793.     not be assigned    IP addresses.  When interface addresses    are
  794.     assigned, they are modelled as stub links, with    each router
  795.     advertising a stub connection to the other router's interface
  796.     address. Optionally, an    IP subnet can be assigned to the point-
  797.     to-point network. In this case,    both routers advertise a stub
  798.     link to    the IP subnet, instead of advertising each others' IP
  799.     interface addresses.
  800.  
  801.     The middle of Figure 1a    shows a    network    with only one attached
  802.     router (i.e., a    stub network). In this case, the network appears
  803.     on the end of a    stub connection    in the link-state database's
  804.     graph.
  805.  
  806.     When multiple routers are attached to a    broadcast network, the
  807.     link-state database graph shows    all routers bidirectionally
  808.     connected to the network vertex. This is pictured at the bottom
  809.     of Figure 1a.
  810.  
  811.     Each network (stub or transit) in the graph has    an IP address
  812.     and associated network mask.  The mask indicates the number of
  813.     nodes on the network.  Hosts attached directly to routers
  814.     (referred to as    host routes) appear on the graph as stub
  815.     networks.  The network mask for    a host route is    always
  816.     0xffffffff, which indicates the    presence of a single node.
  817.  
  818.  
  819.     2.1.1.    Representation of non-broadcast    networks
  820.  
  821.         As mentioned previously, OSPF can run over non-broadcast
  822.         networks in    one of two modes: NBMA or Point-to-MultiPoint.
  823.         The    choice of mode determines the way that the Hello
  824.         protocol and flooding work over the    non-broadcast network,
  825.         and    the way    that the network is represented    in the link-
  826.         state database.
  827.  
  828.         In NBMA mode, OSPF emulates    operation over a broadcast
  829.         network: a Designated Router is elected for    the NBMA
  830.         network, and the Designated    Router originates an LSA for the
  831.         network. The graph representation for broadcast networks and
  832.         NBMA networks is identical.    This representation is pictured
  833.         in the middle of Figure 1a.
  834.  
  835.         NBMA mode is the most efficient way    to run OSPF over non-
  836.         broadcast networks,    both in    terms of link-state database
  837.  
  838.  
  839.  
  840. Moy                                   [Page 15]
  841.  
  842. Internet Draft             OSPF Version 2            January 1997
  843.  
  844.  
  845.         size and in    terms of the amount of routing protocol    traffic.
  846.         However, it    has one    significant restriction: it requires all
  847.         routers attached to    the NBMA network to be able to
  848.         communicate    directly. This restriction may be met on some
  849.         non-broadcast networks, such as an ATM subnet utilizing
  850.         SVCs. But it is often not met on other non-broadcast
  851.         networks, such as PVC-only Frame Relay networks. On    non-
  852.         broadcast networks where not all routers can communicate
  853.         directly you can break the non-broadcast network into
  854.         logical subnets, with the routers on each subnet being able
  855.         to communicate directly, and then run each separate    subnet
  856.         as an NBMA network (see [Ref15]). This however requires
  857.         quite a bit    of administrative overhead, and    is prone to
  858.         misconfiguration. It is probably better to run such    a non-
  859.         broadcast network in Point-to-Multipoint mode.
  860.  
  861.         In Point-to-MultiPoint mode, OSPF treats all router-to-
  862.         router connections over the    non-broadcast network as if they
  863.         were point-to-point    links. No Designated Router is elected
  864.         for    the network, nor is there an LSA generated for the
  865.         network. In    fact, a    vertex for the Point-to-MultiPoint
  866.         network does not appear in the graph of the    link-state
  867.         database.
  868.  
  869.         Figure 1b illustrates the link-state database representation
  870.         of a Point-to-MultiPoint network. On the left side of the
  871.         figure, a Point-to-MultiPoint network is pictured. It is
  872.         assumed that all routers can communicate directly, except
  873.         for    routers    RT4 and    RT5. I3    though I6 indicate the routers'
  874.         IP interface addresses on the Point-to-MultiPoint network.
  875.         In the graphical representation of the link-state database,
  876.         routers that can communicate directly over the Point-to-
  877.         MultiPoint network are joined by bidirectional edges, and
  878.         each router    also has a stub    connection to its own IP
  879.         interface address (which is    in contrast to the
  880.         representation of real point-to-point links; see Figure 1a).
  881.  
  882.         On some non-broadcast networks, use    of Point-to-MultiPoint
  883.         mode and data-link protocols such as Inverse ARP (see
  884.         [Ref14]) will allow    autodiscovery of OSPF neighbors    even
  885.         though broadcast support is    not available.
  886.  
  887.  
  888.  
  889.     2.1.2.    An example link-state database
  890.  
  891.         Figure 2 shows a sample map    of an Autonomous System.  The
  892.         rectangle labelled H1 indicates a host, which has a    SLIP
  893.  
  894.  
  895.  
  896. Moy                                   [Page 16]
  897.  
  898. Internet Draft             OSPF Version 2            January 1997
  899.  
  900.  
  901.  
  902.  
  903.                           **FROM**
  904.         +---+       +---+
  905.         |RT3|       |RT4|          |RT3|RT4|RT5|RT6|
  906.         +---+       +---+    *  --------------------
  907.         I3|    N2    |I4    *  RT3|      | X |    X | X |
  908.         +----------------------+    T  RT4|    X |   |      | X |
  909.         I5|         |I6    O  RT5|    X |   |      | X |
  910.         +---+       +---+    *  RT6|    X | X |    X |   |
  911.         |RT5|       |RT6|    *   I3|    X |   |      |   |
  912.         +---+       +---+        I4|      | X |      |   |
  913.                         I5|      |   |    X |   |
  914.                         I6|      |   |      | X |
  915.  
  916.  
  917.  
  918.             Figure 1b: Network map components
  919.                Point-to-MultiPoint networks
  920.  
  921.          All routers can communicate directly over N2, except
  922.         routers    RT4 and    RT5. I3    through    I6 indicate IP
  923.                interface addresses
  924.  
  925.  
  926.         connection to Router RT12.    Router RT12 is therefore
  927.         advertising    a host route.  Lines between routers indicate
  928.         physical point-to-point networks.  The only    point-to-point
  929.         network that has been assigned interface addresses is the
  930.         one    joining    Routers    RT6 and    RT10.  Routers RT5 and RT7 have
  931.         BGP    connections to other Autonomous    Systems.  A set    of BGP-
  932.         learned routes have    been displayed for both    of these
  933.         routers.
  934.  
  935.         A cost is associated with the output side of each router
  936.         interface.    This cost is configurable by the system
  937.         administrator.  The    lower the cost,    the more likely    the
  938.         interface is to be used to forward data traffic.  Costs are
  939.         also associated with the externally    derived    routing    data
  940.         (e.g., the BGP-learned routes).
  941.  
  942.         The    directed graph resulting from the map in Figure    2 is
  943.         depicted in    Figure 3.  Arcs    are labelled with the cost of
  944.         the    corresponding router output interface.    Arcs having no
  945.         labelled cost have a cost of 0.  Note that arcs leading from
  946.         networks to    routers    always have cost 0; they are significant
  947.         nonetheless.  Note also that the externally    derived    routing
  948.         data appears on the    graph as stubs.
  949.  
  950.  
  951.  
  952. Moy                                   [Page 17]
  953.  
  954. Internet Draft             OSPF Version 2            January 1997
  955.  
  956.  
  957.  
  958.          +
  959.          | 3+---+              N12      N14
  960.            N1|--|RT1|\ 1            \ N13 /
  961.          |  +---+ \            8\ |8/8
  962.          +       \ ____          \|/
  963.                 /     \   1+---+8    8+---+6
  964.                *  N3  *---|RT4|------|RT5|--------+
  965.                 \____/    +---+     +---+          |
  966.           +        /    |           |7          |
  967.           | 3+---+ /    |           |          |
  968.         N2|--|RT2|/1    |1           |6          |
  969.           |  +---+    +---+8        6+---+          |
  970.           +          |RT3|--------------|RT6|          |
  971.                   +---+         +---+          |
  972.                 |2         Ia|7          |
  973.                 |           |          |
  974.                +---------+           |          |
  975.                    N4           |          |
  976.                            |          |
  977.                            |          |
  978.                N11               |          |
  979.            +---------+               |          |
  980.             |               |          |       N12
  981.             |3               |          |6 2/
  982.               +---+               |        +---+/
  983.               |RT9|               |        |RT7|---N15
  984.               +---+               |        +---+ 9
  985.             |1             +       |          |1
  986.                _|__             |     Ib|5        __|_
  987.               /       \      1+----+2   |    3+----+1   /    \
  988.              *    N9  *------|RT11|----|---|RT10|---*  N6     *
  989.               \____/       +----+    |     +----+       \____/
  990.             |             |              |
  991.             |1             +              |1
  992.          +--+   10+----+            N8            +---+
  993.          |H1|-----|RT12|                    |RT8|
  994.          +--+SLIP +----+                    +---+
  995.             |2                      |4
  996.             |                      |
  997.            +---------+                  +--------+
  998.                N10                      N7
  999.  
  1000.             Figure 2: A    sample Autonomous System
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008. Moy                                   [Page 18]
  1009.  
  1010. Internet Draft             OSPF Version 2            January 1997
  1011.  
  1012.  
  1013.                 **FROM**
  1014.  
  1015.          |RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|RT|
  1016.          |1 |2 |3 |4 |5    |6 |7 |8 |9 |10|11|12|N3|N6|N8|N9|
  1017.           ----- ---------------------------------------------
  1018.           RT1|  |  |  |  |    |  |  |     |  |  |  |  |0    |  |  |     |
  1019.           RT2|  |  |  |  |    |  |  |     |  |  |  |  |0    |  |  |     |
  1020.           RT3|  |  |  |  |    |6 |  |     |  |  |  |  |0    |  |  |     |
  1021.           RT4|  |  |  |  |8    |  |  |     |  |  |  |  |0    |  |  |     |
  1022.           RT5|  |  |  |8 |    |6 |6 |     |  |  |  |  |    |  |  |     |
  1023.           RT6|  |  |8 |  |7    |  |  |     |  |5 |  |  |    |  |  |     |
  1024.           RT7|  |  |  |  |6    |  |  |     |  |  |  |  |    |0 |  |     |
  1025.       *   RT8|  |  |  |  |    |  |  |     |  |  |  |  |    |0 |  |     |
  1026.       *   RT9|  |  |  |  |    |  |  |     |  |  |  |  |    |  |  |0 |
  1027.       T  RT10|  |  |  |  |    |7 |  |     |  |  |  |  |    |0 |0 |     |
  1028.       O  RT11|  |  |  |  |    |  |  |     |  |  |  |  |    |  |0 |0 |
  1029.       *  RT12|  |  |  |  |    |  |  |     |  |  |  |  |    |  |  |0 |
  1030.       *    N1|3 |  |  |  |    |  |  |     |  |  |  |  |    |  |  |     |
  1031.            N2|  |3 |  |  |    |  |  |     |  |  |  |  |    |  |  |     |
  1032.            N3|1 |1 |1 |1 |    |  |  |     |  |  |  |  |    |  |  |     |
  1033.            N4|  |  |2 |  |    |  |  |     |  |  |  |  |    |  |  |     |
  1034.            N6|  |  |  |  |    |  |1 |1 |  |1 |  |  |    |  |  |     |
  1035.            N7|  |  |  |  |    |  |  |4 |  |  |  |  |    |  |  |     |
  1036.            N8|  |  |  |  |    |  |  |     |  |3 |2 |  |    |  |  |     |
  1037.            N9|  |  |  |  |    |  |  |     |1 |  |1 |1 |    |  |  |     |
  1038.           N10|  |  |  |  |    |  |  |     |  |  |  |2 |    |  |  |     |
  1039.           N11|  |  |  |  |    |  |  |     |3 |  |  |  |    |  |  |     |
  1040.           N12|  |  |  |  |8    |  |2 |     |  |  |  |  |    |  |  |     |
  1041.           N13|  |  |  |  |8    |  |  |     |  |  |  |  |    |  |  |     |
  1042.           N14|  |  |  |  |8    |  |  |     |  |  |  |  |    |  |  |     |
  1043.           N15|  |  |  |  |    |  |9 |     |  |  |  |  |    |  |  |     |
  1044.            H1|  |  |  |  |    |  |  |     |  |  |  |10|    |  |  |     |
  1045.  
  1046.  
  1047.              Figure 3: The resulting directed graph
  1048.  
  1049.          Networks and routers are represented by vertices.
  1050.          An edge of cost X connects Vertex A to    Vertex B iff
  1051.          the intersection of Column A and Row B    is marked
  1052.                      with an X.
  1053.  
  1054.         The    link-state database is pieced together from LSAs
  1055.         generated by the routers.  In the associated graphical
  1056.         representation, the    neighborhood of    each router or transit
  1057.         network is represented in a    single,    separate LSA.  Figure 4
  1058.         shows these    LSAs graphically. Router RT12 has an interface
  1059.         to two broadcast networks and a SLIP line to a host.
  1060.         Network N6 is a broadcast network with three attached
  1061.  
  1062.  
  1063.  
  1064. Moy                                   [Page 19]
  1065.  
  1066. Internet Draft             OSPF Version 2            January 1997
  1067.  
  1068.  
  1069.         routers.  The cost of all links from Network N6 to its
  1070.         attached routers is    0.  Note that the LSA for Network N6 is
  1071.         actually generated by one of the network's attached    routers:
  1072.         the    router that has    been elected Designated    Router for the
  1073.         network.
  1074.  
  1075.     2.2.  The shortest-path tree
  1076.  
  1077.     When no    OSPF areas are configured, each    router in the Autonomous
  1078.     System has an identical    link-state database, leading to    an
  1079.     identical graphical representation.  A router generates    its
  1080.     routing    table from this    graph by calculating a tree of shortest
  1081.     paths with the router itself as    root.  Obviously, the shortest-
  1082.     path tree depends on the router    doing the calculation.    The
  1083.     shortest-path tree for Router RT6 in our example is depicted in
  1084.     Figure 5.
  1085.  
  1086.     The tree gives the entire path to any destination network or
  1087.     host.  However,    only the next hop to the destination is    used in
  1088.     the forwarding process.     Note also that    the best route to any
  1089.     router has also    been calculated.  For the processing of    external
  1090.     data, we note the next hop and distance    to any router
  1091.     advertising external routes.  The resulting routing table for
  1092.     Router RT6 is pictured in Table    2.  Note that there is a
  1093.     separate route for each    end of a numbered point-to-point network
  1094.     (in this case, the serial line between Routers RT6 and RT10).
  1095.  
  1096.  
  1097.  
  1098.              **FROM**                **FROM**
  1099.  
  1100.           |RT12|N9|N10|H1|           |RT9|RT11|RT12|N9|
  1101.        *  --------------------        *  ----------------------
  1102.        *  RT12|    |  |   |     |        *    RT9|   |    |     |0 |
  1103.        T    N9|1   |  |   |     |        T  RT11|   |    |     |0 |
  1104.        O   N10|2   |  |   |     |        O  RT12|   |    |     |0 |
  1105.        *    H1|10  |  |   |     |        *     N9|   |    |     |  |
  1106.        *                    *
  1107.         RT12's router-LSA           N9's network-LSA
  1108.  
  1109.           Figure 4: Individual link state components
  1110.  
  1111.           Networks and routers are represented by vertices.
  1112.           An edge of cost X    connects Vertex    A to Vertex B iff
  1113.           the intersection of Column A and Row B is    marked
  1114.                   with an X.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120. Moy                                   [Page 20]
  1121.  
  1122. Internet Draft             OSPF Version 2            January 1997
  1123.  
  1124.  
  1125.  
  1126.                 RT6(origin)
  1127.             RT5    o------------o-----------o Ib
  1128.                /|\    6         |\        7
  1129.              8/8|8\         | \
  1130.              /    |  \        6|    \
  1131.             o    |   o         |     \7
  1132.            N12    o  N14         |      \
  1133.                N13      2  |       \
  1134.                 N4 o-----o RT3  \
  1135.                     /         \      5
  1136.                   1/     RT10 o-------o    Ia
  1137.                   /          |\
  1138.                RT4 o-----o N3         3|    \1
  1139.                 /|          |     \ N6      RT7
  1140.                    / |       N8 o      o---------o
  1141.                   /     |          |      |       /|
  1142.              RT2 o     o RT1          |      |     2/ |9
  1143.                 /     |          |      |RT8     /  |
  1144.                /3     |3     RT11 o      o    o   o
  1145.               /     |          |      |    N12 N15
  1146.               N2 o     o N1         1|      |4
  1147.                           |      |
  1148.                        N9 o      o N7
  1149.                          /|
  1150.                         / |
  1151.             N11     RT9       /  |RT12
  1152.              o--------o-------o   o--------o H1
  1153.                  3              |      10
  1154.                           |2
  1155.                           |
  1156.                           o    N10
  1157.  
  1158.  
  1159.              Figure 5: The SPF tree for    Router RT6
  1160.  
  1161.           Edges that are not marked    with a cost have a cost    of
  1162.           of zero (these are network-to-router links). Routes
  1163.           to networks N12-N15 are external information that    is
  1164.              considered in Section 2.3
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176. Moy                                   [Page 21]
  1177.  
  1178. Internet Draft             OSPF Version 2            January 1997
  1179.  
  1180.  
  1181.            Destination     Next  Hop   Distance
  1182.            __________________________________
  1183.            N1         RT3         10
  1184.            N2         RT3         10
  1185.            N3         RT3         7
  1186.            N4         RT3         8
  1187.            Ib         *         7
  1188.            Ia         RT10         12
  1189.            N6         RT10         8
  1190.            N7         RT10         12
  1191.            N8         RT10         10
  1192.            N9         RT10         11
  1193.            N10         RT10         13
  1194.            N11         RT10         14
  1195.            __________________________________
  1196.            RT5         RT5         6
  1197.            RT7         RT10         8
  1198.  
  1199.  
  1200.     Table 2: The portion of Router RT6's routing table listing local
  1201.                  destinations.
  1202.  
  1203.     Routes to networks belonging to    other AS'es (such as N12) appear
  1204.     as dashed lines    on the shortest    path tree in Figure 5.    Use of
  1205.     this externally    derived    routing    information is considered in the
  1206.     next section.
  1207.  
  1208.  
  1209.     2.3.  Use of external routing information
  1210.  
  1211.     After the tree is created the external routing information is
  1212.     examined.  This    external routing information may originate from
  1213.     another    routing    protocol such as BGP, or be statically
  1214.     configured (static routes).  Default routes can    also be    included
  1215.     as part    of the Autonomous System's external routing information.
  1216.  
  1217.     External routing information is    flooded    unaltered throughout the
  1218.     AS.  In    our example, all the routers in    the Autonomous System
  1219.     know that Router RT7 has two external routes, with metrics 2 and
  1220.     9.
  1221.  
  1222.     OSPF supports two types    of external metrics.  Type 1 external
  1223.     metrics    are expressed in the same units    as OSPF    interface cost
  1224.     (i.e., in terms    of the link state metric).  Type 2 external
  1225.     metrics    are an order of    magnitude larger; any Type 2 metric is
  1226.     considered greater than    the cost of any    path internal to the AS.
  1227.     Use of Type 2 external metrics assumes that routing between
  1228.     AS'es is the major cost    of routing a packet, and eliminates the
  1229.  
  1230.  
  1231.  
  1232. Moy                                   [Page 22]
  1233.  
  1234. Internet Draft             OSPF Version 2            January 1997
  1235.  
  1236.  
  1237.     need for conversion of external    costs to internal link state
  1238.     metrics.
  1239.  
  1240.     As an example of Type 1    external metric    processing, suppose that
  1241.     the Routers RT7    and RT5    in Figure 2 are    advertising Type 1
  1242.     external metrics.  For each advertised external    route, the total
  1243.     cost from Router RT6 is    calculated as the sum of the external
  1244.     route's    advertised cost    and the    distance from Router RT6 to the
  1245.     advertising router.  When two routers are advertising the same
  1246.     external destination, RT6 picks    the advertising    router providing
  1247.     the minimum total cost.    RT6 then sets the next hop to the
  1248.     external destination equal to the next hop that    would be used
  1249.     when routing packets to    the chosen advertising router.
  1250.  
  1251.     In Figure 2, both Router RT5 and RT7 are advertising an    external
  1252.     route to destination Network N12.  Router RT7 is preferred since
  1253.     it is advertising N12 at a distance of 10 (8+2)    to Router RT6,
  1254.     which is better    than Router RT5's 14 (6+8).  Table 3 shows the
  1255.     entries    that are added to the routing table when external routes
  1256.     are examined:
  1257.  
  1258.  
  1259.  
  1260.              Destination   Next  Hop   Distance
  1261.              __________________________________
  1262.              N12           RT10       10
  1263.              N13           RT5       14
  1264.              N14           RT5       14
  1265.              N15           RT10       17
  1266.  
  1267.  
  1268.          Table 3: The portion of Router    RT6's routing table
  1269.                listing external destinations.
  1270.  
  1271.  
  1272.     Processing of Type 2 external metrics is simpler.  The AS
  1273.     boundary router    advertising the    smallest external metric is
  1274.     chosen,    regardless of the internal distance to the AS boundary
  1275.     router.     Suppose in our    example    both Router RT5    and Router RT7
  1276.     were advertising Type 2    external routes.  Then all traffic
  1277.     destined for Network N12 would be forwarded to Router RT7, since
  1278.     2 < 8.    When several equal-cost    Type 2 routes exist, the
  1279.     internal distance to the advertising routers is    used to    break
  1280.     the tie.
  1281.  
  1282.     Both Type 1 and    Type 2 external    metrics    can be present in the AS
  1283.     at the same time.  In that event, Type 1 external metrics always
  1284.     take precedence.
  1285.  
  1286.  
  1287.  
  1288. Moy                                   [Page 23]
  1289.  
  1290. Internet Draft             OSPF Version 2            January 1997
  1291.  
  1292.  
  1293.     This section has assumed that packets destined for external
  1294.     destinations are always    routed through the advertising AS
  1295.     boundary router.  This is not always desirable.     For example,
  1296.     suppose    in Figure 2 there is an    additional router attached to
  1297.     Network    N6, called Router RTX.    Suppose    further    that RTX does
  1298.     not participate    in OSPF    routing, but does exchange BGP
  1299.     information with the AS    boundary router    RT7.  Then, Router RT7
  1300.     would end up advertising OSPF external routes for all
  1301.     destinations that should be routed to RTX.  An extra hop will
  1302.     sometimes be introduced    if packets for these destinations need
  1303.     always be routed first to Router RT7 (the advertising router).
  1304.  
  1305.     To deal    with this situation, the OSPF protocol allows an AS
  1306.     boundary router    to specify a "forwarding address" in its AS-
  1307.     external-LSAs.    In the above example, Router RT7 would specify
  1308.     RTX's IP address as the    "forwarding address" for all those
  1309.     destinations whose packets should be routed directly to    RTX.
  1310.  
  1311.     The "forwarding    address" has one other application.  It    enables
  1312.     routers    in the Autonomous System's interior to function    as
  1313.     "route servers".  For example, in Figure 2 the router RT6 could
  1314.     become a route server, gaining external    routing    information
  1315.     through    a combination of static    configuration and external
  1316.     routing    protocols.  RT6    would then start advertising itself as
  1317.     an AS boundary router, and would originate a collection    of OSPF
  1318.     AS-external-LSAs.  In each AS-external-LSA, Router RT6 would
  1319.     specify    the correct Autonomous System exit point to use    for the
  1320.     destination through appropriate    setting    of the LSA's "forwarding
  1321.     address" field.
  1322.  
  1323.  
  1324.     2.4.  Equal-cost multipath
  1325.  
  1326.     The above discussion has been simplified by considering    only a
  1327.     single route to    any destination.  In reality, if multiple
  1328.     equal-cost routes to a destination exist, they are all
  1329.     discovered and used.  This requires no conceptual changes to the
  1330.     algorithm, and its discussion is postponed until we consider the
  1331.     tree-building process in more detail.
  1332.  
  1333.     With equal cost    multipath, a router potentially    has several
  1334.     available next hops towards any    given destination.
  1335.  
  1336.  
  1337.     2.5.  TOS-based routing
  1338.  
  1339.     OSPF can calculate a separate set of routes for    each IP    Type of
  1340.     Service. This means that, for any destination, there can
  1341.  
  1342.  
  1343.  
  1344. Moy                                   [Page 24]
  1345.  
  1346. Internet Draft             OSPF Version 2            January 1997
  1347.  
  1348.  
  1349.     potentially be multiple    routing    table entries, one for each IP
  1350.     TOS. The IP TOS    values are represented in OSPF exactly as they
  1351.     appear in the IP packet    header.
  1352.  
  1353.     Up to this point, all examples shown have assumed that routes do
  1354.     not vary on TOS.  In order to differentiate routes based on TOS,
  1355.     separate interface costs can be    configured for each TOS.  For
  1356.     example, in Figure 2 there could be multiple costs (one    for each
  1357.     TOS) listed for    each interface.     A cost    for TOS    0 must always be
  1358.     specified.
  1359.  
  1360.     When interface costs vary based    on TOS,    a separate shortest path
  1361.     tree is    calculated for each TOS    (see Section 2.2).  In addition,
  1362.     external costs can vary    based on TOS.  For example, in Figure 2
  1363.     Router RT7 could advertise a separate type 1 external metric for
  1364.     each TOS.  Then, when calculating the TOS X distance to    Network
  1365.     N15 the    cost of    the shortest TOS X path    to RT7 would be    added to
  1366.     the TOS    X cost advertised by RT7 for Network N15 (see Section
  1367.     2.3).
  1368.  
  1369.     All OSPF implementations must be capable of calculating    routes
  1370.     based on TOS.  However,    OSPF routers can be configured to route
  1371.     all packets on the TOS 0 path (see Appendix C),    eliminating the
  1372.     need to    calculate non-zero TOS paths.  This can    be used    to
  1373.     conserve routing table space and processing resources in the
  1374.     router.     These TOS-0-only routers can be mixed with routers that
  1375.     do route based on TOS.    TOS-0-only routers will    be avoided as
  1376.     much as    possible when forwarding traffic requesting a non-zero
  1377.     TOS.
  1378.  
  1379.     It may be the case that    no path    exists for some    non-zero TOS,
  1380.     even if    the router is calculating non-zero TOS paths.  In that
  1381.     case, packets requesting that non-zero TOS are routed along the
  1382.     TOS 0 path (see    Section    11.1).
  1383.  
  1384.  
  1385. 3.  Splitting the AS into Areas
  1386.  
  1387.     OSPF allows    collections of contiguous networks and hosts to    be
  1388.     grouped together.  Such a group, together with the routers having
  1389.     interfaces to any one of the included networks, is called an area.
  1390.     Each area runs a separate copy of the basic    link-state routing
  1391.     algorithm.    This means that    each area has its own link-state
  1392.     database and corresponding graph, as explained in the previous
  1393.     section.
  1394.  
  1395.     The    topology of an area is invisible from the outside of the area.
  1396.     Conversely,    routers    internal to a given area know nothing of the
  1397.  
  1398.  
  1399.  
  1400. Moy                                   [Page 25]
  1401.  
  1402. Internet Draft             OSPF Version 2            January 1997
  1403.  
  1404.  
  1405.     detailed topology external to the area.  This isolation of knowledge
  1406.     enables the    protocol to effect a marked reduction in routing traffic
  1407.     as compared    to treating the    entire Autonomous System as a single
  1408.     link-state domain.
  1409.  
  1410.     With the introduction of areas, it is no longer true that all
  1411.     routers in the AS have an identical    link-state database.  A    router
  1412.     actually has a separate link-state database    for each area it is
  1413.     connected to.  (Routers connected to multiple areas    are called area
  1414.     border routers).  Two routers belonging to the same    area have, for
  1415.     that area, identical area link-state databases.
  1416.  
  1417.     Routing in the Autonomous System takes place on two    levels,
  1418.     depending on whether the source and    destination of a packet    reside
  1419.     in the same    area (intra-area routing is used) or different areas
  1420.     (inter-area    routing    is used).  In intra-area routing, the packet is
  1421.     routed solely on information obtained within the area; no routing
  1422.     information    obtained from outside the area can be used.  This
  1423.     protects intra-area    routing    from the injection of bad routing
  1424.     information.  We discuss inter-area    routing    in Section 3.2.
  1425.  
  1426.  
  1427.     3.1.  The backbone of the Autonomous System
  1428.  
  1429.     The OSPF backbone is the special OSPF Area 0 (often written as
  1430.     Area 0.0.0.0, since OSPF Area ID's are typically formatted as IP
  1431.     addresses). The    OSPF backbone always contains all area border
  1432.     routers. The backbone is responsible for distributing routing
  1433.     information between non-backbone areas.    The backbone must be
  1434.     contiguous. However, it    need not be physically contiguous;
  1435.     backbone connectivity can be established/maintained through the
  1436.     configuration of virtual links.
  1437.  
  1438.     Virtual    links can be configured    between    any two    backbone routers
  1439.     that have an interface to a common non-backbone    area.  Virtual
  1440.     links belong to    the backbone.  The protocol treats two routers
  1441.     joined by a virtual link as if they were connected by an
  1442.     unnumbered point-to-point backbone network.  On    the graph of the
  1443.     backbone, two such routers are joined by arcs whose costs are
  1444.     the intra-area distances between the two routers.  The routing
  1445.     protocol traffic that flows along the virtual link uses    intra-
  1446.     area routing only.
  1447.  
  1448.  
  1449.     3.2.  Inter-area routing
  1450.  
  1451.     When routing a packet between two non-backbone areas the
  1452.     backbone is used.  The path that the packet will travel    can be
  1453.  
  1454.  
  1455.  
  1456. Moy                                   [Page 26]
  1457.  
  1458. Internet Draft             OSPF Version 2            January 1997
  1459.  
  1460.  
  1461.     broken up into three contiguous    pieces:    an intra-area path from
  1462.     the source to an area border router, a backbone    path between the
  1463.     source and destination areas, and then another intra-area path
  1464.     to the destination.  The algorithm finds the set of such paths
  1465.     that have the smallest cost.
  1466.  
  1467.     Looking    at this    another    way, inter-area    routing    can be pictured
  1468.     as forcing a star configuration    on the Autonomous System, with
  1469.     the backbone as    hub and    each of    the non-backbone areas as
  1470.     spokes.
  1471.  
  1472.     The topology of    the backbone dictates the backbone paths used
  1473.     between    areas.    The topology of    the backbone can be enhanced by
  1474.     adding virtual links.  This gives the system administrator some
  1475.     control    over the routes    taken by inter-area traffic.
  1476.  
  1477.     The correct area border    router to use as the packet exits the
  1478.     source area is chosen in exactly the same way routers
  1479.     advertising external routes are    chosen.     Each area border router
  1480.     in an area summarizes for the area its cost to all networks
  1481.     external to the    area.  After the SPF tree is calculated    for the
  1482.     area, routes to    all inter-area destinations are    calculated by
  1483.     examining the summaries    of the area border routers.
  1484.  
  1485.  
  1486.     3.3.  Classification of routers
  1487.  
  1488.     Before the introduction    of areas, the only OSPF    routers    having a
  1489.     specialized function were those    advertising external routing
  1490.     information, such as Router RT5    in Figure 2.  When the AS is
  1491.     split into OSPF    areas, the routers are further divided according
  1492.     to function into the following four overlapping    categories:
  1493.  
  1494.  
  1495.     Internal routers
  1496.         A router with all directly connected networks belonging to
  1497.         the    same area. These routers run a single copy of the basic
  1498.         routing algorithm.
  1499.  
  1500.     Area border routers
  1501.         A router that attaches to multiple areas.  Area border
  1502.         routers run    multiple copies    of the basic algorithm,    one copy
  1503.         for    each attached area. Area border    routers    condense the
  1504.         topological    information of their attached areas for
  1505.         distribution to the    backbone.  The backbone    in turn
  1506.         distributes    the information    to the other areas.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512. Moy                                   [Page 27]
  1513.  
  1514. Internet Draft             OSPF Version 2            January 1997
  1515.  
  1516.  
  1517.     Backbone routers
  1518.         A router that has an interface to the backbone area.  This
  1519.         includes all routers that interface    to more    than one area
  1520.         (i.e., area    border routers).  However, backbone routers do
  1521.         not    have to    be area    border routers.     Routers with all
  1522.         interfaces connecting to the backbone area are supported.
  1523.  
  1524.     AS boundary routers
  1525.         A router that exchanges routing information    with routers
  1526.         belonging to other Autonomous Systems.  Such a router
  1527.         advertises AS external routing information throughout the
  1528.         Autonomous System.    The paths to each AS boundary router are
  1529.         known by every router in the AS.  This classification is
  1530.         completely independent of the previous classifications: AS
  1531.         boundary routers may be internal or    area border routers, and
  1532.         may    or may not participate in the backbone.
  1533.  
  1534.  
  1535.     3.4.  A sample area    configuration
  1536.  
  1537.     Figure 6 shows a sample    area configuration.  The first area
  1538.     consists of networks N1-N4, along with their attached routers
  1539.     RT1-RT4.  The second area consists of networks N6-N8, along with
  1540.     their attached routers RT7, RT8, RT10 and RT11.     The third area
  1541.     consists of networks N9-N11 and    Host H1, along with their
  1542.     attached routers RT9, RT11 and RT12.  The third    area has been
  1543.     configured so that networks N9-N11 and Host H1 will all    be
  1544.     grouped    into a single route, when advertised external to the
  1545.     area (see Section 3.5 for more details).
  1546.  
  1547.     In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are
  1548.     internal routers.  Routers RT3,    RT4, RT7, RT10 and RT11    are area
  1549.     border routers.     Finally, as before, Routers RT5 and RT7 are AS
  1550.     boundary routers.
  1551.  
  1552.     Figure 7 shows the resulting link-state    database for the Area 1.
  1553.     The figure completely describes    that area's intra-area routing.
  1554.     It also    shows the complete view    of the internet    for the    two
  1555.     internal routers RT1 and RT2.  It is the job of    the area border
  1556.     routers, RT3 and RT4, to advertise into    Area 1 the distances to
  1557.     all destinations external to the area.    These are indicated in
  1558.     Figure 7 by the    dashed stub routes.  Also, RT3 and RT4 must
  1559.     advertise into Area 1 the location of the AS boundary routers
  1560.     RT5 and    RT7.  Finally, AS-external-LSAs    from RT5 and RT7 are
  1561.     flooded    throughout the entire AS, and in particular throughout
  1562.     Area 1.     These LSAs are    included in Area 1's database, and yield
  1563.     routes to Networks N12-N15.
  1564.  
  1565.  
  1566.  
  1567.  
  1568. Moy                                   [Page 28]
  1569.  
  1570. Internet Draft             OSPF Version 2            January 1997
  1571.  
  1572.  
  1573.  
  1574.          ...........................
  1575.          .     +               .
  1576.          .     | 3+---+           .      N12      N14
  1577.          . N1|--|RT1|\ 1           .    \ N13 /
  1578.          .     |  +---+ \           .    8\ |8/8
  1579.          .     +       \ ____      .      \|/
  1580.          .            /     \   1+---+8    8+---+6
  1581.          .           *  N3  *---|RT4|------|RT5|--------+
  1582.          .            \____/    +---+     +---+          |
  1583.          .      +        /       \   .       |7          |
  1584.          .      | 3+---+ /        \  .       |          |
  1585.          .    N2|--|RT2|/1        1\ .       |6          |
  1586.          .      |  +---+          +---+8    6+---+          |
  1587.          .      +              |RT3|------|RT6|          |
  1588.          .                  +---+     +---+          |
  1589.          .                2/ .     Ia|7          |
  1590.          .                /  .       |          |
  1591.          .           +---------+ .       |          |
  1592.          .Area 1           N4      .       |          |
  1593.          ...........................       |          |
  1594.       ..........................           |          |
  1595.       .           N11       .           |          |
  1596.       .       +---------+       .           |          |
  1597.       .        |       .           |          |       N12
  1598.       .        |3       .         Ib|5          |6 2/
  1599.       .          +---+       .         +----+        +---+/
  1600.       .          |RT9|       .    .........|RT10|.....|RT7|---N15.
  1601.       .          +---+       .    .     +----+        +---+ 9    .
  1602.       .        |1       .    .    +    /3    1\      |1       .
  1603.       .           _|__       .    .    | /    \   __|_       .
  1604.       .          /       \      1+----+2   |/         \ /    \      .
  1605.       .         *    N9  *------|RT11|----|          *  N6     *     .
  1606.       .          \____/       +----+    |           \____/      .
  1607.       .        |       .    .    |              |           .
  1608.       .        |1       .    .    +              |1       .
  1609.       .  +--+   10+----+       .    .   N8            +---+      .
  1610.       .  |H1|-----|RT12|       .    .            |RT8|      .
  1611.       .  +--+SLIP +----+       .    .            +---+      .
  1612.       .        |2       .    .              |4       .
  1613.       .        |       .    .              |           .
  1614.       .       +---------+       .    .          +--------+   .
  1615.       .           N10       .    .              N7       .
  1616.       .               .    .Area 2                   .
  1617.       .Area    3           .    ................................
  1618.       ..........................
  1619.  
  1620.             Figure 6: A    sample OSPF area configuration
  1621.  
  1622.  
  1623.  
  1624. Moy                                   [Page 29]
  1625.  
  1626. Internet Draft             OSPF Version 2            January 1997
  1627.  
  1628.  
  1629.     Routers    RT3 and    RT4 must also summarize    Area 1's topology for
  1630.     distribution to    the backbone.  Their backbone LSAs are shown in
  1631.     Table 4.  These    summaries show which networks are contained in
  1632.     Area 1 (i.e., Networks N1-N4), and the distance    to these
  1633.     networks from the routers RT3 and RT4 respectively.
  1634.  
  1635.  
  1636.     The link-state database    for the    backbone is shown in Figure 8.
  1637.     The set    of routers pictured are    the backbone routers.  Router
  1638.     RT11 is    a backbone router because it belongs to    two areas.  In
  1639.     order to make the backbone connected, a    virtual    link has been
  1640.     configured between Routers R10 and R11.
  1641.  
  1642.     The area border    routers    RT3, RT4, RT7, RT10 and    RT11 condense
  1643.     the routing information    of their attached non-backbone areas for
  1644.     distribution via the backbone; these are the dashed stubs that
  1645.     appear in Figure 8.  Remember that the third area has been
  1646.     configured to condense Networks    N9-N11 and Host    H1 into    a single
  1647.     route.    This yields a single dashed line for networks N9-N11 and
  1648.     Host H1    in Figure 8.  Routers RT5 and RT7 are AS boundary
  1649.     routers; their externally derived information also appears on
  1650.     the graph in Figure 8 as stubs.
  1651.  
  1652.     The backbone enables the exchange of summary information between
  1653.     area border routers.  Every area border    router hears the area
  1654.     summaries from all other area border routers.  It then forms a
  1655.     picture    of the distance    to all networks    outside    of its area by
  1656.     examining the collected    LSAs, and adding in the    backbone
  1657.     distance to each advertising router.
  1658.  
  1659.     Again using Routers RT3    and RT4    as an example, the procedure
  1660.     goes as    follows: They first calculate the SPF tree for the
  1661.     backbone.  This    gives the distances to all other area border
  1662.     routers.  Also noted are the distances to networks (Ia and Ib)
  1663.     and AS boundary    routers    (RT5 and RT7) that belong to the
  1664.     backbone.  This    calculation is shown in    Table 5.
  1665.  
  1666.  
  1667.              Network   RT3 adv.      RT4 adv.
  1668.              _____________________________
  1669.              N1           4      4
  1670.              N2           4      4
  1671.              N3           1      1
  1672.              N4           2      3
  1673.  
  1674.           Table 4: Networks    advertised to the backbone
  1675.             by Routers RT3 and RT4.
  1676.  
  1677.  
  1678.  
  1679.  
  1680. Moy                                   [Page 30]
  1681.  
  1682. Internet Draft             OSPF Version 2            January 1997
  1683.  
  1684.  
  1685.  
  1686.                    **FROM**
  1687.  
  1688.               |RT|RT|RT|RT|RT|RT|
  1689.               |1 |2    |3 |4 |5 |7 |N3|
  1690.                ----- -------------------
  1691.                RT1|  |    |  |  |     |  |0 |
  1692.                RT2|  |    |  |  |     |  |0 |
  1693.                RT3|  |    |  |  |     |  |0 |
  1694.            *   RT4|  |    |  |  |     |  |0 |
  1695.            *   RT5|  |    |14|8 |     |  |  |
  1696.            T   RT7|  |    |20|14|     |  |  |
  1697.            O    N1|3 |    |  |  |     |  |  |
  1698.            *    N2|  |3    |  |  |     |  |  |
  1699.            *    N3|1 |1    |1 |1 |     |  |  |
  1700.             N4|  |    |2 |  |     |  |  |
  1701.              Ia,Ib|  |    |20|27|     |  |  |
  1702.             N6|  |    |16|15|     |  |  |
  1703.             N7|  |    |20|19|     |  |  |
  1704.             N8|  |    |18|18|     |  |  |
  1705.          N9-N11,H1|  |    |29|36|     |  |  |
  1706.                N12|  |    |  |  |8 |2 |  |
  1707.                N13|  |    |  |  |8 |  |  |
  1708.                N14|  |    |  |  |8 |  |  |
  1709.                N15|  |    |  |  |     |9 |  |
  1710.  
  1711.               Figure 7:    Area 1's Database.
  1712.  
  1713.           Networks and routers are represented by vertices.
  1714.           An edge of cost X    connects Vertex    A to Vertex B iff
  1715.           the intersection of Column A and Row B is    marked
  1716.                    with an X.
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736. Moy                                   [Page 31]
  1737.  
  1738. Internet Draft             OSPF Version 2            January 1997
  1739.  
  1740.  
  1741.                   **FROM**
  1742.  
  1743.                 |RT|RT|RT|RT|RT|RT|RT
  1744.                 |3 |4 |5 |6    |7 |10|11|
  1745.              ------------------------
  1746.              RT3|  |  |  |6    |  |  |     |
  1747.              RT4|  |  |8 |    |  |  |     |
  1748.              RT5|  |8 |  |6    |6 |  |     |
  1749.              RT6|8 |  |7 |    |  |5 |     |
  1750.              RT7|  |  |6 |    |  |  |     |
  1751.              *    RT10|  |  |  |7    |  |  |2 |
  1752.              *    RT11|  |  |  |    |  |3 |     |
  1753.              T      N1|4 |4 |  |    |  |  |     |
  1754.              O      N2|4 |4 |  |    |  |  |     |
  1755.              *      N3|1 |1 |  |    |  |  |     |
  1756.              *      N4|2 |3 |  |    |  |  |     |
  1757.               Ia|  |  |  |    |  |5 |     |
  1758.               Ib|  |  |  |7    |  |  |     |
  1759.               N6|  |  |  |    |1 |1 |3 |
  1760.               N7|  |  |  |    |5 |5 |7 |
  1761.               N8|  |  |  |    |4 |3 |2 |
  1762.            N9-N11,H1|  |  |  |    |  |  |11|
  1763.              N12|  |  |8 |    |2 |  |     |
  1764.              N13|  |  |8 |    |  |  |     |
  1765.              N14|  |  |8 |    |  |  |     |
  1766.              N15|  |  |  |    |9 |  |     |
  1767.  
  1768.  
  1769.              Figure 8: The backbone's database.
  1770.  
  1771.           Networks and routers are represented by vertices.
  1772.           An edge of cost X    connects Vertex    A to Vertex B iff
  1773.           the intersection of Column A and Row B is    marked
  1774.                  with an X.
  1775.  
  1776.     Next, by looking at the    area summaries from these area border
  1777.     routers, RT3 and RT4 can determine the distance    to all networks
  1778.     outside    their area.  These distances are then advertised
  1779.     internally to the area by RT3 and RT4.    The advertisements that
  1780.     Router RT3 and RT4 will    make into Area 1 are shown in Table 6.
  1781.     Note that Table    6 assumes that an area range has been configured
  1782.     for the    backbone which groups Ia and Ib    into a single LSA.
  1783.  
  1784.  
  1785.     The information    imported into Area 1 by    Routers    RT3 and    RT4
  1786.     enables    an internal router, such as RT1, to choose an area
  1787.     border router intelligently.  Router RT1 would use RT4 for
  1788.     traffic    to Network N6, RT3 for traffic to Network N10, and would
  1789.  
  1790.  
  1791.  
  1792. Moy                                   [Page 32]
  1793.  
  1794. Internet Draft             OSPF Version 2            January 1997
  1795.  
  1796.  
  1797.  
  1798.  
  1799.                   dist  from   dist     from
  1800.                   RT3       RT4
  1801.            __________________________________
  1802.            to  RT3    *           21
  1803.            to  RT4    22       *
  1804.            to  RT7    20       14
  1805.            to  RT10   15       22
  1806.            __________________________________
  1807.            to  Ia     20       27
  1808.            to  Ib     15       22
  1809.            __________________________________
  1810.            to  RT5    14       8
  1811.            to  RT7    20       14
  1812.  
  1813.          Table 5: Backbone distances calculated
  1814.             by Routers RT3 and RT4.
  1815.  
  1816.  
  1817.            _________________________________
  1818.            Ia,Ib     20        27
  1819.            N6         16        15
  1820.            N7         20        19
  1821.            N8         18        18
  1822.            N9-N11,H1     29        36
  1823.            _________________________________
  1824.            RT5         14        8
  1825.            RT7         20        14
  1826.  
  1827.           Table 6: Destinations advertised into Area 1
  1828.             by Routers RT3 and RT4.
  1829.  
  1830.     load share between the two for traffic to Network N8.
  1831.  
  1832.     Router RT1 can also determine in this manner the shortest path
  1833.     to the AS boundary routers RT5 and RT7.     Then, by looking at RT5
  1834.     and RT7's AS-external-LSAs, Router RT1 can decide between RT5 or
  1835.     RT7 when sending to a destination in another Autonomous    System
  1836.     (one of    the networks N12-N15).
  1837.  
  1838.     Note that a failure of the line    between    Routers    RT6 and    RT10
  1839.     will cause the backbone    to become disconnected.     Configuring a
  1840.     virtual    link between Routers RT7 and RT10 will give the    backbone
  1841.     more connectivity and more resistance to such failures.
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. Moy                                   [Page 33]
  1849.  
  1850. Internet Draft             OSPF Version 2            January 1997
  1851.  
  1852.  
  1853.     3.5.  IP subnetting    support
  1854.  
  1855.     OSPF attaches an IP address mask to each advertised route.  The
  1856.     mask indicates the range of addresses being described by the
  1857.     particular route.  For example,    a summary-LSA for the
  1858.     destination 128.185.0.0    with a mask of 0xffff0000 actually is
  1859.     describing a single route to the collection of destinations
  1860.     128.185.0.0 - 128.185.255.255.    Similarly, host    routes are
  1861.     always advertised with a mask of 0xffffffff, indicating    the
  1862.     presence of only a single destination.
  1863.  
  1864.     Including the mask with    each advertised    destination enables the
  1865.     implementation of what is commonly referred to as variable-
  1866.     length subnetting.  This means that a single IP    class A, B, or C
  1867.     network    number can be broken up    into many subnets of various
  1868.     sizes.    For example, the network 128.185.0.0 could be broken up
  1869.     into 62    variable-sized subnets:    15 subnets of size 4K, 15
  1870.     subnets    of size    256, and 32 subnets of size 8.    Table 7    shows
  1871.     some of    the resulting network addresses    together with their
  1872.     masks.
  1873.  
  1874.  
  1875.  
  1876.           Network address   IP address mask   Subnet size
  1877.           _______________________________________________
  1878.           128.185.16.0        0xfffff000          4K
  1879.           128.185.1.0        0xffffff00          256
  1880.           128.185.0.8        0xfffffff8          8
  1881.  
  1882.  
  1883.              Table 7: Some sample subnet sizes.
  1884.  
  1885.  
  1886.     There are many possible    ways of    dividing up a class A, B, and C
  1887.     network    into variable sized subnets.  The precise procedure for
  1888.     doing so is beyond the scope of    this specification.  This
  1889.     specification however establishes the following    guideline: When
  1890.     an IP packet is    forwarded, it is always    forwarded to the network
  1891.     that is    the best match for the packet's    destination.  Here best
  1892.     match is synonymous with the longest or    most specific match.
  1893.     For example, the default route with destination    of 0.0.0.0 and
  1894.     mask 0x00000000    is always a match for every IP destination.  Yet
  1895.     it is always less specific than    any other match.  Subnet masks
  1896.     must be    assigned so that the best match    for any    IP destination
  1897.     is unambiguous.
  1898.  
  1899.     Attaching an address mask to each route    also enables the support
  1900.     of IP supernetting. For    example, a single physical network
  1901.  
  1902.  
  1903.  
  1904. Moy                                   [Page 34]
  1905.  
  1906. Internet Draft             OSPF Version 2            January 1997
  1907.  
  1908.  
  1909.     segment    could be assigned the [address,mask] pair
  1910.     [192.9.4.0,0xfffffc00].    The segment would then be single IP
  1911.     network, containing addresses from the four consecutive    class C
  1912.     network    numbers    192.9.4.0 through 192.9.7.0. Such addressing is
  1913.     now becoming commonplace with the advent of CIDR (see [Ref10]).
  1914.  
  1915.     In order to get    better aggregation at area boundaries, area
  1916.     address    ranges can be employed (see Section C.2    for more
  1917.     details).  Each    address    range is defined as an [address,mask]
  1918.     pair.  Many separate networks may then be contained in a single
  1919.     address    range, just as a subnetted network is composed of many
  1920.     separate subnets.  Area    border routers then summarize the area
  1921.     contents (for distribution to the backbone) by advertising a
  1922.     single route for each address range.  The cost of the route is
  1923.     the maximum cost to any    of the networks    falling    in the specified
  1924.     range.
  1925.  
  1926.     For example, an    IP subnetted network might be configured as a
  1927.     single OSPF area.  In that case, a single address range    could be
  1928.     configured:  a class A,    B, or C    network    number along with its
  1929.     natural    IP mask.  Inside the area, any number of variable sized
  1930.     subnets    could be defined.  However, external to    the area a
  1931.     single route for the entire subnetted network would be
  1932.     distributed, hiding even the fact that the network is subnetted
  1933.     at all.     The cost of this route    is the maximum of the set of
  1934.     costs to the component subnets.
  1935.  
  1936.  
  1937.     3.6.  Supporting stub areas
  1938.  
  1939.     In some    Autonomous Systems, the    majority of the    link-state
  1940.     database may consist of    AS-external-LSAs.  An OSPF AS-external-
  1941.     LSA is usually flooded throughout the entire AS.  However, OSPF
  1942.     allows certain areas to    be configured as "stub areas".    AS-
  1943.     external-LSAs are not flooded into/throughout stub areas;
  1944.     routing    to AS external destinations in these areas is based on a
  1945.     (per-area) default only.  This reduces the link-state database
  1946.     size, and therefore the    memory requirements, for a stub    area's
  1947.     internal routers.
  1948.  
  1949.     In order to take advantage of the OSPF stub area support,
  1950.     default    routing    must be    used in    the stub area.    This is
  1951.     accomplished as    follows.  One or more of the stub area's area
  1952.     border routers must advertise a    default    route into the stub area
  1953.     via summary-LSAs.  These summary defaults are flooded throughout
  1954.     the stub area, but no further.    (For this reason these defaults
  1955.     pertain    only to    the particular stub area).  These summary
  1956.     default    routes will be used for    any destination    that is    not
  1957.  
  1958.  
  1959.  
  1960. Moy                                   [Page 35]
  1961.  
  1962. Internet Draft             OSPF Version 2            January 1997
  1963.  
  1964.  
  1965.     explicitly reachable by    an intra-area or inter-area path (i.e.,
  1966.     AS external destinations).
  1967.  
  1968.     An area    can be configured as a stub when there is a single exit
  1969.     point from the area, or    when the choice    of exit    point need not
  1970.     be made    on a per-external-destination basis.  For example, Area
  1971.     3 in Figure 6 could be configured as a stub area, because all
  1972.     external traffic must travel though its    single area border
  1973.     router RT11.  If Area 3    were configured    as a stub, Router RT11
  1974.     would advertise    a default route    for distribution inside    Area 3
  1975.     (in a summary-LSA), instead of flooding    the AS-external-LSAs for
  1976.     Networks N12-N15 into/throughout the area.
  1977.  
  1978.     The OSPF protocol ensures that all routers belonging to    an area
  1979.     agree on whether the area has been configured as a stub.  This
  1980.     guarantees that    no confusion will arise    in the flooding    of AS-
  1981.     external-LSAs.
  1982.  
  1983.     There are a couple of restrictions on the use of stub areas.
  1984.     Virtual    links cannot be    configured through stub    areas.    In
  1985.     addition, AS boundary routers cannot be    placed internal    to stub
  1986.     areas.
  1987.  
  1988.  
  1989.     3.7.  Partitions of    areas
  1990.  
  1991.     OSPF does not actively attempt to repair area partitions.  When
  1992.     an area    becomes    partitioned, each component simply becomes a
  1993.     separate area.    The backbone then performs routing between the
  1994.     new areas.  Some destinations reachable    via intra-area routing
  1995.     before the partition will now require inter-area routing.
  1996.  
  1997.     However, in order to maintain full routing after the partition,
  1998.     an address range must not be split across multiple components of
  1999.     the area partition. Also, the backbone itself must not
  2000.     partition.  If it does,    parts of the Autonomous    System will
  2001.     become unreachable.  Backbone partitions can be    repaired by
  2002.     configuring virtual links (see Section 15).
  2003.  
  2004.     Another    way to think about area    partitions is to look at the
  2005.     Autonomous System graph    that was introduced in Section 2.  Area
  2006.     IDs can    be viewed as colors for    the graph's edges.[1] Each edge
  2007.     of the graph connects to a network, or is itself a point-to-
  2008.     point network.    In either case,    the edge is colored with the
  2009.     network's Area ID.
  2010.  
  2011.     A group    of edges, all having the same color, and interconnected
  2012.     by vertices, represents    an area.  If the topology of the
  2013.  
  2014.  
  2015.  
  2016. Moy                                   [Page 36]
  2017.  
  2018. Internet Draft             OSPF Version 2            January 1997
  2019.  
  2020.  
  2021.     Autonomous System is intact, the graph will have several regions
  2022.     of color, each color being a distinct Area ID.
  2023.  
  2024.     When the AS topology changes, one of the areas may become
  2025.     partitioned.  The graph    of the AS will then have multiple
  2026.     regions    of the same color (Area    ID).  The routing in the
  2027.     Autonomous System will continue    to function as long as these
  2028.     regions    of same    color are connected by the single backbone
  2029.     region.
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072. Moy                                   [Page 37]
  2073.  
  2074. Internet Draft             OSPF Version 2            January 1997
  2075.  
  2076.  
  2077. 4.  Functional Summary
  2078.  
  2079.     A separate copy of OSPF's basic routing algorithm runs in each area.
  2080.     Routers having interfaces to multiple areas    run multiple copies of
  2081.     the    algorithm.  A brief summary of the routing algorithm follows.
  2082.  
  2083.     When a router starts, it first initializes the routing protocol data
  2084.     structures.     The router then waits for indications from the    lower-
  2085.     level protocols that its interfaces    are functional.
  2086.  
  2087.     A router then uses the OSPF's Hello    Protocol to acquire neighbors.
  2088.     The    router sends Hello packets to its neighbors, and in turn
  2089.     receives their Hello packets.  On broadcast    and point-to-point
  2090.     networks, the router dynamically detects its neighboring routers by
  2091.     sending its    Hello packets to the multicast address AllSPFRouters.
  2092.     On non-broadcast networks, some configuration information may be
  2093.     necessary in order to discover neighbors.  On broadcast and    NBMA
  2094.     networks the Hello Protocol    also elects a Designated router    for the
  2095.     network.
  2096.  
  2097.     The    router will attempt to form adjacencies    with some of its newly
  2098.     acquired neighbors.     Link-state databases are synchronized between
  2099.     pairs of adjacent routers.    On broadcast and NBMA networks,    the
  2100.     Designated Router determines which routers should become adjacent.
  2101.  
  2102.     Adjacencies    control    the distribution of routing information.
  2103.     Routing updates are    sent and received only on adjacencies.
  2104.  
  2105.     A router periodically advertises its state,    which is also called
  2106.     link state.     Link state is also advertised when a router's state
  2107.     changes.  A    router's adjacencies are reflected in the contents of
  2108.     its    LSAs.  This relationship between adjacencies and link state
  2109.     allows the protocol    to detect dead routers in a timely fashion.
  2110.  
  2111.     LSAs are flooded throughout    the area.  The flooding    algorithm is
  2112.     reliable, ensuring that all    routers    in an area have    exactly    the same
  2113.     link-state database.  This database    consists of the    collection of
  2114.     LSAs originated by each router belonging to    the area.  From    this
  2115.     database each router calculates a shortest-path tree, with itself as
  2116.     root.  This    shortest-path tree in turn yields a routing table for
  2117.     the    protocol.
  2118.  
  2119.  
  2120.     4.1.  Inter-area routing
  2121.  
  2122.     The previous section described the operation of    the protocol
  2123.     within a single    area.  For intra-area routing, no other    routing
  2124.     information is pertinent.  In order to be able to route    to
  2125.  
  2126.  
  2127.  
  2128. Moy                                   [Page 38]
  2129.  
  2130. Internet Draft             OSPF Version 2            January 1997
  2131.  
  2132.  
  2133.     destinations outside of    the area, the area border routers inject
  2134.     additional routing information into the    area.  This additional
  2135.     information is a distillation of the rest of the Autonomous
  2136.     System's topology.
  2137.  
  2138.     This distillation is accomplished as follows: Each area    border
  2139.     router is by definition    connected to the backbone.  Each area
  2140.     border router summarizes the topology of its attached non-
  2141.     backbone areas for transmission    on the backbone, and hence to
  2142.     all other area border routers.    An area    border router then has
  2143.     complete topological information concerning the    backbone, and
  2144.     the area summaries from    each of    the other area border routers.
  2145.     From this information, the router calculates paths to all
  2146.     inter-area destinations.  The router then advertises these paths
  2147.     into its attached areas.  This enables the area's internal
  2148.     routers    to pick    the best exit router when forwarding traffic
  2149.     inter-area destinations.
  2150.  
  2151.  
  2152.     4.2.  AS external routes
  2153.  
  2154.     Routers    that have information regarding    other Autonomous Systems
  2155.     can flood this information throughout the AS.  This external
  2156.     routing    information is distributed verbatim to every
  2157.     participating router.  There is    one exception: external    routing
  2158.     information is not flooded into    "stub" areas (see Section 3.6).
  2159.  
  2160.     To utilize external routing information, the path to all routers
  2161.     advertising external information must be known throughout the AS
  2162.     (excepting the stub areas).  For that reason, the locations of
  2163.     these AS boundary routers are summarized by the    (non-stub) area
  2164.     border routers.
  2165.  
  2166.  
  2167.     4.3.  Routing protocol packets
  2168.  
  2169.     The OSPF protocol runs directly    over IP, using IP protocol 89.
  2170.     OSPF does not provide any explicit fragmentation/reassembly
  2171.     support.  When fragmentation is    necessary, IP
  2172.     fragmentation/reassembly is used.  OSPF    protocol packets have
  2173.     been designed so that large protocol packets can generally be
  2174.     split into several smaller protocol packets.  This practice is
  2175.     recommended; IP    fragmentation should be    avoided    whenever
  2176.     possible.
  2177.  
  2178.     Routing    protocol packets should    always be sent with the    IP TOS
  2179.     field set to 0.     If at all possible, routing protocol packets
  2180.     should be given    preference over    regular    IP data    traffic, both
  2181.  
  2182.  
  2183.  
  2184. Moy                                   [Page 39]
  2185.  
  2186. Internet Draft             OSPF Version 2            January 1997
  2187.  
  2188.  
  2189.     when being sent    and received.  As an aid to accomplishing this,
  2190.     OSPF protocol packets should have their    IP precedence field set
  2191.     to the value Internetwork Control (see [Ref5]).
  2192.  
  2193.     All OSPF protocol packets share    a common protocol header that is
  2194.     described in Appendix A.  The OSPF packet types    are listed below
  2195.     in Table 8.  Their formats are also described in Appendix A.
  2196.  
  2197.  
  2198.  
  2199.          Type   Packet  name       Protocol  function
  2200.          __________________________________________________________
  2201.          1        Hello           Discover/maintain  neighbors
  2202.          2        Database Description   Summarize database contents
  2203.          3        Link State Request       Database download
  2204.          4        Link State Update       Database update
  2205.          5        Link State Ack       Flooding acknowledgment
  2206.  
  2207.  
  2208.                 Table 8: OSPF packet types.
  2209.  
  2210.  
  2211.     OSPF's Hello protocol uses Hello packets to discover and
  2212.     maintain neighbor relationships.  The Database Description and
  2213.     Link State Request packets are used in the forming of
  2214.     adjacencies.  OSPF's reliable update mechanism is implemented by
  2215.     the Link State Update and Link State Acknowledgment packets.
  2216.  
  2217.     Each Link State    Update packet carries a    set of new link    state
  2218.     advertisements (LSAs) one hop further away from    their point of
  2219.     origination.  A    single Link State Update packet    may contain the
  2220.     LSAs of    several    routers.  Each LSA is tagged with the ID of the
  2221.     originating router and a checksum of its link state contents.
  2222.     Each LSA also has a type field;    the different types of OSPF LSAs
  2223.     are listed below in Table 9.
  2224.  
  2225.     OSPF routing packets (with the exception of Hellos) are    sent
  2226.     only over adjacencies.    This means that    all OSPF protocol
  2227.     packets    travel a single    IP hop,    except those that are sent over
  2228.     virtual    adjacencies.  The IP source address of an OSPF protocol
  2229.     packet is one end of a router adjacency, and the IP destination
  2230.     address    is either the other end    of the adjacency or an IP
  2231.     multicast address.
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240. Moy                                   [Page 40]
  2241.  
  2242. Internet Draft             OSPF Version 2            January 1997
  2243.  
  2244.  
  2245.  
  2246.  
  2247.     LS     LSA          LSA description
  2248.     type   name
  2249.     ________________________________________________________
  2250.     1      Router-LSAs      Originated by    all routers.
  2251.                   This LSA describes
  2252.                   the collected    states of the
  2253.                   router's interfaces to an
  2254.                   area.    Flooded    throughout a
  2255.     ________________________________________________________
  2256.     2      Network-LSAs      Originated for broadcast
  2257.                   and NBMA networks by
  2258.                   the Designated Router. This
  2259.                   LSA contains the
  2260.                   list of routers connected
  2261.                   to the network. Flooded
  2262.                   throughout a single area only.
  2263.     ________________________________________________________
  2264.     3,4    Summary-LSAs      Originated by    area border
  2265.                   routers, and flooded through-
  2266.                   out the LSA's    associated
  2267.                   area.    Each summary-LSA
  2268.                   describes a route to a
  2269.                   destination outside the area,
  2270.                   yet still inside the AS
  2271.                   (i.e., an inter-area route).
  2272.                   Type 3 summary-LSAs describe
  2273.                   routes to networks. Type 4
  2274.                   summary-LSAs describe
  2275.     ________________________________________________________
  2276.     5      AS-external-LSAs      Originated by    AS boundary
  2277.                   routers, and flooded through-
  2278.                   out the AS. Each
  2279.                   AS-external-LSA describes
  2280.                   a route to a destination in
  2281.                   another Autonomous System.
  2282.                   Default routes for the AS can
  2283.                   also be described by
  2284.                   AS-external-LSAs.
  2285.  
  2286.  
  2287.         Table 9: OSPF link state advertisements (LSAs).
  2288.  
  2289.  
  2290.  
  2291.     4.4.  Basic    implementation requirements
  2292.  
  2293.  
  2294.  
  2295.  
  2296. Moy                                   [Page 41]
  2297.  
  2298. Internet Draft             OSPF Version 2            January 1997
  2299.  
  2300.  
  2301.     An implementation of OSPF requires the following pieces    of
  2302.     system support:
  2303.  
  2304.  
  2305.     Timers
  2306.         Two    different kind of timers are required.    The first kind,
  2307.         called "single shot    timers", fire once and cause a protocol
  2308.         event to be    processed.  The    second kind, called "interval
  2309.         timers", fire at continuous    intervals.  These are used for
  2310.         the    sending    of packets at regular intervals.  A good example
  2311.         of this is the regular broadcast of    Hello packets. The
  2312.         granularity    of both    kinds of timers    is one second.
  2313.  
  2314.         Interval timers should be implemented to avoid drift.  In
  2315.         some router    implementations, packet    processing can affect
  2316.         timer execution.  When multiple routers are    attached to a
  2317.         single network, all    doing broadcasts, this can lead    to the
  2318.         synchronization of routing packets (which should be
  2319.         avoided).  If timers cannot    be implemented to avoid    drift,
  2320.         small random amounts should    be added to/subtracted from the
  2321.         interval timer at each firing.
  2322.  
  2323.     IP multicast
  2324.         Certain OSPF packets take the form of IP multicast
  2325.         datagrams.    Support    for receiving and sending IP multicast
  2326.         datagrams, along with the appropriate lower-level protocol
  2327.         support, is    required.  The IP multicast datagrams used by
  2328.         OSPF never travel more than    one hop. For this reason, the
  2329.         ability to forward IP multicast datagrams is not required.
  2330.         For    information on IP multicast, see [Ref7].
  2331.  
  2332.     Variable-length    subnet support
  2333.         The    router's IP protocol support must include the ability to
  2334.         divide a single IP class A,    B, or C    network    number into many
  2335.         subnets of various sizes.  This is commonly    called
  2336.         variable-length subnetting;    see Section 3.5    for details.
  2337.  
  2338.     IP supernetting    support
  2339.         The    router's IP protocol support must include the ability to
  2340.         aggregate contiguous collections of    IP class A, B, and C
  2341.         networks into larger quantities called supernets.
  2342.         Supernetting has been proposed as one way to improve the
  2343.         scaling of IP routing in the worldwide Internet. For more
  2344.         information    on IP supernetting, see    [Ref10].
  2345.  
  2346.     Lower-level protocol support
  2347.         The    lower level protocols referred to here are the network
  2348.         access protocols, such as the Ethernet data    link layer.
  2349.  
  2350.  
  2351.  
  2352. Moy                                   [Page 42]
  2353.  
  2354. Internet Draft             OSPF Version 2            January 1997
  2355.  
  2356.  
  2357.         Indications    must be    passed from these protocols to OSPF as
  2358.         the    network    interface goes up and down.  For example, on an
  2359.         ethernet it    would be valuable to know when the ethernet
  2360.         transceiver    cable becomes unplugged.
  2361.  
  2362.     Non-broadcast lower-level protocol support
  2363.         On non-broadcast networks, the OSPF    Hello Protocol can be
  2364.         aided by providing an indication when an attempt is    made to
  2365.         send a packet to a dead or non-existent router.  For
  2366.         example, on    an X.25    PDN a dead neighboring router may be
  2367.         indicated by the reception of a X.25 clear with an
  2368.         appropriate    cause and diagnostic, and this information would
  2369.         be passed to OSPF.
  2370.  
  2371.     List manipulation primitives
  2372.         Much of the    OSPF functionality is described    in terms of its
  2373.         operation on lists of LSAs.     For example, the collection of
  2374.         LSAs that will be retransmitted to an adjacent router until
  2375.         acknowledged are described as a list.  Any particular LSA
  2376.         may    be on many such    lists.    An OSPF    implementation needs to
  2377.         be able to manipulate these    lists, adding and deleting
  2378.         constituent    LSAs as    necessary.
  2379.  
  2380.     Tasking    support
  2381.         Certain procedures described in this specification invoke
  2382.         other procedures.  At times, these other procedures    should
  2383.         be executed    in-line, that is, before the current procedure
  2384.         is finished.  This is indicated in the text    by instructions
  2385.         to execute a procedure.  At    other times, the other
  2386.         procedures are to be executed only when the    current
  2387.         procedure has finished.  This is indicated by instructions
  2388.         to schedule    a task.
  2389.  
  2390.  
  2391.     4.5.  Optional OSPF    capabilities
  2392.  
  2393.     The OSPF protocol defines several optional capabilities.  A
  2394.     router indicates the optional capabilities that    it supports in
  2395.     its OSPF Hello packets,    Database Description packets and in its
  2396.     LSAs.  This enables routers supporting a mix of    optional
  2397.     capabilities to    coexist    in a single Autonomous System.
  2398.  
  2399.     Some capabilities must be supported by all routers attached to a
  2400.     specific area.    In this    case, a    router will not    accept a
  2401.     neighbor's Hello Packet    unless there is    a match    in reported
  2402.     capabilities (i.e., a capability mismatch prevents a neighbor
  2403.     relationship from forming).  An    example    of this    is the
  2404.     ExternalRoutingCapability (see below).
  2405.  
  2406.  
  2407.  
  2408. Moy                                   [Page 43]
  2409.  
  2410. Internet Draft             OSPF Version 2            January 1997
  2411.  
  2412.  
  2413.     Other capabilities can be negotiated during the    Database
  2414.     Exchange process.  This    is accomplished    by specifying the
  2415.     optional capabilities in Database Description packets.    A
  2416.     capability mismatch with a neighbor in this case will result in
  2417.     only a subset of the link state    database being exchanged between
  2418.     the two    neighbors.
  2419.  
  2420.     The routing table build    process    can also be affected by    the
  2421.     presence/absence of optional capabilities.  For    example, since
  2422.     the optional capabilities are reported in LSAs,    routers
  2423.     incapable of certain functions can be avoided when building the
  2424.     shortest path tree.  An    example    of this    is the TOS routing
  2425.     capability (see    below).
  2426.  
  2427.     The OSPF optional capabilities defined in this memo are    listed
  2428.     below.    See Section A.2    for more information.
  2429.  
  2430.  
  2431.     ExternalRoutingCapability
  2432.         Entire OSPF    areas can be configured    as "stubs" (see    Section
  2433.         3.6).  AS-external-LSAs will not be    flooded    into stub areas.
  2434.         This capability is represented by the E-bit    in the OSPF
  2435.         Options field (see Section A.2).  In order to ensure
  2436.         consistent configuration of    stub areas, all    routers
  2437.         interfacing    to such    an area    must have the E-bit clear in
  2438.         their Hello    packets    (see Sections 9.5 and 10.5).
  2439.  
  2440.     TOS capability
  2441.         All    OSPF implementations must be able to calculate separate
  2442.         routes based on IP Type of Service.     However, to save
  2443.         routing table space    and processing resources, an OSPF router
  2444.         can    be configured to ignore    TOS when forwarding packets.  In
  2445.         this case, the router calculates routes for    TOS 0 only.
  2446.         This capability is represented by the T-bit    in the OSPF
  2447.         Options field (see Section A.2).  TOS-capable routers will
  2448.         attempt to avoid non-TOS-capable routers when calculating
  2449.         non-zero TOS paths.
  2450.  
  2451.  
  2452. 5.  Protocol Data Structures
  2453.  
  2454.     The    OSPF protocol is described herein in terms of its operation on
  2455.     various protocol data structures.  The following list comprises the
  2456.     top-level OSPF data    structures.  Any initialization    that needs to be
  2457.     done is noted.  OSPF areas,    interfaces and neighbors also have
  2458.     associated data structures that are    described later    in this
  2459.     specification.
  2460.  
  2461.  
  2462.  
  2463.  
  2464. Moy                                   [Page 44]
  2465.  
  2466. Internet Draft             OSPF Version 2            January 1997
  2467.  
  2468.  
  2469.     Router ID
  2470.     A 32-bit number    that uniquely identifies this router in    the AS.
  2471.     One possible implementation strategy would be to use the
  2472.     smallest IP interface address belonging    to the router. If a
  2473.     router's OSPF Router ID    is changed, the    router's OSPF software
  2474.     should be restarted before the new Router ID takes effect.  In
  2475.     this case the router should flush its self-originated LSAs from
  2476.     the routing domain (see    Section    14.1) before restarting, or they
  2477.     will persist for up to MaxAge minutes.
  2478.  
  2479.     Area structures
  2480.     Each one of the    areas to which the router is connected has its
  2481.     own data structure.  This data structure describes the working
  2482.     of the basic OSPF algorithm.  Remember that each area runs a
  2483.     separate copy of the basic OSPF    algorithm.
  2484.  
  2485.     Backbone (area) structure
  2486.     The OSPF backbone area is responsible for the dissemination of
  2487.     inter-area routing information.
  2488.  
  2489.     Virtual links configured
  2490.     The virtual links configured with this router as one endpoint.
  2491.     In order to have configured virtual links, the router itself
  2492.     must be    an area    border router.    Virtual    links are identified by
  2493.     the Router ID of the other endpoint -- which is    another    area
  2494.     border router.    These two endpoint routers must    be attached to a
  2495.     common area, called the    virtual    link's Transit area.  Virtual
  2496.     links are part of the backbone,    and behave as if they were
  2497.     unnumbered point-to-point networks between the two routers.  A
  2498.     virtual    link uses the intra-area routing of its    Transit    area to
  2499.     forward    packets.  Virtual links    are brought up and down    through
  2500.     the building of    the shortest-path trees    for the    Transit    area.
  2501.  
  2502.     List of external routes
  2503.     These are routes to destinations external to the Autonomous
  2504.     System,    that have been gained either through direct experience
  2505.     with another routing protocol (such as BGP), or    through
  2506.     configuration information, or through a    combination of the two
  2507.     (e.g., dynamic external    information to be advertised by    OSPF
  2508.     with configured    metric). Any router having these external routes
  2509.     is called an AS    boundary router.  These    routes are advertised by
  2510.     the router into    the OSPF routing domain    via AS-external-LSAs.
  2511.  
  2512.     List of AS-external-LSAs
  2513.     Part of    the link-state database.  These    have originated    from the
  2514.     AS boundary routers.  They comprise routes to destinations
  2515.     external to the    Autonomous System.  Note that, if the router is
  2516.     itself an AS boundary router, some of these AS-external-LSAs
  2517.  
  2518.  
  2519.  
  2520. Moy                                   [Page 45]
  2521.  
  2522. Internet Draft             OSPF Version 2            January 1997
  2523.  
  2524.  
  2525.     have been self-originated.
  2526.  
  2527.     The    routing    table
  2528.     Derived    from the link-state database.  Each entry in the routing
  2529.     table is indexed by a destination, and contains    the
  2530.     destination's cost and a set of    paths to use in    forwarding
  2531.     packets    to the destination. A path is described    by its type and
  2532.     next hop.  For more information, see Section 11.
  2533.  
  2534.     TOS    capability
  2535.     This item indicates whether the    router will calculate separate
  2536.     routes based on    TOS.  This is a    configurable parameter.     For
  2537.     more information, see Sections 4.5 and 16.9.
  2538.  
  2539.  
  2540.     Figure 9 shows the collection of data structures present in    a
  2541.     typical router.  The router    pictured is RT10, from the map in Figure
  2542.     6.    Note that Router RT10 has a virtual link configured to Router
  2543.     RT11, with Area 2 as the link's Transit area.  This    is indicated by
  2544.     the    dashed line in Figure 9.  When the virtual link    becomes    active,
  2545.     through the    building of the    shortest path tree for Area 2, it
  2546.     becomes an interface to the    backbone (see the two backbone
  2547.     interfaces depicted    in Figure 9).
  2548.  
  2549. 6.  The    Area Data Structure
  2550.  
  2551.     The    area data structure contains all the information used to run the
  2552.     basic OSPF routing algorithm. Each area maintains its own link-state
  2553.     database. A    network    belongs    to a single area, and a    router interface
  2554.     connects to    a single area. Each router adjacency also belongs to a
  2555.     single area.
  2556.  
  2557.     The    OSPF backbone is the special OSPF area responsible for
  2558.     disseminating inter-area routing information.
  2559.  
  2560.     The    area link-state    database consists of the collection of router-
  2561.     LSAs, network-LSAs and summary-LSAs    that have originated from the
  2562.     area's routers.  This information is flooded throughout a single
  2563.     area only.    The list of AS-external-LSAs (see Section 5) is    also
  2564.     considered to be part of each area's link-state database.
  2565.  
  2566.  
  2567.     Area ID
  2568.     A 32-bit number    identifying the    area. The Area ID of 0.0.0.0 is
  2569.     reserved for the backbone.
  2570.  
  2571.     List of area address ranges
  2572.     In order to aggregate routing information at area boundaries,
  2573.  
  2574.  
  2575.  
  2576. Moy                                   [Page 46]
  2577.  
  2578. Internet Draft             OSPF Version 2            January 1997
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.                   +----+
  2585.                   |RT10|------+
  2586.                   +----+       \+-------------+
  2587.                  /        \        |Routing Table|
  2588.                 /         \        +-------------+
  2589.                /          \
  2590.           +------+      /           \    +--------+
  2591.           |Area 2|---+        +---|Backbone|
  2592.           +------+***********+        +--------+
  2593.          /          \          *       /          \
  2594.         /           \       *      /           \
  2595.        +---------+  +---------+       +------------+    +------------+
  2596.        |Interface|  |Interface|       |Virtual Link|    |Interface Ib|
  2597.        |  to N6     |  |  to N8  |       |   to RT11    |    +------------+
  2598.        +---------+  +---------+       +------------+          |
  2599.        /  \          |          |              |
  2600.       /    \      |          |              |
  2601.    +--------+ +--------+  |       +-------------+    +------------+
  2602.    |Neighbor| |Neighbor|  |       |Neighbor RT11|    |Neighbor RT6|
  2603.    |  RT8   | |     RT7   |  |       +-------------+    +------------+
  2604.    +--------+ +--------+  |
  2605.               |
  2606.              +-------------+
  2607.              |Neighbor RT11|
  2608.              +-------------+
  2609.  
  2610.  
  2611.         Figure 9: Router RT10's    Data structures
  2612.  
  2613.     area address ranges can    be employed. Each address range    is
  2614.     specified by an    [address,mask] pair and    a status indication of
  2615.     either Advertise or DoNotAdvertise (see    Section    12.4.3).
  2616.  
  2617.     Associated router interfaces
  2618.     This router's interfaces connecting to the area.  A router
  2619.     interface belongs to one and only one area (or the backbone).
  2620.     For the    backbone area this list    includes all the virtual links.
  2621.     A virtual link is identified by    the Router ID of its other
  2622.     endpoint; its cost is the cost of the shortest intra-area path
  2623.     through    the Transit area that exists between the two routers.
  2624.  
  2625.     List of router-LSAs
  2626.     A router-LSA is    generated by each router in the    area.  It
  2627.     describes the state of the router's interfaces to the area.
  2628.  
  2629.  
  2630.  
  2631.  
  2632. Moy                                   [Page 47]
  2633.  
  2634. Internet Draft             OSPF Version 2            January 1997
  2635.  
  2636.  
  2637.     List of network-LSAs
  2638.     One network-LSA    is generated for each transit broadcast    and NBMA
  2639.     network    in the area.  A    network-LSA describes the set of routers
  2640.     currently connected to the network.
  2641.  
  2642.     List of summary-LSAs
  2643.     Summary-LSAs originate from the    area's area border routers.
  2644.     They describe routes to    destinations internal to the Autonomous
  2645.     System,    yet external to    the area (i.e.,    inter-area
  2646.     destinations).
  2647.  
  2648.     Shortest-path tree
  2649.     The shortest-path tree for the area, with this router itself as
  2650.     root.  Derived from the    collected router-LSAs and network-LSAs
  2651.     by the Dijkstra    algorithm (see Section 16.1).
  2652.  
  2653.     TransitCapability
  2654.     This parameter indicates whether the area can carry data traffic
  2655.     that neither originates    nor terminates in the area itself. This
  2656.     parameter is calculated    when the area's    shortest-path tree is
  2657.     built (see Section 16.1, where TransitCapability is set    to TRUE
  2658.     if and only if there are one or    more fully adjacent virtual
  2659.     links using the    area as    Transit    area), and is used as an input
  2660.     to a subsequent    step of    the routing table build    process    (see
  2661.     Section    16.3). When an area's TransitCapability    is set to TRUE,
  2662.     the area is said to be a "transit area".
  2663.  
  2664.     ExternalRoutingCapability
  2665.     Whether    AS-external-LSAs will be flooded into/throughout the
  2666.     area.  This is a configurable parameter.  If AS-external-LSAs
  2667.     are excluded from the area, the    area is    called a "stub". Within
  2668.     stub areas, routing to AS external destinations    will be    based
  2669.     solely on a default summary route.  The    backbone cannot    be
  2670.     configured as a    stub area.  Also, virtual links    cannot be
  2671.     configured through stub    areas.    For more information, see
  2672.     Section    3.6.
  2673.  
  2674.     StubDefaultCost
  2675.     If the area has    been configured    as a stub area,    and the    router
  2676.     itself is an area border router, then the StubDefaultCost
  2677.     indicates the cost of the default summary-LSA that the router
  2678.     should advertise into the area.     There can be a    separate cost
  2679.     configured for each IP TOS.  See Section 12.4.3    for more
  2680.     information.
  2681.  
  2682.  
  2683.     Unless otherwise specified,    the remaining sections of this document
  2684.     refer to the operation of the OSPF protocol    within a single    area.
  2685.  
  2686.  
  2687.  
  2688. Moy                                   [Page 48]
  2689.  
  2690. Internet Draft             OSPF Version 2            January 1997
  2691.  
  2692.  
  2693. 7.  Bringing Up    Adjacencies
  2694.  
  2695.     OSPF creates adjacencies between neighboring routers for the purpose
  2696.     of exchanging routing information.    Not every two neighboring
  2697.     routers will become    adjacent.  This    section    covers the generalities
  2698.     involved in    creating adjacencies.  For further details consult
  2699.     Section 10.
  2700.  
  2701.  
  2702.     7.1.  The Hello Protocol
  2703.  
  2704.     The Hello Protocol is responsible for establishing and
  2705.     maintaining neighbor relationships.  It    also ensures that
  2706.     communication between neighbors    is bidirectional.  Hello packets
  2707.     are sent periodically out all router interfaces.  Bidirectional
  2708.     communication is indicated when    the router sees    itself listed in
  2709.     the neighbor's Hello Packet.  On broadcast and NBMA networks,
  2710.     the Hello Protocol elects a Designated Router for the network.
  2711.  
  2712.     The Hello Protocol works differently on    broadcast networks, NBMA
  2713.     networks and Point-to-MultiPoint networks.  On broadcast
  2714.     networks, each router advertises itself    by periodically
  2715.     multicasting Hello Packets.  This allows neighbors to be
  2716.     discovered dynamically.     These Hello Packets contain the
  2717.     router's view of the Designated    Router's identity, and the list
  2718.     of routers whose Hello Packets have been seen recently.
  2719.  
  2720.     On NBMA    networks some configuration information    may be necessary
  2721.     for the    operation of the Hello Protocol.  Each router that may
  2722.     potentially become Designated Router has a list    of all other
  2723.     routers    attached to the    network.  A router, having Designated
  2724.     Router potential, sends    Hello Packets to all other potential
  2725.     Designated Routers when    its interface to the NBMA network first
  2726.     becomes    operational.  This is an attempt to find the Designated
  2727.     Router for the network.     If the    router itself is elected
  2728.     Designated Router, it begins sending Hello Packets to all other
  2729.     routers    attached to the    network.
  2730.  
  2731.     On Point-to-MultiPoint networks, a router sends    Hello Packets to
  2732.     all neighbors with which it can    communicate directly. These
  2733.     neighbors may be discovered dynamically    through    a protocol such
  2734.     as Inverse ARP (see [Ref14]), or they may be configured.
  2735.  
  2736.     After a    neighbor has been discovered, bidirectional
  2737.     communication ensured, and (if on a broadcast or NBMA network) a
  2738.     Designated Router elected, a decision is made regarding    whether
  2739.     or not an adjacency should be formed with the neighbor (see
  2740.     Section    10.4). If an adjacency is to be    formed,    the first step
  2741.  
  2742.  
  2743.  
  2744. Moy                                   [Page 49]
  2745.  
  2746. Internet Draft             OSPF Version 2            January 1997
  2747.  
  2748.  
  2749.     is to synchronize the neighbors' link-state databases.    This is
  2750.     covered    in the next section.
  2751.  
  2752.  
  2753.     7.2.  The Synchronization of Databases
  2754.  
  2755.     In a link-state    routing    algorithm, it is very important    for all
  2756.     routers' link-state databases to stay synchronized.  OSPF
  2757.     simplifies this    by requiring only adjacent routers to remain
  2758.     synchronized.  The synchronization process begins as soon as the
  2759.     routers    attempt    to bring up the    adjacency.  Each router
  2760.     describes its database by sending a sequence of    Database
  2761.     Description packets to its neighbor.  Each Database Description
  2762.     Packet describes a set of LSAs belonging to the    router's
  2763.     database.  When    the neighbor sees an LSA that is more recent
  2764.     than its own database copy, it makes a note that this newer LSA
  2765.     should be requested.
  2766.  
  2767.     This sending and receiving of Database Description packets is
  2768.     called the "Database Exchange Process".     During    this process,
  2769.     the two    routers    form a master/slave relationship.  Each    Database
  2770.     Description Packet has a sequence number.  Database Description
  2771.     Packets    sent by    the master (polls) are acknowledged by the slave
  2772.     through    echoing    of the sequence    number.     Both polls and    their
  2773.     responses contain summaries of link state data.     The master is
  2774.     the only one allowed to    retransmit Database Description    Packets.
  2775.     It does    so only    at fixed intervals, the    length of which    is the
  2776.     configured per-interface constant RxmtInterval.
  2777.  
  2778.     Each Database Description contains an indication that there are
  2779.     more packets to    follow --- the M-bit.  The Database Exchange
  2780.     Process    is over    when a router has received and sent Database
  2781.     Description Packets with the M-bit off.
  2782.  
  2783.     During and after the Database Exchange Process,    each router has
  2784.     a list of those    LSAs for which the neighbor has    more up-to-date
  2785.     instances.  These LSAs are requested in    Link State Request
  2786.     Packets.  Link State Request packets that are not satisfied are
  2787.     retransmitted at fixed intervals of time RxmtInterval.    When the
  2788.     Database Description Process has completed and all Link    State
  2789.     Requests have been satisfied, the databases are    deemed
  2790.     synchronized and the routers are marked    fully adjacent.     At this
  2791.     time the adjacency is fully functional and is advertised in the
  2792.     two routers' router-LSAs.
  2793.  
  2794.     The adjacency is used by the flooding procedure    as soon    as the
  2795.     Database Exchange Process begins.  This    simplifies database
  2796.     synchronization, and guarantees    that it    finishes in a
  2797.  
  2798.  
  2799.  
  2800. Moy                                   [Page 50]
  2801.  
  2802. Internet Draft             OSPF Version 2            January 1997
  2803.  
  2804.  
  2805.     predictable period of time.
  2806.  
  2807.  
  2808.     7.3.  The Designated Router
  2809.  
  2810.     Every broadcast    and NBMA network has a Designated Router.  The
  2811.     Designated Router performs two main functions for the routing
  2812.     protocol:
  2813.  
  2814.     o   The    Designated Router originates a network-LSA on behalf of
  2815.         the    network.  This LSA lists the set of routers (including
  2816.         the    Designated Router itself) currently attached to    the
  2817.         network.  The Link State ID    for this LSA (see Section
  2818.         12.1.4) is the IP interface    address    of the Designated
  2819.         Router.  The IP network number can then be obtained    by using
  2820.         the    network's subnet/network mask.
  2821.  
  2822.     o   The    Designated Router becomes adjacent to all other    routers
  2823.         on the network.  Since the link state databases are
  2824.         synchronized across    adjacencies (through adjacency bring-up
  2825.         and    then the flooding procedure), the Designated Router
  2826.         plays a central part in the    synchronization    process.
  2827.  
  2828.  
  2829.     The Designated Router is elected by the    Hello Protocol.     A
  2830.     router's Hello Packet contains its Router Priority, which is
  2831.     configurable on    a per-interface    basis.    In general, when a
  2832.     router's interface to a    network    first becomes functional, it
  2833.     checks to see whether there is currently a Designated Router for
  2834.     the network.  If there is, it accepts that Designated Router,
  2835.     regardless of its Router Priority.  (This makes    it harder to
  2836.     predict    the identity of    the Designated Router, but ensures that
  2837.     the Designated Router changes less often.  See below.)
  2838.     Otherwise, the router itself becomes Designated    Router if it has
  2839.     the highest Router Priority on the network.  A more detailed
  2840.     (and more accurate) description    of Designated Router election is
  2841.     presented in Section 9.4.
  2842.  
  2843.     The Designated Router is the endpoint of many adjacencies.  In
  2844.     order to optimize the flooding procedure on broadcast networks,
  2845.     the Designated Router multicasts its Link State    Update Packets
  2846.     to the address AllSPFRouters, rather than sending separate
  2847.     packets    over each adjacency.
  2848.  
  2849.     Section    2 of this document discusses the directed graph
  2850.     representation of an area.  Router nodes are labelled with their
  2851.     Router ID.  Transit network nodes are actually labelled    with the
  2852.     IP address of their Designated Router.    It follows that    when the
  2853.  
  2854.  
  2855.  
  2856. Moy                                   [Page 51]
  2857.  
  2858. Internet Draft             OSPF Version 2            January 1997
  2859.  
  2860.  
  2861.     Designated Router changes, it appears as if the    network    node on
  2862.     the graph is replaced by an entirely new node.    This will cause
  2863.     the network and    all its    attached routers to originate new LSAs.
  2864.     Until the link-state databases again converge, some temporary
  2865.     loss of    connectivity may result.  This may result in ICMP
  2866.     unreachable messages being sent    in response to data traffic.
  2867.     For that reason, the Designated    Router should change only
  2868.     infrequently.  Router Priorities should    be configured so that
  2869.     the most dependable router on a    network    eventually becomes
  2870.     Designated Router.
  2871.  
  2872.  
  2873.     7.4.  The Backup Designated    Router
  2874.  
  2875.     In order to make the transition    to a new Designated Router
  2876.     smoother, there    is a Backup Designated Router for each broadcast
  2877.     and NBMA network.  The Backup Designated Router    is also    adjacent
  2878.     to all routers on the network, and becomes Designated Router
  2879.     when the previous Designated Router fails.  If there were no
  2880.     Backup Designated Router, when a new Designated    Router became
  2881.     necessary, new adjacencies would have to be formed between the
  2882.     new Designated Router and all other routers attached to    the
  2883.     network.  Part of the adjacency    forming    process    is the
  2884.     synchronizing of link-state databases, which can potentially
  2885.     take quite a long time.     During    this time, the network would not
  2886.     be available for transit data traffic.    The Backup Designated
  2887.     obviates the need to form these    adjacencies, since they    already
  2888.     exist.    This means the period of disruption in transit traffic
  2889.     lasts only as long as it takes to flood    the new    LSAs (which
  2890.     announce the new Designated Router).
  2891.  
  2892.     The Backup Designated Router does not generate a network-LSA for
  2893.     the network.  (If it did, the transition to a new Designated
  2894.     Router would be    even faster.  However, this is a tradeoff
  2895.     between    database size and speed    of convergence when the
  2896.     Designated Router disappears.)
  2897.  
  2898.     The Backup Designated Router is    also elected by    the Hello
  2899.     Protocol.  Each    Hello Packet has a field that specifies    the
  2900.     Backup Designated Router for the network.
  2901.  
  2902.     In some    steps of the flooding procedure, the Backup Designated
  2903.     Router plays a passive role, letting the Designated Router do
  2904.     more of    the work.  This    cuts down on the amount    of local routing
  2905.     traffic.  See Section 13.3 for more information.
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912. Moy                                   [Page 52]
  2913.  
  2914. Internet Draft             OSPF Version 2            January 1997
  2915.  
  2916.  
  2917.     7.5.  The graph of adjacencies
  2918.  
  2919.     An adjacency is    bound to the network that the two routers have
  2920.     in common.  If two routers have    multiple networks in common,
  2921.     they may have multiple adjacencies between them.
  2922.  
  2923.     One can    picture    the collection of adjacencies on a network as
  2924.     forming    an undirected graph.  The vertices consist of routers,
  2925.     with an    edge joining two routers if they are adjacent.    The
  2926.     graph of adjacencies describes the flow    of routing protocol
  2927.     packets, and in    particular Link    State Update Packets, through
  2928.     the Autonomous System.
  2929.  
  2930.     Two graphs are possible, depending on whether a    Designated
  2931.     Router is elected for the network.  On physical    point-to-point
  2932.     networks, Point-to-MultiPoint networks and virtual links,
  2933.     neighboring routers become adjacent whenever they can
  2934.     communicate directly.  In contrast, on broadcast and NBMA
  2935.     networks only the Designated Router and    the Backup Designated
  2936.     Router become adjacent to all other routers attached to    the
  2937.     network.
  2938.  
  2939.  
  2940.  
  2941.       +---+           +---+
  2942.       |RT1|------------|RT2|        o---------------o
  2943.       +---+       N1       +---+       RT1           RT2
  2944.  
  2945.  
  2946.  
  2947.                          RT7
  2948.                           o---------+
  2949.         +---+   +---+   +---+         /|\        |
  2950.         |RT7|   |RT3|   |RT4|        / | \        |
  2951.         +---+   +---+   +---+           /  |  \        |
  2952.           |          |          |              /      |   \        |
  2953.      +-----------------------+      RT5o RT6o    oRT4 |
  2954.           |      |    N2          *      *   *        |
  2955.         +---+    +---+               *  *  *        |
  2956.         |RT5|    |RT6|            * * *        |
  2957.         +---+    +---+             ***        |
  2958.                           o---------+
  2959.                          RT3
  2960.  
  2961.  
  2962.           Figure 10: The graph of adjacencies
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968. Moy                                   [Page 53]
  2969.  
  2970. Internet Draft             OSPF Version 2            January 1997
  2971.  
  2972.  
  2973.     These graphs are shown in Figure 10.  It is assumed that Router
  2974.     RT7 has    become the Designated Router, and Router RT3 the Backup
  2975.     Designated Router, for the Network N2.    The Backup Designated
  2976.     Router performs    a lesser function during the flooding procedure
  2977.     than the Designated Router (see    Section    13.3).    This is    the
  2978.     reason for the dashed lines connecting the Backup Designated
  2979.     Router RT3.
  2980.  
  2981.  
  2982. 8.  Protocol Packet Processing
  2983.  
  2984.     This section discusses the general processing of OSPF routing
  2985.     protocol packets.  It is very important that the router link-state
  2986.     databases remain synchronized.  For    this reason, routing protocol
  2987.     packets should get preferential treatment over ordinary data
  2988.     packets, both in sending and receiving.
  2989.  
  2990.     Routing protocol packets are sent along adjacencies    only (with the
  2991.     exception of Hello packets,    which are used to discover the
  2992.     adjacencies).  This    means that all routing protocol    packets    travel a
  2993.     single IP hop, except those    sent over virtual links.
  2994.  
  2995.     All    routing    protocol packets begin with a standard header.    The
  2996.     sections below provide details on how to fill in and verify    this
  2997.     standard header.  Then, for    each packet type, the section giving
  2998.     more details on that particular packet type's processing is    listed.
  2999.  
  3000.     8.1.  Sending protocol packets
  3001.  
  3002.     When a router sends a routing protocol packet, it fills    in the
  3003.     fields of the standard OSPF packet header as follows.  For more
  3004.     details    on the header format consult Section A.3.1:
  3005.  
  3006.  
  3007.     Version    #
  3008.         Set    to 2, the version number of the    protocol as documented
  3009.         in this specification.
  3010.  
  3011.     Packet type
  3012.         The    type of    OSPF packet, such as Link state    Update or Hello
  3013.         Packet.
  3014.  
  3015.     Packet length
  3016.         The    length of the entire OSPF packet in bytes, including the
  3017.         standard OSPF packet header.
  3018.  
  3019.     Router ID
  3020.         The    identity of the    router itself (who is originating the
  3021.  
  3022.  
  3023.  
  3024. Moy                                   [Page 54]
  3025.  
  3026. Internet Draft             OSPF Version 2            January 1997
  3027.  
  3028.  
  3029.         packet).
  3030.  
  3031.     Area ID
  3032.         The    OSPF area that the packet is being sent    into.
  3033.  
  3034.     Checksum
  3035.         The    standard IP 16-bit one's complement checksum of    the
  3036.         entire OSPF    packet,    excluding the 64-bit authentication
  3037.         field.  This checksum is calculated    as part    of the
  3038.         appropriate    authentication procedure; for some OSPF
  3039.         authentication types, the checksum calculation is omitted.
  3040.         See    Section    D.4 for    details.
  3041.  
  3042.     AuType and Authentication
  3043.         Each OSPF packet exchange is authenticated.     Authentication
  3044.         types are assigned by the protocol and are documented in
  3045.         Appendix D.     A different authentication procedure can be
  3046.         used for each IP network/subnet.  Autype indicates the type
  3047.         of authentication procedure    in use.    The 64-bit
  3048.         authentication field is then for use by the    chosen
  3049.         authentication procedure.  This procedure should be    the last
  3050.         called when    forming    the packet to be sent. See Section D.4
  3051.         for    details.
  3052.  
  3053.  
  3054.     The IP destination address for the packet is selected as
  3055.     follows.  On physical point-to-point networks, the IP
  3056.     destination is always set to the address AllSPFRouters.     On all
  3057.     other network types (including virtual links), the majority of
  3058.     OSPF packets are sent as unicasts, i.e., sent directly to the
  3059.     other end of the adjacency.  In    this case, the IP destination is
  3060.     just the Neighbor IP address associated    with the other end of
  3061.     the adjacency (see Section 10).     The only packets not sent as
  3062.     unicasts are on    broadcast networks; on these networks Hello
  3063.     packets    are sent to the    multicast destination AllSPFRouters, the
  3064.     Designated Router and its Backup send both Link    State Update
  3065.     Packets    and Link State Acknowledgment Packets to the multicast
  3066.     address    AllSPFRouters, while all other routers send both their
  3067.     Link State Update and Link State Acknowledgment    Packets    to the
  3068.     multicast address AllDRouters.
  3069.  
  3070.     Retransmissions    of Link    State Update packets are ALWAYS    sent as
  3071.     unicasts.
  3072.  
  3073.     The IP source address should be    set to the IP address of the
  3074.     sending    interface.  Interfaces to unnumbered point-to-point
  3075.     networks have no associated IP address.     On these interfaces,
  3076.     the IP source should be    set to any of the other    IP addresses
  3077.  
  3078.  
  3079.  
  3080. Moy                                   [Page 55]
  3081.  
  3082. Internet Draft             OSPF Version 2            January 1997
  3083.  
  3084.  
  3085.     belonging to the router.  For this reason, there must be at
  3086.     least one IP address assigned to the router.[2]    Note that, for
  3087.     most purposes, virtual links act precisely the same as
  3088.     unnumbered point-to-point networks.  However, each virtual link
  3089.     does have an IP    interface address (discovered during the routing
  3090.     table build process) which is used as the IP source when sending
  3091.     packets    over the virtual link.
  3092.  
  3093.     For more information on    the format of specific OSPF packet
  3094.     types, consult the sections listed in Table 10.
  3095.  
  3096.  
  3097.  
  3098.          Type   Packet name           detailed section (transmit)
  3099.          _________________________________________________________
  3100.          1        Hello           Section  9.5
  3101.          2        Database description   Section 10.8
  3102.          3        Link state request       Section 10.9
  3103.          4        Link state update       Section 13.3
  3104.          5        Link state ack       Section 13.5
  3105.  
  3106.  
  3107.         Table 10: Sections describing OSPF protocol    packet transmission.
  3108.  
  3109.  
  3110.  
  3111.     8.2.  Receiving protocol packets
  3112.  
  3113.     Whenever a protocol packet is received by the router it    is
  3114.     marked with the    interface it was received on.  For routers that
  3115.     have virtual links configured, it may not be immediately obvious
  3116.     which interface    to associate the packet    with.  For example,
  3117.     consider the Router RT11 depicted in Figure 6.    If RT11    receives
  3118.     an OSPF    protocol packet    on its interface to Network N8,    it may
  3119.     want to    associate the packet with the interface    to Area    2, or
  3120.     with the virtual link to Router    RT10 (which is part of the
  3121.     backbone).  In the following, we assume    that the packet    is
  3122.     initially associated with the non-virtual  link.[3]
  3123.  
  3124.     In order for the packet    to be accepted at the IP level,    it must
  3125.     pass a number of tests,    even before the    packet is passed to OSPF
  3126.     for processing:
  3127.  
  3128.  
  3129.     o   The    IP checksum must be correct.
  3130.  
  3131.     o   The    packet's IP destination    address    must be    the IP address
  3132.         of the receiving interface,    or one of the IP multicast
  3133.  
  3134.  
  3135.  
  3136. Moy                                   [Page 56]
  3137.  
  3138. Internet Draft             OSPF Version 2            January 1997
  3139.  
  3140.  
  3141.         addresses AllSPFRouters or AllDRouters.
  3142.  
  3143.     o   The    IP protocol specified must be OSPF (89).
  3144.  
  3145.     o   Locally originated packets should not be passed on to OSPF.
  3146.         That is, the source    IP address should be examined to make
  3147.         sure this is not a multicast packet    that the router    itself
  3148.         generated.
  3149.  
  3150.  
  3151.     Next, the OSPF packet header is    verified.  The fields specified
  3152.     in the header must match those configured for the receiving
  3153.     interface.  If they do not, the    packet should be discarded:
  3154.  
  3155.  
  3156.     o   The    version    number field must specify protocol version 2.
  3157.  
  3158.     o   The    Area ID    found in the OSPF header must be verified.  If
  3159.         both of the    following cases    fail, the packet should    be
  3160.         discarded.    The Area ID specified in the header must either:
  3161.  
  3162.         (1)    Match the Area ID of the receiving interface.  In this
  3163.         case, the packet has been sent over a single hop.
  3164.         Therefore, the packet's    IP source address is required to
  3165.         be on the same network as the receiving    interface.  This
  3166.         can be verified    by comparing the packet's IP source
  3167.         address    to the interface's IP address, after masking
  3168.         both addresses with the    interface mask.     This comparison
  3169.         should not be performed    on point-to-point networks. On
  3170.         point-to-point networks, the interface addresses of each
  3171.         end of the link    are assigned independently, if they are
  3172.         assigned at all.
  3173.  
  3174.         (2)    Indicate the backbone.    In this    case, the packet has
  3175.         been sent over a virtual link.    The receiving router
  3176.         must be    an area    border router, and the Router ID
  3177.         specified in the packet    (the source router) must be the
  3178.         other end of a configured virtual link.     The receiving
  3179.         interface must also attach to the virtual link's
  3180.         configured Transit area.  If all of these checks
  3181.         succeed, the packet is accepted    and is from now    on
  3182.         associated with    the virtual link (and the backbone
  3183.         area).
  3184.  
  3185.     o   Packets whose IP destination is AllDRouters    should only be
  3186.         accepted if    the state of the receiving interface is    DR or
  3187.         Backup (see    Section    9.1).
  3188.  
  3189.  
  3190.  
  3191.  
  3192. Moy                                   [Page 57]
  3193.  
  3194. Internet Draft             OSPF Version 2            January 1997
  3195.  
  3196.  
  3197.     o   The    AuType specified in the    packet must match the AuType
  3198.         specified for the associated area.
  3199.  
  3200.     o   The    packet must be authenticated.  The authentication
  3201.         procedure is indicated by the setting of AuType (see
  3202.         Appendix D).  The authentication procedure may use one or
  3203.         more Authentication    keys, which can    be configured on a per-
  3204.         interface basis.  The authentication procedure may also
  3205.         verify the checksum    field in the OSPF packet header    (which,
  3206.         when used, is set to the standard IP 16-bit    one's complement
  3207.         checksum of    the OSPF packet's contents after excluding the
  3208.         64-bit authentication field).  If the authentication
  3209.         procedure fails, the packet    should be discarded.
  3210.  
  3211.     If the packet type is Hello, it    should then be further processed
  3212.     by the Hello Protocol (see Section 10.5).  All other packet
  3213.     types are sent/received    only on    adjacencies.  This means that
  3214.     the packet must    have been sent by one of the router's active
  3215.     neighbors.  If the receiving interface connects    to a broadcast
  3216.     network, Point-to-MultiPoint network or    NBMA network the sender
  3217.     is identified by the IP    source address found in    the packet's IP
  3218.     header.     If the    receiving interface connects to    a point-to-point
  3219.     network    or a virtual link, the sender is identified by the
  3220.     Router ID (source router) found    in the packet's    OSPF header.
  3221.     The data structure associated with the receiving interface
  3222.     contains the list of active neighbors.    Packets    not matching any
  3223.     active neighbor    are discarded.
  3224.  
  3225.     At this    point all received protocol packets are    associated with
  3226.     an active neighbor.  For the further input processing of
  3227.     specific packet    types, consult the sections listed in Table 11.
  3228.  
  3229.  
  3230.  
  3231.           Type   Packet name        detailed section (receive)
  3232.           ________________________________________________________
  3233.           1         Hello            Section 10.5
  3234.           2         Database description   Section 10.6
  3235.           3         Link state    request        Section 10.7
  3236.           4         Link state    update        Section 13
  3237.           5         Link state    ack        Section 13.7
  3238.  
  3239.  
  3240.         Table 11: Sections describing OSPF protocol    packet reception.
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248. Moy                                   [Page 58]
  3249.  
  3250. Internet Draft             OSPF Version 2            January 1997
  3251.  
  3252.  
  3253. 9.  The    Interface Data Structure
  3254.  
  3255.     An OSPF interface is the connection    between    a router and a network.
  3256.     We assume a    single OSPF interface to each attached network/subnet,
  3257.     although supporting    multiple interfaces on a single    network    is
  3258.     considered in Appendix F. Each interface structure has at most one
  3259.     IP interface address.
  3260.  
  3261.     An OSPF interface can be considered    to belong to the area that
  3262.     contains the attached network.  All    routing    protocol packets
  3263.     originated by the router over this interface are labelled with the
  3264.     interface's    Area ID.  One or more router adjacencies may develop
  3265.     over an interface.    A router's LSAs    reflect    the state of its
  3266.     interfaces and their associated adjacencies.
  3267.  
  3268.     The    following data items are associated with an interface.    Note
  3269.     that a number of these items are actually configuration for    the
  3270.     attached network; such items must be the same for all routers
  3271.     connected to the network.
  3272.  
  3273.  
  3274.     Type
  3275.     The OSPF interface type    is either point-to-point, broadcast,
  3276.     NBMA, Point-to-MultiPoint or virtual link.
  3277.  
  3278.     State
  3279.     The functional level of    an interface.  State determines    whether
  3280.     or not full adjacencies    are allowed to form over the interface.
  3281.     State is also reflected    in the router's    LSAs.
  3282.  
  3283.     IP interface address
  3284.     The IP address associated with the interface.  This appears as
  3285.     the IP source address in all routing protocol packets originated
  3286.     over this interface.  Interfaces to unnumbered point-to-point
  3287.     networks do not    have an    associated IP address.
  3288.  
  3289.     IP interface mask
  3290.     Also referred to as the    subnet mask, this indicates the    portion
  3291.     of the IP interface address that identifies the    attached
  3292.     network.  Masking the IP interface address with    the IP interface
  3293.     mask yields the    IP network number of the attached network.  On
  3294.     point-to-point networks    and virtual links, the IP interface mask
  3295.     is not defined.    On these networks, the link itself is not
  3296.     assigned an IP network number, and so the addresses of each side
  3297.     of the link are    assigned independently,    if they    are assigned at
  3298.     all.
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. Moy                                   [Page 59]
  3305.  
  3306. Internet Draft             OSPF Version 2            January 1997
  3307.  
  3308.  
  3309.     Area ID
  3310.     The Area ID of the area    to which the attached network belongs.
  3311.     All routing protocol packets originating from the interface are
  3312.     labelled with this Area    ID.
  3313.  
  3314.     HelloInterval
  3315.     The length of time, in seconds,    between    the Hello packets that
  3316.     the router sends on the    interface.  Advertised in Hello    packets
  3317.     sent out this interface.
  3318.  
  3319.     RouterDeadInterval
  3320.     The number of seconds before the router's neighbors will declare
  3321.     it down, when they stop    hearing    the router's Hello Packets.
  3322.     Advertised in Hello packets sent out this interface.
  3323.  
  3324.     InfTransDelay
  3325.     The estimated number of    seconds    it takes to transmit a Link
  3326.     State Update Packet over this interface.  LSAs contained in the
  3327.     Link State Update packet will have their age incremented by this
  3328.     amount before transmission.  This value    should take into account
  3329.     transmission and propagation delays; it    must be    greater    than
  3330.     zero.
  3331.  
  3332.     Router Priority
  3333.     An 8-bit unsigned integer.  When two routers attached to a
  3334.     network    both attempt to    become Designated Router, the one with
  3335.     the highest Router Priority takes precedence.  A router    whose
  3336.     Router Priority    is set to 0 is ineligible to become Designated
  3337.     Router on the attached network.     Advertised in Hello packets
  3338.     sent out this interface.
  3339.  
  3340.     Hello Timer
  3341.     An interval timer that causes the interface to send a Hello
  3342.     packet.     This timer fires every    HelloInterval seconds.    Note
  3343.     that on    non-broadcast networks a separate Hello    packet is sent
  3344.     to each    qualified neighbor.
  3345.  
  3346.     Wait Timer
  3347.     A single shot timer that causes    the interface to exit the
  3348.     Waiting    state, and as a    consequence select a Designated    Router
  3349.     on the network.     The length of the timer is RouterDeadInterval
  3350.     seconds.
  3351.  
  3352.     List of neighboring    routers
  3353.     The other routers attached to this network.  This list is formed
  3354.     by the Hello Protocol.    Adjacencies will be formed to some of
  3355.     these neighbors.  The set of adjacent neighbors    can be
  3356.     determined by an examination of    all of the neighbors' states.
  3357.  
  3358.  
  3359.  
  3360. Moy                                   [Page 60]
  3361.  
  3362. Internet Draft             OSPF Version 2            January 1997
  3363.  
  3364.  
  3365.     Designated Router
  3366.     The Designated Router selected for the attached    network.  The
  3367.     Designated Router is selected on all broadcast and NBMA    networks
  3368.     by the Hello Protocol.    Two pieces of identification are kept
  3369.     for the    Designated Router: its Router ID and its IP interface
  3370.     address    on the network.     The Designated    Router advertises link
  3371.     state for the network; this network-LSA    is labelled with the
  3372.     Designated Router's IP address.     The Designated    Router is
  3373.     initialized to 0.0.0.0,    which indicates    the lack of a Designated
  3374.     Router.
  3375.  
  3376.     Backup Designated Router
  3377.     The Backup Designated Router is    also selected on all broadcast
  3378.     and NBMA networks by the Hello Protocol.  All routers on the
  3379.     attached network become    adjacent to both the Designated    Router
  3380.     and the    Backup Designated Router.  The Backup Designated Router
  3381.     becomes    Designated Router when the current Designated Router
  3382.     fails.    The Backup Designated Router is    initialized to 0.0.0.0,
  3383.     indicating the lack of a Backup    Designated Router.
  3384.  
  3385.     Interface output cost(s)
  3386.     The cost of sending a data packet on the interface, expressed in
  3387.     the link state metric.    This is    advertised as the link cost for
  3388.     this interface in the router-LSA.  There may be    a separate cost
  3389.     for each IP Type of Service.  The cost of an interface must be
  3390.     greater    than zero.
  3391.  
  3392.     RxmtInterval
  3393.     The number of seconds between LSA retransmissions, for
  3394.     adjacencies belonging to this interface.  Also used when
  3395.     retransmitting Database    Description and    Link State Request
  3396.     Packets.
  3397.  
  3398.     AuType
  3399.     The type of authentication used    on the attached    network/subnet.
  3400.     Authentication types are defined in Appendix D.     All OSPF packet
  3401.     exchanges are authenticated.  Different    authentication schemes
  3402.     may be used on different networks/subnets.
  3403.  
  3404.     Authentication key
  3405.     This configured    data allows the    authentication procedure to
  3406.     generate and/or    verify OSPF protocol packets.  The
  3407.     Authentication key can be configured on    a per-interface    basis.
  3408.     For example, if    the AuType indicates simple password, the
  3409.     Authentication key would be a 64-bit clear password which is
  3410.     inserted into the OSPF packet header. If instead Autype
  3411.     indicates Cryptographic    authentication,    then the Authentication
  3412.     key is a shared    secret which enables the generation/verification
  3413.  
  3414.  
  3415.  
  3416. Moy                                   [Page 61]
  3417.  
  3418. Internet Draft             OSPF Version 2            January 1997
  3419.  
  3420.  
  3421.     of message digests which are appended to the OSPF protocol
  3422.     packets. When Cryptographic authentication is used, multiple
  3423.     simultaneous keys are supported    in order to achieve smooth key
  3424.     transition (see    Section    D.3).
  3425.  
  3426.  
  3427.     9.1.  Interface states
  3428.  
  3429.     The various states that    router interfaces may attain is
  3430.     documented in this section.  The states    are listed in order of
  3431.     progressing functionality.  For    example, the inoperative state
  3432.     is listed first, followed by a list of intermediate states
  3433.     before the final, fully    functional state is achieved.  The
  3434.     specification makes use    of this    ordering by sometimes making
  3435.     references such    as "those interfaces in    state greater than X".
  3436.     Figure 11 shows    the graph of interface state changes.  The arcs
  3437.  
  3438.                   +----+   UnloopInd   +--------+
  3439.                   |Down|<--------------|Loopback|
  3440.                   +----+           +--------+
  3441.                      |
  3442.                      |InterfaceUp
  3443.               +-------+  |             +--------------+
  3444.               |Waiting|<-+-------------->|Point-to-point|
  3445.               +-------+             +--------------+
  3446.                   |
  3447.              WaitTimer|BackupSeen
  3448.                   |
  3449.                   |
  3450.                   |      NeighborChange
  3451.       +------+         +-+<---------------- +-------+
  3452.       |Backup|<----------|?|----------------->|DROther|
  3453.       +------+---------->+-+<-----+          +-------+
  3454.             Neighbor  |          |
  3455.             Change    |          |Neighbor
  3456.                   |          |Change
  3457.                   |        +--+
  3458.                   +---->|DR|
  3459.                     +--+
  3460.  
  3461.               Figure 11: Interface State changes
  3462.  
  3463.          In addition to    the state transitions pictured,
  3464.          Event InterfaceDown always forces Down    State, and
  3465.          Event LoopInd always forces Loopback State
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472. Moy                                   [Page 62]
  3473.  
  3474. Internet Draft             OSPF Version 2            January 1997
  3475.  
  3476.  
  3477.     of the graph are labelled with the event causing the state
  3478.     change.     These events are documented in    Section    9.2.  The
  3479.     interface state    machine    is described in    more detail in Section
  3480.     9.3.
  3481.  
  3482.  
  3483.     Down
  3484.         This is the    initial    interface state.  In this state, the
  3485.         lower-level    protocols have indicated that the interface is
  3486.         unusable.  No protocol traffic at all will be sent or
  3487.         received on    such a interface.  In this state, interface
  3488.         parameters should be set to    their initial values.  All
  3489.         interface timers should be disabled, and there should be no
  3490.         adjacencies    associated with    the interface.
  3491.  
  3492.     Loopback
  3493.         In this state, the router's    interface to the network is
  3494.         looped back.  The interface    may be looped back in hardware
  3495.         or software.  The interface    will be    unavailable for    regular
  3496.         data traffic.  However, it may still be desirable to gain
  3497.         information    on the quality of this interface, either through
  3498.         sending ICMP pings to the interface    or through something
  3499.         like a bit error test.  For    this reason, IP    packets    may
  3500.         still be addressed to an interface in Loopback state.  To
  3501.         facilitate this, such interfaces are advertised in router-
  3502.         LSAs as single host    routes,    whose destination is the IP
  3503.         interface address.[4]
  3504.  
  3505.     Waiting
  3506.         In this state, the router is trying    to determine the
  3507.         identity of    the (Backup) Designated    Router for the network.
  3508.         To do this,    the router monitors the    Hello Packets it
  3509.         receives.  The router is not allowed to elect a Backup
  3510.         Designated Router nor a Designated Router until it
  3511.         transitions    out of Waiting state.  This prevents unnecessary
  3512.         changes of (Backup)    Designated Router.
  3513.  
  3514.     Point-to-point
  3515.         In this state, the interface is operational, and connects
  3516.         either to a    physical point-to-point    network    or to a    virtual
  3517.         link.  Upon    entering this state, the router    attempts to form
  3518.         an adjacency with the neighboring router.  Hello Packets are
  3519.         sent to the    neighbor every HelloInterval seconds.
  3520.  
  3521.     DR Other
  3522.         The    interface is to    a broadcast or NBMA network on which
  3523.         another router has been selected to    be the Designated
  3524.         Router.  In    this state, the    router itself has not been
  3525.  
  3526.  
  3527.  
  3528. Moy                                   [Page 63]
  3529.  
  3530. Internet Draft             OSPF Version 2            January 1997
  3531.  
  3532.  
  3533.         selected Backup Designated Router either.  The router forms
  3534.         adjacencies    to both    the Designated Router and the Backup
  3535.         Designated Router (if they exist).
  3536.  
  3537.     Backup
  3538.         In this state, the router itself is    the Backup Designated
  3539.         Router on the attached network.  It    will be    promoted to
  3540.         Designated Router when the present Designated Router fails.
  3541.         The    router establishes adjacencies to all other routers
  3542.         attached to    the network.  The Backup Designated Router
  3543.         performs slightly different    functions during the Flooding
  3544.         Procedure, as compared to the Designated Router (see Section
  3545.         13.3).  See    Section    7.4 for    more details on    the functions
  3546.         performed by the Backup Designated Router.
  3547.  
  3548.     DR  In this state, this    router itself is the Designated    Router
  3549.         on the attached network.  Adjacencies are established to all
  3550.         other routers attached to the network.  The    router must also
  3551.         originate a    network-LSA for    the network node.  The network-
  3552.         LSA    will contain links to all routers (including the
  3553.         Designated Router itself) attached to the network.    See
  3554.         Section 7.3    for more details on the    functions performed by
  3555.         the    Designated Router.
  3556.  
  3557.  
  3558.     9.2.  Events causing interface state changes
  3559.  
  3560.     State changes can be effected by a number of events.  These
  3561.     events are pictured as the labelled arcs in Figure 11.    The
  3562.     label definitions are listed below.  For a detailed explanation
  3563.     of the effect of these events on OSPF protocol operation,
  3564.     consult    Section    9.3.
  3565.  
  3566.  
  3567.     InterfaceUp
  3568.         Lower-level    protocols have indicated that the network
  3569.         interface is operational.  This enables the    interface to
  3570.         transition out of Down state.  On virtual links, the
  3571.         interface operational indication is    actually a result of the
  3572.         shortest path calculation (see Section 16.7).
  3573.  
  3574.     WaitTimer
  3575.         The    Wait Timer has fired, indicating the end of the    waiting
  3576.         period that    is required before electing a (Backup)
  3577.         Designated Router.
  3578.  
  3579.     BackupSeen
  3580.         The    router has detected the    existence or non-existence of a
  3581.  
  3582.  
  3583.  
  3584. Moy                                   [Page 64]
  3585.  
  3586. Internet Draft             OSPF Version 2            January 1997
  3587.  
  3588.  
  3589.         Backup Designated Router for the network.  This is done in
  3590.         one    of two ways.  First, an    Hello Packet may be received
  3591.         from a neighbor claiming to    be itself the Backup Designated
  3592.         Router.  Alternatively, an Hello Packet may    be received from
  3593.         a neighbor claiming    to be itself the Designated Router, and
  3594.         indicating that there is no    Backup Designated Router.  In
  3595.         either case    there must be bidirectional communication with
  3596.         the    neighbor, i.e.,    the router must    also appear in the
  3597.         neighbor's Hello Packet.  This event signals an end    to the
  3598.         Waiting state.
  3599.  
  3600.     NeighborChange
  3601.         There has been a change in the set of bidirectional
  3602.         neighbors associated with the interface.  The (Backup)
  3603.         Designated Router needs to be recalculated.     The following
  3604.         neighbor changes lead to the NeighborChange    event.    For an
  3605.         explanation    of neighbor states, see    Section    10.1.
  3606.  
  3607.         o    Bidirectional communication has    been established to a
  3608.         neighbor.  In other words, the state of    the neighbor has
  3609.         transitioned to    2-Way or higher.
  3610.  
  3611.         o    There is no longer bidirectional communication with a
  3612.         neighbor.  In other words, the state of    the neighbor has
  3613.         transitioned to    Init or    lower.
  3614.  
  3615.         o    One of the bidirectional neighbors is newly declaring
  3616.         itself as either Designated Router or Backup Designated
  3617.         Router.     This is detected through examination of that
  3618.         neighbor's Hello Packets.
  3619.  
  3620.         o    One of the bidirectional neighbors is no longer
  3621.         declaring itself as Designated Router, or is no    longer
  3622.         declaring itself as Backup Designated Router.  This is
  3623.         again detected through examination of that neighbor's
  3624.         Hello Packets.
  3625.  
  3626.         o    The advertised Router Priority for a bidirectional
  3627.         neighbor has changed.  This is again detected through
  3628.         examination of that neighbor's Hello Packets.
  3629.  
  3630.     LoopInd
  3631.         An indication has been received that the interface is now
  3632.         looped back    to itself.  This indication can    be received
  3633.         either from    network    management or from the lower level
  3634.         protocols.
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640. Moy                                   [Page 65]
  3641.  
  3642. Internet Draft             OSPF Version 2            January 1997
  3643.  
  3644.  
  3645.     UnloopInd
  3646.         An indication has been received that the interface is no
  3647.         longer looped back.     As with the LoopInd event, this
  3648.         indication can be received either from network management or
  3649.         from the lower level protocols.
  3650.  
  3651.     InterfaceDown
  3652.         Lower-level    protocols indicate that    this interface is no
  3653.         longer functional.    No matter what the current interface
  3654.         state is, the new interface    state will be Down.
  3655.  
  3656.  
  3657.     9.3.  The Interface    state machine
  3658.  
  3659.     A detailed description of the interface    state changes follows.
  3660.     Each state change is invoked by    an event (Section 9.2).     This
  3661.     event may produce different effects, depending on the current
  3662.     state of the interface.     For this reason, the state machine
  3663.     below is organized by current interface    state and received
  3664.     event.    Each entry in the state    machine    describes the resulting
  3665.     new interface state and    the required set of additional actions.
  3666.  
  3667.     When an    interface's state changes, it may be necessary to
  3668.     originate a new    router-LSA.  See Section 12.4 for more details.
  3669.  
  3670.     Some of    the required actions below involve generating events for
  3671.     the neighbor state machine.  For example, when an interface
  3672.     becomes    inoperative, all neighbor connections associated with
  3673.     the interface must be destroyed.  For more information on the
  3674.     neighbor state machine,    see Section 10.3.
  3675.  
  3676.  
  3677.      State(s):  Down
  3678.  
  3679.         Event:  InterfaceUp
  3680.  
  3681.     New state:  Depends upon action    routine
  3682.  
  3683.        Action:  Start the interval Hello Timer, enabling the
  3684.             periodic sending of    Hello packets out the interface.
  3685.             If the attached network is a physical point-to-point
  3686.             network, Point-to-MultiPoint network or virtual
  3687.             link, the interface    state transitions to Point-to-
  3688.             Point.  Else, if the router    is not eligible    to
  3689.             become Designated Router the interface state
  3690.             transitions    to DR Other.
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696. Moy                                   [Page 66]
  3697.  
  3698. Internet Draft             OSPF Version 2            January 1997
  3699.  
  3700.  
  3701.             Otherwise, the attached network is a broadcast or
  3702.             NBMA network and the router    is eligible to become
  3703.             Designated Router.    In this    case, in an attempt to
  3704.             discover the attached network's Designated Router
  3705.             the    interface state    is set to Waiting and the single
  3706.             shot Wait Timer is started.     Additionally, if the
  3707.             network is an NBMA network examine the configured
  3708.             list of neighbors for this interface and generate
  3709.             the    neighbor event Start for each neighbor that is
  3710.             also eligible to become Designated Router.
  3711.  
  3712.  
  3713.      State(s):  Waiting
  3714.  
  3715.         Event:  BackupSeen
  3716.  
  3717.     New state:  Depends upon action    routine.
  3718.  
  3719.        Action:  Calculate the attached network's Backup Designated
  3720.             Router and Designated Router, as shown in Section
  3721.             9.4.  As a result of this calculation, the new state
  3722.             of the interface will be either DR Other, Backup or
  3723.             DR.
  3724.  
  3725.  
  3726.      State(s):  Waiting
  3727.  
  3728.         Event:  WaitTimer
  3729.  
  3730.     New state:  Depends upon action    routine.
  3731.  
  3732.        Action:  Calculate the attached network's Backup Designated
  3733.             Router and Designated Router, as shown in Section
  3734.             9.4.  As a result of this calculation, the new state
  3735.             of the interface will be either DR Other, Backup or
  3736.             DR.
  3737.  
  3738.  
  3739.      State(s):  DR Other, Backup or    DR
  3740.  
  3741.         Event:  NeighborChange
  3742.  
  3743.     New state:  Depends upon action    routine.
  3744.  
  3745.        Action:  Recalculate    the attached network's Backup Designated
  3746.             Router and Designated Router, as shown in Section
  3747.             9.4.  As a result of this calculation, the new state
  3748.             of the interface will be either DR Other, Backup or
  3749.  
  3750.  
  3751.  
  3752. Moy                                   [Page 67]
  3753.  
  3754. Internet Draft             OSPF Version 2            January 1997
  3755.  
  3756.  
  3757.             DR.
  3758.  
  3759.  
  3760.      State(s):  Any    State
  3761.  
  3762.         Event:  InterfaceDown
  3763.  
  3764.     New state:  Down
  3765.  
  3766.        Action:  All    interface variables are    reset, and interface
  3767.             timers disabled.  Also, all    neighbor connections
  3768.             associated with the    interface are destroyed.  This
  3769.             is done by generating the event KillNbr on all
  3770.             associated neighbors (see Section 10.2).
  3771.  
  3772.  
  3773.      State(s):  Any    State
  3774.  
  3775.         Event:  LoopInd
  3776.  
  3777.     New state:  Loopback
  3778.  
  3779.        Action:  Since this interface is no longer connected    to the
  3780.             attached network the actions associated with the
  3781.             above InterfaceDown    event are executed.
  3782.  
  3783.  
  3784.      State(s):  Loopback
  3785.  
  3786.         Event:  UnloopInd
  3787.  
  3788.     New state:  Down
  3789.  
  3790.        Action:  No actions are necessary.  For example, the
  3791.             interface variables    have already been reset    upon
  3792.             entering the Loopback state.  Note that reception of
  3793.             an InterfaceUp event is necessary before the
  3794.             interface again becomes fully functional.
  3795.  
  3796.  
  3797.     9.4.  Electing the Designated Router
  3798.  
  3799.     This section describes the algorithm used for calculating a
  3800.     network's Designated Router and    Backup Designated Router.  This
  3801.     algorithm is invoked by    the Interface state machine.  The
  3802.     initial    time a router runs the election    algorithm for a    network,
  3803.     the network's Designated Router    and Backup Designated Router are
  3804.     initialized to 0.0.0.0.     This indicates    the lack of both a
  3805.  
  3806.  
  3807.  
  3808. Moy                                   [Page 68]
  3809.  
  3810. Internet Draft             OSPF Version 2            January 1997
  3811.  
  3812.  
  3813.     Designated Router and a    Backup Designated Router.
  3814.  
  3815.     The Designated Router election algorithm proceeds as follows:
  3816.     Call the router    doing the calculation Router X.     The list of
  3817.     neighbors attached to the network and having established
  3818.     bidirectional communication with Router    X is examined.    This
  3819.     list is    precisely the collection of Router X's neighbors (on
  3820.     this network) whose state is greater than or equal to 2-Way (see
  3821.     Section    10.1).    Router X itself    is also    considered to be on the
  3822.     list.  Discard all routers from    the list that are ineligible to
  3823.     become Designated Router.  (Routers having Router Priority of 0
  3824.     are ineligible to become Designated Router.)  The following
  3825.     steps are then executed, considering only those    routers    that
  3826.     remain on the list:
  3827.  
  3828.  
  3829.     (1) Note the current values for    the network's Designated Router
  3830.         and    Backup Designated Router.  This    is used    later for
  3831.         comparison purposes.
  3832.  
  3833.     (2) Calculate the new Backup Designated    Router for the network
  3834.         as follows.     Only those routers on the list    that have not
  3835.         declared themselves    to be Designated Router    are eligible to
  3836.         become Backup Designated Router.  If one or    more of    these
  3837.         routers have declared themselves Backup Designated Router
  3838.         (i.e., they    are currently listing themselves as Backup
  3839.         Designated Router, but not as Designated Router, in    their
  3840.         Hello Packets) the one having highest Router Priority is
  3841.         declared to    be Backup Designated Router.  In case of a tie,
  3842.         the    one having the highest Router ID is chosen.  If    no
  3843.         routers have declared themselves Backup Designated Router,
  3844.         choose the router having highest Router Priority, (again
  3845.         excluding those routers who    have declared themselves
  3846.         Designated Router),    and again use the Router ID to break
  3847.         ties.
  3848.  
  3849.     (3) Calculate the new Designated Router    for the    network    as
  3850.         follows.  If one or    more of    the routers have declared
  3851.         themselves Designated Router (i.e.,    they are currently
  3852.         listing themselves as Designated Router in their Hello
  3853.         Packets) the one having highest Router Priority is declared
  3854.         to be Designated Router.  In case of a tie,    the one    having
  3855.         the    highest    Router ID is chosen.  If no routers have
  3856.         declared themselves    Designated Router, assign the Designated
  3857.         Router to be the same as the newly elected Backup Designated
  3858.         Router.
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864. Moy                                   [Page 69]
  3865.  
  3866. Internet Draft             OSPF Version 2            January 1997
  3867.  
  3868.  
  3869.     (4) If Router X    is now newly the Designated Router or newly the
  3870.         Backup Designated Router, or is now    no longer the Designated
  3871.         Router or no longer    the Backup Designated Router, repeat
  3872.         steps 2 and    3, and then proceed to step 5.    For example, if
  3873.         Router X is    now the    Designated Router, when    step 2 is
  3874.         repeated X will no longer be eligible for Backup Designated
  3875.         Router election.  Among other things, this will ensure that
  3876.         no router will declare itself both Backup Designated Router
  3877.         and    Designated Router.[5]
  3878.  
  3879.     (5) As a result    of these calculations, the router itself may now
  3880.         be Designated Router or Backup Designated Router.  See
  3881.         Sections 7.3 and 7.4 for the additional duties this    would
  3882.         entail.  The router's interface state should be set
  3883.         accordingly.  If the router    itself is now Designated Router,
  3884.         the    new interface state is DR.  If the router itself is now
  3885.         Backup Designated Router, the new interface    state is Backup.
  3886.         Otherwise, the new interface state is DR Other.
  3887.  
  3888.     (6) If the attached network is an NBMA network,    and the    router
  3889.         itself has just become either Designated Router or Backup
  3890.         Designated Router, it must start sending Hello Packets to
  3891.         those neighbors that are not eligible to become Designated
  3892.         Router (see    Section    9.5.1).     This is done by invoking the
  3893.         neighbor event Start for each neighbor having a Router
  3894.         Priority of    0.
  3895.  
  3896.     (7) If the above calculations have caused the identity of either
  3897.         the    Designated Router or Backup Designated Router to change,
  3898.         the    set of adjacencies associated with this    interface will
  3899.         need to be modified.  Some adjacencies may need to be
  3900.         formed, and    others may need    to be broken.  To accomplish
  3901.         this, invoke the event AdjOK?  on all neighbors whose state
  3902.         is at least    2-Way.    This will cause    their eligibility for
  3903.         adjacency to be reexamined (see Sections 10.3 and 10.4).
  3904.  
  3905.  
  3906.     The reason behind the election algorithm's complexity is the
  3907.     desire for an orderly transition from Backup Designated    Router
  3908.     to Designated Router, when the current Designated Router fails.
  3909.     This orderly transition    is ensured through the introduction of
  3910.     hysteresis: no new Backup Designated Router can    be chosen until
  3911.     the old    Backup accepts its new Designated Router
  3912.     responsibilities.
  3913.  
  3914.     The above procedure may    elect the same router to be both
  3915.     Designated Router and Backup Designated    Router,    although that
  3916.     router will never be the calculating router (Router X) itself.
  3917.  
  3918.  
  3919.  
  3920. Moy                                   [Page 70]
  3921.  
  3922. Internet Draft             OSPF Version 2            January 1997
  3923.  
  3924.  
  3925.     The elected Designated Router may not be the router having the
  3926.     highest    Router Priority, nor will the Backup Designated    Router
  3927.     necessarily have the second highest Router Priority.  If Router
  3928.     X is not itself    eligible to become Designated Router, it is
  3929.     possible that neither a    Backup Designated Router nor a
  3930.     Designated Router will be selected in the above    procedure.  Note
  3931.     also that if Router X is the only attached router that is
  3932.     eligible to become Designated Router, it will select itself as
  3933.     Designated Router and there will be no Backup Designated Router
  3934.     for the    network.
  3935.  
  3936.  
  3937.     9.5.  Sending Hello    packets
  3938.  
  3939.     Hello packets are sent out each    functioning router interface.
  3940.     They are used to discover and maintain neighbor
  3941.     relationships.[6] On broadcast and NBMA    networks, Hello    Packets
  3942.     are also used to elect the Designated Router and Backup
  3943.     Designated Router.
  3944.  
  3945.     The format of an Hello packet is detailed in Section A.3.2.  The
  3946.     Hello Packet contains the router's Router Priority (used in
  3947.     choosing the Designated    Router), and the interval between Hello
  3948.     Packets    sent out the interface (HelloInterval).     The Hello
  3949.     Packet also indicates how often    a neighbor must    be heard from to
  3950.     remain active (RouterDeadInterval).  Both HelloInterval    and
  3951.     RouterDeadInterval must    be the same for    all routers attached to
  3952.     a common network.  The Hello packet also contains the IP address
  3953.     mask of    the attached network (Network Mask).  On unnumbered
  3954.     point-to-point networks    and on virtual links this field    should
  3955.     be set to 0.0.0.0.
  3956.  
  3957.     The Hello packet's Options field describes the router's    optional
  3958.     OSPF capabilities.  Two    optional capabilities are defined in
  3959.     this specification (see    Sections 4.5 and A.2).    The T-bit of the
  3960.     Options    field should be    set if the router is capable of
  3961.     calculating separate routes for    each IP    TOS.  The E-bit    should
  3962.     be set if and only if the attached area    is capable of processing
  3963.     AS-external-LSAs (i.e.,    it is not a stub area).     If the    E-bit is
  3964.     set incorrectly    the neighboring    routers    will refuse to accept
  3965.     the Hello Packet (see Section 10.5). Unrecognized bits in the
  3966.     Hello Packet's Options field should be set to zero.
  3967.  
  3968.     In order to ensure two-way communication between adjacent
  3969.     routers, the Hello packet contains the list of all routers on
  3970.     the network from which Hello Packets have been seen recently.
  3971.     The Hello packet also contains the router's current choice for
  3972.     Designated Router and Backup Designated    Router.     A value of
  3973.  
  3974.  
  3975.  
  3976. Moy                                   [Page 71]
  3977.  
  3978. Internet Draft             OSPF Version 2            January 1997
  3979.  
  3980.  
  3981.     0.0.0.0    in these fields    means that one has not yet been
  3982.     selected.
  3983.  
  3984.     On broadcast networks and physical point-to-point networks,
  3985.     Hello packets are sent every HelloInterval seconds to the IP
  3986.     multicast address AllSPFRouters.  On virtual links, Hello
  3987.     packets    are sent as unicasts (addressed    directly to the    other
  3988.     end of the virtual link) every HelloInterval seconds. On Point-
  3989.     to-MultiPoint networks,    separate Hello packets are sent    to each
  3990.     attached neighbor every    HelloInterval seconds. Sending of Hello
  3991.     packets    on NBMA    networks is covered in the next    section.
  3992.  
  3993.  
  3994.     9.5.1.    Sending    Hello packets on NBMA networks
  3995.  
  3996.         Static configuration information may be necessary in order
  3997.         for    the Hello Protocol to function on non-broadcast    networks
  3998.         (see Sections C.5 and C.6).     On NBMA networks, every
  3999.         attached router which is eligible to become    Designated
  4000.         Router becomes aware of all    of its neighbors on the    network
  4001.         (either through configuration or by    some unspecified
  4002.         mechanism).     Each neighbor is labelled with    the neighbor's
  4003.         Designated Router eligibility.
  4004.  
  4005.         The    interface state    must be    at least Waiting for any Hello
  4006.         Packets to be sent out the NBMA interface.    Hello Packets
  4007.         are    then sent directly (as unicasts) to some subset    of a
  4008.         router's neighbors.     Sometimes an Hello Packet is sent
  4009.         periodically on a timer; at    other times it is sent as a
  4010.         response to    a received Hello Packet.  A router's hello-
  4011.         sending behavior varies depending on whether the router
  4012.         itself is eligible to become Designated Router.
  4013.  
  4014.         If the router is eligible to become    Designated Router, it
  4015.         must periodically send Hello Packets to all    neighbors that
  4016.         are    also eligible.    In addition, if    the router is itself the
  4017.         Designated Router or Backup    Designated Router, it must also
  4018.         send periodic Hello    Packets    to all other neighbors.     This
  4019.         means that any two eligible    routers    are always exchanging
  4020.         Hello Packets, which is necessary for the correct operation
  4021.         of the Designated Router election algorithm.  To minimize
  4022.         the    number of Hello    Packets    sent, the number of eligible
  4023.         routers on an NBMA network should be kept small.
  4024.  
  4025.         If the router is not eligible to become Designated Router,
  4026.         it must periodically send Hello Packets to both the
  4027.         Designated Router and the Backup Designated    Router (if they
  4028.         exist).  It    must also send an Hello    Packet in reply    to an
  4029.  
  4030.  
  4031.  
  4032. Moy                                   [Page 72]
  4033.  
  4034. Internet Draft             OSPF Version 2            January 1997
  4035.  
  4036.  
  4037.         Hello Packet received from any eligible neighbor (other than
  4038.         the    current    Designated Router and Backup Designated    Router).
  4039.         This is needed to establish    an initial bidirectional
  4040.         relationship with any potential Designated Router.
  4041.  
  4042.         When sending Hello packets periodically to any neighbor, the
  4043.         interval between Hello Packets is determined by the
  4044.         neighbor's state.  If the neighbor is in state Down, Hello
  4045.         Packets are    sent every PollInterval    seconds.  Otherwise,
  4046.         Hello Packets are sent every HelloInterval seconds.
  4047.  
  4048.  
  4049. 10.  The Neighbor Data Structure
  4050.  
  4051.     An OSPF router converses with its neighboring routers.  Each
  4052.     separate conversation is described by a "neighbor data structure".
  4053.     Each conversation is bound to a particular OSPF router interface,
  4054.     and    is identified either by    the neighboring    router's OSPF Router ID
  4055.     or by its Neighbor IP address (see below).    Thus if    the OSPF router
  4056.     and    another    router have multiple attached networks in common,
  4057.     multiple conversations ensue, each described by a unique neighbor
  4058.     data structure.  Each separate conversation    is loosely referred to
  4059.     in the text    as being a separate "neighbor".
  4060.  
  4061.     The    neighbor data structure    contains all information pertinent to
  4062.     the    forming    or formed adjacency between the    two neighbors.
  4063.     (However, remember that not    all neighbors become adjacent.)     An
  4064.     adjacency can be viewed as a highly    developed conversation between
  4065.     two    routers.
  4066.  
  4067.  
  4068.     State
  4069.     The functional level of    the neighbor conversation.  This is
  4070.     described in more detail in Section 10.1.
  4071.  
  4072.     Inactivity Timer
  4073.     A single shot timer whose firing indicates that    no Hello Packet
  4074.     has been seen from this    neighbor recently.  The    length of the
  4075.     timer is RouterDeadInterval seconds.
  4076.  
  4077.     Master/Slave
  4078.     When the two neighbors are exchanging databases, they form a
  4079.     master/slave relationship.  The    master sends the first Database
  4080.     Description Packet, and    is the only part that is allowed to
  4081.     retransmit.  The slave can only    respond    to the master's    Database
  4082.     Description Packets.  The master/slave relationship is
  4083.     negotiated in state ExStart.
  4084.  
  4085.  
  4086.  
  4087.  
  4088. Moy                                   [Page 73]
  4089.  
  4090. Internet Draft             OSPF Version 2            January 1997
  4091.  
  4092.  
  4093.     DD Sequence    Number
  4094.     The DD Sequence    number of the Database Description packet that
  4095.     is currently being sent    to the neighbor.
  4096.  
  4097.     Last received Database Description packet
  4098.     The initialize(I), more    (M) and    master(MS) bits, Options field,
  4099.     and DD sequence    number contained in the    last Database
  4100.     Description packet received from the neighbor. Used to determine
  4101.     whether    the next Database Description packet received from the
  4102.     neighbor is a duplicate.
  4103.  
  4104.     Neighbor ID
  4105.     The OSPF Router    ID of the neighboring router.  The Neighbor ID
  4106.     is learned when    Hello packets are received from    the neighbor, or
  4107.     is configured if this is a virtual adjacency (see Section C.4).
  4108.  
  4109.     Neighbor Priority
  4110.     The Router Priority of the neighboring router.    Contained in the
  4111.     neighbor's Hello packets, this item is used when selecting the
  4112.     Designated Router for the attached network.
  4113.  
  4114.     Neighbor IP    address
  4115.     The IP address of the neighboring router's interface to    the
  4116.     attached network.  Used    as the Destination IP address when
  4117.     protocol packets are sent as unicasts along this adjacency.
  4118.     Also used in router-LSAs as the    Link ID    for the    attached network
  4119.     if the neighboring router is selected to be Designated Router
  4120.     (see Section 12.4.1).  The Neighbor IP address is learned when
  4121.     Hello packets are received from    the neighbor.  For virtual
  4122.     links, the Neighbor IP address is learned during the routing
  4123.     table build process (see Section 15).
  4124.  
  4125.     Neighbor Options
  4126.     The optional OSPF capabilities supported by the    neighbor.
  4127.     Learned    during the Database Exchange process (see Section 10.6).
  4128.     The neighbor's optional    OSPF capabilities are also listed in its
  4129.     Hello packets.    This enables received Hello Packets to be
  4130.     rejected (i.e.,    neighbor relationships will not    even start to
  4131.     form) if there is a mismatch in    certain    crucial    OSPF
  4132.     capabilities (see Section 10.5).  The optional OSPF capabilities
  4133.     are documented in Section 4.5.
  4134.  
  4135.     Neighbor's Designated Router
  4136.     The neighbor's idea of the Designated Router.  If this is the
  4137.     neighbor itself, this is important in the local    calculation of
  4138.     the Designated Router.    Defined    only on    broadcast and NBMA
  4139.     networks.
  4140.  
  4141.  
  4142.  
  4143.  
  4144. Moy                                   [Page 74]
  4145.  
  4146. Internet Draft             OSPF Version 2            January 1997
  4147.  
  4148.  
  4149.     Neighbor's Backup Designated Router
  4150.     The neighbor's idea of the Backup Designated Router.  If this is
  4151.     the neighbor itself, this is important in the local calculation
  4152.     of the Backup Designated Router.  Defined only on broadcast and
  4153.     NBMA networks.
  4154.  
  4155.  
  4156.     The    next set of variables are lists    of LSAs.  These    lists describe
  4157.     subsets of the area    link-state database.  This memo    defines    five
  4158.     distinct types of LSAs, all    of which may be    present    in an area
  4159.     link-state database: router-LSAs, network-LSAs, and    Type 3 and 4
  4160.     summary-LSAs (all stored in    the area data structure), and AS-
  4161.     external-LSAs (stored in the global    data structure).
  4162.  
  4163.  
  4164.     Link state retransmission list
  4165.     The list of LSAs that have been    flooded    but not    acknowledged on
  4166.     this adjacency.     These will be retransmitted at    intervals until
  4167.     they are acknowledged, or until    the adjacency is destroyed.
  4168.  
  4169.     Database summary list
  4170.     The complete list of LSAs that make up the area    link-state
  4171.     database, at the moment    the neighbor goes into Database    Exchange
  4172.     state.    This list is sent to the neighbor in Database
  4173.     Description packets.
  4174.  
  4175.     Link state request list
  4176.     The list of LSAs that need to be received from this neighbor in
  4177.     order to synchronize the two neighbors'    link-state databases.
  4178.     This list is created as    Database Description packets are
  4179.     received, and is then sent to the neighbor in Link State Request
  4180.     packets.  The list is depleted as appropriate Link State Update
  4181.     packets    are received.
  4182.  
  4183.  
  4184.     10.1.  Neighbor states
  4185.  
  4186.     The state of a neighbor    (really, the state of a    conversation
  4187.     being held with    a neighboring router) is documented in the
  4188.     following sections.  The states    are listed in order of
  4189.     progressing functionality.  For    example, the inoperative state
  4190.     is listed first, followed by a list of intermediate states
  4191.     before the final, fully    functional state is achieved.  The
  4192.     specification makes use    of this    ordering by sometimes making
  4193.     references such    as "those neighbors/adjacencies    in state greater
  4194.     than X".  Figures 12 and 13 show the graph of neighbor state
  4195.     changes.  The arcs of the graphs are labelled with the event
  4196.     causing    the state change.  The neighbor    events are documented in
  4197.  
  4198.  
  4199.  
  4200. Moy                                   [Page 75]
  4201.  
  4202. Internet Draft             OSPF Version 2            January 1997
  4203.  
  4204.  
  4205.     Section    10.2.
  4206.  
  4207.     The graph in Figure 12 shows the state changes effected    by the
  4208.     Hello Protocol.     The Hello Protocol is responsible for neighbor
  4209.     acquisition and    maintenance, and for ensuring two way
  4210.     communication between neighbors.
  4211.  
  4212.     The graph in Figure 13 shows the forming of an adjacency.  Not
  4213.     every two neighboring routers become adjacent (see Section
  4214.     10.4).    The adjacency starts to    form when the neighbor is in
  4215.     state ExStart.    After the two routers discover their
  4216.     master/slave status, the state transitions to Exchange.     At this
  4217.     point the neighbor starts to be    used in    the flooding procedure,
  4218.     and the    two neighboring    routers    begin synchronizing their
  4219.     databases.  When this synchronization is finished, the neighbor
  4220.     is in state Full and we    say that the two routers are fully
  4221.     adjacent.  At this point the adjacency is listed in LSAs.
  4222.  
  4223.     For a more detailed description    of neighbor state changes,
  4224.  
  4225.                    +----+
  4226.                    |Down|
  4227.                    +----+
  4228.                      |\
  4229.                      | \Start
  4230.                      |    \      +-------+
  4231.                  Hello   |     +---->|Attempt|
  4232.                 Received |           +-------+
  4233.                      |           |
  4234.                  +----+<-+           |HelloReceived
  4235.                  |Init|<---------------+
  4236.                  +----+<--------+
  4237.                 |        |
  4238.                 |2-Way        |1-Way
  4239.                 |Received   |Received
  4240.                 |        |
  4241.           +-------+        |     +-----+
  4242.           |ExStart|<--------+------->|2-Way|
  4243.           +-------+             +-----+
  4244.  
  4245.           Figure 12: Neighbor state    changes    (Hello Protocol)
  4246.  
  4247.           In addition to the state transitions pictured,
  4248.           Event    KillNbr    always forces Down State,
  4249.           Event    InactivityTimer    always forces Down State,
  4250.           Event    LLDown always forces Down State
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256. Moy                                   [Page 76]
  4257.  
  4258. Internet Draft             OSPF Version 2            January 1997
  4259.  
  4260.  
  4261.  
  4262.                   +-------+
  4263.                   |ExStart|
  4264.                   +-------+
  4265.                     |
  4266.              NegotiationDone|
  4267.                     +->+--------+
  4268.                        |Exchange|
  4269.                     +--+--------+
  4270.                     |
  4271.                 Exchange|
  4272.                   Done  |
  4273.             +----+        |       +-------+
  4274.             |Full|<---------+----->|Loading|
  4275.             +----+<-+           +-------+
  4276.                 |  LoadingDone     |
  4277.                 +------------------+
  4278.  
  4279.         Figure 13: Neighbor    state changes (Database    Exchange)
  4280.  
  4281.         In addition to the state transitions pictured,
  4282.         Event SeqNumberMismatch    forces ExStart state,
  4283.         Event BadLSReq forces ExStart state,
  4284.         Event 1-Way forces Init    state,
  4285.         Event KillNbr always forces Down State,
  4286.         Event InactivityTimer always forces Down State,
  4287.         Event LLDown always forces Down    State,
  4288.         Event AdjOK? leads to adjacency    forming/breaking
  4289.  
  4290.     together with the additional actions involved in each change,
  4291.     see Section 10.3.
  4292.  
  4293.  
  4294.     Down
  4295.         This is the    initial    state of a neighbor conversation.  It
  4296.         indicates that there has been no recent information    received
  4297.         from the neighbor.    On NBMA    networks, Hello    packets    may
  4298.         still be sent to "Down" neighbors, although    at a reduced
  4299.         frequency (see Section 9.5.1).
  4300.  
  4301.     Attempt
  4302.         This state is only valid for neighbors attached to NBMA
  4303.         networks.  It indicates that no recent information has been
  4304.         received from the neighbor,    but that a more    concerted effort
  4305.         should be made to contact the neighbor.  This is done by
  4306.         sending the    neighbor Hello packets at intervals of
  4307.         HelloInterval (see Section 9.5.1).
  4308.  
  4309.  
  4310.  
  4311.  
  4312. Moy                                   [Page 77]
  4313.  
  4314. Internet Draft             OSPF Version 2            January 1997
  4315.  
  4316.  
  4317.     Init
  4318.         In this state, an Hello packet has recently    been seen from
  4319.         the    neighbor.  However, bidirectional communication    has not
  4320.         yet    been established with the neighbor (i.e., the router
  4321.         itself did not appear in the neighbor's Hello packet).  All
  4322.         neighbors in this state (or    higher)    are listed in the Hello
  4323.         packets sent from the associated interface.
  4324.  
  4325.     2-Way
  4326.         In this state, communication between the two routers is
  4327.         bidirectional.  This has been assured by the operation of
  4328.         the    Hello Protocol.     This is the most advanced state short
  4329.         of beginning adjacency establishment.  The (Backup)
  4330.         Designated Router is selected from the set of neighbors in
  4331.         state 2-Way    or greater.
  4332.  
  4333.     ExStart
  4334.         This is the    first step in creating an adjacency between the
  4335.         two    neighboring routers.  The goal of this step is to decide
  4336.         which router is the    master,    and to decide upon the initial
  4337.         DD sequence    number.     Neighbor conversations    in this    state or
  4338.         greater are    called adjacencies.
  4339.  
  4340.     Exchange
  4341.         In this state the router is    describing its entire link state
  4342.         database by    sending    Database Description packets to    the
  4343.         neighbor.  Each Database Description Packet    has a DD
  4344.         sequence number, and is explicitly acknowledged.  Only one
  4345.         Database Description Packet    is allowed outstanding at any
  4346.         one    time.  In this state, Link State Request Packets may
  4347.         also be sent asking    for the    neighbor's more    recent LSAs.
  4348.         All    adjacencies in Exchange    state or greater are used by the
  4349.         flooding procedure.     In fact, these    adjacencies are    fully
  4350.         capable of transmitting and    receiving all types of OSPF
  4351.         routing protocol packets.
  4352.  
  4353.     Loading
  4354.         In this state, Link    State Request packets are sent to the
  4355.         neighbor asking for    the more recent    LSAs that have been
  4356.         discovered (but not    yet received) in the Exchange state.
  4357.  
  4358.     Full
  4359.         In this state, the neighboring routers are fully adjacent.
  4360.         These adjacencies will now appear in router-LSAs and
  4361.         network-LSAs.
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368. Moy                                   [Page 78]
  4369.  
  4370. Internet Draft             OSPF Version 2            January 1997
  4371.  
  4372.  
  4373.     10.2.  Events causing neighbor state changes
  4374.  
  4375.     State changes can be effected by a number of events.  These
  4376.     events are shown in the    labels of the arcs in Figures 12 and 13.
  4377.     The label definitions are as follows:
  4378.  
  4379.  
  4380.     HelloReceived
  4381.         An Hello packet has    been received from the neighbor.
  4382.  
  4383.     Start
  4384.         This is an indication that Hello Packets should now    be sent
  4385.         to the neighbor at intervals of HelloInterval seconds.  This
  4386.         event is generated only for    neighbors associated with NBMA
  4387.         networks.
  4388.  
  4389.     2-WayReceived
  4390.         Bidirectional communication    has been realized between the
  4391.         two    neighboring routers.  This is indicated    by the router
  4392.         seeing itself in the neighbor's Hello packet.
  4393.  
  4394.     NegotiationDone
  4395.         The    Master/Slave relationship has been negotiated, and DD
  4396.         sequence numbers have been exchanged.  This    signals    the
  4397.         start of the sending/receiving of Database Description
  4398.         packets.  For more information on the generation of    this
  4399.         event, consult Section 10.8.
  4400.  
  4401.     ExchangeDone
  4402.         Both routers have successfully transmitted a full sequence
  4403.         of Database    Description packets.  Each router now knows what
  4404.         parts of its link state database are out of    date.  For more
  4405.         information    on the generation of this event, consult Section
  4406.         10.8.
  4407.  
  4408.     BadLSReq
  4409.         A Link State Request has been received for an LSA not
  4410.         contained in the database.    This indicates an error    in the
  4411.         Database Exchange process.
  4412.  
  4413.     Loading    Done
  4414.         Link State Updates have been received for all out-of-date
  4415.         portions of    the database.  This is indicated by the    Link
  4416.         state request list becoming    empty after the    Database
  4417.         Exchange process has completed.
  4418.  
  4419.     AdjOK?
  4420.         A decision must be made as to whether an adjacency should be
  4421.  
  4422.  
  4423.  
  4424. Moy                                   [Page 79]
  4425.  
  4426. Internet Draft             OSPF Version 2            January 1997
  4427.  
  4428.  
  4429.         established/maintained with    the neighbor.  This event will
  4430.         start some adjacencies forming, and    destroy    others.
  4431.  
  4432.  
  4433.     The following events cause well    developed neighbors to revert to
  4434.     lesser states.    Unlike the above events, these events may occur
  4435.     when the neighbor conversation is in any of a number of    states.
  4436.  
  4437.  
  4438.     SeqNumberMismatch
  4439.         A Database Description packet has been received that either
  4440.         a) has an unexpected DD sequence number, b)    unexpectedly has
  4441.         the    Init bit set or    c) has an Options field    differing from
  4442.         the    last Options field received in a Database Description
  4443.         packet.  Any of these conditions indicate that some    error
  4444.         has    occurred during    adjacency establishment.
  4445.  
  4446.     1-Way
  4447.         An Hello packet has    been received from the neighbor, in
  4448.         which the router is    not mentioned.    This indicates that
  4449.         communication with the neighbor is not bidirectional.
  4450.  
  4451.     KillNbr
  4452.         This  is  an  indication that  all    communication  with  the
  4453.         neighbor  is now  impossible,  forcing  the     neighbor  to
  4454.         revert  to    Down  state.
  4455.  
  4456.     InactivityTimer
  4457.         The    inactivity Timer has fired.  This means    that no    Hello
  4458.         packets have been seen recently from the neighbor.    The
  4459.         neighbor reverts to    Down state.
  4460.  
  4461.     LLDown
  4462.         This is an indication from the lower level protocols that
  4463.         the    neighbor is now    unreachable.  For example, on an X.25
  4464.         network this could be indicated by an X.25 clear indication
  4465.         with appropriate cause and diagnostic fields.  This    event
  4466.         forces the neighbor    into Down state.
  4467.  
  4468.  
  4469.     10.3.  The Neighbor    state machine
  4470.  
  4471.     A detailed description of the neighbor state changes follows.
  4472.     Each state change is invoked by    an event (Section 10.2).  This
  4473.     event may produce different effects, depending on the current
  4474.     state of the neighbor.    For this reason, the state machine below
  4475.     is organized by    current    neighbor state and received event.  Each
  4476.     entry in the state machine describes the resulting new neighbor
  4477.  
  4478.  
  4479.  
  4480. Moy                                   [Page 80]
  4481.  
  4482. Internet Draft             OSPF Version 2            January 1997
  4483.  
  4484.  
  4485.     state and the required set of additional actions.
  4486.  
  4487.     When a neighbor's state    changes, it may    be necessary to    rerun
  4488.     the Designated Router election algorithm.  This    is determined by
  4489.     whether    the interface NeighborChange event is generated    (see
  4490.     Section    9.2).  Also, if    the Interface is in DR state (the router
  4491.     is itself Designated Router), changes in neighbor state    may
  4492.     cause a    new network-LSA    to be originated (see Section 12.4).
  4493.  
  4494.     When the neighbor state    machine    needs to invoke    the interface
  4495.     state machine, it should be done as a scheduled    task (see
  4496.     Section    4.4).  This simplifies things, by ensuring that    neither
  4497.     state machine will be executed recursively.
  4498.  
  4499.  
  4500.      State(s):  Down
  4501.  
  4502.         Event:  Start
  4503.  
  4504.     New state:  Attempt
  4505.  
  4506.        Action:  Send an Hello Packet to the    neighbor (this neighbor
  4507.             is always associated with an NBMA network) and start
  4508.             the    Inactivity Timer for the neighbor.  The    timer's
  4509.             later firing would indicate    that communication with
  4510.             the    neighbor was not attained.
  4511.  
  4512.  
  4513.      State(s):  Attempt
  4514.  
  4515.         Event:  HelloReceived
  4516.  
  4517.     New state:  Init
  4518.  
  4519.        Action:  Restart the    Inactivity Timer for the neighbor, since
  4520.             the    neighbor has now been heard from.
  4521.  
  4522.  
  4523.      State(s):  Down
  4524.  
  4525.         Event:  HelloReceived
  4526.  
  4527.     New state:  Init
  4528.  
  4529.        Action:  Start the Inactivity Timer for the neighbor.  The
  4530.             timer's later firing would indicate    that the
  4531.             neighbor is    dead.
  4532.  
  4533.  
  4534.  
  4535.  
  4536. Moy                                   [Page 81]
  4537.  
  4538. Internet Draft             OSPF Version 2            January 1997
  4539.  
  4540.  
  4541.      State(s):  Init or greater
  4542.  
  4543.         Event:  HelloReceived
  4544.  
  4545.     New state:  No state change.
  4546.  
  4547.        Action:  Restart the    Inactivity Timer for the neighbor, since
  4548.             the    neighbor has again been    heard from.
  4549.  
  4550.  
  4551.      State(s):  Init
  4552.  
  4553.         Event:  2-WayReceived
  4554.  
  4555.     New state:  Depends upon action    routine.
  4556.  
  4557.        Action:  Determine whether an adjacency should be established
  4558.             with the neighbor (see Section 10.4).  If not, the
  4559.             new    neighbor state is 2-Way.
  4560.  
  4561.             Otherwise (an adjacency should be established) the
  4562.             neighbor state transitions to ExStart.  Upon
  4563.             entering this state, the router increments the DD
  4564.             sequence number in the neighbor data structure.  If
  4565.             this is the    first time that    an adjacency has been
  4566.             attempted, the DD sequence number should be    assigned
  4567.             some unique    value (like the    time of    day clock).  It
  4568.             then declares itself master    (sets the master/slave
  4569.             bit    to master), and    starts sending Database
  4570.             Description    Packets, with the initialize (I), more
  4571.             (M)    and master (MS)    bits set.  This    Database
  4572.             Description    Packet should be otherwise empty.  This
  4573.             Database Description Packet    should be retransmitted
  4574.             at intervals of RxmtInterval until the next    state is
  4575.             entered (see Section 10.8).
  4576.  
  4577.  
  4578.      State(s):  ExStart
  4579.  
  4580.         Event:  NegotiationDone
  4581.  
  4582.     New state:  Exchange
  4583.  
  4584.        Action:  The    router must list the contents of its entire area
  4585.             link state database    in the neighbor    Database summary
  4586.             list.  The area link state database    consists of the
  4587.             router-LSAs, network-LSAs and summary-LSAs contained
  4588.             in the area    structure, along with the AS-external-
  4589.  
  4590.  
  4591.  
  4592. Moy                                   [Page 82]
  4593.  
  4594. Internet Draft             OSPF Version 2            January 1997
  4595.  
  4596.  
  4597.             LSAs contained in the global structure.  AS-
  4598.             external-LSAs are omitted from a virtual neighbor's
  4599.             Database summary list.  AS-external-LSAs are omitted
  4600.             from the Database summary list if the area has been
  4601.             configured as a stub (see Section 3.6).  LSAs whose
  4602.             age    is equal to MaxAge are instead added to    the
  4603.             neighbor's Link state retransmission list.    A
  4604.             summary of the Database summary list will be sent to
  4605.             the    neighbor in Database Description packets.  Each
  4606.             Database Description Packet    has a DD sequence
  4607.             number, and    is explicitly acknowledged.  Only one
  4608.             Database Description Packet    is allowed outstanding
  4609.             at any one time.  For more detail on the sending and
  4610.             receiving of Database Description packets, see
  4611.             Sections 10.8 and 10.6.
  4612.  
  4613.  
  4614.      State(s):  Exchange
  4615.  
  4616.         Event:  ExchangeDone
  4617.  
  4618.     New state:  Depends upon action    routine.
  4619.  
  4620.        Action:  If the neighbor Link state request list is empty,
  4621.             the    new neighbor state is Full.  No    other action is
  4622.             required.  This is an adjacency's final state.
  4623.  
  4624.             Otherwise, the new neighbor    state is Loading.  Start
  4625.             (or    continue) sending Link State Request packets to
  4626.             the    neighbor (see Section 10.9).  These are    requests
  4627.             for    the neighbor's more recent LSAs    (which were
  4628.             discovered but not yet received in the Exchange
  4629.             state).  These LSAs    are listed in the Link state
  4630.             request list associated with the neighbor.
  4631.  
  4632.  
  4633.      State(s):  Loading
  4634.  
  4635.         Event:  Loading Done
  4636.  
  4637.     New state:  Full
  4638.  
  4639.        Action:  No action required.     This is an adjacency's    final
  4640.             state.
  4641.  
  4642.  
  4643.      State(s):  2-Way
  4644.  
  4645.  
  4646.  
  4647.  
  4648. Moy                                   [Page 83]
  4649.  
  4650. Internet Draft             OSPF Version 2            January 1997
  4651.  
  4652.  
  4653.         Event:  AdjOK?
  4654.  
  4655.     New state:  Depends upon action    routine.
  4656.  
  4657.        Action:  Determine whether an adjacency should be formed with
  4658.             the    neighboring router (see    Section    10.4).    If not,
  4659.             the    neighbor state remains at 2-Way.  Otherwise,
  4660.             transition the neighbor state to ExStart and perform
  4661.             the    actions    associated with    the above state    machine
  4662.             entry for state Init and event 2-WayReceived.
  4663.  
  4664.  
  4665.      State(s):  ExStart or greater
  4666.  
  4667.         Event:  AdjOK?
  4668.  
  4669.     New state:  Depends upon action    routine.
  4670.  
  4671.        Action:  Determine whether the neighboring router should
  4672.             still be adjacent.    If yes,    there is no state change
  4673.             and    no further action is necessary.
  4674.  
  4675.             Otherwise, the (possibly partially formed) adjacency
  4676.             must be destroyed.    The neighbor state transitions
  4677.             to 2-Way.  The Link    state retransmission list,
  4678.             Database summary list and Link state request list
  4679.             are    cleared    of LSAs.
  4680.  
  4681.  
  4682.      State(s):  Exchange or    greater
  4683.  
  4684.         Event:  SeqNumberMismatch
  4685.  
  4686.     New state:  ExStart
  4687.  
  4688.        Action:  The    (possibly partially formed) adjacency is torn
  4689.             down, and then an attempt is made at
  4690.             reestablishment.  The neighbor state first
  4691.             transitions    to ExStart.  The Link state
  4692.             retransmission list, Database summary list and Link
  4693.             state request list are cleared of LSAs.  Then the
  4694.             router increments the DD sequence number in    the
  4695.             neighbor data structure, declares itself master
  4696.             (sets the master/slave bit to master), and starts
  4697.             sending Database Description Packets, with the
  4698.             initialize (I), more (M) and master    (MS) bits set.
  4699.             This Database Description Packet should be otherwise
  4700.             empty (see Section 10.8).
  4701.  
  4702.  
  4703.  
  4704. Moy                                   [Page 84]
  4705.  
  4706. Internet Draft             OSPF Version 2            January 1997
  4707.  
  4708.  
  4709.      State(s):  Exchange or    greater
  4710.  
  4711.         Event:  BadLSReq
  4712.  
  4713.     New state:  ExStart
  4714.  
  4715.        Action:  The    action for event BadLSReq is exactly the same as
  4716.             for    the neighbor event SeqNumberMismatch.  The
  4717.             (possibly partially    formed)    adjacency is torn down,
  4718.             and    then an    attempt    is made    at reestablishment.  For
  4719.             more information, see the neighbor state machine
  4720.             entry that is invoked when event SeqNumberMismatch
  4721.             is generated in state Exchange or greater.
  4722.  
  4723.  
  4724.      State(s):  Any    state
  4725.  
  4726.         Event:  KillNbr
  4727.  
  4728.     New state:  Down
  4729.  
  4730.        Action:  The    Link state retransmission list,    Database summary
  4731.             list and Link state    request    list are cleared of
  4732.             LSAs.  Also, the Inactivity    Timer is disabled.
  4733.  
  4734.  
  4735.      State(s):  Any    state
  4736.  
  4737.         Event:  LLDown
  4738.  
  4739.     New state:  Down
  4740.  
  4741.        Action:  The    Link state retransmission list,    Database summary
  4742.             list and Link state    request    list are cleared of
  4743.             LSAs.  Also, the Inactivity    Timer is disabled.
  4744.  
  4745.  
  4746.      State(s):  Any    state
  4747.  
  4748.         Event:  InactivityTimer
  4749.  
  4750.     New state:  Down
  4751.  
  4752.        Action:  The    Link state retransmission list,    Database summary
  4753.             list and Link state    request    list are cleared of
  4754.             LSAs.
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760. Moy                                   [Page 85]
  4761.  
  4762. Internet Draft             OSPF Version 2            January 1997
  4763.  
  4764.  
  4765.      State(s):  2-Way or greater
  4766.  
  4767.         Event:  1-WayReceived
  4768.  
  4769.     New state:  Init
  4770.  
  4771.        Action:  The    Link state retransmission list,    Database summary
  4772.             list and Link state    request    list are cleared of
  4773.             LSAs.
  4774.  
  4775.  
  4776.      State(s):  2-Way or greater
  4777.  
  4778.         Event:  2-WayReceived
  4779.  
  4780.     New state:  No state change.
  4781.  
  4782.        Action:  No action required.
  4783.  
  4784.  
  4785.      State(s):  Init
  4786.  
  4787.         Event:  1-WayReceived
  4788.  
  4789.     New state:  No state change.
  4790.  
  4791.        Action:  No action required.
  4792.  
  4793.  
  4794.     10.4.  Whether to become adjacent
  4795.  
  4796.     Adjacencies are    established with some subset of    the router's
  4797.     neighbors.  Routers connected by point-to-point    networks,
  4798.     Point-to-MultiPoint networks and virtual links always become
  4799.     adjacent.  On broadcast    and NBMA networks, all routers become
  4800.     adjacent to both the Designated    Router and the Backup Designated
  4801.     Router.
  4802.  
  4803.     The adjacency-forming decision occurs in two places in the
  4804.     neighbor state machine.     First,    when bidirectional communication
  4805.     is initially established with the neighbor, and    secondly, when
  4806.     the identity of    the attached network's (Backup)    Designated
  4807.     Router changes.     If the    decision is made to not    attempt    an
  4808.     adjacency, the state of    the neighbor communication stops at 2-
  4809.     Way.
  4810.  
  4811.     An adjacency should be established with    a bidirectional    neighbor
  4812.     when at    least one of the following conditions holds:
  4813.  
  4814.  
  4815.  
  4816. Moy                                   [Page 86]
  4817.  
  4818. Internet Draft             OSPF Version 2            January 1997
  4819.  
  4820.  
  4821.     o   The    underlying network type    is point-to-point
  4822.  
  4823.     o   The    underlying network type    is Point-to-MultiPoint
  4824.  
  4825.     o   The    underlying network type    is virtual link
  4826.  
  4827.     o   The    router itself is the Designated    Router
  4828.  
  4829.     o   The    router itself is the Backup Designated Router
  4830.  
  4831.     o   The    neighboring router is the Designated Router
  4832.  
  4833.     o   The    neighboring router is the Backup Designated Router
  4834.  
  4835.  
  4836.     10.5.  Receiving Hello Packets
  4837.  
  4838.     This section explains the detailed processing of a received
  4839.     Hello Packet.  (See Section A.3.2 for the format of Hello
  4840.     packets.)  The generic input processing    of OSPF    packets    will
  4841.     have checked the validity of the IP header and the OSPF    packet
  4842.     header.     Next, the values of the Network Mask, HelloInterval,
  4843.     and RouterDeadInterval fields in the received Hello packet must
  4844.     be checked against the values configured for the receiving
  4845.     interface.  Any    mismatch causes    processing to stop and the
  4846.     packet to be dropped.  In other    words, the above fields    are
  4847.     really describing the attached network's configuration.    However,
  4848.     there is one exception to the above rule: on point-to-point
  4849.     networks and on    virtual    links, the Network Mask    in the received
  4850.     Hello Packet should be ignored.
  4851.  
  4852.     The receiving interface    attaches to a single OSPF area (this
  4853.     could be the backbone).     The setting of    the E-bit found    in the
  4854.     Hello Packet's Options field must match    this area's
  4855.     ExternalRoutingCapability.  If AS-external-LSAs    are not    flooded
  4856.     into/throughout    the area (i.e, the area    is a "stub") the E-bit
  4857.     must be    clear in received Hello    Packets, otherwise the E-bit
  4858.     must be    set.  A    mismatch causes    processing to stop and the
  4859.     packet to be dropped.  The setting of the rest of the bits in
  4860.     the Hello Packet's Options field should    be ignored.
  4861.  
  4862.     At this    point, an attempt is made to match the source of the
  4863.     Hello Packet to    one of the receiving interface's neighbors.  If
  4864.     the receiving interface    connects to a broadcast, Point-to-
  4865.     MultiPoint or NBMA network the source is identified by the IP
  4866.     source address found in    the Hello's IP header.    If the receiving
  4867.     interface connects to a    point-to-point link or a virtual link,
  4868.     the source is identified by the    Router ID found    in the Hello's
  4869.  
  4870.  
  4871.  
  4872. Moy                                   [Page 87]
  4873.  
  4874. Internet Draft             OSPF Version 2            January 1997
  4875.  
  4876.  
  4877.     OSPF packet header.  The interface's current list of neighbors
  4878.     is contained in    the interface's    data structure.     If a matching
  4879.     neighbor structure cannot be found, (i.e., this    is the first
  4880.     time the neighbor has been detected), one is created.  The
  4881.     initial    state of a newly created neighbor is set to Down.
  4882.  
  4883.     When receiving an Hello    Packet from a neighbor on a broadcast,
  4884.     Point-to-MultiPoint or NBMA network, set the neighbor
  4885.     structure's Neighbor ID    equal to the Router ID found in    the
  4886.     packet's OSPF header.  When receiving an Hello on a point-to-
  4887.     point network (but not on a virtual link) set the neighbor
  4888.     structure's Neighbor IP    address    to the packet's    IP source
  4889.     address.
  4890.  
  4891.     Now the    rest of    the Hello Packet is examined, generating events
  4892.     to be given to the neighbor and    interface state    machines.  These
  4893.     state machines are specified either to be executed or scheduled
  4894.     (see Section 4.4).  For    example, by specifying below that the
  4895.     neighbor state machine be executed in line, several neighbor
  4896.     state transitions may be effected by a single received Hello:
  4897.  
  4898.  
  4899.     o   Each Hello Packet causes the neighbor state    machine    to be
  4900.         executed with the event HelloReceived.
  4901.  
  4902.     o   Then the list of neighbors contained in the    Hello Packet is
  4903.         examined.  If the router itself appears in this list, the
  4904.         neighbor state machine should be executed with the event 2-
  4905.         WayReceived.  Otherwise, the neighbor state    machine    should
  4906.         be executed    with the event 1-WayReceived, and the processing
  4907.         of the packet stops.
  4908.  
  4909.     o   Next, the Hello Packet's Router Priority field is examined.
  4910.         If this field is different than the    one previously received
  4911.         from the neighbor, the receiving interface's state machine
  4912.         is scheduled with the event    NeighborChange.     In any    case,
  4913.         the    Router Priority    field in the neighbor data structure
  4914.         should be updated accordingly.
  4915.  
  4916.     o   Next the Designated    Router field in    the Hello Packet is
  4917.         examined.  If the neighbor is both declaring itself    to be
  4918.         Designated Router (Designated Router field = Neighbor IP
  4919.         address) and the Backup Designated Router field in the
  4920.         packet is equal to 0.0.0.0 and the receiving interface is in
  4921.         state Waiting, the receiving interface's state machine is
  4922.         scheduled with the event BackupSeen.  Otherwise, if    the
  4923.         neighbor is    declaring itself to be Designated Router and it
  4924.         had    not previously,    or the neighbor    is not declaring itself
  4925.  
  4926.  
  4927.  
  4928. Moy                                   [Page 88]
  4929.  
  4930. Internet Draft             OSPF Version 2            January 1997
  4931.  
  4932.  
  4933.         Designated Router where it had previously, the receiving
  4934.         interface's    state machine is scheduled with    the event
  4935.         NeighborChange.  In    any case, the Neighbors' Designated
  4936.         Router item    in the neighbor    structure is updated
  4937.         accordingly.
  4938.  
  4939.     o   Finally, the Backup    Designated Router field    in the Hello
  4940.         Packet is examined.     If the    neighbor is declaring itself to
  4941.         be Backup Designated Router    (Backup    Designated Router field
  4942.         = Neighbor IP address) and the receiving interface is in
  4943.         state Waiting, the receiving interface's state machine is
  4944.         scheduled with the event BackupSeen.  Otherwise, if    the
  4945.         neighbor is    declaring itself to be Backup Designated Router
  4946.         and    it had not previously, or the neighbor is not declaring
  4947.         itself Backup Designated Router where it had previously, the
  4948.         receiving interface's state    machine    is scheduled with the
  4949.         event NeighborChange.  In any case,    the Neighbor's Backup
  4950.         Designated Router item in the neighbor structure is    updated
  4951.         accordingly.
  4952.  
  4953.     On NBMA    networks, receipt of an    Hello Packet may also cause an
  4954.     Hello Packet to    be sent    back to    the neighbor in    response. See
  4955.     Section    9.5.1 for more details.
  4956.  
  4957.  
  4958.     10.6.  Receiving Database Description Packets
  4959.  
  4960.     This section explains the detailed processing of a received
  4961.     Database Description Packet.  The incoming Database Description
  4962.     Packet has already been    associated with    a neighbor and receiving
  4963.     interface by the generic input packet processing (Section 8.2).
  4964.     Whether    the Database Description packet    should be accepted, and
  4965.     if so, how it should be    further    processed depends upon the
  4966.     neighbor state.
  4967.  
  4968.     If a Database Description packet is accepted, the following
  4969.     packet fields should be    saved in the corresponding neighbor data
  4970.     structure under    "last received Database    Description packet":
  4971.     the packet's initialize(I), more (M) and master(MS) bits,
  4972.     Options    field, and DD sequence number. If these    fields are set
  4973.     identically in two consecutive Database    Description packets
  4974.     received from the neighbor, the    second Database    Description
  4975.     packet is considered to    be a "duplicate" in the    processing
  4976.     described below.
  4977.  
  4978.     If the Interface MTU field in the Database Description packet
  4979.     indicates an IP    datagram size that is larger than the router can
  4980.     accept on the receiving    interface without fragmentation, the
  4981.  
  4982.  
  4983.  
  4984. Moy                                   [Page 89]
  4985.  
  4986. Internet Draft             OSPF Version 2            January 1997
  4987.  
  4988.  
  4989.     Database Description packet is rejected.  Otherwise, if    the
  4990.     neighbor state is:
  4991.  
  4992.     Down
  4993.         The    packet should be rejected.
  4994.  
  4995.     Attempt
  4996.         The    packet should be rejected.
  4997.  
  4998.     Init
  4999.         The    neighbor state machine should be executed with the event
  5000.         2-WayReceived.  This causes    an immediate state change to
  5001.         either state 2-Way or state    ExStart. If the    new state is
  5002.         ExStart, the processing of the current packet should then
  5003.         continue in    this new state by falling through to case
  5004.         ExStart below.
  5005.  
  5006.     2-Way
  5007.         The    packet should be ignored.  Database Description    Packets
  5008.         are    used only for the purpose of bringing up adjacencies.[7]
  5009.  
  5010.     ExStart
  5011.         If the received packet matches one of the following    cases,
  5012.         then the neighbor state machine should be executed with the
  5013.         event NegotiationDone (causing the state to    transition to
  5014.         Exchange), the packet's Options field should be recorded in
  5015.         the    neighbor structure's Neighbor Options field and    the
  5016.         packet should be accepted as next in sequence and processed
  5017.         further (see below).  Otherwise, the packet    should be
  5018.         ignored.
  5019.  
  5020.         o    The initialize(I), more    (M) and    master(MS) bits    are set,
  5021.         the contents of    the packet are empty, and the neighbor's
  5022.         Router ID is larger than the router's own.  In this case
  5023.         the router is now Slave.  Set the master/slave bit to
  5024.         slave, and set the neighbor data structure's DD    sequence
  5025.         number to that specified by the    master.
  5026.  
  5027.         o    The initialize(I) and master(MS) bits are off, the
  5028.         packet's DD sequence number equals the neighbor    data
  5029.         structure's DD sequence    number (indicating
  5030.         acknowledgment)    and the    neighbor's Router ID is    smaller
  5031.         than the router's own.    In this    case the router    is
  5032.         Master.
  5033.  
  5034.     Exchange
  5035.         Duplicate Database Description packets are discarded by the
  5036.         master, and    cause the slave    to retransmit the last Database
  5037.  
  5038.  
  5039.  
  5040. Moy                                   [Page 90]
  5041.  
  5042. Internet Draft             OSPF Version 2            January 1997
  5043.  
  5044.  
  5045.         Description    packet that it had sent. Otherwise (the    packet
  5046.         is not a duplicate):
  5047.  
  5048.         o    If the state of    the MS-bit is inconsistent with    the
  5049.         master/slave state of the connection, generate the
  5050.         neighbor event SeqNumberMismatch and stop processing the
  5051.         packet.
  5052.  
  5053.         o    If the initialize(I) bit is set, generate the neighbor
  5054.         event SeqNumberMismatch    and stop processing the    packet.
  5055.  
  5056.         o    If the packet's    Options    field indicates    a different set
  5057.         of optional OSPF capabilities than were    previously
  5058.         received from the neighbor (recorded in    the Neighbor
  5059.         Options    field of the neighbor structure), generate the
  5060.         neighbor event SeqNumberMismatch and stop processing the
  5061.         packet.
  5062.  
  5063.         o    Database Description packets must be processed in
  5064.         sequence, as indicated by the packets' DD sequence
  5065.         numbers. If the    router is master, the next packet
  5066.         received should    have DD    sequence number    equal to the DD
  5067.         sequence number    in the neighbor    data structure.    If the
  5068.         router is slave, the next packet received should have DD
  5069.         sequence number    equal to one more than the DD sequence
  5070.         number stored in the neighbor data structure. In either
  5071.         case, if the packet is the next    in sequence it should be
  5072.         accepted and its contents processed as specified below.
  5073.  
  5074.         o    Else, generate the neighbor event SeqNumberMismatch and
  5075.         stop processing    the packet.
  5076.  
  5077.     Loading    or Full
  5078.         In this state, the router has sent and received an entire
  5079.         sequence of    Database Description Packets.  The only    packets
  5080.         received should be duplicates (see above).    In particular,
  5081.         the    packet's Options field should match the    set of optional
  5082.         OSPF capabilities previously indicated by the neighbor
  5083.         (stored in the neighbor structure's    Neighbor Options field).
  5084.         Any    other packets received,    including the reception    of a
  5085.         packet with    the Initialize(I) bit set, should generate the
  5086.         neighbor event SeqNumberMismatch.[8] Duplicates should be
  5087.         discarded by the master.  The slave    must respond to
  5088.         duplicates by repeating the    last Database Description packet
  5089.         that it had    sent.
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096. Moy                                   [Page 91]
  5097.  
  5098. Internet Draft             OSPF Version 2            January 1997
  5099.  
  5100.  
  5101.     When the router    accepts    a received Database Description    Packet
  5102.     as the next in sequence    the packet contents are    processed as
  5103.     follows.  For each LSA listed, the LSA's LS type is checked for
  5104.     validity.  If the LS type is unknown (e.g., not    one of the LS
  5105.     types 1-5 defined by this specification), or if    this is    an AS-
  5106.     external-LSA (LS type =    5) and the neighbor is associated with a
  5107.     stub area, generate the    neighbor event SeqNumberMismatch and
  5108.     stop processing    the packet.  Otherwise,    the router looks up the
  5109.     LSA in its database to see whether it also has an instance of
  5110.     the LSA.  If it    does not, or if    the database copy is less recent
  5111.     (see Section 13.1), the    LSA is put on the Link state request
  5112.     list so    that it    can be requested (immediately or at some later
  5113.     time) in Link State Request Packets.
  5114.  
  5115.     When the router    accepts    a received Database Description    Packet
  5116.     as the next in sequence, it also performs the following    actions,
  5117.     depending on whether it    is master or slave:
  5118.  
  5119.  
  5120.     Master
  5121.         Increments the DD sequence number in the neighbor data
  5122.         structure.    If the router has already sent its entire
  5123.         sequence of    Database Description Packets, and the just
  5124.         accepted packet has    the more bit (M) set to    0, the neighbor
  5125.         event ExchangeDone is generated.  Otherwise, it should send
  5126.         a new Database Description to the slave.
  5127.  
  5128.     Slave
  5129.         Sets the DD    sequence number    in the neighbor    data structure
  5130.         to the DD sequence number appearing    in the received    packet.
  5131.         The    slave must send    a Database Description Packet in reply.
  5132.         If the received packet has the more    bit (M)    set to 0, and
  5133.         the    packet to be sent by the slave will also have the M-bit
  5134.         set    to 0, the neighbor event ExchangeDone is generated.
  5135.         Note that the slave    always generates this event before the
  5136.         master.
  5137.  
  5138.  
  5139.     10.7.  Receiving Link State    Request    Packets
  5140.  
  5141.     This section explains the detailed processing of received Link
  5142.     State Request packets.    Received Link State Request Packets
  5143.     specify    a list of LSAs that the    neighbor wishes    to receive.
  5144.     Link State Request Packets should be accepted when the neighbor
  5145.     is in states Exchange, Loading,    or Full.  In all other states
  5146.     Link State Request Packets should be ignored.
  5147.  
  5148.     Each LSA specified in the Link State Request packet should be
  5149.  
  5150.  
  5151.  
  5152. Moy                                   [Page 92]
  5153.  
  5154. Internet Draft             OSPF Version 2            January 1997
  5155.  
  5156.  
  5157.     located    in the router's    database, and copied into Link State
  5158.     Update packets for transmission    to the neighbor.  These    LSAs
  5159.     should NOT be placed on    the Link state retransmission list for
  5160.     the neighbor.  If an LSA cannot    be found in the    database,
  5161.     something has gone wrong with the Database Exchange process, and
  5162.     neighbor event BadLSReq    should be generated.
  5163.  
  5164.  
  5165.     10.8.  Sending Database Description    Packets
  5166.  
  5167.     This section describes how Database Description    Packets    are sent
  5168.     to a neighbor. The Database Description    packet's Interface MTU
  5169.     field is set to    the size of the    largest    IP datagram that can be
  5170.     sent out the sending interface,    without    fragmentation.    Common
  5171.     MTUs in    use in the Internet can    be found in Table 7-1 of
  5172.     [Ref22]. Interface MTU should be set to    0 in Database
  5173.     Description packets sent over virtual links.
  5174.  
  5175.     The router's optional OSPF capabilities    (see Section 4.5) are
  5176.     transmitted to the neighbor in the Options field of the    Database
  5177.     Description packet.  The router    should maintain    the same set of
  5178.     optional capabilities throughout the Database Exchange and
  5179.     flooding procedures.  If for some reason the router's optional
  5180.     capabilities change, the Database Exchange procedure should be
  5181.     restarted by reverting to neighbor state ExStart.  There are
  5182.     currently two optional capabilities defined.  The T-bit    should
  5183.     be set if and only if the router is capable of calculating
  5184.     separate routes    for each IP TOS.  The E-bit should be set if and
  5185.     only if    the attached network belongs to    a non-stub area.  The
  5186.     rest of    the Options field should be set    to zero.
  5187.  
  5188.     The sending of Database    Description packets depends on the
  5189.     neighbor's state.  In state ExStart the    router sends empty
  5190.     Database Description packets, with the initialize (I), more (M)
  5191.     and master (MS)    bits set.  These packets are retransmitted every
  5192.     RxmtInterval seconds.
  5193.  
  5194.     In state Exchange the Database Description Packets actually
  5195.     contain    summaries of the link state information    contained in the
  5196.     router's database.  Each LSA in    the area's link-state database
  5197.     (at the    time the neighbor transitions into Exchange state) is
  5198.     listed in the neighbor Database    summary    list.  Each new    Database
  5199.     Description Packet copies its DD sequence number from the
  5200.     neighbor data structure    and then describes the current top of
  5201.     the Database summary list.  Items are removed from the Database
  5202.     summary    list when the previous packet is acknowledged.
  5203.  
  5204.     In state Exchange, the determination of    when to    send a Database
  5205.  
  5206.  
  5207.  
  5208. Moy                                   [Page 93]
  5209.  
  5210. Internet Draft             OSPF Version 2            January 1997
  5211.  
  5212.  
  5213.     Description packet depends on whether the router is master or
  5214.     slave:
  5215.  
  5216.  
  5217.     Master
  5218.         Database Description packets are sent when either a) the
  5219.         slave acknowledges the previous Database Description packet
  5220.         by echoing the DD sequence number or b) RxmtInterval seconds
  5221.         elapse without an acknowledgment, in which case the    previous
  5222.         Database Description packet    is retransmitted.
  5223.  
  5224.     Slave
  5225.         Database Description packets are sent only in response to
  5226.         Database Description packets received from the master.  If
  5227.         the    Database Description packet received from the master is
  5228.         new, a new Database    Description packet is sent, otherwise
  5229.         the    previous Database Description packet is    resent.
  5230.  
  5231.  
  5232.     In states Loading and Full the slave must resend its last
  5233.     Database Description packet in response    to duplicate Database
  5234.     Description packets received from the master.  For this    reason
  5235.     the slave must wait RouterDeadInterval seconds before freeing
  5236.     the last Database Description packet.  Reception of a Database
  5237.     Description packet from    the master after this interval will
  5238.     generate a SeqNumberMismatch neighbor event.
  5239.  
  5240.  
  5241.     10.9.  Sending Link    State Request Packets
  5242.  
  5243.     In neighbor states Exchange or Loading,    the Link state request
  5244.     list contains a    list of    those LSAs that    need to    be obtained from
  5245.     the neighbor.  To request these    LSAs, a    router sends the
  5246.     neighbor the beginning of the Link state request list, packaged
  5247.     in a Link State    Request    packet.
  5248.  
  5249.     When the neighbor responds to these requests with the proper
  5250.     Link State Update packet(s), the Link state request list is
  5251.     truncated and a    new Link State Request packet is sent.    This
  5252.     process    continues until    the Link state request list becomes
  5253.     empty.    Unsatisfied Link State Request packets are retransmitted
  5254.     at intervals of    RxmtInterval.  There should be at most one Link
  5255.     State Request packet outstanding at any    one time.
  5256.  
  5257.     When the Link state request list becomes empty,    and the    neighbor
  5258.     state is Loading (i.e.,    a complete sequence of Database
  5259.     Description packets has    been sent to and received from the
  5260.     neighbor), the Loading Done neighbor event is generated.
  5261.  
  5262.  
  5263.  
  5264. Moy                                   [Page 94]
  5265.  
  5266. Internet Draft             OSPF Version 2            January 1997
  5267.  
  5268.  
  5269.     10.10.  An Example
  5270.  
  5271.     Figure 14 shows    an example of an adjacency forming.  Routers RT1
  5272.     and RT2    are both connected to a    broadcast network.  It is
  5273.     assumed    that RT2 is the    Designated Router for the network, and
  5274.     that RT2 has a higher Router ID    than Router RT1.
  5275.  
  5276.     The neighbor state changes realized by each router are listed on
  5277.     the sides of the figure.
  5278.  
  5279.     At the beginning of Figure 14, Router RT1's interface to the
  5280.     network    becomes    operational.  It begins    sending    Hello Packets,
  5281.     although it doesn't know the identity of the Designated    Router
  5282.     or of any other    neighboring routers.  Router RT2 hears this
  5283.     hello (moving the neighbor to Init state), and in its next Hello
  5284.     Packet indicates that it is itself the Designated Router and
  5285.     that it    has heard Hello    Packets    from RT1.  This    in turn    causes
  5286.     RT1 to go to state ExStart, as it starts to bring up the
  5287.     adjacency.
  5288.  
  5289.     RT1 begins by asserting    itself as the master.  When it sees that
  5290.     RT2 is indeed the master (because of RT2's higher Router ID),
  5291.     RT1 transitions    to slave state and adopts its neighbor's DD
  5292.     sequence number.  Database Description packets are then
  5293.     exchanged, with    polls coming from the master (RT2) and responses
  5294.     from the slave (RT1).  This sequence of    Database Description
  5295.     Packets    ends when both the poll    and associated response    has the
  5296.     M-bit off.
  5297.  
  5298.     In this    example, it is assumed that RT2    has a completely up to
  5299.     date database.    In that    case, RT2 goes immediately into    Full
  5300.     state.    RT1 will go into Full state after updating the necessary
  5301.     parts of its database.    This is    done by    sending    Link State
  5302.     Request    Packets, and receiving Link State Update Packets in
  5303.     response.  Note    that, while RT1    has waited until a complete set
  5304.     of Database Description    Packets    has been received (from    RT2)
  5305.     before sending any Link    State Request Packets, this need not be
  5306.     the case.  RT1 could have interleaved the sending of Link State
  5307.     Request    Packets    with the reception of Database Description
  5308.     Packets.
  5309.  
  5310.  
  5311. 11.  The Routing Table Structure
  5312.  
  5313.     The    routing    table data structure contains all the information
  5314.     necessary to forward an IP data packet toward its destination.  Each
  5315.     routing table entry    describes the collection of best paths to a
  5316.     particular destination.  When forwarding an    IP data    packet,    the
  5317.  
  5318.  
  5319.  
  5320. Moy                                   [Page 95]
  5321.  
  5322. Internet Draft             OSPF Version 2            January 1997
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.         +---+                      +---+
  5331.         |RT1|                      |RT2|
  5332.         +---+                      +---+
  5333.  
  5334.         Down                      Down
  5335.                 Hello(DR=0,seen=0)
  5336.                ------------------------------>
  5337.              Hello (DR=RT2,seen=RT1,...)      Init
  5338.                <------------------------------
  5339.         ExStart       D-D (Seq=x,I,M,Master)
  5340.                ------------------------------>
  5341.                D-D (Seq=y,I,M,Master)      ExStart
  5342.                <------------------------------
  5343.         Exchange       D-D (Seq=y,M,Slave)
  5344.                ------------------------------>
  5345.                D-D (Seq=y+1,M,Master)      Exchange
  5346.                <------------------------------
  5347.                D-D (Seq=y+1,M,Slave)
  5348.                ------------------------------>
  5349.                      ...
  5350.                      ...
  5351.                      ...
  5352.                D-D (Seq=y+n, Master)
  5353.                <------------------------------
  5354.                D-D (Seq=y+n, Slave)
  5355.          Loading   ------------------------------>
  5356.                  LS Request           Full
  5357.                ------------------------------>
  5358.                  LS Update
  5359.                <------------------------------
  5360.                  LS Request
  5361.                ------------------------------>
  5362.                  LS Update
  5363.                <------------------------------
  5364.          Full
  5365.  
  5366.  
  5367.            Figure 14: An adjacency bring-up example
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376. Moy                                   [Page 96]
  5377.  
  5378. Internet Draft             OSPF Version 2            January 1997
  5379.  
  5380.  
  5381.     routing table entry    providing the best match for the packet's IP
  5382.     destination    is located.  The matching routing table    entry then
  5383.     provides the next hop towards the packet's destination.  OSPF also
  5384.     provides for the existence of a default route (Destination ID =
  5385.     DefaultDestination,    Address    Mask =    0x00000000).  When the default
  5386.     route exists, it matches all IP destinations (although any other
  5387.     matching entry is a    better match).    Finding    the routing table entry
  5388.     that best matches an IP destination    is further described in    Section
  5389.     11.1.
  5390.  
  5391.     There is a single routing table in each router.  Two sample    routing
  5392.     tables are described in Sections 11.2 and 11.3.  The building of the
  5393.     routing table is discussed in Section 16.
  5394.  
  5395.     The    rest of    this section defines the fields    found in a routing table
  5396.     entry.  The    first set of fields describes the routing table    entry's
  5397.     destination.
  5398.  
  5399.  
  5400.     Destination    Type
  5401.     Destination type is either "network" or    "router". Only network
  5402.     entries    are actually used when forwarding IP data traffic.
  5403.     Router routing table entries are used solely as    intermediate
  5404.     steps in the routing table build process.
  5405.  
  5406.     A network is a range of    IP addresses, to which IP data traffic
  5407.     may be forwarded.  This    includes IP networks (class A, B, or C),
  5408.     IP subnets, IP supernets and single IP hosts.  The default route
  5409.     also falls into    this category.
  5410.  
  5411.     Router entries are kept    for area border    routers    and AS boundary
  5412.     routers.  Routing table    entries    for area border    routers    are used
  5413.     when calculating the inter-area    routes (see Section 16.2), and
  5414.     when maintaining configured virtual links (see Section 15).
  5415.     Routing    table entries for AS boundary routers are used when
  5416.     calculating the    AS external routes (see    Section    16.4).
  5417.  
  5418.     Destination    ID
  5419.     The destination's identifier or    name.  This depends on the
  5420.     Destination Type.  For networks, the identifier    is their
  5421.     associated IP address.    For routers, the identifier is the OSPF
  5422.     Router ID.[9]
  5423.  
  5424.     Address Mask
  5425.     Only defined for networks.  The    network's IP address together
  5426.     with its address mask defines a    range of IP addresses.    For IP
  5427.     subnets, the address mask is referred to as the    subnet mask.
  5428.     For host routes, the mask is "all ones"    (0xffffffff).
  5429.  
  5430.  
  5431.  
  5432. Moy                                   [Page 97]
  5433.  
  5434. Internet Draft             OSPF Version 2            January 1997
  5435.  
  5436.  
  5437.     Optional Capabilities
  5438.     When the destination is    a router this field indicates the
  5439.     optional OSPF capabilities supported by    the destination    router.
  5440.     The two    optional capabilities currently    defined    by this
  5441.     specification are the ability to route based on    IP TOS and the
  5442.     ability    to process AS-external-LSAs.  For a further discussion
  5443.     of OSPF's optional capabilities, see Section 4.5.
  5444.  
  5445.  
  5446.     The    set of paths to    use for    a destination may vary based on    IP Type
  5447.     of Service and the OSPF area to which the paths belong.  This means
  5448.     that there may be multiple routing table entries for the same
  5449.     destination, depending on the values of the    next two fields.
  5450.  
  5451.  
  5452.     Type of Service
  5453.     There can be a separate    set of routes for each IP Type of
  5454.     Service.  The encoding of TOS in OSPF LSAs is described    in
  5455.     Section    12.3.
  5456.  
  5457.     Area
  5458.     This field indicates the area whose link state information has
  5459.     led to the routing table entry's collection of paths.  This is
  5460.     called the entry's associated area.  For sets of AS external
  5461.     paths, this field is not defined.  For destinations of type
  5462.     "router", there    may be separate    sets of    paths (and therefore
  5463.     separate routing table entries)    associated with    each of    several
  5464.     areas. For example, this will happen when two area border
  5465.     routers    share multiple areas in    common.     For destinations of
  5466.     type "network",    only the set of    paths associated with the best
  5467.     area (the one providing    the preferred route) is    kept.
  5468.  
  5469.  
  5470.     The    rest of    the routing table entry    describes the set of paths to
  5471.     the    destination.  The following fields pertain to the set of paths
  5472.     as a whole.     In other words, each one of the paths contained in a
  5473.     routing table entry    is of the same path-type and cost (see below).
  5474.  
  5475.  
  5476.     Path-type
  5477.     There are four possible    types of paths used to route traffic to
  5478.     the destination, listed    here in    order of preference: intra-area,
  5479.     inter-area, type 1 external or type 2 external.     Intra-area
  5480.     paths indicate destinations belonging to one of    the router's
  5481.     attached areas.     Inter-area paths are paths to destinations in
  5482.     other OSPF areas.  These are discovered    through    the examination
  5483.     of received summary-LSAs.  AS external paths are paths to
  5484.     destinations external to the AS.  These    are detected through the
  5485.  
  5486.  
  5487.  
  5488. Moy                                   [Page 98]
  5489.  
  5490. Internet Draft             OSPF Version 2            January 1997
  5491.  
  5492.  
  5493.     examination of received    AS-external-LSAs.
  5494.  
  5495.     Cost
  5496.     The link state cost of the path    to the destination.  For all
  5497.     paths except type 2 external paths this    describes the entire
  5498.     path's cost.  For Type 2 external paths, this field describes
  5499.     the cost of the    portion    of the path internal to    the AS.     This
  5500.     cost is    calculated as the sum of the costs of the path's
  5501.     constituent links.
  5502.  
  5503.     Type 2 cost
  5504.     Only valid for type 2 external paths.  For these paths,    this
  5505.     field indicates    the cost of the    path's external    portion.  This
  5506.     cost has been advertised by an AS boundary router, and is the
  5507.     most significant part of the total path    cost.  For example, a
  5508.     type 2 external    path with type 2 cost of 5 is always preferred
  5509.     over a path with type 2    cost of    10, regardless of the cost of
  5510.     the two    paths' internal    components.
  5511.  
  5512.     Link State Origin
  5513.     Valid only for intra-area paths, this field indicates the LSA
  5514.     (router-LSA or network-LSA) that directly references the
  5515.     destination.  For example, if the destination is a transit
  5516.     network, this is the transit network's network-LSA.  If    the
  5517.     destination is a stub network, this is the router-LSA for the
  5518.     attached router.  The LSA is discovered    during the shortest-path
  5519.     tree calculation (see Section 16.1).  Multiple LSAs may
  5520.     reference the destination, however a tie-breaking scheme always
  5521.     reduces    the choice to a    single LSA. The    Link State Origin field
  5522.     is not used by the OSPF    protocol, but it is used by the    routing
  5523.     table calculation in OSPF's Multicast routing extensions
  5524.     (MOSPF).
  5525.  
  5526.     When multiple paths    of equal path-type and cost exist to a
  5527.     destination    (called    elsewhere "equal-cost" paths), they are    stored
  5528.     in a single    routing    table entry.  Each one of the "equal-cost" paths
  5529.     is distinguished by    the following fields:
  5530.  
  5531.  
  5532.     Next hop
  5533.     The outgoing router interface to use when forwarding traffic to
  5534.     the destination.  On broadcast,    Point-to-MultiPoint and    NBMA
  5535.     networks, the next hop also includes the IP address of the next
  5536.     router (if any)    in the path towards the    destination.
  5537.  
  5538.     Advertising    router
  5539.     Valid only for inter-area and AS external paths.  This field
  5540.     indicates the Router ID    of the router advertising the summary-
  5541.  
  5542.  
  5543.  
  5544. Moy                                   [Page 99]
  5545.  
  5546. Internet Draft             OSPF Version 2            January 1997
  5547.  
  5548.  
  5549.     LSA or AS-external-LSA that led    to this    path.
  5550.  
  5551.  
  5552.     11.1.  Routing table lookup
  5553.  
  5554.     When an    IP data    packet is received, an OSPF router finds the
  5555.     routing    table entry that best matches the packet's destination.
  5556.     This routing table entry then provides the outgoing interface
  5557.     and next hop router to use in forwarding the packet. This
  5558.     section    describes the process of finding the best matching
  5559.     routing    table entry. The process consists of a number of steps,
  5560.     wherein    the collection of routing table    entries    is progressively
  5561.     pruned.    In the end, the    single routing table entry remaining is
  5562.     called the "best match".
  5563.  
  5564.     Before the lookup begins, "discard" routing table entries should
  5565.     be inserted into the routing table for each of the router's
  5566.     active area address ranges (see    Section    3.5).  (An area    range is
  5567.     considered "active" if the range contains one or more networks
  5568.     reachable by intra-area    paths.)    The destination    of a "discard"
  5569.     entry is the set of addresses described    by its associated active
  5570.     area address range, and    the path type of each "discard"    entry is
  5571.     set to "inter-area".[10]
  5572.  
  5573.     Note that the steps described below may    fail to    produce    a best
  5574.     match routing table entry (i.e., all existing routing table
  5575.     entries    are pruned for some reason or another),    or the best
  5576.     match routing table entry may be one of    the above "discard"
  5577.     routing    table entries. In these    cases, the packet's IP
  5578.     destination is considered unreachable. Instead of being
  5579.     forwarded, the packet should be    discarded and an ICMP
  5580.     destination unreachable    message    should be returned to the
  5581.     packet's source.
  5582.  
  5583.  
  5584.     (1) Select the complete    set of "matching" routing table    entries
  5585.         from the routing table.  Each routing table    entry describes
  5586.         a (set of) path(s) to a range of IP    addresses. If the data
  5587.         packet's IP    destination falls into an entry's range    of IP
  5588.         addresses, the routing table entry is called a match. (It is
  5589.         quite likely that multiple entries will match the data
  5590.         packet.  For example, a default route will match all
  5591.         packets.)
  5592.  
  5593.     (2) Reduce the set of matching entries to those    having the most
  5594.         preferential path-type (see    Section    11). OSPF has a    four
  5595.         level hierarchy of paths. Intra-area paths are the most
  5596.         preferred, followed    in order by inter-area,    type 1 external
  5597.  
  5598.  
  5599.  
  5600. Moy                                  [Page 100]
  5601.  
  5602. Internet Draft             OSPF Version 2            January 1997
  5603.  
  5604.  
  5605.         and    type 2 external    paths.
  5606.  
  5607.     (3) Select the remaining routing table entry that provides the
  5608.         most specific (longest) match. Another way of saying this is
  5609.         to choose the remaining entry that specifies the narrowest
  5610.         range of IP    addresses.[11] For example, the    entry for the
  5611.         address/mask pair of (128.185.1.0, 0xffffff00) is more
  5612.         specific than an entry for the pair    (128.185.0.0,
  5613.         0xffff0000). The default route is the least    specific match,
  5614.         since it matches all destinations.
  5615.  
  5616.     (4) At this point, there may still be multiple routing table
  5617.         entries remaining. Each routing entry will specify the same
  5618.         range of IP    addresses, but a different IP Type of Service.
  5619.         Select the routing table entry whose TOS value matches the
  5620.         TOS    found in the packet header. If there is    no routing table
  5621.         entry for this TOS,    select the routing table entry for TOS
  5622.         0. In other    words, packets requesting TOS X    are routed along
  5623.         the    TOS 0 path if a    TOS X path does    not exist.
  5624.  
  5625.  
  5626.     11.2.  Sample routing table, without areas
  5627.  
  5628.     Consider the Autonomous    System pictured    in Figure 2.  No OSPF
  5629.     areas have been    configured.  A single metric is    shown per
  5630.     outbound interface, indicating that routes will    not vary based
  5631.     on TOS.     The calculation of Router RT6's routing table proceeds
  5632.     as described in    Section    2.2.  The resulting routing table is
  5633.     shown in Table 12.  Destination    types are abbreviated: Network
  5634.     as "N",    Router as "R".
  5635.  
  5636.     There are no instances of multiple equal-cost shortest paths in
  5637.     this example.  Also, since there are no    areas, there are no
  5638.     inter-area paths.
  5639.  
  5640.     Routers    RT5 and    RT7 are    AS boundary routers.  Intra-area routes
  5641.     have been calculated to    Routers    RT5 and    RT7.  This allows
  5642.     external routes    to be calculated to the    destinations advertised
  5643.     by RT5 and RT7 (i.e., Networks N12, N13, N14 and N15).    It is
  5644.     assumed    all AS-external-LSAs originated    by RT5 and RT7 are
  5645.     advertising type 1 external metrics.  This results in type 1
  5646.     external paths being calculated    to destinations    N12-N15.
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656. Moy                                  [Page 101]
  5657.  
  5658. Internet Draft             OSPF Version 2            January 1997
  5659.  
  5660.  
  5661.  
  5662.  
  5663.       Type   Dest   Area   Path     Type     Cost    Next     Adv.
  5664.                         Hop(s)     Router(s)
  5665.       ____________________________________________________________
  5666.       N         N1        0       intra-area     10    RT3     *
  5667.       N         N2        0       intra-area     10    RT3     *
  5668.       N         N3        0       intra-area     7    RT3     *
  5669.       N         N4        0       intra-area     8    RT3     *
  5670.       N         Ib        0       intra-area     7    *     *
  5671.       N         Ia        0       intra-area     12    RT10     *
  5672.       N         N6        0       intra-area     8    RT10     *
  5673.       N         N7        0       intra-area     12    RT10     *
  5674.       N         N8        0       intra-area     10    RT10     *
  5675.       N         N9        0       intra-area     11    RT10     *
  5676.       N         N10    0       intra-area     13    RT10     *
  5677.       N         N11    0       intra-area     14    RT10     *
  5678.       N         H1        0       intra-area     21    RT10     *
  5679.       R         RT5    0       intra-area     6    RT5     *
  5680.       ____________________________________________________________
  5681.       N         N12    *       type    1 ext.     10    RT10     RT7
  5682.       N         N13    *       type    1 ext.     14    RT5     RT5
  5683.       N         N14    *       type    1 ext.     14    RT5     RT5
  5684.       N         N15    *       type    1 ext.     17    RT10     RT7
  5685.  
  5686.  
  5687.            Table 12: The routing table for Router RT6
  5688.              (no configured    areas).
  5689.  
  5690.     11.3.  Sample routing table, with areas
  5691.  
  5692.     Consider the previous example, this time split into OSPF areas.
  5693.     An OSPF    area configuration is pictured in Figure 6.  Router
  5694.     RT4's routing table will be described for this area
  5695.     configuration.    Router RT4 has a connection to Area 1 and a
  5696.     backbone connection.  This causes Router RT4 to    view the AS as
  5697.     the concatenation of the two graphs shown in Figures 7 and 8.
  5698.     The resulting routing table is displayed in Table 13.
  5699.  
  5700.     Again, Routers RT5 and RT7 are AS boundary routers.  Routers
  5701.     RT3, RT4, RT7, RT10 and    RT11 are area border routers.  Note that
  5702.     there are two routing entries for the area border router RT3,
  5703.     since it has two areas in common with RT4 (Area    1 and the
  5704.     backbone).
  5705.  
  5706.     Backbone paths have been calculated to all area    border routers.
  5707.     These are used when determining    the inter-area routes.    Note
  5708.     that all of the    inter-area routes are associated with the
  5709.  
  5710.  
  5711.  
  5712. Moy                                  [Page 102]
  5713.  
  5714. Internet Draft             OSPF Version 2            January 1997
  5715.  
  5716.  
  5717.     backbone; this is always the case when the calculating router is
  5718.     itself an area border router.  Routing information is condensed
  5719.     at area    boundaries.  In    this example, we assume    that Area 3 has
  5720.     been defined so    that networks N9-N11 and the host route    to H1
  5721.     are all    condensed to a single route when advertised into the
  5722.     backbone (by Router RT11).  Note that the cost of this route is
  5723.     the maximum of the set of costs    to its individual components.
  5724.  
  5725.     There is a virtual link    configured between Routers RT10    and
  5726.     RT11.  Without this configured virtual link, RT11 would    be
  5727.     unable to advertise a route for    networks N9-N11    and Host H1 into
  5728.     the backbone, and there    would not be an    entry for these    networks
  5729.     in Router RT4's    routing    table.
  5730.  
  5731.     In this    example    there are two equal-cost paths to Network N12.
  5732.     However, they both use the same    next hop (Router RT5).
  5733.  
  5734.  
  5735.  
  5736.     Router RT4's routing table would improve (i.e.,    some of    the
  5737.     paths in the routing table would become    shorter) if an
  5738.     additional virtual link    were configured    between    Router RT4 and
  5739.     Router RT3.  The new virtual link would    itself be associated
  5740.     with the first entry for area border router RT3    in Table 13 (an
  5741.     intra-area path    through    Area 1).  This would yield a cost of 1
  5742.     for the    virtual    link.  The routing table entries changes that
  5743.     would be caused    by the addition    of this    virtual    link are shown
  5744.     in Table 14.
  5745.  
  5746.  
  5747.  
  5748. 12.  Link State    Advertisements (LSAs)
  5749.  
  5750.     Each router    in the Autonomous System originates one    or more    link
  5751.     state advertisements (LSAs).  This memo defines five distinct types
  5752.     of LSAs, which are described in Section 4.3.  The collection of LSAs
  5753.     forms the link-state database.  Each separate type of LSA has a
  5754.     separate function.    Router-LSAs and    network-LSAs describe how an
  5755.     area's routers and networks    are interconnected.  Summary-LSAs
  5756.     provide a way of condensing    an area's routing information.    AS-
  5757.     external-LSAs provide a way    of transparently advertising
  5758.     externally-derived routing information throughout the Autonomous
  5759.     System.
  5760.  
  5761.     Each LSA begins with a standard 20-byte header.  This LSA header is
  5762.     discussed below.
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768. Moy                                  [Page 103]
  5769.  
  5770. Internet Draft             OSPF Version 2            January 1997
  5771.  
  5772.  
  5773.  
  5774.  
  5775.    Type      Dest          Area   Path  Type       Cost      Next        Adv.
  5776.                           Hops(s)   Router(s)
  5777.    __________________________________________________________________
  5778.    N      N1          1         intra-area       4      RT1        *
  5779.    N      N2          1         intra-area       4      RT2        *
  5780.    N      N3          1         intra-area       1      *        *
  5781.    N      N4          1         intra-area       3      RT3        *
  5782.    __________________________________________________________________
  5783.    N      Ib          0         intra-area       22      RT5        *
  5784.    N      Ia          0         intra-area       27      RT5        *
  5785.    R      RT3          0         intra-area       21      RT5        *
  5786.    R      RT5          0         intra-area       8      *        *
  5787.    R      RT7          0         intra-area       14      RT5        *
  5788.    R      RT10          0         intra-area       22      RT5        *
  5789.    R      RT11          0         intra-area       25      RT5        *
  5790.    __________________________________________________________________
  5791.    N      N6          0         inter-area       15      RT5        RT7
  5792.    N      N7          0         inter-area       19      RT5        RT7
  5793.    N      N8          0         inter-area       18      RT5        RT7
  5794.    __________________________________________________________________
  5795.    N      N12          *         type 1 ext.   16      RT5        RT5,RT7
  5796.    N      N13          *         type 1 ext.   16      RT5        RT5
  5797.    N      N14          *         type 1 ext.   16      RT5        RT5
  5798.    N      N15          *         type 1 ext.   23      RT5        RT7
  5799.  
  5800.  
  5801.           Table    13: Router RT4's routing table
  5802.                in the presence of areas.
  5803.  
  5804.  
  5805.     Type   Dest           Area   Path  Type   Cost      Next       Adv.
  5806.                           Hop(s)   Router(s)
  5807.     ________________________________________________________________
  5808.     N       Ib           0      intra-area   16      RT3       *
  5809.     N       Ia           0      intra-area   21      RT3       *
  5810.     R       RT3           0      intra-area   1      *       *
  5811.     R       RT10           0      intra-area   16      RT3       *
  5812.     ________________________________________________________________
  5813.     N       N9-N11,H1   0      inter-area   30      RT3       RT11
  5814.  
  5815.  
  5816.           Table    14: Changes resulting from an
  5817.             additional virtual link.
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824. Moy                                  [Page 104]
  5825.  
  5826. Internet Draft             OSPF Version 2            January 1997
  5827.  
  5828.  
  5829.     12.1.  The LSA Header
  5830.  
  5831.     The LSA    header contains    the LS type, Link State    ID and
  5832.     Advertising Router fields.  The    combination of these three
  5833.     fields uniquely    identifies the LSA.
  5834.  
  5835.     There may be several instances of an LSA present in the
  5836.     Autonomous System, all at the same time.  It must then be
  5837.     determined which instance is more recent.  This    determination is
  5838.     made by    examining the LS sequence, LS checksum and LS age
  5839.     fields.     These fields are also contained in the    20-byte    LSA
  5840.     header.
  5841.  
  5842.     Several    of the OSPF packet types list LSAs.  When the instance
  5843.     is not important, an LSA is referred to    by its LS type,    Link
  5844.     State ID and Advertising Router    (see Link State    Request
  5845.     Packets).  Otherwise, the LS sequence number, LS age and LS
  5846.     checksum fields    must also be referenced.
  5847.  
  5848.     A detailed explanation of the fields contained in the LSA header
  5849.     follows.
  5850.  
  5851.  
  5852.     12.1.1.     LS age
  5853.  
  5854.         This field is the age of the LSA in    seconds.  It should be
  5855.         processed as an unsigned 16-bit integer.  It is set    to 0
  5856.         when the LSA is originated.     It must be incremented    by
  5857.         InfTransDelay on every hop of the flooding procedure.  LSAs
  5858.         are    also aged as they are held in each router's database.
  5859.  
  5860.         The    age of an LSA is never incremented past    MaxAge.     LSAs
  5861.         having age MaxAge are not used in the routing table
  5862.         calculation.  When an LSA's    age first reaches MaxAge, it is
  5863.         reflooded.    An LSA of age MaxAge is    finally    flushed    from the
  5864.         database when it is    no longer needed to ensure database
  5865.         synchronization.  For more information on the aging    of LSAs,
  5866.         consult Section 14.
  5867.  
  5868.         The    LS age field is    examined when a    router receives    two
  5869.         instances of an LSA, both having identical LS sequence
  5870.         numbers and    LS checksums.  An instance of age MaxAge is then
  5871.         always accepted as most recent; this allows    old LSAs to be
  5872.         flushed quickly from the routing domain.  Otherwise, if the
  5873.         ages differ    by more    than MaxAgeDiff, the instance having the
  5874.         smaller age    is accepted as most recent.[12]    See Section 13.1
  5875.         for    more details.
  5876.  
  5877.  
  5878.  
  5879.  
  5880. Moy                                  [Page 105]
  5881.  
  5882. Internet Draft             OSPF Version 2            January 1997
  5883.  
  5884.  
  5885.     12.1.2.     Options
  5886.  
  5887.         The    Options    field in the LSA header    indicates which    optional
  5888.         capabilities are associated    with the LSA.  OSPF's optional
  5889.         capabilities are described in Section 4.5.    There are
  5890.         currently two optional capabilities    defined; they are
  5891.         represented    by the T-bit and E-bit found in    the Options
  5892.         field.  The    rest of    the Options field should be set    to zero.
  5893.  
  5894.         The    E-bit represents OSPF's    ExternalRoutingCapability.  This
  5895.         bit    should be set in all LSAs associated with the backbone,
  5896.         and    all LSAs associated with non-stub areas    (see Section
  5897.         3.6).  It should also be set in all    AS-external-LSAs.  It
  5898.         should be reset in all router-LSAs,    network-LSAs and
  5899.         summary-LSAs associated with a stub    area.  For all LSAs, the
  5900.         setting of the E-bit is for    informational purposes only; it
  5901.         does not affect the    routing    table calculation.
  5902.  
  5903.         The    T-bit represents OSPF's    TOS routing capability.     This
  5904.         bit    should be set in a router-LSA if and only if the router
  5905.         is capable of calculating separate routes for each IP TOS
  5906.         (see Section 2.5).    The T-bit should always    be set in
  5907.         network-LSAs.  It should be    set in summary-LSAs and    AS-
  5908.         external-LSAs if and only if the LSA describes paths for all
  5909.         TOS    values,    instead    of just    the TOS    0 path.     Note that, with
  5910.         the    T-bit set, there may still be only a single metric in
  5911.         the    LSA (the TOS 0 metric).     This would mean that paths for
  5912.         non-zero TOS exist,    but are    equivalent to the TOS 0    path.
  5913.         An LSA's T-bit is examined when calculating    the routing
  5914.         table's non-zero TOS paths (see Section 16.9).
  5915.  
  5916.  
  5917.     12.1.3.     LS type
  5918.  
  5919.         The    LS type    field dictates the format and function of the
  5920.         LSA.  LSAs of different types have different names (e.g.,
  5921.         router-LSAs    or network-LSAs).  All LSA types defined by this
  5922.         memo, except the AS-external-LSAs (LS type = 5), are flooded
  5923.         throughout a single    area only.  AS-external-LSAs are flooded
  5924.         throughout the entire Autonomous System, excepting stub
  5925.         areas (see Section 3.6).  Each separate LSA    type is    briefly
  5926.         described below in Table 15.
  5927.  
  5928.     12.1.4.     Link State ID
  5929.  
  5930.         This field identifies the piece of the routing domain that
  5931.         is being described by the LSA.  Depending on the LSA's LS
  5932.         type, the Link State ID takes on the values    listed in Table
  5933.  
  5934.  
  5935.  
  5936. Moy                                  [Page 106]
  5937.  
  5938. Internet Draft             OSPF Version 2            January 1997
  5939.  
  5940.  
  5941.  
  5942.  
  5943.         LS Type   LSA description
  5944.         ________________________________________________
  5945.         1          These are    the router-LSAs.
  5946.               They describe the    collected
  5947.                states of the router's
  5948.               interfaces. For more information,
  5949.         ________________________________________________
  5950.         2          These are    the network-LSAs.
  5951.               They describe the    set of routers
  5952.               attached to the network. For
  5953.               more information,    consult
  5954.               Section 12.4.2.
  5955.         ________________________________________________
  5956.         3 or 4    These are    the summary-LSAs.
  5957.               They describe inter-area routes,
  5958.               and enable the condensation of
  5959.               routing information at area
  5960.               borders. Originated by area border
  5961.               routers, the Type    3 summary-LSAs
  5962.               describe routes to networks while    the
  5963.               Type 4 summary-LSAs describe routes to
  5964.         ________________________________________________
  5965.         5          These are    the AS-external-LSAs.
  5966.               Originated by AS boundary    routers,
  5967.               they describe routes
  5968.               to destinations external to the
  5969.               Autonomous System. A default route for
  5970.               the Autonomous System can    also be
  5971.               described    by an AS-external-LSA.
  5972.  
  5973.  
  5974.         Table 15: OSPF link    state advertisements (LSAs).
  5975.  
  5976.         16.
  5977.  
  5978.  
  5979.         Actually, for Type 3 summary-LSAs (LS type = 3) and    AS-
  5980.         external-LSAs (LS type = 5), the Link State    ID may
  5981.         additionally have one or more of the destination network's
  5982.         "host" bits    set. For example, when originating an AS-
  5983.         external-LSA for the network 10.0.0.0 with mask of
  5984.         255.0.0.0, the Link    State ID can be    set to anything    in the
  5985.         range 10.0.0.0 through 10.255.255.255 inclusive (although
  5986.         10.0.0.0 should be used whenever possible).    The freedom to
  5987.         set    certain    host bits allows a router to originate separate
  5988.         LSAs for two networks having the same address but different
  5989.  
  5990.  
  5991.  
  5992. Moy                                  [Page 107]
  5993.  
  5994. Internet Draft             OSPF Version 2            January 1997
  5995.  
  5996.  
  5997.  
  5998.  
  5999.         LS Type   Link State ID
  6000.         _______________________________________________
  6001.         1          The originating router's Router ID.
  6002.         2          The IP interface address of the
  6003.               network's    Designated Router.
  6004.         3          The destination network's    IP address.
  6005.         4          The Router ID of the described AS
  6006.               boundary router.
  6007.         5          The destination network's    IP address.
  6008.  
  6009.  
  6010.            Table 16: The LSA's Link State ID.
  6011.  
  6012.         masks. See Appendix    E for details.
  6013.  
  6014.         When the LSA is describing a network (LS type = 2, 3 or 5),
  6015.         the    network's IP address is    easily derived by masking the
  6016.         Link State ID with the network/subnet mask contained in the
  6017.         body of the    LSA.  When the LSA is describing a router (LS
  6018.         type = 1 or    4), the    Link State ID is always    the described
  6019.         router's OSPF Router ID.
  6020.  
  6021.         When an AS-external-LSA (LS    Type = 5) is describing    a
  6022.         default route, its Link State ID is    set to
  6023.         DefaultDestination (0.0.0.0).
  6024.  
  6025.  
  6026.     12.1.5.     Advertising Router
  6027.  
  6028.         This field specifies the OSPF Router ID of the LSA's
  6029.         originator.     For router-LSAs, this field is    identical to the
  6030.         Link State ID field.  Network-LSAs are originated by the
  6031.         network's Designated Router.  Summary-LSAs originated by
  6032.         area border    routers.  AS-external-LSAs are originated by AS
  6033.         boundary routers.
  6034.  
  6035.  
  6036.     12.1.6.     LS sequence number
  6037.  
  6038.         The    sequence number    field is a signed 32-bit integer.  It is
  6039.         used to detect old and duplicate LSAs.  The    space of
  6040.         sequence numbers is    linearly ordered.  The larger the
  6041.         sequence number (when compared as signed 32-bit integers)
  6042.         the    more recent the    LSA.  To describe to sequence number
  6043.         space more precisely, let N    refer in the discussion    below to
  6044.         the    constant 2**31.
  6045.  
  6046.  
  6047.  
  6048. Moy                                  [Page 108]
  6049.  
  6050. Internet Draft             OSPF Version 2            January 1997
  6051.  
  6052.  
  6053.         The    sequence number    -N (0x80000000)    is reserved (and
  6054.         unused).  This leaves -N + 1 (0x80000001) as the smallest
  6055.         (and therefore oldest) sequence number; this sequence number
  6056.         is referred    to as the constant InitialSequenceNumber. A
  6057.         router uses    InitialSequenceNumber the first    time it
  6058.         originates any LSA.     Afterwards, the LSA's sequence    number
  6059.         is incremented each    time the router    originates a new
  6060.         instance of    the LSA.  When an attempt is made to increment
  6061.         the    sequence number    past the maximum value of N - 1
  6062.         (0x7fffffff; also referred to as MaxSequenceNumber), the
  6063.         current instance of    the LSA    must first be flushed from the
  6064.         routing domain.  This is done by prematurely aging the LSA
  6065.         (see Section 14.1) and reflooding it.  As soon as this flood
  6066.         has    been acknowledged by all adjacent neighbors, a new
  6067.         instance can be originated with sequence number of
  6068.         InitialSequenceNumber.
  6069.  
  6070.         The    router may be forced to    promote    the sequence number of
  6071.         one    of its LSAs when a more    recent instance    of the LSA is
  6072.         unexpectedly received during the flooding process.    This
  6073.         should be a    rare event.  This may indicate that an out-of-
  6074.         date LSA, originated by the    router itself before its last
  6075.         restart/reload, still exists in the    Autonomous System.  For
  6076.         more information see Section 13.4.
  6077.  
  6078.  
  6079.     12.1.7.     LS checksum
  6080.  
  6081.         This field is the checksum of the complete contents    of the
  6082.         LSA, excepting the LS age field.  The LS age field is
  6083.         excepted so    that an    LSA's age can be incremented without
  6084.         updating the checksum.  The    checksum used is the same that
  6085.         is used for    ISO connectionless datagrams; it is commonly
  6086.         referred to    as the Fletcher    checksum.  It is documented in
  6087.         Annex B of [Ref6].    The LSA    header also contains the length
  6088.         of the LSA in bytes; subtracting the size of the LS    age
  6089.         field (two bytes) yields the amount    of data    to checksum.
  6090.  
  6091.         The    checksum is used to detect data    corruption of an LSA.
  6092.         This corruption can    occur while an LSA is being flooded, or
  6093.         while it is    being held in a    router's memory.  The LS
  6094.         checksum field cannot take on the value of zero; the
  6095.         occurrence of such a value should be considered a checksum
  6096.         failure.  In other words, calculation of the checksum is not
  6097.         optional.
  6098.  
  6099.         The    checksum of an LSA is verified in two cases:  a) when it
  6100.         is received    in a Link State    Update Packet and b) at    times
  6101.  
  6102.  
  6103.  
  6104. Moy                                  [Page 109]
  6105.  
  6106. Internet Draft             OSPF Version 2            January 1997
  6107.  
  6108.  
  6109.         during the aging of    the link state database.  The detection
  6110.         of a checksum failure leads    to separate actions in each
  6111.         case.  See Sections    13 and 14 for more details.
  6112.  
  6113.         Whenever the LS sequence number field indicates that two
  6114.         instances of an LSA    are the    same, the LS checksum field is
  6115.         examined.  If there    is a difference, the instance with the
  6116.         larger LS checksum is considered to    be most    recent.[13] See
  6117.         Section 13.1 for more details.
  6118.  
  6119.  
  6120.     12.2.  The link state database
  6121.  
  6122.     A router has a separate    link state database for    every area to
  6123.     which it belongs. All routers belonging    to the same area have
  6124.     identical link state databases for the area.
  6125.  
  6126.     The databases for each individual area are always dealt    with
  6127.     separately.  The shortest path calculation is performed
  6128.     separately for each area (see Section 16).  Components of the
  6129.     area link-state    database are flooded throughout    the area only.
  6130.     Finally, when an adjacency (belonging to Area A) is being
  6131.     brought    up, only the database for Area A is synchronized between
  6132.     the two    routers.
  6133.  
  6134.     The area database is composed of router-LSAs, network-LSAs and
  6135.     summary-LSAs (all listed in the    area data structure).  In
  6136.     addition, external routes (AS-external-LSAs) are included in all
  6137.     non-stub area databases    (see Section 3.6).
  6138.  
  6139.     An implementation of OSPF must be able to access individual
  6140.     pieces of an area database.  This lookup function is based on an
  6141.     LSA's LS type, Link State ID and Advertising Router.[14] There
  6142.     will be    a single instance (the most up-to-date)    of each    LSA in
  6143.     the database.  The database lookup function is invoked during
  6144.     the LSA    flooding procedure (Section 13)    and the    routing    table
  6145.     calculation (Section 16).  In addition,    using this lookup
  6146.     function the router can    determine whether it has itself    ever
  6147.     originated a particular    LSA, and if so,    with what LS sequence
  6148.     number.
  6149.  
  6150.     An LSA is added    to a router's database when either a) it is
  6151.     received during    the flooding process (Section 13) or b)    it is
  6152.     originated by the router itself    (Section 12.4).     An LSA    is
  6153.     deleted    from a router's    database when either a)    it has been
  6154.     overwritten by a newer instance    during the flooding process
  6155.     (Section 13) or    b) the router originates a newer instance of one
  6156.     of its self-originated LSAs (Section 12.4) or c) the LSA ages
  6157.  
  6158.  
  6159.  
  6160. Moy                                  [Page 110]
  6161.  
  6162. Internet Draft             OSPF Version 2            January 1997
  6163.  
  6164.  
  6165.     out and    is flushed from    the routing domain (Section 14).
  6166.     Whenever an LSA    is deleted from    the database it    must also be
  6167.     removed    from all neighbors' Link state retransmission lists (see
  6168.     Section    10).
  6169.  
  6170.  
  6171.     12.3.  Representation of TOS
  6172.  
  6173.     All OSPF LSAs (with the    exception of network-LSAs) specify
  6174.     metrics.  In router-LSAs, the metrics indicate the costs of the
  6175.     described interfaces.  In summary-LSAs and AS-external-LSAs, the
  6176.     metric indicates the cost of the described path.  In all of
  6177.     these LSAs, a separate metric can be specified for each    IP TOS.
  6178.     The encoding of    TOS in OSPF LSAs is specified in Table 17. That
  6179.     table relates the OSPF encoding    to the IP packet header's TOS
  6180.     field (defined in [Ref12]).  The OSPF encoding is expressed as a
  6181.     decimal    integer, and the IP packet header's TOS    field is
  6182.     expressed in the binary    TOS values used    in [Ref12].
  6183.  
  6184.  
  6185.  
  6186.             OSPF encoding   RFC    1349 TOS values
  6187.             ___________________________________________
  6188.             0            0000 normal    service
  6189.             2            0001 minimize monetary cost
  6190.             4            0010 maximize reliability
  6191.             6            0011
  6192.             8            0100 maximize throughput
  6193.             10            0101
  6194.             12            0110
  6195.             14            0111
  6196.             16            1000 minimize delay
  6197.             18            1001
  6198.             20            1010
  6199.             22            1011
  6200.             24            1100
  6201.             26            1101
  6202.             28            1110
  6203.             30            1111
  6204.  
  6205.  
  6206.             Table 17: Representing TOS in OSPF.
  6207.  
  6208.  
  6209.     Each OSPF LSA must specify the TOS 0 metric.  Other TOS    metrics,
  6210.     if they    appear,    must appear in order of    increasing TOS encoding.
  6211.     For example, the TOS 8 (maximize throughput) metric must always
  6212.     appear before the TOS 16 (minimize delay) metric when both are
  6213.  
  6214.  
  6215.  
  6216. Moy                                  [Page 111]
  6217.  
  6218. Internet Draft             OSPF Version 2            January 1997
  6219.  
  6220.  
  6221.     specified.  If a metric    for some non-zero TOS is not specified,
  6222.     its cost defaults to the cost for TOS 0, unless    the T-bit is
  6223.     reset in the LSA's Options field (see Section 12.1.2 for more
  6224.     details).
  6225.  
  6226.  
  6227.     12.4.  Originating LSAs
  6228.  
  6229.     Into any given OSPF area, a router will    originate several LSAs.
  6230.     Each router originates a router-LSA.  If the router is also the
  6231.     Designated Router for any of the area's    networks, it will
  6232.     originate network-LSAs for those networks.
  6233.  
  6234.     Area border routers originate a    single summary-LSA for each
  6235.     known inter-area destination.  AS boundary routers originate a
  6236.     single AS-external-LSA for each    known AS external destination.
  6237.     Destinations are advertised one    at a time so that the change in
  6238.     any single route can be    flooded    without    reflooding the entire
  6239.     collection of routes.  During the flooding procedure, many LSAs
  6240.     can be carried by a single Link    State Update packet.
  6241.  
  6242.     As an example, consider    Router RT4 in Figure 6.     It is an area
  6243.     border router, having a    connection to Area 1 and the backbone.
  6244.     Router RT4 originates 5    distinct LSAs into the backbone    (one
  6245.     router-LSA, and    one summary-LSA    for each of the    networks N1-N4).
  6246.     Router RT4 will    also originate 8 distinct LSAs into Area 1 (one
  6247.     router-LSA and seven summary-LSAs as pictured in Figure    7).  If
  6248.     RT4 has    been selected as Designated Router for Network N3, it
  6249.     will also originate a network-LSA for N3 into Area 1.
  6250.  
  6251.     In this    same figure, Router RT5    will be    originating 3 distinct
  6252.     AS-external-LSAs (one for each of the networks N12-N14).  These
  6253.     will be    flooded    throughout the entire AS, assuming that    none of
  6254.     the areas have been configured as stubs.  However, if area 3 has
  6255.     been configured    as a stub area,    the AS-external-LSAs for
  6256.     networks N12-N14 will not be flooded into area 3 (see Section
  6257.     3.6).  Instead,    Router RT11 would originate a default summary-
  6258.     LSA that would be flooded throughout area 3 (see Section
  6259.     12.4.3).  This instructs all of    area 3's internal routers to
  6260.     send their AS external traffic to RT11.
  6261.  
  6262.     Whenever a new instance    of an LSA is originated, its LS    sequence
  6263.     number is incremented, its LS age is set to 0, its LS checksum
  6264.     is calculated, and the LSA is added to the link    state database
  6265.     and flooded out    the appropriate    interfaces.  See Section 13.2
  6266.     for details concerning the installation    of the LSA into    the link
  6267.     state database.     See Section 13.3 for details concerning the
  6268.     flooding of newly originated LSAs.
  6269.  
  6270.  
  6271.  
  6272. Moy                                  [Page 112]
  6273.  
  6274. Internet Draft             OSPF Version 2            January 1997
  6275.  
  6276.  
  6277.     The ten    events that can    cause a    new instance of    an LSA to be
  6278.     originated are:
  6279.  
  6280.  
  6281.     (1) The    LS age field of    one of the router's self-originated LSAs
  6282.         reaches the    value LSRefreshTime. In    this case, a new
  6283.         instance of    the LSA    is originated, even though the contents
  6284.         of the LSA (apart from the LSA header) will    be the same.
  6285.         This guarantees periodic originations of all LSAs.    This
  6286.         periodic updating of LSAs adds robustness to the link state
  6287.         algorithm.    LSAs that solely describe unreachable
  6288.         destinations should    not be refreshed, but should instead be
  6289.         flushed from the routing domain (see Section 14.1).
  6290.  
  6291.  
  6292.     When whatever is being described by an LSA changes, a new LSA is
  6293.     originated.  However, two instances of the same    LSA may    not be
  6294.     originated within the time period MinLSInterval.  This may
  6295.     require    that the generation of the next    instance be delayed by
  6296.     up to MinLSInterval.  The following events may cause the
  6297.     contents of an LSA to change.  These events should cause new
  6298.     originations if    and only if the    contents of the    new LSA    would be
  6299.     different:
  6300.  
  6301.  
  6302.     (2) An interface's state changes (see Section 9.1).  This may
  6303.         mean that it is necessary to produce a new instance    of the
  6304.         router-LSA.
  6305.  
  6306.     (3) An attached    network's Designated Router changes.  A    new
  6307.         router-LSA should be originated.  Also, if the router itself
  6308.         is now the Designated Router, a new    network-LSA should be
  6309.         produced.  If the router itself is no longer the Designated
  6310.         Router, any    network-LSA that it might have originated for
  6311.         the    network    should be flushed from the routing domain (see
  6312.         Section 14.1).
  6313.  
  6314.     (4) One    of the neighboring routers changes to/from the FULL
  6315.         state.  This may mean that it is necessary to produce a new
  6316.         instance of    the router-LSA.     Also, if the router is    itself
  6317.         the    Designated Router for the attached network, a new
  6318.         network-LSA    should be produced.
  6319.  
  6320.  
  6321.     The next four events concern area border routers only:
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328. Moy                                  [Page 113]
  6329.  
  6330. Internet Draft             OSPF Version 2            January 1997
  6331.  
  6332.  
  6333.     (5) An intra-area route    has been added/deleted/modified    in the
  6334.         routing table.  This may cause a new instance of a summary-
  6335.         LSA    (for this route) to be originated in each attached area
  6336.         (possibly including    the backbone).
  6337.  
  6338.     (6) An inter-area route    has been added/deleted/modified    in the
  6339.         routing table.  This may cause a new instance of a summary-
  6340.         LSA    (for this route) to be originated in each attached area
  6341.         (but NEVER for the backbone).
  6342.  
  6343.     (7) The    router becomes newly attached to an area.  The router
  6344.         must then originate    summary-LSAs into the newly attached
  6345.         area for all pertinent intra-area and inter-area routes in
  6346.         the    router's routing table.     See Section 12.4.3 for    more
  6347.         details.
  6348.  
  6349.     (8) When the state of one of the router's configured virtual
  6350.         links changes, it may be necessary to originate a new
  6351.         router-LSA into the    virtual    link's Transit area (see the
  6352.         discussion of the router-LSA's bit V in Section 12.4.1), as
  6353.         well as originating    a new router-LSA into the backbone.
  6354.  
  6355.  
  6356.     The last two events concern AS boundary    routers    (and former AS
  6357.     boundary routers) only:
  6358.  
  6359.  
  6360.     (9) An external    route gained through direct experience with an
  6361.         external routing protocol (like BGP) changes.  This    will
  6362.         cause an AS    boundary router    to originate a new instance of
  6363.         an AS-external-LSA.
  6364.  
  6365.     (10)
  6366.         A router ceases to be an AS    boundary router, perhaps after
  6367.         restarting.    In this    situation the router should flush all
  6368.         AS-external-LSAs that it had previously originated.     These
  6369.         LSAs can be    flushed    via the    premature aging    procedure
  6370.         specified in Section 14.1.
  6371.  
  6372.  
  6373.     The construction of each type of LSA is    explained in detail
  6374.     below.    In general, these sections describe the    contents of the
  6375.     LSA body (i.e.,    the part coming    after the 20-byte LSA header).
  6376.     For information    concerning the building    of the LSA header, see
  6377.     Section    12.1.
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384. Moy                                  [Page 114]
  6385.  
  6386. Internet Draft             OSPF Version 2            January 1997
  6387.  
  6388.  
  6389.  
  6390.           ....................................
  6391.           . 192.1.2              Area 1 .
  6392.           .    +                 .
  6393.           .    |                 .
  6394.           .    | 3+---+1             .
  6395.           .  N1    |--|RT1|-----+             .
  6396.           .    |  +---+      \             .
  6397.           .    |           \  _______N3  .
  6398.           .    +        \/     \   .    1+---+
  6399.           .            * 192.1.1 *------|RT4|
  6400.           .    +        /\_______/   .     +---+
  6401.           .    |           /     |         .
  6402.           .    | 3+---+1     /         |         .
  6403.           .  N2    |--|RT2|-----+        1|         .
  6404.           .    |  +---+       +---+8    .           6+---+
  6405.           .    |           |RT3|----------------|RT6|
  6406.           .    +           +---+     .        +---+
  6407.           . 192.1.3             |2         .     18.10.0.6|7
  6408.           .                 |         .          |
  6409.           .              +------------+ .
  6410.           .            192.1.4    (N4) .
  6411.           ....................................
  6412.  
  6413.  
  6414.             Figure 15: Area 1 with IP addresses    shown
  6415.  
  6416.     12.4.1.     Router-LSAs
  6417.  
  6418.         A router originates    a router-LSA for each area that    it
  6419.         belongs to.     Such an LSA describes the collected states of
  6420.         the    router's links to the area.  The LSA is    flooded
  6421.         throughout the particular area, and    no further.
  6422.  
  6423.         The    format of a router-LSA is shown    in Appendix A (Section
  6424.         A.4.2).  The first 20 bytes    of the LSA consist of the
  6425.         generic LSA    header that was    discussed in Section 12.1.
  6426.         router-LSAs    have LS    type = 1.  The router indicates    whether
  6427.         it is willing to calculate separate    routes for each    IP TOS
  6428.         by setting (or resetting) the T-bit    of the LSA's Options
  6429.         field.
  6430.  
  6431.         A router also indicates whether it is an area border router,
  6432.         or an AS boundary router, by setting the appropriate bits
  6433.         (bit B and bit E, respectively) in its router-LSAs.    This
  6434.         enables paths to those types of routers to be saved    in the
  6435.         routing table, for later processing    of summary-LSAs    and AS-
  6436.         external-LSAs.  Bit    B should be set    whenever the router is
  6437.  
  6438.  
  6439.  
  6440. Moy                                  [Page 115]
  6441.  
  6442. Internet Draft             OSPF Version 2            January 1997
  6443.  
  6444.  
  6445.         actively attached to two or    more areas, even if the    router
  6446.         is not currently attached to the OSPF backbone area.  Bit E
  6447.         should never be set    in a router-LSA    for a stub area    (stub
  6448.         areas cannot contain AS boundary routers).
  6449.  
  6450.         In addition, the router sets bit V in its router-LSA for
  6451.         Area A if and only if the router is    the endpoint of    one or
  6452.         more fully adjacent    virtual    links having Area A as their
  6453.         Transit area. The setting of bit V enables other routers in
  6454.         Area A to discover whether the area    supports transit traffic
  6455.         (see TransitCapability in Section 6).
  6456.  
  6457.         The    router-LSA then    describes the router's working
  6458.         connections    (i.e., interfaces or links) to the area.  Each
  6459.         link is typed according to the kind    of attached network.
  6460.         Each link is also labelled with its    Link ID.  This Link ID
  6461.         gives a name to the    entity that is on the other end    of the
  6462.         link.  Table 18 summarizes the values used for the Type and
  6463.         Link ID fields.
  6464.  
  6465.  
  6466.  
  6467.            Link    type   Description     Link ID
  6468.            __________________________________________________
  6469.            1           Point-to-point     Neighbor Router ID
  6470.                    link
  6471.            2           Link to transit     Interface address of
  6472.                    network         Designated Router
  6473.            3           Link to stub     IP network number
  6474.                    network
  6475.            4           Virtual link     Neighbor Router ID
  6476.  
  6477.  
  6478.                Table 18: Link descriptions in the
  6479.                       router-LSA.
  6480.  
  6481.  
  6482.         In addition, the Link Data field is    specified for each link.
  6483.         This field gives 32    bits of    extra information for the link.
  6484.         For    links to transit networks, numbered point-to-point links
  6485.         and    virtual    links, this field specifies the    IP interface
  6486.         address of the associated router interface (this is    needed
  6487.         by the routing table calculation, see Section 16.1.1).  For
  6488.         links to stub networks, this field specifies the stub
  6489.         network's IP address mask.    For unnumbered point-to-point
  6490.         links, the Link Data field should be set to    the unnumbered
  6491.         interface's    MIB-II [Ref8] ifIndex value.
  6492.  
  6493.  
  6494.  
  6495.  
  6496. Moy                                  [Page 116]
  6497.  
  6498. Internet Draft             OSPF Version 2            January 1997
  6499.  
  6500.  
  6501.         Finally, the cost of using the link    for output (possibly
  6502.         specifying a different cost    for each Type of Service) is
  6503.         specified.    The output cost    of a link is configurable.  With
  6504.         the    exception of links to stub networks, the output    cost
  6505.         must always    be non-zero.
  6506.  
  6507.         To further describe    the process of building    the list of link
  6508.         descriptions, suppose a router wishes to build a router-LSA
  6509.         for    Area A.     The router examines its collection of interface
  6510.         data structures.  For each interface, the following    steps
  6511.         are    taken:
  6512.  
  6513.  
  6514.         o    If the attached    network    does not belong    to Area    A, no
  6515.         links are added    to the LSA, and    the next interface
  6516.         should be examined.
  6517.  
  6518.         o    If the state of    the interface is Down, no links    are
  6519.         added.
  6520.  
  6521.         o    If the state of    the interface is Loopback, add a Type 3
  6522.         link (stub network) as long as this is not an interface
  6523.         to an unnumbered point-to-point    network.  The Link ID
  6524.         should be set to the IP    interface address, the Link Data
  6525.         set to the mask    0xffffffff (indicating a host route),
  6526.         and the    cost set to 0.
  6527.  
  6528.         o    Otherwise, the link descriptions added to the router-LSA
  6529.         depend on the OSPF interface type. Link    descriptions
  6530.         used for point-to-point    interfaces are specified in
  6531.         Section    12.4.1.1, for virtual links in Section 12.4.1.2,
  6532.         for broadcast and NBMA interfaces in 12.4.1.3, and for
  6533.         Point-to-MultiPoint interfaces in 12.4.1.4.
  6534.  
  6535.         After consideration    of all the router interfaces, host links
  6536.         are    added to the router-LSA    by examining the list of
  6537.         attached hosts belonging to    Area A.     A host    route is
  6538.         represented    as a Type 3 link (stub network)    whose Link ID is
  6539.         the    host's IP address, Link    Data is    the mask of all    ones
  6540.         (0xffffffff), and cost the host's configured cost (see
  6541.         Section C.7).
  6542.  
  6543.  
  6544.         12.4.1.1.  Describing point-to-point interfaces
  6545.  
  6546.         For point-to-point interfaces, one or more link
  6547.         descriptions are added to the router-LSA as follows:
  6548.  
  6549.  
  6550.  
  6551.  
  6552. Moy                                  [Page 117]
  6553.  
  6554. Internet Draft             OSPF Version 2            January 1997
  6555.  
  6556.  
  6557.         o   If the neighboring router is fully adjacent, add a
  6558.             Type 1 link    (point-to-point). The Link ID should be
  6559.             set    to the Router ID of the    neighboring router. For
  6560.             numbered point-to-point networks, the Link Data
  6561.             should specify the IP interface address. For
  6562.             unnumbered point-to-point networks,    the Link Data
  6563.             field should specify the interface's MIB-II    [Ref8]
  6564.             ifIndex value. The cost should be set to the output
  6565.             cost of the    point-to-point interface.
  6566.  
  6567.         o   In addition, as long as the    state of the interface
  6568.             is "Point-to-Point"    (and regardless    of the
  6569.             neighboring    router state), a Type 3    link (stub
  6570.             network) should be added. There are    two forms that
  6571.             this stub link can take:
  6572.  
  6573.             Option 1
  6574.             Assuming that the neighboring router's IP
  6575.             address    is known, set the Link ID of the Type 3
  6576.             link to    the neighbor's IP address, the Link Data
  6577.             to the mask 0xffffffff (indicating a host
  6578.             route),    and the    cost to    the interface's
  6579.             configured output cost.[15]
  6580.  
  6581.             Option 2
  6582.             If a subnet has    been assigned to the point-to-
  6583.             point link, set    the Link ID of the Type    3 link
  6584.             to the subnet's    IP address, the    Link Data to the
  6585.             subnet's mask, and the cost to the interface's
  6586.             configured output cost.[16]
  6587.  
  6588.  
  6589.         12.4.1.2.  Describing broadcast and    NBMA interfaces
  6590.  
  6591.         For operational    broadcast and NBMA interfaces, a single
  6592.         link description is added to the router-LSA as follows:
  6593.  
  6594.         o   If the state of the    interface is Waiting, add a Type
  6595.             3 link (stub network) with Link ID set to the IP
  6596.             network number of the attached network, Link Data
  6597.             set    to the attached    network's address mask,    and cost
  6598.             equal to the interface's configured    output cost.
  6599.  
  6600.         o   Else, there    has been a Designated Router elected for
  6601.             the    attached network.  If the router is fully
  6602.             adjacent to    the Designated Router, or if the router
  6603.             itself is Designated Router    and is fully adjacent to
  6604.             at least one other router, add a single Type 2 link
  6605.  
  6606.  
  6607.  
  6608. Moy                                  [Page 118]
  6609.  
  6610. Internet Draft             OSPF Version 2            January 1997
  6611.  
  6612.  
  6613.             (transit network) with Link    ID set to the IP
  6614.             interface address of the attached network's
  6615.             Designated Router (which may be the    router itself),
  6616.             Link Data set to the router's own IP interface
  6617.             address, and cost equal to the interface's
  6618.             configured output cost.  Otherwise,    add a link as if
  6619.             the    interface state    were Waiting (see above).
  6620.  
  6621.  
  6622.         12.4.1.3.  Describing virtual links
  6623.  
  6624.         For virtual links, a link description is added to the
  6625.         router-LSA only    when the virtual neighbor is fully
  6626.         adjacent. In this case,    add a Type 4 link (virtual link)
  6627.         with Link ID set to the    Router ID of the virtual
  6628.         neighbor, Link Data set    to the IP interface address
  6629.         associated with    the virtual link and cost set to the
  6630.         cost calculated    for the    virtual    link during the    routing
  6631.         table calculation (see Section 15).
  6632.  
  6633.  
  6634.         12.4.1.4.  Describing Point-to-MultiPoint interfaces
  6635.  
  6636.         For operational    Point-to-MultiPoint interfaces,    one or
  6637.         more link descriptions are added to the    router-LSA as
  6638.         follows:
  6639.  
  6640.         o   A single Type 3 link (stub network)    is added with
  6641.             Link ID set    to the router's    own IP interface
  6642.             address, Link Data set to the mask 0xffffffff
  6643.             (indicating    a host route), and cost    set to 0.
  6644.  
  6645.         o   For    each fully adjacent neighbor associated    with the
  6646.             interface, add an additional Type 1    link (point-to-
  6647.             point) with    Link ID    set to the Router ID of    the
  6648.             neighboring    router,    Link Data set to the IP
  6649.             interface address and cost equal to    the interface's
  6650.             configured output cost.
  6651.  
  6652.  
  6653.         12.4.1.5.  Examples    of router-LSAs
  6654.  
  6655.         Consider the router-LSAs generated by Router RT3, as
  6656.         pictured in Figure 6.  The area    containing Router RT3
  6657.         (Area 1) has been redrawn, with    actual network
  6658.         addresses, in Figure 15.  Assume that the last byte of
  6659.         all of RT3's interface addresses is 3, giving it the
  6660.         interface addresses 192.1.1.3 and 192.1.4.3, and that
  6661.  
  6662.  
  6663.  
  6664. Moy                                  [Page 119]
  6665.  
  6666. Internet Draft             OSPF Version 2            January 1997
  6667.  
  6668.  
  6669.         the other routers have similar addressing schemes.  In
  6670.         addition, assume that all links    are functional,    and that
  6671.         Router IDs are assigned    as the smallest    IP interface
  6672.         address.
  6673.  
  6674.         RT3 originates two router-LSAs,    one for    Area 1 and one
  6675.         for the    backbone.  Assume that Router RT4 has been
  6676.         selected as the    Designated router for network 192.1.1.0.
  6677.         RT3's router-LSA for Area 1 is then shown below.  It
  6678.         indicates that RT3 has two connections to Area 1, the
  6679.         first a    link to    the transit network 192.1.1.0 and the
  6680.         second a link to the stub network 192.1.4.0.  Note that
  6681.         the transit network is identified by the IP interface of
  6682.         its Designated Router (i.e., the Link ID = 192.1.1.4
  6683.         which is the Designated    Router RT4's IP    interface to
  6684.         192.1.1.0).  Note also that RT3    has indicated that it is
  6685.         capable    of calculating separate    routes based on    IP TOS,
  6686.         through    setting    the T-bit in the Options field.     It has
  6687.         also indicated that it is an area border router.
  6688.  
  6689.           ; RT3's router-LSA for Area 1
  6690.  
  6691.           LS age = 0             ;always true on origination
  6692.           Options = (T-bit|E-bit)     ;TOS-capable
  6693.           LS type = 1             ;indicates router-LSA
  6694.           Link State ID    = 192.1.1.3     ;RT3's    Router ID
  6695.           Advertising Router = 192.1.1.3 ;RT3's    Router ID
  6696.           bit E    = 0             ;not an AS boundary router
  6697.           bit B    = 1             ;area border router
  6698.           #links = 2
  6699.              Link ID = 192.1.1.4     ;IP address of    Desig. Rtr.
  6700.              Link Data = 192.1.1.3     ;RT3's    IP interface to    net
  6701.              Type =    2         ;connects to transit network
  6702.              # other metrics = 0
  6703.              TOS 0 metric =    1
  6704.  
  6705.              Link ID = 192.1.4.0     ;IP Network number
  6706.              Link Data = 0xffffff00     ;Network mask
  6707.              Type =    3         ;connects to stub network
  6708.              # other metrics = 0
  6709.              TOS 0 metric =    2
  6710.  
  6711.         Next RT3's router-LSA for the backbone is shown.  It
  6712.         indicates that RT3 has a single    attachment to the
  6713.         backbone.  This    attachment is via an unnumbered    point-
  6714.         to-point link to Router    RT6.  RT3 has again indicated
  6715.         that it    is TOS-capable,    and that it is an area border
  6716.         router.
  6717.  
  6718.  
  6719.  
  6720. Moy                                  [Page 120]
  6721.  
  6722. Internet Draft             OSPF Version 2            January 1997
  6723.  
  6724.  
  6725.           ; RT3's router-LSA for the backbone
  6726.  
  6727.           LS age = 0             ;always true on origination
  6728.           Options = (T-bit|E-bit)     ;TOS-capable
  6729.           LS type = 1             ;indicates router-LSA
  6730.           Link State ID    = 192.1.1.3     ;RT3's    router ID
  6731.           Advertising Router = 192.1.1.3 ;RT3's    router ID
  6732.           bit E    = 0             ;not an AS boundary router
  6733.           bit B    = 1             ;area border router
  6734.           #links = 1
  6735.              Link ID = 18.10.0.6     ;Neighbor's Router ID
  6736.              Link Data = 0.0.0.3     ;MIB-II ifIndex of P-P    link
  6737.              Type =    1         ;connects to router
  6738.              # other metrics = 0
  6739.              TOS 0 metric =    8
  6740.  
  6741.         Even though Router RT3 has indicated that it is    TOS-
  6742.         capable    in the above examples, only a single metric (the
  6743.         TOS 0 metric) has been specified for each interface.
  6744.         Different metrics can be specified for each TOS.  The
  6745.         encoding of TOS    in OSPF    LSAs is    described in Section
  6746.         12.3.
  6747.  
  6748.         As an example, suppose the point-to-point link between
  6749.         Routers    RT3 and    RT6 in Figure 15 is a satellite    link.
  6750.         The AS administrator may want to encourage the use of
  6751.         the line for high bandwidth traffic.  This would be done
  6752.         by setting the metric artificially low for the
  6753.         appropriate TOS    value.    Router RT3 would then originate
  6754.         the following router-LSA for the backbone (TOS 8 =
  6755.         maximize throughput):
  6756.  
  6757.           ; RT3's router-LSA for the backbone
  6758.  
  6759.           LS age = 0              ;always true on origination
  6760.           Options = (T-bit|E-bit)     ;TOS-capable
  6761.           LS type = 1              ;indicates router-LSA
  6762.           Link State ID    = 192.1.1.3   ;RT3's Router ID
  6763.           Advertising Router = 192.1.1.3
  6764.           bit E    = 0              ;not an AS boundary router
  6765.           bit B    = 1              ;area border router
  6766.           #links = 1
  6767.              Link ID = 18.10.0.6  ;Neighbor's Router ID
  6768.              Link Data = 0.0.0.3  ;MIB-II ifIndex of P-P link
  6769.              Type =    1          ;connects    to router
  6770.              # other metrics = 1
  6771.              TOS 0 metric =    8
  6772.                  TOS = 8      ;maximize    throughput
  6773.  
  6774.  
  6775.  
  6776. Moy                                  [Page 121]
  6777.  
  6778. Internet Draft             OSPF Version 2            January 1997
  6779.  
  6780.  
  6781.                  metric    = 1   ;traffic preferred
  6782.  
  6783.  
  6784.     12.4.2.     Network-LSAs
  6785.  
  6786.         A network-LSA is generated for every transit broadcast or
  6787.         NBMA network.  (A transit network is a network having two or
  6788.         more attached routers).  The network-LSA describes all the
  6789.         routers that are attached to the network.
  6790.  
  6791.         The    Designated Router for the network originates the LSA.
  6792.         The    Designated Router originates the LSA only if it    is fully
  6793.         adjacent to    at least one other router on the network.  The
  6794.         network-LSA    is flooded throughout the area that contains the
  6795.         transit network, and no further.  The network-LSA lists
  6796.         those routers that are fully adjacent to the Designated
  6797.         Router; each fully adjacent    router is identified by    its OSPF
  6798.         Router ID.    The Designated Router includes itself in this
  6799.         list.
  6800.  
  6801.         The    Link State ID for a network-LSA    is the IP interface
  6802.         address of the Designated Router.  This value, masked by the
  6803.         network's address mask (which is also contained in the
  6804.         network-LSA) yields    the network's IP address.
  6805.  
  6806.         A router that has formerly been the    Designated Router for a
  6807.         network, but is no longer, should flush the    network-LSA that
  6808.         it had previously originated.  This    LSA is no longer used in
  6809.         the    routing    table calculation.  It is flushed by prematurely
  6810.         incrementing the LSA's age to MaxAge and reflooding    (see
  6811.         Section 14.1). In addition,    in those rare cases where a
  6812.         router's Router ID has changed, any    network-LSAs that were
  6813.         originated with the    router's previous Router ID must be
  6814.         flushed. Since the router may have no idea what it's
  6815.         previous Router ID might have been,    these network-LSAs are
  6816.         indicated by having    their Link State ID equal to one of the
  6817.         router's IP    interface addresses and    their Advertising Router
  6818.         equal to some value    other than the router's    current    Router
  6819.         ID (see Section 13.4 for more details).
  6820.  
  6821.  
  6822.         12.4.2.1.  Examples    of network-LSAs
  6823.  
  6824.         Again consider the area    configuration in Figure    6.
  6825.         Network-LSAs are originated for    Network    N3 in Area 1,
  6826.         Networks N6 and    N8 in Area 2, and Network N9 in    Area 3.
  6827.         Assuming that Router RT4 has been selected as the
  6828.         Designated Router for Network N3, the following
  6829.  
  6830.  
  6831.  
  6832. Moy                                  [Page 122]
  6833.  
  6834. Internet Draft             OSPF Version 2            January 1997
  6835.  
  6836.  
  6837.         network-LSA is generated by RT4    on behalf of Network N3
  6838.         (see Figure 15 for the address assignments):
  6839.  
  6840.           ; Network-LSA    for Network N3
  6841.  
  6842.           LS age = 0             ;always true on origination
  6843.           Options = (T-bit|E-bit)     ;TOS-capable
  6844.           LS type = 2             ;indicates network-LSA
  6845.           Link State ID    = 192.1.1.4     ;IP address of    Desig. Rtr.
  6846.           Advertising Router = 192.1.1.4 ;RT4's    Router ID
  6847.           Network Mask = 0xffffff00
  6848.              Attached Router = 192.1.1.4    ;Router    ID
  6849.              Attached Router = 192.1.1.1    ;Router    ID
  6850.              Attached Router = 192.1.1.2    ;Router    ID
  6851.              Attached Router = 192.1.1.3    ;Router    ID
  6852.  
  6853.  
  6854.     12.4.3.     Summary-LSAs
  6855.  
  6856.         The    destination described by a summary-LSA is either an IP
  6857.         network, an    AS boundary router or a    range of IP addresses.
  6858.         Summary-LSAs are flooded throughout    a single area only.  The
  6859.         destination    described is one that is external to the area,
  6860.         yet    still belongs to the Autonomous    System.
  6861.  
  6862.         Summary-LSAs are originated    by area    border routers.     The
  6863.         precise summary routes to advertise    into an    area are
  6864.         determined by examining the    routing    table structure    (see
  6865.         Section 11)    in accordance with the algorithm described
  6866.         below. Note    that only intra-area routes are    advertised into
  6867.         the    backbone, while    both intra-area    and inter-area routes
  6868.         are    advertised into    the other areas.
  6869.  
  6870.         To determine which routes to advertise into    an attached Area
  6871.         A, each routing table entry    is processed as    follows.
  6872.         Remember that each routing table entry describes a set of
  6873.         equal-cost best paths to a particular destination:
  6874.  
  6875.  
  6876.         o    Only Destination Types of network and AS boundary router
  6877.         are advertised in summary-LSAs.     If the    routing    table
  6878.         entry's    Destination Type is area border    router,    examine
  6879.         the next routing table entry.
  6880.  
  6881.         o    AS external routes are never advertised    in summary-LSAs.
  6882.         If the routing table entry has Path-type of type 1
  6883.         external or type 2 external, examine the next routing
  6884.         table entry.
  6885.  
  6886.  
  6887.  
  6888. Moy                                  [Page 123]
  6889.  
  6890. Internet Draft             OSPF Version 2            January 1997
  6891.  
  6892.  
  6893.         o    Else, if the area associated with this set of paths is
  6894.         the Area A itself, do not generate a summary-LSA for the
  6895.         route.[17]
  6896.  
  6897.         o    Else, if the next hops associated with this set    of paths
  6898.         belong to Area A itself, do not    generate a summary-LSA
  6899.         for the    route.[18] This    is the logical equivalent of a
  6900.         Distance Vector    protocol's split horizon logic.
  6901.  
  6902.         o    Else, if the routing table cost    equals or exceeds the
  6903.         value LSInfinity, a summary-LSA    cannot be generated for
  6904.         this route.
  6905.  
  6906.         o    Else, if the destination of this route is an AS    boundary
  6907.         router,    a summary-LSA should be    originated if and only
  6908.         if the routing table entry describes the preferred path
  6909.         to the AS boundary router (see Step 3 of Section 16.4).
  6910.         If so, a Type 4    summary-LSA is originated for the
  6911.         destination, with Link State ID    equal to the AS    boundary
  6912.         router's Router    ID and metric equal to the routing table
  6913.         entry's    cost. Note: these LSAs should not be generated
  6914.         if Area    A has been configured as a stub    area.
  6915.  
  6916.         o    Else, the Destination type is network. If this is an
  6917.         inter-area route, generate a Type 3 summary-LSA    for the
  6918.         destination, with Link State ID    equal to the network's
  6919.         address    (if necessary, the Link    State ID can also have
  6920.         one or more of the network's host bits set; see    Appendix
  6921.         E for details) and metric equal    to the routing table
  6922.         cost.
  6923.  
  6924.         o    The one    remaining case is an intra-area    route to a
  6925.         network.  This means that the network is contained in
  6926.         one of the router's directly attached areas.  In
  6927.         general, this information must be condensed before
  6928.         appearing in summary-LSAs.  Remember that an area has a
  6929.         configured list    of address ranges, each    range consisting
  6930.         of an [address,mask] pair and a    status indication of
  6931.         either Advertise or DoNotAdvertise.  At    most a single
  6932.         Type 3 summary-LSA is originated for each range. When
  6933.         the range's status indicates Advertise,    a Type 3
  6934.         summary-LSA is generated with Link State ID equal to the
  6935.         range's    address    (if necessary, the Link    State ID can
  6936.         also have one or more of the range's "host" bits set;
  6937.         see Appendix E for details) and    cost equal to the
  6938.         largest    cost of    any of the component networks. When the
  6939.         range's    status indicates DoNotAdvertise, the Type 3
  6940.         summary-LSA is suppressed and the component networks
  6941.  
  6942.  
  6943.  
  6944. Moy                                  [Page 124]
  6945.  
  6946. Internet Draft             OSPF Version 2            January 1997
  6947.  
  6948.  
  6949.         remain hidden from other areas.
  6950.  
  6951.         By default, if a network is not    contained in any
  6952.         explicitly configured address range, a Type 3 summary-
  6953.         LSA is generated with Link State ID equal to the
  6954.         network's address (if necessary, the Link State    ID can
  6955.         also have one or more of the network's "host" bits set;
  6956.         see Appendix E for details) and    metric equal to    the
  6957.         network's routing table    cost.
  6958.  
  6959.         If an area is capable of carrying transit traffic (i.e.,
  6960.         its TransitCapability is set to    TRUE), routing
  6961.         information concerning backbone    networks should    not be
  6962.         condensed before being summarized into the area.  Nor
  6963.         should the advertisement of backbone networks into
  6964.         transit    areas be suppressed.  In other words, the
  6965.         backbone's configured ranges should be ignored when
  6966.         originating summary-LSAs into transit areas.
  6967.  
  6968.         If a router    advertises a summary-LSA for a destination which
  6969.         then becomes unreachable, the router must then flush the LSA
  6970.         from the routing domain by setting its age to MaxAge and
  6971.         reflooding (see Section 14.1).  Also, if the destination is
  6972.         still reachable, yet can no    longer be advertised according
  6973.         to the above procedure (e.g., it is    now an inter-area route,
  6974.         when it used to be an intra-area route associated with some
  6975.         non-backbone area; it would    thus no    longer be advertisable
  6976.         to the backbone), the LSA should also be flushed from the
  6977.         routing domain.
  6978.  
  6979.         For    the destination    described by a summary-LSA there may be
  6980.         separate sets of paths, and    therefore separate routing table
  6981.         entries, for each Type of Service.    All these entries must
  6982.         be considered when building    the summary-LSA    for the
  6983.         destination; a single LSA must specify the separate    costs
  6984.         (if    they exist) for    each TOS.  The encoding    of TOS in OSPF
  6985.         LSAs is described in Section 12.3.
  6986.  
  6987.         Clearing the T-bit in the Options field of a summary-LSA
  6988.         indicates that there is a TOS 0 path to the    destination, but
  6989.         no paths for non-zero TOS.    This can happen    when non-TOS-
  6990.         capable routers exist in the routing domain    (see Section
  6991.         2.5).
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000. Moy                                  [Page 125]
  7001.  
  7002. Internet Draft             OSPF Version 2            January 1997
  7003.  
  7004.  
  7005.         12.4.3.1.  Originating summary-LSAs    into stub areas
  7006.  
  7007.         The algorithm in Section 12.4.3    is optional when Area A
  7008.         is an OSPF stub    area. Area border routers connecting to
  7009.         a stub area can    originate summary-LSAs into the    area
  7010.         according to the Section 12.4.3's algorithm, or    can
  7011.         choose to originate only a subset of the summary-LSAs,
  7012.         possibly under configuration control.  The fewer LSAs
  7013.         originated, the    smaller    the stub area's    link state
  7014.         database, further reducing the demands on its routers'
  7015.         resources. However, omitting LSAs may also lead    to sub-
  7016.         optimal    inter-area routing, although routing will
  7017.         continue to function.
  7018.  
  7019.         As specified in    Section    12.4.3,    Type 4 summary-LSAs
  7020.         (ASBR-summary-LSAs) are    never originated into stub
  7021.         areas.
  7022.  
  7023.         In a stub area,    instead    of importing external routes
  7024.         each area border router    originates a "default summary-
  7025.         LSA" into the area. The    Link State ID for the default
  7026.         summary-LSA is set to DefaultDestination, and the metric
  7027.         set to the (per-area) configurable parameter
  7028.         StubDefaultCost.  Note that StubDefaultCost need not be
  7029.         configured identically in all of the stub area's area
  7030.         border routers.
  7031.  
  7032.  
  7033.         12.4.3.2.  Examples    of summary-LSAs
  7034.  
  7035.         Consider again the area    configuration in Figure    6.
  7036.         Routers    RT3, RT4, RT7, RT10 and    RT11 are all area border
  7037.         routers, and therefore are originating summary-LSAs.
  7038.         Consider in particular Router RT4.  Its    routing    table
  7039.         was calculated as the example in Section 11.3.    RT4
  7040.         originates summary-LSAs    into both the backbone and Area
  7041.         1.  Into the backbone, Router RT4 originates separate
  7042.         LSAs for each of the networks N1-N4.  Into Area    1,
  7043.         Router RT4 originates separate LSAs for    networks N6-N8
  7044.         and the    AS boundary routers RT5,RT7.  It also condenses
  7045.         host routes Ia and Ib into a single summary-LSA.
  7046.         Finally, the routes to networks    N9,N10,N11 and Host H1
  7047.         are advertised by a single summary-LSA.     This
  7048.         condensation was originally performed by the router
  7049.         RT11.
  7050.  
  7051.         These LSAs are illustrated graphically in Figures 7 and
  7052.         8.  Two    of the summary-LSAs originated by Router RT4
  7053.  
  7054.  
  7055.  
  7056. Moy                                  [Page 126]
  7057.  
  7058. Internet Draft             OSPF Version 2            January 1997
  7059.  
  7060.  
  7061.         follow.     The actual IP addresses for the networks and
  7062.         routers    in question have been assigned in Figure 15.
  7063.  
  7064.           ; Summary-LSA    for Network N1,
  7065.           ; originated by Router RT4 into the backbone
  7066.  
  7067.           LS age = 0              ;always true on origination
  7068.           Options = (T-bit|E-bit)     ;TOS-capable
  7069.           LS type = 3              ;Type 3 summary-LSA
  7070.           Link State ID    = 192.1.2.0   ;N1's IP network number
  7071.           Advertising Router = 192.1.1.4       ;RT4's ID
  7072.              TOS = 0
  7073.              metric    = 4
  7074.  
  7075.           ; Summary-LSA    for AS boundary    router RT7
  7076.           ; originated by Router RT4 into Area 1
  7077.  
  7078.           LS age = 0              ;always true on origination
  7079.           Options = (T-bit|E-bit)     ;TOS-capable
  7080.           LS type = 4              ;Type 4 summary-LSA
  7081.           Link State ID    = Router RT7's ID
  7082.           Advertising Router = 192.1.1.4       ;RT4's ID
  7083.              TOS = 0
  7084.              metric    = 14
  7085.  
  7086.  
  7087.     12.4.4.     AS-external-LSAs
  7088.  
  7089.         AS-external-LSAs describe routes to    destinations external to
  7090.         the    Autonomous System.  Most AS-external-LSAs describe
  7091.         routes to specific external    destinations; in these cases the
  7092.         LSA's Link State ID    is set to the destination network's IP
  7093.         address (if    necessary, the Link State ID can also have one
  7094.         or more of the network's "host" bits set; see Appendix E for
  7095.         details).  However,    a default route    for the    Autonomous
  7096.         System can be described in an AS-external-LSA by setting the
  7097.         LSA's Link State ID    to DefaultDestination (0.0.0.0).  AS-
  7098.         external-LSAs are originated by AS boundary    routers.  An AS
  7099.         boundary router originates a single    AS-external-LSA    for each
  7100.         external route that    it has learned,    either through another
  7101.         routing protocol (such as BGP), or through configuration
  7102.         information.
  7103.  
  7104.         AS-external-LSAs are the only type of LSAs that are    flooded
  7105.         throughout the entire Autonomous System; all other types of
  7106.         LSAs are specific to a single area.     However, AS-external-
  7107.         LSAs are not flooded into/throughout stub areas (see Section
  7108.         3.6).  This    enables    a reduction in link state database size
  7109.  
  7110.  
  7111.  
  7112. Moy                                  [Page 127]
  7113.  
  7114. Internet Draft             OSPF Version 2            January 1997
  7115.  
  7116.  
  7117.         for    routers    internal to stub areas.
  7118.  
  7119.         The    metric that is advertised for an external route    can be
  7120.         one    of two types.  Type 1 metrics are comparable to    the link
  7121.         state metric.  Type    2 metrics are assumed to be larger than
  7122.         the    cost of    any intra-AS path.  As with summary-LSAs, if
  7123.         separate paths exist based on TOS, separate    TOS costs can be
  7124.         included in    the AS-external-LSA The    encoding of TOS    in OSPF
  7125.         LSAs is described in Section 12.3.    If the T-bit of    the
  7126.         LSA's Options field    is clear, no non-zero TOS paths    to the
  7127.         destination    exist.
  7128.  
  7129.         If a router    advertises an AS-external-LSA for a destination
  7130.         which then becomes unreachable, the    router must then flush
  7131.         the    LSA from the routing domain by setting its age to MaxAge
  7132.         and    reflooding (see    Section    14.1).
  7133.  
  7134.  
  7135.         12.4.4.1.  Examples    of AS-external-LSAs
  7136.  
  7137.         Consider once again the    AS pictured in Figure 6.  There
  7138.         are two    AS boundary routers: RT5 and RT7.  Router RT5
  7139.         originates three AS-external-LSAs, for networks    N12-N14.
  7140.         Router RT7 originates two AS-external-LSAs, for    networks
  7141.         N12 and    N15.  Assume that RT7 has learned its route to
  7142.         N12 via    BGP, and that it wishes    to advertise a Type 2
  7143.         metric to the AS.  RT7 would then originate the
  7144.         following LSA for N12:
  7145.  
  7146.           ; AS-external-LSA for    Network    N12,
  7147.           ; originated by Router RT7
  7148.  
  7149.           LS age = 0              ;always true on origination
  7150.           Options = (T-bit|E-bit)     ;TOS-capable
  7151.           LS type = 5              ;AS-external-LSA
  7152.           Link State ID    = N12's    IP network number
  7153.           Advertising Router = Router RT7's ID
  7154.              bit E = 1          ;Type 2 metric
  7155.              TOS = 0
  7156.              metric    = 2
  7157.              Forwarding address = 0.0.0.0
  7158.  
  7159.         In the above example, the forwarding address field has
  7160.         been set to 0.0.0.0, indicating    that packets for the
  7161.         external destination should be forwarded to the
  7162.         advertising OSPF router    (RT7).    This is    not always
  7163.         desirable.  Consider the example pictured in Figure 16.
  7164.         There are three    OSPF routers (RTA, RTB and RTC)
  7165.  
  7166.  
  7167.  
  7168. Moy                                  [Page 128]
  7169.  
  7170. Internet Draft             OSPF Version 2            January 1997
  7171.  
  7172.  
  7173.         connected to a common network.    Only one of these
  7174.         routers, RTA, is exchanging BGP    information with the
  7175.         non-OSPF router    RTX.  RTA must then originate AS-
  7176.         external-LSAs for those    destinations it    has learned from
  7177.         RTX.  By using the AS-external-LSA's forwarding    address
  7178.         field, RTA can specify that packets for    these
  7179.         destinations be    forwarded directly to RTX.  Without this
  7180.         feature, Routers RTB and RTC would take    an extra hop to
  7181.         get to these destinations.
  7182.  
  7183.         Note that when the forwarding address field is non-zero,
  7184.         it should point    to a router belonging to another
  7185.         Autonomous System.
  7186.  
  7187.         A forwarding address can also be specified for the
  7188.         default    route.    For example, in    figure 16 RTA may want
  7189.         to specify that    all externally-destined    packets    should
  7190.         by default be forwarded    to its BGP peer    RTX.  The
  7191.         resulting AS-external-LSA is pictured below.  Note that
  7192.         the Link State ID is set to DefaultDestination.
  7193.  
  7194.           ; Default route, originated by Router    RTA
  7195.           ; Packets forwarded through RTX
  7196.  
  7197.           LS age = 0              ;always true on origination
  7198.           Options = (T-bit|E-bit)       ;TOS-capable
  7199.           LS type = 5              ;AS-external-LSA
  7200.           Link State ID    = DefaultDestination  ;    default    route
  7201.           Advertising Router = Router RTA's ID
  7202.              bit E = 1          ;Type 2 metric
  7203.              TOS = 0
  7204.              metric    = 1
  7205.              Forwarding address = RTX's IP address
  7206.  
  7207.         In figure 16, suppose instead that both    RTA and    RTB
  7208.         exchange BGP information with RTX.  In this case, RTA
  7209.         and RTB    would originate    the same set of    AS-external-
  7210.         LSAs.  These LSAs, if they specify the same metric,
  7211.         would be functionally equivalent since they would
  7212.         specify    the same destination and forwarding address
  7213.         (RTX).    This leads to a    clear duplication of effort.  If
  7214.         only one of RTA    or RTB originated the set of AS-
  7215.         external-LSAs, the routing would remain    the same, and
  7216.         the size of the    link state database would decrease.
  7217.         However, it must be unambiguously defined as to    which
  7218.         router originates the LSAs (otherwise neither may, or
  7219.         the identity of    the originator may oscillate).    The
  7220.         following rule is thereby established: if two routers,
  7221.  
  7222.  
  7223.  
  7224. Moy                                  [Page 129]
  7225.  
  7226. Internet Draft             OSPF Version 2            January 1997
  7227.  
  7228.  
  7229.         both reachable from one    another, originate functionally
  7230.         equivalent AS-external-LSAs (i.e., same    destination,
  7231.         cost and non-zero forwarding address), then the    LSA
  7232.         originated by the router having    the highest OSPF Router
  7233.         ID is used.  The router    having the lower OSPF Router ID
  7234.         can then flush its LSA.     Flushing an LSA is discussed in
  7235.         Section    14.1.
  7236.  
  7237. 13.  The Flooding Procedure
  7238.  
  7239.     Link State Update packets provide the mechanism for    flooding LSAs.
  7240.     A Link State Update    packet may contain several distinct LSAs, and
  7241.     floods each    LSA one    hop further from its point of origination.  To
  7242.     make the flooding procedure    reliable, each LSA must    be acknowledged
  7243.     separately.     Acknowledgments are transmitted in Link State
  7244.     Acknowledgment packets.  Many separate acknowledgments can also be
  7245.     grouped together into a single packet.
  7246.  
  7247.     The    flooding procedure starts when a Link State Update packet has
  7248.     been received.  Many consistency checks have been made on the
  7249.     received packet before being handed    to the flooding    procedure (see
  7250.     Section 8.2).  In particular, the Link State Update    packet has been
  7251.     associated with a particular neighbor, and a particular area.  If
  7252.     the    neighbor is in a lesser    state than Exchange, the packet    should
  7253.     be dropped without further processing.
  7254.  
  7255.     All    types of LSAs, other than AS-external-LSAs, are    associated with
  7256.  
  7257.                 +
  7258.                 |
  7259.               +---+.....|.BGP
  7260.               |RTA|-----|.....+---+
  7261.               +---+    |-----|RTX|
  7262.                 |     +---+
  7263.               +---+    |
  7264.               |RTB|-----|
  7265.               +---+    |
  7266.                 |
  7267.               +---+    |
  7268.               |RTC|-----|
  7269.               +---+    |
  7270.                 |
  7271.                 +
  7272.  
  7273.  
  7274.            Figure 16: Forwarding address example
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280. Moy                                  [Page 130]
  7281.  
  7282. Internet Draft             OSPF Version 2            January 1997
  7283.  
  7284.  
  7285.     a specific area.  However, LSAs do not contain an area field.  An
  7286.     LSA's area must be deduced from the    Link State Update packet header.
  7287.  
  7288.     For    each LSA contained in a    Link State Update packet, the following
  7289.     steps are taken:
  7290.  
  7291.  
  7292.     (1)    Validate the LSA's LS checksum.     If the    checksum turns out to be
  7293.     invalid, discard the LSA and get the next one from the Link
  7294.     State Update packet.
  7295.  
  7296.     (2)    Examine    the LSA's LS type.  If the LS type is unknown, discard
  7297.     the LSA    and get    the next one from the Link State Update    Packet.
  7298.     This specification defines LS types 1-5    (see Section 4.3).
  7299.  
  7300.     (3)    Else if    this is    an AS-external-LSA (LS type = 5), and the area
  7301.     has been configured as a stub area, discard the    LSA and    get the
  7302.     next one from the Link State Update Packet.  AS-external-LSAs
  7303.     are not    flooded    into/throughout    stub areas (see    Section    3.6).
  7304.  
  7305.     (4)    Else if    the LSA's LS age is equal to MaxAge, and there is
  7306.     currently no instance of the LSA in the    router's link state
  7307.     database, then take the    following actions:
  7308.  
  7309.     (a) Acknowledge    the receipt of the LSA by sending a Link State
  7310.         Acknowledgment packet back to the sending neighbor (see
  7311.         Section 13.5).
  7312.  
  7313.     (b) Purge all outstanding requests for equal or    previous
  7314.         instances of the LSA from the sending neighbor's Link State
  7315.         Request list (see Section 10).
  7316.  
  7317.     (c) If the sending neighbor is in state    Exchange or in state
  7318.         Loading, then install the MaxAge LSA in the    link state
  7319.         database.  Otherwise, simply discard the LSA.  In either
  7320.         case, examine the next LSA (if any)    listed in the Link State
  7321.         Update packet.
  7322.  
  7323.     (5)    Otherwise, find    the instance of    this LSA that is currently
  7324.     contained in the router's link state database.    If there is no
  7325.     database copy, or the received LSA is more recent than the
  7326.     database copy (see Section 13.1    below for the determination of
  7327.     which LSA is more recent) the following    steps must be performed:
  7328.  
  7329.     (a) If there is    already    a database copy, and if    the database
  7330.         copy was installed less than MinLSArrival seconds ago,
  7331.         discard the    new LSA    (without acknowledging it) and examine
  7332.         the    next LSA (if any) listed in the    Link State Update
  7333.  
  7334.  
  7335.  
  7336. Moy                                  [Page 131]
  7337.  
  7338. Internet Draft             OSPF Version 2            January 1997
  7339.  
  7340.  
  7341.         packet.
  7342.  
  7343.     (b) Otherwise immediately flood    the new    LSA out    some subset of
  7344.         the    router's interfaces (see Section 13.3).     In some cases
  7345.         (e.g., the state of    the receiving interface    is DR and the
  7346.         LSA    was received from a router other than the Backup DR) the
  7347.         LSA    will be    flooded    back out the receiving interface.  This
  7348.         occurrence should be noted for later use by    the
  7349.         acknowledgment process (Section 13.5).
  7350.  
  7351.     (c) Remove the current database    copy from all neighbors' Link
  7352.         state retransmission lists.
  7353.  
  7354.     (d) Install the    new LSA    in the link state database (replacing
  7355.         the    current    database copy).     This may cause    the routing
  7356.         table calculation to be scheduled.    In addition, timestamp
  7357.         the    new LSA    with the current time (i.e., the time it was
  7358.         received).    The flooding procedure cannot overwrite    the
  7359.         newly installed LSA    until MinLSArrival seconds have    elapsed.
  7360.         The    LSA installation process is discussed further in Section
  7361.         13.2.
  7362.  
  7363.     (e) Possibly acknowledge the receipt of    the LSA    by sending a
  7364.         Link State Acknowledgment packet back out the receiving
  7365.         interface.    This is    explained below    in Section 13.5.
  7366.  
  7367.     (f) If this new    LSA indicates that it was originated by    the
  7368.         receiving router itself (i.e., is considered a self-
  7369.         originated LSA), the router    must take special action, either
  7370.         updating the LSA or    in some    cases flushing it from the
  7371.         routing domain. For    a description of how self-originated
  7372.         LSAs are detected and subsequently handled,    see Section
  7373.         13.4.
  7374.  
  7375.     (6)    Else, if there is an instance of the LSA on the    sending
  7376.     neighbor's Link    state request list, an error has occurred in the
  7377.     Database Exchange process.  In this case, restart the Database
  7378.     Exchange process by generating the neighbor event BadLSReq for
  7379.     the sending neighbor and stop processing the Link State    Update
  7380.     packet.
  7381.  
  7382.     (7)    Else, if the received LSA is the same instance as the database
  7383.     copy (i.e., neither one    is more    recent)    the following two steps
  7384.     should be performed:
  7385.  
  7386.     (a) If the LSA is listed in the    Link state retransmission list
  7387.         for    the receiving adjacency, the router itself is expecting
  7388.         an acknowledgment for this LSA.  The router    should treat the
  7389.  
  7390.  
  7391.  
  7392. Moy                                  [Page 132]
  7393.  
  7394. Internet Draft             OSPF Version 2            January 1997
  7395.  
  7396.  
  7397.         received LSA as an acknowledgment by removing the LSA from
  7398.         the    Link state retransmission list.     This is termed    an
  7399.         "implied acknowledgment".  Its occurrence should be    noted
  7400.         for    later use by the acknowledgment    process    (Section 13.5).
  7401.  
  7402.     (b) Possibly acknowledge the receipt of    the LSA    by sending a
  7403.         Link State Acknowledgment packet back out the receiving
  7404.         interface.    This is    explained below    in Section 13.5.
  7405.  
  7406.     (8)    Else, the database copy    is more    recent.     If the    database copy
  7407.     has LS age equal to MaxAge and LS sequence number equal    to
  7408.     MaxSequenceNumber, simply discard the received LSA without
  7409.     acknowledging it. (In this case, the LSA's LS sequence number is
  7410.     wrapping, and the MaxSequenceNumber LSA    must be    completely
  7411.     flushed    before any new LSA instance can    be introduced).
  7412.     Otherwise, send    the database copy back to the sending neighbor,
  7413.     encapsulated within a Link State Update    Packet.    The Link State
  7414.     Update Packet should be    unicast    to the neighbor. In so doing, do
  7415.     not put    the database copy of the LSA on    the neighbor's link
  7416.     state retransmission list, and do not acknowledge the received
  7417.     (less recent) LSA instance.
  7418.  
  7419.  
  7420.     13.1.  Determining which LSA is newer
  7421.  
  7422.     When a router encounters two instances of an LSA, it must
  7423.     determine which    is more    recent.     This occurred above when
  7424.     comparing a received LSA to its    database copy.    This comparison
  7425.     must also be done during the Database Exchange procedure which
  7426.     occurs during adjacency    bring-up.
  7427.  
  7428.     An LSA is identified by    its LS type, Link State    ID and
  7429.     Advertising Router.  For two instances of the same LSA,    the LS
  7430.     sequence number, LS age, and LS    checksum fields    are used to
  7431.     determine which    instance is more recent:
  7432.  
  7433.  
  7434.     o   The    LSA having the newer LS    sequence number    is more    recent.
  7435.         See    Section    12.1.6 for an explanation of the LS sequence
  7436.         number space.  If both instances have the same LS sequence
  7437.         number, then:
  7438.  
  7439.     o   If the two instances have different    LS checksums, then the
  7440.         instance having the    larger LS checksum (when considered as a
  7441.         16-bit unsigned integer) is    considered more    recent.
  7442.  
  7443.     o   Else, if only one of the instances has its LS age field set
  7444.         to MaxAge, the instance of age MaxAge is considered    to be
  7445.  
  7446.  
  7447.  
  7448. Moy                                  [Page 133]
  7449.  
  7450. Internet Draft             OSPF Version 2            January 1997
  7451.  
  7452.  
  7453.         more recent.
  7454.  
  7455.     o   Else, if the LS age    fields of the two instances differ by
  7456.         more than MaxAgeDiff, the instance having the smaller
  7457.         (younger) LS age is    considered to be more recent.
  7458.  
  7459.     o   Else, the two instances are    considered to be identical.
  7460.  
  7461.  
  7462.     13.2.  Installing LSAs in the database
  7463.  
  7464.     Installing a new LSA in    the database, either as    the result of
  7465.     flooding or a newly self-originated LSA, may cause the OSPF
  7466.     routing    table structure    to be recalculated.  The contents of the
  7467.     new LSA    should be compared to the old instance,    if present.  If
  7468.     there is no difference,    there is no need to recalculate    the
  7469.     routing    table. When comparing an LSA to    its previous instance,
  7470.     the following are all considered to be differences in contents:
  7471.  
  7472.         o    The LSA's Options field    has changed.
  7473.  
  7474.         o    One of the LSA instances has LS    age set    to MaxAge, and
  7475.         the other does not.
  7476.  
  7477.         o    The length field in the    LSA header has changed.
  7478.  
  7479.         o    The body of the    LSA (i.e., anything outside the    20-byte
  7480.         LSA header) has    changed. Note that this    excludes changes
  7481.         in LS Sequence Number and LS Checksum.
  7482.  
  7483.     If the contents    are different, the following pieces of the
  7484.     routing    table must be recalculated, depending on the new LSA's
  7485.     LS type    field:
  7486.  
  7487.  
  7488.     Router-LSAs and    network-LSAs
  7489.         The    entire routing table must be recalculated, starting with
  7490.         the    shortest path calculations for each area (not just the
  7491.         area whose link-state database has changed).  The reason
  7492.         that the shortest path calculation cannot be restricted to
  7493.         the    single changed area has    to do with the fact that AS
  7494.         boundary routers may belong    to multiple areas.  A change in
  7495.         the    area currently providing the best route    may force the
  7496.         router to use an intra-area    route provided by a different
  7497.         area.[19]
  7498.  
  7499.     Summary-LSAs
  7500.         The    best route to the destination described    by the summary-
  7501.  
  7502.  
  7503.  
  7504. Moy                                  [Page 134]
  7505.  
  7506. Internet Draft             OSPF Version 2            January 1997
  7507.  
  7508.  
  7509.         LSA    must be    recalculated (see Section 16.5).  If this
  7510.         destination    is an AS boundary router, it may also be
  7511.         necessary to re-examine all    the AS-external-LSAs.
  7512.  
  7513.     AS-external-LSAs
  7514.         The    best route to the destination described    by the AS-
  7515.         external-LSA must be recalculated (see Section 16.6).
  7516.  
  7517.  
  7518.     Also, any old instance of the LSA must be removed from the
  7519.     database when the new LSA is installed.     This old instance must
  7520.     also be    removed    from all neighbors' Link state retransmission
  7521.     lists (see Section 10).
  7522.  
  7523.  
  7524.     13.3.  Next    step in    the flooding procedure
  7525.  
  7526.     When a new (and    more recent) LSA has been received, it must be
  7527.     flooded    out some set of    the router's interfaces.  This section
  7528.     describes the second part of flooding procedure    (the first part
  7529.     being the processing that occurred in Section 13), namely,
  7530.     selecting the outgoing interfaces and adding the LSA to    the
  7531.     appropriate neighbors' Link state retransmission lists.     Also
  7532.     included in this part of the flooding procedure    is the
  7533.     maintenance of the neighbors' Link state request lists.
  7534.  
  7535.     This section is    equally    applicable to the flooding of an LSA
  7536.     that the router    itself has just    originated (see    Section    12.4).
  7537.     For these LSAs,    this section provides the entirety of the
  7538.     flooding procedure (i.e., the processing of Section 13 is not
  7539.     performed, since, for example, the LSA has not been received
  7540.     from a neighbor    and therefore does not need to be acknowledged).
  7541.  
  7542.     Depending upon the LSA's LS type, the LSA can be flooded out
  7543.     only certain interfaces.  These    interfaces, defined by the
  7544.     following, are called the eligible interfaces:
  7545.  
  7546.  
  7547.     AS-external-LSAs (LS Type = 5)
  7548.         AS-external-LSAs are flooded throughout the    entire AS, with
  7549.         the    exception of stub areas    (see Section 3.6).  The    eligible
  7550.         interfaces are all the router's interfaces,    excluding
  7551.         virtual links and those interfaces attaching to stub areas.
  7552.  
  7553.     All other LS types
  7554.         All    other types are    specific to a single area (Area    A).  The
  7555.         eligible interfaces    are all    those interfaces attaching to
  7556.         the    Area A.     If Area A is the backbone, this includes all
  7557.  
  7558.  
  7559.  
  7560. Moy                                  [Page 135]
  7561.  
  7562. Internet Draft             OSPF Version 2            January 1997
  7563.  
  7564.  
  7565.         the    virtual    links.
  7566.  
  7567.  
  7568.     Link state databases must remain synchronized over all
  7569.     adjacencies associated with the    above eligible interfaces.  This
  7570.     is accomplished    by executing the following steps on each
  7571.     eligible interface.  It    should be noted    that this procedure may
  7572.     decide not to flood an LSA out a particular interface, if there
  7573.     is a high probability that the attached    neighbors have already
  7574.     received the LSA.  However, in these cases the flooding
  7575.     procedure must be absolutely sure that the neighbors eventually
  7576.     do receive the LSA, so the LSA is still    added to each
  7577.     adjacency's Link state retransmission list.  For each eligible
  7578.     interface:
  7579.  
  7580.  
  7581.     (1) Each of the    neighbors attached to this interface are
  7582.         examined, to determine whether they    must receive the new
  7583.         LSA.  The following    steps are executed for each neighbor:
  7584.  
  7585.         (a)    If the neighbor    is in a    lesser state than Exchange, it
  7586.         does not participate in    flooding, and the next neighbor
  7587.         should be examined.
  7588.  
  7589.         (b)    Else, if the adjacency is not yet full (neighbor state
  7590.         is Exchange or Loading), examine the Link state    request
  7591.         list associated    with this adjacency.  If there is an
  7592.         instance of the    new LSA    on the list, it    indicates that
  7593.         the neighboring    router has an instance of the LSA
  7594.         already.  Compare the new LSA to the neighbor's    copy:
  7595.  
  7596.         o   If the new LSA is less recent, then    examine    the next
  7597.             neighbor.
  7598.  
  7599.         o   If the two copies are the same instance, then delete
  7600.             the    LSA from the Link state    request    list, and
  7601.             examine the    next neighbor.[20]
  7602.  
  7603.         o   Else, the new LSA is more recent.  Delete the LSA
  7604.             from the Link state    request    list.
  7605.  
  7606.         (c)    If the new LSA was received from this neighbor,    examine
  7607.         the next neighbor.
  7608.  
  7609.         (d)    At this    point we are not positive that the neighbor has
  7610.         an up-to-date instance of this new LSA.     Add the new LSA
  7611.         to the Link state retransmission list for the adjacency.
  7612.         This ensures that the flooding procedure is reliable;
  7613.  
  7614.  
  7615.  
  7616. Moy                                  [Page 136]
  7617.  
  7618. Internet Draft             OSPF Version 2            January 1997
  7619.  
  7620.  
  7621.         the LSA    will be    retransmitted at intervals until an
  7622.         acknowledgment is seen from the    neighbor.
  7623.  
  7624.     (2) The    router must now    decide whether to flood    the new    LSA out
  7625.         this interface.  If    in the previous    step, the LSA was NOT
  7626.         added to any of the    Link state retransmission lists, there
  7627.         is no need to flood    the LSA    out the    interface and the next
  7628.         interface should be    examined.
  7629.  
  7630.     (3) If the new LSA was received    on this    interface, and it was
  7631.         received from either the Designated    Router or the Backup
  7632.         Designated Router, chances are that    all the    neighbors have
  7633.         received the LSA already.  Therefore, examine the next
  7634.         interface.
  7635.  
  7636.     (4) If the new LSA was received    on this    interface, and the
  7637.         interface state is Backup (i.e., the router    itself is the
  7638.         Backup Designated Router), examine the next    interface.  The
  7639.         Designated Router will do the flooding on this interface.
  7640.         However, if    the Designated Router fails the    router (i.e.,
  7641.         the    Backup Designated Router) will end up retransmitting the
  7642.         updates.
  7643.  
  7644.     (5) If this step is reached, the LSA must be flooded out the
  7645.         interface.    Send a Link State Update packet    (including the
  7646.         new    LSA as contents) out the interface.  The LSA's LS age
  7647.         must be incremented    by InfTransDelay (which    must be    > 0)
  7648.         when it is copied into the outgoing    Link State Update packet
  7649.         (until the LS age field reaches the    maximum    value of
  7650.         MaxAge).
  7651.  
  7652.         On broadcast networks, the Link State Update packets are
  7653.         multicast.    The destination    IP address specified for the
  7654.         Link State Update Packet depends on    the state of the
  7655.         interface.    If the interface state is DR or    Backup,    the
  7656.         address AllSPFRouters should be used.  Otherwise, the
  7657.         address AllDRouters    should be used.
  7658.  
  7659.         On non-broadcast networks, separate    Link State Update
  7660.         packets must be sent, as unicasts, to each adjacent    neighbor
  7661.         (i.e., those in state Exchange or greater).     The destination
  7662.         IP addresses for these packets are the neighbors' IP
  7663.         addresses.
  7664.  
  7665.  
  7666.  
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  
  7672. Moy                                  [Page 137]
  7673.  
  7674. Internet Draft             OSPF Version 2            January 1997
  7675.  
  7676.  
  7677.     13.4.  Receiving self-originated LSAs
  7678.  
  7679.     It is a    common occurrence for a    router to receive self-
  7680.     originated LSAs    via the    flooding procedure. A self-originated
  7681.     LSA is detected    when either 1) the LSA's Advertising Router is
  7682.     equal to the router's own Router ID or 2) the LSA is a network-
  7683.     LSA and    its Link State ID is equal to one of the router's own IP
  7684.     interface addresses.
  7685.  
  7686.     However, if the    received self-originated LSA is    newer than the
  7687.     last instance that the router actually originated, the router
  7688.     must take special action.  The reception of such an LSA
  7689.     indicates that there are LSAs in the routing domain that were
  7690.     originated by the router before    the last time it was restarted.
  7691.     In most    cases, the router must then advance the    LSA's LS
  7692.     sequence number    one past the received LS sequence number, and
  7693.     originate a new    instance of the    LSA.
  7694.  
  7695.     It may be the case the router no longer    wishes to originate the
  7696.     received LSA. Possible examples    include: 1) the    LSA is a
  7697.     summary-LSA or AS-external-LSA and the router no longer    has an
  7698.     (advertisable) route to    the destination, 2) the    LSA is a
  7699.     network-LSA but    the router is no longer    Designated Router for
  7700.     the network or 3) the LSA is a network-LSA whose Link State ID
  7701.     is one of the router's own IP interface    addresses but whose
  7702.     Advertising Router is not equal    to the router's    own Router ID
  7703.     (this latter case should be rare, and it indicates that    the
  7704.     router's Router    ID has changed since originating the LSA).  In
  7705.     all these cases, instead of updating the LSA, the LSA should be
  7706.     flushed    from the routing domain    by incrementing    the received
  7707.     LSA's LS age to    MaxAge and reflooding (see Section 14.1).
  7708.  
  7709.  
  7710.     13.5.  Sending Link    State Acknowledgment packets
  7711.  
  7712.     Each newly received LSA    must be    acknowledged.  This is usually
  7713.     done by    sending    Link State Acknowledgment packets.  However,
  7714.     acknowledgments    can also be accomplished implicitly by sending
  7715.     Link State Update packets (see step 7a of Section 13).
  7716.  
  7717.     Many acknowledgments may be grouped together into a single Link
  7718.     State Acknowledgment packet.  Such a packet is sent back out the
  7719.     interface which    received the LSAs.  The    packet can be sent in
  7720.     one of two ways: delayed and sent on an    interval timer,    or sent
  7721.     directly (as a unicast)    to a particular    neighbor.  The
  7722.     particular acknowledgment strategy used    depends    on the
  7723.     circumstances surrounding the receipt of the LSA.
  7724.  
  7725.  
  7726.  
  7727.  
  7728. Moy                                  [Page 138]
  7729.  
  7730. Internet Draft             OSPF Version 2            January 1997
  7731.  
  7732.  
  7733.     Sending    delayed    acknowledgments    accomplishes several things: 1)
  7734.     it facilitates the packaging of    multiple acknowledgments in a
  7735.     single Link State Acknowledgment packet, 2) it enables a single
  7736.     Link State Acknowledgment packet to indicate acknowledgments to
  7737.     several    neighbors at once (through multicasting) and 3)    it
  7738.     randomizes the Link State Acknowledgment packets sent by the
  7739.     various    routers    attached to a common network.  The fixed
  7740.     interval between a router's delayed transmissions must be short
  7741.     (less than RxmtInterval) or needless retransmissions will ensue.
  7742.  
  7743.     Direct acknowledgments are sent    to a particular    neighbor in
  7744.     response to the    receipt    of duplicate LSAs.  These
  7745.     acknowledgments    are sent as unicasts, and are sent immediately
  7746.     when the duplicate is received.
  7747.  
  7748.     The precise procedure for sending Link State Acknowledgment
  7749.     packets    is described in    Table 19.  The circumstances surrounding
  7750.     the receipt of the LSA are listed in the left column.  The
  7751.     acknowledgment action then taken is listed in one of the two
  7752.     right columns.    This action depends on the state of the
  7753.     concerned interface; interfaces    in state Backup    behave
  7754.     differently from interfaces in all other states.  Delayed
  7755.     acknowledgments    must be    delivered to all adjacent routers
  7756.     associated with    the interface.    On broadcast networks, this is
  7757.     accomplished by    sending    the delayed Link State Acknowledgment
  7758.     packets    as multicasts.    The Destination    IP address used    depends
  7759.     on the state of    the interface.    If the interface state is DR or
  7760.     Backup,    the destination    AllSPFRouters is used.    In all other
  7761.     states,    the destination    AllDRouters is used.  On non-broadcast
  7762.     networks, delayed Link State Acknowledgment packets must be
  7763.     unicast    separately over    each adjacency (i.e., neighbor whose
  7764.     state is >= Exchange).
  7765.  
  7766.     The reasoning behind sending the above packets as multicasts is
  7767.     best explained by an example.  Consider    the network
  7768.     configuration depicted in Figure 15.  Suppose RT4 has been
  7769.     elected    as Designated Router, and RT3 as Backup    Designated
  7770.     Router for the network N3.  When Router    RT4 floods a new LSA to
  7771.     Network    N3, it is received by routers RT1, RT2,    and RT3.  These
  7772.     routers    will not flood the LSA back onto net N3, but they still
  7773.     must ensure that their link-state databases remain synchronized
  7774.     with their adjacent neighbors.    So RT1,    RT2, and RT4 are waiting
  7775.     to see an acknowledgment from RT3.  Likewise, RT4 and RT3 are
  7776.     both waiting to    see acknowledgments from RT1 and RT2.  This is
  7777.     best achieved by sending the acknowledgments as    multicasts.
  7778.  
  7779.     The reason that    the acknowledgment logic for Backup DRs    is
  7780.     slightly different is because they perform differently during
  7781.  
  7782.  
  7783.  
  7784. Moy                                  [Page 139]
  7785.  
  7786. Internet Draft             OSPF Version 2            January 1997
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.                     Action taken in state
  7794.     Circumstances       Backup         All other states
  7795.     _______________________________________________________________
  7796.     LSA     has           No  acknowledgment     No  acknowledgment
  7797.     been  flooded back       sent.         sent.
  7798.     out    receiving  in-
  7799.     terface  (see Sec-
  7800.     _______________________________________________________________
  7801.     LSA      is           Delayed acknowledg-     Delayed       ack-
  7802.     more  recent  than       ment    sent if    adver-     nowledgment sent.
  7803.     database copy, but       tisement   received
  7804.     was      not  flooded       from       Designated
  7805.     back out receiving       Router,  otherwise
  7806.     interface           do nothing
  7807.     _______________________________________________________________
  7808.     LSA    is a           Delayed acknowledg-     No  acknowledgment
  7809.     duplicate, and was       ment    sent if    adver-     sent.
  7810.     treated as an  im-       tisement   received
  7811.     plied  acknowledg-       from       Designated
  7812.     ment (see  Section       Router,  otherwise
  7813.     _______________________________________________________________
  7814.     LSA    is a           Direct acknowledg-     Direct    acknowledg-
  7815.     duplicate, and was       ment    sent.         ment sent.
  7816.     not    treated    as  an
  7817.     implied      ack-
  7818.     nowledgment.
  7819.     _______________________________________________________________
  7820.     LSA's LS           Direct acknowledg-     Direct    acknowledg-
  7821.     age    is equal to       ment    sent.         ment sent.
  7822.     MaxAge, and    there is
  7823.     no current instance
  7824.     of the LSA
  7825.     in the link    state
  7826.     database (see
  7827.     Section 13,    step 4).
  7828.  
  7829.  
  7830.          Table 19: Sending link state acknowledgements.
  7831.  
  7832.  
  7833.  
  7834.  
  7835.     the flooding of    LSAs (see Section 13.3,    step 4).
  7836.  
  7837.  
  7838.  
  7839.  
  7840. Moy                                  [Page 140]
  7841.  
  7842. Internet Draft             OSPF Version 2            January 1997
  7843.  
  7844.  
  7845.     13.6.  Retransmitting LSAs
  7846.  
  7847.     LSAs flooded out an adjacency are placed on the    adjacency's Link
  7848.     state retransmission list.  In order to    ensure that flooding is
  7849.     reliable, these    LSAs are retransmitted until they are
  7850.     acknowledged.  The length of time between retransmissions is a
  7851.     configurable per-interface value, RxmtInterval.     If this is set
  7852.     too low    for an interface, needless retransmissions will    ensue.
  7853.     If the value is    set too    high, the speed    of the flooding, in the
  7854.     face of    lost packets, may be affected.
  7855.  
  7856.     Several    retransmitted LSAs may fit into    a single Link State
  7857.     Update packet.    When LSAs are to be retransmitted, only    the
  7858.     number fitting in a single Link    State Update packet should be
  7859.     sent.  Another packet of retransmissions can be    sent whenever
  7860.     some of    the LSAs are acknowledged, or on the next firing of the
  7861.     retransmission timer.
  7862.  
  7863.     Link State Update Packets carrying retransmissions are always
  7864.     sent as    unicasts (directly to the physical address of the
  7865.     neighbor).  They are never sent    as multicasts.    Each LSA's LS
  7866.     age must be incremented    by InfTransDelay (which    must be    > 0)
  7867.     when it    is copied into the outgoing Link State Update packet
  7868.     (until the LS age field    reaches    the maximum value of MaxAge).
  7869.  
  7870.     If an adjacent router goes down, retransmissions may occur until
  7871.     the adjacency is destroyed by OSPF's Hello Protocol.  When the
  7872.     adjacency is destroyed,    the Link state retransmission list is
  7873.     cleared.
  7874.  
  7875.  
  7876.     13.7.  Receiving link state    acknowledgments
  7877.  
  7878.     Many consistency checks    have been made on a received Link State
  7879.     Acknowledgment packet before it    is handed to the flooding
  7880.     procedure.  In particular, it has been associated with a
  7881.     particular neighbor.  If this neighbor is in a lesser state than
  7882.     Exchange, the Link State Acknowledgment    packet is discarded.
  7883.  
  7884.     Otherwise, for each acknowledgment in the Link State
  7885.     Acknowledgment packet, the following steps are performed:
  7886.  
  7887.  
  7888.     o   Does the LSA acknowledged have an instance on the Link state
  7889.         retransmission list    for the    neighbor?  If not, examine the
  7890.         next acknowledgment.  Otherwise:
  7891.  
  7892.  
  7893.  
  7894.  
  7895.  
  7896. Moy                                  [Page 141]
  7897.  
  7898. Internet Draft             OSPF Version 2            January 1997
  7899.  
  7900.  
  7901.     o   If the acknowledgment is for the same instance that    is
  7902.         contained on the list, remove the item from    the list and
  7903.         examine the    next acknowledgment.  Otherwise:
  7904.  
  7905.     o   Log    the questionable acknowledgment, and examine the next
  7906.         one.
  7907.  
  7908.  
  7909. 14.  Aging The Link State Database
  7910.  
  7911.     Each LSA has an LS age field.  The LS age is expressed in seconds.
  7912.     An LSA's LS    age field is incremented while it is contained in a
  7913.     router's database.    Also, when copied into a Link State Update
  7914.     Packet for flooding    out a particular interface, the    LSA's LS age is
  7915.     incremented    by InfTransDelay.
  7916.  
  7917.     An LSA's LS    age is never incremented past the value    MaxAge.     LSAs
  7918.     having age MaxAge are not used in the routing table    calculation.  As
  7919.     a router ages its link state database, an LSA's LS age may reach
  7920.     MaxAge.[21]    At this    time, the router must attempt to flush the LSA
  7921.     from the routing domain.  This is done simply by reflooding    the
  7922.     MaxAge LSA just as if it was a newly originated LSA    (see Section
  7923.     13.3).
  7924.  
  7925.     When creating a Database summary list for a    newly forming adjacency,
  7926.     any    MaxAge LSAs present in the link    state database are added to the
  7927.     neighbor's Link state retransmission list instead of the neighbor's
  7928.     Database summary list.  See    Section    10.3 for more details.
  7929.  
  7930.     A MaxAge LSA must be removed immediately from the router's link
  7931.     state database as soon as both a) it is no longer contained    on any
  7932.     neighbor Link state    retransmission lists and b) none of the    router's
  7933.     neighbors are in states Exchange or    Loading.
  7934.  
  7935.     When, in the process of aging the link state database, an LSA's LS
  7936.     age    hits a multiple    of CheckAge, its LS checksum should be verified.
  7937.     If the LS checksum is incorrect, a program or memory error has been
  7938.     detected, and at the very least the    router itself should be
  7939.     restarted.
  7940.  
  7941.  
  7942.     14.1.  Premature aging of LSAs
  7943.  
  7944.     An LSA can be flushed from the routing domain by setting its LS
  7945.     age to MaxAge and reflooding the LSA.  This procedure follows
  7946.     the same course    as flushing an LSA whose LS age    has naturally
  7947.     reached    the value MaxAge (see Section 14).  In particular, the
  7948.     MaxAge LSA is removed from the router's    link state database as
  7949.  
  7950.  
  7951.  
  7952. Moy                                  [Page 142]
  7953.  
  7954. Internet Draft             OSPF Version 2            January 1997
  7955.  
  7956.  
  7957.     soon as    a) it is no longer contained on    any neighbor Link state
  7958.     retransmission lists and b) none of the    router's neighbors are
  7959.     in states Exchange or Loading.    We call    the setting of an LSA's
  7960.     LS age to MaxAge "premature aging".
  7961.  
  7962.     Premature aging    is used    when it    is time    for a self-originated
  7963.     LSA's sequence number field to wrap.  At this point, the current
  7964.     LSA instance (having LS    sequence number    MaxSequenceNumber) must
  7965.     be prematurely aged and    flushed    from the routing domain    before a
  7966.     new instance with sequence number equal    to InitialSequenceNumber
  7967.     can be originated.  See    Section    12.1.6 for more    information.
  7968.  
  7969.     Premature aging    can also be used when, for example, one    of the
  7970.     router's previously advertised external    routes is no longer
  7971.     reachable.  In this circumstance, the router can flush its AS-
  7972.     external-LSA from the routing domain via premature aging. This
  7973.     procedure is preferable    to the alternative, which is to
  7974.     originate a new    LSA for    the destination    specifying a metric of
  7975.     LSInfinity.  Premature aging is    also be    used when unexpectedly
  7976.     receiving self-originated LSAs during the flooding procedure
  7977.     (see Section 13.4).
  7978.  
  7979.     A router may only prematurely age its own self-originated LSAs.
  7980.     The router may not prematurely age LSAs    that have been
  7981.     originated by other routers. An    LSA is considered self-
  7982.     originated when    either 1) the LSA's Advertising    Router is equal
  7983.     to the router's    own Router ID or 2) the    LSA is a network-LSA and
  7984.     its Link State ID is equal to one of the router's own IP
  7985.     interface addresses.
  7986.  
  7987.  
  7988. 15.  Virtual Links
  7989.  
  7990.     The    single backbone    area (Area ID =    0.0.0.0) cannot    be disconnected,
  7991.     or some areas of the Autonomous System will    become unreachable.  To
  7992.     establish/maintain connectivity of the backbone, virtual links can
  7993.     be configured through non-backbone areas.  Virtual links serve to
  7994.     connect physically separate    components of the backbone.  The two
  7995.     endpoints of a virtual link    are area border    routers.  The virtual
  7996.     link must be configured in both routers.  The configuration
  7997.     information    in each    router consists    of the other virtual endpoint
  7998.     (the other area border router), and    the non-backbone area the two
  7999.     routers have in common (called the Transit area).  Virtual links
  8000.     cannot be configured through stub areas (see Section 3.6).
  8001.  
  8002.     The    virtual    link is    treated    as if it were an unnumbered point-to-
  8003.     point network belonging to the backbone and    joining    the two    area
  8004.     border routers.  An    attempt    is made    to establish an    adjacency over
  8005.  
  8006.  
  8007.  
  8008. Moy                                  [Page 143]
  8009.  
  8010. Internet Draft             OSPF Version 2            January 1997
  8011.  
  8012.  
  8013.     the    virtual    link.  When this adjacency is established, the virtual
  8014.     link will be included in backbone router-LSAs, and OSPF packets
  8015.     pertaining to the backbone area will flow over the adjacency.  Such
  8016.     an adjacency has been referred to in this document as a "virtual
  8017.     adjacency".
  8018.  
  8019.     In each endpoint router, the cost and viability of the virtual link
  8020.     is discovered by examining the routing table entry for the other
  8021.     endpoint router.  (The entry's associated area must    be the
  8022.     configured Transit area).  Actually, there may be a    separate routing
  8023.     table entry    for each Type of Service.  These are called the    virtual
  8024.     link's corresponding routing table entries.     The InterfaceUp event
  8025.     occurs for a virtual link when its corresponding TOS 0 routing table
  8026.     entry becomes reachable.  Conversely, the InterfaceDown event occurs
  8027.     when its TOS 0 routing table entry becomes unreachable.[22]    In other
  8028.     words, the virtual link's viability    is determined by the existence
  8029.     of an intra-area path, through the Transit area, between the two
  8030.     endpoints.    Note that a virtual link whose underlying path has cost
  8031.     greater than hexadecimal 0xffff (the maximum size of an interface
  8032.     cost in a router-LSA) should be considered inoperational (i.e.,
  8033.     treated the    same as    if the path did    not exist).
  8034.  
  8035.     The    other details concerning virtual links are as follows:
  8036.  
  8037.     o    AS-external-LSAs are NEVER flooded over    virtual    adjacencies.
  8038.     This would be duplication of effort, since the same AS-
  8039.     external-LSAs are already flooded throughout the virtual link's
  8040.     Transit    area.  For this    same reason, AS-external-LSAs are not
  8041.     summarized over    virtual    adjacencies during the Database    Exchange
  8042.     process.
  8043.  
  8044.     o    The cost of a virtual link is NOT configured.  It is defined to
  8045.     be the cost of the intra-area path between the two defining area
  8046.     border routers.     This cost appears in the virtual link's
  8047.     corresponding routing table entry.  When the cost of a virtual
  8048.     link changes, a    new router-LSA should be originated for    the
  8049.     backbone area.
  8050.  
  8051.     o    Just as    the virtual link's cost    and viability are determined by
  8052.     the routing table build    process    (through construction of the
  8053.     routing    table entry for    the other endpoint), so    are the    IP
  8054.     interface address for the virtual interface and    the virtual
  8055.     neighbor's IP address.    These are used when sending OSPF
  8056.     protocol packets over the virtual link.    Note that when one (or
  8057.     both) of the virtual link endpoints connect to the Transit area
  8058.     via an unnumbered point-to-point link, it may be impossible to
  8059.     calculate either the virtual interface's IP address and/or the
  8060.     virtual    neighbor's IP address, thereby causing the virtual link
  8061.  
  8062.  
  8063.  
  8064. Moy                                  [Page 144]
  8065.  
  8066. Internet Draft             OSPF Version 2            January 1997
  8067.  
  8068.  
  8069.     to fail.
  8070.  
  8071.     o    In each    endpoint's router-LSA for the backbone,    the virtual link
  8072.     is represented as a Type 4 link    whose Link ID is set to    the
  8073.     virtual    neighbor's OSPF    Router ID and whose Link Data is set to
  8074.     the virtual interface's    IP address.  See Section 12.4.1    for more
  8075.     information. Note that it may be the case that there is    a TOS 0
  8076.     path, but no non-zero TOS paths, between the two endpoint
  8077.     routers.  In this case,    both routers must revert to being non-
  8078.     TOS-capable, clearing the T-bit    in the Options field of    their
  8079.     backbone router-LSAs.
  8080.  
  8081.     o    A non-backbone area can    carry transit data traffic (i.e., is
  8082.     considered a "transit area") if    and only if it serves as the
  8083.     Transit    area for one or    more fully adjacent virtual links (see
  8084.     TransitCapability in Sections 6    and 16.1). Such    an area    requires
  8085.     special    treatment when summarizing backbone networks into it
  8086.     (see Section 12.4.3), and during the routing calculation (see
  8087.     Section    16.3).
  8088.  
  8089.     o    The time between link state retransmissions, RxmtInterval, is
  8090.     configured for a virtual link.    This should be well over the
  8091.     expected round-trip delay between the two routers.  This may be
  8092.     hard to    estimate for a virtual link; it    is better to err on the
  8093.     side of    making it too large.
  8094.  
  8095.  
  8096. 16.  Calculation of the    routing    table
  8097.  
  8098.     This section details the OSPF routing table    calculation.  Using its
  8099.     attached areas' link state databases as input, a router runs the
  8100.     following algorithm, building its routing table step by step.  At
  8101.     each step, the router must access individual pieces    of the link
  8102.     state databases (e.g., a router-LSA    originated by a    certain    router).
  8103.     This access    is performed by    the lookup function discussed in Section
  8104.     12.2.  The lookup process may return an LSA    whose LS age is    equal to
  8105.     MaxAge.  Such an LSA should    not be used in the routing table
  8106.     calculation, and is    treated    just as    if the lookup process had
  8107.     failed.
  8108.  
  8109.     The    OSPF routing table's organization is explained in Section 11.
  8110.     Two    examples of the    routing    table build process are    presented in
  8111.     Sections 11.2 and 11.3.  This process can be broken    into the
  8112.     following steps:
  8113.  
  8114.  
  8115.     (1)    The present routing table is invalidated.  The routing table is
  8116.     built again from scratch.  The old routing table is saved so
  8117.  
  8118.  
  8119.  
  8120. Moy                                  [Page 145]
  8121.  
  8122. Internet Draft             OSPF Version 2            January 1997
  8123.  
  8124.  
  8125.     that changes in    routing    table entries can be identified.
  8126.  
  8127.     (2)    The intra-area routes are calculated by    building the shortest-
  8128.     path tree for each attached area.  In particular, all routing
  8129.     table entries whose Destination    Type is    "area border router" are
  8130.     calculated in this step.  This step is described in two    parts.
  8131.     At first the tree is constructed by only considering those links
  8132.     between    routers    and transit networks.  Then the    stub networks
  8133.     are incorporated into the tree.    During the area's shortest-path
  8134.     tree calculation, the area's TransitCapability is also
  8135.     calculated for later use in Step 4.
  8136.  
  8137.     (3)    The inter-area routes are calculated, through examination of
  8138.     summary-LSAs.  If the router is    attached to multiple areas
  8139.     (i.e., it is an    area border router), only backbone summary-LSAs
  8140.     are examined.
  8141.  
  8142.     (4)    In area    border routers connecting to one or more transit areas
  8143.     (i.e, non-backbone areas whose TransitCapability is found to be
  8144.     TRUE), the transit areas' summary-LSAs are examined to see
  8145.     whether    better paths exist using the transit areas than    were
  8146.     found in Steps 2-3 above.
  8147.  
  8148.     (5)    Routes to external destinations    are calculated,    through
  8149.     examination of AS-external-LSAs.  The locations    of the AS
  8150.     boundary routers (which    originate the AS-external-LSAs)    have
  8151.     been determined    in steps 2-4.
  8152.  
  8153.  
  8154.     Steps 2-5 are explained in further detail below.  The explanations
  8155.     describe the calculations for TOS 0    only.  It may also be necessary
  8156.     to perform each step (separately) for each of the non-zero TOS
  8157.     values.[23]    For more information concerning    the building of    non-zero
  8158.     TOS    routes see Section 16.9.
  8159.  
  8160.     Changes made to routing table entries as a result of these
  8161.     calculations can cause the OSPF protocol to    take further actions.
  8162.     For    example, a change to an    intra-area route will cause an area
  8163.     border router to originate new summary-LSAs    (see Section 12.4).  See
  8164.     Section 16.7 for a complete    list of    the OSPF protocol actions
  8165.     resulting from routing table changes.
  8166.  
  8167.  
  8168.     16.1.  Calculating the shortest-path tree for an area
  8169.  
  8170.     This calculation yields    the set    of intra-area routes associated
  8171.     with an    area (called hereafter Area A).     A router calculates the
  8172.     shortest-path tree using itself    as the root.[24] The formation
  8173.  
  8174.  
  8175.  
  8176. Moy                                  [Page 146]
  8177.  
  8178. Internet Draft             OSPF Version 2            January 1997
  8179.  
  8180.  
  8181.     of the shortest    path tree is done here in two stages.  In the
  8182.     first stage, only links    between    routers    and transit networks are
  8183.     considered.  Using the Dijkstra    algorithm, a tree is formed from
  8184.     this subset of the link    state database.     In the    second stage,
  8185.     leaves are added to the    tree by    considering the    links to stub
  8186.     networks.
  8187.  
  8188.     The procedure will be explained    using the graph    terminology that
  8189.     was introduced in Section 2.  The area's link state database is
  8190.     represented as a directed graph.  The graph's vertices are
  8191.     routers, transit networks and stub networks.  The first    stage of
  8192.     the procedure concerns only the    transit    vertices (routers and
  8193.     transit    networks) and their connecting links.  Throughout the
  8194.     shortest path calculation, the following data is also associated
  8195.     with each transit vertex:
  8196.  
  8197.  
  8198.     Vertex (node) ID
  8199.         A 32-bit number uniquely identifying the vertex.  For router
  8200.         vertices this is the router's OSPF Router ID.  For network
  8201.         vertices, this is the IP address of    the network's Designated
  8202.         Router.
  8203.  
  8204.     An LSA
  8205.         Each transit vertex    has an associated LSA.    For router
  8206.         vertices, this is a    router-LSA.  For transit networks, this
  8207.         is a network-LSA (which is actually    originated by the
  8208.         network's Designated Router).  In any case,    the LSA's Link
  8209.         State ID is    always equal to    the above Vertex ID.
  8210.  
  8211.     List of    next hops
  8212.         The    list of    next hops for the current set of shortest paths
  8213.         from the root to this vertex.  There can be    multiple
  8214.         shortest paths due to the equal-cost multipath capability.
  8215.         Each next hop indicates the    outgoing router    interface to use
  8216.         when forwarding traffic to the destination.     On broadcast,
  8217.         Point-to-MultiPoint    and NBMA networks, the next hop    also
  8218.         includes the IP address of the next    router (if any)    in the
  8219.         path towards the destination.
  8220.  
  8221.     Distance from root
  8222.         The    link state cost    of the current set of shortest paths
  8223.         from the root to the vertex.  The link state cost of a path
  8224.         is calculated as the sum of    the costs of the path's
  8225.         constituent    links (as advertised in    router-LSAs and
  8226.         network-LSAs).  One    path is    said to    be "shorter" than
  8227.         another if it has a    smaller    link state cost.
  8228.  
  8229.  
  8230.  
  8231.  
  8232. Moy                                  [Page 147]
  8233.  
  8234. Internet Draft             OSPF Version 2            January 1997
  8235.  
  8236.  
  8237.     The first stage    of the procedure (i.e.,    the Dijkstra algorithm)
  8238.     can now    be summarized as follows. At each iteration of the
  8239.     algorithm, there is a list of candidate    vertices.  Paths from
  8240.     the root to these vertices have    been found, but    not necessarily
  8241.     the shortest ones.  However, the paths to the candidate    vertex
  8242.     that is    closest    to the root are    guaranteed to be shortest; this
  8243.     vertex is added    to the shortest-path tree, removed from    the
  8244.     candidate list,    and its    adjacent vertices are examined for
  8245.     possible addition to/modification of the candidate list.  The
  8246.     algorithm then iterates    again.    It terminates when the candidate
  8247.     list becomes empty.
  8248.  
  8249.     The following steps describe the algorithm in detail.  Remember
  8250.     that we    are computing the shortest path    tree for Area A.  All
  8251.     references to link state database lookup below are from    Area A's
  8252.     database.
  8253.  
  8254.  
  8255.     (1) Initialize the algorithm's data structures.     Clear the list
  8256.         of candidate vertices.  Initialize the shortest-path tree to
  8257.         only the root (which is the    router doing the calculation).
  8258.         Set    Area A's TransitCapability to FALSE.
  8259.  
  8260.     (2) Call the vertex just added to the tree vertex V.  Examine
  8261.         the    LSA associated with vertex V.  This is a lookup    in the
  8262.         Area A's link state    database based on the Vertex ID.  If
  8263.         this is a router-LSA, and bit V of the router-LSA (see
  8264.         Section A.4.2) is set, set Area A's    TransitCapability to
  8265.         TRUE.  In any case,    each link described by the LSA gives the
  8266.         cost to an adjacent    vertex.     For each described link, (say
  8267.         it joins vertex V to vertex    W):
  8268.  
  8269.         (a)    If this    is a link to a stub network, examine the next
  8270.         link in    V's LSA.  Links    to stub    networks will be
  8271.         considered in the second stage of the shortest path
  8272.         calculation.
  8273.  
  8274.         (b)    Otherwise, W is    a transit vertex (router or transit
  8275.         network).  Look    up the vertex W's LSA (router-LSA or
  8276.         network-LSA) in    Area A's link state database.  If the
  8277.         LSA does not exist, or its LS age is equal to MaxAge, or
  8278.         it does    not have a link    back to    vertex V, examine the
  8279.         next link in V's LSA.[25]
  8280.  
  8281.         (c)    If vertex W is already on the shortest-path tree,
  8282.         examine    the next link in the LSA.
  8283.  
  8284.  
  8285.  
  8286.  
  8287.  
  8288. Moy                                  [Page 148]
  8289.  
  8290. Internet Draft             OSPF Version 2            January 1997
  8291.  
  8292.  
  8293.         (d)    Calculate the link state cost D    of the resulting path
  8294.         from the root to vertex    W.  D is equal to the sum of the
  8295.         link state cost    of the (already    calculated) shortest
  8296.         path to    vertex V and the advertised cost of the    link
  8297.         between    vertices V and W.  If D    is:
  8298.  
  8299.         o   Greater than the value that    already    appears    for
  8300.             vertex W on    the candidate list, then examine the
  8301.             next link.
  8302.  
  8303.         o   Equal to the value that appears for    vertex W on the
  8304.             candidate list, calculate the set of next hops that
  8305.             result from    using the advertised link.  Input to
  8306.             this calculation is    the destination    (W), and its
  8307.             parent (V).     This calculation is shown in Section
  8308.             16.1.1.  This set of hops should be    added to the
  8309.             next hop values that appear    for W on the candidate
  8310.             list.
  8311.  
  8312.         o   Less than the value    that appears for vertex    W on the
  8313.             candidate list, or if W does not yet appear    on the
  8314.             candidate list, then set the entry for W on    the
  8315.             candidate list to indicate a distance of D from the
  8316.             root.  Also    calculate the list of next hops    that
  8317.             result from    using the advertised link, setting the
  8318.             next hop values for    W accordingly.    The next hop
  8319.             calculation    is described in    Section    16.1.1;    it takes
  8320.             as input the destination (W) and its parent    (V).
  8321.  
  8322.     (3) If at this step the    candidate list is empty, the shortest-
  8323.         path tree (of transit vertices) has    been completely    built
  8324.         and    this stage of the procedure terminates.     Otherwise,
  8325.         choose the vertex belonging    to the candidate list that is
  8326.         closest to the root, and add it to the shortest-path tree
  8327.         (removing it from the candidate list in the    process). Note
  8328.         that when there is a choice    of vertices closest to the root,
  8329.         network vertices must be chosen before router vertices in
  8330.         order to necessarily find all equal-cost paths. This is
  8331.         consistent with the    tie-breakers that were introduced in the
  8332.         modified Dijkstra algorithm    used by    OSPF's Multicast routing
  8333.         extensions (MOSPF).
  8334.  
  8335.     (4) Possibly modify the    routing    table.    For those routing table
  8336.         entries modified, the associated area will be set to Area A,
  8337.         the    path type will be set to intra-area, and the cost will
  8338.         be set to the newly    discovered shortest path's calculated
  8339.         distance.
  8340.  
  8341.  
  8342.  
  8343.  
  8344. Moy                                  [Page 149]
  8345.  
  8346. Internet Draft             OSPF Version 2            January 1997
  8347.  
  8348.  
  8349.         If the newly added vertex is an area border    router or AS
  8350.         boundary router, a routing table entry is added whose
  8351.         destination    type is    "router".  The Options field found in
  8352.         the    associated router-LSA is copied    into the routing table
  8353.         entry's Optional capabilities field. Call the newly    added
  8354.         vertex Router X.  If Router    X is the endpoint of one of the
  8355.         calculating    router's virtual links,    and the    virtual    link
  8356.         uses Area A    as Transit area:  the virtual link is declared
  8357.         up,    the IP address of the virtual interface    is set to the IP
  8358.         address of the outgoing interface calculated above for
  8359.         Router X, and the virtual neighbor's IP address is set to
  8360.         Router X's interface address (contained in Router X's
  8361.         router-LSA)    that points back to the    root of    the shortest-
  8362.         path tree; equivalently, this is the interface that    points
  8363.         back to Router X's parent vertex on    the shortest-path tree
  8364.         (similar to    the calculation    in Section 16.1.1).
  8365.  
  8366.         If the newly added vertex is a transit network, the    routing
  8367.         table entry    for the    network    is located.  The entry's
  8368.         Destination    ID is the IP network number, which can be
  8369.         obtained by    masking    the Vertex ID (Link State ID) with its
  8370.         associated subnet mask (found in the body of the associated
  8371.         network-LSA).  If the routing table    entry already exists
  8372.         (i.e., there is already an intra-area route    to the
  8373.         destination    installed in the routing table), multiple
  8374.         vertices have mapped to the    same IP    network.  For example,
  8375.         this can occur when    a new Designated Router    is being
  8376.         established.  In this case,    the current routing table entry
  8377.         should be overwritten if and only if the newly found path is
  8378.         just as short and the current routing table    entry's    Link
  8379.         State Origin has a smaller Link State ID than the newly
  8380.         added vertex' LSA.
  8381.  
  8382.         If there is    no routing table entry for the network (the
  8383.         usual case), a routing table entry for the IP network should
  8384.         be added.  The routing table entry's Link State Origin
  8385.         should be set to the newly added vertex' LSA.
  8386.  
  8387.     (5) Iterate the    algorithm by returning to Step 2.
  8388.  
  8389.  
  8390.     The stub networks are added to the tree    in the procedure's
  8391.     second stage.  In this stage, all router vertices are again
  8392.     examined.  Those that have been    determined to be unreachable in
  8393.     the above first    phase are discarded.  For each reachable router
  8394.     vertex (call it    V), the    associated router-LSA is found in the
  8395.     link state database.  Each stub    network    link appearing in the
  8396.     LSA is then examined, and the following    steps are executed:
  8397.  
  8398.  
  8399.  
  8400. Moy                                  [Page 150]
  8401.  
  8402. Internet Draft             OSPF Version 2            January 1997
  8403.  
  8404.  
  8405.     (1) Calculate the distance D of    stub network from the root.  D
  8406.         is equal to    the distance from the root to the router vertex
  8407.         (calculated    in stage 1), plus the stub network link's
  8408.         advertised cost.  Compare this distance to the current best
  8409.         cost to the    stub network.  This is done by looking up the
  8410.         stub network's current routing table entry.     If the
  8411.         calculated distance    D is larger, go    on to examine the next
  8412.         stub network link in the LSA.
  8413.  
  8414.     (2) If this step is reached, the stub network's    routing    table
  8415.         entry must be updated.  Calculate the set of next hops that
  8416.         would result from using the    stub network link.  This
  8417.         calculation    is shown in Section 16.1.1; input to this
  8418.         calculation    is the destination (the    stub network) and the
  8419.         parent vertex (the router vertex).    If the distance    D is the
  8420.         same as the    current    routing    table cost, simply add this set
  8421.         of next hops to the    routing    table entry's list of next hops.
  8422.         In this case, the routing table already has    a Link State
  8423.         Origin.  If    this Link State    Origin is a router-LSA whose
  8424.         Link State ID is smaller than V's Router ID, reset the Link
  8425.         State Origin to V's    router-LSA.
  8426.  
  8427.         Otherwise D    is smaller than    the routing table cost.
  8428.         Overwrite the current routing table    entry by setting the
  8429.         routing table entry's cost to D, and by setting the    entry's
  8430.         list of next hops to the newly calculated set.  Set    the
  8431.         routing table entry's Link State Origin to V's router-LSA.
  8432.         Then go on to examine the next stub    network    link.
  8433.  
  8434.  
  8435.     For all    routing    table entries added/modified in    the second
  8436.     stage, the associated area will    be set to Area A and the path
  8437.     type will be set to intra-area.     When the list of reachable
  8438.     router-LSAs is exhausted, the second stage is completed.  At
  8439.     this time, all intra-area routes associated with Area A    have
  8440.     been determined.
  8441.  
  8442.     The specification does not require that    the above two stage
  8443.     method be used to calculate the    shortest path tree.  However, if
  8444.     another    algorithm is used, an identical    tree must be produced.
  8445.     For this reason, it is important to note that links between
  8446.     transit    vertices must be bidirectional in order    to be included
  8447.     in the above tree.  It should also be mentioned    that more
  8448.     efficient algorithms exist for calculating the tree; for
  8449.     example, the incremental SPF algorithm described in [Ref1].
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456. Moy                                  [Page 151]
  8457.  
  8458. Internet Draft             OSPF Version 2            January 1997
  8459.  
  8460.  
  8461.     16.1.1.     The next hop calculation
  8462.  
  8463.         This section explains how to calculate the current set of
  8464.         next hops to use for a destination.     Each next hop consists
  8465.         of the outgoing interface to use in    forwarding packets to
  8466.         the    destination together with the IP address of the    next hop
  8467.         router (if any).  The next hop calculation is invoked each
  8468.         time a shorter path    to the destination is discovered.  This
  8469.         can    happen in either stage of the shortest-path tree
  8470.         calculation    (see Section 16.1).  In    stage 1    of the
  8471.         shortest-path tree calculation a shorter path is found as
  8472.         the    destination is added to    the candidate list, or when the
  8473.         destination's entry    on the candidate list is modified (Step
  8474.         2d of Stage    1).  In    stage 2    a shorter path is discovered
  8475.         each time the destination's    routing    table entry is modified
  8476.         (Step 2 of Stage 2).
  8477.  
  8478.         The    set of next hops to use    for the    destination may    be
  8479.         recalculated several times during the shortest-path    tree
  8480.         calculation, as shorter and    shorter    paths are discovered.
  8481.         In the end,    the destination's routing table    entry will
  8482.         always reflect the next hops resulting from    the absolute
  8483.         shortest path(s).
  8484.  
  8485.         Input to the next hop calculation is a) the    destination and
  8486.         b) its parent in the current shortest path between the root
  8487.         (the calculating router) and the destination.  The parent is
  8488.         always a transit vertex (i.e., always a router or a    transit
  8489.         network).
  8490.  
  8491.         If there is    at least one intervening router    in the current
  8492.         shortest path between the destination and the root,    the
  8493.         destination    simply inherits    the set    of next    hops from the
  8494.         parent.  Otherwise,    there are two cases.  In the first case,
  8495.         the    parent vertex is the root (the calculating router
  8496.         itself).  This means that the destination is either    a
  8497.         directly connected network or directly connected router.
  8498.         The    outgoing interface in this case    is simply the OSPF
  8499.         interface connecting to the    destination network/router. If
  8500.         the    destination is a router    which connects to the
  8501.         calculating    router via a Point-to-MultiPoint network, the
  8502.         destination's next hop IP address(es) can be determined by
  8503.         examining the destination's    router-LSA: each link pointing
  8504.         back to the    calculating router and having a    Link Data field
  8505.         belonging to the Point-to-MultiPoint network provides an IP
  8506.         address of the next    hop router. If the destination is a
  8507.         directly connected network,    or a router which connects to
  8508.         the    calculating router via a point-to-point    interface, no
  8509.  
  8510.  
  8511.  
  8512. Moy                                  [Page 152]
  8513.  
  8514. Internet Draft             OSPF Version 2            January 1997
  8515.  
  8516.  
  8517.         next hop IP    address    is required. If    the destination    is a
  8518.         router connected to    the calculating    router via a virtual
  8519.         link, the setting of the next hop should be    deferred until
  8520.         the    calculation in Section 16.3.
  8521.  
  8522.         In the second case,    the parent vertex is a network that
  8523.         directly connects the calculating router to    the destination
  8524.         router.  The list of next hops is then determined by
  8525.         examining the destination's    router-LSA.  For each link in
  8526.         the    router-LSA that    points back to the parent network, the
  8527.         link's Link    Data field provides the    IP address of a    next hop
  8528.         router.  The outgoing interface to use can then be derived
  8529.         from the next hop IP address (or it    can be inherited from
  8530.         the    parent network).
  8531.  
  8532.  
  8533.     16.2.  Calculating the inter-area routes
  8534.  
  8535.     The inter-area routes are calculated by    examining summary-LSAs.
  8536.     If the router has active attachments to    multiple areas,    only
  8537.     backbone summary-LSAs are examined.  Routers attached to a
  8538.     single area examine that area's    summary-LSAs.  In either case,
  8539.     the summary-LSAs examined below    are all    part of    a single area's
  8540.     link state database (call it Area A).
  8541.  
  8542.     Summary-LSAs are originated by the area    border routers.     Each
  8543.     summary-LSA in Area A is considered in turn.  Remember that the
  8544.     destination described by a summary-LSA is either a network (Type
  8545.     3 summary-LSAs)    or an AS boundary router (Type 4 summary-LSAs).
  8546.     For each summary-LSA:
  8547.  
  8548.  
  8549.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8550.         LSA's LS age is equal to MaxAge, then examine the the next
  8551.         LSA.
  8552.  
  8553.     (2) If the LSA was originated by the calculating router    itself,
  8554.         examine the    next LSA.
  8555.  
  8556.     (3) If it is a Type 3 summary-LSA, and the collection of
  8557.         destinations described by the summary-LSA equals one of the
  8558.         router's configured    area address ranges (see Section 3.5),
  8559.         and    the particular area address range is active, then the
  8560.         summary-LSA    should be ignored.  "Active" means that    there
  8561.         are    one or more reachable (by intra-area paths) networks
  8562.         contained in the area range.
  8563.  
  8564.  
  8565.  
  8566.  
  8567.  
  8568. Moy                                  [Page 153]
  8569.  
  8570. Internet Draft             OSPF Version 2            January 1997
  8571.  
  8572.  
  8573.     (4) Else, call the destination described by the    LSA N (for Type
  8574.         3 summary-LSAs, N's    address    is obtained by masking the LSA's
  8575.         Link State ID with the network/subnet mask contained in the
  8576.         body of the    LSA), and the area border originating the LSA
  8577.         BR.     Look up the routing table entry for BR    having Area A as
  8578.         its    associated area.  If no    such entry exists for router BR
  8579.         (i.e., BR is unreachable in    Area A), do nothing with this
  8580.         LSA    and consider the next in the list.  Else, this LSA
  8581.         describes an inter-area path to destination    N, whose cost is
  8582.         the    distance to BR plus the    cost specified in the LSA. Call
  8583.         the    cost of    this inter-area    path IAC.
  8584.  
  8585.     (5) Next, look up the routing table entry for the destination N.
  8586.         (If    N is an    AS boundary router, look up the    "router" routing
  8587.         table entry    associated with    Area A).  If no    entry exists for
  8588.         N or if the    entry's    path type is "type 1 external" or "type
  8589.         2 external", then install the inter-area path to N,    with
  8590.         associated area Area A, cost IAC, next hop equal to    the list
  8591.         of next hops to router BR, and Advertising router equal to
  8592.         BR.
  8593.  
  8594.     (6) Else, if the paths present in the table are    intra-area
  8595.         paths, do nothing with the LSA (intra-area paths are always
  8596.         preferred).
  8597.  
  8598.     (7) Else, the paths present in the routing table are also
  8599.         inter-area paths.  Install the new path through BR if it is
  8600.         cheaper, overriding    the paths in the routing table.
  8601.         Otherwise, if the new path is the same cost, add it    to the
  8602.         list of paths that appear in the routing table entry.
  8603.  
  8604.  
  8605.     16.3.  Examining transit areas' summary-LSAs
  8606.  
  8607.     This step is only performed by area border routers attached to
  8608.     one or more non-backbone areas that are    capable    of carrying
  8609.     transit    traffic    (i.e., "transit    areas",    or those areas whose
  8610.     TransitCapability parameter has    been set to TRUE in Step 2 of
  8611.     the Dijkstra algorithm (see Section 16.1).
  8612.  
  8613.     The purpose of the calculation below is    to examine the transit
  8614.     areas to see whether they provide any better (shorter) paths
  8615.     than the paths previously calculated in    Sections 16.1 and 16.2.
  8616.     Any paths found    that are better    than or    equal to previously
  8617.     discovered paths are installed in the routing table.
  8618.  
  8619.     The calculation    proceeds as follows. All the transit areas'
  8620.     summary-LSAs are examined in turn.  Each such summary-LSA
  8621.  
  8622.  
  8623.  
  8624. Moy                                  [Page 154]
  8625.  
  8626. Internet Draft             OSPF Version 2            January 1997
  8627.  
  8628.  
  8629.     describes a route through a transit area Area A    to a Network N
  8630.     (N's address is    obtained by masking the    LSA's Link State ID with
  8631.     the network/subnet mask    contained in the body of the LSA) or in
  8632.     the case of a Type 4 summary-LSA, to an    AS boundary router N.
  8633.     Suppose    also that the summary-LSA was originated by an area
  8634.     border router BR.
  8635.  
  8636.     (1) If the cost    advertised by the summary-LSA is LSInfinity, or
  8637.         if the LSA's LS age    is equal to MaxAge, then examine the
  8638.         next LSA.
  8639.  
  8640.     (2) If the summary-LSA was originated by the calculating router
  8641.         itself, examine the    next LSA.
  8642.  
  8643.     (3) Look up the    routing    table entry for    N. (If N is an AS
  8644.         boundary router, look up the "router" routing table    entry
  8645.         associated with the    backbone area).    If it does not exist, or
  8646.         if the route type is other than intra-area or inter-area, or
  8647.         if the area    associated with    the routing table entry    is not
  8648.         the    backbone area, then examine the    next LSA. In other
  8649.         words, this    calculation only updates backbone intra-area
  8650.         routes found in Section 16.1 and inter-area    routes found in
  8651.         Section 16.2.
  8652.  
  8653.     (4) Look up the    routing    table entry for    the advertising    router
  8654.         BR associated with the Area    A. If it is unreachable, examine
  8655.         the    next LSA. Otherwise, the cost to destination N is the
  8656.         sum    of the cost in BR's Area A routing table entry and the
  8657.         cost advertised in the LSA.    Call this cost IAC.
  8658.  
  8659.     (5) If this cost is less than the cost occurring in N's    routing
  8660.         table entry, overwrite N's list of next hops with those used
  8661.         for    BR, and    set N's    routing    table cost to IAC. Else, if IAC
  8662.         is the same    as N's current cost, add BR's list of next hops
  8663.         to N's list    of next    hops. In any case, the area associated
  8664.         with N's routing table entry must remain the backbone area,
  8665.         and    the path type (either intra-area or inter-area)    must
  8666.         also remain    the same.
  8667.  
  8668.     It is important    to note    that the above calculation never makes
  8669.     unreachable destinations reachable, but    instead    just potentially
  8670.     finds better paths to already reachable    destinations.  The
  8671.     calculation installs any better    cost found into    the routing
  8672.     table entry, from which    it may be readvertised in summary-LSAs
  8673.     to other areas.
  8674.  
  8675.     As an example of the calculation, consider the Autonomous System
  8676.     pictured in Figure 17.    There is a single non-backbone area
  8677.  
  8678.  
  8679.  
  8680. Moy                                  [Page 155]
  8681.  
  8682. Internet Draft             OSPF Version 2            January 1997
  8683.  
  8684.  
  8685.  
  8686.               ........................
  8687.               .    Area 1 (transit)     .          +
  8688.               .                 .          |
  8689.               .         +---+1       1+---+100      |
  8690.               .         |RT2|----------|RT4|=========|
  8691.               .       1/+---+********* +---+      |
  8692.               .       /*******         .          |
  8693.               .     1/*Virtual         .          |
  8694.            1+---+/*  Link         .           Net|work
  8695.          =======|RT1|*             .          | N1
  8696.             +---+\             .          |
  8697.               .      \             .          |
  8698.               .       \             .          |
  8699.               .       1\+---+1       1+---+20      |
  8700.               .         |RT3|----------|RT5|=========|
  8701.               .         +---+        +---+      |
  8702.               .                 .          |
  8703.               ........................          +
  8704.  
  8705.  
  8706.             Figure 17: Routing through transit areas
  8707.  
  8708.     (Area 1) that physically divides the backbone into two separate
  8709.     pieces.    To maintain connectivity of the    backbone, a virtual link
  8710.     has been configured between routers RT1    and RT4. On the    right
  8711.     side of    the figure, Network N1 belongs to the backbone.    The
  8712.     dotted lines indicate that there is a much shorter intra-area
  8713.     backbone path between router RT5 and Network N1    (cost 20) than
  8714.     there is between Router    RT4 and    Network    N1 (cost 100). Both
  8715.     Router RT4 and Router RT5 will inject summary-LSAs for Network
  8716.     N1 into    Area 1.
  8717.  
  8718.     After the shortest-path    tree has been calculated for the
  8719.     backbone in Section 16.1, Router RT1 (left end of the virtual
  8720.     link) will have    calculated a path through Router RT4 for all
  8721.     data traffic destined for Network N1. However, since Router RT5
  8722.     is so much closer to Network N1, all routers internal to Area 1
  8723.     (e.g., Routers RT2 and RT3) will forward their Network N1
  8724.     traffic    towards    Router RT5, instead of RT4. And    indeed,    after
  8725.     examining Area 1's summary-LSAs    by the above calculation, Router
  8726.     RT1 will also forward Network N1 traffic towards RT5. Note that
  8727.     in this    example    the virtual link enables transit data traffic to
  8728.     be forwarded through Area 1, but the actual path the transit
  8729.     data traffic takes does    not follow the virtual link.  In other
  8730.     words, virtual links allow transit traffic to be forwarded
  8731.     through    an area, but do    not dictate the    precise    path that the
  8732.     traffic    will take.
  8733.  
  8734.  
  8735.  
  8736. Moy                                  [Page 156]
  8737.  
  8738. Internet Draft             OSPF Version 2            January 1997
  8739.  
  8740.  
  8741.     16.4.  Calculating AS external routes
  8742.  
  8743.     AS external routes are calculated by examining AS-external-LSAs.
  8744.     Each of    the AS-external-LSAs is    considered in turn.  Most AS-
  8745.     external-LSAs describe routes to specific IP destinations.  An
  8746.     AS-external-LSA    can also describe a default route for the
  8747.     Autonomous System (Destination ID = DefaultDestination,
  8748.     network/subnet mask = 0x00000000).  For    each AS-external-LSA:
  8749.  
  8750.  
  8751.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8752.         LSA's LS age is equal to MaxAge, then examine the next LSA.
  8753.  
  8754.     (2) If the LSA was originated by the calculating router    itself,
  8755.         examine the    next LSA.
  8756.  
  8757.     (3) Call the destination described by the LSA N.  N's address is
  8758.         obtained by    masking    the LSA's Link State ID    with the
  8759.         network/subnet mask    contained in the body of the LSA.  Look
  8760.         up the routing table entries (potentially one per attached
  8761.         area) for the AS boundary router (ASBR) that originated the
  8762.         LSA. If no entries exist for router    ASBR (i.e., ASBR is
  8763.         unreachable), do nothing with this LSA and consider    the next
  8764.         in the list.
  8765.  
  8766.         Else, this LSA describes an    AS external path to destination
  8767.         N.    Examine    the forwarding address specified in the    AS-
  8768.         external-LSA.  This    indicates the IP address to which
  8769.         packets for    the destination    should be forwarded.
  8770.  
  8771.         If the forwarding address is set to    0.0.0.0, packets should
  8772.         be sent to the ASBR    itself.    Among the multiple routing table
  8773.         entries for    the ASBR, select the preferred entry as    follows.
  8774.         If RFC1583Compatibility is set to "disabled", prune    the set
  8775.         of routing table entries for the ASBR as described in
  8776.         Section 16.4.1. In any case, among the remaining routing
  8777.         table entries, select the routing table entry with the least
  8778.         cost; when there are multiple least    cost routing table
  8779.         entries the    entry whose associated area has    the largest OSPF
  8780.         Area ID (when considered as    an unsigned 32-bit integer) is
  8781.         chosen.
  8782.  
  8783.         If the forwarding address is non-zero, look    up the
  8784.         forwarding address in the routing table.[26] The matching
  8785.         routing table entry    must specify an    intra-area or inter-area
  8786.         path; if no    such path exists, do nothing with the LSA and
  8787.         consider the next in the list.
  8788.  
  8789.  
  8790.  
  8791.  
  8792. Moy                                  [Page 157]
  8793.  
  8794. Internet Draft             OSPF Version 2            January 1997
  8795.  
  8796.  
  8797.     (4) Let    X be the cost specified    by the preferred routing table
  8798.         entry for the ASBR/forwarding address, and Y the cost
  8799.         specified in the LSA.  X is    in terms of the    link state
  8800.         metric, and    Y is a type 1 or 2 external metric.
  8801.  
  8802.     (5) Look up the    routing    table entry for    the destination    N.  If
  8803.         no entry exists for    N, install the AS external path    to N,
  8804.         with next hop equal    to the list of next hops to the
  8805.         forwarding address,    and advertising    router equal to    ASBR.
  8806.         If the external metric type    is 1, then the path-type is set
  8807.         to type 1 external and the cost is equal to    X+Y.  If the
  8808.         external metric type is 2, the path-type is    set to type 2
  8809.         external, the link state component of the route's cost is X,
  8810.         and    the type 2 cost    is Y.
  8811.  
  8812.     (6) Compare the    AS external path described by the LSA with the
  8813.         existing paths in N's routing table    entry, as follows. If
  8814.         the    new path is preferred, it replaces the present paths in
  8815.         N's    routing    table entry.  If the new path is of equal
  8816.         preference,    it is added to N's routing table entry's list of
  8817.         paths.
  8818.  
  8819.         (a)    Intra-area and inter-area paths    are always preferred
  8820.         over AS    external paths.
  8821.  
  8822.         (b)    Type 1 external    paths are always preferred over    type 2
  8823.         external paths.    When all paths are type    2 external
  8824.         paths, the paths with the smallest advertised type 2
  8825.         metric are always preferred.
  8826.  
  8827.         (c)    If the new AS external path is still indistinguishable
  8828.         from the current paths in the N's routing table    entry,
  8829.         and RFC1583Compatibility is set    to "disabled", select
  8830.         the preferred paths based on the intra-AS paths    to the
  8831.         ASBR/forwarding    addresses, as specified    in Section
  8832.         16.4.1.
  8833.  
  8834.         (d)    If the new AS external path is still indistinguishable
  8835.         from the current paths in the N's routing table    entry,
  8836.         select the preferred path based    on a least cost
  8837.         comparison.  Type 1 external paths are compared    by
  8838.         looking    at the sum of the distance to the forwarding
  8839.         address    and the    advertised type    1 metric (X+Y).     Type 2
  8840.         external paths advertising equal type 2    metrics    are
  8841.         compared by looking at the distance to the forwarding
  8842.         addresses.
  8843.  
  8844.  
  8845.  
  8846.  
  8847.  
  8848. Moy                                  [Page 158]
  8849.  
  8850. Internet Draft             OSPF Version 2            January 1997
  8851.  
  8852.  
  8853.     16.4.1.     External path preferences
  8854.  
  8855.         When multiple intra-AS paths are available to
  8856.         ASBRs/forwarding addresses,    the following rules indicate
  8857.         which paths    are preferred. These rules apply when the same
  8858.         ASBR is reachable through multiple areas, or when trying to
  8859.         decide which of several AS-external-LSAs should be
  8860.         preferred. In the former case the paths all    terminate at the
  8861.         same ASBR, while in    the latter the paths terminate at
  8862.         separate ASBRs/forwarding addresses. In either case, each
  8863.         path is represented    by a separate routing table entry as
  8864.         defined in Section 11.
  8865.  
  8866.         This section only applies when RFC1583Compatibility    is set
  8867.         to "disabled".
  8868.  
  8869.         The    path preference    rules, stated from highest to lowest
  8870.         preference,    are as follows.    Note that as a result of these
  8871.         rules, there may still be multiple paths of    the highest
  8872.         preference.    In this    case, the path to use must be determined
  8873.         based on cost, as described    in Section 16.4.
  8874.  
  8875.         o    Intra-area paths using non-backbone areas are always the
  8876.         most preferred.
  8877.  
  8878.         o    Otherwise, intra-area backbone paths are preferred.
  8879.  
  8880.         o    Inter-area paths are the least preferred.
  8881.  
  8882.     16.5.  Incremental updates -- summary-LSAs
  8883.  
  8884.     When a new summary-LSA is received, it is not necessary    to
  8885.     recalculate the    entire routing table.  Call the    destination
  8886.     described by the summary-LSA N (N's address is obtained    by
  8887.     masking    the LSA's Link State ID    with the network/subnet    mask
  8888.     contained in the body of the LSA), and let Area    A be the area to
  8889.     which the LSA belongs. There are then two separate cases:
  8890.  
  8891.     Case 1:    Area A is the backbone and/or the router is not    an area
  8892.         border router.
  8893.         In this case, the following    calculations must be performed.
  8894.         First, if there is presently an inter-area route to    the
  8895.         destination    N, N's routing table entry is invalidated,
  8896.         saving the entry's values for later    comparisons. Then the
  8897.         calculation    in Section 16.2    is run again for the single
  8898.         destination    N. In this calculation,    all of Area A's
  8899.         summary-LSAs that describe a route to N are    examined.  In
  8900.         addition, if the router is an area border router attached to
  8901.  
  8902.  
  8903.  
  8904. Moy                                  [Page 159]
  8905.  
  8906. Internet Draft             OSPF Version 2            January 1997
  8907.  
  8908.  
  8909.         one    or more    transit    areas, the calculation in Section 16.3
  8910.         must be run    again for the single destination.  If the
  8911.         results of these calculations have changed the cost/path to
  8912.         an AS boundary router (as would be the case    for a Type 4
  8913.         summary-LSA) or to any forwarding addresses, all AS-
  8914.         external-LSAs will have to be reexamined by    rerunning the
  8915.         calculation    in Section 16.4.  Otherwise, if    N is now newly
  8916.         unreachable, the calculation in Section 16.4 must be rerun
  8917.         for    the single destination N, in case an alternate external
  8918.         route to N exists.
  8919.  
  8920.     Case 2:    Area A is a transit area and the router    is an area
  8921.         border router.
  8922.         In this case, the following    calculations must be performed.
  8923.         First, if N's routing table    entry presently    contains one or
  8924.         more inter-area paths that utilize the transit area    Area A,
  8925.         these paths    should be removed. If this removes all paths
  8926.         from the routing table entry, the entry should be
  8927.         invalidated.  The entry's old values should    be saved for
  8928.         later comparisons. Next the    calculation in Section 16.3 must
  8929.         be run again for the single    destination N. If the results of
  8930.         this calculation have caused the cost to N to increase, the
  8931.         complete routing table calculation must be rerun starting
  8932.         with the Dijkstra algorithm    specified in Section 16.1.
  8933.         Otherwise, if the cost/path    to an AS boundary router (as
  8934.         would be the case for a Type 4 summary-LSA)    or to any
  8935.         forwarding addresses has changed, all AS-external-LSAs will
  8936.         have to be reexamined by rerunning the calculation in
  8937.         Section 16.4.  Otherwise, if N is now newly    unreachable, the
  8938.         calculation    in Section 16.4    must be    rerun for the single
  8939.         destination    N, in case an alternate    external route to N
  8940.         exists.
  8941.  
  8942.     16.6.  Incremental updates -- AS-external-LSAs
  8943.  
  8944.     When a new AS-external-LSA is received,    it is not necessary to
  8945.     recalculate the    entire routing table.  Call the    destination
  8946.     described by the AS-external-LSA N.  N's address is obtained by
  8947.     masking    the LSA's Link State ID    with the network/subnet    mask
  8948.     contained in the body of the LSA. If there is already an intra-
  8949.     area or    inter-area route to the    destination, no    recalculation is
  8950.     necessary (internal routes take    precedence).
  8951.  
  8952.     Otherwise, the procedure in Section 16.4 will have to be
  8953.     performed, but only for    those AS-external-LSAs whose destination
  8954.     is N.  Before this procedure is    performed, the present routing
  8955.     table entry for    N should be invalidated.
  8956.  
  8957.  
  8958.  
  8959.  
  8960. Moy                                  [Page 160]
  8961.  
  8962. Internet Draft             OSPF Version 2            January 1997
  8963.  
  8964.  
  8965.     16.7.  Events generated as a result    of routing table changes
  8966.  
  8967.     Changes    to routing table entries sometimes cause the OSPF area
  8968.     border routers to take additional actions.  These routers need
  8969.     to act on the following    routing    table changes:
  8970.  
  8971.  
  8972.     o   The    cost or    path type of a routing table entry has changed.
  8973.         If the destination described by this entry is a Network or
  8974.         AS boundary    router,    and this is not    simply a change    of AS
  8975.         external routes, new summary-LSAs may have to be generated
  8976.         (potentially one for each attached area, including the
  8977.         backbone).    See Section 12.4.3 for more information.  If a
  8978.         previously advertised entry    has been deleted, or is    no
  8979.         longer advertisable    to a particular    area, the LSA must be
  8980.         flushed from the routing domain by setting its LS age to
  8981.         MaxAge and reflooding (see Section 14.1).
  8982.  
  8983.     o   A routing table entry associated with a configured virtual
  8984.         link has changed.  The destination of such a routing table
  8985.         entry is an    area border router.  The change    indicates a
  8986.         modification to the    virtual    link's cost or viability.
  8987.  
  8988.         If the entry indicates that    the area border    router is newly
  8989.         reachable (via TOS 0), the corresponding virtual link is now
  8990.         operational.  An InterfaceUp event should be generated for
  8991.         the    virtual    link, which will cause a virtual adjacency to
  8992.         begin to form (see Section 10.3).  At this time the    virtual
  8993.         link's IP interface    address    and the    virtual    neighbor's
  8994.         Neighbor IP    address    are also calculated.
  8995.  
  8996.         If the entry indicates that    the area border    router is no
  8997.         longer reachable (via TOS 0), the virtual link and its
  8998.         associated adjacency should    be destroyed.  This means an
  8999.         InterfaceDown event    should be generated for    the associated
  9000.         virtual link.
  9001.  
  9002.         If the cost    of the entry has changed, and there is a fully
  9003.         established    virtual    adjacency, a new router-LSA for    the
  9004.         backbone must be originated.  This in turn may cause further
  9005.         routing table changes.
  9006.  
  9007.  
  9008.     16.8.  Equal-cost multipath
  9009.  
  9010.     The OSPF protocol maintains multiple equal-cost    routes to all
  9011.     destinations.  This can    be seen    in the steps used above    to
  9012.     calculate the routing table, and in the    definition of the
  9013.  
  9014.  
  9015.  
  9016. Moy                                  [Page 161]
  9017.  
  9018. Internet Draft             OSPF Version 2            January 1997
  9019.  
  9020.  
  9021.     routing    table structure.
  9022.  
  9023.     Each one of the    multiple routes    will be    of the same type
  9024.     (intra-area, inter-area, type 1    external or type 2 external),
  9025.     cost, and will have the    same associated    area.  However,    each
  9026.     route specifies    a separate next    hop and    Advertising router.
  9027.  
  9028.     There is no requirement    that a router running OSPF keep    track of
  9029.     all possible equal-cost    routes to a destination.  An
  9030.     implementation may choose to keep only a fixed number of routes
  9031.     to any given destination.  This    does not affect    any of the
  9032.     algorithms presented in    this specification.
  9033.  
  9034.  
  9035.     16.9.  Building the    non-zero-TOS portion of    the routing table
  9036.  
  9037.     The OSPF protocol can calculate    a different set    of routes for
  9038.     each IP    TOS (see Section 2.5).    Support    for TOS-based routing is
  9039.     optional.  TOS-capable and non-TOS-capable routers can be mixed
  9040.     in an OSPF routing domain.  Routers not    supporting TOS calculate
  9041.     only the TOS 0 route to    each destination.  These routes    are then
  9042.     used to    forward    all data traffic, regardless of    the TOS
  9043.     indications in the data    packet's IP header.  A router that does
  9044.     not support TOS    indicates this fact to the other OSPF routers by
  9045.     clearing the T-bit in the Options field    of its router-LSA.
  9046.  
  9047.     The above sections detailing the routing table calculations
  9048.     handle the TOS 0 case only.  In    general, for routers supporting
  9049.     TOS-based routing, each    piece of the routing table calculation
  9050.     must be    rerun separately for the non-zero TOS values.  When
  9051.     calculating routes for TOS X, only TOS X metrics can be    used.
  9052.     Any LSA    may specify a separate cost for    each TOS (a cost for TOS
  9053.     0 must always be specified).  The encoding of TOS in OSPF LSAs
  9054.     is described in    Section    12.3.
  9055.  
  9056.     An LSA can specify that    it is restricted to TOS    0 (i.e., non-
  9057.     zero TOS is not    handled) by clearing the T-bit in the LSA's
  9058.     Option field.  Such LSAs are not used when calculating routes
  9059.     for non-zero TOS.  For this reason, it is possible that    a
  9060.     destination is unreachable for some non-zero TOS.  In this case,
  9061.     the TOS    0 path is used when forwarding packets (see Section
  9062.     11.1).
  9063.  
  9064.     The following lists the    modifications needed when running the
  9065.     routing    table calculation for a    non-zero TOS value (called TOS
  9066.     X).  In    general, routers and LSAs that do not support TOS are
  9067.     omitted    from the calculation.
  9068.  
  9069.  
  9070.  
  9071.  
  9072. Moy                                  [Page 162]
  9073.  
  9074. Internet Draft             OSPF Version 2            January 1997
  9075.  
  9076.  
  9077.     Calculating the    shortest-path tree (Section  16.1).
  9078.         Routers that do not    support    TOS-based routing should be
  9079.         omitted from the shortest-path tree    calculation.  These
  9080.         routers are    identified as those having the T-bit reset in
  9081.         the    Options    field of their router-LSAs.  Such routers should
  9082.         never be added to the Dijkstra algorithm's candidate list,
  9083.         nor    should their router-LSAs be examined when adding the
  9084.         stub networks to the tree.    In particular, if the T-bit is
  9085.         reset in the calculating router's own router-LSA, it does
  9086.         not    run the    shortest-path tree calculation for non-zero TOS
  9087.         values.
  9088.  
  9089.     Calculating the    inter-area routes (Section  16.2).
  9090.         Inter-area paths are the concatenation of a    path to    an area
  9091.         border router with a summary link.    When calculating TOS X
  9092.         routes, both path components must also specify TOS X.  In
  9093.         other words, only TOS X paths to the area border router are
  9094.         examined, and the area border router must be advertising a
  9095.         TOS    X route    to the destination.  Note that this means that
  9096.         summary-LSAs having    the T-bit reset    in their Options field
  9097.         are    not considered.
  9098.  
  9099.     Examining transit areas' summary-LSAs (Section 16.3).
  9100.         This calculation again considers the concatenation of a path
  9101.         to an area border router with a summary link.  As with
  9102.         inter-area routes, only TOS    X paths    to the area border
  9103.         router are examined, and the area border router must be
  9104.         advertising    a TOS X    route to the destination.
  9105.  
  9106.     Calculating AS external    routes (Section    16.4).
  9107.         This calculation considers the concatenation of a path to a
  9108.         forwarding address with an AS external link.  Only TOS X
  9109.         paths to the forwarding address are    examined, and the AS
  9110.         boundary router must be advertising    a TOS X    route to the
  9111.         destination.  Note that this means that AS-external-LSAs
  9112.         having the T-bit reset in their Options field are not
  9113.         considered.
  9114.  
  9115.         In addition, the advertising AS boundary router must also be
  9116.         reachable for its LSAs to be considered (see Section 16.4).
  9117.         However, if    the advertising    router and the forwarding
  9118.         address are    not one    in the same, the advertising router need
  9119.         only be reachable via TOS 0.
  9120.  
  9121.  
  9122.  
  9123.  
  9124.  
  9125.  
  9126.  
  9127.  
  9128. Moy                                  [Page 163]
  9129.  
  9130. Internet Draft             OSPF Version 2            January 1997
  9131.  
  9132.  
  9133. Footnotes
  9134.  
  9135.  
  9136.     [1]The graph's vertices represent either routers, transit networks,
  9137.     or stub networks.  Since routers may belong    to multiple areas, it is
  9138.     not    possible to color the graph's vertices.
  9139.  
  9140.     [2]It is possible for all of a router's interfaces to be unnumbered
  9141.     point-to-point links.  In this case, an IP address must be assigned
  9142.     to the router.  This address will then be advertised in the    router's
  9143.     router-LSA as a host route.
  9144.  
  9145.     [3]Note that in these cases    both interfaces, the non-virtual and the
  9146.     virtual, would have    the same IP address.
  9147.  
  9148.     [4]Note that no host route is generated for, and no    IP packets can
  9149.     be addressed to, interfaces    to unnumbered point-to-point networks.
  9150.     This is regardless of such an interface's state.
  9151.  
  9152.     [5]It is instructive to see    what happens when the Designated Router
  9153.     for    the network crashes.  Call the Designated Router for the network
  9154.     RT1, and the Backup    Designated Router RT2.    If Router RT1 crashes
  9155.     (or    maybe its interface to the network dies), the other routers on
  9156.     the    network    will detect RT1's absence within RouterDeadInterval
  9157.     seconds.  All routers may not detect this at precisely the same
  9158.     time; the routers that detect RT1's    absence    before RT2 does    will,
  9159.     for    a time,    select RT2 to be both Designated Router    and Backup
  9160.     Designated Router.    When RT2 detects that RT1 is gone it will move
  9161.     itself to Designated Router.  At this time,    the remaining router
  9162.     having highest Router Priority will    be selected as Backup Designated
  9163.     Router.
  9164.  
  9165.     [6]On point-to-point networks, the lower level protocols indicate
  9166.     whether the    neighbor is up and running.  Likewise, existence of the
  9167.     neighbor on    virtual    links is indicated by the routing table
  9168.     calculation.  However, in both these cases,    the Hello Protocol is
  9169.     still used.     This ensures that communication between the neighbors
  9170.     is bidirectional, and that each of the neighbors has a functioning
  9171.     routing protocol layer.
  9172.  
  9173.     [7]When the    identity of the    Designated Router is changing, it may be
  9174.     quite common for a neighbor    in this    state to send the router a
  9175.     Database Description packet; this means that there is some momentary
  9176.     disagreement on the    Designated Router's identity.
  9177.  
  9178.     [8]Note that it is possible    for a router to    resynchronize any of its
  9179.     fully established adjacencies by setting the adjacency's state back
  9180.     to ExStart.     This will cause the other end of the adjacency    to
  9181.  
  9182.  
  9183.  
  9184. Moy                                  [Page 164]
  9185.  
  9186. Internet Draft             OSPF Version 2            January 1997
  9187.  
  9188.  
  9189.     process a SeqNumberMismatch    event, and therefore to    also go    back to
  9190.     ExStart state.
  9191.  
  9192.     [9]The address space of IP networks    and the    address    space of OSPF
  9193.     Router IDs may overlap.  That is, a    network    may have an IP address
  9194.     which is identical (when considered    as a 32-bit number) to some
  9195.     router's Router ID.
  9196.  
  9197.     [10]"Discard" entries are necessary    to ensure that route
  9198.     summarization at area boundaries will not cause packet looping.
  9199.  
  9200.     [11]It is assumed that, for    two different address ranges matching
  9201.     the    destination, one range is more specific    than the other.    Non-
  9202.     contiguous subnet masks can    be configured to violate this
  9203.     assumption.    Such subnet mask configurations    cannot be handled by the
  9204.     OSPF protocol.
  9205.  
  9206.     [12]MaxAgeDiff is an architectural constant.  It indicates the
  9207.     maximum dispersion of ages,    in seconds, that can occur for a single
  9208.     LSA    instance as it is flooded throughout the routing domain.  If two
  9209.     LSAs differ    by more    than this, they    are assumed to be different
  9210.     instances of the same LSA.    This can occur when a router restarts
  9211.     and    loses track of the LSA's previous LS sequence number.  See
  9212.     Section 13.4 for more details.
  9213.  
  9214.     [13]When two LSAs have different LS    checksums, they    are assumed to
  9215.     be separate    instances.  This can occur when    a router restarts, and
  9216.     loses track    of the LSA's previous LS sequence number.  In the case
  9217.     where the two LSAs have the    same LS    sequence number, it is not
  9218.     possible to    determine which    LSA is actually    newer.    However, if the
  9219.     wrong LSA is accepted as newer, the    originating router will    simply
  9220.     originate another instance.     See Section 13.4 for further details.
  9221.  
  9222.     [14]There is one instance where a lookup must be done based    on
  9223.     partial information.  This is during the routing table calculation,
  9224.     when a network-LSA must be found based solely on its Link State ID.
  9225.     The    lookup in this case is still well defined, since no two
  9226.     network-LSAs can have the same Link    State ID.
  9227.  
  9228.     [15]This is    the way    RFC 1583 specified point-to-point
  9229.     representation.  It    has three advantages: a) it does not require
  9230.     allocating a subnet    to the point-to-point link, b) it tends    to bias
  9231.     the    routing    so that    packets    destined for the point-to-point
  9232.     interface will actually be received    over the interface (which is
  9233.     useful for diagnostic purposes) and    c) it allows network
  9234.     bootstrapping of a neighbor, without requiring that    the bootstrap
  9235.     program contain an OSPF implementation.
  9236.  
  9237.  
  9238.  
  9239.  
  9240. Moy                                  [Page 165]
  9241.  
  9242. Internet Draft             OSPF Version 2            January 1997
  9243.  
  9244.  
  9245.     [16]This is    the more traditional point-to-point representation used
  9246.     by protocols such as RIP.
  9247.  
  9248.     [17]This clause covers the case: Inter-area    routes are not
  9249.     summarized to the backbone.     This is because inter-area routes are
  9250.     always associated with the backbone    area.
  9251.  
  9252.     [18]This clause is only invoked when a non-backbone    Area A supports
  9253.     transit data traffic (i.e.,    has TransitCapability set to TRUE).  For
  9254.     example, in    the area configuration of Figure 6, Area 2 can support
  9255.     transit traffic due    to the configured virtual link between Routers
  9256.     RT10 and RT11. As a    result,    Router RT11 need only originate    a single
  9257.     summary-LSA    into Area 2 (having the    collapsed destination N9-
  9258.     N11,H1), since all of Router RT11's    other eligible routes have next
  9259.     hops belonging to Area 2 itself (and as such only need be advertised
  9260.     by other area border routers; in this case,    Routers    RT10 and RT7).
  9261.  
  9262.     [19]By keeping more    information in the routing table, it is    possible
  9263.     for    an implementation to recalculate the shortest path tree    for only
  9264.     a single area.  In fact, there are incremental algorithms that allow
  9265.     an implementation to recalculate only a portion of a single    area's
  9266.     shortest path tree [Ref1].    However, these algorithms are beyond the
  9267.     scope of this specification.
  9268.  
  9269.     [20]This is    how the    Link state request list    is emptied, which
  9270.     eventually causes the neighbor state to transition to Full.     See
  9271.     Section 10.9 for more details.
  9272.  
  9273.     [21]It should be a relatively rare occurrence for an LSA's LS age to
  9274.     reach MaxAge in this fashion.  Usually, the    LSA will be replaced by
  9275.     a more recent instance before it ages out.
  9276.  
  9277.     [22]Only the TOS 0 routes are important here because all OSPF
  9278.     protocol packets are sent with TOS = 0.  See Appendix A.
  9279.  
  9280.     [23]It may be the case that    paths to certain destinations do not
  9281.     vary based on TOS.    For these destinations,    the routing calculation
  9282.     need not be    repeated for each TOS value.  In addition, there need
  9283.     only be a single routing table entry for these destinations    (instead
  9284.     of a separate entry    for each TOS value).
  9285.  
  9286.     [24]Strictly speaking, because of equal-cost multipath, the
  9287.     algorithm does not create a    tree.  We continue to use the "tree"
  9288.     terminology    because    that is    what occurs most often in the existing
  9289.     literature.
  9290.  
  9291.     [25]Note that the presence of any link back    to V is    sufficient; it
  9292.     need not be    the matching half of the link under consideration from V
  9293.  
  9294.  
  9295.  
  9296. Moy                                  [Page 166]
  9297.  
  9298. Internet Draft             OSPF Version 2            January 1997
  9299.  
  9300.  
  9301.     to W. This is enough to ensure that, before    data traffic flows
  9302.     between a pair of neighboring routers, their link state databases
  9303.     will be synchronized.
  9304.  
  9305.     [26]When the forwarding address is non-zero, it should point to a
  9306.     router belonging to    another    Autonomous System.  See    Section    12.4.4
  9307.     for    more details.
  9308.  
  9309.  
  9310.  
  9311.  
  9312.  
  9313.  
  9314.  
  9315.  
  9316.  
  9317.  
  9318.  
  9319.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.  
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352. Moy                                  [Page 167]
  9353.  
  9354. Internet Draft             OSPF Version 2            January 1997
  9355.  
  9356.  
  9357. References
  9358.  
  9359.     [Ref1]  McQuillan, J., I. Richer and E. Rosen, "ARPANET Routing
  9360.         Algorithm Improvements", BBN Technical Report 3803,    April
  9361.         1978.
  9362.  
  9363.     [Ref2]  Digital Equipment Corporation, "Information    processing
  9364.         systems -- Data communications -- Intermediate System to
  9365.         Intermediate System    Intra-Domain Routing Protocol",    October
  9366.         1987.
  9367.  
  9368.     [Ref3]  McQuillan, J. et.al., "The New Routing Algorithm for the
  9369.         ARPANET", IEEE Transactions    on Communications, May 1980.
  9370.  
  9371.     [Ref4]  Perlman, R., "Fault-Tolerant Broadcast of Routing
  9372.         Information", Computer Networks, December 1983.
  9373.  
  9374.     [Ref5]  Postel, J.,    "Internet Protocol", STD 5, RFC    791,
  9375.         USC/Information Sciences Institute,    September 1981.
  9376.  
  9377.     [Ref6]  McKenzie, A., "ISO Transport Protocol specification    ISO DP
  9378.         8073", RFC 905, ISO, April 1984.
  9379.  
  9380.     [Ref7]  Deering, S., "Host extensions for IP multicasting",    STD 5,
  9381.         RFC    1112, Stanford University, May 1988.
  9382.  
  9383.     [Ref8]  McCloghrie,    K., and    M. Rose, "Management Information Base
  9384.         for    network    management of TCP/IP-based internets: MIB-II",
  9385.         STD    17, RFC    1213, Hughes LAN Systems, Performance Systems
  9386.         International, March 1991.
  9387.  
  9388.     [Ref9]  Moy, J., "OSPF Version 2", RFC 1583, Proteon, Inc.,    March
  9389.         1994.
  9390.  
  9391.     [Ref10] Fuller, V.,    T. Li, J. Yu, and K. Varadhan, "Classless
  9392.         Inter-Domain Routing (CIDR): an Address Assignment and
  9393.         Aggregation    Strategy", RFC1519, BARRNet, cisco, MERIT,
  9394.         OARnet, September 1993.
  9395.  
  9396.     [Ref11] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
  9397.         1700, USC/Information Sciences Institute, October 1994.
  9398.  
  9399.     [Ref12] Almquist, P., "Type    of Service in the Internet Protocol
  9400.         Suite", RFC    1349, July 1992.
  9401.  
  9402.     [Ref13] Leiner, B.,    et.al.,    "The DARPA Internet Protocol Suite", DDN
  9403.         Protocol Handbook, April 1985.
  9404.  
  9405.  
  9406.  
  9407.  
  9408. Moy                                  [Page 168]
  9409.  
  9410. Internet Draft             OSPF Version 2            January 1997
  9411.  
  9412.  
  9413.     [Ref14] Bradley, T., and C.    Brown, "Inverse    Address    Resolution
  9414.         Protocol", RFC 1293, January 1992.
  9415.  
  9416.     [Ref15] deSouza, O., and M.    Rodrigues, "Guidelines for Running OSPF
  9417.         Over Frame Relay Networks",    RFC 1586, March    1994.
  9418.  
  9419.     [Ref16] Bellovin, S., "Security Problems in    the TCP/IP Protocol
  9420.         Suite", ACM    Computer Communications    Review,    Volume 19,
  9421.         Number 2, pp. 32-38, April 1989.
  9422.  
  9423.     [Ref17] Rivest, R.,    "The MD5 Message-Digest    Algorithm", RFC    1321,
  9424.         April 1992.
  9425.  
  9426.     [Ref18] Moy, J., "Multicast    Extensions to OSPF", RFC 1584, Proteon,
  9427.         Inc., March    1994.
  9428.  
  9429.     [Ref19] Coltun, R. and V. Fuller, "The OSPF    NSSA Option", RFC 1587,
  9430.         RainbowBridge Communications, Stanford University, March
  9431.         1994.
  9432.  
  9433.     [Ref20] Ferguson, D., "The OSPF External Attributes    LSA", work in
  9434.         progress.
  9435.  
  9436.     [Ref21] Moy, J., "Extending    OSPF to    Support    Demand Circuits", RFC
  9437.         1793, Cascade, April 1995.
  9438.  
  9439.     [Ref22] Mogul, J. and S. Deering, "Path MTU    Discovery", RFC    1191,
  9440.         DECWRL, Stanford University, November 1990.
  9441.  
  9442.     [Ref23] Rekhter, Y.    and T. Li, "A Border Gateway Protocol 4    (BGP-
  9443.         4)", RFC 1771, T.J.    Watson Research    Center,    IBM Corp., cisco
  9444.         Systems, March 1995.
  9445.  
  9446.  
  9447.  
  9448.  
  9449.  
  9450.  
  9451.  
  9452.  
  9453.  
  9454.  
  9455.  
  9456.  
  9457.  
  9458.  
  9459.  
  9460.  
  9461.  
  9462.  
  9463.  
  9464. Moy                                  [Page 169]
  9465.  
  9466. Internet Draft             OSPF Version 2            January 1997
  9467.  
  9468.  
  9469. A. OSPF    data formats
  9470.  
  9471.     This appendix describes the    format of OSPF protocol    packets    and OSPF
  9472.     LSAs.  The OSPF protocol runs directly over    the IP network layer.
  9473.     Before any data formats are    described, the details of the OSPF
  9474.     encapsulation are explained.
  9475.  
  9476.     Next the OSPF Options field    is described.  This field describes
  9477.     various capabilities that may or may not be    supported by pieces of
  9478.     the    OSPF routing domain. The OSPF Options field is contained in OSPF
  9479.     Hello packets, Database Description    packets    and in OSPF LSAs.
  9480.  
  9481.     OSPF packet    formats    are detailed in    Section    A.3.  A    description of
  9482.     OSPF LSAs appears in Section A.4.
  9483.  
  9484. A.1 Encapsulation of OSPF packets
  9485.  
  9486.     OSPF runs directly over the    Internet Protocol's network layer.  OSPF
  9487.     packets are    therefore encapsulated solely by IP and    local data-link
  9488.     headers.
  9489.  
  9490.     OSPF does not define a way to fragment its protocol    packets, and
  9491.     depends on IP fragmentation    when transmitting packets larger than
  9492.     the    network    MTU. If    necessary, the length of OSPF packets can be up
  9493.     to 65,535 bytes (including the IP header).    The OSPF packet    types
  9494.     that are likely to be large    (Database Description Packets, Link
  9495.     State Request, Link    State Update, and Link State Acknowledgment
  9496.     packets) can usually be split into several separate    protocol
  9497.     packets, without loss of functionality.  This is recommended; IP
  9498.     fragmentation should be avoided whenever possible.    Using this
  9499.     reasoning, an attempt should be made to limit the sizes of OSPF
  9500.     packets sent over virtual links to 576 bytes unless    Path MTU
  9501.     Discovery is being performed (see [Ref22]).
  9502.  
  9503.     The    other important    features of OSPF's IP encapsulation are:
  9504.  
  9505.     o    Use of IP multicast.  Some OSPF    messages are multicast,    when
  9506.     sent over broadcast networks.  Two distinct IP multicast
  9507.     addresses are used.  Packets sent to these multicast addresses
  9508.     should never be    forwarded; they    are meant to travel a single hop
  9509.     only.  To ensure that these packets will not travel multiple
  9510.     hops, their IP TTL must    be set to 1.
  9511.  
  9512.     AllSPFRouters
  9513.         This multicast address has been assigned the value
  9514.         224.0.0.5.    All routers running OSPF should    be prepared to
  9515.         receive packets sent to this address.  Hello packets are
  9516.         always sent    to this    destination.  Also, certain OSPF
  9517.  
  9518.  
  9519.  
  9520. Moy                                  [Page 170]
  9521.  
  9522. Internet Draft             OSPF Version 2            January 1997
  9523.  
  9524.  
  9525.         protocol packets are sent to this address during the
  9526.         flooding procedure.
  9527.  
  9528.     AllDRouters
  9529.         This multicast address has been assigned the value
  9530.         224.0.0.6.    Both the Designated Router and Backup Designated
  9531.         Router must    be prepared to receive packets destined    to this
  9532.         address.  Certain OSPF protocol packets are    sent to    this
  9533.         address during the flooding    procedure.
  9534.  
  9535.     o    OSPF is    IP protocol number 89.    This number has    been registered
  9536.     with the Network Information Center.  IP protocol number
  9537.     assignments are    documented in [Ref11].
  9538.  
  9539.     o    Routing    protocol packets are sent with IP TOS of 0.  The OSPF
  9540.     protocol supports TOS-based routing.  Routes to    any particular
  9541.     destination may    vary based on TOS.  However, all OSPF routing
  9542.     protocol packets are sent using    the normal service TOS value of
  9543.     binary 0000 defined in [Ref12].
  9544.  
  9545.     o    Routing    protocol packets are sent with IP precedence set to
  9546.     Internetwork Control.  OSPF protocol packets should be given
  9547.     precedence over    regular    IP data    traffic, in both sending and
  9548.     receiving.  Setting the    IP precedence field in the IP header to
  9549.     Internetwork Control [Ref5] may    help implement this objective.
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.  
  9557.  
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576. Moy                                  [Page 171]
  9577.  
  9578. Internet Draft             OSPF Version 2            January 1997
  9579.  
  9580.  
  9581. A.2 The    Options    field
  9582.  
  9583.     The    OSPF Options field is present in OSPF Hello packets, Database
  9584.     Description    packets    and all    LSAs.  The Options field enables OSPF
  9585.     routers to support (or not support)    optional capabilities, and to
  9586.     communicate    their capability level to other    OSPF routers.  Through
  9587.     this mechanism routers of differing    capabilities can be mixed within
  9588.     an OSPF routing domain.
  9589.  
  9590.     When used in Hello packets,    the Options field allows a router to
  9591.     reject a neighbor because of a capability mismatch.     Alternatively,
  9592.     when capabilities are exchanged in Database    Description packets a
  9593.     router can choose not to forward certain LSAs to a neighbor    because
  9594.     of its reduced functionality.  Lastly, listing capabilities    in LSAs
  9595.     allows routers to forward traffic around reduced functionality
  9596.     routers, by    excluding them from parts of the routing table
  9597.     calculation.
  9598.  
  9599.     Six    bits of    the OSPF Options field have been assigned, although only
  9600.     two    (the T-bit and E-bit) are described completely by this memo.
  9601.     Each bit is    described briefly below. Routers should    reset (i.e.
  9602.     clear) unrecognized    bits in    the Options field when sending Hello
  9603.     packets or Database    Description packets and    when originating LSAs.
  9604.     Conversely,    routers    encountering unrecognized Option bits in
  9605.     received Hello Packets, Database Description packets or LSAs should
  9606.     ignore the capability and process the packet/LSA normally.
  9607.  
  9608.                +------------------------------------+
  9609.                | * | * | DC | EA | N/P | MC | E    | T |
  9610.                +------------------------------------+
  9611.  
  9612.                  The Options field
  9613.  
  9614.  
  9615.     T-bit
  9616.     This bit describes the router's    TOS-based routing capability, as
  9617.     specified in Sections 9.5, 10.8, 12.1.2    and 16.9 of this memo.
  9618.  
  9619.     E-bit
  9620.     This bit describes the way AS-external-LSAs are    flooded, as
  9621.     described in Sections 3.6, 9.5,    10.8 and 12.1.2    of this    memo.
  9622.  
  9623.     MC-bit
  9624.     This bit describes whether IP multicast    datagrams are forwarded
  9625.     according to the specifications    in [Ref18].
  9626.  
  9627.     N/P-bit
  9628.     This bit describes the handling    of Type-7 LSAs,    as specified in
  9629.  
  9630.  
  9631.  
  9632. Moy                                  [Page 172]
  9633.  
  9634. Internet Draft             OSPF Version 2            January 1997
  9635.  
  9636.  
  9637.     [Ref19].
  9638.  
  9639.     EA-bit
  9640.     This bit describes the router's    willingness to receive and
  9641.     forward    External-Attributes-LSAs, as specified in [Ref20].
  9642.  
  9643.     DC-bit
  9644.     This bit describes the router's    handling of demand circuits, as
  9645.     specified in [Ref21].
  9646.  
  9647.  
  9648.  
  9649.  
  9650.  
  9651.  
  9652.  
  9653.  
  9654.  
  9655.  
  9656.  
  9657.  
  9658.  
  9659.  
  9660.  
  9661.  
  9662.  
  9663.  
  9664.  
  9665.  
  9666.  
  9667.  
  9668.  
  9669.  
  9670.  
  9671.  
  9672.  
  9673.  
  9674.  
  9675.  
  9676.  
  9677.  
  9678.  
  9679.  
  9680.  
  9681.  
  9682.  
  9683.  
  9684.  
  9685.  
  9686.  
  9687.  
  9688. Moy                                  [Page 173]
  9689.  
  9690. Internet Draft             OSPF Version 2            January 1997
  9691.  
  9692.  
  9693. A.3 OSPF Packet    Formats
  9694.  
  9695.     There are five distinct OSPF packet    types.    All OSPF packet    types
  9696.     begin with a standard 24 byte header.  This    header is described
  9697.     first.  Each packet    type is    then described in a succeeding section.
  9698.     In these sections each packet's division into fields is displayed,
  9699.     and    then the field definitions are enumerated.
  9700.  
  9701.     All    OSPF packet types (other than the OSPF Hello packets) deal with
  9702.     lists of LSAs.  For    example, Link State Update packets implement the
  9703.     flooding of    LSAs throughout    the OSPF routing domain.  Because of
  9704.     this, OSPF protocol    packets    cannot be parsed unless    the format of
  9705.     LSAs is also understood.  The format of LSAs is described in Section
  9706.     A.4.
  9707.  
  9708.     The    receive    processing of OSPF packets is detailed in Section 8.2.
  9709.     The    sending    of OSPF    packets    is explained in    Section    8.1.
  9710.  
  9711.  
  9712.  
  9713.  
  9714.  
  9715.  
  9716.  
  9717.  
  9718.  
  9719.  
  9720.  
  9721.  
  9722.  
  9723.  
  9724.  
  9725.  
  9726.  
  9727.  
  9728.  
  9729.  
  9730.  
  9731.  
  9732.  
  9733.  
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744. Moy                                  [Page 174]
  9745.  
  9746. Internet Draft             OSPF Version 2            January 1997
  9747.  
  9748.  
  9749. A.3.1 The OSPF packet header
  9750.  
  9751.     Every OSPF packet starts with a standard 24    byte header.  This
  9752.     header contains all    the information    necessary to determine whether
  9753.     the    packet should be accepted for further processing.  This
  9754.     determination is described in Section 8.2 of the specification.
  9755.  
  9756.  
  9757.     0            1            2            3
  9758.     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
  9759.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9760.        |   Version #   |     Type      |     Packet    length           |
  9761.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9762.        |              Router ID                   |
  9763.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9764.        |               Area    ID                   |
  9765.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9766.        |       Checksum           |         AuType           |
  9767.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9768.        |               Authentication                   |
  9769.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9770.        |               Authentication                   |
  9771.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9772.  
  9773.  
  9774.  
  9775.     Version #
  9776.     The OSPF version number.  This specification documents version 2
  9777.     of the protocol.
  9778.  
  9779.     Type
  9780.     The OSPF packet    types are as follows. See Sections A.3.2 through
  9781.     A.3.6 for details.
  9782.  
  9783.  
  9784.  
  9785.               Type     Description
  9786.               ________________________________
  9787.               1     Hello
  9788.               2     Database Description
  9789.               3     Link State Request
  9790.               4     Link State Update
  9791.               5     Link State Acknowledgment
  9792.  
  9793.  
  9794.  
  9795.  
  9796.  
  9797.  
  9798.  
  9799.  
  9800. Moy                                  [Page 175]
  9801.  
  9802. Internet Draft             OSPF Version 2            January 1997
  9803.  
  9804.  
  9805.     Packet length
  9806.     The length of the OSPF protocol    packet in bytes.  This length
  9807.     includes the standard OSPF header.
  9808.  
  9809.     Router ID
  9810.     The Router ID of the packet's source.
  9811.  
  9812.     Area ID
  9813.     A 32 bit number    identifying the    area that this packet belongs
  9814.     to.  All OSPF packets are associated with a single area.  Most
  9815.     travel a single    hop only.  Packets travelling over a virtual
  9816.     link are labelled with the backbone Area ID of 0.0.0.0.
  9817.  
  9818.     Checksum
  9819.     The standard IP    checksum of the    entire contents    of the packet,
  9820.     starting with the OSPF packet header but excluding the 64-bit
  9821.     authentication field.  This checksum is    calculated as the 16-bit
  9822.     one's complement of the    one's complement sum of    all the    16-bit
  9823.     words in the packet, excepting the authentication field.  If the
  9824.     packet's length    is not an integral number of 16-bit words, the
  9825.     packet is padded with a    byte of    zero before checksumming.  The
  9826.     checksum is considered to be part of the packet    authentication
  9827.     procedure; for some authentication types the checksum
  9828.     calculation is omitted.
  9829.  
  9830.     AuType
  9831.     Identifies the authentication procedure    to be used for the
  9832.     packet.     Authentication    is discussed in    Appendix D of the
  9833.     specification.    Consult    Appendix D for a list of the currently
  9834.     defined    authentication types.
  9835.  
  9836.     Authentication
  9837.     A 64-bit field for use by the authentication scheme. See
  9838.     Appendix D for details.
  9839.  
  9840.  
  9841.  
  9842.  
  9843.  
  9844.  
  9845.  
  9846.  
  9847.  
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.  
  9855.  
  9856. Moy                                  [Page 176]
  9857.  
  9858. Internet Draft             OSPF Version 2            January 1997
  9859.  
  9860.  
  9861. A.3.2 The Hello    packet
  9862.  
  9863.     Hello packets are OSPF packet type 1.  These packets are sent
  9864.     periodically on all    interfaces (including virtual links) in    order to
  9865.     establish and maintain neighbor relationships.  In addition, Hello
  9866.     Packets are    multicast on those physical networks having a multicast
  9867.     or broadcast capability, enabling dynamic discovery    of neighboring
  9868.     routers.
  9869.  
  9870.     All    routers    connected to a common network must agree on certain
  9871.     parameters (Network    mask, HelloInterval and    RouterDeadInterval).
  9872.     These parameters are included in Hello packets, so that differences
  9873.     can    inhibit    the forming of neighbor    relationships.    A detailed
  9874.     explanation    of the receive processing for Hello packets is presented
  9875.     in Section 10.5.  The sending of Hello packets is covered in Section
  9876.     9.5.
  9877.  
  9878.  
  9879.     0            1            2            3
  9880.     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
  9881.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9882.        |   Version #   |       1       |     Packet    length           |
  9883.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9884.        |              Router ID                   |
  9885.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9886.        |               Area    ID                   |
  9887.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9888.        |       Checksum           |         AuType           |
  9889.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9890.        |               Authentication                   |
  9891.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9892.        |               Authentication                   |
  9893.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9894.        |            Network    Mask                   |
  9895.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9896.        |     HelloInterval           |    Options    |    Rtr    Pri    |
  9897.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9898.        |             RouterDeadInterval                   |
  9899.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9900.        |              Designated Router                   |
  9901.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9902.        |           Backup Designated Router               |
  9903.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9904.        |              Neighbor                   |
  9905.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9906.        |                  ...                   |
  9907.  
  9908.  
  9909.  
  9910.  
  9911.  
  9912. Moy                                  [Page 177]
  9913.  
  9914. Internet Draft             OSPF Version 2            January 1997
  9915.  
  9916.  
  9917.     Network mask
  9918.     The network mask associated with this interface.  For example,
  9919.     if the interface is to a class B network whose third byte is
  9920.     used for subnetting, the network mask is 0xffffff00.
  9921.  
  9922.     Options
  9923.     The optional capabilities supported by the router, as documented
  9924.     in Section A.2.
  9925.  
  9926.     HelloInterval
  9927.     The number of seconds between this router's Hello packets.
  9928.  
  9929.     Rtr    Pri
  9930.     This router's Router Priority.    Used in    (Backup) Designated
  9931.     Router election.  If set to 0, the router will be ineligible to
  9932.     become (Backup)    Designated Router.
  9933.  
  9934.     RouterDeadInterval
  9935.     The number of seconds before declaring a silent    router down.
  9936.  
  9937.     Designated Router
  9938.     The identity of    the Designated Router for this network,    in the
  9939.     view of    the sending router.  The Designated Router is identified
  9940.     here by    its IP interface address on the    network.  Set to 0.0.0.0
  9941.     if there is no Designated Router.
  9942.  
  9943.     Backup Designated Router
  9944.     The identity of    the Backup Designated Router for this network,
  9945.     in the view of the sending router.  The    Backup Designated Router
  9946.     is identified here by its IP interface address on the network.
  9947.     Set to 0.0.0.0 if there    is no Backup Designated    Router.
  9948.  
  9949.     Neighbor
  9950.     The Router IDs of each router from whom    valid Hello packets have
  9951.     been seen recently on the network.  Recently means in the last
  9952.     RouterDeadInterval seconds.
  9953.  
  9954.  
  9955.  
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.  
  9962.  
  9963.  
  9964.  
  9965.  
  9966.  
  9967.  
  9968. Moy                                  [Page 178]
  9969.  
  9970. Internet Draft             OSPF Version 2            January 1997
  9971.  
  9972.  
  9973. A.3.3 The Database Description packet
  9974.  
  9975.     Database Description packets are OSPF packet type 2.  These    packets
  9976.     are    exchanged when an adjacency is being initialized.  They    describe
  9977.     the    contents of the    link-state database.  Multiple packets may be
  9978.     used to describe the database.  For    this purpose a poll-response
  9979.     procedure is used.    One of the routers is designated to be the
  9980.     master, the    other the slave.  The master sends Database Description
  9981.     packets (polls) which are acknowledged by Database Description
  9982.     packets sent by the    slave (responses).  The    responses are linked to
  9983.     the    polls via the packets' DD sequence numbers.
  9984.  
  9985.  
  9986.     0            1            2            3
  9987.     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
  9988.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9989.        |   Version #   |       2       |     Packet    length           |
  9990.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9991.        |              Router ID                   |
  9992.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9993.        |               Area    ID                   |
  9994.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9995.        |       Checksum           |         AuType           |
  9996.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9997.        |               Authentication                   |
  9998.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9999.        |               Authentication                   |
  10000.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10001.        |     Interface MTU           |    Options    |0|0|0|0|0|I|M|MS
  10002.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10003.        |             DD    sequence number                   |
  10004.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10005.        |                                   |
  10006.        +-                                  -+
  10007.        |                                   |
  10008.        +-               An LSA Header                  -+
  10009.        |                                   |
  10010.        +-                                  -+
  10011.        |                                   |
  10012.        +-                                  -+
  10013.        |                                   |
  10014.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10015.        |                  ...                   |
  10016.  
  10017.  
  10018.     The    format of the Database Description packet is very similar to
  10019.     both the Link State    Request    and Link State Acknowledgment packets.
  10020.     The    main part of all three is a list of items, each    item describing
  10021.  
  10022.  
  10023.  
  10024. Moy                                  [Page 179]
  10025.  
  10026. Internet Draft             OSPF Version 2            January 1997
  10027.  
  10028.  
  10029.     a piece of the link-state database.     The sending of    Database
  10030.     Description    Packets    is documented in Section 10.8.    The reception of
  10031.     Database Description packets is documented in Section 10.6.
  10032.  
  10033.     Interface MTU
  10034.     The size in bytes of the largest IP datagram that can be sent
  10035.     out the    associated interface, without fragmentation.  The MTUs
  10036.     of common Internet link    types can be found in Table 7-1    of
  10037.     [Ref22]. Interface MTU should be set to    0 in Database
  10038.     Description packets sent over virtual links.
  10039.  
  10040.     Options
  10041.     The optional capabilities supported by the router, as documented
  10042.     in Section A.2.
  10043.  
  10044.     I-bit
  10045.     The Init bit.  When set    to 1, this packet is the first in the
  10046.     sequence of Database Description Packets.
  10047.  
  10048.     M-bit
  10049.     The More bit.  When set    to 1, it indicates that    more Database
  10050.     Description Packets are    to follow.
  10051.  
  10052.     MS-bit
  10053.     The Master/Slave bit.  When set    to 1, it indicates that    the
  10054.     router is the master during the    Database Exchange process.
  10055.     Otherwise, the router is the slave.
  10056.  
  10057.     DD sequence    number
  10058.     Used to    sequence the collection    of Database Description    Packets.
  10059.     The initial value (indicated by    the Init bit being set)    should
  10060.     be unique.  The    DD sequence number then    increments until the
  10061.     complete database description has been sent.
  10062.  
  10063.  
  10064.     The    rest of    the packet consists of a (possibly partial) list of the
  10065.     link-state database's pieces.  Each    LSA in the database is described
  10066.     by its LSA header.    The LSA    header is documented in    Section    A.4.1.
  10067.     It contains    all the    information required to    uniquely identify both
  10068.     the    LSA and    the LSA's current instance.
  10069.  
  10070.  
  10071.  
  10072.  
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.  
  10080. Moy                                  [Page 180]
  10081.  
  10082. Internet Draft             OSPF Version 2            January 1997
  10083.  
  10084.  
  10085. A.3.4 The Link State Request packet
  10086.  
  10087.     Link State Request packets are OSPF    packet type 3.    After exchanging
  10088.     Database Description packets with a    neighboring router, a router may
  10089.     find that parts of its link-state database are out-of-date.     The
  10090.     Link State Request packet is used to request the pieces of the
  10091.     neighbor's database    that are more up-to-date.  Multiple Link State
  10092.     Request packets may    need to    be used.
  10093.  
  10094.     A router that sends    a Link State Request packet has    in mind    the
  10095.     precise instance of    the database pieces it is requesting. Each
  10096.     instance is    defined    by its LS sequence number, LS checksum,    and LS
  10097.     age, although these    fields are not specified in the    Link State
  10098.     Request Packet itself.  The    router may receive even    more recent
  10099.     instances in response.
  10100.  
  10101.     The    sending    of Link    State Request packets is documented in Section
  10102.     10.9.  The reception of Link State Request packets is documented in
  10103.     Section 10.7.
  10104.  
  10105.  
  10106.     0            1            2            3
  10107.     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
  10108.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10109.        |   Version #   |       3       |     Packet    length           |
  10110.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10111.        |              Router ID                   |
  10112.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10113.        |               Area    ID                   |
  10114.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10115.        |       Checksum           |         AuType           |
  10116.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10117.        |               Authentication                   |
  10118.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10119.        |               Authentication                   |
  10120.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10121.        |              LS type                   |
  10122.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10123.        |               Link State ID                   |
  10124.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10125.        |             Advertising Router                   |
  10126.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10127.        |                  ...                   |
  10128.  
  10129.  
  10130.     Each LSA requested is specified by its LS type, Link State ID, and
  10131.     Advertising    Router.     This uniquely identifies the LSA, but not its
  10132.     instance.  Link State Request packets are understood to be requests
  10133.  
  10134.  
  10135.  
  10136. Moy                                  [Page 181]
  10137.  
  10138. Internet Draft             OSPF Version 2            January 1997
  10139.  
  10140.  
  10141.     for    the most recent    instance (whatever that    might be).
  10142.  
  10143.  
  10144.  
  10145.  
  10146.  
  10147.  
  10148.  
  10149.  
  10150.  
  10151.  
  10152.  
  10153.  
  10154.  
  10155.  
  10156.  
  10157.  
  10158.  
  10159.  
  10160.  
  10161.  
  10162.  
  10163.  
  10164.  
  10165.  
  10166.  
  10167.  
  10168.  
  10169.  
  10170.  
  10171.  
  10172.  
  10173.  
  10174.  
  10175.  
  10176.  
  10177.  
  10178.  
  10179.  
  10180.  
  10181.  
  10182.  
  10183.  
  10184.  
  10185.  
  10186.  
  10187.  
  10188.  
  10189.  
  10190.  
  10191.  
  10192. Moy                                  [Page 182]
  10193.  
  10194. Internet Draft             OSPF Version 2            January 1997
  10195.  
  10196.  
  10197. A.3.5 The Link State Update packet
  10198.  
  10199.     Link State Update packets are OSPF packet type 4.  These packets
  10200.     implement the flooding of LSAs.  Each Link State Update packet
  10201.     carries a collection of LSAs one hop further from their origin.
  10202.     Several LSAs may be    included in a single packet.
  10203.  
  10204.     Link State Update packets are multicast on those physical networks
  10205.     that support multicast/broadcast.  In order    to make    the flooding
  10206.     procedure reliable,    flooded    LSAs are acknowledged in Link State
  10207.     Acknowledgment packets.  If    retransmission of certain LSAs is
  10208.     necessary, the retransmitted LSAs are always carried by unicast Link
  10209.     State Update packets.  For more information    on the reliable    flooding
  10210.     of LSAs, consult Section 13.
  10211.  
  10212.  
  10213.     0            1            2            3
  10214.     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
  10215.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10216.        |   Version #   |       4       |     Packet    length           |
  10217.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10218.        |              Router ID                   |
  10219.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10220.        |               Area    ID                   |
  10221.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10222.        |       Checksum           |         AuType           |
  10223.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10224.        |               Authentication                   |
  10225.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10226.        |               Authentication                   |
  10227.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10228.        |                # LSAs                   |
  10229.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10230.        |                                   |
  10231.        +-                                 +-+
  10232.        |                 LSAs                   |
  10233.        +-                                 +-+
  10234.        |                  ...                   |
  10235.  
  10236.  
  10237.  
  10238.     # LSAs
  10239.     The number of LSAs included in this update.
  10240.  
  10241.  
  10242.     The    body of    the Link State Update packet consists of a list    of LSAs.
  10243.     Each LSA begins with a common 20 byte header, described in Section
  10244.     A.4.1. Detailed formats of the different types of LSAs are described
  10245.  
  10246.  
  10247.  
  10248. Moy                                  [Page 183]
  10249.  
  10250. Internet Draft             OSPF Version 2            January 1997
  10251.  
  10252.  
  10253.     in Section A.4.
  10254.  
  10255.  
  10256.  
  10257.  
  10258.  
  10259.  
  10260.  
  10261.  
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.  
  10272.  
  10273.  
  10274.  
  10275.  
  10276.  
  10277.  
  10278.  
  10279.  
  10280.  
  10281.  
  10282.  
  10283.  
  10284.  
  10285.  
  10286.  
  10287.  
  10288.  
  10289.  
  10290.  
  10291.  
  10292.  
  10293.  
  10294.  
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.  
  10304. Moy                                  [Page 184]
  10305.  
  10306. Internet Draft             OSPF Version 2            January 1997
  10307.  
  10308.  
  10309. A.3.6 The Link State Acknowledgment packet
  10310.  
  10311.     Link State Acknowledgment Packets are OSPF packet type 5.  To make
  10312.     the    flooding of LSAs reliable, flooded LSAs    are explicitly
  10313.     acknowledged.  This    acknowledgment is accomplished through the
  10314.     sending and    receiving of Link State    Acknowledgment packets.
  10315.     Multiple LSAs can be acknowledged in a single Link State
  10316.     Acknowledgment packet.
  10317.  
  10318.     Depending on the state of the sending interface and    the sender of
  10319.     the    corresponding Link State Update    packet,    a Link State
  10320.     Acknowledgment packet is sent either to the    multicast address
  10321.     AllSPFRouters, to the multicast address AllDRouters, or as a
  10322.     unicast.  The sending of Link State    Acknowledgement    packets    is
  10323.     documented in Section 13.5.     The reception of Link State
  10324.     Acknowledgement packets is documented in Section 13.7.
  10325.  
  10326.     The    format of this packet is similar to that of the    Data Description
  10327.     packet.  The body of both packets is simply    a list of LSA headers.
  10328.  
  10329.  
  10330.     0            1            2            3
  10331.     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
  10332.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10333.        |   Version #   |       5       |     Packet    length           |
  10334.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10335.        |              Router ID                   |
  10336.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10337.        |               Area    ID                   |
  10338.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10339.        |       Checksum           |         AuType           |
  10340.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10341.        |               Authentication                   |
  10342.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10343.        |               Authentication                   |
  10344.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10345.        |                                   |
  10346.        +-                                  -+
  10347.        |                                   |
  10348.        +-              An LSA Header                  -+
  10349.        |                                   |
  10350.        +-                                  -+
  10351.        |                                   |
  10352.        +-                                  -+
  10353.        |                                   |
  10354.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10355.        |                  ...                   |
  10356.  
  10357.  
  10358.  
  10359.  
  10360. Moy                                  [Page 185]
  10361.  
  10362. Internet Draft             OSPF Version 2            January 1997
  10363.  
  10364.  
  10365.     Each acknowledged LSA is described by its LSA header.  The LSA
  10366.     header is documented in Section A.4.1.  It contains    all the
  10367.     information    required to uniquely identify both the LSA and the LSA's
  10368.     current instance.
  10369.  
  10370.  
  10371.  
  10372.  
  10373.  
  10374.  
  10375.  
  10376.  
  10377.  
  10378.  
  10379.  
  10380.  
  10381.  
  10382.  
  10383.  
  10384.  
  10385.  
  10386.  
  10387.  
  10388.  
  10389.  
  10390.  
  10391.  
  10392.  
  10393.  
  10394.  
  10395.  
  10396.  
  10397.  
  10398.  
  10399.  
  10400.  
  10401.  
  10402.  
  10403.  
  10404.  
  10405.  
  10406.  
  10407.  
  10408.  
  10409.  
  10410.  
  10411.  
  10412.  
  10413.  
  10414.  
  10415.  
  10416. Moy                                  [Page 186]
  10417.  
  10418. Internet Draft             OSPF Version 2            January 1997
  10419.  
  10420.  
  10421. A.4 LSA    formats
  10422.  
  10423.     This memo defines five distinct types of LSAs.  Each LSA begins with
  10424.     a standard 20 byte LSA header.  This header    is explained in    Section
  10425.     A.4.1.  Succeeding sections    then diagram the separate LSA types.
  10426.  
  10427.     Each LSA describes a piece of the OSPF routing domain.  Every router
  10428.     originates a router-LSA.  In addition, whenever the    router is
  10429.     elected Designated Router, it originates a network-LSA.  Other types
  10430.     of LSAs may    also be    originated (see    Section    12.4).    All LSAs are
  10431.     then flooded throughout the    OSPF routing domain.  The flooding
  10432.     algorithm is reliable, ensuring that all routers have the same
  10433.     collection of LSAs.     (See Section 13 for more information concerning
  10434.     the    flooding algorithm).  This collection of LSAs is called    the
  10435.     link-state database.
  10436.  
  10437.     From the link state    database, each router constructs a shortest path
  10438.     tree with itself as    root.  This yields a routing table (see    Section
  10439.     11).  For the details of the routing table build process, see
  10440.     Section 16.
  10441.  
  10442.  
  10443.  
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.  
  10451.  
  10452.  
  10453.  
  10454.  
  10455.  
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.  
  10463.  
  10464.  
  10465.  
  10466.  
  10467.  
  10468.  
  10469.  
  10470.  
  10471.  
  10472. Moy                                  [Page 187]
  10473.  
  10474. Internet Draft             OSPF Version 2            January 1997
  10475.  
  10476.  
  10477. A.4.1 The LSA header
  10478.  
  10479.     All    LSAs begin with    a common 20 byte header.  This header contains
  10480.     enough information to uniquely identify the    LSA (LS    type, Link State
  10481.     ID,    and Advertising    Router).  Multiple instances of    the LSA    may
  10482.     exist in the routing domain    at the same time.  It is then necessary
  10483.     to determine which instance    is more    recent.     This is accomplished by
  10484.     examining the LS age, LS sequence number and LS checksum fields that
  10485.     are    also contained in the LSA header.
  10486.  
  10487.  
  10488.     0            1            2            3
  10489.     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
  10490.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10491.        |        LS age           |    Options    |    LS type    |
  10492.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10493.        |            Link State ID                   |
  10494.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10495.        |             Advertising Router                   |
  10496.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10497.        |             LS    sequence number                   |
  10498.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10499.        |     LS checksum           |         length           |
  10500.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10501.  
  10502.  
  10503.  
  10504.     LS age
  10505.     The time in seconds since the LSA was originated.
  10506.  
  10507.     Options
  10508.     The optional capabilities supported by the described portion of
  10509.     the routing domain.  OSPF's optional capabilities are documented
  10510.     in Section A.2.
  10511.  
  10512.     LS type
  10513.     The type of the    LSA.  Each LSA type has    a separate advertisement
  10514.     format.     The LSA types defined in this memo are    as follows (see
  10515.     Section    12.1.3 for further explanation):
  10516.  
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.  
  10526.  
  10527.  
  10528. Moy                                  [Page 188]
  10529.  
  10530. Internet Draft             OSPF Version 2            January 1997
  10531.  
  10532.  
  10533.  
  10534.             LS Type      Description
  10535.             ___________________________________
  10536.             1      Router-LSAs
  10537.             2      Network-LSAs
  10538.             3      Summary-LSAs (IP network)
  10539.             4      Summary-LSAs (ASBR)
  10540.             5      AS-external-LSAs
  10541.  
  10542.  
  10543.  
  10544.  
  10545.     Link State ID
  10546.     This field identifies the portion of the internet environment
  10547.     that is    being described    by the LSA.  The contents of this field
  10548.     depend on the LSA's LS type.  For example, in network-LSAs the
  10549.     Link State ID is set to    the IP interface address of the
  10550.     network's Designated Router (from which    the network's IP address
  10551.     can be derived).  The Link State ID is further discussed in
  10552.     Section    12.1.4.
  10553.  
  10554.     Advertising    Router
  10555.     The Router ID of the router that originated the    LSA.  For
  10556.     example, in network-LSAs this field is equal to    the Router ID of
  10557.     the network's Designated Router.
  10558.  
  10559.     LS sequence    number
  10560.     Detects    old or duplicate LSAs.    Successive instances of    an LSA
  10561.     are given successive LS    sequence numbers.  See Section 12.1.6
  10562.     for more details.
  10563.  
  10564.     LS checksum
  10565.     The Fletcher checksum of the complete contents of the LSA,
  10566.     including the LSA header but excluding the LS age field. See
  10567.     Section    12.1.7 for more    details.
  10568.  
  10569.     length
  10570.     The length in bytes of the LSA.     This includes the 20 byte LSA
  10571.     header.
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584. Moy                                  [Page 189]
  10585.  
  10586. Internet Draft             OSPF Version 2            January 1997
  10587.  
  10588.  
  10589. A.4.2 Router-LSAs
  10590.  
  10591.     Router-LSAs    are the    Type 1 LSAs.  Each router in an    area originates
  10592.     a router-LSA.  The LSA describes the state and cost    of the router's
  10593.     links (i.e., interfaces) to    the area.  All of the router's links to
  10594.     the    area must be described in a single router-LSA.    For details
  10595.     concerning the construction    of router-LSAs,    see Section 12.4.1.
  10596.  
  10597.  
  10598.     0            1            2            3
  10599.     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
  10600.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10601.        |        LS age           |     Options   |       1       |
  10602.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10603.        |            Link State ID                   |
  10604.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10605.        |             Advertising Router                   |
  10606.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10607.        |             LS    sequence number                   |
  10608.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10609.        |     LS checksum           |         length           |
  10610.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10611.        |    0     |V|E|B|    0      |        # links           |
  10612.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10613.        |              Link ID                   |
  10614.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10615.        |             Link Data                   |
  10616.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10617.        |     Type      |     # TOS     |    TOS 0 metric           |
  10618.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10619.        |      TOS      |    0      |        metric           |
  10620.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10621.        |                  ...                   |
  10622.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10623.        |      TOS      |    0      |        metric           |
  10624.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10625.        |              Link ID                   |
  10626.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10627.        |             Link Data                   |
  10628.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10629.        |                  ...                   |
  10630.  
  10631.  
  10632.     In router-LSAs, the    Link State ID field is set to the router's OSPF
  10633.     Router ID.    The T-bit is set in the    LSA's Option field if and only
  10634.     if the router is able to calculate a separate set of routes    for each
  10635.     IP TOS.  Router-LSAs are flooded throughout    a single area only.
  10636.  
  10637.  
  10638.  
  10639.  
  10640. Moy                                  [Page 190]
  10641.  
  10642. Internet Draft             OSPF Version 2            January 1997
  10643.  
  10644.  
  10645.     bit    V
  10646.     When set, the router is    an endpoint of one or more fully
  10647.     adjacent virtual links having the described area as Transit area
  10648.     (V is for virtual link endpoint).
  10649.  
  10650.     bit    E
  10651.     When set, the router is    an AS boundary router (E is for
  10652.     external).
  10653.  
  10654.     bit    B
  10655.     When set, the router is    an area    border router (B is for    border).
  10656.  
  10657.     # links
  10658.     The number of router links described in    this LSA.  This    must be
  10659.     the total collection of    router links (i.e., interfaces)    to the
  10660.     area.
  10661.  
  10662.  
  10663.     The    following fields are used to describe each router link (i.e.,
  10664.     interface).    Each router link is typed (see the below Type field).
  10665.     The    Type field indicates the kind of link being described.    It may
  10666.     be a link to a transit network, to another router or to a stub
  10667.     network.  The values of all    the other fields describing a router
  10668.     link depend    on the link's Type.  For example, each link has    an
  10669.     associated 32-bit Link Data    field.    For links to stub networks this
  10670.     field specifies the    network's IP address mask.  For    other link types
  10671.     the    Link Data field    specifies the router interface's IP address.
  10672.  
  10673.  
  10674.     Type
  10675.     A quick    description of the router link.     One of    the following.
  10676.     Note that host routes are classified as    links to stub networks
  10677.     with network mask of 0xffffffff.
  10678.  
  10679.  
  10680.  
  10681.          Type    Description
  10682.          __________________________________________________
  10683.          1    Point-to-point connection to another router
  10684.          2    Connection to a    transit    network
  10685.          3    Connection to a    stub network
  10686.          4    Virtual    link
  10687.  
  10688.  
  10689.  
  10690.  
  10691.     Link ID
  10692.     Identifies the object that this    router link connects to.  Value
  10693.  
  10694.  
  10695.  
  10696. Moy                                  [Page 191]
  10697.  
  10698. Internet Draft             OSPF Version 2            January 1997
  10699.  
  10700.  
  10701.     depends    on the link's Type.  When connecting to    an object that
  10702.     also originates    an LSA (i.e., another router or    a transit
  10703.     network) the Link ID is    equal to the neighboring LSA's Link
  10704.     State ID.  This    provides the key for looking up    the neighboring
  10705.     LSA in the link    state database during the routing table
  10706.     calculation. See Section 12.2 for more details.
  10707.  
  10708.  
  10709.  
  10710.                Type   Link ID
  10711.                ______________________________________
  10712.                1      Neighboring router's Router ID
  10713.                2      IP address of Designated Router
  10714.                3      IP network/subnet    number
  10715.                4      Neighboring router's Router ID
  10716.  
  10717.  
  10718.  
  10719.  
  10720.     Link Data
  10721.     Value again depends on the link's Type field. For connections to
  10722.     stub networks, Link Data specifies the network's IP address
  10723.     mask. For unnumbered point-to-point connections, it specifies
  10724.     the interface's    MIB-II [Ref8] ifIndex value. For the other link
  10725.     types it specifies the router interface's IP address. This
  10726.     latter piece of    information is needed during the routing table
  10727.     build process, when calculating    the IP address of the next hop.
  10728.     See Section 16.1.1 for more details.
  10729.  
  10730.     # TOS
  10731.     The number of different    TOS metrics given for this link, not
  10732.     counting the required metric for TOS 0.     For example, if no
  10733.     additional TOS metrics are given, this field is    set to 0.
  10734.  
  10735.     TOS    0 metric
  10736.     The cost of using this router link for TOS 0.
  10737.  
  10738.  
  10739.     For    each link, separate metrics may    be specified for each Type of
  10740.     Service (TOS).  The    metric for TOS 0 must always be    included, and
  10741.     was    discussed above.  Metrics for non-zero TOS are described below.
  10742.     The    encoding of TOS    in OSPF    LSAs is    described in Section 12.3.  Note
  10743.     that the cost for non-zero TOS values that are not specified
  10744.     defaults to    the TOS    0 cost.     Metrics must be listed    in order of
  10745.     increasing TOS encoding.  For example, the metric for TOS 16 must
  10746.     always follow the metric for TOS 8 when both are specified.
  10747.  
  10748.  
  10749.  
  10750.  
  10751.  
  10752. Moy                                  [Page 192]
  10753.  
  10754. Internet Draft             OSPF Version 2            January 1997
  10755.  
  10756.  
  10757.     TOS    IP Type    of Service that    this metric refers to.    The encoding of
  10758.     TOS in OSPF LSAs is described in Section 12.3.
  10759.  
  10760.     metric
  10761.     The cost of using this outbound    router link, for traffic of the
  10762.     specified TOS.
  10763.  
  10764.  
  10765.  
  10766.  
  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.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808. Moy                                  [Page 193]
  10809.  
  10810. Internet Draft             OSPF Version 2            January 1997
  10811.  
  10812.  
  10813. A.4.3 Network-LSAs
  10814.  
  10815.     Network-LSAs are the Type 2    LSAs.  A network-LSA is    originated for
  10816.     each broadcast and NBMA network in the area    which supports two or
  10817.     more routers.  The network-LSA is originated by the    network's
  10818.     Designated Router.    The LSA    describes all routers attached to the
  10819.     network, including the Designated Router itself.  The LSA's    Link
  10820.     State ID field lists the IP    interface address of the Designated
  10821.     Router.
  10822.  
  10823.     The    distance from the network to all attached routers is zero, for
  10824.     all    Types of Service.  This    is why the TOS and metric fields need
  10825.     not    be specified in    the network-LSA.  For details concerning the
  10826.     construction of network-LSAs, see Section 12.4.2.
  10827.  
  10828.  
  10829.     0            1            2            3
  10830.     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
  10831.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10832.        |        LS age           |      Options  |      2           |
  10833.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10834.        |            Link State ID                   |
  10835.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10836.        |             Advertising Router                   |
  10837.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10838.        |             LS    sequence number                   |
  10839.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10840.        |     LS checksum           |         length           |
  10841.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10842.        |             Network Mask                   |
  10843.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10844.        |            Attached Router                   |
  10845.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10846.        |                  ...                   |
  10847.  
  10848.  
  10849.  
  10850.     Network Mask
  10851.     The IP address mask for    the network.  For example, a class A
  10852.     network    would have the mask 0xff000000.
  10853.  
  10854.     Attached Router
  10855.     The Router IDs of each of the routers attached to the network.
  10856.     Actually, only those routers that are fully adjacent to    the
  10857.     Designated Router are listed.  The Designated Router includes
  10858.     itself in this list.  The number of routers included can be
  10859.     deduced    from the LSA header's length field.
  10860.  
  10861.  
  10862.  
  10863.  
  10864. Moy                                  [Page 194]
  10865.  
  10866. Internet Draft             OSPF Version 2            January 1997
  10867.  
  10868.  
  10869. A.4.4 Summary-LSAs
  10870.  
  10871.     Summary-LSAs are the Type 3    and 4 LSAs.  These LSAs    are originated
  10872.     by area border routers. Summary-LSAs describe inter-area
  10873.     destinations.  For details concerning the construction of summary-
  10874.     LSAs, see Section 12.4.3.
  10875.  
  10876.     Type 3 summary-LSAs    are used when the destination is an IP network.
  10877.     In this case the LSA's Link    State ID field is an IP    network    number
  10878.     (if    necessary, the Link State ID can also have one or more of the
  10879.     network's "host" bits set; see Appendix E for details). When the
  10880.     destination    is an AS boundary router, a Type 4 summary-LSA is used,
  10881.     and    the Link State ID field    is the AS boundary router's OSPF Router
  10882.     ID.     (To see why it    is necessary to    advertise the location of each
  10883.     ASBR, consult Section 16.4.)  Other    than the difference in the Link
  10884.     State ID field, the    format of Type 3 and 4 summary-LSAs is
  10885.     identical.
  10886.  
  10887.  
  10888.     0            1            2            3
  10889.     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
  10890.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10891.        |        LS age           |     Options   |    3 or 4     |
  10892.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10893.        |            Link State ID                   |
  10894.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10895.        |             Advertising Router                   |
  10896.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10897.        |             LS    sequence number                   |
  10898.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10899.        |     LS checksum           |         length           |
  10900.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10901.        |             Network Mask                   |
  10902.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10903.        |     TOS       |          metric               |
  10904.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10905.        |                  ...                   |
  10906.  
  10907.  
  10908.     For    stub areas, Type 3 summary-LSAs    can also be used to describe a
  10909.     (per-area) default route.  Default summary routes are used in stub
  10910.     areas instead of flooding a    complete set of    external routes.  When
  10911.     describing a default summary route,    the summary-LSA's Link State ID
  10912.     is always set to DefaultDestination    (0.0.0.0) and the Network Mask
  10913.     is set to 0.0.0.0.
  10914.  
  10915.     Separate costs may be advertised for each IP Type of Service.  The
  10916.     encoding of    TOS in OSPF LSAs is described in Section 12.3.    Note
  10917.  
  10918.  
  10919.  
  10920. Moy                                  [Page 195]
  10921.  
  10922. Internet Draft             OSPF Version 2            January 1997
  10923.  
  10924.  
  10925.     that the cost for TOS 0 must be included, and is always listed
  10926.     first.  If the T-bit is reset in the LSA's Option field, only a
  10927.     route for TOS 0 is described by the    LSA.  Otherwise, routes    for the
  10928.     other TOS values are also described; if a cost for a certain TOS is
  10929.     not    included, its cost defaults to that specified for TOS 0.
  10930.  
  10931.     Network Mask
  10932.     For Type 3 summary-LSAs, this indicates    the destination
  10933.     network's IP address mask.  For    example, when advertising the
  10934.     location of a class A network the value    0xff000000 would be
  10935.     used.  This field is not meaningful and    must be    zero for Type 4
  10936.     summary-LSAs.
  10937.  
  10938.  
  10939.     For    each specified Type of Service,    the following fields are
  10940.     defined.  The number of TOS    routes included    can be calculated from
  10941.     the    LSA header's length field.  A value for    TOS 0 must be specified;
  10942.     it is listed first.     Other values must be listed in    order of
  10943.     increasing TOS encoding.  For example, the cost for    TOS 16 must
  10944.     always follow the cost for TOS 8 when both are specified.
  10945.  
  10946.  
  10947.     TOS    The Type of Service that the following cost concerns.  The
  10948.     encoding of TOS    in OSPF    LSAs is    described in Section 12.3.
  10949.  
  10950.     metric
  10951.     The cost of this route.     Expressed in the same units as    the
  10952.     interface costs    in the router-LSAs.
  10953.  
  10954.  
  10955.  
  10956.  
  10957.  
  10958.  
  10959.  
  10960.  
  10961.  
  10962.  
  10963.  
  10964.  
  10965.  
  10966.  
  10967.  
  10968.  
  10969.  
  10970.  
  10971.  
  10972.  
  10973.  
  10974.  
  10975.  
  10976. Moy                                  [Page 196]
  10977.  
  10978. Internet Draft             OSPF Version 2            January 1997
  10979.  
  10980.  
  10981. A.4.5 AS-external-LSAs
  10982.  
  10983.     AS-external-LSAs are the Type 5 LSAs.  These LSAs are originated by
  10984.     AS boundary    routers, and describe destinations external to the AS.
  10985.     For    details    concerning the construction of AS-external-LSAs, see
  10986.     Section 12.4.3.
  10987.  
  10988.     AS-external-LSAs usually describe a    particular external destination.
  10989.     For    these LSAs the Link State ID field specifies an    IP network
  10990.     number (if necessary, the Link State ID can    also have one or more of
  10991.     the    network's "host" bits set; see Appendix    E for details).     AS-
  10992.     external-LSAs are also used    to describe a default route.  Default
  10993.     routes are used when no specific route exists to the destination.
  10994.     When describing a default route, the Link State ID is always set to
  10995.     DefaultDestination (0.0.0.0) and the Network Mask is set to    0.0.0.0.
  10996.  
  10997.  
  10998.     0            1            2            3
  10999.     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
  11000.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11001.        |        LS age           |     Options   |      5           |
  11002.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11003.        |            Link State ID                   |
  11004.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11005.        |             Advertising Router                   |
  11006.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11007.        |             LS    sequence number                   |
  11008.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11009.        |     LS checksum           |         length           |
  11010.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11011.        |             Network Mask                   |
  11012.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11013.        |E|    TOS      |          metric               |
  11014.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11015.        |              Forwarding address               |
  11016.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11017.        |              External Route Tag               |
  11018.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11019.        |                  ...                   |
  11020.  
  11021.  
  11022.  
  11023.     Separate costs may be advertised for each IP Type of Service.  The
  11024.     encoding of    TOS in OSPF LSAs is described in Section 12.3.    Note
  11025.     that the cost for TOS 0 must be included, and is always listed
  11026.     first.  If the T-bit is reset in the LSA's Option field, only a
  11027.     route for TOS 0 is described by the    LSA.  Otherwise, routes    for the
  11028.     other TOS values are also described; if a cost for a certain TOS is
  11029.  
  11030.  
  11031.  
  11032. Moy                                  [Page 197]
  11033.  
  11034. Internet Draft             OSPF Version 2            January 1997
  11035.  
  11036.  
  11037.     not    included, its cost defaults to that specified for TOS 0.
  11038.  
  11039.     Network Mask
  11040.     The IP address mask for    the advertised destination.  For
  11041.     example, when advertising a class A network the    mask 0xff000000
  11042.     would be used.
  11043.  
  11044.  
  11045.     For    each specified Type of Service,    the following fields are
  11046.     defined.  The number of TOS    routes included    can be calculated from
  11047.     the    LSA header's length field.  A value for    TOS 0 must be specified;
  11048.     it is listed first.     Other values must be listed in    order of
  11049.     increasing TOS encoding.  For example, the cost for    TOS 16 must
  11050.     always follow the cost for TOS 8 when both are specified.
  11051.  
  11052.  
  11053.     TOS    The Type of Service that the following fields concern.    The
  11054.     encoding of TOS    in OSPF    LSAs is    described in Section 12.3.
  11055.  
  11056.     bit    E
  11057.     The type of external metric.  If bit E is set, the metric
  11058.     specified is a Type 2 external metric.    This means the metric is
  11059.     considered larger than any link    state path.  If    bit E is zero,
  11060.     the specified metric is    a Type 1 external metric.  This    means
  11061.     that it    is expressed in    the same units as the link state metric
  11062.     (i.e., the same    units as interface cost).
  11063.  
  11064.     metric
  11065.     The cost of this route.     Interpretation    depends    on the external
  11066.     type indication    (bit E above).
  11067.  
  11068.     Forwarding address
  11069.     Data traffic for the advertised    destination and    TOS will be
  11070.     forwarded to this address.  If the Forwarding address is set to
  11071.     0.0.0.0, data traffic will be forwarded    instead    to the LSA's
  11072.     originator (i.e., the responsible AS boundary router).
  11073.  
  11074.     External Route Tag
  11075.     A 32-bit field attached    to each    external route.     This is not
  11076.     used by    the OSPF protocol itself.  It may be used to communicate
  11077.     information between AS boundary    routers; the precise nature of
  11078.     such information is outside the    scope of this specification.
  11079.  
  11080.  
  11081.  
  11082.  
  11083.  
  11084.  
  11085.  
  11086.  
  11087.  
  11088. Moy                                  [Page 198]
  11089.  
  11090. Internet Draft             OSPF Version 2            January 1997
  11091.  
  11092.  
  11093. B. Architectural Constants
  11094.  
  11095.     Several OSPF protocol parameters have fixed    architectural values.
  11096.     These parameters have been referred    to in the text by names    such as
  11097.     LSRefreshTime.  The    same naming convention is used for the
  11098.     configurable protocol parameters.  They are    defined    in Appendix C.
  11099.  
  11100.     The    name of    each architectural constant follows, together with its
  11101.     value and a    short description of its function.
  11102.  
  11103.  
  11104.     LSRefreshTime
  11105.     The maximum time between distinct originations of any particular
  11106.     LSA.  If the LS    age field of one of the    router's self-originated
  11107.     LSAs reaches the value LSRefreshTime, a    new instance of    the LSA
  11108.     is originated, even though the contents    of the LSA (apart from
  11109.     the LSA    header)    will be    the same.  The value of    LSRefreshTime is
  11110.     set to 30 minutes.
  11111.  
  11112.     MinLSInterval
  11113.     The minimum time between distinct originations of any particular
  11114.     LSA.  The value    of MinLSInterval is set    to 5 seconds.
  11115.  
  11116.     MinLSArrival
  11117.     For any    particular LSA,    the minimum time that must elapse
  11118.     between    reception of new LSA instances during flooding.    LSA
  11119.     instances received at higher frequencies are discarded.    The
  11120.     value of MinLSArrival is set to    1 second.
  11121.  
  11122.     MaxAge
  11123.     The maximum age    that an    LSA can    attain.    When an    LSA's LS age
  11124.     field reaches MaxAge, it is reflooded in an attempt to flush the
  11125.     LSA from the routing domain (See Section 14). LSAs of age MaxAge
  11126.     are not    used in    the routing table calculation.    The value of
  11127.     MaxAge is set to 1 hour.
  11128.  
  11129.     CheckAge
  11130.     When the age of    an LSA in the link state database hits a
  11131.     multiple of CheckAge, the LSA's    checksum is verified.  An
  11132.     incorrect checksum at this time    indicates a serious error.  The
  11133.     value of CheckAge is set to 5 minutes.
  11134.  
  11135.     MaxAgeDiff
  11136.     The maximum time dispersion that can occur, as an LSA is flooded
  11137.     throughout the AS.  Most of this time is accounted for by the
  11138.     LSAs sitting on    router output queues (and therefore not    aging)
  11139.     during the flooding process.  The value    of MaxAgeDiff is set to
  11140.     15 minutes.
  11141.  
  11142.  
  11143.  
  11144. Moy                                  [Page 199]
  11145.  
  11146. Internet Draft             OSPF Version 2            January 1997
  11147.  
  11148.  
  11149.     LSInfinity
  11150.     The metric value indicating that the destination described by an
  11151.     LSA is unreachable. Used in summary-LSAs and AS-external-LSAs as
  11152.     an alternative to premature aging (see Section 14.1). It is
  11153.     defined    to be the 24-bit binary    value of all ones: 0xffffff.
  11154.  
  11155.     DefaultDestination
  11156.     The Destination    ID that    indicates the default route.  This route
  11157.     is used    when no    other matching routing table entry can be found.
  11158.     The default destination    can only be advertised in AS-external-
  11159.     LSAs and in stub areas'    type 3 summary-LSAs.  Its value    is the
  11160.     IP address 0.0.0.0. Its    associated Network Mask    is also    always
  11161.     0.0.0.0.
  11162.  
  11163.     InitialSequenceNumber
  11164.     The value used for LS Sequence Number when originating the first
  11165.     instance of any    LSA. Its value is the signed 32-bit integer
  11166.     0x80000001.
  11167.  
  11168.     MaxSequenceNumber
  11169.     The maximum value that LS Sequence Number can attain.  Its value
  11170.     is the signed 32-bit integer 0x7fffffff.
  11171.  
  11172.  
  11173.  
  11174.  
  11175.  
  11176.  
  11177.  
  11178.  
  11179.  
  11180.  
  11181.  
  11182.  
  11183.  
  11184.  
  11185.  
  11186.  
  11187.  
  11188.  
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.  
  11197.  
  11198.  
  11199.  
  11200. Moy                                  [Page 200]
  11201.  
  11202. Internet Draft             OSPF Version 2            January 1997
  11203.  
  11204.  
  11205. C. Configurable    Constants
  11206.  
  11207.     The    OSPF protocol has quite    a few configurable parameters.    These
  11208.     parameters are listed below.  They are grouped into    general
  11209.     functional categories (area    parameters, interface parameters, etc.).
  11210.     Sample values are given for    some of    the parameters.
  11211.  
  11212.     Some parameter settings need to be consistent among    groups of
  11213.     routers.  For example, all routers in an area must agree on    that
  11214.     area's parameters, and all routers attached    to a network must agree
  11215.     on that network's IP network number    and mask.
  11216.  
  11217.     Some parameters may    be determined by router    algorithms outside of
  11218.     this specification (e.g., the address of a host connected to the
  11219.     router via a SLIP line).  From OSPF's point    of view, these items are
  11220.     still configurable.
  11221.  
  11222.     C.1    Global parameters
  11223.  
  11224.     In general, a separate copy of the OSPF    protocol is run    for each
  11225.     area.  Because of this,    most configuration parameters are
  11226.     defined    on a per-area basis.  The few global configuration
  11227.     parameters are listed below.
  11228.  
  11229.  
  11230.     Router ID
  11231.         This is a 32-bit number that uniquely identifies the router
  11232.         in the Autonomous System.  One algorithm for Router    ID
  11233.         assignment is to choose the    largest    or smallest IP address
  11234.         assigned to    the router.  If    a router's OSPF    Router ID is
  11235.         changed, the router's OSPF software    should be restarted
  11236.         before the new Router ID takes effect. Before restarting in
  11237.         order to change its    Router ID, the router should flush its
  11238.         self-originated LSAs from the routing domain (see Section
  11239.         14.1), or they will    persist    for up to MaxAge minutes.
  11240.  
  11241.     TOS capability
  11242.         This item indicates    whether    the router will    calculate
  11243.         separate routes based on TOS.  For more information, see
  11244.         Sections 4.5 and 16.9.
  11245.  
  11246.     RFC1583Compatibility
  11247.         Controls the preference rules used in Section 16.4 when
  11248.         choosing among multiple AS-external-LSAs advertising the
  11249.         same destination. When set to "enabled", the preference
  11250.         rules remain those specified by RFC    1583 ([Ref9]). When set
  11251.         to "disabled", the preference rules    are those stated in
  11252.         Section 16.4.1, which prevent routing loops    when AS-
  11253.  
  11254.  
  11255.  
  11256. Moy                                  [Page 201]
  11257.  
  11258. Internet Draft             OSPF Version 2            January 1997
  11259.  
  11260.  
  11261.         external-LSAs for the same destination have    been originated
  11262.         from different areas (see Section G.7). Set    to "enabled" by
  11263.         default.
  11264.  
  11265.         In order to    minimize the chance of routing loops, all OSPF
  11266.         routers in an OSPF routing domain should have
  11267.         RFC1583Compatibility set identically. When there are routers
  11268.         present that have not been updated with the    functionality
  11269.         specified in Section 16.4.1    of this    memo, all routers should
  11270.         have RFC1583Compatibility set to "enabled".    Otherwise, all
  11271.         routers should have    RFC1583Compatibility set to "disabled",
  11272.         preventing all routing loops.
  11273.  
  11274.     C.2    Area parameters
  11275.  
  11276.     All routers belonging to an area must agree on that area's
  11277.     configuration.    Disagreements between two routers will lead to
  11278.     an inability for adjacencies to    form between them, with    a
  11279.     resulting hindrance to the flow    of routing protocol and    data
  11280.     traffic.  The following    items must be configured for an    area:
  11281.  
  11282.  
  11283.     Area ID
  11284.         This is a 32-bit number that identifies the    area.  The Area
  11285.         ID of 0.0.0.0 is reserved for the backbone.     If the    area
  11286.         represents a subnetted network, the    IP network number of the
  11287.         subnetted network may be used for the Area ID.
  11288.  
  11289.     List of    address    ranges
  11290.         An OSPF area is defined as a list of address ranges. Each
  11291.         address range consists of the following items:
  11292.  
  11293.         [IP    address, mask]
  11294.             Describes the collection of    IP addresses contained
  11295.             in the address range. Networks and hosts are
  11296.             assigned to    an area    depending on whether their
  11297.             addresses fall into    one of the area's defining
  11298.             address ranges.  Routers are viewed    as belonging to
  11299.             multiple areas, depending on their attached
  11300.             networks' area membership.
  11301.  
  11302.         Status  Set    to either Advertise or DoNotAdvertise.    Routing
  11303.             information    is condensed at    area boundaries.
  11304.             External to    the area, at most a single route is
  11305.             advertised (via a summary-LSA) for each address
  11306.             range. The route is    advertised if and only if the
  11307.             address range's Status is set to Advertise.
  11308.             Unadvertised ranges    allow the existence of certain
  11309.  
  11310.  
  11311.  
  11312. Moy                                  [Page 202]
  11313.  
  11314. Internet Draft             OSPF Version 2            January 1997
  11315.  
  11316.  
  11317.             networks to    be intentionally hidden    from other
  11318.             areas. Status is set to Advertise by default.
  11319.  
  11320.         As an example, suppose an IP subnetted network is to be its
  11321.         own    OSPF area.  The    area would be configured as a single
  11322.         address range, whose IP address is the address of the
  11323.         subnetted network, and whose mask is the natural class A, B,
  11324.         or C address mask.    A single route would be    advertised
  11325.         external to    the area, describing the entire    subnetted
  11326.         network.
  11327.  
  11328.     ExternalRoutingCapability
  11329.         Whether AS-external-LSAs will be flooded into/throughout the
  11330.         area.  If AS-external-LSAs are excluded from the area, the
  11331.         area is called a "stub".  Internal to stub areas, routing to
  11332.         external destinations will be based    solely on a default
  11333.         summary route.  The    backbone cannot    be configured as a stub
  11334.         area.  Also, virtual links cannot be configured through stub
  11335.         areas.  For    more information, see Section 3.6.
  11336.  
  11337.     StubDefaultCost
  11338.         If the area    has been configured as a stub area, and    the
  11339.         router itself is an    area border router, then the
  11340.         StubDefaultCost indicates the cost of the default summary-
  11341.         LSA    that the router    should advertise into the area.     There
  11342.         can    be a separate cost configured for each IP TOS.    See
  11343.         Section 12.4.3 for more information.
  11344.  
  11345.     C.3    Router interface parameters
  11346.  
  11347.     Some of    the configurable router    interface parameters (such as IP
  11348.     interface address and subnet mask) actually imply properties of
  11349.     the attached networks, and therefore must be consistent    across
  11350.     all the    routers    attached to that network.  The parameters that
  11351.     must be    configured for a router    interface are:
  11352.  
  11353.  
  11354.     IP interface address
  11355.         The    IP protocol address for    this interface.     This uniquely
  11356.         identifies the router over the entire internet.  An    IP
  11357.         address is not required on point-to-point networks.     Such a
  11358.         point-to-point network is called "unnumbered".
  11359.  
  11360.     IP interface mask
  11361.         Also referred to as    the subnet/network mask, this indicates
  11362.         the    portion    of the IP interface address that identifies the
  11363.         attached network.  Masking the IP interface    address    with the
  11364.         IP interface mask yields the IP network number of the
  11365.  
  11366.  
  11367.  
  11368. Moy                                  [Page 203]
  11369.  
  11370. Internet Draft             OSPF Version 2            January 1997
  11371.  
  11372.  
  11373.         attached network.  On point-to-point networks and virtual
  11374.         links, the IP interface mask is not    defined. On these
  11375.         networks, the link itself is not assigned an IP network
  11376.         number, and    so the addresses of each side of the link are
  11377.         assigned independently, if they are    assigned at all.
  11378.  
  11379.     Area ID
  11380.         The    OSPF area to which the attached    network    belongs.
  11381.  
  11382.     Interface output cost(s)
  11383.         The    cost of    sending    a packet on the    interface, expressed in
  11384.         the    link state metric.  This is advertised as the link cost
  11385.         for    this interface in the router's router-LSA.  There may be
  11386.         a separate cost for    each IP    Type of    Service.  The interface
  11387.         output cost(s) must    always be greater than 0.
  11388.  
  11389.     RxmtInterval
  11390.         The    number of seconds between LSA retransmissions, for
  11391.         adjacencies    belonging to this interface.  Also used    when
  11392.         retransmitting Database Description    and Link State Request
  11393.         Packets.  This should be well over the expected round-trip
  11394.         delay between any two routers on the attached network.  The
  11395.         setting of this value should be conservative or needless
  11396.         retransmissions will result.  Sample value for a local area
  11397.         network: 5 seconds.
  11398.  
  11399.     InfTransDelay
  11400.         The    estimated number of seconds it takes to    transmit a Link
  11401.         State Update Packet    over this interface.  LSAs contained in
  11402.         the    update packet must have    their age incremented by this
  11403.         amount before transmission.     This value should take    into
  11404.         account the    transmission and propagation delays of the
  11405.         interface.    It must    be greater than    0.  Sample value for a
  11406.         local area network:    1 second.
  11407.  
  11408.     Router Priority
  11409.         An 8-bit unsigned integer.    When two routers attached to a
  11410.         network both attempt to become Designated Router, the one
  11411.         with the highest Router Priority takes precedence.    If there
  11412.         is still a tie, the    router with the    highest    Router ID takes
  11413.         precedence.     A router whose    Router Priority    is set to 0 is
  11414.         ineligible to become Designated Router on the attached
  11415.         network.  Router Priority is only configured for interfaces
  11416.         to broadcast and NBMA networks.
  11417.  
  11418.     HelloInterval
  11419.         The    length of time,    in seconds, between the    Hello Packets
  11420.         that the router sends on the interface.  This value    is
  11421.  
  11422.  
  11423.  
  11424. Moy                                  [Page 204]
  11425.  
  11426. Internet Draft             OSPF Version 2            January 1997
  11427.  
  11428.  
  11429.         advertised in the router's Hello Packets.  It must be the
  11430.         same for all routers attached to a common network.    The
  11431.         smaller the    HelloInterval, the faster topological changes
  11432.         will be detected; however, more OSPF routing protocol
  11433.         traffic will ensue.     Sample    value for a X.25 PDN network: 30
  11434.         seconds.  Sample value for a local area network: 10    seconds.
  11435.  
  11436.     RouterDeadInterval
  11437.         After ceasing to hear a router's Hello Packets, the    number
  11438.         of seconds before its neighbors declare the    router down.
  11439.         This is also advertised in the router's Hello Packets in
  11440.         their RouterDeadInterval field.  This should be some
  11441.         multiple of    the HelloInterval (say 4).  This value again
  11442.         must be the    same for all routers attached to a common
  11443.         network.
  11444.  
  11445.     AuType
  11446.         Identifies the authentication procedure to be used on the
  11447.         attached network.  This value must be the same for all
  11448.         routers attached to    the network.  See Appendix D for a
  11449.         discussion of the defined authentication types.
  11450.  
  11451.     Authentication key
  11452.         This configured data allows    the authentication procedure to
  11453.         verify OSPF    protocol packets received over the interface.
  11454.         For    example, if the    AuType indicates simple    password, the
  11455.         Authentication key would be    a clear    64-bit password.
  11456.         Authentication keys    associated with    the other OSPF
  11457.         authentication types are discussed in Appendix D.
  11458.  
  11459.     C.4    Virtual    link parameters
  11460.  
  11461.     Virtual    links are used to restore/increase connectivity    of the
  11462.     backbone.  Virtual links may be    configured between any pair of
  11463.     area border routers having interfaces to a common (non-backbone)
  11464.     area.  The virtual link    appears    as an unnumbered point-to-point
  11465.     link in    the graph for the backbone.  The virtual link must be
  11466.     configured in both of the area border routers.
  11467.  
  11468.     A virtual link appears in router-LSAs (for the backbone) as if
  11469.     it were    a separate router interface to the backbone.  As such,
  11470.     it has all of the parameters associated    with a router interface
  11471.     (see Section C.3).  Although a virtual link acts like an
  11472.     unnumbered point-to-point link,    it does    have an    associated IP
  11473.     interface address.  This address is used as the    IP source in
  11474.     OSPF protocol packets it sends along the virtual link, and is
  11475.     set dynamically    during the routing table build process.
  11476.     Interface output cost is also set dynamically on virtual links
  11477.  
  11478.  
  11479.  
  11480. Moy                                  [Page 205]
  11481.  
  11482. Internet Draft             OSPF Version 2            January 1997
  11483.  
  11484.  
  11485.     to be the cost of the intra-area path between the two routers.
  11486.     The parameter RxmtInterval must    be configured, and should be
  11487.     well over the expected round-trip delay    between    the two    routers.
  11488.     This may be hard to estimate for a virtual link; it is better to
  11489.     err on the side    of making it too large.     Router    Priority is not
  11490.     used on    virtual    links.
  11491.  
  11492.     A virtual link is defined by the following two configurable
  11493.     parameters: the    Router ID of the virtual link's    other endpoint,
  11494.     and the    (non-backbone) area through which the virtual link runs
  11495.     (referred to as    the virtual link's Transit area).  Virtual links
  11496.     cannot be configured through stub areas.
  11497.  
  11498.     C.5    NBMA network parameters
  11499.  
  11500.     OSPF treats an NBMA network much like it treats    a broadcast
  11501.     network.  Since    there may be many routers attached to the
  11502.     network, a Designated Router is    selected for the network.  This
  11503.     Designated Router then originates a network-LSA, which lists all
  11504.     routers    attached to the    NBMA network.
  11505.  
  11506.     However, due to    the lack of broadcast capabilities, it may be
  11507.     necessary to use configuration parameters in the Designated
  11508.     Router selection.  These parameters will only need to be
  11509.     configured in those routers that are themselves    eligible to
  11510.     become Designated Router (i.e.,    those router's whose Router
  11511.     Priority for the network is non-zero), and then    only if    no
  11512.     automatic procedure for    discovering neighbors exists:
  11513.  
  11514.  
  11515.     List of    all other attached routers
  11516.         The    list of    all other routers attached to the NBMA network.
  11517.         Each router    is listed by its IP interface address on the
  11518.         network.  Also, for    each router listed, that router's
  11519.         eligibility    to become Designated Router must be defined.
  11520.         When an interface to a NBMA    network    comes up, the router
  11521.         sends Hello    Packets    only to    those neighbors    eligible to
  11522.         become Designated Router, until the    identity of the
  11523.         Designated Router is discovered.
  11524.  
  11525.     PollInterval
  11526.         If a neighboring router has    become inactive    (Hello Packets
  11527.         have not been seen for RouterDeadInterval seconds),    it may
  11528.         still be necessary to send Hello Packets to    the dead
  11529.         neighbor.  These Hello Packets will    be sent    at the reduced
  11530.         rate PollInterval, which should be much larger than
  11531.         HelloInterval.  Sample value for a PDN X.25    network: 2
  11532.         minutes.
  11533.  
  11534.  
  11535.  
  11536. Moy                                  [Page 206]
  11537.  
  11538. Internet Draft             OSPF Version 2            January 1997
  11539.  
  11540.  
  11541.     C.6    Point-to-MultiPoint network parameters
  11542.  
  11543.     On Point-to-MultiPoint networks, it may    be necessary to
  11544.     configure the set of neighbors that are    directly reachable over
  11545.     the Point-to-MultiPoint    network. Each neighbor is identified by
  11546.     its IP address on the Point-to-MultiPoint network. Designated
  11547.     Routers    are not    elected    on Point-to-MultiPoint networks, so the
  11548.     Designated Router eligibility of configured neighbors is
  11549.     undefined.
  11550.  
  11551.     Alternatively, neighbors on Point-to-MultiPoint    networks may be
  11552.     dynamically discovered by lower-level protocols    such as    Inverse
  11553.     ARP ([Ref14]).
  11554.  
  11555.     C.7    Host route parameters
  11556.  
  11557.     Host routes are    advertised in router-LSAs as stub networks with
  11558.     mask 0xffffffff.  They indicate    either router interfaces to
  11559.     point-to-point networks, looped    router interfaces, or IP hosts
  11560.     that are directly connected to the router (e.g., via a SLIP
  11561.     line).    For each host directly connected to the    router,    the
  11562.     following items    must be    configured:
  11563.  
  11564.  
  11565.     Host IP    address
  11566.         The    IP address of the host.
  11567.  
  11568.     Cost of    link to    host
  11569.         The    cost of    sending    a packet to the    host, in terms of the
  11570.         link state metric.    There may be multiple costs configured,
  11571.         one    for each IP TOS.  However, since the host probably has
  11572.         only a single connection to    the internet, the actual
  11573.         configured cost(s) in many cases is    unimportant (i.e., will
  11574.         have no effect on routing).
  11575.  
  11576.     Area ID
  11577.         The    OSPF area to which the host belongs.
  11578.  
  11579.  
  11580.  
  11581.  
  11582.  
  11583.  
  11584.  
  11585.  
  11586.  
  11587.  
  11588.  
  11589.  
  11590.  
  11591.  
  11592. Moy                                  [Page 207]
  11593.  
  11594. Internet Draft             OSPF Version 2            January 1997
  11595.  
  11596.  
  11597. D. Authentication
  11598.  
  11599.     All    OSPF protocol exchanges    are authenticated.  The    OSPF packet
  11600.     header (see    Section    A.3.1) includes    an authentication type field,
  11601.     and    64-bits    of data    for use    by the appropriate authentication scheme
  11602.     (determined    by the type field).
  11603.  
  11604.     The    authentication type is configurable on a per-interface (or
  11605.     equivalently, on a per-network/subnet) basis.  Additional
  11606.     authentication data    is also    configurable on    a per-interface    basis.
  11607.  
  11608.     Authentication types 0, 1 and 2 are    defined    by this    specification.
  11609.     All    other authentication types are reserved    for definition by the
  11610.     IANA (iana@ISI.EDU).  The current list of authentication types is
  11611.     described below in Table 20.
  11612.  
  11613.  
  11614.  
  11615.           AuType       Description
  11616.           ___________________________________________
  11617.           0           Null authentication
  11618.           1           Simple password
  11619.           2           Cryptographic authentication
  11620.           All others   Reserved    for assignment by the
  11621.                    IANA (iana@ISI.EDU)
  11622.  
  11623.  
  11624.               Table 20:    OSPF authentication types.
  11625.  
  11626.  
  11627.  
  11628.     D.1    Null authentication
  11629.  
  11630.     Use of this authentication type    means that routing exchanges
  11631.     over the network/subnet    are not    authenticated.    The 64-bit
  11632.     authentication field in    the OSPF header    can contain anything; it
  11633.     is not examined    on packet reception. When employing Null
  11634.     authentication,    the entire contents of each OSPF packet    (other
  11635.     than the 64-bit    authentication field) are checksummed in order
  11636.     to detect data corruption.
  11637.  
  11638.     D.2    Simple password    authentication
  11639.  
  11640.     Using this authentication type,    a 64-bit field is configured on
  11641.     a per-network basis.  All packets sent on a particular network
  11642.     must have this configured value    in their OSPF header 64-bit
  11643.     authentication field.  This essentially    serves as a "clear" 64-
  11644.     bit password. In addition, the entire contents of each OSPF
  11645.  
  11646.  
  11647.  
  11648. Moy                                  [Page 208]
  11649.  
  11650. Internet Draft             OSPF Version 2            January 1997
  11651.  
  11652.  
  11653.     packet (other than the 64-bit authentication field) are
  11654.     checksummed in order to    detect data corruption.
  11655.  
  11656.     Simple password    authentication guards against routers
  11657.     inadvertently joining the routing domain; each router must first
  11658.     be configured with its attached    networks' passwords before it
  11659.     can participate    in routing.  However, simple password
  11660.     authentication is vulnerable to    passive    attacks    currently
  11661.     widespread in the Internet (see    [Ref16]). Anyone with physical
  11662.     access to the network can learn    the password and compromise the
  11663.     security of the    OSPF routing domain.
  11664.  
  11665.     D.3    Cryptographic authentication
  11666.  
  11667.     Using this authentication type,    a shared secret    key is
  11668.     configured in all routers attached to a    common network/subnet.
  11669.     For each OSPF protocol packet, the key is used to
  11670.     generate/verify    a "message digest" that    is appended to the end
  11671.     of the OSPF packet. The    message    digest is a one-way function of
  11672.     the OSPF protocol packet and the secret    key. Since the secret
  11673.     key is never sent over the network in the clear, protection is
  11674.     provided against passive attacks.
  11675.  
  11676.     The algorithms used to generate    and verify the message digest
  11677.     are specified implicitly by the    secret key. This specification
  11678.     completely defines the use of OSPF Cryptographic authentication
  11679.     when the MD5 algorithm is used.
  11680.  
  11681.     In addition, a non-decreasing sequence number is included in
  11682.     each OSPF protocol packet to protect against replay attacks.
  11683.     This provides long term    protection; however, it    is still
  11684.     possible to replay an OSPF packet until    the sequence number
  11685.     changes. To implement this feature, each neighbor data structure
  11686.  
  11687.  
  11688.     0            1            2            3
  11689.     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
  11690.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11691.        |          0               |    Key    ID     | Auth Data Len |
  11692.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11693.        |         Cryptographic sequence    number               |
  11694.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11695.  
  11696.            Figure 18: Usage of the Authentication field
  11697.            in the OSPF packet header when Cryptographic
  11698.               Authentication is employed
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704. Moy                                  [Page 209]
  11705.  
  11706. Internet Draft             OSPF Version 2            January 1997
  11707.  
  11708.  
  11709.     contains a new field called the    "cryptographic sequence    number".
  11710.     This field is initialized to zero, and is also set to zero
  11711.     whenever the neighbor's    state transitions to "Down". Whenever an
  11712.     OSPF packet is accepted    as authentic, the cryptographic    sequence
  11713.     number is set to the received packet's sequence    number.
  11714.  
  11715.     This specification does    not provide a rollover procedure for the
  11716.     cryptographic sequence number. When the    cryptographic sequence
  11717.     number that the    router is sending hits the maximum value, the
  11718.     router should reset the    cryptographic sequence number that it is
  11719.     sending    back to    0. After this is done, the router's neighbors
  11720.     will reject the    router's OSPF packets for a period of
  11721.     RouterDeadInterval, and    then the router    will be    forced to
  11722.     reestablish all    adjacencies over the interface.    However, it is
  11723.     expected that many implementations will    use "seconds since
  11724.     reboot"    (or "seconds since 1960", etc.)    as the cryptographic
  11725.     sequence number. Such a    choice will essentially    prevent
  11726.     rollover, since    the cryptographic sequence number field    is 32
  11727.     bits in    length.
  11728.  
  11729.     The OSPF Cryptographic authentication option does not provide
  11730.     confidentiality.
  11731.  
  11732.     When cryptographic authentication is used, the 64-bit
  11733.     Authentication field in    the standard OSPF packet header    is
  11734.     redefined as shown in Figure 18. The new field definitions are
  11735.     as follows:
  11736.  
  11737.     Key ID
  11738.         This field identifies the algorithm    and secret key used to
  11739.         create the message digest appended to the OSPF packet. Key
  11740.         Identifiers    are unique per-interface (or equivalently, per-
  11741.         subnet).
  11742.  
  11743.     Auth Data Len
  11744.         The    length in bytes    of the message digest appended to the
  11745.         OSPF packet.
  11746.  
  11747.     Cryptographic sequence number
  11748.         An unsigned    32-bit non-decreasing sequence number. Used to
  11749.         guard against replay attacks.
  11750.  
  11751.     The message digest appended to the OSPF    packet is not actually
  11752.     considered part    of the OSPF protocol packet: the message digest
  11753.     is not included    in the OSPF header's packet length, although it
  11754.     is included in the packet's IP header length field.
  11755.  
  11756.  
  11757.  
  11758.  
  11759.  
  11760. Moy                                  [Page 210]
  11761.  
  11762. Internet Draft             OSPF Version 2            January 1997
  11763.  
  11764.  
  11765.     Each key is identified by the combination of interface and Key
  11766.     ID. An interface may have multiple keys    active at any one time.
  11767.     This enables smooth transition from one    key to another.    Each key
  11768.     has four time constants    associated with    it. These time constants
  11769.     can be expressed in terms of a time-of-day clock, or in    terms of
  11770.     a router's local clock (e.g., number of    seconds    since last
  11771.     reboot):
  11772.  
  11773.     KeyStartAccept
  11774.         The    time that the router will start    accepting packets that
  11775.         have been created with the given key.
  11776.  
  11777.     KeyStartGenerate
  11778.         The    time that the router will start    using the key for packet
  11779.         generation.
  11780.  
  11781.     KeyStopGenerate
  11782.         The    time that the router will stop using the key for packet
  11783.         generation.
  11784.  
  11785.     KeyStopAccept
  11786.         The    time that the router will stop accepting packets that
  11787.         have been created with the given key.
  11788.  
  11789.     In order to achieve smooth key transition, KeyStartAccept should
  11790.     be less    than KeyStartGenerate and KeyStopGenerate should be less
  11791.     than KeyStopAccept. If KeyStopGenerate and KeyStopAccept are
  11792.     left unspecified, the key's lifetime is    infinite. When a new key
  11793.     replaces an old, the KeyStartGenerate time for the new key must
  11794.     be less    than or    equal to the KeyStopGenerate time of the old
  11795.     key.
  11796.  
  11797.     Key storage should persist across a system restart, warm or
  11798.     cold, to avoid operational issues. In the event    that the last
  11799.     key associated with an interface expires, it is    unacceptable to
  11800.     revert to an unauthenticated condition,    and not    advisable to
  11801.     disrupt    routing.  Therefore, the router    should send a "last
  11802.     authentication key expiration" notification to the network
  11803.     manager    and treat the key as having an infinite    lifetime until
  11804.     the lifetime is    extended, the key is deleted by    network
  11805.     management, or a new key is configured.
  11806.  
  11807.     D.4    Message    generation
  11808.  
  11809.     After building the contents of an OSPF packet, the
  11810.     authentication procedure indicated by the sending interface's
  11811.     Autype value is    called before the packet is sent. The
  11812.     authentication procedure modifies the OSPF packet as follows.
  11813.  
  11814.  
  11815.  
  11816. Moy                                  [Page 211]
  11817.  
  11818. Internet Draft             OSPF Version 2            January 1997
  11819.  
  11820.  
  11821.     D.4.1 Generating Null authentication
  11822.  
  11823.         When using Null authentication, the    packet is modified as
  11824.         follows:
  11825.  
  11826.         (1)    The Autype field in the    standard OSPF header is    set to
  11827.         0.
  11828.  
  11829.         (2)    The checksum field in the standard OSPF    header is set to
  11830.         the standard IP    checksum of the    entire contents    of the
  11831.         packet,    starting with the OSPF packet header but
  11832.         excluding the 64-bit authentication field.  This
  11833.         checksum is calculated as the 16-bit one's complement of
  11834.         the one's complement sum of all    the 16-bit words in the
  11835.         packet,    excepting the authentication field.  If    the
  11836.         packet's length    is not an integral number of 16-bit
  11837.         words, the packet is padded with a byte    of zero    before
  11838.         checksumming.
  11839.  
  11840.     D.4.2 Generating Simple    password authentication
  11841.  
  11842.         When using Simple password authentication, the packet is
  11843.         modified as    follows:
  11844.  
  11845.         (1)    The Autype field in the    standard OSPF header is    set to
  11846.         1.
  11847.  
  11848.         (2)    The checksum field in the standard OSPF    header is set to
  11849.         the standard IP    checksum of the    entire contents    of the
  11850.         packet,    starting with the OSPF packet header but
  11851.         excluding the 64-bit authentication field.  This
  11852.         checksum is calculated as the 16-bit one's complement of
  11853.         the one's complement sum of all    the 16-bit words in the
  11854.         packet,    excepting the authentication field.  If    the
  11855.         packet's length    is not an integral number of 16-bit
  11856.         words, the packet is padded with a byte    of zero    before
  11857.         checksumming.
  11858.  
  11859.         (3)    The 64-bit authentication field    in the OSPF packet
  11860.         header is set to the 64-bit password (i.e.,
  11861.         authentication key) that has been configured for the
  11862.         interface.
  11863.  
  11864.     D.4.3 Generating Cryptographic authentication
  11865.  
  11866.         When using Cryptographic authentication, there may be
  11867.         multiple keys configured for the interface.    In this    case,
  11868.         among the keys that    are valid for message generation (i.e,
  11869.  
  11870.  
  11871.  
  11872. Moy                                  [Page 212]
  11873.  
  11874. Internet Draft             OSPF Version 2            January 1997
  11875.  
  11876.  
  11877.         that have KeyStartGenerate <= current time <
  11878.         KeyStopGenerate) choose the    one with the most recent
  11879.         KeyStartGenerate time. Using this key, modify the packet as
  11880.         follows:
  11881.  
  11882.         (1)    The Autype field in the    standard OSPF header is    set to
  11883.         2.
  11884.  
  11885.         (2)    The checksum field in the standard OSPF    header is not
  11886.         calculated, but    is instead set to 0.
  11887.  
  11888.         (3)    The Key    ID (see    Figure 18) is set to the chosen    key's
  11889.         Key ID.
  11890.  
  11891.         (4)    The Auth Data Len field    is set to the length in    bytes of
  11892.         the message digest that    will be    appended to the    OSPF
  11893.         packet.    When using MD5 as the authentication algorithm,
  11894.         Auth Data Len will be 16.
  11895.  
  11896.         (5)    The 32-bit Cryptographic sequence number (see Figure 18)
  11897.         is set to a non-decreasing value (i.e.,    a value    at least
  11898.         as large as the    last value sent    out the    interface). The
  11899.         precise    values to use in the cryptographic sequence
  11900.         number field are implementation-specific. For example,
  11901.         it may be based    on a simple counter, or    be based on the
  11902.         system's clock.
  11903.  
  11904.         (6)    The message digest is then calculated and appended to
  11905.         the OSPF packet.  The authentication algorithm to be
  11906.         used in    calculating the    digest is indicated by the key
  11907.         itself.     Input to the authentication algorithm consists
  11908.         of the OSPF packet and the secret key. When using MD5 as
  11909.         the authentication algorithm, the message digest
  11910.         calculation proceeds as    follows:
  11911.  
  11912.         (a) The    16 byte    MD5 key    is appended to the OSPF    packet.
  11913.  
  11914.         (b) Trailing pad and length fields are added, as
  11915.             specified in [Ref17].
  11916.  
  11917.         (c) The    MD5 authentication algorithm is    run over the
  11918.             concatenation of the OSPF packet, secret key, pad
  11919.             and    length fields, producing a 16 byte message
  11920.             digest (see    [Ref17]).
  11921.  
  11922.         (d) The    MD5 digest is written over the OSPF key    (i.e.,
  11923.             appended to    the original OSPF packet). The digest is
  11924.             not    counted    in the OSPF packet's length field, but
  11925.  
  11926.  
  11927.  
  11928. Moy                                  [Page 213]
  11929.  
  11930. Internet Draft             OSPF Version 2            January 1997
  11931.  
  11932.  
  11933.             is included    in the packet's    IP length field. Any
  11934.             trailing pad or length fields beyond the digest are
  11935.             not    counted    or transmitted.
  11936.  
  11937.     D.5    Message    verification
  11938.  
  11939.     When an    OSPF packet has    been received on an interface, it must
  11940.     be authenticated. The authentication procedure is indicated by
  11941.     the setting of Autype in the standard OSPF packet header, which
  11942.     matches    the setting of Autype for the receiving    OSPF interface.
  11943.  
  11944.     If an OSPF protocol packet is accepted as authentic, processing
  11945.     of the packet continues    as specified in    Section    8.2. Packets
  11946.     which fail authentication are discarded.
  11947.  
  11948.     D.5.1 Verifying    Null authentication
  11949.  
  11950.         When using Null authentication, the    checksum field in the
  11951.         OSPF header    must be    verified. It must be set to the    16-bit
  11952.         one's complement of    the one's complement sum of all    the 16-
  11953.         bit    words in the packet, excepting the authentication field.
  11954.         (If    the packet's length is not an integral number of 16-bit
  11955.         words, the packet is padded    with a byte of zero before
  11956.         checksumming.)
  11957.  
  11958.     D.5.2 Verifying    Simple password    authentication
  11959.  
  11960.         When using Simple password authentication, the received OSPF
  11961.         packet is authenticated as follows:
  11962.  
  11963.         (1)    The checksum field in the OSPF header must be verified.
  11964.         It must    be set to the 16-bit one's complement of the
  11965.         one's complement sum of    all the    16-bit words in    the
  11966.         packet,    excepting the authentication field.  (If the
  11967.         packet's length    is not an integral number of 16-bit
  11968.         words, the packet is padded with a byte    of zero    before
  11969.         checksumming.)
  11970.  
  11971.         (2)    The 64-bit authentication field    in the OSPF packet
  11972.         header must be equal to    the 64-bit password (i.e.,
  11973.         authentication key) that has been configured for the
  11974.         interface.
  11975.  
  11976.     D.5.3 Verifying    Cryptographic authentication
  11977.  
  11978.         When using Cryptographic authentication, the received OSPF
  11979.         packet is authenticated as follows:
  11980.  
  11981.  
  11982.  
  11983.  
  11984. Moy                                  [Page 214]
  11985.  
  11986. Internet Draft             OSPF Version 2            January 1997
  11987.  
  11988.  
  11989.         (1)    Locate the receiving interface's configured key    having
  11990.         Key ID equal to    that specified in the received OSPF
  11991.         packet (see Figure 18).    If the key is not found, or if
  11992.         the key    is not valid for reception (i.e., current time <
  11993.         KeyStartAccept or current time >= KeyStopAccept), the
  11994.         OSPF packet is discarded.
  11995.  
  11996.         (2)    If the cryptographic sequence number found in the OSPF
  11997.         header (see Figure 18) is less than the    cryptographic
  11998.         sequence number    recorded in the    sending    neighbor's data
  11999.         structure, the OSPF packet is discarded.
  12000.  
  12001.         (3)    Verify the appended message digest in the following
  12002.         steps:
  12003.  
  12004.         (a) The    received digest    is set aside.
  12005.  
  12006.         (b) A new digest is calculated,    as specified in    Step 6
  12007.             of Section D.4.3.
  12008.  
  12009.         (c) The    calculated and received    digests    are compared. If
  12010.             they do not    match, the OSPF    packet is discarded. If
  12011.             they do match, the OSPF protocol packet is accepted
  12012.             as authentic, and the "cryptographic sequence
  12013.             number" in the neighbor's data structure is    set to
  12014.             the    sequence number    found in the packet's OSPF
  12015.             header.
  12016.  
  12017.  
  12018.  
  12019.  
  12020.  
  12021.  
  12022.  
  12023.  
  12024.  
  12025.  
  12026.  
  12027.  
  12028.  
  12029.  
  12030.  
  12031.  
  12032.  
  12033.  
  12034.  
  12035.  
  12036.  
  12037.  
  12038.  
  12039.  
  12040. Moy                                  [Page 215]
  12041.  
  12042. Internet Draft             OSPF Version 2            January 1997
  12043.  
  12044.  
  12045. E. An algorithm    for assigning Link State IDs
  12046.  
  12047.     The    Link State ID in AS-external-LSAs and summary-LSAs is usually
  12048.     set    to the described network's IP address. However,    if necessary one
  12049.     or more of the network's host bits may be set in the Link State ID.
  12050.     This allows    the router to originate    separate LSAs for networks
  12051.     having the same address, yet different masks. Such networks    can
  12052.     occur in the presence of supernetting and subnet 0s    (see [Ref10]).
  12053.  
  12054.     This appendix gives    one possible algorithm for setting the host bits
  12055.     in Link State IDs.    The choice of such an algorithm    is a local
  12056.     decision. Separate routers are free    to use different algorithms,
  12057.     since the only LSAs    affected are the ones that the router itself
  12058.     originates.    The only requirement on    the algorithms used is that the
  12059.     network's IP address should    be used    as the Link State ID whenever
  12060.     possible; this maximizes interoperability with OSPF    implementations
  12061.     predating RFC 1583.
  12062.  
  12063.     The    algorithm below    is stated for AS-external-LSAs.     This is only
  12064.     for    clarity; the exact same    algorithm can be used for summary-LSAs.
  12065.     Suppose that the router wishes to originate    an AS-external-LSA for a
  12066.     network having address NA and mask NM1. The    following steps    are then
  12067.     used to determine the LSA's    Link State ID:
  12068.  
  12069.     (1)    Determine whether the router is    already    originating an AS-
  12070.     external-LSA with Link State ID    equal to NA (in    such an    LSA the
  12071.     router itself will be listed as    the LSA's Advertising Router).
  12072.     If not,    the Link State ID is set equal to NA and the algorithm
  12073.     terminates. Otherwise,
  12074.  
  12075.     (2)    Obtain the network mask    from the body of the already existing
  12076.     AS-external-LSA. Call this mask    NM2. There are then two    cases:
  12077.  
  12078.     o   NM1    is longer (i.e., more specific)    than NM2. In this case,
  12079.         set    the Link State ID in the new LSA to be the network
  12080.         [NA,NM1] with all the host bits set    (i.e., equal to    NA or'ed
  12081.         together with all the bits that are    not set    in NM1,    which is
  12082.         network [NA,NM1]'s broadcast address).
  12083.  
  12084.     o   NM2    is longer than NM1. In this case, change the existing
  12085.         LSA    (having    Link State ID of NA) to    reference the new
  12086.         network [NA,NM1] by    incrementing the sequence number,
  12087.         changing the mask in the body to NM1 and inserting the cost
  12088.         of the new network.    Then originate a new LSA for the old
  12089.         network [NA,NM2], with Link    State ID equal to NA or'ed
  12090.         together with the bits that    are not    set in NM2 (i.e.,
  12091.         network [NA,NM2]'s broadcast address).
  12092.  
  12093.  
  12094.  
  12095.  
  12096. Moy                                  [Page 216]
  12097.  
  12098. Internet Draft             OSPF Version 2            January 1997
  12099.  
  12100.  
  12101.     The    above algorithm    assumes    that all masks are contiguous; this
  12102.     ensures that when two networks have    the same address, one mask is
  12103.     more specific than the other. The algorithm    also assumes that no
  12104.     network exists having an address equal to another network's
  12105.     broadcast address. Given these two assumptions, the    above algorithm
  12106.     always produces unique Link    State IDs. The above algorithm can also
  12107.     be reworded    as follows:  When originating an AS-external-LSA, try to
  12108.     use    the network number as the Link State ID.  If that produces a
  12109.     conflict, examine the two networks in conflict. One    will be    a subset
  12110.     of the other. For the less specific    network, use the network number
  12111.     as the Link    State ID and for the more specific use the network's
  12112.     broadcast address instead (i.e., flip all the "host" bits to 1).  If
  12113.     the    most specific network was originated first, this will cause you
  12114.     to originate two LSAs at once.
  12115.  
  12116.     As an example of the algorithm, consider its operation when    the
  12117.     following sequence of events occurs    in a single router (Router A).
  12118.  
  12119.  
  12120.     (1)    Router A wants to originate an AS-external-LSA for
  12121.     [10.0.0.0,255.255.255.0]:
  12122.  
  12123.     (a) A Link State ID of 10.0.0.0    is used.
  12124.  
  12125.     (2)    Router A then wants to originate an AS-external-LSA for
  12126.     [10.0.0.0,255.255.0.0]:
  12127.  
  12128.     (a) The    LSA for    [10.0.0,0,255.255.255.0] is reoriginated using a
  12129.         new    Link State ID of 10.0.0.255.
  12130.  
  12131.     (b) A Link State ID of 10.0.0.0    is used    for
  12132.         [10.0.0.0,255.255.0.0].
  12133.  
  12134.     (3)    Router A then wants to originate an AS-external-LSA for
  12135.     [10.0.0.0,255.0.0.0]:
  12136.  
  12137.     (a) The    LSA for    [10.0.0.0,255.255.0.0] is reoriginated using a
  12138.         new    Link State ID of 10.0.255.255.
  12139.  
  12140.     (b) A Link State ID of 10.0.0.0    is used    for
  12141.         [10.0.0.0,255.0.0.0].
  12142.  
  12143.     (c) The    network    [10.0.0.0,255.255.255.0] keeps its Link    State ID
  12144.         of 10.0.0.255.
  12145.  
  12146.  
  12147.  
  12148.  
  12149.  
  12150.  
  12151.  
  12152. Moy                                  [Page 217]
  12153.  
  12154. Internet Draft             OSPF Version 2            January 1997
  12155.  
  12156.  
  12157. F. Multiple interfaces to the same network/subnet
  12158.  
  12159.     There are at least two ways    to support multiple physical interfaces
  12160.     to the same    IP subnet. Both    methods    will interoperate with
  12161.     implementations of RFC 1583    (and of    course this memo). The two
  12162.     methods are    sketched briefly below.    An assumption has been made that
  12163.     each interface has been assigned a separate    IP address (otherwise,
  12164.     support for    multiple interfaces is more of a link-level or ARP issue
  12165.     than an OSPF issue).
  12166.  
  12167.     Method 1:
  12168.     Run the    entire OSPF functionality over both interfaces,    sending
  12169.     and receiving hellos, flooding,    supporting separate interface
  12170.     and neighbor FSMs for each interface, etc. When    doing this all
  12171.     other routers on the subnet will treat the two interfaces as
  12172.     separate neighbors, since neighbors are    identified (on broadcast
  12173.     and NBMA networks) by their IP address.
  12174.  
  12175.     Method 1 has the following disadvantages:
  12176.  
  12177.     (1) You    increase the total number of neighbors and adjacencies.
  12178.  
  12179.     (2) You    lose the bidirectionality test on both interfaces, since
  12180.         bidirectionality is    based on Router    ID.
  12181.  
  12182.     (3) You    have to    consider both interfaces together during the
  12183.         Designated Router election,    since if you declare both to be
  12184.         DR simultaneously you can confuse the tie-breaker (which is
  12185.         Router ID).
  12186.  
  12187.     Method 2:
  12188.     Run OSPF over only one interface (call it the primary
  12189.     interface), but    include    both the primary and secondary
  12190.     interfaces in your Router-LSA.
  12191.  
  12192.     Method 2 has the following disadvantages:
  12193.  
  12194.     (1) You    lose the bidirectionality test on the secondary
  12195.         interface.
  12196.  
  12197.     (2) When the primary interface fails, you need to promote the
  12198.         secondary interface    to primary status.
  12199.  
  12200.  
  12201.  
  12202.  
  12203.  
  12204.  
  12205.  
  12206.  
  12207.  
  12208. Moy                                  [Page 218]
  12209.  
  12210. Internet Draft             OSPF Version 2            January 1997
  12211.  
  12212.  
  12213. G. Differences from RFC    1583
  12214.  
  12215.     This section documents the differences between this    memo and RFC
  12216.     1583.  All differences are backward-compatible. Implementations of
  12217.     this memo and of RFC 1583 will interoperate.
  12218.  
  12219.     G.1    Enhancements to    OSPF authentication
  12220.  
  12221.     An additional OSPF authentication type has been    added: the
  12222.     Cryptographic authentication type. This    has been defined so that
  12223.     any arbitrary "Keyed Message Digest" algorithm can be used for
  12224.     packet authentication. Operation using the MD5 algorithm is
  12225.     completely specified (see Appendix D).
  12226.  
  12227.     A number of other changes were also made to OSPF packet
  12228.     authentication,    affecting the following    Sections:
  12229.  
  12230.     o   The    authentication type is now specified per-interface,
  12231.         rather than    per-area (Sections 6, 9, C.2 and C.3).
  12232.  
  12233.     o   The    OSPF packet header checksum is now considered part of
  12234.         the    authentication procedure, and so has been moved    out of
  12235.         the    packet send and    receive    logic (Sections    8.1 and    8.2) and
  12236.         into the description of authentication types (Appendix D).
  12237.  
  12238.     o   In Appendix    D, sections detailing message generation and
  12239.         message verification have been added.
  12240.  
  12241.     o   For    the OSPF Cryptographic authentication type, a discussion
  12242.         of key management, including the requirement for
  12243.         simultaneous support of multiple keys, key lifetimes and
  12244.         smooth key transition, has been added to Appendix D.
  12245.  
  12246.     G.2    Addition of Point-to-MultiPoint    interface
  12247.  
  12248.     This memo adds an additional method for    running    OSPF over non-
  12249.     broadcast networks: the    Point-to-Multipoint network. To
  12250.     implement this addition, the language of RFC 1583 has been
  12251.     altered    slightly. References to    "multi-access" networks    have
  12252.     been deleted. The term "non-broadcast networks"    is now used to
  12253.     describe networks which    can connect many routers, but which do
  12254.     not natively support broadcast/multicast (such as a public Frame
  12255.     relay network).    Over non-broadcast networks, there are two
  12256.     options    for running OSPF: modelling them as "NBMA networks" or
  12257.     as "Point-to-MultiPoint    networks". NBMA    networks require full
  12258.     mesh connectivity between routers; when    employing NBMA networks
  12259.     in the presence    of partial mesh    connectivity, multiple NBMA
  12260.     networks must be configured, as    described in [Ref15]. In
  12261.  
  12262.  
  12263.  
  12264. Moy                                  [Page 219]
  12265.  
  12266. Internet Draft             OSPF Version 2            January 1997
  12267.  
  12268.  
  12269.     contrast, Point-to-Multipoint networks have been designed to
  12270.     work simply and    naturally when faced with partial mesh
  12271.     connectivity.
  12272.  
  12273.     The addition of    Point-to-MultiPoint networks has impacted the
  12274.     text in    many places, which are briefly summarized below:
  12275.  
  12276.     o   Section 2 describing the OSPF link-state database has been
  12277.         split into additional subsections, with one    of the
  12278.         subsections    (Section 2.1.1)    describing the differing map
  12279.         representations of the two non-broadcast network options.
  12280.         This subsection also contrasts the NBMA network and    Point-
  12281.         to-MultiPoint network options, and describes the situations
  12282.         when one is    preferable to the other.
  12283.  
  12284.     o   In contrast    to NBMA    networks, Point-to-MultiPoint networks
  12285.         have the following properties. Adjacencies are established
  12286.         between all    neighboring routers (Sections 4, 7.1, 7.5, 9.5
  12287.         and    10.4). There is    no Designated Router or    Backup
  12288.         Designated Router for a Point-to-MultiPoint    network
  12289.         (Sections 7.3 and 7.4). No network-LSA is originated for
  12290.         Point-to-MultiPoint    networks (Sections 12.4.2 and A.4.3).
  12291.         Router Priority is not configured for Point-to-MultiPoint
  12292.         interfaces,    nor for    neighbors on Point-to-MultiPoint
  12293.         networks (Sections C.3 and C.6).
  12294.  
  12295.     o   The    Interface FSM for a Point-to-MultiPoint    interface is
  12296.         identical to that used for point-to-point interfaces. Two
  12297.         states are possible: "Down"    and "Point-to-Point" (Section
  12298.         9.3).
  12299.  
  12300.     o   When originating a router-LSA, and Point-to-MultiPoint
  12301.         interface is reported as a collection of "point-to-point
  12302.         links" to all of the interface's adjacent neighbors,
  12303.         together with a single stub    link advertising the interface's
  12304.         IP address with a cost of 0    (Section 12.4.1.4).
  12305.  
  12306.     o   When flooding out a    non-broadcast interface    (when either in
  12307.         NBMA or Point-to-MultiPoint    mode) the Link State Update or
  12308.         Link State Acknowledgment packet must be replicated    in order
  12309.         to be sent to each of the interface's neighbors (see
  12310.         Sections 13.3 and 13.5).
  12311.  
  12312.     G.3    Support    for overlapping    area ranges
  12313.  
  12314.     RFC 1583 requires that all networks falling into a given area
  12315.     range actually belong to a single area.    This memo relaxes that
  12316.     restriction. This is useful in the following example. Suppose
  12317.  
  12318.  
  12319.  
  12320. Moy                                  [Page 220]
  12321.  
  12322. Internet Draft             OSPF Version 2            January 1997
  12323.  
  12324.  
  12325.     that [10.0.0.0,    255.0.0.0] is carved up    into subnets. Most of
  12326.     these subnets are assigned to a    single OSPF area (call it Area
  12327.     X), while a few    subnets    are assigned to    other areas. In    order to
  12328.     get this configuration to work with RFC    1583, you must not
  12329.     summarize the subnets of Area X    with the single    range [10.0.0.0,
  12330.     255.0.0.0], because then the subnets of    10.0.0.0 belonging to
  12331.     other areas would become unreachable. However, with this memo
  12332.     you can    summarize the subnets in Area X, provided that the
  12333.     subnets    belonging to other areas are not summarized.
  12334.  
  12335.     Implementation details for this    change can be found in Sections
  12336.     11.1 and 16.2.
  12337.  
  12338.     G.4    A modification to the flooding algorithm
  12339.  
  12340.     The OSPF flooding algorithm has    been modified as follows. When a
  12341.     Link State Update Packet is received that contains an LSA
  12342.     instance which is actually less    recent than the    the router's
  12343.     current    database copy, the router will now in most cases respond
  12344.     by flooding back its database copy. This is in contrast    to the
  12345.     RFC 1583 behavior, which was to    simply throw the received LSA
  12346.     away.
  12347.  
  12348.     Detailed description of    the change can be found    in Step    8 of
  12349.     Section    13.
  12350.  
  12351.     This change improves MaxAge processing.    There are times    when
  12352.     MaxAge LSAs stay in a router's database    for extended intervals:
  12353.     1) when    they are stuck in a retransmission queue on a slow link
  12354.     or 2) when a router is not properly flushing them from its
  12355.     database, due to software bugs.    The prolonged existence    of these
  12356.     MaxAge LSAs can    inhibit    the flooding of    new instances of the
  12357.     LSA. New instances typically start with    LS sequence number equal
  12358.     to InitialSequenceNumber, and are treated as less recent (and
  12359.     hence were discarded according to RFC 1583) by routers still
  12360.     holding    MaxAge instances. However, with    the above change to
  12361.     flooding, a router holding a MaxAge instance will flood    back the
  12362.     MaxAge instance. When this flood reaches the LSA's originator,
  12363.     it will    then pick the next highest LS sequence number and
  12364.     reflood, overwriting the MaxAge    instance.
  12365.  
  12366.     G.5    Introduction of    the MinLSArrival constant
  12367.  
  12368.     OSPF limits the    frequency that new instances of    any particular
  12369.     LSA can    be accepted during flooding. This is extra protection,
  12370.     just in    case a neighboring router is violating the mandated
  12371.     limit on LSA (re)originations (namely, one per LSA in any
  12372.     MinLSInterval).
  12373.  
  12374.  
  12375.  
  12376. Moy                                  [Page 221]
  12377.  
  12378. Internet Draft             OSPF Version 2            January 1997
  12379.  
  12380.  
  12381.     In RFC 1583, the frequency at which new    LSA instances were
  12382.     accepted was also set equal to once every MinLSInterval    seconds.
  12383.     However, in some circumstances this led    to unwanted link state
  12384.     retransmissions, even when the LSA originator was obeying the
  12385.     MinLSInterval limit on originations. This was due to either 1)
  12386.     choice of clock    granularity in some OSPF implementations or 2)
  12387.     differing clock    speed in neighboring routers.
  12388.  
  12389.     To alleviate this problem, the frequency at which new LSA
  12390.     instances are accepted during flooding has now been increased to
  12391.     once every MinLSArrival    seconds, whose value is    set to 1.  This
  12392.     change is reflected in Steps 5a    and 5d of Section 13, and in
  12393.     Appendix B.
  12394.  
  12395.     G.6    Optionally advertising point-to-point links as subnets
  12396.  
  12397.     When describing    a point-to-point interface in its router-LSA, a
  12398.     router may now advertise a stub    link to    the point-to-point
  12399.     network's subnet. This is specified as an alternative to the RFC
  12400.     1583 behavior, which is    to advertise a stub link to the
  12401.     neighbor's IP address. See Sections 12.4.1 and 12.4.1.1    for
  12402.     details.
  12403.  
  12404.     G.7    Advertising same external route    from multiple areas
  12405.  
  12406.     This document fixes routing loops which    can occur in RFC 1583
  12407.     when the same external destination is advertised by AS boundary
  12408.     routers    in separate areas. There are two manifestations    of this
  12409.     problem. The first, discovered by Dennis Ferguson, occurs when
  12410.     an aggregated forwarding address is in use. In this case, the
  12411.     desirability of    the forwarding address can change for the worse
  12412.     as a packet crosses an area aggregation    boundary on the    way to
  12413.     the forwarding address,    which in turn can cause    the preference
  12414.     of AS-external-LSAs to change, resulting in a routing loop.
  12415.  
  12416.     The second manifestation was discovered    by Richard Woundy. It is
  12417.     caused by an incomplete    application of OSPF's preference of
  12418.     intra-area routes over inter-area routes: paths    to any given
  12419.     ASBR/forwarding    address    are selected first based on intra-area
  12420.     preference, while the comparison between separate
  12421.     ASBRs/forwarding addresses is driven only by cost, ignoring
  12422.     intra-area preference. His example is replicated in Figure 19.
  12423.     Both router A3 and router B3 are originating an    AS-external-LSA
  12424.     for 10.0.0.0/8,    with the same type 2 metric. Router A1 selects
  12425.     B1 as its next hop towards 10.0.0.0/8, based on    shorter    cost to
  12426.     ASBR B3    (via B1->B2->B3). However, the shorter route to    B3 is
  12427.     not available to B1, due to B1's preference for    the (higher
  12428.     cost) intra-area route to B3 through Area A. This leads    B1 to
  12429.  
  12430.  
  12431.  
  12432. Moy                                  [Page 222]
  12433.  
  12434. Internet Draft             OSPF Version 2            January 1997
  12435.  
  12436.  
  12437.     select A1 as its next hop to 10.0.0.0/8, resulting in a    routing
  12438.     loop.
  12439.  
  12440.     The following two changes have been made to prevent these
  12441.     routing    loops:
  12442.  
  12443.     o   When originating a type 3 summary-LSA for a    configured area
  12444.         address range, the cost of the summary-LSA is now set to the
  12445.         maximum cost of the    range's    component networks (instead of
  12446.         the    previous algorithm which set the cost to the minimum
  12447.         component cost).  This change affects Sections 3.5 and
  12448.         12.4.3, Figures 7 and 8, and Tables    6 and 13.
  12449.  
  12450.     o   The    preference rules for choosing among multiple AS-
  12451.         external-LSAs have been changed. Where previously cost was
  12452.         the    only determining factor, now the preference is driven
  12453.         first by type of path (intra-area or inter-area, through
  12454.         non-backbone area or through backbone) to the
  12455.         ASBR/forwarding address, using cost    only to    break ties. This
  12456.         change affects Sections 16.4 and 16.4.1.
  12457.  
  12458.         After implementing this change, the    example    in Figure 19 is
  12459.         modified as    follows. Router    A1 now chooses A3 as the next
  12460.  
  12461.                   10.0.0.0/8
  12462.                   ----------
  12463.                    |
  12464.                 +----+
  12465.                 | XX |
  12466.                 +----+
  12467.            RIP        /    \          RIP
  12468.        ---------------------      --------------------
  12469.        !                         !
  12470.        !                         !
  12471.      +----+         +----+      1      +----+......+----+....
  12472.      | A3 |------| A1 |---------------| B1 |------|    B3 |   .
  12473.      +----+      6  +----+          +----+  8   +----+   .
  12474.                        1|  .     /     .
  12475.                OSPF backbone        |  .    /      .
  12476.                       +----+  2    /       .
  12477.                       | B2 |-------     Area A.
  12478.                       +----+................
  12479.  
  12480.         Figure 19: Example routing loop    when the
  12481.            same external route is advertised from multiple
  12482.                 areas
  12483.  
  12484.  
  12485.  
  12486.  
  12487.  
  12488. Moy                                  [Page 223]
  12489.  
  12490. Internet Draft             OSPF Version 2            January 1997
  12491.  
  12492.  
  12493.         hop    to 10.0.0.0/8, while B1    chooses    B3 as next hop.    The
  12494.         reason for both choices is that ASBRs/forwarding addresses
  12495.         are    now chosen based first on intra-area preference, and
  12496.         then by cost.
  12497.  
  12498.         Unfortunately, this    change is not backward compatible. While
  12499.         the    change prevents    routing    loops when all routers run the
  12500.         new    preference rules, it can actually create routing loops
  12501.         when some routers are running the new preference rules and
  12502.         other routers implement RFC    1583. For this reason, a new
  12503.         configuration parameter has    been added:
  12504.         RFC1583Compatibility. Only when RFC1583Compatibility is set
  12505.         to "disabled" will the new preference rules    take effect. See
  12506.         Appendix C for more    details.
  12507.  
  12508.     G.8    Retransmission of initial Database Description packets
  12509.  
  12510.     This memo allows retransmission    of initial Database Description
  12511.     packets, without resetting the state of    the adjacency. In some
  12512.     environments, retransmission of    the initial Database Description
  12513.     packet may be unavoidable. For example,    the link delay incurred
  12514.     by a satellite link may    exceed the value configured for    an
  12515.     interface's RxmtInterval. In RFC 1583 such an environment
  12516.     prevents a full    adjacency from ever forming.
  12517.  
  12518.     In this    memo, changes have been    made in    the reception of
  12519.     Database Description packets so    that retransmitted initial
  12520.     Database Description packets are treated identically to    any
  12521.     other retransmitted Database Description packets. See Section
  12522.     10.6 for details.
  12523.  
  12524.     G.9    Detecting interface MTU    mismatches
  12525.  
  12526.     When two neighboring routers have a different interface    MTU for
  12527.     their common network segment, serious problems can ensue: large
  12528.     packets    are prevented from being successfully transferred from
  12529.     one router to the other, impairing OSPF's flooding algorithm and
  12530.     possibly creating "black holes"    for user data traffic.
  12531.  
  12532.     This memo provides a fix for the interface MTU mismatch    problem
  12533.     by advertising the interface MTU in Database Description
  12534.     packets. When a    router receives    a Database description packet
  12535.     advertising an MTU larger than the router can receive, the
  12536.     router drops the Database Description packet. This prevents an
  12537.     adjacency from forming,    telling    OSPF flooding and user data
  12538.     traffic    to avoid the connection    between    the two    routers. For
  12539.     more information, see Sections 10.6, 10.8, and A.3.3.
  12540.  
  12541.  
  12542.  
  12543.  
  12544. Moy                                  [Page 224]
  12545.  
  12546. Internet Draft             OSPF Version 2            January 1997
  12547.  
  12548.  
  12549. Security Considerations
  12550.  
  12551.     All    OSPF protocol exchanges    are authenticated. OSPF    supports
  12552.     multiple types of authentication; the type of authentication in use
  12553.     can    be configured on a per network segment basis. One of OSPF's
  12554.     authentication types, namely the Cryptographic authentication
  12555.     option, is believed    to be secure against passive attacks and provide
  12556.     significant    protection against active attacks. When    using the
  12557.     Cryptographic authentication option, each router appends a "message
  12558.     digest" to its transmitted OSPF packets. Receivers then use    the
  12559.     shared secret key and received digest to verify that each received
  12560.     OSPF packet    is authentic.
  12561.  
  12562.     The    quality    of the security    provided by the    Cryptographic
  12563.     authentication option depends completely on    the strength of    the
  12564.     message digest algorithm (MD5 is currently the only    message    digest
  12565.     algorithm specified), the strength of the key being    used, and the
  12566.     correct implementation of the security mechanism in    all
  12567.     communicating OSPF implementations.     It also requires that all
  12568.     parties maintain the secrecy of the    shared secret key.
  12569.  
  12570.     None of the    OSPF authentication types provide confidentiality. Nor
  12571.     do they protect against traffic analysis. Key management is    also not
  12572.     addressed by this memo.
  12573.  
  12574.     For    more information, see Sections 8.1, 8.2, and Appendix D.
  12575.  
  12576. Author's Address
  12577.  
  12578.     John Moy
  12579.     Cascade Communications Corp.
  12580.     5 Carlisle Road
  12581.     Westford, MA 01886
  12582.  
  12583.     Phone: 508-952-1367
  12584.     Fax:   508-692-9214
  12585.     Email: jmoy@casc.com
  12586.  
  12587.     This document expires in July 1997.
  12588.  
  12589.  
  12590.  
  12591.  
  12592.  
  12593.  
  12594.  
  12595.  
  12596.  
  12597.  
  12598.  
  12599.  
  12600. Moy                                  [Page 225]
  12601.  
  12602.