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-10.txt < prev    next >
Text File  |  1997-02-05  |  467KB  |  12,658 lines

  1.  
  2.  
  3.  
  4.  
  5. Network    Working    Group                          J. Moy
  6. Internet Draft                    Cascade Communications Corp.
  7. Expiration Date: August    1997                   February 1997
  8. File name: draft-ietf-ospf-version2-10.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           February 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           February 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 ..................................... 25
  133.     3         Splitting the AS into Areas ........................... 25
  134.     3.1         The backbone of the Autonomous System ................. 26
  135.     3.2         Inter-area    routing    .................................... 27
  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 ..................... 42
  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    ............................ 53
  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           February 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 .............................................. 107
  193.     12.1.4   Link State    ID ........................................ 108
  194.     12.1.5   Advertising Router    ................................... 109
  195.     12.1.6   LS    sequence number    ................................... 109
  196.     12.1.7   LS    checksum .......................................... 110
  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 ................. 118
  202.     12.4.1.2 Describing    broadcast and NBMA interfaces ............. 119
  203.     12.4.1.3 Describing    virtual    links ............................. 119
  204.     12.4.1.4 Describing    Point-to-MultiPoint interfaces ............ 120
  205.     12.4.1.5 Examples of router-LSAs .............................. 120
  206.     12.4.2   Network-LSAs ......................................... 122
  207.     12.4.2.1 Examples of network-LSAs ............................. 123
  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 ............................. 127
  211.     12.4.4   AS-external-LSAs ..................................... 128
  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 ....................... 134
  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 ............ 139
  219.     13.6     Retransmitting LSAs .................................. 141
  220.     13.7     Receiving link state acknowledgments ................. 142
  221.  
  222.  
  223.  
  224. Moy                                [Page 4]
  225.  
  226. Internet Draft             OSPF Version 2           February 1997
  227.  
  228.  
  229.     14         Aging The Link State Database ........................ 142
  230.     14.1     Premature aging of    LSAs .............................. 143
  231.     15         Virtual Links ........................................ 144
  232.     16         Calculation of the    routing    table ..................... 146
  233.     16.1     Calculating the shortest-path tree    for an area ....... 147
  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 ................ 155
  237.     16.4     Calculating AS external routes ....................... 157
  238.     16.4.1   External path preferences ............................ 159
  239.     16.5     Incremental updates -- summary-LSAs .................. 160
  240.     16.6     Incremental updates -- AS-external-LSAs .............. 161
  241.     16.7     Events generated as a result of routing table changes  161
  242.     16.8     Equal-cost    multipath ................................. 162
  243.     16.9     Building the non-zero-TOS portion of the routing table 162
  244.          Footnotes ............................................ 165
  245.          References    ........................................... 169
  246.     A         OSPF data formats .................................... 171
  247.     A.1         Encapsulation of OSPF packets ........................ 171
  248.     A.2         The Options field .................................... 173
  249.     A.3         OSPF Packet Formats .................................. 175
  250.     A.3.1    The OSPF packet header ............................... 176
  251.     A.3.2    The Hello packet ..................................... 178
  252.     A.3.3    The Database Description packet ...................... 180
  253.     A.3.4    The Link State Request packet ........................ 182
  254.     A.3.5    The Link State Update packet ......................... 184
  255.     A.3.6    The Link State Acknowledgment packet ................. 186
  256.     A.4         LSA formats .......................................... 188
  257.     A.4.1    The LSA header ....................................... 189
  258.     A.4.2    Router-LSAs .......................................... 191
  259.     A.4.3    Network-LSAs ......................................... 195
  260.     A.4.4    Summary-LSAs ......................................... 196
  261.     A.4.5    AS-external-LSAs ..................................... 198
  262.     B         Architectural Constants .............................. 200
  263.     C         Configurable Constants ............................... 202
  264.     C.1         Global parameters .................................... 202
  265.     C.2         Area parameters ...................................... 203
  266.     C.3         Router interface parameters .......................... 204
  267.     C.4         Virtual link parameters .............................. 206
  268.     C.5         NBMA network parameters .............................. 207
  269.     C.6         Point-to-MultiPoint network parameters ............... 208
  270.     C.7         Host route    parameters ................................ 208
  271.     D         Authentication ....................................... 209
  272.     D.1         Null authentication .................................. 209
  273.     D.2         Simple password authentication ....................... 209
  274.     D.3         Cryptographic authentication ......................... 210
  275.     D.4         Message generation    ................................... 212
  276.     D.4.1    Generating    Null authentication ....................... 213
  277.  
  278.  
  279.  
  280. Moy                                [Page 5]
  281.  
  282. Internet Draft             OSPF Version 2           February 1997
  283.  
  284.  
  285.     D.4.2    Generating    Simple password    authentication ............ 213
  286.     D.4.3    Generating    Cryptographic authentication .............. 213
  287.     D.5         Message verification ................................. 215
  288.     D.5.1    Verifying Null authentication ........................ 215
  289.     D.5.2    Verifying Simple password authentication ............. 215
  290.     D.5.3    Verifying Cryptographic authentication ............... 215
  291.     E         An    algorithm for assigning    Link State IDs ............ 217
  292.     F         Multiple interfaces to the    same network/subnet ....... 219
  293.     G         Differences from RFC 1583 ............................ 220
  294.     G.1         Enhancements to OSPF authentication .................. 220
  295.     G.2         Addition of Point-to-MultiPoint interface ............ 220
  296.     G.3         Support for overlapping area ranges .................. 221
  297.     G.4         A modification to the flooding algorithm ............. 222
  298.     G.5         Introduction of the MinLSArrival constant ............ 222
  299.     G.6         Optionally    advertising point-to-point links as subnets 223
  300.     G.7         Advertising same external route from multiple areas .. 223
  301.     G.8         Retransmission of initial Database    Description packets 225
  302.     G.9         Detecting interface MTU mismatches    ................... 225
  303.          Security Considerations .............................. 226
  304.          Author's Address ..................................... 226
  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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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.            H1         RT10         21
  1196.            __________________________________
  1197.            RT5         RT5         6
  1198.            RT7         RT10         8
  1199.  
  1200.  
  1201.     Table 2: The portion of Router RT6's routing table listing local
  1202.                  destinations.
  1203.  
  1204.     Routes to networks belonging to    other AS'es (such as N12) appear
  1205.     as dashed lines    on the shortest    path tree in Figure 5.    Use of
  1206.     this externally    derived    routing    information is considered in the
  1207.     next section.
  1208.  
  1209.  
  1210.     2.3.  Use of external routing information
  1211.  
  1212.     After the tree is created the external routing information is
  1213.     examined.  This    external routing information may originate from
  1214.     another    routing    protocol such as BGP, or be statically
  1215.     configured (static routes).  Default routes can    also be    included
  1216.     as part    of the Autonomous System's external routing information.
  1217.  
  1218.     External routing information is    flooded    unaltered throughout the
  1219.     AS.  In    our example, all the routers in    the Autonomous System
  1220.     know that Router RT7 has two external routes, with metrics 2 and
  1221.     9.
  1222.  
  1223.     OSPF supports two types    of external metrics.  Type 1 external
  1224.     metrics    are expressed in the same units    as OSPF    interface cost
  1225.     (i.e., in terms    of the link state metric).  Type 2 external
  1226.     metrics    are an order of    magnitude larger; any Type 2 metric is
  1227.     considered greater than    the cost of any    path internal to the AS.
  1228.     Use of Type 2 external metrics assumes that routing between
  1229.  
  1230.  
  1231.  
  1232. Moy                                   [Page 22]
  1233.  
  1234. Internet Draft             OSPF Version 2           February 1997
  1235.  
  1236.  
  1237.     AS'es is the major cost    of routing a packet, and eliminates the
  1238.     need for conversion of external    costs to internal link state
  1239.     metrics.
  1240.  
  1241.     As an example of Type 1    external metric    processing, suppose that
  1242.     the Routers RT7    and RT5    in Figure 2 are    advertising Type 1
  1243.     external metrics.  For each advertised external    route, the total
  1244.     cost from Router RT6 is    calculated as the sum of the external
  1245.     route's    advertised cost    and the    distance from Router RT6 to the
  1246.     advertising router.  When two routers are advertising the same
  1247.     external destination, RT6 picks    the advertising    router providing
  1248.     the minimum total cost.    RT6 then sets the next hop to the
  1249.     external destination equal to the next hop that    would be used
  1250.     when routing packets to    the chosen advertising router.
  1251.  
  1252.     In Figure 2, both Router RT5 and RT7 are advertising an    external
  1253.     route to destination Network N12.  Router RT7 is preferred since
  1254.     it is advertising N12 at a distance of 10 (8+2)    to Router RT6,
  1255.     which is better    than Router RT5's 14 (6+8).  Table 3 shows the
  1256.     entries    that are added to the routing table when external routes
  1257.     are examined:
  1258.  
  1259.  
  1260.  
  1261.              Destination   Next  Hop   Distance
  1262.              __________________________________
  1263.              N12           RT10       10
  1264.              N13           RT5       14
  1265.              N14           RT5       14
  1266.              N15           RT10       17
  1267.  
  1268.  
  1269.          Table 3: The portion of Router    RT6's routing table
  1270.                listing external destinations.
  1271.  
  1272.  
  1273.     Processing of Type 2 external metrics is simpler.  The AS
  1274.     boundary router    advertising the    smallest external metric is
  1275.     chosen,    regardless of the internal distance to the AS boundary
  1276.     router.     Suppose in our    example    both Router RT5    and Router RT7
  1277.     were advertising Type 2    external routes.  Then all traffic
  1278.     destined for Network N12 would be forwarded to Router RT7, since
  1279.     2 < 8.    When several equal-cost    Type 2 routes exist, the
  1280.     internal distance to the advertising routers is    used to    break
  1281.     the tie.
  1282.  
  1283.     Both Type 1 and    Type 2 external    metrics    can be present in the AS
  1284.     at the same time.  In that event, Type 1 external metrics always
  1285.  
  1286.  
  1287.  
  1288. Moy                                   [Page 23]
  1289.  
  1290. Internet Draft             OSPF Version 2           February 1997
  1291.  
  1292.  
  1293.     take precedence.
  1294.  
  1295.     This section has assumed that packets destined for external
  1296.     destinations are always    routed through the advertising AS
  1297.     boundary router.  This is not always desirable.     For example,
  1298.     suppose    in Figure 2 there is an    additional router attached to
  1299.     Network    N6, called Router RTX.    Suppose    further    that RTX does
  1300.     not participate    in OSPF    routing, but does exchange BGP
  1301.     information with the AS    boundary router    RT7.  Then, Router RT7
  1302.     would end up advertising OSPF external routes for all
  1303.     destinations that should be routed to RTX.  An extra hop will
  1304.     sometimes be introduced    if packets for these destinations need
  1305.     always be routed first to Router RT7 (the advertising router).
  1306.  
  1307.     To deal    with this situation, the OSPF protocol allows an AS
  1308.     boundary router    to specify a "forwarding address" in its AS-
  1309.     external-LSAs.    In the above example, Router RT7 would specify
  1310.     RTX's IP address as the    "forwarding address" for all those
  1311.     destinations whose packets should be routed directly to    RTX.
  1312.  
  1313.     The "forwarding    address" has one other application.  It    enables
  1314.     routers    in the Autonomous System's interior to function    as
  1315.     "route servers".  For example, in Figure 2 the router RT6 could
  1316.     become a route server, gaining external    routing    information
  1317.     through    a combination of static    configuration and external
  1318.     routing    protocols.  RT6    would then start advertising itself as
  1319.     an AS boundary router, and would originate a collection    of OSPF
  1320.     AS-external-LSAs.  In each AS-external-LSA, Router RT6 would
  1321.     specify    the correct Autonomous System exit point to use    for the
  1322.     destination through appropriate    setting    of the LSA's "forwarding
  1323.     address" field.
  1324.  
  1325.  
  1326.     2.4.  Equal-cost multipath
  1327.  
  1328.     The above discussion has been simplified by considering    only a
  1329.     single route to    any destination.  In reality, if multiple
  1330.     equal-cost routes to a destination exist, they are all
  1331.     discovered and used.  This requires no conceptual changes to the
  1332.     algorithm, and its discussion is postponed until we consider the
  1333.     tree-building process in more detail.
  1334.  
  1335.     With equal cost    multipath, a router potentially    has several
  1336.     available next hops towards any    given destination.
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344. Moy                                   [Page 24]
  1345.  
  1346. Internet Draft             OSPF Version 2           February 1997
  1347.  
  1348.  
  1349.     2.5.  TOS-based routing
  1350.  
  1351.     OSPF can calculate a separate set of routes for    each IP    Type of
  1352.     Service. This means that, for any destination, there can
  1353.     potentially be multiple    routing    table entries, one for each IP
  1354.     TOS. The IP TOS    values are represented in OSPF exactly as they
  1355.     appear in the IP packet    header.
  1356.  
  1357.     Up to this point, all examples shown have assumed that routes do
  1358.     not vary on TOS.  In order to differentiate routes based on TOS,
  1359.     separate interface costs can be    configured for each TOS.  For
  1360.     example, in Figure 2 there could be multiple costs (one    for each
  1361.     TOS) listed for    each interface.     A cost    for TOS    0 must always be
  1362.     specified.
  1363.  
  1364.     When interface costs vary based    on TOS,    a separate shortest path
  1365.     tree is    calculated for each TOS    (see Section 2.2).  In addition,
  1366.     external costs can vary    based on TOS.  For example, in Figure 2
  1367.     Router RT7 could advertise a separate type 1 external metric for
  1368.     each TOS.  Then, when calculating the TOS X distance to    Network
  1369.     N15 the    cost of    the shortest TOS X path    to RT7 would be    added to
  1370.     the TOS    X cost advertised by RT7 for Network N15 (see Section
  1371.     2.3).
  1372.  
  1373.     All OSPF implementations must be capable of calculating    routes
  1374.     based on TOS.  However,    OSPF routers can be configured to route
  1375.     all packets on the TOS 0 path (see Appendix C),    eliminating the
  1376.     need to    calculate non-zero TOS paths.  This can    be used    to
  1377.     conserve routing table space and processing resources in the
  1378.     router.     These TOS-0-only routers can be mixed with routers that
  1379.     do route based on TOS.    TOS-0-only routers will    be avoided as
  1380.     much as    possible when forwarding traffic requesting a non-zero
  1381.     TOS.
  1382.  
  1383.     It may be the case that    no path    exists for some    non-zero TOS,
  1384.     even if    the router is calculating non-zero TOS paths.  In that
  1385.     case, packets requesting that non-zero TOS are routed along the
  1386.     TOS 0 path (see    Section    11.1).
  1387.  
  1388.  
  1389. 3.  Splitting the AS into Areas
  1390.  
  1391.     OSPF allows    collections of contiguous networks and hosts to    be
  1392.     grouped together.  Such a group, together with the routers having
  1393.     interfaces to any one of the included networks, is called an area.
  1394.     Each area runs a separate copy of the basic    link-state routing
  1395.     algorithm.    This means that    each area has its own link-state
  1396.     database and corresponding graph, as explained in the previous
  1397.  
  1398.  
  1399.  
  1400. Moy                                   [Page 25]
  1401.  
  1402. Internet Draft             OSPF Version 2           February 1997
  1403.  
  1404.  
  1405.     section.
  1406.  
  1407.     The    topology of an area is invisible from the outside of the area.
  1408.     Conversely,    routers    internal to a given area know nothing of the
  1409.     detailed topology external to the area.  This isolation of knowledge
  1410.     enables the    protocol to effect a marked reduction in routing traffic
  1411.     as compared    to treating the    entire Autonomous System as a single
  1412.     link-state domain.
  1413.  
  1414.     With the introduction of areas, it is no longer true that all
  1415.     routers in the AS have an identical    link-state database.  A    router
  1416.     actually has a separate link-state database    for each area it is
  1417.     connected to.  (Routers connected to multiple areas    are called area
  1418.     border routers).  Two routers belonging to the same    area have, for
  1419.     that area, identical area link-state databases.
  1420.  
  1421.     Routing in the Autonomous System takes place on two    levels,
  1422.     depending on whether the source and    destination of a packet    reside
  1423.     in the same    area (intra-area routing is used) or different areas
  1424.     (inter-area    routing    is used).  In intra-area routing, the packet is
  1425.     routed solely on information obtained within the area; no routing
  1426.     information    obtained from outside the area can be used.  This
  1427.     protects intra-area    routing    from the injection of bad routing
  1428.     information.  We discuss inter-area    routing    in Section 3.2.
  1429.  
  1430.  
  1431.     3.1.  The backbone of the Autonomous System
  1432.  
  1433.     The OSPF backbone is the special OSPF Area 0 (often written as
  1434.     Area 0.0.0.0, since OSPF Area ID's are typically formatted as IP
  1435.     addresses). The    OSPF backbone always contains all area border
  1436.     routers. The backbone is responsible for distributing routing
  1437.     information between non-backbone areas.    The backbone must be
  1438.     contiguous. However, it    need not be physically contiguous;
  1439.     backbone connectivity can be established/maintained through the
  1440.     configuration of virtual links.
  1441.  
  1442.     Virtual    links can be configured    between    any two    backbone routers
  1443.     that have an interface to a common non-backbone    area.  Virtual
  1444.     links belong to    the backbone.  The protocol treats two routers
  1445.     joined by a virtual link as if they were connected by an
  1446.     unnumbered point-to-point backbone network.  On    the graph of the
  1447.     backbone, two such routers are joined by arcs whose costs are
  1448.     the intra-area distances between the two routers.  The routing
  1449.     protocol traffic that flows along the virtual link uses    intra-
  1450.     area routing only.
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. Moy                                   [Page 26]
  1457.  
  1458. Internet Draft             OSPF Version 2           February 1997
  1459.  
  1460.  
  1461.     3.2.  Inter-area routing
  1462.  
  1463.     When routing a packet between two non-backbone areas the
  1464.     backbone is used.  The path that the packet will travel    can be
  1465.     broken up into three contiguous    pieces:    an intra-area path from
  1466.     the source to an area border router, a backbone    path between the
  1467.     source and destination areas, and then another intra-area path
  1468.     to the destination.  The algorithm finds the set of such paths
  1469.     that have the smallest cost.
  1470.  
  1471.     Looking    at this    another    way, inter-area    routing    can be pictured
  1472.     as forcing a star configuration    on the Autonomous System, with
  1473.     the backbone as    hub and    each of    the non-backbone areas as
  1474.     spokes.
  1475.  
  1476.     The topology of    the backbone dictates the backbone paths used
  1477.     between    areas.    The topology of    the backbone can be enhanced by
  1478.     adding virtual links.  This gives the system administrator some
  1479.     control    over the routes    taken by inter-area traffic.
  1480.  
  1481.     The correct area border    router to use as the packet exits the
  1482.     source area is chosen in exactly the same way routers
  1483.     advertising external routes are    chosen.     Each area border router
  1484.     in an area summarizes for the area its cost to all networks
  1485.     external to the    area.  After the SPF tree is calculated    for the
  1486.     area, routes to    all inter-area destinations are    calculated by
  1487.     examining the summaries    of the area border routers.
  1488.  
  1489.  
  1490.     3.3.  Classification of routers
  1491.  
  1492.     Before the introduction    of areas, the only OSPF    routers    having a
  1493.     specialized function were those    advertising external routing
  1494.     information, such as Router RT5    in Figure 2.  When the AS is
  1495.     split into OSPF    areas, the routers are further divided according
  1496.     to function into the following four overlapping    categories:
  1497.  
  1498.  
  1499.     Internal routers
  1500.         A router with all directly connected networks belonging to
  1501.         the    same area. These routers run a single copy of the basic
  1502.         routing algorithm.
  1503.  
  1504.     Area border routers
  1505.         A router that attaches to multiple areas.  Area border
  1506.         routers run    multiple copies    of the basic algorithm,    one copy
  1507.         for    each attached area. Area border    routers    condense the
  1508.         topological    information of their attached areas for
  1509.  
  1510.  
  1511.  
  1512. Moy                                   [Page 27]
  1513.  
  1514. Internet Draft             OSPF Version 2           February 1997
  1515.  
  1516.  
  1517.         distribution to the    backbone.  The backbone    in turn
  1518.         distributes    the information    to the other areas.
  1519.  
  1520.     Backbone routers
  1521.         A router that has an interface to the backbone area.  This
  1522.         includes all routers that interface    to more    than one area
  1523.         (i.e., area    border routers).  However, backbone routers do
  1524.         not    have to    be area    border routers.     Routers with all
  1525.         interfaces connecting to the backbone area are supported.
  1526.  
  1527.     AS boundary routers
  1528.         A router that exchanges routing information    with routers
  1529.         belonging to other Autonomous Systems.  Such a router
  1530.         advertises AS external routing information throughout the
  1531.         Autonomous System.    The paths to each AS boundary router are
  1532.         known by every router in the AS.  This classification is
  1533.         completely independent of the previous classifications: AS
  1534.         boundary routers may be internal or    area border routers, and
  1535.         may    or may not participate in the backbone.
  1536.  
  1537.  
  1538.     3.4.  A sample area    configuration
  1539.  
  1540.     Figure 6 shows a sample    area configuration.  The first area
  1541.     consists of networks N1-N4, along with their attached routers
  1542.     RT1-RT4.  The second area consists of networks N6-N8, along with
  1543.     their attached routers RT7, RT8, RT10 and RT11.     The third area
  1544.     consists of networks N9-N11 and    Host H1, along with their
  1545.     attached routers RT9, RT11 and RT12.  The third    area has been
  1546.     configured so that networks N9-N11 and Host H1 will all    be
  1547.     grouped    into a single route, when advertised external to the
  1548.     area (see Section 3.5 for more details).
  1549.  
  1550.     In Figure 6, Routers RT1, RT2, RT5, RT6, RT8, RT9 and RT12 are
  1551.     internal routers.  Routers RT3,    RT4, RT7, RT10 and RT11    are area
  1552.     border routers.     Finally, as before, Routers RT5 and RT7 are AS
  1553.     boundary routers.
  1554.  
  1555.     Figure 7 shows the resulting link-state    database for the Area 1.
  1556.     The figure completely describes    that area's intra-area routing.
  1557.     It also    shows the complete view    of the internet    for the    two
  1558.     internal routers RT1 and RT2.  It is the job of    the area border
  1559.     routers, RT3 and RT4, to advertise into    Area 1 the distances to
  1560.     all destinations external to the area.    These are indicated in
  1561.     Figure 7 by the    dashed stub routes.  Also, RT3 and RT4 must
  1562.     advertise into Area 1 the location of the AS boundary routers
  1563.     RT5 and    RT7.  Finally, AS-external-LSAs    from RT5 and RT7 are
  1564.     flooded    throughout the entire AS, and in particular throughout
  1565.  
  1566.  
  1567.  
  1568. Moy                                   [Page 28]
  1569.  
  1570. Internet Draft             OSPF Version 2           February 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           February 1997
  1627.  
  1628.  
  1629.     Area 1.     These LSAs are    included in Area 1's database, and yield
  1630.     routes to Networks N12-N15.
  1631.  
  1632.     Routers    RT3 and    RT4 must also summarize    Area 1's topology for
  1633.     distribution to    the backbone.  Their backbone LSAs are shown in
  1634.     Table 4.  These    summaries show which networks are contained in
  1635.     Area 1 (i.e., Networks N1-N4), and the distance    to these
  1636.     networks from the routers RT3 and RT4 respectively.
  1637.  
  1638.  
  1639.     The link-state database    for the    backbone is shown in Figure 8.
  1640.     The set    of routers pictured are    the backbone routers.  Router
  1641.     RT11 is    a backbone router because it belongs to    two areas.  In
  1642.     order to make the backbone connected, a    virtual    link has been
  1643.     configured between Routers R10 and R11.
  1644.  
  1645.     The area border    routers    RT3, RT4, RT7, RT10 and    RT11 condense
  1646.     the routing information    of their attached non-backbone areas for
  1647.     distribution via the backbone; these are the dashed stubs that
  1648.     appear in Figure 8.  Remember that the third area has been
  1649.     configured to condense Networks    N9-N11 and Host    H1 into    a single
  1650.     route.    This yields a single dashed line for networks N9-N11 and
  1651.     Host H1    in Figure 8.  Routers RT5 and RT7 are AS boundary
  1652.     routers; their externally derived information also appears on
  1653.     the graph in Figure 8 as stubs.
  1654.  
  1655.     The backbone enables the exchange of summary information between
  1656.     area border routers.  Every area border    router hears the area
  1657.     summaries from all other area border routers.  It then forms a
  1658.     picture    of the distance    to all networks    outside    of its area by
  1659.     examining the collected    LSAs, and adding in the    backbone
  1660.     distance to each advertising router.
  1661.  
  1662.     Again using Routers RT3    and RT4    as an example, the procedure
  1663.     goes as    follows: They first calculate the SPF tree for the
  1664.  
  1665.  
  1666.              Network   RT3 adv.      RT4 adv.
  1667.              _____________________________
  1668.              N1           4      4
  1669.              N2           4      4
  1670.              N3           1      1
  1671.              N4           2      3
  1672.  
  1673.           Table 4: Networks    advertised to the backbone
  1674.             by Routers RT3 and RT4.
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680. Moy                                   [Page 30]
  1681.  
  1682. Internet Draft             OSPF Version 2           February 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           February 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.     backbone.  This    gives the distances to all other area border
  1777.     routers.  Also noted are the distances to networks (Ia and Ib)
  1778.     and AS boundary    routers    (RT5 and RT7) that belong to the
  1779.     backbone.  This    calculation is shown in    Table 5.
  1780.  
  1781.  
  1782.     Next, by looking at the    area summaries from these area border
  1783.     routers, RT3 and RT4 can determine the distance    to all networks
  1784.     outside    their area.  These distances are then advertised
  1785.     internally to the area by RT3 and RT4.    The advertisements that
  1786.     Router RT3 and RT4 will    make into Area 1 are shown in Table 6.
  1787.     Note that Table    6 assumes that an area range has been configured
  1788.     for the    backbone which groups Ia and Ib    into a single LSA.
  1789.  
  1790.  
  1791.  
  1792. Moy                                   [Page 32]
  1793.  
  1794. Internet Draft             OSPF Version 2           February 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.            to  RT11   18       25
  1807.            __________________________________
  1808.            to  Ia     20       27
  1809.            to  Ib     15       22
  1810.            __________________________________
  1811.            to  RT5    14       8
  1812.            to  RT7    20       14
  1813.  
  1814.          Table 5: Backbone distances calculated
  1815.             by Routers RT3 and RT4.
  1816.  
  1817.     The information    imported into Area 1 by    Routers    RT3 and    RT4
  1818.     enables    an internal router, such as RT1, to choose an area
  1819.     border router intelligently.  Router RT1 would use RT4 for
  1820.     traffic    to Network N6, RT3 for traffic to Network N10, and would
  1821.     load share between the two for traffic to Network N8.
  1822.  
  1823.     Router RT1 can also determine in this manner the shortest path
  1824.     to the AS boundary routers RT5 and RT7.     Then, by looking at RT5
  1825.     and RT7's AS-external-LSAs, Router RT1 can decide between RT5 or
  1826.     RT7 when sending to a destination in another Autonomous    System
  1827.     (one of    the networks N12-N15).
  1828.  
  1829.  
  1830.            Destination     RT3 adv.   RT4    adv.
  1831.            _________________________________
  1832.            Ia,Ib     20        27
  1833.            N6         16        15
  1834.            N7         20        19
  1835.            N8         18        18
  1836.            N9-N11,H1     29        36
  1837.            _________________________________
  1838.            RT5         14        8
  1839.            RT7         20        14
  1840.  
  1841.           Table 6: Destinations advertised into Area 1
  1842.             by Routers RT3 and RT4.
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. Moy                                   [Page 33]
  1849.  
  1850. Internet Draft             OSPF Version 2           February 1997
  1851.  
  1852.  
  1853.     Note that a failure of the line    between    Routers    RT6 and    RT10
  1854.     will cause the backbone    to become disconnected.     Configuring a
  1855.     virtual    link between Routers RT7 and RT10 will give the    backbone
  1856.     more connectivity and more resistance to such failures.
  1857.  
  1858.  
  1859.     3.5.  IP subnetting    support
  1860.  
  1861.     OSPF attaches an IP address mask to each advertised route.  The
  1862.     mask indicates the range of addresses being described by the
  1863.     particular route.  For example,    a summary-LSA for the
  1864.     destination 128.185.0.0    with a mask of 0xffff0000 actually is
  1865.     describing a single route to the collection of destinations
  1866.     128.185.0.0 - 128.185.255.255.    Similarly, host    routes are
  1867.     always advertised with a mask of 0xffffffff, indicating    the
  1868.     presence of only a single destination.
  1869.  
  1870.     Including the mask with    each advertised    destination enables the
  1871.     implementation of what is commonly referred to as variable-
  1872.     length subnetting.  This means that a single IP    class A, B, or C
  1873.     network    number can be broken up    into many subnets of various
  1874.     sizes.    For example, the network 128.185.0.0 could be broken up
  1875.     into 62    variable-sized subnets:    15 subnets of size 4K, 15
  1876.     subnets    of size    256, and 32 subnets of size 8.    Table 7    shows
  1877.     some of    the resulting network addresses    together with their
  1878.     masks.
  1879.  
  1880.  
  1881.  
  1882.           Network address   IP address mask   Subnet size
  1883.           _______________________________________________
  1884.           128.185.16.0        0xfffff000          4K
  1885.           128.185.1.0        0xffffff00          256
  1886.           128.185.0.8        0xfffffff8          8
  1887.  
  1888.  
  1889.              Table 7: Some sample subnet sizes.
  1890.  
  1891.  
  1892.     There are many possible    ways of    dividing up a class A, B, and C
  1893.     network    into variable sized subnets.  The precise procedure for
  1894.     doing so is beyond the scope of    this specification.  This
  1895.     specification however establishes the following    guideline: When
  1896.     an IP packet is    forwarded, it is always    forwarded to the network
  1897.     that is    the best match for the packet's    destination.  Here best
  1898.     match is synonymous with the longest or    most specific match.
  1899.     For example, the default route with destination    of 0.0.0.0 and
  1900.     mask 0x00000000    is always a match for every IP destination.  Yet
  1901.  
  1902.  
  1903.  
  1904. Moy                                   [Page 34]
  1905.  
  1906. Internet Draft             OSPF Version 2           February 1997
  1907.  
  1908.  
  1909.     it is always less specific than    any other match.  Subnet masks
  1910.     must be    assigned so that the best match    for any    IP destination
  1911.     is unambiguous.
  1912.  
  1913.     Attaching an address mask to each route    also enables the support
  1914.     of IP supernetting. For    example, a single physical network
  1915.     segment    could be assigned the [address,mask] pair
  1916.     [192.9.4.0,0xfffffc00].    The segment would then be single IP
  1917.     network, containing addresses from the four consecutive    class C
  1918.     network    numbers    192.9.4.0 through 192.9.7.0. Such addressing is
  1919.     now becoming commonplace with the advent of CIDR (see [Ref10]).
  1920.  
  1921.     In order to get    better aggregation at area boundaries, area
  1922.     address    ranges can be employed (see Section C.2    for more
  1923.     details).  Each    address    range is defined as an [address,mask]
  1924.     pair.  Many separate networks may then be contained in a single
  1925.     address    range, just as a subnetted network is composed of many
  1926.     separate subnets.  Area    border routers then summarize the area
  1927.     contents (for distribution to the backbone) by advertising a
  1928.     single route for each address range.  The cost of the route is
  1929.     the maximum cost to any    of the networks    falling    in the specified
  1930.     range.
  1931.  
  1932.     For example, an    IP subnetted network might be configured as a
  1933.     single OSPF area.  In that case, a single address range    could be
  1934.     configured:  a class A,    B, or C    network    number along with its
  1935.     natural    IP mask.  Inside the area, any number of variable sized
  1936.     subnets    could be defined.  However, external to    the area a
  1937.     single route for the entire subnetted network would be
  1938.     distributed, hiding even the fact that the network is subnetted
  1939.     at all.     The cost of this route    is the maximum of the set of
  1940.     costs to the component subnets.
  1941.  
  1942.  
  1943.     3.6.  Supporting stub areas
  1944.  
  1945.     In some    Autonomous Systems, the    majority of the    link-state
  1946.     database may consist of    AS-external-LSAs.  An OSPF AS-external-
  1947.     LSA is usually flooded throughout the entire AS.  However, OSPF
  1948.     allows certain areas to    be configured as "stub areas".    AS-
  1949.     external-LSAs are not flooded into/throughout stub areas;
  1950.     routing    to AS external destinations in these areas is based on a
  1951.     (per-area) default only.  This reduces the link-state database
  1952.     size, and therefore the    memory requirements, for a stub    area's
  1953.     internal routers.
  1954.  
  1955.     In order to take advantage of the OSPF stub area support,
  1956.     default    routing    must be    used in    the stub area.    This is
  1957.  
  1958.  
  1959.  
  1960. Moy                                   [Page 35]
  1961.  
  1962. Internet Draft             OSPF Version 2           February 1997
  1963.  
  1964.  
  1965.     accomplished as    follows.  One or more of the stub area's area
  1966.     border routers must advertise a    default    route into the stub area
  1967.     via summary-LSAs.  These summary defaults are flooded throughout
  1968.     the stub area, but no further.    (For this reason these defaults
  1969.     pertain    only to    the particular stub area).  These summary
  1970.     default    routes will be used for    any destination    that is    not
  1971.     explicitly reachable by    an intra-area or inter-area path (i.e.,
  1972.     AS external destinations).
  1973.  
  1974.     An area    can be configured as a stub when there is a single exit
  1975.     point from the area, or    when the choice    of exit    point need not
  1976.     be made    on a per-external-destination basis.  For example, Area
  1977.     3 in Figure 6 could be configured as a stub area, because all
  1978.     external traffic must travel though its    single area border
  1979.     router RT11.  If Area 3    were configured    as a stub, Router RT11
  1980.     would advertise    a default route    for distribution inside    Area 3
  1981.     (in a summary-LSA), instead of flooding    the AS-external-LSAs for
  1982.     Networks N12-N15 into/throughout the area.
  1983.  
  1984.     The OSPF protocol ensures that all routers belonging to    an area
  1985.     agree on whether the area has been configured as a stub.  This
  1986.     guarantees that    no confusion will arise    in the flooding    of AS-
  1987.     external-LSAs.
  1988.  
  1989.     There are a couple of restrictions on the use of stub areas.
  1990.     Virtual    links cannot be    configured through stub    areas.    In
  1991.     addition, AS boundary routers cannot be    placed internal    to stub
  1992.     areas.
  1993.  
  1994.  
  1995.     3.7.  Partitions of    areas
  1996.  
  1997.     OSPF does not actively attempt to repair area partitions.  When
  1998.     an area    becomes    partitioned, each component simply becomes a
  1999.     separate area.    The backbone then performs routing between the
  2000.     new areas.  Some destinations reachable    via intra-area routing
  2001.     before the partition will now require inter-area routing.
  2002.  
  2003.     However, in order to maintain full routing after the partition,
  2004.     an address range must not be split across multiple components of
  2005.     the area partition. Also, the backbone itself must not
  2006.     partition.  If it does,    parts of the Autonomous    System will
  2007.     become unreachable.  Backbone partitions can be    repaired by
  2008.     configuring virtual links (see Section 15).
  2009.  
  2010.     Another    way to think about area    partitions is to look at the
  2011.     Autonomous System graph    that was introduced in Section 2.  Area
  2012.     IDs can    be viewed as colors for    the graph's edges.[1] Each edge
  2013.  
  2014.  
  2015.  
  2016. Moy                                   [Page 36]
  2017.  
  2018. Internet Draft             OSPF Version 2           February 1997
  2019.  
  2020.  
  2021.     of the graph connects to a network, or is itself a point-to-
  2022.     point network.    In either case,    the edge is colored with the
  2023.     network's Area ID.
  2024.  
  2025.     A group    of edges, all having the same color, and interconnected
  2026.     by vertices, represents    an area.  If the topology of the
  2027.     Autonomous System is intact, the graph will have several regions
  2028.     of color, each color being a distinct Area ID.
  2029.  
  2030.     When the AS topology changes, one of the areas may become
  2031.     partitioned.  The graph    of the AS will then have multiple
  2032.     regions    of the same color (Area    ID).  The routing in the
  2033.     Autonomous System will continue    to function as long as these
  2034.     regions    of same    color are connected by the single backbone
  2035.     region.
  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           February 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           February 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           February 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           February 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.                   single area only.
  2256.     ________________________________________________________
  2257.     2      Network-LSAs      Originated for broadcast
  2258.                   and NBMA networks by
  2259.                   the Designated Router. This
  2260.                   LSA contains the
  2261.                   list of routers connected
  2262.                   to the network. Flooded
  2263.                   throughout a single area only.
  2264.     ________________________________________________________
  2265.     3,4    Summary-LSAs      Originated by    area border
  2266.                   routers, and flooded through-
  2267.                   out the LSA's    associated
  2268.                   area.    Each summary-LSA
  2269.                   describes a route to a
  2270.                   destination outside the area,
  2271.                   yet still inside the AS
  2272.                   (i.e., an inter-area route).
  2273.                   Type 3 summary-LSAs describe
  2274.                   routes to networks. Type 4
  2275.                   summary-LSAs describe
  2276.                   routes to AS boundary    routers.
  2277.     ________________________________________________________
  2278.     5      AS-external-LSAs      Originated by    AS boundary
  2279.                   routers, and flooded through-
  2280.                   out the AS. Each
  2281.                   AS-external-LSA describes
  2282.                   a route to a destination in
  2283.                   another Autonomous System.
  2284.                   Default routes for the AS can
  2285.                   also be described by
  2286.                   AS-external-LSAs.
  2287.  
  2288.  
  2289.         Table 9: OSPF link state advertisements (LSAs).
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296. Moy                                   [Page 41]
  2297.  
  2298. Internet Draft             OSPF Version 2           February 1997
  2299.  
  2300.  
  2301.     4.4.  Basic    implementation requirements
  2302.  
  2303.     An implementation of OSPF requires the following pieces    of
  2304.     system support:
  2305.  
  2306.  
  2307.     Timers
  2308.         Two    different kind of timers are required.    The first kind,
  2309.         called "single shot    timers", fire once and cause a protocol
  2310.         event to be    processed.  The    second kind, called "interval
  2311.         timers", fire at continuous    intervals.  These are used for
  2312.         the    sending    of packets at regular intervals.  A good example
  2313.         of this is the regular broadcast of    Hello packets. The
  2314.         granularity    of both    kinds of timers    is one second.
  2315.  
  2316.         Interval timers should be implemented to avoid drift.  In
  2317.         some router    implementations, packet    processing can affect
  2318.         timer execution.  When multiple routers are    attached to a
  2319.         single network, all    doing broadcasts, this can lead    to the
  2320.         synchronization of routing packets (which should be
  2321.         avoided).  If timers cannot    be implemented to avoid    drift,
  2322.         small random amounts should    be added to/subtracted from the
  2323.         interval timer at each firing.
  2324.  
  2325.     IP multicast
  2326.         Certain OSPF packets take the form of IP multicast
  2327.         datagrams.    Support    for receiving and sending IP multicast
  2328.         datagrams, along with the appropriate lower-level protocol
  2329.         support, is    required.  The IP multicast datagrams used by
  2330.         OSPF never travel more than    one hop. For this reason, the
  2331.         ability to forward IP multicast datagrams is not required.
  2332.         For    information on IP multicast, see [Ref7].
  2333.  
  2334.     Variable-length    subnet support
  2335.         The    router's IP protocol support must include the ability to
  2336.         divide a single IP class A,    B, or C    network    number into many
  2337.         subnets of various sizes.  This is commonly    called
  2338.         variable-length subnetting;    see Section 3.5    for details.
  2339.  
  2340.     IP supernetting    support
  2341.         The    router's IP protocol support must include the ability to
  2342.         aggregate contiguous collections of    IP class A, B, and C
  2343.         networks into larger quantities called supernets.
  2344.         Supernetting has been proposed as one way to improve the
  2345.         scaling of IP routing in the worldwide Internet. For more
  2346.         information    on IP supernetting, see    [Ref10].
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352. Moy                                   [Page 42]
  2353.  
  2354. Internet Draft             OSPF Version 2           February 1997
  2355.  
  2356.  
  2357.     Lower-level protocol support
  2358.         The    lower level protocols referred to here are the network
  2359.         access protocols, such as the Ethernet data    link layer.
  2360.         Indications    must be    passed from these protocols to OSPF as
  2361.         the    network    interface goes up and down.  For example, on an
  2362.         ethernet it    would be valuable to know when the ethernet
  2363.         transceiver    cable becomes unplugged.
  2364.  
  2365.     Non-broadcast lower-level protocol support
  2366.         On non-broadcast networks, the OSPF    Hello Protocol can be
  2367.         aided by providing an indication when an attempt is    made to
  2368.         send a packet to a dead or non-existent router.  For
  2369.         example, on    an X.25    PDN a dead neighboring router may be
  2370.         indicated by the reception of a X.25 clear with an
  2371.         appropriate    cause and diagnostic, and this information would
  2372.         be passed to OSPF.
  2373.  
  2374.     List manipulation primitives
  2375.         Much of the    OSPF functionality is described    in terms of its
  2376.         operation on lists of LSAs.     For example, the collection of
  2377.         LSAs that will be retransmitted to an adjacent router until
  2378.         acknowledged are described as a list.  Any particular LSA
  2379.         may    be on many such    lists.    An OSPF    implementation needs to
  2380.         be able to manipulate these    lists, adding and deleting
  2381.         constituent    LSAs as    necessary.
  2382.  
  2383.     Tasking    support
  2384.         Certain procedures described in this specification invoke
  2385.         other procedures.  At times, these other procedures    should
  2386.         be executed    in-line, that is, before the current procedure
  2387.         is finished.  This is indicated in the text    by instructions
  2388.         to execute a procedure.  At    other times, the other
  2389.         procedures are to be executed only when the    current
  2390.         procedure has finished.  This is indicated by instructions
  2391.         to schedule    a task.
  2392.  
  2393.  
  2394.     4.5.  Optional OSPF    capabilities
  2395.  
  2396.     The OSPF protocol defines several optional capabilities.  A
  2397.     router indicates the optional capabilities that    it supports in
  2398.     its OSPF Hello packets,    Database Description packets and in its
  2399.     LSAs.  This enables routers supporting a mix of    optional
  2400.     capabilities to    coexist    in a single Autonomous System.
  2401.  
  2402.     Some capabilities must be supported by all routers attached to a
  2403.     specific area.    In this    case, a    router will not    accept a
  2404.     neighbor's Hello Packet    unless there is    a match    in reported
  2405.  
  2406.  
  2407.  
  2408. Moy                                   [Page 43]
  2409.  
  2410. Internet Draft             OSPF Version 2           February 1997
  2411.  
  2412.  
  2413.     capabilities (i.e., a capability mismatch prevents a neighbor
  2414.     relationship from forming).  An    example    of this    is the
  2415.     ExternalRoutingCapability (see below).
  2416.  
  2417.     Other capabilities can be negotiated during the    Database
  2418.     Exchange process.  This    is accomplished    by specifying the
  2419.     optional capabilities in Database Description packets.    A
  2420.     capability mismatch with a neighbor in this case will result in
  2421.     only a subset of the link state    database being exchanged between
  2422.     the two    neighbors.
  2423.  
  2424.     The routing table build    process    can also be affected by    the
  2425.     presence/absence of optional capabilities.  For    example, since
  2426.     the optional capabilities are reported in LSAs,    routers
  2427.     incapable of certain functions can be avoided when building the
  2428.     shortest path tree.  An    example    of this    is the TOS routing
  2429.     capability (see    below).
  2430.  
  2431.     The OSPF optional capabilities defined in this memo are    listed
  2432.     below.    See Section A.2    for more information.
  2433.  
  2434.  
  2435.     ExternalRoutingCapability
  2436.         Entire OSPF    areas can be configured    as "stubs" (see    Section
  2437.         3.6).  AS-external-LSAs will not be    flooded    into stub areas.
  2438.         This capability is represented by the E-bit    in the OSPF
  2439.         Options field (see Section A.2).  In order to ensure
  2440.         consistent configuration of    stub areas, all    routers
  2441.         interfacing    to such    an area    must have the E-bit clear in
  2442.         their Hello    packets    (see Sections 9.5 and 10.5).
  2443.  
  2444.     TOS capability
  2445.         All    OSPF implementations must be able to calculate separate
  2446.         routes based on IP Type of Service.     However, to save
  2447.         routing table space    and processing resources, an OSPF router
  2448.         can    be configured to ignore    TOS when forwarding packets.  In
  2449.         this case, the router calculates routes for    TOS 0 only.
  2450.         This capability is represented by the T-bit    in the OSPF
  2451.         Options field (see Section A.2).  TOS-capable routers will
  2452.         attempt to avoid non-TOS-capable routers when calculating
  2453.         non-zero TOS paths.
  2454.  
  2455.  
  2456. 5.  Protocol Data Structures
  2457.  
  2458.     The    OSPF protocol is described herein in terms of its operation on
  2459.     various protocol data structures.  The following list comprises the
  2460.     top-level OSPF data    structures.  Any initialization    that needs to be
  2461.  
  2462.  
  2463.  
  2464. Moy                                   [Page 44]
  2465.  
  2466. Internet Draft             OSPF Version 2           February 1997
  2467.  
  2468.  
  2469.     done is noted.  OSPF areas,    interfaces and neighbors also have
  2470.     associated data structures that are    described later    in this
  2471.     specification.
  2472.  
  2473.  
  2474.     Router ID
  2475.     A 32-bit number    that uniquely identifies this router in    the AS.
  2476.     One possible implementation strategy would be to use the
  2477.     smallest IP interface address belonging    to the router. If a
  2478.     router's OSPF Router ID    is changed, the    router's OSPF software
  2479.     should be restarted before the new Router ID takes effect.  In
  2480.     this case the router should flush its self-originated LSAs from
  2481.     the routing domain (see    Section    14.1) before restarting, or they
  2482.     will persist for up to MaxAge minutes.
  2483.  
  2484.     Area structures
  2485.     Each one of the    areas to which the router is connected has its
  2486.     own data structure.  This data structure describes the working
  2487.     of the basic OSPF algorithm.  Remember that each area runs a
  2488.     separate copy of the basic OSPF    algorithm.
  2489.  
  2490.     Backbone (area) structure
  2491.     The OSPF backbone area is responsible for the dissemination of
  2492.     inter-area routing information.
  2493.  
  2494.     Virtual links configured
  2495.     The virtual links configured with this router as one endpoint.
  2496.     In order to have configured virtual links, the router itself
  2497.     must be    an area    border router.    Virtual    links are identified by
  2498.     the Router ID of the other endpoint -- which is    another    area
  2499.     border router.    These two endpoint routers must    be attached to a
  2500.     common area, called the    virtual    link's Transit area.  Virtual
  2501.     links are part of the backbone,    and behave as if they were
  2502.     unnumbered point-to-point networks between the two routers.  A
  2503.     virtual    link uses the intra-area routing of its    Transit    area to
  2504.     forward    packets.  Virtual links    are brought up and down    through
  2505.     the building of    the shortest-path trees    for the    Transit    area.
  2506.  
  2507.     List of external routes
  2508.     These are routes to destinations external to the Autonomous
  2509.     System,    that have been gained either through direct experience
  2510.     with another routing protocol (such as BGP), or    through
  2511.     configuration information, or through a    combination of the two
  2512.     (e.g., dynamic external    information to be advertised by    OSPF
  2513.     with configured    metric). Any router having these external routes
  2514.     is called an AS    boundary router.  These    routes are advertised by
  2515.     the router into    the OSPF routing domain    via AS-external-LSAs.
  2516.  
  2517.  
  2518.  
  2519.  
  2520. Moy                                   [Page 45]
  2521.  
  2522. Internet Draft             OSPF Version 2           February 1997
  2523.  
  2524.  
  2525.     List of AS-external-LSAs
  2526.     Part of    the link-state database.  These    have originated    from the
  2527.     AS boundary routers.  They comprise routes to destinations
  2528.     external to the    Autonomous System.  Note that, if the router is
  2529.     itself an AS boundary router, some of these AS-external-LSAs
  2530.     have been self-originated.
  2531.  
  2532.     The    routing    table
  2533.     Derived    from the link-state database.  Each entry in the routing
  2534.     table is indexed by a destination, and contains    the
  2535.     destination's cost and a set of    paths to use in    forwarding
  2536.     packets    to the destination. A path is described    by its type and
  2537.     next hop.  For more information, see Section 11.
  2538.  
  2539.     TOS    capability
  2540.     This item indicates whether the    router will calculate separate
  2541.     routes based on    TOS.  This is a    configurable parameter.     For
  2542.     more information, see Sections 4.5 and 16.9.
  2543.  
  2544.  
  2545.     Figure 9 shows the collection of data structures present in    a
  2546.     typical router.  The router    pictured is RT10, from the map in Figure
  2547.     6.    Note that Router RT10 has a virtual link configured to Router
  2548.     RT11, with Area 2 as the link's Transit area.  This    is indicated by
  2549.     the    dashed line in Figure 9.  When the virtual link    becomes    active,
  2550.     through the    building of the    shortest path tree for Area 2, it
  2551.     becomes an interface to the    backbone (see the two backbone
  2552.     interfaces depicted    in Figure 9).
  2553.  
  2554. 6.  The    Area Data Structure
  2555.  
  2556.     The    area data structure contains all the information used to run the
  2557.     basic OSPF routing algorithm. Each area maintains its own link-state
  2558.     database. A    network    belongs    to a single area, and a    router interface
  2559.     connects to    a single area. Each router adjacency also belongs to a
  2560.     single area.
  2561.  
  2562.     The    OSPF backbone is the special OSPF area responsible for
  2563.     disseminating inter-area routing information.
  2564.  
  2565.     The    area link-state    database consists of the collection of router-
  2566.     LSAs, network-LSAs and summary-LSAs    that have originated from the
  2567.     area's routers.  This information is flooded throughout a single
  2568.     area only.    The list of AS-external-LSAs (see Section 5) is    also
  2569.     considered to be part of each area's link-state database.
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576. Moy                                   [Page 46]
  2577.  
  2578. Internet Draft             OSPF Version 2           February 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 ID
  2614.     A 32-bit number    identifying the    area. The Area ID of 0.0.0.0 is
  2615.     reserved for the backbone.
  2616.  
  2617.     List of area address ranges
  2618.     In order to aggregate routing information at area boundaries,
  2619.     area address ranges can    be employed. Each address range    is
  2620.     specified by an    [address,mask] pair and    a status indication of
  2621.     either Advertise or DoNotAdvertise (see    Section    12.4.3).
  2622.  
  2623.     Associated router interfaces
  2624.     This router's interfaces connecting to the area.  A router
  2625.     interface belongs to one and only one area (or the backbone).
  2626.     For the    backbone area this list    includes all the virtual links.
  2627.     A virtual link is identified by    the Router ID of its other
  2628.     endpoint; its cost is the cost of the shortest intra-area path
  2629.  
  2630.  
  2631.  
  2632. Moy                                   [Page 47]
  2633.  
  2634. Internet Draft             OSPF Version 2           February 1997
  2635.  
  2636.  
  2637.     through    the Transit area that exists between the two routers.
  2638.  
  2639.     List of router-LSAs
  2640.     A router-LSA is    generated by each router in the    area.  It
  2641.     describes the state of the router's interfaces to the area.
  2642.  
  2643.     List of network-LSAs
  2644.     One network-LSA    is generated for each transit broadcast    and NBMA
  2645.     network    in the area.  A    network-LSA describes the set of routers
  2646.     currently connected to the network.
  2647.  
  2648.     List of summary-LSAs
  2649.     Summary-LSAs originate from the    area's area border routers.
  2650.     They describe routes to    destinations internal to the Autonomous
  2651.     System,    yet external to    the area (i.e.,    inter-area
  2652.     destinations).
  2653.  
  2654.     Shortest-path tree
  2655.     The shortest-path tree for the area, with this router itself as
  2656.     root.  Derived from the    collected router-LSAs and network-LSAs
  2657.     by the Dijkstra    algorithm (see Section 16.1).
  2658.  
  2659.     TransitCapability
  2660.     This parameter indicates whether the area can carry data traffic
  2661.     that neither originates    nor terminates in the area itself. This
  2662.     parameter is calculated    when the area's    shortest-path tree is
  2663.     built (see Section 16.1, where TransitCapability is set    to TRUE
  2664.     if and only if there are one or    more fully adjacent virtual
  2665.     links using the    area as    Transit    area), and is used as an input
  2666.     to a subsequent    step of    the routing table build    process    (see
  2667.     Section    16.3). When an area's TransitCapability    is set to TRUE,
  2668.     the area is said to be a "transit area".
  2669.  
  2670.     ExternalRoutingCapability
  2671.     Whether    AS-external-LSAs will be flooded into/throughout the
  2672.     area.  This is a configurable parameter.  If AS-external-LSAs
  2673.     are excluded from the area, the    area is    called a "stub". Within
  2674.     stub areas, routing to AS external destinations    will be    based
  2675.     solely on a default summary route.  The    backbone cannot    be
  2676.     configured as a    stub area.  Also, virtual links    cannot be
  2677.     configured through stub    areas.    For more information, see
  2678.     Section    3.6.
  2679.  
  2680.     StubDefaultCost
  2681.     If the area has    been configured    as a stub area,    and the    router
  2682.     itself is an area border router, then the StubDefaultCost
  2683.     indicates the cost of the default summary-LSA that the router
  2684.     should advertise into the area.     There can be a    separate cost
  2685.  
  2686.  
  2687.  
  2688. Moy                                   [Page 48]
  2689.  
  2690. Internet Draft             OSPF Version 2           February 1997
  2691.  
  2692.  
  2693.     configured for each IP TOS.  See Section 12.4.3    for more
  2694.     information.
  2695.  
  2696.  
  2697.     Unless otherwise specified,    the remaining sections of this document
  2698.     refer to the operation of the OSPF protocol    within a single    area.
  2699.  
  2700.  
  2701. 7.  Bringing Up    Adjacencies
  2702.  
  2703.     OSPF creates adjacencies between neighboring routers for the purpose
  2704.     of exchanging routing information.    Not every two neighboring
  2705.     routers will become    adjacent.  This    section    covers the generalities
  2706.     involved in    creating adjacencies.  For further details consult
  2707.     Section 10.
  2708.  
  2709.  
  2710.     7.1.  The Hello Protocol
  2711.  
  2712.     The Hello Protocol is responsible for establishing and
  2713.     maintaining neighbor relationships.  It    also ensures that
  2714.     communication between neighbors    is bidirectional.  Hello packets
  2715.     are sent periodically out all router interfaces.  Bidirectional
  2716.     communication is indicated when    the router sees    itself listed in
  2717.     the neighbor's Hello Packet.  On broadcast and NBMA networks,
  2718.     the Hello Protocol elects a Designated Router for the network.
  2719.  
  2720.     The Hello Protocol works differently on    broadcast networks, NBMA
  2721.     networks and Point-to-MultiPoint networks.  On broadcast
  2722.     networks, each router advertises itself    by periodically
  2723.     multicasting Hello Packets.  This allows neighbors to be
  2724.     discovered dynamically.     These Hello Packets contain the
  2725.     router's view of the Designated    Router's identity, and the list
  2726.     of routers whose Hello Packets have been seen recently.
  2727.  
  2728.     On NBMA    networks some configuration information    may be necessary
  2729.     for the    operation of the Hello Protocol.  Each router that may
  2730.     potentially become Designated Router has a list    of all other
  2731.     routers    attached to the    network.  A router, having Designated
  2732.     Router potential, sends    Hello Packets to all other potential
  2733.     Designated Routers when    its interface to the NBMA network first
  2734.     becomes    operational.  This is an attempt to find the Designated
  2735.     Router for the network.     If the    router itself is elected
  2736.     Designated Router, it begins sending Hello Packets to all other
  2737.     routers    attached to the    network.
  2738.  
  2739.     On Point-to-MultiPoint networks, a router sends    Hello Packets to
  2740.     all neighbors with which it can    communicate directly. These
  2741.  
  2742.  
  2743.  
  2744. Moy                                   [Page 49]
  2745.  
  2746. Internet Draft             OSPF Version 2           February 1997
  2747.  
  2748.  
  2749.     neighbors may be discovered dynamically    through    a protocol such
  2750.     as Inverse ARP (see [Ref14]), or they may be configured.
  2751.  
  2752.     After a    neighbor has been discovered, bidirectional
  2753.     communication ensured, and (if on a broadcast or NBMA network) a
  2754.     Designated Router elected, a decision is made regarding    whether
  2755.     or not an adjacency should be formed with the neighbor (see
  2756.     Section    10.4). If an adjacency is to be    formed,    the first step
  2757.     is to synchronize the neighbors' link-state databases.    This is
  2758.     covered    in the next section.
  2759.  
  2760.  
  2761.     7.2.  The Synchronization of Databases
  2762.  
  2763.     In a link-state    routing    algorithm, it is very important    for all
  2764.     routers' link-state databases to stay synchronized.  OSPF
  2765.     simplifies this    by requiring only adjacent routers to remain
  2766.     synchronized.  The synchronization process begins as soon as the
  2767.     routers    attempt    to bring up the    adjacency.  Each router
  2768.     describes its database by sending a sequence of    Database
  2769.     Description packets to its neighbor.  Each Database Description
  2770.     Packet describes a set of LSAs belonging to the    router's
  2771.     database.  When    the neighbor sees an LSA that is more recent
  2772.     than its own database copy, it makes a note that this newer LSA
  2773.     should be requested.
  2774.  
  2775.     This sending and receiving of Database Description packets is
  2776.     called the "Database Exchange Process".     During    this process,
  2777.     the two    routers    form a master/slave relationship.  Each    Database
  2778.     Description Packet has a sequence number.  Database Description
  2779.     Packets    sent by    the master (polls) are acknowledged by the slave
  2780.     through    echoing    of the sequence    number.     Both polls and    their
  2781.     responses contain summaries of link state data.     The master is
  2782.     the only one allowed to    retransmit Database Description    Packets.
  2783.     It does    so only    at fixed intervals, the    length of which    is the
  2784.     configured per-interface constant RxmtInterval.
  2785.  
  2786.     Each Database Description contains an indication that there are
  2787.     more packets to    follow --- the M-bit.  The Database Exchange
  2788.     Process    is over    when a router has received and sent Database
  2789.     Description Packets with the M-bit off.
  2790.  
  2791.     During and after the Database Exchange Process,    each router has
  2792.     a list of those    LSAs for which the neighbor has    more up-to-date
  2793.     instances.  These LSAs are requested in    Link State Request
  2794.     Packets.  Link State Request packets that are not satisfied are
  2795.     retransmitted at fixed intervals of time RxmtInterval.    When the
  2796.     Database Description Process has completed and all Link    State
  2797.  
  2798.  
  2799.  
  2800. Moy                                   [Page 50]
  2801.  
  2802. Internet Draft             OSPF Version 2           February 1997
  2803.  
  2804.  
  2805.     Requests have been satisfied, the databases are    deemed
  2806.     synchronized and the routers are marked    fully adjacent.     At this
  2807.     time the adjacency is fully functional and is advertised in the
  2808.     two routers' router-LSAs.
  2809.  
  2810.     The adjacency is used by the flooding procedure    as soon    as the
  2811.     Database Exchange Process begins.  This    simplifies database
  2812.     synchronization, and guarantees    that it    finishes in a
  2813.     predictable period of time.
  2814.  
  2815.  
  2816.     7.3.  The Designated Router
  2817.  
  2818.     Every broadcast    and NBMA network has a Designated Router.  The
  2819.     Designated Router performs two main functions for the routing
  2820.     protocol:
  2821.  
  2822.     o   The    Designated Router originates a network-LSA on behalf of
  2823.         the    network.  This LSA lists the set of routers (including
  2824.         the    Designated Router itself) currently attached to    the
  2825.         network.  The Link State ID    for this LSA (see Section
  2826.         12.1.4) is the IP interface    address    of the Designated
  2827.         Router.  The IP network number can then be obtained    by using
  2828.         the    network's subnet/network mask.
  2829.  
  2830.     o   The    Designated Router becomes adjacent to all other    routers
  2831.         on the network.  Since the link state databases are
  2832.         synchronized across    adjacencies (through adjacency bring-up
  2833.         and    then the flooding procedure), the Designated Router
  2834.         plays a central part in the    synchronization    process.
  2835.  
  2836.  
  2837.     The Designated Router is elected by the    Hello Protocol.     A
  2838.     router's Hello Packet contains its Router Priority, which is
  2839.     configurable on    a per-interface    basis.    In general, when a
  2840.     router's interface to a    network    first becomes functional, it
  2841.     checks to see whether there is currently a Designated Router for
  2842.     the network.  If there is, it accepts that Designated Router,
  2843.     regardless of its Router Priority.  (This makes    it harder to
  2844.     predict    the identity of    the Designated Router, but ensures that
  2845.     the Designated Router changes less often.  See below.)
  2846.     Otherwise, the router itself becomes Designated    Router if it has
  2847.     the highest Router Priority on the network.  A more detailed
  2848.     (and more accurate) description    of Designated Router election is
  2849.     presented in Section 9.4.
  2850.  
  2851.     The Designated Router is the endpoint of many adjacencies.  In
  2852.     order to optimize the flooding procedure on broadcast networks,
  2853.  
  2854.  
  2855.  
  2856. Moy                                   [Page 51]
  2857.  
  2858. Internet Draft             OSPF Version 2           February 1997
  2859.  
  2860.  
  2861.     the Designated Router multicasts its Link State    Update Packets
  2862.     to the address AllSPFRouters, rather than sending separate
  2863.     packets    over each adjacency.
  2864.  
  2865.     Section    2 of this document discusses the directed graph
  2866.     representation of an area.  Router nodes are labelled with their
  2867.     Router ID.  Transit network nodes are actually labelled    with the
  2868.     IP address of their Designated Router.    It follows that    when the
  2869.     Designated Router changes, it appears as if the    network    node on
  2870.     the graph is replaced by an entirely new node.    This will cause
  2871.     the network and    all its    attached routers to originate new LSAs.
  2872.     Until the link-state databases again converge, some temporary
  2873.     loss of    connectivity may result.  This may result in ICMP
  2874.     unreachable messages being sent    in response to data traffic.
  2875.     For that reason, the Designated    Router should change only
  2876.     infrequently.  Router Priorities should    be configured so that
  2877.     the most dependable router on a    network    eventually becomes
  2878.     Designated Router.
  2879.  
  2880.  
  2881.     7.4.  The Backup Designated    Router
  2882.  
  2883.     In order to make the transition    to a new Designated Router
  2884.     smoother, there    is a Backup Designated Router for each broadcast
  2885.     and NBMA network.  The Backup Designated Router    is also    adjacent
  2886.     to all routers on the network, and becomes Designated Router
  2887.     when the previous Designated Router fails.  If there were no
  2888.     Backup Designated Router, when a new Designated    Router became
  2889.     necessary, new adjacencies would have to be formed between the
  2890.     new Designated Router and all other routers attached to    the
  2891.     network.  Part of the adjacency    forming    process    is the
  2892.     synchronizing of link-state databases, which can potentially
  2893.     take quite a long time.     During    this time, the network would not
  2894.     be available for transit data traffic.    The Backup Designated
  2895.     obviates the need to form these    adjacencies, since they    already
  2896.     exist.    This means the period of disruption in transit traffic
  2897.     lasts only as long as it takes to flood    the new    LSAs (which
  2898.     announce the new Designated Router).
  2899.  
  2900.     The Backup Designated Router does not generate a network-LSA for
  2901.     the network.  (If it did, the transition to a new Designated
  2902.     Router would be    even faster.  However, this is a tradeoff
  2903.     between    database size and speed    of convergence when the
  2904.     Designated Router disappears.)
  2905.  
  2906.     The Backup Designated Router is    also elected by    the Hello
  2907.     Protocol.  Each    Hello Packet has a field that specifies    the
  2908.     Backup Designated Router for the network.
  2909.  
  2910.  
  2911.  
  2912. Moy                                   [Page 52]
  2913.  
  2914. Internet Draft             OSPF Version 2           February 1997
  2915.  
  2916.  
  2917.     In some    steps of the flooding procedure, the Backup Designated
  2918.     Router plays a passive role, letting the Designated Router do
  2919.     more of    the work.  This    cuts down on the amount    of local routing
  2920.     traffic.  See Section 13.3 for more information.
  2921.  
  2922.  
  2923.     7.5.  The graph of adjacencies
  2924.  
  2925.     An adjacency is    bound to the network that the two routers have
  2926.     in common.  If two routers have    multiple networks in common,
  2927.     they may have multiple adjacencies between them.
  2928.  
  2929.     One can    picture    the collection of adjacencies on a network as
  2930.     forming    an undirected graph.  The vertices consist of routers,
  2931.     with an    edge joining two routers if they are adjacent.    The
  2932.     graph of adjacencies describes the flow    of routing protocol
  2933.     packets, and in    particular Link    State Update Packets, through
  2934.     the Autonomous System.
  2935.  
  2936.     Two graphs are possible, depending on whether a    Designated
  2937.     Router is elected for the network.  On physical    point-to-point
  2938.     networks, Point-to-MultiPoint networks and virtual links,
  2939.     neighboring routers become adjacent whenever they can
  2940.     communicate directly.  In contrast, on broadcast and NBMA
  2941.     networks only the Designated Router and    the Backup Designated
  2942.     Router become adjacent to all other routers attached to    the
  2943.     network.
  2944.  
  2945.     These graphs are shown in Figure 10.  It is assumed that Router
  2946.     RT7 has    become the Designated Router, and Router RT3 the Backup
  2947.     Designated Router, for the Network N2.    The Backup Designated
  2948.     Router performs    a lesser function during the flooding procedure
  2949.     than the Designated Router (see    Section    13.3).    This is    the
  2950.     reason for the dashed lines connecting the Backup Designated
  2951.     Router RT3.
  2952.  
  2953.  
  2954. 8.  Protocol Packet Processing
  2955.  
  2956.     This section discusses the general processing of OSPF routing
  2957.     protocol packets.  It is very important that the router link-state
  2958.     databases remain synchronized.  For    this reason, routing protocol
  2959.     packets should get preferential treatment over ordinary data
  2960.     packets, both in sending and receiving.
  2961.  
  2962.     Routing protocol packets are sent along adjacencies    only (with the
  2963.     exception of Hello packets,    which are used to discover the
  2964.     adjacencies).  This    means that all routing protocol    packets    travel a
  2965.  
  2966.  
  2967.  
  2968. Moy                                   [Page 53]
  2969.  
  2970. Internet Draft             OSPF Version 2           February 1997
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.       +---+           +---+
  2977.       |RT1|------------|RT2|        o---------------o
  2978.       +---+       N1       +---+       RT1           RT2
  2979.  
  2980.  
  2981.  
  2982.                          RT7
  2983.                           o---------+
  2984.         +---+   +---+   +---+         /|\        |
  2985.         |RT7|   |RT3|   |RT4|        / | \        |
  2986.         +---+   +---+   +---+           /  |  \        |
  2987.           |          |          |              /      |   \        |
  2988.      +-----------------------+      RT5o RT6o    oRT4 |
  2989.           |      |    N2          *      *   *        |
  2990.         +---+    +---+               *  *  *        |
  2991.         |RT5|    |RT6|            * * *        |
  2992.         +---+    +---+             ***        |
  2993.                           o---------+
  2994.                          RT3
  2995.  
  2996.  
  2997.           Figure 10: The graph of adjacencies
  2998.  
  2999.     single IP hop, except those    sent over virtual links.
  3000.  
  3001.     All    routing    protocol packets begin with a standard header.    The
  3002.     sections below provide details on how to fill in and verify    this
  3003.     standard header.  Then, for    each packet type, the section giving
  3004.     more details on that particular packet type's processing is    listed.
  3005.  
  3006.     8.1.  Sending protocol packets
  3007.  
  3008.     When a router sends a routing protocol packet, it fills    in the
  3009.     fields of the standard OSPF packet header as follows.  For more
  3010.     details    on the header format consult Section A.3.1:
  3011.  
  3012.  
  3013.     Version    #
  3014.         Set    to 2, the version number of the    protocol as documented
  3015.         in this specification.
  3016.  
  3017.     Packet type
  3018.         The    type of    OSPF packet, such as Link state    Update or Hello
  3019.         Packet.
  3020.  
  3021.  
  3022.  
  3023.  
  3024. Moy                                   [Page 54]
  3025.  
  3026. Internet Draft             OSPF Version 2           February 1997
  3027.  
  3028.  
  3029.     Packet length
  3030.         The    length of the entire OSPF packet in bytes, including the
  3031.         standard OSPF packet header.
  3032.  
  3033.     Router ID
  3034.         The    identity of the    router itself (who is originating the
  3035.         packet).
  3036.  
  3037.     Area ID
  3038.         The    OSPF area that the packet is being sent    into.
  3039.  
  3040.     Checksum
  3041.         The    standard IP 16-bit one's complement checksum of    the
  3042.         entire OSPF    packet,    excluding the 64-bit authentication
  3043.         field.  This checksum is calculated    as part    of the
  3044.         appropriate    authentication procedure; for some OSPF
  3045.         authentication types, the checksum calculation is omitted.
  3046.         See    Section    D.4 for    details.
  3047.  
  3048.     AuType and Authentication
  3049.         Each OSPF packet exchange is authenticated.     Authentication
  3050.         types are assigned by the protocol and are documented in
  3051.         Appendix D.     A different authentication procedure can be
  3052.         used for each IP network/subnet.  Autype indicates the type
  3053.         of authentication procedure    in use.    The 64-bit
  3054.         authentication field is then for use by the    chosen
  3055.         authentication procedure.  This procedure should be    the last
  3056.         called when    forming    the packet to be sent. See Section D.4
  3057.         for    details.
  3058.  
  3059.  
  3060.     The IP destination address for the packet is selected as
  3061.     follows.  On physical point-to-point networks, the IP
  3062.     destination is always set to the address AllSPFRouters.     On all
  3063.     other network types (including virtual links), the majority of
  3064.     OSPF packets are sent as unicasts, i.e., sent directly to the
  3065.     other end of the adjacency.  In    this case, the IP destination is
  3066.     just the Neighbor IP address associated    with the other end of
  3067.     the adjacency (see Section 10).     The only packets not sent as
  3068.     unicasts are on    broadcast networks; on these networks Hello
  3069.     packets    are sent to the    multicast destination AllSPFRouters, the
  3070.     Designated Router and its Backup send both Link    State Update
  3071.     Packets    and Link State Acknowledgment Packets to the multicast
  3072.     address    AllSPFRouters, while all other routers send both their
  3073.     Link State Update and Link State Acknowledgment    Packets    to the
  3074.     multicast address AllDRouters.
  3075.  
  3076.     Retransmissions    of Link    State Update packets are ALWAYS    sent as
  3077.  
  3078.  
  3079.  
  3080. Moy                                   [Page 55]
  3081.  
  3082. Internet Draft             OSPF Version 2           February 1997
  3083.  
  3084.  
  3085.     unicasts.
  3086.  
  3087.     The IP source address should be    set to the IP address of the
  3088.     sending    interface.  Interfaces to unnumbered point-to-point
  3089.     networks have no associated IP address.     On these interfaces,
  3090.     the IP source should be    set to any of the other    IP addresses
  3091.     belonging to the router.  For this reason, there must be at
  3092.     least one IP address assigned to the router.[2]    Note that, for
  3093.     most purposes, virtual links act precisely the same as
  3094.     unnumbered point-to-point networks.  However, each virtual link
  3095.     does have an IP    interface address (discovered during the routing
  3096.     table build process) which is used as the IP source when sending
  3097.     packets    over the virtual link.
  3098.  
  3099.     For more information on    the format of specific OSPF packet
  3100.     types, consult the sections listed in Table 10.
  3101.  
  3102.  
  3103.  
  3104.          Type   Packet name           detailed section (transmit)
  3105.          _________________________________________________________
  3106.          1        Hello           Section  9.5
  3107.          2        Database description   Section 10.8
  3108.          3        Link state request       Section 10.9
  3109.          4        Link state update       Section 13.3
  3110.          5        Link state ack       Section 13.5
  3111.  
  3112.  
  3113.         Table 10: Sections describing OSPF protocol    packet transmission.
  3114.  
  3115.  
  3116.  
  3117.     8.2.  Receiving protocol packets
  3118.  
  3119.     Whenever a protocol packet is received by the router it    is
  3120.     marked with the    interface it was received on.  For routers that
  3121.     have virtual links configured, it may not be immediately obvious
  3122.     which interface    to associate the packet    with.  For example,
  3123.     consider the Router RT11 depicted in Figure 6.    If RT11    receives
  3124.     an OSPF    protocol packet    on its interface to Network N8,    it may
  3125.     want to    associate the packet with the interface    to Area    2, or
  3126.     with the virtual link to Router    RT10 (which is part of the
  3127.     backbone).  In the following, we assume    that the packet    is
  3128.     initially associated with the non-virtual  link.[3]
  3129.  
  3130.     In order for the packet    to be accepted at the IP level,    it must
  3131.     pass a number of tests,    even before the    packet is passed to OSPF
  3132.     for processing:
  3133.  
  3134.  
  3135.  
  3136. Moy                                   [Page 56]
  3137.  
  3138. Internet Draft             OSPF Version 2           February 1997
  3139.  
  3140.  
  3141.     o   The    IP checksum must be correct.
  3142.  
  3143.     o   The    packet's IP destination    address    must be    the IP address
  3144.         of the receiving interface,    or one of the IP multicast
  3145.         addresses AllSPFRouters or AllDRouters.
  3146.  
  3147.     o   The    IP protocol specified must be OSPF (89).
  3148.  
  3149.     o   Locally originated packets should not be passed on to OSPF.
  3150.         That is, the source    IP address should be examined to make
  3151.         sure this is not a multicast packet    that the router    itself
  3152.         generated.
  3153.  
  3154.  
  3155.     Next, the OSPF packet header is    verified.  The fields specified
  3156.     in the header must match those configured for the receiving
  3157.     interface.  If they do not, the    packet should be discarded:
  3158.  
  3159.  
  3160.     o   The    version    number field must specify protocol version 2.
  3161.  
  3162.     o   The    Area ID    found in the OSPF header must be verified.  If
  3163.         both of the    following cases    fail, the packet should    be
  3164.         discarded.    The Area ID specified in the header must either:
  3165.  
  3166.         (1)    Match the Area ID of the receiving interface.  In this
  3167.         case, the packet has been sent over a single hop.
  3168.         Therefore, the packet's    IP source address is required to
  3169.         be on the same network as the receiving    interface.  This
  3170.         can be verified    by comparing the packet's IP source
  3171.         address    to the interface's IP address, after masking
  3172.         both addresses with the    interface mask.     This comparison
  3173.         should not be performed    on point-to-point networks. On
  3174.         point-to-point networks, the interface addresses of each
  3175.         end of the link    are assigned independently, if they are
  3176.         assigned at all.
  3177.  
  3178.         (2)    Indicate the backbone.    In this    case, the packet has
  3179.         been sent over a virtual link.    The receiving router
  3180.         must be    an area    border router, and the Router ID
  3181.         specified in the packet    (the source router) must be the
  3182.         other end of a configured virtual link.     The receiving
  3183.         interface must also attach to the virtual link's
  3184.         configured Transit area.  If all of these checks
  3185.         succeed, the packet is accepted    and is from now    on
  3186.         associated with    the virtual link (and the backbone
  3187.         area).
  3188.  
  3189.  
  3190.  
  3191.  
  3192. Moy                                   [Page 57]
  3193.  
  3194. Internet Draft             OSPF Version 2           February 1997
  3195.  
  3196.  
  3197.     o   Packets whose IP destination is AllDRouters    should only be
  3198.         accepted if    the state of the receiving interface is    DR or
  3199.         Backup (see    Section    9.1).
  3200.  
  3201.     o   The    AuType specified in the    packet must match the AuType
  3202.         specified for the associated area.
  3203.  
  3204.     o   The    packet must be authenticated.  The authentication
  3205.         procedure is indicated by the setting of AuType (see
  3206.         Appendix D).  The authentication procedure may use one or
  3207.         more Authentication    keys, which can    be configured on a per-
  3208.         interface basis.  The authentication procedure may also
  3209.         verify the checksum    field in the OSPF packet header    (which,
  3210.         when used, is set to the standard IP 16-bit    one's complement
  3211.         checksum of    the OSPF packet's contents after excluding the
  3212.         64-bit authentication field).  If the authentication
  3213.         procedure fails, the packet    should be discarded.
  3214.  
  3215.     If the packet type is Hello, it    should then be further processed
  3216.     by the Hello Protocol (see Section 10.5).  All other packet
  3217.     types are sent/received    only on    adjacencies.  This means that
  3218.     the packet must    have been sent by one of the router's active
  3219.     neighbors.  If the receiving interface connects    to a broadcast
  3220.     network, Point-to-MultiPoint network or    NBMA network the sender
  3221.     is identified by the IP    source address found in    the packet's IP
  3222.     header.     If the    receiving interface connects to    a point-to-point
  3223.     network    or a virtual link, the sender is identified by the
  3224.     Router ID (source router) found    in the packet's    OSPF header.
  3225.     The data structure associated with the receiving interface
  3226.     contains the list of active neighbors.    Packets    not matching any
  3227.     active neighbor    are discarded.
  3228.  
  3229.     At this    point all received protocol packets are    associated with
  3230.     an active neighbor.  For the further input processing of
  3231.     specific packet    types, consult the sections listed in Table 11.
  3232.  
  3233.  
  3234.  
  3235.           Type   Packet name        detailed section (receive)
  3236.           ________________________________________________________
  3237.           1         Hello            Section 10.5
  3238.           2         Database description   Section 10.6
  3239.           3         Link state    request        Section 10.7
  3240.           4         Link state    update        Section 13
  3241.           5         Link state    ack        Section 13.7
  3242.  
  3243.  
  3244.         Table 11: Sections describing OSPF protocol    packet reception.
  3245.  
  3246.  
  3247.  
  3248. Moy                                   [Page 58]
  3249.  
  3250. Internet Draft             OSPF Version 2           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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           February 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.       R         RT7    0       intra-area     8    RT10     *
  5681.       ____________________________________________________________
  5682.       N         N12    *       type    1 ext.     10    RT10     RT7
  5683.       N         N13    *       type    1 ext.     14    RT5     RT5
  5684.       N         N14    *       type    1 ext.     14    RT5     RT5
  5685.       N         N15    *       type    1 ext.     17    RT10     RT7
  5686.  
  5687.  
  5688.            Table 12: The routing table for Router RT6
  5689.              (no configured    areas).
  5690.  
  5691.     11.3.  Sample routing table, with areas
  5692.  
  5693.     Consider the previous example, this time split into OSPF areas.
  5694.     An OSPF    area configuration is pictured in Figure 6.  Router
  5695.     RT4's routing table will be described for this area
  5696.     configuration.    Router RT4 has a connection to Area 1 and a
  5697.     backbone connection.  This causes Router RT4 to    view the AS as
  5698.     the concatenation of the two graphs shown in Figures 7 and 8.
  5699.     The resulting routing table is displayed in Table 13.
  5700.  
  5701.     Again, Routers RT5 and RT7 are AS boundary routers.  Routers
  5702.     RT3, RT4, RT7, RT10 and    RT11 are area border routers.  Note that
  5703.     there are two routing entries for the area border router RT3,
  5704.     since it has two areas in common with RT4 (Area    1 and the
  5705.     backbone).
  5706.  
  5707.     Backbone paths have been calculated to all area    border routers.
  5708.     These are used when determining    the inter-area routes.    Note
  5709.  
  5710.  
  5711.  
  5712. Moy                                  [Page 102]
  5713.  
  5714. Internet Draft             OSPF Version 2           February 1997
  5715.  
  5716.  
  5717.     that all of the    inter-area routes are associated with the
  5718.     backbone; this is always the case when the calculating router is
  5719.     itself an area border router.  Routing information is condensed
  5720.     at area    boundaries.  In    this example, we assume    that Area 3 has
  5721.     been defined so    that networks N9-N11 and the host route    to H1
  5722.     are all    condensed to a single route when advertised into the
  5723.     backbone (by Router RT11).  Note that the cost of this route is
  5724.     the maximum of the set of costs    to its individual components.
  5725.  
  5726.     There is a virtual link    configured between Routers RT10    and
  5727.     RT11.  Without this configured virtual link, RT11 would    be
  5728.     unable to advertise a route for    networks N9-N11    and Host H1 into
  5729.     the backbone, and there    would not be an    entry for these    networks
  5730.     in Router RT4's    routing    table.
  5731.  
  5732.     In this    example    there are two equal-cost paths to Network N12.
  5733.     However, they both use the same    next hop (Router RT5).
  5734.  
  5735.  
  5736.  
  5737.     Router RT4's routing table would improve (i.e.,    some of    the
  5738.     paths in the routing table would become    shorter) if an
  5739.     additional virtual link    were configured    between    Router RT4 and
  5740.     Router RT3.  The new virtual link would    itself be associated
  5741.     with the first entry for area border router RT3    in Table 13 (an
  5742.     intra-area path    through    Area 1).  This would yield a cost of 1
  5743.     for the    virtual    link.  The routing table entries changes that
  5744.     would be caused    by the addition    of this    virtual    link are shown
  5745.     in Table 14.
  5746.  
  5747.  
  5748.  
  5749. 12.  Link State    Advertisements (LSAs)
  5750.  
  5751.     Each router    in the Autonomous System originates one    or more    link
  5752.     state advertisements (LSAs).  This memo defines five distinct types
  5753.     of LSAs, which are described in Section 4.3.  The collection of LSAs
  5754.     forms the link-state database.  Each separate type of LSA has a
  5755.     separate function.    Router-LSAs and    network-LSAs describe how an
  5756.     area's routers and networks    are interconnected.  Summary-LSAs
  5757.     provide a way of condensing    an area's routing information.    AS-
  5758.     external-LSAs provide a way    of transparently advertising
  5759.     externally-derived routing information throughout the Autonomous
  5760.     System.
  5761.  
  5762.     Each LSA begins with a standard 20-byte header.  This LSA header is
  5763.     discussed below.
  5764.  
  5765.  
  5766.  
  5767.  
  5768. Moy                                  [Page 103]
  5769.  
  5770. Internet Draft             OSPF Version 2           February 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.    R      RT3          1         intra-area       1      *        *
  5783.    __________________________________________________________________
  5784.    N      Ib          0         intra-area       22      RT5        *
  5785.    N      Ia          0         intra-area       27      RT5        *
  5786.    R      RT3          0         intra-area       21      RT5        *
  5787.    R      RT5          0         intra-area       8      *        *
  5788.    R      RT7          0         intra-area       14      RT5        *
  5789.    R      RT10          0         intra-area       22      RT5        *
  5790.    R      RT11          0         intra-area       25      RT5        *
  5791.    __________________________________________________________________
  5792.    N      N6          0         inter-area       15      RT5        RT7
  5793.    N      N7          0         inter-area       19      RT5        RT7
  5794.    N      N8          0         inter-area       18      RT5        RT7
  5795.    N      N9-N11,H1   0         inter-area       36      RT5        RT11
  5796.    __________________________________________________________________
  5797.    N      N12          *         type 1 ext.   16      RT5        RT5,RT7
  5798.    N      N13          *         type 1 ext.   16      RT5        RT5
  5799.    N      N14          *         type 1 ext.   16      RT5        RT5
  5800.    N      N15          *         type 1 ext.   23      RT5        RT7
  5801.  
  5802.  
  5803.           Table    13: Router RT4's routing table
  5804.                in the presence of areas.
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.  
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824. Moy                                  [Page 104]
  5825.  
  5826. Internet Draft             OSPF Version 2           February 1997
  5827.  
  5828.  
  5829.     Type   Dest           Area   Path  Type   Cost      Next       Adv.
  5830.                           Hop(s)   Router(s)
  5831.     ________________________________________________________________
  5832.     N       Ib           0      intra-area   16      RT3       *
  5833.     N       Ia           0      intra-area   21      RT3       *
  5834.     R       RT3           0      intra-area   1      *       *
  5835.     R       RT10           0      intra-area   16      RT3       *
  5836.     R       RT11           0      intra-area   19      RT3       *
  5837.     ________________________________________________________________
  5838.     N       N9-N11,H1   0      inter-area   30      RT3       RT11
  5839.  
  5840.  
  5841.           Table    14: Changes resulting from an
  5842.             additional virtual link.
  5843.  
  5844.     12.1.  The LSA Header
  5845.  
  5846.     The LSA    header contains    the LS type, Link State    ID and
  5847.     Advertising Router fields.  The    combination of these three
  5848.     fields uniquely    identifies the LSA.
  5849.  
  5850.     There may be several instances of an LSA present in the
  5851.     Autonomous System, all at the same time.  It must then be
  5852.     determined which instance is more recent.  This    determination is
  5853.     made by    examining the LS sequence, LS checksum and LS age
  5854.     fields.     These fields are also contained in the    20-byte    LSA
  5855.     header.
  5856.  
  5857.     Several    of the OSPF packet types list LSAs.  When the instance
  5858.     is not important, an LSA is referred to    by its LS type,    Link
  5859.     State ID and Advertising Router    (see Link State    Request
  5860.     Packets).  Otherwise, the LS sequence number, LS age and LS
  5861.     checksum fields    must also be referenced.
  5862.  
  5863.     A detailed explanation of the fields contained in the LSA header
  5864.     follows.
  5865.  
  5866.  
  5867.     12.1.1.     LS age
  5868.  
  5869.         This field is the age of the LSA in    seconds.  It should be
  5870.         processed as an unsigned 16-bit integer.  It is set    to 0
  5871.         when the LSA is originated.     It must be incremented    by
  5872.         InfTransDelay on every hop of the flooding procedure.  LSAs
  5873.         are    also aged as they are held in each router's database.
  5874.  
  5875.         The    age of an LSA is never incremented past    MaxAge.     LSAs
  5876.         having age MaxAge are not used in the routing table
  5877.  
  5878.  
  5879.  
  5880. Moy                                  [Page 105]
  5881.  
  5882. Internet Draft             OSPF Version 2           February 1997
  5883.  
  5884.  
  5885.         calculation.  When an LSA's    age first reaches MaxAge, it is
  5886.         reflooded.    An LSA of age MaxAge is    finally    flushed    from the
  5887.         database when it is    no longer needed to ensure database
  5888.         synchronization.  For more information on the aging    of LSAs,
  5889.         consult Section 14.
  5890.  
  5891.         The    LS age field is    examined when a    router receives    two
  5892.         instances of an LSA, both having identical LS sequence
  5893.         numbers and    LS checksums.  An instance of age MaxAge is then
  5894.         always accepted as most recent; this allows    old LSAs to be
  5895.         flushed quickly from the routing domain.  Otherwise, if the
  5896.         ages differ    by more    than MaxAgeDiff, the instance having the
  5897.         smaller age    is accepted as most recent.[12]    See Section 13.1
  5898.         for    more details.
  5899.  
  5900.  
  5901.     12.1.2.     Options
  5902.  
  5903.         The    Options    field in the LSA header    indicates which    optional
  5904.         capabilities are associated    with the LSA.  OSPF's optional
  5905.         capabilities are described in Section 4.5.    There are
  5906.         currently two optional capabilities    defined; they are
  5907.         represented    by the T-bit and E-bit found in    the Options
  5908.         field.  The    rest of    the Options field should be set    to zero.
  5909.  
  5910.         The    E-bit represents OSPF's    ExternalRoutingCapability.  This
  5911.         bit    should be set in all LSAs associated with the backbone,
  5912.         and    all LSAs associated with non-stub areas    (see Section
  5913.         3.6).  It should also be set in all    AS-external-LSAs.  It
  5914.         should be reset in all router-LSAs,    network-LSAs and
  5915.         summary-LSAs associated with a stub    area.  For all LSAs, the
  5916.         setting of the E-bit is for    informational purposes only; it
  5917.         does not affect the    routing    table calculation.
  5918.  
  5919.         The    T-bit represents OSPF's    TOS routing capability.     This
  5920.         bit    should be set in a router-LSA if and only if the router
  5921.         is capable of calculating separate routes for each IP TOS
  5922.         (see Section 2.5).    The T-bit should always    be set in
  5923.         network-LSAs.  It should be    set in summary-LSAs and    AS-
  5924.         external-LSAs if and only if the LSA describes paths for all
  5925.         TOS    values,    instead    of just    the TOS    0 path.     Note that, with
  5926.         the    T-bit set, there may still be only a single metric in
  5927.         the    LSA (the TOS 0 metric).     This would mean that paths for
  5928.         non-zero TOS exist,    but are    equivalent to the TOS 0    path.
  5929.         An LSA's T-bit is examined when calculating    the routing
  5930.         table's non-zero TOS paths (see Section 16.9).
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936. Moy                                  [Page 106]
  5937.  
  5938. Internet Draft             OSPF Version 2           February 1997
  5939.  
  5940.  
  5941.     12.1.3.     LS type
  5942.  
  5943.         The    LS type    field dictates the format and function of the
  5944.         LSA.  LSAs of different types have different names (e.g.,
  5945.         router-LSAs    or network-LSAs).  All LSA types defined by this
  5946.         memo, except the AS-external-LSAs (LS type = 5), are flooded
  5947.         throughout a single    area only.  AS-external-LSAs are flooded
  5948.         throughout the entire Autonomous System, excepting stub
  5949.         areas (see Section 3.6).  Each separate LSA    type is    briefly
  5950.         described below in Table 15.
  5951.  
  5952.  
  5953.         LS Type   LSA description
  5954.         ________________________________________________
  5955.         1          These are    the router-LSAs.
  5956.               They describe the    collected
  5957.                states of the router's
  5958.               interfaces. For more information,
  5959.               consult Section 12.4.1.
  5960.         ________________________________________________
  5961.         2          These are    the network-LSAs.
  5962.               They describe the    set of routers
  5963.               attached to the network. For
  5964.               more information,    consult
  5965.               Section 12.4.2.
  5966.         ________________________________________________
  5967.         3 or 4    These are    the summary-LSAs.
  5968.               They describe inter-area routes,
  5969.               and enable the condensation of
  5970.               routing information at area
  5971.               borders. Originated by area border
  5972.               routers, the Type    3 summary-LSAs
  5973.               describe routes to networks while    the
  5974.               Type 4 summary-LSAs describe routes to
  5975.               AS boundary routers.
  5976.         ________________________________________________
  5977.         5          These are    the AS-external-LSAs.
  5978.               Originated by AS boundary    routers,
  5979.               they describe routes
  5980.               to destinations external to the
  5981.               Autonomous System. A default route for
  5982.               the Autonomous System can    also be
  5983.               described    by an AS-external-LSA.
  5984.  
  5985.  
  5986.         Table 15: OSPF link    state advertisements (LSAs).
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992. Moy                                  [Page 107]
  5993.  
  5994. Internet Draft             OSPF Version 2           February 1997
  5995.  
  5996.  
  5997.     12.1.4.     Link State ID
  5998.  
  5999.         This field identifies the piece of the routing domain that
  6000.         is being described by the LSA.  Depending on the LSA's LS
  6001.         type, the Link State ID takes on the values    listed in Table
  6002.         16.
  6003.  
  6004.  
  6005.         Actually, for Type 3 summary-LSAs (LS type = 3) and    AS-
  6006.         external-LSAs (LS type = 5), the Link State    ID may
  6007.         additionally have one or more of the destination network's
  6008.         "host" bits    set. For example, when originating an AS-
  6009.         external-LSA for the network 10.0.0.0 with mask of
  6010.         255.0.0.0, the Link    State ID can be    set to anything    in the
  6011.         range 10.0.0.0 through 10.255.255.255 inclusive (although
  6012.         10.0.0.0 should be used whenever possible).    The freedom to
  6013.         set    certain    host bits allows a router to originate separate
  6014.         LSAs for two networks having the same address but different
  6015.         masks. See Appendix    E for details.
  6016.  
  6017.         When the LSA is describing a network (LS type = 2, 3 or 5),
  6018.         the    network's IP address is    easily derived by masking the
  6019.         Link State ID with the network/subnet mask contained in the
  6020.         body of the    LSA.  When the LSA is describing a router (LS
  6021.         type = 1 or    4), the    Link State ID is always    the described
  6022.         router's OSPF Router ID.
  6023.  
  6024.         When an AS-external-LSA (LS    Type = 5) is describing    a
  6025.         default route, its Link State ID is    set to
  6026.         DefaultDestination (0.0.0.0).
  6027.  
  6028.  
  6029.  
  6030.  
  6031.         LS Type   Link State ID
  6032.         _______________________________________________
  6033.         1          The originating router's Router ID.
  6034.         2          The IP interface address of the
  6035.               network's    Designated Router.
  6036.         3          The destination network's    IP address.
  6037.         4          The Router ID of the described AS
  6038.               boundary router.
  6039.         5          The destination network's    IP address.
  6040.  
  6041.  
  6042.            Table 16: The LSA's Link State ID.
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048. Moy                                  [Page 108]
  6049.  
  6050. Internet Draft             OSPF Version 2           February 1997
  6051.  
  6052.  
  6053.     12.1.5.     Advertising Router
  6054.  
  6055.         This field specifies the OSPF Router ID of the LSA's
  6056.         originator.     For router-LSAs, this field is    identical to the
  6057.         Link State ID field.  Network-LSAs are originated by the
  6058.         network's Designated Router.  Summary-LSAs originated by
  6059.         area border    routers.  AS-external-LSAs are originated by AS
  6060.         boundary routers.
  6061.  
  6062.  
  6063.     12.1.6.     LS sequence number
  6064.  
  6065.         The    sequence number    field is a signed 32-bit integer.  It is
  6066.         used to detect old and duplicate LSAs.  The    space of
  6067.         sequence numbers is    linearly ordered.  The larger the
  6068.         sequence number (when compared as signed 32-bit integers)
  6069.         the    more recent the    LSA.  To describe to sequence number
  6070.         space more precisely, let N    refer in the discussion    below to
  6071.         the    constant 2**31.
  6072.  
  6073.         The    sequence number    -N (0x80000000)    is reserved (and
  6074.         unused).  This leaves -N + 1 (0x80000001) as the smallest
  6075.         (and therefore oldest) sequence number; this sequence number
  6076.         is referred    to as the constant InitialSequenceNumber. A
  6077.         router uses    InitialSequenceNumber the first    time it
  6078.         originates any LSA.     Afterwards, the LSA's sequence    number
  6079.         is incremented each    time the router    originates a new
  6080.         instance of    the LSA.  When an attempt is made to increment
  6081.         the    sequence number    past the maximum value of N - 1
  6082.         (0x7fffffff; also referred to as MaxSequenceNumber), the
  6083.         current instance of    the LSA    must first be flushed from the
  6084.         routing domain.  This is done by prematurely aging the LSA
  6085.         (see Section 14.1) and reflooding it.  As soon as this flood
  6086.         has    been acknowledged by all adjacent neighbors, a new
  6087.         instance can be originated with sequence number of
  6088.         InitialSequenceNumber.
  6089.  
  6090.         The    router may be forced to    promote    the sequence number of
  6091.         one    of its LSAs when a more    recent instance    of the LSA is
  6092.         unexpectedly received during the flooding process.    This
  6093.         should be a    rare event.  This may indicate that an out-of-
  6094.         date LSA, originated by the    router itself before its last
  6095.         restart/reload, still exists in the    Autonomous System.  For
  6096.         more information see Section 13.4.
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104. Moy                                  [Page 109]
  6105.  
  6106. Internet Draft             OSPF Version 2           February 1997
  6107.  
  6108.  
  6109.     12.1.7.     LS checksum
  6110.  
  6111.         This field is the checksum of the complete contents    of the
  6112.         LSA, excepting the LS age field.  The LS age field is
  6113.         excepted so    that an    LSA's age can be incremented without
  6114.         updating the checksum.  The    checksum used is the same that
  6115.         is used for    ISO connectionless datagrams; it is commonly
  6116.         referred to    as the Fletcher    checksum.  It is documented in
  6117.         Annex B of [Ref6].    The LSA    header also contains the length
  6118.         of the LSA in bytes; subtracting the size of the LS    age
  6119.         field (two bytes) yields the amount    of data    to checksum.
  6120.  
  6121.         The    checksum is used to detect data    corruption of an LSA.
  6122.         This corruption can    occur while an LSA is being flooded, or
  6123.         while it is    being held in a    router's memory.  The LS
  6124.         checksum field cannot take on the value of zero; the
  6125.         occurrence of such a value should be considered a checksum
  6126.         failure.  In other words, calculation of the checksum is not
  6127.         optional.
  6128.  
  6129.         The    checksum of an LSA is verified in two cases:  a) when it
  6130.         is received    in a Link State    Update Packet and b) at    times
  6131.         during the aging of    the link state database.  The detection
  6132.         of a checksum failure leads    to separate actions in each
  6133.         case.  See Sections    13 and 14 for more details.
  6134.  
  6135.         Whenever the LS sequence number field indicates that two
  6136.         instances of an LSA    are the    same, the LS checksum field is
  6137.         examined.  If there    is a difference, the instance with the
  6138.         larger LS checksum is considered to    be most    recent.[13] See
  6139.         Section 13.1 for more details.
  6140.  
  6141.  
  6142.     12.2.  The link state database
  6143.  
  6144.     A router has a separate    link state database for    every area to
  6145.     which it belongs. All routers belonging    to the same area have
  6146.     identical link state databases for the area.
  6147.  
  6148.     The databases for each individual area are always dealt    with
  6149.     separately.  The shortest path calculation is performed
  6150.     separately for each area (see Section 16).  Components of the
  6151.     area link-state    database are flooded throughout    the area only.
  6152.     Finally, when an adjacency (belonging to Area A) is being
  6153.     brought    up, only the database for Area A is synchronized between
  6154.     the two    routers.
  6155.  
  6156.     The area database is composed of router-LSAs, network-LSAs and
  6157.  
  6158.  
  6159.  
  6160. Moy                                  [Page 110]
  6161.  
  6162. Internet Draft             OSPF Version 2           February 1997
  6163.  
  6164.  
  6165.     summary-LSAs (all listed in the    area data structure).  In
  6166.     addition, external routes (AS-external-LSAs) are included in all
  6167.     non-stub area databases    (see Section 3.6).
  6168.  
  6169.     An implementation of OSPF must be able to access individual
  6170.     pieces of an area database.  This lookup function is based on an
  6171.     LSA's LS type, Link State ID and Advertising Router.[14] There
  6172.     will be    a single instance (the most up-to-date)    of each    LSA in
  6173.     the database.  The database lookup function is invoked during
  6174.     the LSA    flooding procedure (Section 13)    and the    routing    table
  6175.     calculation (Section 16).  In addition,    using this lookup
  6176.     function the router can    determine whether it has itself    ever
  6177.     originated a particular    LSA, and if so,    with what LS sequence
  6178.     number.
  6179.  
  6180.     An LSA is added    to a router's database when either a) it is
  6181.     received during    the flooding process (Section 13) or b)    it is
  6182.     originated by the router itself    (Section 12.4).     An LSA    is
  6183.     deleted    from a router's    database when either a)    it has been
  6184.     overwritten by a newer instance    during the flooding process
  6185.     (Section 13) or    b) the router originates a newer instance of one
  6186.     of its self-originated LSAs (Section 12.4) or c) the LSA ages
  6187.     out and    is flushed from    the routing domain (Section 14).
  6188.     Whenever an LSA    is deleted from    the database it    must also be
  6189.     removed    from all neighbors' Link state retransmission lists (see
  6190.     Section    10).
  6191.  
  6192.  
  6193.     12.3.  Representation of TOS
  6194.  
  6195.     All OSPF LSAs (with the    exception of network-LSAs) specify
  6196.     metrics.  In router-LSAs, the metrics indicate the costs of the
  6197.     described interfaces.  In summary-LSAs and AS-external-LSAs, the
  6198.     metric indicates the cost of the described path.  In all of
  6199.     these LSAs, a separate metric can be specified for each    IP TOS.
  6200.     The encoding of    TOS in OSPF LSAs is specified in Table 17. That
  6201.     table relates the OSPF encoding    to the IP packet header's TOS
  6202.     field (defined in [Ref12]).  The OSPF encoding is expressed as a
  6203.     decimal    integer, and the IP packet header's TOS    field is
  6204.     expressed in the binary    TOS values used    in [Ref12].
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216. Moy                                  [Page 111]
  6217.  
  6218. Internet Draft             OSPF Version 2           February 1997
  6219.  
  6220.  
  6221.  
  6222.             OSPF encoding   RFC    1349 TOS values
  6223.             ___________________________________________
  6224.             0            0000 normal    service
  6225.             2            0001 minimize monetary cost
  6226.             4            0010 maximize reliability
  6227.             6            0011
  6228.             8            0100 maximize throughput
  6229.             10            0101
  6230.             12            0110
  6231.             14            0111
  6232.             16            1000 minimize delay
  6233.             18            1001
  6234.             20            1010
  6235.             22            1011
  6236.             24            1100
  6237.             26            1101
  6238.             28            1110
  6239.             30            1111
  6240.  
  6241.  
  6242.             Table 17: Representing TOS in OSPF.
  6243.  
  6244.  
  6245.     Each OSPF LSA must specify the TOS 0 metric.  Other TOS    metrics,
  6246.     if they    appear,    must appear in order of    increasing TOS encoding.
  6247.     For example, the TOS 8 (maximize throughput) metric must always
  6248.     appear before the TOS 16 (minimize delay) metric when both are
  6249.     specified.  If a metric    for some non-zero TOS is not specified,
  6250.     its cost defaults to the cost for TOS 0, unless    the T-bit is
  6251.     reset in the LSA's Options field (see Section 12.1.2 for more
  6252.     details).
  6253.  
  6254.  
  6255.     12.4.  Originating LSAs
  6256.  
  6257.     Into any given OSPF area, a router will    originate several LSAs.
  6258.     Each router originates a router-LSA.  If the router is also the
  6259.     Designated Router for any of the area's    networks, it will
  6260.     originate network-LSAs for those networks.
  6261.  
  6262.     Area border routers originate a    single summary-LSA for each
  6263.     known inter-area destination.  AS boundary routers originate a
  6264.     single AS-external-LSA for each    known AS external destination.
  6265.     Destinations are advertised one    at a time so that the change in
  6266.     any single route can be    flooded    without    reflooding the entire
  6267.     collection of routes.  During the flooding procedure, many LSAs
  6268.     can be carried by a single Link    State Update packet.
  6269.  
  6270.  
  6271.  
  6272. Moy                                  [Page 112]
  6273.  
  6274. Internet Draft             OSPF Version 2           February 1997
  6275.  
  6276.  
  6277.     As an example, consider    Router RT4 in Figure 6.     It is an area
  6278.     border router, having a    connection to Area 1 and the backbone.
  6279.     Router RT4 originates 5    distinct LSAs into the backbone    (one
  6280.     router-LSA, and    one summary-LSA    for each of the    networks N1-N4).
  6281.     Router RT4 will    also originate 8 distinct LSAs into Area 1 (one
  6282.     router-LSA and seven summary-LSAs as pictured in Figure    7).  If
  6283.     RT4 has    been selected as Designated Router for Network N3, it
  6284.     will also originate a network-LSA for N3 into Area 1.
  6285.  
  6286.     In this    same figure, Router RT5    will be    originating 3 distinct
  6287.     AS-external-LSAs (one for each of the networks N12-N14).  These
  6288.     will be    flooded    throughout the entire AS, assuming that    none of
  6289.     the areas have been configured as stubs.  However, if area 3 has
  6290.     been configured    as a stub area,    the AS-external-LSAs for
  6291.     networks N12-N14 will not be flooded into area 3 (see Section
  6292.     3.6).  Instead,    Router RT11 would originate a default summary-
  6293.     LSA that would be flooded throughout area 3 (see Section
  6294.     12.4.3).  This instructs all of    area 3's internal routers to
  6295.     send their AS external traffic to RT11.
  6296.  
  6297.     Whenever a new instance    of an LSA is originated, its LS    sequence
  6298.     number is incremented, its LS age is set to 0, its LS checksum
  6299.     is calculated, and the LSA is added to the link    state database
  6300.     and flooded out    the appropriate    interfaces.  See Section 13.2
  6301.     for details concerning the installation    of the LSA into    the link
  6302.     state database.     See Section 13.3 for details concerning the
  6303.     flooding of newly originated LSAs.
  6304.  
  6305.  
  6306.     The ten    events that can    cause a    new instance of    an LSA to be
  6307.     originated are:
  6308.  
  6309.  
  6310.     (1) The    LS age field of    one of the router's self-originated LSAs
  6311.         reaches the    value LSRefreshTime. In    this case, a new
  6312.         instance of    the LSA    is originated, even though the contents
  6313.         of the LSA (apart from the LSA header) will    be the same.
  6314.         This guarantees periodic originations of all LSAs.    This
  6315.         periodic updating of LSAs adds robustness to the link state
  6316.         algorithm.    LSAs that solely describe unreachable
  6317.         destinations should    not be refreshed, but should instead be
  6318.         flushed from the routing domain (see Section 14.1).
  6319.  
  6320.  
  6321.     When whatever is being described by an LSA changes, a new LSA is
  6322.     originated.  However, two instances of the same    LSA may    not be
  6323.     originated within the time period MinLSInterval.  This may
  6324.     require    that the generation of the next    instance be delayed by
  6325.  
  6326.  
  6327.  
  6328. Moy                                  [Page 113]
  6329.  
  6330. Internet Draft             OSPF Version 2           February 1997
  6331.  
  6332.  
  6333.     up to MinLSInterval.  The following events may cause the
  6334.     contents of an LSA to change.  These events should cause new
  6335.     originations if    and only if the    contents of the    new LSA    would be
  6336.     different:
  6337.  
  6338.  
  6339.     (2) An interface's state changes (see Section 9.1).  This may
  6340.         mean that it is necessary to produce a new instance    of the
  6341.         router-LSA.
  6342.  
  6343.     (3) An attached    network's Designated Router changes.  A    new
  6344.         router-LSA should be originated.  Also, if the router itself
  6345.         is now the Designated Router, a new    network-LSA should be
  6346.         produced.  If the router itself is no longer the Designated
  6347.         Router, any    network-LSA that it might have originated for
  6348.         the    network    should be flushed from the routing domain (see
  6349.         Section 14.1).
  6350.  
  6351.     (4) One    of the neighboring routers changes to/from the FULL
  6352.         state.  This may mean that it is necessary to produce a new
  6353.         instance of    the router-LSA.     Also, if the router is    itself
  6354.         the    Designated Router for the attached network, a new
  6355.         network-LSA    should be produced.
  6356.  
  6357.  
  6358.     The next four events concern area border routers only:
  6359.  
  6360.  
  6361.     (5) An intra-area route    has been added/deleted/modified    in the
  6362.         routing table.  This may cause a new instance of a summary-
  6363.         LSA    (for this route) to be originated in each attached area
  6364.         (possibly including    the backbone).
  6365.  
  6366.     (6) An inter-area route    has been added/deleted/modified    in the
  6367.         routing table.  This may cause a new instance of a summary-
  6368.         LSA    (for this route) to be originated in each attached area
  6369.         (but NEVER for the backbone).
  6370.  
  6371.     (7) The    router becomes newly attached to an area.  The router
  6372.         must then originate    summary-LSAs into the newly attached
  6373.         area for all pertinent intra-area and inter-area routes in
  6374.         the    router's routing table.     See Section 12.4.3 for    more
  6375.         details.
  6376.  
  6377.     (8) When the state of one of the router's configured virtual
  6378.         links changes, it may be necessary to originate a new
  6379.         router-LSA into the    virtual    link's Transit area (see the
  6380.         discussion of the router-LSA's bit V in Section 12.4.1), as
  6381.  
  6382.  
  6383.  
  6384. Moy                                  [Page 114]
  6385.  
  6386. Internet Draft             OSPF Version 2           February 1997
  6387.  
  6388.  
  6389.         well as originating    a new router-LSA into the backbone.
  6390.  
  6391.  
  6392.     The last two events concern AS boundary    routers    (and former AS
  6393.     boundary routers) only:
  6394.  
  6395.  
  6396.     (9) An external    route gained through direct experience with an
  6397.         external routing protocol (like BGP) changes.  This    will
  6398.         cause an AS    boundary router    to originate a new instance of
  6399.         an AS-external-LSA.
  6400.  
  6401.     (10)
  6402.         A router ceases to be an AS    boundary router, perhaps after
  6403.         restarting.    In this    situation the router should flush all
  6404.         AS-external-LSAs that it had previously originated.     These
  6405.         LSAs can be    flushed    via the    premature aging    procedure
  6406.         specified in Section 14.1.
  6407.  
  6408.  
  6409.     The construction of each type of LSA is    explained in detail
  6410.     below.    In general, these sections describe the    contents of the
  6411.     LSA body (i.e.,    the part coming    after the 20-byte LSA header).
  6412.     For information    concerning the building    of the LSA header, see
  6413.     Section    12.1.
  6414.  
  6415.     12.4.1.     Router-LSAs
  6416.  
  6417.         A router originates    a router-LSA for each area that    it
  6418.         belongs to.     Such an LSA describes the collected states of
  6419.         the    router's links to the area.  The LSA is    flooded
  6420.         throughout the particular area, and    no further.
  6421.  
  6422.         The    format of a router-LSA is shown    in Appendix A (Section
  6423.         A.4.2).  The first 20 bytes    of the LSA consist of the
  6424.         generic LSA    header that was    discussed in Section 12.1.
  6425.         router-LSAs    have LS    type = 1.  The router indicates    whether
  6426.         it is willing to calculate separate    routes for each    IP TOS
  6427.         by setting (or resetting) the T-bit    of the LSA's Options
  6428.         field.
  6429.  
  6430.         A router also indicates whether it is an area border router,
  6431.         or an AS boundary router, by setting the appropriate bits
  6432.         (bit B and bit E, respectively) in its router-LSAs.    This
  6433.         enables paths to those types of routers to be saved    in the
  6434.         routing table, for later processing    of summary-LSAs    and AS-
  6435.         external-LSAs.  Bit    B should be set    whenever the router is
  6436.         actively attached to two or    more areas, even if the    router
  6437.  
  6438.  
  6439.  
  6440. Moy                                  [Page 115]
  6441.  
  6442. Internet Draft             OSPF Version 2           February 1997
  6443.  
  6444.  
  6445.  
  6446.           ....................................
  6447.           . 192.1.2              Area 1 .
  6448.           .    +                 .
  6449.           .    |                 .
  6450.           .    | 3+---+1             .
  6451.           .  N1    |--|RT1|-----+             .
  6452.           .    |  +---+      \             .
  6453.           .    |           \  _______N3  .
  6454.           .    +        \/     \   .    1+---+
  6455.           .            * 192.1.1 *------|RT4|
  6456.           .    +        /\_______/   .     +---+
  6457.           .    |           /     |         .
  6458.           .    | 3+---+1     /         |         .
  6459.           .  N2    |--|RT2|-----+        1|         .
  6460.           .    |  +---+       +---+8    .           6+---+
  6461.           .    |           |RT3|----------------|RT6|
  6462.           .    +           +---+     .        +---+
  6463.           . 192.1.3             |2         .     18.10.0.6|7
  6464.           .                 |         .          |
  6465.           .              +------------+ .
  6466.           .            192.1.4    (N4) .
  6467.           ....................................
  6468.  
  6469.  
  6470.             Figure 15: Area 1 with IP addresses    shown
  6471.  
  6472.         is not currently attached to the OSPF backbone area.  Bit E
  6473.         should never be set    in a router-LSA    for a stub area    (stub
  6474.         areas cannot contain AS boundary routers).
  6475.  
  6476.         In addition, the router sets bit V in its router-LSA for
  6477.         Area A if and only if the router is    the endpoint of    one or
  6478.         more fully adjacent    virtual    links having Area A as their
  6479.         Transit area. The setting of bit V enables other routers in
  6480.         Area A to discover whether the area    supports transit traffic
  6481.         (see TransitCapability in Section 6).
  6482.  
  6483.         The    router-LSA then    describes the router's working
  6484.         connections    (i.e., interfaces or links) to the area.  Each
  6485.         link is typed according to the kind    of attached network.
  6486.         Each link is also labelled with its    Link ID.  This Link ID
  6487.         gives a name to the    entity that is on the other end    of the
  6488.         link.  Table 18 summarizes the values used for the Type and
  6489.         Link ID fields.
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496. Moy                                  [Page 116]
  6497.  
  6498. Internet Draft             OSPF Version 2           February 1997
  6499.  
  6500.  
  6501.  
  6502.            Link    type   Description     Link ID
  6503.            __________________________________________________
  6504.            1           Point-to-point     Neighbor Router ID
  6505.                    link
  6506.            2           Link to transit     Interface address of
  6507.                    network         Designated Router
  6508.            3           Link to stub     IP network number
  6509.                    network
  6510.            4           Virtual link     Neighbor Router ID
  6511.  
  6512.  
  6513.                Table 18: Link descriptions in the
  6514.                       router-LSA.
  6515.  
  6516.  
  6517.         In addition, the Link Data field is    specified for each link.
  6518.         This field gives 32    bits of    extra information for the link.
  6519.         For    links to transit networks, numbered point-to-point links
  6520.         and    virtual    links, this field specifies the    IP interface
  6521.         address of the associated router interface (this is    needed
  6522.         by the routing table calculation, see Section 16.1.1).  For
  6523.         links to stub networks, this field specifies the stub
  6524.         network's IP address mask.    For unnumbered point-to-point
  6525.         links, the Link Data field should be set to    the unnumbered
  6526.         interface's    MIB-II [Ref8] ifIndex value.
  6527.  
  6528.         Finally, the cost of using the link    for output (possibly
  6529.         specifying a different cost    for each Type of Service) is
  6530.         specified.    The output cost    of a link is configurable.  With
  6531.         the    exception of links to stub networks, the output    cost
  6532.         must always    be non-zero.
  6533.  
  6534.         To further describe    the process of building    the list of link
  6535.         descriptions, suppose a router wishes to build a router-LSA
  6536.         for    Area A.     The router examines its collection of interface
  6537.         data structures.  For each interface, the following    steps
  6538.         are    taken:
  6539.  
  6540.  
  6541.         o    If the attached    network    does not belong    to Area    A, no
  6542.         links are added    to the LSA, and    the next interface
  6543.         should be examined.
  6544.  
  6545.         o    If the state of    the interface is Down, no links    are
  6546.         added.
  6547.  
  6548.  
  6549.  
  6550.  
  6551.  
  6552. Moy                                  [Page 117]
  6553.  
  6554. Internet Draft             OSPF Version 2           February 1997
  6555.  
  6556.  
  6557.         o    If the state of    the interface is Loopback, add a Type 3
  6558.         link (stub network) as long as this is not an interface
  6559.         to an unnumbered point-to-point    network.  The Link ID
  6560.         should be set to the IP    interface address, the Link Data
  6561.         set to the mask    0xffffffff (indicating a host route),
  6562.         and the    cost set to 0.
  6563.  
  6564.         o    Otherwise, the link descriptions added to the router-LSA
  6565.         depend on the OSPF interface type. Link    descriptions
  6566.         used for point-to-point    interfaces are specified in
  6567.         Section    12.4.1.1, for virtual links in Section 12.4.1.2,
  6568.         for broadcast and NBMA interfaces in 12.4.1.3, and for
  6569.         Point-to-MultiPoint interfaces in 12.4.1.4.
  6570.  
  6571.         After consideration    of all the router interfaces, host links
  6572.         are    added to the router-LSA    by examining the list of
  6573.         attached hosts belonging to    Area A.     A host    route is
  6574.         represented    as a Type 3 link (stub network)    whose Link ID is
  6575.         the    host's IP address, Link    Data is    the mask of all    ones
  6576.         (0xffffffff), and cost the host's configured cost (see
  6577.         Section C.7).
  6578.  
  6579.  
  6580.         12.4.1.1.  Describing point-to-point interfaces
  6581.  
  6582.         For point-to-point interfaces, one or more link
  6583.         descriptions are added to the router-LSA as follows:
  6584.  
  6585.         o   If the neighboring router is fully adjacent, add a
  6586.             Type 1 link    (point-to-point). The Link ID should be
  6587.             set    to the Router ID of the    neighboring router. For
  6588.             numbered point-to-point networks, the Link Data
  6589.             should specify the IP interface address. For
  6590.             unnumbered point-to-point networks,    the Link Data
  6591.             field should specify the interface's MIB-II    [Ref8]
  6592.             ifIndex value. The cost should be set to the output
  6593.             cost of the    point-to-point interface.
  6594.  
  6595.         o   In addition, as long as the    state of the interface
  6596.             is "Point-to-Point"    (and regardless    of the
  6597.             neighboring    router state), a Type 3    link (stub
  6598.             network) should be added. There are    two forms that
  6599.             this stub link can take:
  6600.  
  6601.             Option 1
  6602.             Assuming that the neighboring router's IP
  6603.             address    is known, set the Link ID of the Type 3
  6604.             link to    the neighbor's IP address, the Link Data
  6605.  
  6606.  
  6607.  
  6608. Moy                                  [Page 118]
  6609.  
  6610. Internet Draft             OSPF Version 2           February 1997
  6611.  
  6612.  
  6613.             to the mask 0xffffffff (indicating a host
  6614.             route),    and the    cost to    the interface's
  6615.             configured output cost.[15]
  6616.  
  6617.             Option 2
  6618.             If a subnet has    been assigned to the point-to-
  6619.             point link, set    the Link ID of the Type    3 link
  6620.             to the subnet's    IP address, the    Link Data to the
  6621.             subnet's mask, and the cost to the interface's
  6622.             configured output cost.[16]
  6623.  
  6624.  
  6625.         12.4.1.2.  Describing broadcast and    NBMA interfaces
  6626.  
  6627.         For operational    broadcast and NBMA interfaces, a single
  6628.         link description is added to the router-LSA as follows:
  6629.  
  6630.         o   If the state of the    interface is Waiting, add a Type
  6631.             3 link (stub network) with Link ID set to the IP
  6632.             network number of the attached network, Link Data
  6633.             set    to the attached    network's address mask,    and cost
  6634.             equal to the interface's configured    output cost.
  6635.  
  6636.         o   Else, there    has been a Designated Router elected for
  6637.             the    attached network.  If the router is fully
  6638.             adjacent to    the Designated Router, or if the router
  6639.             itself is Designated Router    and is fully adjacent to
  6640.             at least one other router, add a single Type 2 link
  6641.             (transit network) with Link    ID set to the IP
  6642.             interface address of the attached network's
  6643.             Designated Router (which may be the    router itself),
  6644.             Link Data set to the router's own IP interface
  6645.             address, and cost equal to the interface's
  6646.             configured output cost.  Otherwise,    add a link as if
  6647.             the    interface state    were Waiting (see above).
  6648.  
  6649.  
  6650.         12.4.1.3.  Describing virtual links
  6651.  
  6652.         For virtual links, a link description is added to the
  6653.         router-LSA only    when the virtual neighbor is fully
  6654.         adjacent. In this case,    add a Type 4 link (virtual link)
  6655.         with Link ID set to the    Router ID of the virtual
  6656.         neighbor, Link Data set    to the IP interface address
  6657.         associated with    the virtual link and cost set to the
  6658.         cost calculated    for the    virtual    link during the    routing
  6659.         table calculation (see Section 15).
  6660.  
  6661.  
  6662.  
  6663.  
  6664. Moy                                  [Page 119]
  6665.  
  6666. Internet Draft             OSPF Version 2           February 1997
  6667.  
  6668.  
  6669.         12.4.1.4.  Describing Point-to-MultiPoint interfaces
  6670.  
  6671.         For operational    Point-to-MultiPoint interfaces,    one or
  6672.         more link descriptions are added to the    router-LSA as
  6673.         follows:
  6674.  
  6675.         o   A single Type 3 link (stub network)    is added with
  6676.             Link ID set    to the router's    own IP interface
  6677.             address, Link Data set to the mask 0xffffffff
  6678.             (indicating    a host route), and cost    set to 0.
  6679.  
  6680.         o   For    each fully adjacent neighbor associated    with the
  6681.             interface, add an additional Type 1    link (point-to-
  6682.             point) with    Link ID    set to the Router ID of    the
  6683.             neighboring    router,    Link Data set to the IP
  6684.             interface address and cost equal to    the interface's
  6685.             configured output cost.
  6686.  
  6687.  
  6688.         12.4.1.5.  Examples    of router-LSAs
  6689.  
  6690.         Consider the router-LSAs generated by Router RT3, as
  6691.         pictured in Figure 6.  The area    containing Router RT3
  6692.         (Area 1) has been redrawn, with    actual network
  6693.         addresses, in Figure 15.  Assume that the last byte of
  6694.         all of RT3's interface addresses is 3, giving it the
  6695.         interface addresses 192.1.1.3 and 192.1.4.3, and that
  6696.         the other routers have similar addressing schemes.  In
  6697.         addition, assume that all links    are functional,    and that
  6698.         Router IDs are assigned    as the smallest    IP interface
  6699.         address.
  6700.  
  6701.         RT3 originates two router-LSAs,    one for    Area 1 and one
  6702.         for the    backbone.  Assume that Router RT4 has been
  6703.         selected as the    Designated router for network 192.1.1.0.
  6704.         RT3's router-LSA for Area 1 is then shown below.  It
  6705.         indicates that RT3 has two connections to Area 1, the
  6706.         first a    link to    the transit network 192.1.1.0 and the
  6707.         second a link to the stub network 192.1.4.0.  Note that
  6708.         the transit network is identified by the IP interface of
  6709.         its Designated Router (i.e., the Link ID = 192.1.1.4
  6710.         which is the Designated    Router RT4's IP    interface to
  6711.         192.1.1.0).  Note also that RT3    has indicated that it is
  6712.         capable    of calculating separate    routes based on    IP TOS,
  6713.         through    setting    the T-bit in the Options field.     It has
  6714.         also indicated that it is an area border router.
  6715.  
  6716.           ; RT3's router-LSA for Area 1
  6717.  
  6718.  
  6719.  
  6720. Moy                                  [Page 120]
  6721.  
  6722. Internet Draft             OSPF Version 2           February 1997
  6723.  
  6724.  
  6725.           LS age = 0             ;always true on origination
  6726.           Options = (T-bit|E-bit)     ;TOS-capable
  6727.           LS type = 1             ;indicates router-LSA
  6728.           Link State ID    = 192.1.1.3     ;RT3's    Router ID
  6729.           Advertising Router = 192.1.1.3 ;RT3's    Router ID
  6730.           bit E    = 0             ;not an AS boundary router
  6731.           bit B    = 1             ;area border router
  6732.           #links = 2
  6733.              Link ID = 192.1.1.4     ;IP address of    Desig. Rtr.
  6734.              Link Data = 192.1.1.3     ;RT3's    IP interface to    net
  6735.              Type =    2         ;connects to transit network
  6736.              # other metrics = 0
  6737.              TOS 0 metric =    1
  6738.  
  6739.              Link ID = 192.1.4.0     ;IP Network number
  6740.              Link Data = 0xffffff00     ;Network mask
  6741.              Type =    3         ;connects to stub network
  6742.              # other metrics = 0
  6743.              TOS 0 metric =    2
  6744.  
  6745.         Next RT3's router-LSA for the backbone is shown.  It
  6746.         indicates that RT3 has a single    attachment to the
  6747.         backbone.  This    attachment is via an unnumbered    point-
  6748.         to-point link to Router    RT6.  RT3 has again indicated
  6749.         that it    is TOS-capable,    and that it is an area border
  6750.         router.
  6751.  
  6752.           ; RT3's router-LSA for the backbone
  6753.  
  6754.           LS age = 0             ;always true on origination
  6755.           Options = (T-bit|E-bit)     ;TOS-capable
  6756.           LS type = 1             ;indicates router-LSA
  6757.           Link State ID    = 192.1.1.3     ;RT3's    router ID
  6758.           Advertising Router = 192.1.1.3 ;RT3's    router ID
  6759.           bit E    = 0             ;not an AS boundary router
  6760.           bit B    = 1             ;area border router
  6761.           #links = 1
  6762.              Link ID = 18.10.0.6     ;Neighbor's Router ID
  6763.              Link Data = 0.0.0.3     ;MIB-II ifIndex of P-P    link
  6764.              Type =    1         ;connects to router
  6765.              # other metrics = 0
  6766.              TOS 0 metric =    8
  6767.  
  6768.         Even though Router RT3 has indicated that it is    TOS-
  6769.         capable    in the above examples, only a single metric (the
  6770.         TOS 0 metric) has been specified for each interface.
  6771.         Different metrics can be specified for each TOS.  The
  6772.         encoding of TOS    in OSPF    LSAs is    described in Section
  6773.  
  6774.  
  6775.  
  6776. Moy                                  [Page 121]
  6777.  
  6778. Internet Draft             OSPF Version 2           February 1997
  6779.  
  6780.  
  6781.         12.3.
  6782.  
  6783.         As an example, suppose the point-to-point link between
  6784.         Routers    RT3 and    RT6 in Figure 15 is a satellite    link.
  6785.         The AS administrator may want to encourage the use of
  6786.         the line for high bandwidth traffic.  This would be done
  6787.         by setting the metric artificially low for the
  6788.         appropriate TOS    value.    Router RT3 would then originate
  6789.         the following router-LSA for the backbone (TOS 8 =
  6790.         maximize throughput):
  6791.  
  6792.           ; RT3's router-LSA for the backbone
  6793.  
  6794.           LS age = 0              ;always true on origination
  6795.           Options = (T-bit|E-bit)     ;TOS-capable
  6796.           LS type = 1              ;indicates router-LSA
  6797.           Link State ID    = 192.1.1.3   ;RT3's Router ID
  6798.           Advertising Router = 192.1.1.3
  6799.           bit E    = 0              ;not an AS boundary router
  6800.           bit B    = 1              ;area border router
  6801.           #links = 1
  6802.              Link ID = 18.10.0.6  ;Neighbor's Router ID
  6803.              Link Data = 0.0.0.3  ;MIB-II ifIndex of P-P link
  6804.              Type =    1          ;connects    to router
  6805.              # other metrics = 1
  6806.              TOS 0 metric =    8
  6807.                  TOS = 8      ;maximize    throughput
  6808.                  metric    = 1   ;traffic preferred
  6809.  
  6810.  
  6811.     12.4.2.     Network-LSAs
  6812.  
  6813.         A network-LSA is generated for every transit broadcast or
  6814.         NBMA network.  (A transit network is a network having two or
  6815.         more attached routers).  The network-LSA describes all the
  6816.         routers that are attached to the network.
  6817.  
  6818.         The    Designated Router for the network originates the LSA.
  6819.         The    Designated Router originates the LSA only if it    is fully
  6820.         adjacent to    at least one other router on the network.  The
  6821.         network-LSA    is flooded throughout the area that contains the
  6822.         transit network, and no further.  The network-LSA lists
  6823.         those routers that are fully adjacent to the Designated
  6824.         Router; each fully adjacent    router is identified by    its OSPF
  6825.         Router ID.    The Designated Router includes itself in this
  6826.         list.
  6827.  
  6828.         The    Link State ID for a network-LSA    is the IP interface
  6829.  
  6830.  
  6831.  
  6832. Moy                                  [Page 122]
  6833.  
  6834. Internet Draft             OSPF Version 2           February 1997
  6835.  
  6836.  
  6837.         address of the Designated Router.  This value, masked by the
  6838.         network's address mask (which is also contained in the
  6839.         network-LSA) yields    the network's IP address.
  6840.  
  6841.         A router that has formerly been the    Designated Router for a
  6842.         network, but is no longer, should flush the    network-LSA that
  6843.         it had previously originated.  This    LSA is no longer used in
  6844.         the    routing    table calculation.  It is flushed by prematurely
  6845.         incrementing the LSA's age to MaxAge and reflooding    (see
  6846.         Section 14.1). In addition,    in those rare cases where a
  6847.         router's Router ID has changed, any    network-LSAs that were
  6848.         originated with the    router's previous Router ID must be
  6849.         flushed. Since the router may have no idea what it's
  6850.         previous Router ID might have been,    these network-LSAs are
  6851.         indicated by having    their Link State ID equal to one of the
  6852.         router's IP    interface addresses and    their Advertising Router
  6853.         equal to some value    other than the router's    current    Router
  6854.         ID (see Section 13.4 for more details).
  6855.  
  6856.  
  6857.         12.4.2.1.  Examples    of network-LSAs
  6858.  
  6859.         Again consider the area    configuration in Figure    6.
  6860.         Network-LSAs are originated for    Network    N3 in Area 1,
  6861.         Networks N6 and    N8 in Area 2, and Network N9 in    Area 3.
  6862.         Assuming that Router RT4 has been selected as the
  6863.         Designated Router for Network N3, the following
  6864.         network-LSA is generated by RT4    on behalf of Network N3
  6865.         (see Figure 15 for the address assignments):
  6866.  
  6867.           ; Network-LSA    for Network N3
  6868.  
  6869.           LS age = 0             ;always true on origination
  6870.           Options = (T-bit|E-bit)     ;TOS-capable
  6871.           LS type = 2             ;indicates network-LSA
  6872.           Link State ID    = 192.1.1.4     ;IP address of    Desig. Rtr.
  6873.           Advertising Router = 192.1.1.4 ;RT4's    Router ID
  6874.           Network Mask = 0xffffff00
  6875.              Attached Router = 192.1.1.4    ;Router    ID
  6876.              Attached Router = 192.1.1.1    ;Router    ID
  6877.              Attached Router = 192.1.1.2    ;Router    ID
  6878.              Attached Router = 192.1.1.3    ;Router    ID
  6879.  
  6880.  
  6881.     12.4.3.     Summary-LSAs
  6882.  
  6883.         The    destination described by a summary-LSA is either an IP
  6884.         network, an    AS boundary router or a    range of IP addresses.
  6885.  
  6886.  
  6887.  
  6888. Moy                                  [Page 123]
  6889.  
  6890. Internet Draft             OSPF Version 2           February 1997
  6891.  
  6892.  
  6893.         Summary-LSAs are flooded throughout    a single area only.  The
  6894.         destination    described is one that is external to the area,
  6895.         yet    still belongs to the Autonomous    System.
  6896.  
  6897.         Summary-LSAs are originated    by area    border routers.     The
  6898.         precise summary routes to advertise    into an    area are
  6899.         determined by examining the    routing    table structure    (see
  6900.         Section 11)    in accordance with the algorithm described
  6901.         below. Note    that only intra-area routes are    advertised into
  6902.         the    backbone, while    both intra-area    and inter-area routes
  6903.         are    advertised into    the other areas.
  6904.  
  6905.         To determine which routes to advertise into    an attached Area
  6906.         A, each routing table entry    is processed as    follows.
  6907.         Remember that each routing table entry describes a set of
  6908.         equal-cost best paths to a particular destination:
  6909.  
  6910.  
  6911.         o    Only Destination Types of network and AS boundary router
  6912.         are advertised in summary-LSAs.     If the    routing    table
  6913.         entry's    Destination Type is area border    router,    examine
  6914.         the next routing table entry.
  6915.  
  6916.         o    AS external routes are never advertised    in summary-LSAs.
  6917.         If the routing table entry has Path-type of type 1
  6918.         external or type 2 external, examine the next routing
  6919.         table entry.
  6920.  
  6921.         o    Else, if the area associated with this set of paths is
  6922.         the Area A itself, do not generate a summary-LSA for the
  6923.         route.[17]
  6924.  
  6925.         o    Else, if the next hops associated with this set    of paths
  6926.         belong to Area A itself, do not    generate a summary-LSA
  6927.         for the    route.[18] This    is the logical equivalent of a
  6928.         Distance Vector    protocol's split horizon logic.
  6929.  
  6930.         o    Else, if the routing table cost    equals or exceeds the
  6931.         value LSInfinity, a summary-LSA    cannot be generated for
  6932.         this route.
  6933.  
  6934.         o    Else, if the destination of this route is an AS    boundary
  6935.         router,    a summary-LSA should be    originated if and only
  6936.         if the routing table entry describes the preferred path
  6937.         to the AS boundary router (see Step 3 of Section 16.4).
  6938.         If so, a Type 4    summary-LSA is originated for the
  6939.         destination, with Link State ID    equal to the AS    boundary
  6940.         router's Router    ID and metric equal to the routing table
  6941.  
  6942.  
  6943.  
  6944. Moy                                  [Page 124]
  6945.  
  6946. Internet Draft             OSPF Version 2           February 1997
  6947.  
  6948.  
  6949.         entry's    cost. Note: these LSAs should not be generated
  6950.         if Area    A has been configured as a stub    area.
  6951.  
  6952.         o    Else, the Destination type is network. If this is an
  6953.         inter-area route, generate a Type 3 summary-LSA    for the
  6954.         destination, with Link State ID    equal to the network's
  6955.         address    (if necessary, the Link    State ID can also have
  6956.         one or more of the network's host bits set; see    Appendix
  6957.         E for details) and metric equal    to the routing table
  6958.         cost.
  6959.  
  6960.         o    The one    remaining case is an intra-area    route to a
  6961.         network.  This means that the network is contained in
  6962.         one of the router's directly attached areas.  In
  6963.         general, this information must be condensed before
  6964.         appearing in summary-LSAs.  Remember that an area has a
  6965.         configured list    of address ranges, each    range consisting
  6966.         of an [address,mask] pair and a    status indication of
  6967.         either Advertise or DoNotAdvertise.  At    most a single
  6968.         Type 3 summary-LSA is originated for each range. When
  6969.         the range's status indicates Advertise,    a Type 3
  6970.         summary-LSA is generated with Link State ID equal to the
  6971.         range's    address    (if necessary, the Link    State ID can
  6972.         also have one or more of the range's "host" bits set;
  6973.         see Appendix E for details) and    cost equal to the
  6974.         largest    cost of    any of the component networks. When the
  6975.         range's    status indicates DoNotAdvertise, the Type 3
  6976.         summary-LSA is suppressed and the component networks
  6977.         remain hidden from other areas.
  6978.  
  6979.         By default, if a network is not    contained in any
  6980.         explicitly configured address range, a Type 3 summary-
  6981.         LSA is generated with Link State ID equal to the
  6982.         network's address (if necessary, the Link State    ID can
  6983.         also have one or more of the network's "host" bits set;
  6984.         see Appendix E for details) and    metric equal to    the
  6985.         network's routing table    cost.
  6986.  
  6987.         If an area is capable of carrying transit traffic (i.e.,
  6988.         its TransitCapability is set to    TRUE), routing
  6989.         information concerning backbone    networks should    not be
  6990.         condensed before being summarized into the area.  Nor
  6991.         should the advertisement of backbone networks into
  6992.         transit    areas be suppressed.  In other words, the
  6993.         backbone's configured ranges should be ignored when
  6994.         originating summary-LSAs into transit areas.
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000. Moy                                  [Page 125]
  7001.  
  7002. Internet Draft             OSPF Version 2           February 1997
  7003.  
  7004.  
  7005.         If a router    advertises a summary-LSA for a destination which
  7006.         then becomes unreachable, the router must then flush the LSA
  7007.         from the routing domain by setting its age to MaxAge and
  7008.         reflooding (see Section 14.1).  Also, if the destination is
  7009.         still reachable, yet can no    longer be advertised according
  7010.         to the above procedure (e.g., it is    now an inter-area route,
  7011.         when it used to be an intra-area route associated with some
  7012.         non-backbone area; it would    thus no    longer be advertisable
  7013.         to the backbone), the LSA should also be flushed from the
  7014.         routing domain.
  7015.  
  7016.         For    the destination    described by a summary-LSA there may be
  7017.         separate sets of paths, and    therefore separate routing table
  7018.         entries, for each Type of Service.    All these entries must
  7019.         be considered when building    the summary-LSA    for the
  7020.         destination; a single LSA must specify the separate    costs
  7021.         (if    they exist) for    each TOS.  The encoding    of TOS in OSPF
  7022.         LSAs is described in Section 12.3.
  7023.  
  7024.         Clearing the T-bit in the Options field of a summary-LSA
  7025.         indicates that there is a TOS 0 path to the    destination, but
  7026.         no paths for non-zero TOS.    This can happen    when non-TOS-
  7027.         capable routers exist in the routing domain    (see Section
  7028.         2.5).
  7029.  
  7030.  
  7031.         12.4.3.1.  Originating summary-LSAs    into stub areas
  7032.  
  7033.         The algorithm in Section 12.4.3    is optional when Area A
  7034.         is an OSPF stub    area. Area border routers connecting to
  7035.         a stub area can    originate summary-LSAs into the    area
  7036.         according to the Section 12.4.3's algorithm, or    can
  7037.         choose to originate only a subset of the summary-LSAs,
  7038.         possibly under configuration control.  The fewer LSAs
  7039.         originated, the    smaller    the stub area's    link state
  7040.         database, further reducing the demands on its routers'
  7041.         resources. However, omitting LSAs may also lead    to sub-
  7042.         optimal    inter-area routing, although routing will
  7043.         continue to function.
  7044.  
  7045.         As specified in    Section    12.4.3,    Type 4 summary-LSAs
  7046.         (ASBR-summary-LSAs) are    never originated into stub
  7047.         areas.
  7048.  
  7049.         In a stub area,    instead    of importing external routes
  7050.         each area border router    originates a "default summary-
  7051.         LSA" into the area. The    Link State ID for the default
  7052.         summary-LSA is set to DefaultDestination, and the metric
  7053.  
  7054.  
  7055.  
  7056. Moy                                  [Page 126]
  7057.  
  7058. Internet Draft             OSPF Version 2           February 1997
  7059.  
  7060.  
  7061.         set to the (per-area) configurable parameter
  7062.         StubDefaultCost.  Note that StubDefaultCost need not be
  7063.         configured identically in all of the stub area's area
  7064.         border routers.
  7065.  
  7066.  
  7067.         12.4.3.2.  Examples    of summary-LSAs
  7068.  
  7069.         Consider again the area    configuration in Figure    6.
  7070.         Routers    RT3, RT4, RT7, RT10 and    RT11 are all area border
  7071.         routers, and therefore are originating summary-LSAs.
  7072.         Consider in particular Router RT4.  Its    routing    table
  7073.         was calculated as the example in Section 11.3.    RT4
  7074.         originates summary-LSAs    into both the backbone and Area
  7075.         1.  Into the backbone, Router RT4 originates separate
  7076.         LSAs for each of the networks N1-N4.  Into Area    1,
  7077.         Router RT4 originates separate LSAs for    networks N6-N8
  7078.         and the    AS boundary routers RT5,RT7.  It also condenses
  7079.         host routes Ia and Ib into a single summary-LSA.
  7080.         Finally, the routes to networks    N9,N10,N11 and Host H1
  7081.         are advertised by a single summary-LSA.     This
  7082.         condensation was originally performed by the router
  7083.         RT11.
  7084.  
  7085.         These LSAs are illustrated graphically in Figures 7 and
  7086.         8.  Two    of the summary-LSAs originated by Router RT4
  7087.         follow.     The actual IP addresses for the networks and
  7088.         routers    in question have been assigned in Figure 15.
  7089.  
  7090.           ; Summary-LSA    for Network N1,
  7091.           ; originated by Router RT4 into the backbone
  7092.  
  7093.           LS age = 0              ;always true on origination
  7094.           Options = (T-bit|E-bit)     ;TOS-capable
  7095.           LS type = 3              ;Type 3 summary-LSA
  7096.           Link State ID    = 192.1.2.0   ;N1's IP network number
  7097.           Advertising Router = 192.1.1.4       ;RT4's ID
  7098.              TOS = 0
  7099.              metric    = 4
  7100.  
  7101.           ; Summary-LSA    for AS boundary    router RT7
  7102.           ; originated by Router RT4 into Area 1
  7103.  
  7104.           LS age = 0              ;always true on origination
  7105.           Options = (T-bit|E-bit)     ;TOS-capable
  7106.           LS type = 4              ;Type 4 summary-LSA
  7107.           Link State ID    = Router RT7's ID
  7108.           Advertising Router = 192.1.1.4       ;RT4's ID
  7109.  
  7110.  
  7111.  
  7112. Moy                                  [Page 127]
  7113.  
  7114. Internet Draft             OSPF Version 2           February 1997
  7115.  
  7116.  
  7117.              TOS = 0
  7118.              metric    = 14
  7119.  
  7120.  
  7121.     12.4.4.     AS-external-LSAs
  7122.  
  7123.         AS-external-LSAs describe routes to    destinations external to
  7124.         the    Autonomous System.  Most AS-external-LSAs describe
  7125.         routes to specific external    destinations; in these cases the
  7126.         LSA's Link State ID    is set to the destination network's IP
  7127.         address (if    necessary, the Link State ID can also have one
  7128.         or more of the network's "host" bits set; see Appendix E for
  7129.         details).  However,    a default route    for the    Autonomous
  7130.         System can be described in an AS-external-LSA by setting the
  7131.         LSA's Link State ID    to DefaultDestination (0.0.0.0).  AS-
  7132.         external-LSAs are originated by AS boundary    routers.  An AS
  7133.         boundary router originates a single    AS-external-LSA    for each
  7134.         external route that    it has learned,    either through another
  7135.         routing protocol (such as BGP), or through configuration
  7136.         information.
  7137.  
  7138.         AS-external-LSAs are the only type of LSAs that are    flooded
  7139.         throughout the entire Autonomous System; all other types of
  7140.         LSAs are specific to a single area.     However, AS-external-
  7141.         LSAs are not flooded into/throughout stub areas (see Section
  7142.         3.6).  This    enables    a reduction in link state database size
  7143.         for    routers    internal to stub areas.
  7144.  
  7145.         The    metric that is advertised for an external route    can be
  7146.         one    of two types.  Type 1 metrics are comparable to    the link
  7147.         state metric.  Type    2 metrics are assumed to be larger than
  7148.         the    cost of    any intra-AS path.  As with summary-LSAs, if
  7149.         separate paths exist based on TOS, separate    TOS costs can be
  7150.         included in    the AS-external-LSA The    encoding of TOS    in OSPF
  7151.         LSAs is described in Section 12.3.    If the T-bit of    the
  7152.         LSA's Options field    is clear, no non-zero TOS paths    to the
  7153.         destination    exist.
  7154.  
  7155.         If a router    advertises an AS-external-LSA for a destination
  7156.         which then becomes unreachable, the    router must then flush
  7157.         the    LSA from the routing domain by setting its age to MaxAge
  7158.         and    reflooding (see    Section    14.1).
  7159.  
  7160.  
  7161.         12.4.4.1.  Examples    of AS-external-LSAs
  7162.  
  7163.         Consider once again the    AS pictured in Figure 6.  There
  7164.         are two    AS boundary routers: RT5 and RT7.  Router RT5
  7165.  
  7166.  
  7167.  
  7168. Moy                                  [Page 128]
  7169.  
  7170. Internet Draft             OSPF Version 2           February 1997
  7171.  
  7172.  
  7173.         originates three AS-external-LSAs, for networks    N12-N14.
  7174.         Router RT7 originates two AS-external-LSAs, for    networks
  7175.         N12 and    N15.  Assume that RT7 has learned its route to
  7176.         N12 via    BGP, and that it wishes    to advertise a Type 2
  7177.         metric to the AS.  RT7 would then originate the
  7178.         following LSA for N12:
  7179.  
  7180.           ; AS-external-LSA for    Network    N12,
  7181.           ; originated by Router RT7
  7182.  
  7183.           LS age = 0              ;always true on origination
  7184.           Options = (T-bit|E-bit)     ;TOS-capable
  7185.           LS type = 5              ;AS-external-LSA
  7186.           Link State ID    = N12's    IP network number
  7187.           Advertising Router = Router RT7's ID
  7188.              bit E = 1          ;Type 2 metric
  7189.              TOS = 0
  7190.              metric    = 2
  7191.              Forwarding address = 0.0.0.0
  7192.  
  7193.         In the above example, the forwarding address field has
  7194.         been set to 0.0.0.0, indicating    that packets for the
  7195.         external destination should be forwarded to the
  7196.         advertising OSPF router    (RT7).    This is    not always
  7197.         desirable.  Consider the example pictured in Figure 16.
  7198.         There are three    OSPF routers (RTA, RTB and RTC)
  7199.         connected to a common network.    Only one of these
  7200.         routers, RTA, is exchanging BGP    information with the
  7201.         non-OSPF router    RTX.  RTA must then originate AS-
  7202.         external-LSAs for those    destinations it    has learned from
  7203.         RTX.  By using the AS-external-LSA's forwarding    address
  7204.         field, RTA can specify that packets for    these
  7205.         destinations be    forwarded directly to RTX.  Without this
  7206.         feature, Routers RTB and RTC would take    an extra hop to
  7207.         get to these destinations.
  7208.  
  7209.         Note that when the forwarding address field is non-zero,
  7210.         it should point    to a router belonging to another
  7211.         Autonomous System.
  7212.  
  7213.         A forwarding address can also be specified for the
  7214.         default    route.    For example, in    figure 16 RTA may want
  7215.         to specify that    all externally-destined    packets    should
  7216.         by default be forwarded    to its BGP peer    RTX.  The
  7217.         resulting AS-external-LSA is pictured below.  Note that
  7218.         the Link State ID is set to DefaultDestination.
  7219.  
  7220.           ; Default route, originated by Router    RTA
  7221.  
  7222.  
  7223.  
  7224. Moy                                  [Page 129]
  7225.  
  7226. Internet Draft             OSPF Version 2           February 1997
  7227.  
  7228.  
  7229.           ; Packets forwarded through RTX
  7230.  
  7231.           LS age = 0              ;always true on origination
  7232.           Options = (T-bit|E-bit)       ;TOS-capable
  7233.           LS type = 5              ;AS-external-LSA
  7234.           Link State ID    = DefaultDestination  ;    default    route
  7235.           Advertising Router = Router RTA's ID
  7236.              bit E = 1          ;Type 2 metric
  7237.              TOS = 0
  7238.              metric    = 1
  7239.              Forwarding address = RTX's IP address
  7240.  
  7241.         In figure 16, suppose instead that both    RTA and    RTB
  7242.         exchange BGP information with RTX.  In this case, RTA
  7243.         and RTB    would originate    the same set of    AS-external-
  7244.         LSAs.  These LSAs, if they specify the same metric,
  7245.         would be functionally equivalent since they would
  7246.         specify    the same destination and forwarding address
  7247.         (RTX).    This leads to a    clear duplication of effort.  If
  7248.         only one of RTA    or RTB originated the set of AS-
  7249.         external-LSAs, the routing would remain    the same, and
  7250.         the size of the    link state database would decrease.
  7251.         However, it must be unambiguously defined as to    which
  7252.         router originates the LSAs (otherwise neither may, or
  7253.         the identity of    the originator may oscillate).    The
  7254.         following rule is thereby established: if two routers,
  7255.         both reachable from one    another, originate functionally
  7256.         equivalent AS-external-LSAs (i.e., same    destination,
  7257.         cost and non-zero forwarding address), then the    LSA
  7258.         originated by the router having    the highest OSPF Router
  7259.         ID is used.  The router    having the lower OSPF Router ID
  7260.         can then flush its LSA.     Flushing an LSA is discussed in
  7261.         Section    14.1.
  7262.  
  7263. 13.  The Flooding Procedure
  7264.  
  7265.     Link State Update packets provide the mechanism for    flooding LSAs.
  7266.     A Link State Update    packet may contain several distinct LSAs, and
  7267.     floods each    LSA one    hop further from its point of origination.  To
  7268.     make the flooding procedure    reliable, each LSA must    be acknowledged
  7269.     separately.     Acknowledgments are transmitted in Link State
  7270.     Acknowledgment packets.  Many separate acknowledgments can also be
  7271.     grouped together into a single packet.
  7272.  
  7273.     The    flooding procedure starts when a Link State Update packet has
  7274.     been received.  Many consistency checks have been made on the
  7275.     received packet before being handed    to the flooding    procedure (see
  7276.     Section 8.2).  In particular, the Link State Update    packet has been
  7277.  
  7278.  
  7279.  
  7280. Moy                                  [Page 130]
  7281.  
  7282. Internet Draft             OSPF Version 2           February 1997
  7283.  
  7284.  
  7285.  
  7286.                 +
  7287.                 |
  7288.               +---+.....|.BGP
  7289.               |RTA|-----|.....+---+
  7290.               +---+    |-----|RTX|
  7291.                 |     +---+
  7292.               +---+    |
  7293.               |RTB|-----|
  7294.               +---+    |
  7295.                 |
  7296.               +---+    |
  7297.               |RTC|-----|
  7298.               +---+    |
  7299.                 |
  7300.                 +
  7301.  
  7302.  
  7303.            Figure 16: Forwarding address example
  7304.  
  7305.     associated with a particular neighbor, and a particular area.  If
  7306.     the    neighbor is in a lesser    state than Exchange, the packet    should
  7307.     be dropped without further processing.
  7308.  
  7309.     All    types of LSAs, other than AS-external-LSAs, are    associated with
  7310.     a specific area.  However, LSAs do not contain an area field.  An
  7311.     LSA's area must be deduced from the    Link State Update packet header.
  7312.  
  7313.     For    each LSA contained in a    Link State Update packet, the following
  7314.     steps are taken:
  7315.  
  7316.  
  7317.     (1)    Validate the LSA's LS checksum.     If the    checksum turns out to be
  7318.     invalid, discard the LSA and get the next one from the Link
  7319.     State Update packet.
  7320.  
  7321.     (2)    Examine    the LSA's LS type.  If the LS type is unknown, discard
  7322.     the LSA    and get    the next one from the Link State Update    Packet.
  7323.     This specification defines LS types 1-5    (see Section 4.3).
  7324.  
  7325.     (3)    Else if    this is    an AS-external-LSA (LS type = 5), and the area
  7326.     has been configured as a stub area, discard the    LSA and    get the
  7327.     next one from the Link State Update Packet.  AS-external-LSAs
  7328.     are not    flooded    into/throughout    stub areas (see    Section    3.6).
  7329.  
  7330.     (4)    Else if    the LSA's LS age is equal to MaxAge, and there is
  7331.     currently no instance of the LSA in the    router's link state
  7332.     database, then take the    following actions:
  7333.  
  7334.  
  7335.  
  7336. Moy                                  [Page 131]
  7337.  
  7338. Internet Draft             OSPF Version 2           February 1997
  7339.  
  7340.  
  7341.     (a) Acknowledge    the receipt of the LSA by sending a Link State
  7342.         Acknowledgment packet back to the sending neighbor (see
  7343.         Section 13.5).
  7344.  
  7345.     (b) Purge all outstanding requests for equal or    previous
  7346.         instances of the LSA from the sending neighbor's Link State
  7347.         Request list (see Section 10).
  7348.  
  7349.     (c) If the sending neighbor is in state    Exchange or in state
  7350.         Loading, then install the MaxAge LSA in the    link state
  7351.         database.  Otherwise, simply discard the LSA.  In either
  7352.         case, examine the next LSA (if any)    listed in the Link State
  7353.         Update packet.
  7354.  
  7355.     (5)    Otherwise, find    the instance of    this LSA that is currently
  7356.     contained in the router's link state database.    If there is no
  7357.     database copy, or the received LSA is more recent than the
  7358.     database copy (see Section 13.1    below for the determination of
  7359.     which LSA is more recent) the following    steps must be performed:
  7360.  
  7361.     (a) If there is    already    a database copy, and if    the database
  7362.         copy was installed less than MinLSArrival seconds ago,
  7363.         discard the    new LSA    (without acknowledging it) and examine
  7364.         the    next LSA (if any) listed in the    Link State Update
  7365.         packet.
  7366.  
  7367.     (b) Otherwise immediately flood    the new    LSA out    some subset of
  7368.         the    router's interfaces (see Section 13.3).     In some cases
  7369.         (e.g., the state of    the receiving interface    is DR and the
  7370.         LSA    was received from a router other than the Backup DR) the
  7371.         LSA    will be    flooded    back out the receiving interface.  This
  7372.         occurrence should be noted for later use by    the
  7373.         acknowledgment process (Section 13.5).
  7374.  
  7375.     (c) Remove the current database    copy from all neighbors' Link
  7376.         state retransmission lists.
  7377.  
  7378.     (d) Install the    new LSA    in the link state database (replacing
  7379.         the    current    database copy).     This may cause    the routing
  7380.         table calculation to be scheduled.    In addition, timestamp
  7381.         the    new LSA    with the current time (i.e., the time it was
  7382.         received).    The flooding procedure cannot overwrite    the
  7383.         newly installed LSA    until MinLSArrival seconds have    elapsed.
  7384.         The    LSA installation process is discussed further in Section
  7385.         13.2.
  7386.  
  7387.     (e) Possibly acknowledge the receipt of    the LSA    by sending a
  7388.         Link State Acknowledgment packet back out the receiving
  7389.  
  7390.  
  7391.  
  7392. Moy                                  [Page 132]
  7393.  
  7394. Internet Draft             OSPF Version 2           February 1997
  7395.  
  7396.  
  7397.         interface.    This is    explained below    in Section 13.5.
  7398.  
  7399.     (f) If this new    LSA indicates that it was originated by    the
  7400.         receiving router itself (i.e., is considered a self-
  7401.         originated LSA), the router    must take special action, either
  7402.         updating the LSA or    in some    cases flushing it from the
  7403.         routing domain. For    a description of how self-originated
  7404.         LSAs are detected and subsequently handled,    see Section
  7405.         13.4.
  7406.  
  7407.     (6)    Else, if there is an instance of the LSA on the    sending
  7408.     neighbor's Link    state request list, an error has occurred in the
  7409.     Database Exchange process.  In this case, restart the Database
  7410.     Exchange process by generating the neighbor event BadLSReq for
  7411.     the sending neighbor and stop processing the Link State    Update
  7412.     packet.
  7413.  
  7414.     (7)    Else, if the received LSA is the same instance as the database
  7415.     copy (i.e., neither one    is more    recent)    the following two steps
  7416.     should be performed:
  7417.  
  7418.     (a) If the LSA is listed in the    Link state retransmission list
  7419.         for    the receiving adjacency, the router itself is expecting
  7420.         an acknowledgment for this LSA.  The router    should treat the
  7421.         received LSA as an acknowledgment by removing the LSA from
  7422.         the    Link state retransmission list.     This is termed    an
  7423.         "implied acknowledgment".  Its occurrence should be    noted
  7424.         for    later use by the acknowledgment    process    (Section 13.5).
  7425.  
  7426.     (b) Possibly acknowledge the receipt of    the LSA    by sending a
  7427.         Link State Acknowledgment packet back out the receiving
  7428.         interface.    This is    explained below    in Section 13.5.
  7429.  
  7430.     (8)    Else, the database copy    is more    recent.     If the    database copy
  7431.     has LS age equal to MaxAge and LS sequence number equal    to
  7432.     MaxSequenceNumber, simply discard the received LSA without
  7433.     acknowledging it. (In this case, the LSA's LS sequence number is
  7434.     wrapping, and the MaxSequenceNumber LSA    must be    completely
  7435.     flushed    before any new LSA instance can    be introduced).
  7436.     Otherwise, send    the database copy back to the sending neighbor,
  7437.     encapsulated within a Link State Update    Packet.    The Link State
  7438.     Update Packet should be    unicast    to the neighbor. In so doing, do
  7439.     not put    the database copy of the LSA on    the neighbor's link
  7440.     state retransmission list, and do not acknowledge the received
  7441.     (less recent) LSA instance.
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448. Moy                                  [Page 133]
  7449.  
  7450. Internet Draft             OSPF Version 2           February 1997
  7451.  
  7452.  
  7453.     13.1.  Determining which LSA is newer
  7454.  
  7455.     When a router encounters two instances of an LSA, it must
  7456.     determine which    is more    recent.     This occurred above when
  7457.     comparing a received LSA to its    database copy.    This comparison
  7458.     must also be done during the Database Exchange procedure which
  7459.     occurs during adjacency    bring-up.
  7460.  
  7461.     An LSA is identified by    its LS type, Link State    ID and
  7462.     Advertising Router.  For two instances of the same LSA,    the LS
  7463.     sequence number, LS age, and LS    checksum fields    are used to
  7464.     determine which    instance is more recent:
  7465.  
  7466.  
  7467.     o   The    LSA having the newer LS    sequence number    is more    recent.
  7468.         See    Section    12.1.6 for an explanation of the LS sequence
  7469.         number space.  If both instances have the same LS sequence
  7470.         number, then:
  7471.  
  7472.     o   If the two instances have different    LS checksums, then the
  7473.         instance having the    larger LS checksum (when considered as a
  7474.         16-bit unsigned integer) is    considered more    recent.
  7475.  
  7476.     o   Else, if only one of the instances has its LS age field set
  7477.         to MaxAge, the instance of age MaxAge is considered    to be
  7478.         more recent.
  7479.  
  7480.     o   Else, if the LS age    fields of the two instances differ by
  7481.         more than MaxAgeDiff, the instance having the smaller
  7482.         (younger) LS age is    considered to be more recent.
  7483.  
  7484.     o   Else, the two instances are    considered to be identical.
  7485.  
  7486.  
  7487.     13.2.  Installing LSAs in the database
  7488.  
  7489.     Installing a new LSA in    the database, either as    the result of
  7490.     flooding or a newly self-originated LSA, may cause the OSPF
  7491.     routing    table structure    to be recalculated.  The contents of the
  7492.     new LSA    should be compared to the old instance,    if present.  If
  7493.     there is no difference,    there is no need to recalculate    the
  7494.     routing    table. When comparing an LSA to    its previous instance,
  7495.     the following are all considered to be differences in contents:
  7496.  
  7497.         o    The LSA's Options field    has changed.
  7498.  
  7499.         o    One of the LSA instances has LS    age set    to MaxAge, and
  7500.         the other does not.
  7501.  
  7502.  
  7503.  
  7504. Moy                                  [Page 134]
  7505.  
  7506. Internet Draft             OSPF Version 2           February 1997
  7507.  
  7508.  
  7509.         o    The length field in the    LSA header has changed.
  7510.  
  7511.         o    The body of the    LSA (i.e., anything outside the    20-byte
  7512.         LSA header) has    changed. Note that this    excludes changes
  7513.         in LS Sequence Number and LS Checksum.
  7514.  
  7515.     If the contents    are different, the following pieces of the
  7516.     routing    table must be recalculated, depending on the new LSA's
  7517.     LS type    field:
  7518.  
  7519.  
  7520.     Router-LSAs and    network-LSAs
  7521.         The    entire routing table must be recalculated, starting with
  7522.         the    shortest path calculations for each area (not just the
  7523.         area whose link-state database has changed).  The reason
  7524.         that the shortest path calculation cannot be restricted to
  7525.         the    single changed area has    to do with the fact that AS
  7526.         boundary routers may belong    to multiple areas.  A change in
  7527.         the    area currently providing the best route    may force the
  7528.         router to use an intra-area    route provided by a different
  7529.         area.[19]
  7530.  
  7531.     Summary-LSAs
  7532.         The    best route to the destination described    by the summary-
  7533.         LSA    must be    recalculated (see Section 16.5).  If this
  7534.         destination    is an AS boundary router, it may also be
  7535.         necessary to re-examine all    the AS-external-LSAs.
  7536.  
  7537.     AS-external-LSAs
  7538.         The    best route to the destination described    by the AS-
  7539.         external-LSA must be recalculated (see Section 16.6).
  7540.  
  7541.  
  7542.     Also, any old instance of the LSA must be removed from the
  7543.     database when the new LSA is installed.     This old instance must
  7544.     also be    removed    from all neighbors' Link state retransmission
  7545.     lists (see Section 10).
  7546.  
  7547.  
  7548.     13.3.  Next    step in    the flooding procedure
  7549.  
  7550.     When a new (and    more recent) LSA has been received, it must be
  7551.     flooded    out some set of    the router's interfaces.  This section
  7552.     describes the second part of flooding procedure    (the first part
  7553.     being the processing that occurred in Section 13), namely,
  7554.     selecting the outgoing interfaces and adding the LSA to    the
  7555.     appropriate neighbors' Link state retransmission lists.     Also
  7556.     included in this part of the flooding procedure    is the
  7557.  
  7558.  
  7559.  
  7560. Moy                                  [Page 135]
  7561.  
  7562. Internet Draft             OSPF Version 2           February 1997
  7563.  
  7564.  
  7565.     maintenance of the neighbors' Link state request lists.
  7566.  
  7567.     This section is    equally    applicable to the flooding of an LSA
  7568.     that the router    itself has just    originated (see    Section    12.4).
  7569.     For these LSAs,    this section provides the entirety of the
  7570.     flooding procedure (i.e., the processing of Section 13 is not
  7571.     performed, since, for example, the LSA has not been received
  7572.     from a neighbor    and therefore does not need to be acknowledged).
  7573.  
  7574.     Depending upon the LSA's LS type, the LSA can be flooded out
  7575.     only certain interfaces.  These    interfaces, defined by the
  7576.     following, are called the eligible interfaces:
  7577.  
  7578.  
  7579.     AS-external-LSAs (LS Type = 5)
  7580.         AS-external-LSAs are flooded throughout the    entire AS, with
  7581.         the    exception of stub areas    (see Section 3.6).  The    eligible
  7582.         interfaces are all the router's interfaces,    excluding
  7583.         virtual links and those interfaces attaching to stub areas.
  7584.  
  7585.     All other LS types
  7586.         All    other types are    specific to a single area (Area    A).  The
  7587.         eligible interfaces    are all    those interfaces attaching to
  7588.         the    Area A.     If Area A is the backbone, this includes all
  7589.         the    virtual    links.
  7590.  
  7591.  
  7592.     Link state databases must remain synchronized over all
  7593.     adjacencies associated with the    above eligible interfaces.  This
  7594.     is accomplished    by executing the following steps on each
  7595.     eligible interface.  It    should be noted    that this procedure may
  7596.     decide not to flood an LSA out a particular interface, if there
  7597.     is a high probability that the attached    neighbors have already
  7598.     received the LSA.  However, in these cases the flooding
  7599.     procedure must be absolutely sure that the neighbors eventually
  7600.     do receive the LSA, so the LSA is still    added to each
  7601.     adjacency's Link state retransmission list.  For each eligible
  7602.     interface:
  7603.  
  7604.  
  7605.     (1) Each of the    neighbors attached to this interface are
  7606.         examined, to determine whether they    must receive the new
  7607.         LSA.  The following    steps are executed for each neighbor:
  7608.  
  7609.         (a)    If the neighbor    is in a    lesser state than Exchange, it
  7610.         does not participate in    flooding, and the next neighbor
  7611.         should be examined.
  7612.  
  7613.  
  7614.  
  7615.  
  7616. Moy                                  [Page 136]
  7617.  
  7618. Internet Draft             OSPF Version 2           February 1997
  7619.  
  7620.  
  7621.         (b)    Else, if the adjacency is not yet full (neighbor state
  7622.         is Exchange or Loading), examine the Link state    request
  7623.         list associated    with this adjacency.  If there is an
  7624.         instance of the    new LSA    on the list, it    indicates that
  7625.         the neighboring    router has an instance of the LSA
  7626.         already.  Compare the new LSA to the neighbor's    copy:
  7627.  
  7628.         o   If the new LSA is less recent, then    examine    the next
  7629.             neighbor.
  7630.  
  7631.         o   If the two copies are the same instance, then delete
  7632.             the    LSA from the Link state    request    list, and
  7633.             examine the    next neighbor.[20]
  7634.  
  7635.         o   Else, the new LSA is more recent.  Delete the LSA
  7636.             from the Link state    request    list.
  7637.  
  7638.         (c)    If the new LSA was received from this neighbor,    examine
  7639.         the next neighbor.
  7640.  
  7641.         (d)    At this    point we are not positive that the neighbor has
  7642.         an up-to-date instance of this new LSA.     Add the new LSA
  7643.         to the Link state retransmission list for the adjacency.
  7644.         This ensures that the flooding procedure is reliable;
  7645.         the LSA    will be    retransmitted at intervals until an
  7646.         acknowledgment is seen from the    neighbor.
  7647.  
  7648.     (2) The    router must now    decide whether to flood    the new    LSA out
  7649.         this interface.  If    in the previous    step, the LSA was NOT
  7650.         added to any of the    Link state retransmission lists, there
  7651.         is no need to flood    the LSA    out the    interface and the next
  7652.         interface should be    examined.
  7653.  
  7654.     (3) If the new LSA was received    on this    interface, and it was
  7655.         received from either the Designated    Router or the Backup
  7656.         Designated Router, chances are that    all the    neighbors have
  7657.         received the LSA already.  Therefore, examine the next
  7658.         interface.
  7659.  
  7660.     (4) If the new LSA was received    on this    interface, and the
  7661.         interface state is Backup (i.e., the router    itself is the
  7662.         Backup Designated Router), examine the next    interface.  The
  7663.         Designated Router will do the flooding on this interface.
  7664.         However, if    the Designated Router fails the    router (i.e.,
  7665.         the    Backup Designated Router) will end up retransmitting the
  7666.         updates.
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  
  7672. Moy                                  [Page 137]
  7673.  
  7674. Internet Draft             OSPF Version 2           February 1997
  7675.  
  7676.  
  7677.     (5) If this step is reached, the LSA must be flooded out the
  7678.         interface.    Send a Link State Update packet    (including the
  7679.         new    LSA as contents) out the interface.  The LSA's LS age
  7680.         must be incremented    by InfTransDelay (which    must be    > 0)
  7681.         when it is copied into the outgoing    Link State Update packet
  7682.         (until the LS age field reaches the    maximum    value of
  7683.         MaxAge).
  7684.  
  7685.         On broadcast networks, the Link State Update packets are
  7686.         multicast.    The destination    IP address specified for the
  7687.         Link State Update Packet depends on    the state of the
  7688.         interface.    If the interface state is DR or    Backup,    the
  7689.         address AllSPFRouters should be used.  Otherwise, the
  7690.         address AllDRouters    should be used.
  7691.  
  7692.         On non-broadcast networks, separate    Link State Update
  7693.         packets must be sent, as unicasts, to each adjacent    neighbor
  7694.         (i.e., those in state Exchange or greater).     The destination
  7695.         IP addresses for these packets are the neighbors' IP
  7696.         addresses.
  7697.  
  7698.  
  7699.     13.4.  Receiving self-originated LSAs
  7700.  
  7701.     It is a    common occurrence for a    router to receive self-
  7702.     originated LSAs    via the    flooding procedure. A self-originated
  7703.     LSA is detected    when either 1) the LSA's Advertising Router is
  7704.     equal to the router's own Router ID or 2) the LSA is a network-
  7705.     LSA and    its Link State ID is equal to one of the router's own IP
  7706.     interface addresses.
  7707.  
  7708.     However, if the    received self-originated LSA is    newer than the
  7709.     last instance that the router actually originated, the router
  7710.     must take special action.  The reception of such an LSA
  7711.     indicates that there are LSAs in the routing domain that were
  7712.     originated by the router before    the last time it was restarted.
  7713.     In most    cases, the router must then advance the    LSA's LS
  7714.     sequence number    one past the received LS sequence number, and
  7715.     originate a new    instance of the    LSA.
  7716.  
  7717.     It may be the case the router no longer    wishes to originate the
  7718.     received LSA. Possible examples    include: 1) the    LSA is a
  7719.     summary-LSA or AS-external-LSA and the router no longer    has an
  7720.     (advertisable) route to    the destination, 2) the    LSA is a
  7721.     network-LSA but    the router is no longer    Designated Router for
  7722.     the network or 3) the LSA is a network-LSA whose Link State ID
  7723.     is one of the router's own IP interface    addresses but whose
  7724.     Advertising Router is not equal    to the router's    own Router ID
  7725.  
  7726.  
  7727.  
  7728. Moy                                  [Page 138]
  7729.  
  7730. Internet Draft             OSPF Version 2           February 1997
  7731.  
  7732.  
  7733.     (this latter case should be rare, and it indicates that    the
  7734.     router's Router    ID has changed since originating the LSA).  In
  7735.     all these cases, instead of updating the LSA, the LSA should be
  7736.     flushed    from the routing domain    by incrementing    the received
  7737.     LSA's LS age to    MaxAge and reflooding (see Section 14.1).
  7738.  
  7739.  
  7740.     13.5.  Sending Link    State Acknowledgment packets
  7741.  
  7742.     Each newly received LSA    must be    acknowledged.  This is usually
  7743.     done by    sending    Link State Acknowledgment packets.  However,
  7744.     acknowledgments    can also be accomplished implicitly by sending
  7745.     Link State Update packets (see step 7a of Section 13).
  7746.  
  7747.     Many acknowledgments may be grouped together into a single Link
  7748.     State Acknowledgment packet.  Such a packet is sent back out the
  7749.     interface which    received the LSAs.  The    packet can be sent in
  7750.     one of two ways: delayed and sent on an    interval timer,    or sent
  7751.     directly (as a unicast)    to a particular    neighbor.  The
  7752.     particular acknowledgment strategy used    depends    on the
  7753.     circumstances surrounding the receipt of the LSA.
  7754.  
  7755.     Sending    delayed    acknowledgments    accomplishes several things: 1)
  7756.     it facilitates the packaging of    multiple acknowledgments in a
  7757.     single Link State Acknowledgment packet, 2) it enables a single
  7758.     Link State Acknowledgment packet to indicate acknowledgments to
  7759.     several    neighbors at once (through multicasting) and 3)    it
  7760.     randomizes the Link State Acknowledgment packets sent by the
  7761.     various    routers    attached to a common network.  The fixed
  7762.     interval between a router's delayed transmissions must be short
  7763.     (less than RxmtInterval) or needless retransmissions will ensue.
  7764.  
  7765.     Direct acknowledgments are sent    to a particular    neighbor in
  7766.     response to the    receipt    of duplicate LSAs.  These
  7767.     acknowledgments    are sent as unicasts, and are sent immediately
  7768.     when the duplicate is received.
  7769.  
  7770.     The precise procedure for sending Link State Acknowledgment
  7771.     packets    is described in    Table 19.  The circumstances surrounding
  7772.     the receipt of the LSA are listed in the left column.  The
  7773.     acknowledgment action then taken is listed in one of the two
  7774.     right columns.    This action depends on the state of the
  7775.     concerned interface; interfaces    in state Backup    behave
  7776.     differently from interfaces in all other states.  Delayed
  7777.     acknowledgments    must be    delivered to all adjacent routers
  7778.     associated with    the interface.    On broadcast networks, this is
  7779.     accomplished by    sending    the delayed Link State Acknowledgment
  7780.     packets    as multicasts.    The Destination    IP address used    depends
  7781.  
  7782.  
  7783.  
  7784. Moy                                  [Page 139]
  7785.  
  7786. Internet Draft             OSPF Version 2           February 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.     tion 13, step 5b).
  7801.     _______________________________________________________________
  7802.     LSA      is           Delayed acknowledg-     Delayed       ack-
  7803.     more  recent  than       ment    sent if    adver-     nowledgment sent.
  7804.     database copy, but       tisement   received
  7805.     was      not  flooded       from       Designated
  7806.     back out receiving       Router,  otherwise
  7807.     interface           do nothing
  7808.     _______________________________________________________________
  7809.     LSA    is a           Delayed acknowledg-     No  acknowledgment
  7810.     duplicate, and was       ment    sent if    adver-     sent.
  7811.     treated as an  im-       tisement   received
  7812.     plied  acknowledg-       from       Designated
  7813.     ment (see  Section       Router,  otherwise
  7814.     13,    step 7a).       do nothing
  7815.     _______________________________________________________________
  7816.     LSA    is a           Direct acknowledg-     Direct    acknowledg-
  7817.     duplicate, and was       ment    sent.         ment sent.
  7818.     not    treated    as  an
  7819.     implied      ack-
  7820.     nowledgment.
  7821.     _______________________________________________________________
  7822.     LSA's LS           Direct acknowledg-     Direct    acknowledg-
  7823.     age    is equal to       ment    sent.         ment sent.
  7824.     MaxAge, and    there is
  7825.     no current instance
  7826.     of the LSA
  7827.     in the link    state
  7828.     database (see
  7829.     Section 13,    step 4).
  7830.  
  7831.  
  7832.          Table 19: Sending link state acknowledgements.
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840. Moy                                  [Page 140]
  7841.  
  7842. Internet Draft             OSPF Version 2           February 1997
  7843.  
  7844.  
  7845.     on the state of    the interface.    If the interface state is DR or
  7846.     Backup,    the destination    AllSPFRouters is used.    In all other
  7847.     states,    the destination    AllDRouters is used.  On non-broadcast
  7848.     networks, delayed Link State Acknowledgment packets must be
  7849.     unicast    separately over    each adjacency (i.e., neighbor whose
  7850.     state is >= Exchange).
  7851.  
  7852.     The reasoning behind sending the above packets as multicasts is
  7853.     best explained by an example.  Consider    the network
  7854.     configuration depicted in Figure 15.  Suppose RT4 has been
  7855.     elected    as Designated Router, and RT3 as Backup    Designated
  7856.     Router for the network N3.  When Router    RT4 floods a new LSA to
  7857.     Network    N3, it is received by routers RT1, RT2,    and RT3.  These
  7858.     routers    will not flood the LSA back onto net N3, but they still
  7859.     must ensure that their link-state databases remain synchronized
  7860.     with their adjacent neighbors.    So RT1,    RT2, and RT4 are waiting
  7861.     to see an acknowledgment from RT3.  Likewise, RT4 and RT3 are
  7862.     both waiting to    see acknowledgments from RT1 and RT2.  This is
  7863.     best achieved by sending the acknowledgments as    multicasts.
  7864.  
  7865.     The reason that    the acknowledgment logic for Backup DRs    is
  7866.     slightly different is because they perform differently during
  7867.     the flooding of    LSAs (see Section 13.3,    step 4).
  7868.  
  7869.  
  7870.  
  7871.     13.6.  Retransmitting LSAs
  7872.  
  7873.     LSAs flooded out an adjacency are placed on the    adjacency's Link
  7874.     state retransmission list.  In order to    ensure that flooding is
  7875.     reliable, these    LSAs are retransmitted until they are
  7876.     acknowledged.  The length of time between retransmissions is a
  7877.     configurable per-interface value, RxmtInterval.     If this is set
  7878.     too low    for an interface, needless retransmissions will    ensue.
  7879.     If the value is    set too    high, the speed    of the flooding, in the
  7880.     face of    lost packets, may be affected.
  7881.  
  7882.     Several    retransmitted LSAs may fit into    a single Link State
  7883.     Update packet.    When LSAs are to be retransmitted, only    the
  7884.     number fitting in a single Link    State Update packet should be
  7885.     sent.  Another packet of retransmissions can be    sent whenever
  7886.     some of    the LSAs are acknowledged, or on the next firing of the
  7887.     retransmission timer.
  7888.  
  7889.     Link State Update Packets carrying retransmissions are always
  7890.     sent as    unicasts (directly to the physical address of the
  7891.     neighbor).  They are never sent    as multicasts.    Each LSA's LS
  7892.     age must be incremented    by InfTransDelay (which    must be    > 0)
  7893.  
  7894.  
  7895.  
  7896. Moy                                  [Page 141]
  7897.  
  7898. Internet Draft             OSPF Version 2           February 1997
  7899.  
  7900.  
  7901.     when it    is copied into the outgoing Link State Update packet
  7902.     (until the LS age field    reaches    the maximum value of MaxAge).
  7903.  
  7904.     If an adjacent router goes down, retransmissions may occur until
  7905.     the adjacency is destroyed by OSPF's Hello Protocol.  When the
  7906.     adjacency is destroyed,    the Link state retransmission list is
  7907.     cleared.
  7908.  
  7909.  
  7910.     13.7.  Receiving link state    acknowledgments
  7911.  
  7912.     Many consistency checks    have been made on a received Link State
  7913.     Acknowledgment packet before it    is handed to the flooding
  7914.     procedure.  In particular, it has been associated with a
  7915.     particular neighbor.  If this neighbor is in a lesser state than
  7916.     Exchange, the Link State Acknowledgment    packet is discarded.
  7917.  
  7918.     Otherwise, for each acknowledgment in the Link State
  7919.     Acknowledgment packet, the following steps are performed:
  7920.  
  7921.  
  7922.     o   Does the LSA acknowledged have an instance on the Link state
  7923.         retransmission list    for the    neighbor?  If not, examine the
  7924.         next acknowledgment.  Otherwise:
  7925.  
  7926.     o   If the acknowledgment is for the same instance that    is
  7927.         contained on the list, remove the item from    the list and
  7928.         examine the    next acknowledgment.  Otherwise:
  7929.  
  7930.     o   Log    the questionable acknowledgment, and examine the next
  7931.         one.
  7932.  
  7933.  
  7934. 14.  Aging The Link State Database
  7935.  
  7936.     Each LSA has an LS age field.  The LS age is expressed in seconds.
  7937.     An LSA's LS    age field is incremented while it is contained in a
  7938.     router's database.    Also, when copied into a Link State Update
  7939.     Packet for flooding    out a particular interface, the    LSA's LS age is
  7940.     incremented    by InfTransDelay.
  7941.  
  7942.     An LSA's LS    age is never incremented past the value    MaxAge.     LSAs
  7943.     having age MaxAge are not used in the routing table    calculation.  As
  7944.     a router ages its link state database, an LSA's LS age may reach
  7945.     MaxAge.[21]    At this    time, the router must attempt to flush the LSA
  7946.     from the routing domain.  This is done simply by reflooding    the
  7947.     MaxAge LSA just as if it was a newly originated LSA    (see Section
  7948.     13.3).
  7949.  
  7950.  
  7951.  
  7952. Moy                                  [Page 142]
  7953.  
  7954. Internet Draft             OSPF Version 2           February 1997
  7955.  
  7956.  
  7957.     When creating a Database summary list for a    newly forming adjacency,
  7958.     any    MaxAge LSAs present in the link    state database are added to the
  7959.     neighbor's Link state retransmission list instead of the neighbor's
  7960.     Database summary list.  See    Section    10.3 for more details.
  7961.  
  7962.     A MaxAge LSA must be removed immediately from the router's link
  7963.     state database as soon as both a) it is no longer contained    on any
  7964.     neighbor Link state    retransmission lists and b) none of the    router's
  7965.     neighbors are in states Exchange or    Loading.
  7966.  
  7967.     When, in the process of aging the link state database, an LSA's LS
  7968.     age    hits a multiple    of CheckAge, its LS checksum should be verified.
  7969.     If the LS checksum is incorrect, a program or memory error has been
  7970.     detected, and at the very least the    router itself should be
  7971.     restarted.
  7972.  
  7973.  
  7974.     14.1.  Premature aging of LSAs
  7975.  
  7976.     An LSA can be flushed from the routing domain by setting its LS
  7977.     age to MaxAge and reflooding the LSA.  This procedure follows
  7978.     the same course    as flushing an LSA whose LS age    has naturally
  7979.     reached    the value MaxAge (see Section 14).  In particular, the
  7980.     MaxAge LSA is removed from the router's    link state database as
  7981.     soon as    a) it is no longer contained on    any neighbor Link state
  7982.     retransmission lists and b) none of the    router's neighbors are
  7983.     in states Exchange or Loading.    We call    the setting of an LSA's
  7984.     LS age to MaxAge "premature aging".
  7985.  
  7986.     Premature aging    is used    when it    is time    for a self-originated
  7987.     LSA's sequence number field to wrap.  At this point, the current
  7988.     LSA instance (having LS    sequence number    MaxSequenceNumber) must
  7989.     be prematurely aged and    flushed    from the routing domain    before a
  7990.     new instance with sequence number equal    to InitialSequenceNumber
  7991.     can be originated.  See    Section    12.1.6 for more    information.
  7992.  
  7993.     Premature aging    can also be used when, for example, one    of the
  7994.     router's previously advertised external    routes is no longer
  7995.     reachable.  In this circumstance, the router can flush its AS-
  7996.     external-LSA from the routing domain via premature aging. This
  7997.     procedure is preferable    to the alternative, which is to
  7998.     originate a new    LSA for    the destination    specifying a metric of
  7999.     LSInfinity.  Premature aging is    also be    used when unexpectedly
  8000.     receiving self-originated LSAs during the flooding procedure
  8001.     (see Section 13.4).
  8002.  
  8003.     A router may only prematurely age its own self-originated LSAs.
  8004.     The router may not prematurely age LSAs    that have been
  8005.  
  8006.  
  8007.  
  8008. Moy                                  [Page 143]
  8009.  
  8010. Internet Draft             OSPF Version 2           February 1997
  8011.  
  8012.  
  8013.     originated by other routers. An    LSA is considered self-
  8014.     originated when    either 1) the LSA's Advertising    Router is equal
  8015.     to the router's    own Router ID or 2) the    LSA is a network-LSA and
  8016.     its Link State ID is equal to one of the router's own IP
  8017.     interface addresses.
  8018.  
  8019.  
  8020. 15.  Virtual Links
  8021.  
  8022.     The    single backbone    area (Area ID =    0.0.0.0) cannot    be disconnected,
  8023.     or some areas of the Autonomous System will    become unreachable.  To
  8024.     establish/maintain connectivity of the backbone, virtual links can
  8025.     be configured through non-backbone areas.  Virtual links serve to
  8026.     connect physically separate    components of the backbone.  The two
  8027.     endpoints of a virtual link    are area border    routers.  The virtual
  8028.     link must be configured in both routers.  The configuration
  8029.     information    in each    router consists    of the other virtual endpoint
  8030.     (the other area border router), and    the non-backbone area the two
  8031.     routers have in common (called the Transit area).  Virtual links
  8032.     cannot be configured through stub areas (see Section 3.6).
  8033.  
  8034.     The    virtual    link is    treated    as if it were an unnumbered point-to-
  8035.     point network belonging to the backbone and    joining    the two    area
  8036.     border routers.  An    attempt    is made    to establish an    adjacency over
  8037.     the    virtual    link.  When this adjacency is established, the virtual
  8038.     link will be included in backbone router-LSAs, and OSPF packets
  8039.     pertaining to the backbone area will flow over the adjacency.  Such
  8040.     an adjacency has been referred to in this document as a "virtual
  8041.     adjacency".
  8042.  
  8043.     In each endpoint router, the cost and viability of the virtual link
  8044.     is discovered by examining the routing table entry for the other
  8045.     endpoint router.  (The entry's associated area must    be the
  8046.     configured Transit area).  Actually, there may be a    separate routing
  8047.     table entry    for each Type of Service.  These are called the    virtual
  8048.     link's corresponding routing table entries.     The InterfaceUp event
  8049.     occurs for a virtual link when its corresponding TOS 0 routing table
  8050.     entry becomes reachable.  Conversely, the InterfaceDown event occurs
  8051.     when its TOS 0 routing table entry becomes unreachable.[22]    In other
  8052.     words, the virtual link's viability    is determined by the existence
  8053.     of an intra-area path, through the Transit area, between the two
  8054.     endpoints.    Note that a virtual link whose underlying path has cost
  8055.     greater than hexadecimal 0xffff (the maximum size of an interface
  8056.     cost in a router-LSA) should be considered inoperational (i.e.,
  8057.     treated the    same as    if the path did    not exist).
  8058.  
  8059.     The    other details concerning virtual links are as follows:
  8060.  
  8061.  
  8062.  
  8063.  
  8064. Moy                                  [Page 144]
  8065.  
  8066. Internet Draft             OSPF Version 2           February 1997
  8067.  
  8068.  
  8069.     o    AS-external-LSAs are NEVER flooded over    virtual    adjacencies.
  8070.     This would be duplication of effort, since the same AS-
  8071.     external-LSAs are already flooded throughout the virtual link's
  8072.     Transit    area.  For this    same reason, AS-external-LSAs are not
  8073.     summarized over    virtual    adjacencies during the Database    Exchange
  8074.     process.
  8075.  
  8076.     o    The cost of a virtual link is NOT configured.  It is defined to
  8077.     be the cost of the intra-area path between the two defining area
  8078.     border routers.     This cost appears in the virtual link's
  8079.     corresponding routing table entry.  When the cost of a virtual
  8080.     link changes, a    new router-LSA should be originated for    the
  8081.     backbone area.
  8082.  
  8083.     o    Just as    the virtual link's cost    and viability are determined by
  8084.     the routing table build    process    (through construction of the
  8085.     routing    table entry for    the other endpoint), so    are the    IP
  8086.     interface address for the virtual interface and    the virtual
  8087.     neighbor's IP address.    These are used when sending OSPF
  8088.     protocol packets over the virtual link.    Note that when one (or
  8089.     both) of the virtual link endpoints connect to the Transit area
  8090.     via an unnumbered point-to-point link, it may be impossible to
  8091.     calculate either the virtual interface's IP address and/or the
  8092.     virtual    neighbor's IP address, thereby causing the virtual link
  8093.     to fail.
  8094.  
  8095.     o    In each    endpoint's router-LSA for the backbone,    the virtual link
  8096.     is represented as a Type 4 link    whose Link ID is set to    the
  8097.     virtual    neighbor's OSPF    Router ID and whose Link Data is set to
  8098.     the virtual interface's    IP address.  See Section 12.4.1    for more
  8099.     information. Note that it may be the case that there is    a TOS 0
  8100.     path, but no non-zero TOS paths, between the two endpoint
  8101.     routers.  In this case,    both routers must revert to being non-
  8102.     TOS-capable, clearing the T-bit    in the Options field of    their
  8103.     backbone router-LSAs.
  8104.  
  8105.     o    A non-backbone area can    carry transit data traffic (i.e., is
  8106.     considered a "transit area") if    and only if it serves as the
  8107.     Transit    area for one or    more fully adjacent virtual links (see
  8108.     TransitCapability in Sections 6    and 16.1). Such    an area    requires
  8109.     special    treatment when summarizing backbone networks into it
  8110.     (see Section 12.4.3), and during the routing calculation (see
  8111.     Section    16.3).
  8112.  
  8113.     o    The time between link state retransmissions, RxmtInterval, is
  8114.     configured for a virtual link.    This should be well over the
  8115.     expected round-trip delay between the two routers.  This may be
  8116.     hard to    estimate for a virtual link; it    is better to err on the
  8117.  
  8118.  
  8119.  
  8120. Moy                                  [Page 145]
  8121.  
  8122. Internet Draft             OSPF Version 2           February 1997
  8123.  
  8124.  
  8125.     side of    making it too large.
  8126.  
  8127.  
  8128. 16.  Calculation of the    routing    table
  8129.  
  8130.     This section details the OSPF routing table    calculation.  Using its
  8131.     attached areas' link state databases as input, a router runs the
  8132.     following algorithm, building its routing table step by step.  At
  8133.     each step, the router must access individual pieces    of the link
  8134.     state databases (e.g., a router-LSA    originated by a    certain    router).
  8135.     This access    is performed by    the lookup function discussed in Section
  8136.     12.2.  The lookup process may return an LSA    whose LS age is    equal to
  8137.     MaxAge.  Such an LSA should    not be used in the routing table
  8138.     calculation, and is    treated    just as    if the lookup process had
  8139.     failed.
  8140.  
  8141.     The    OSPF routing table's organization is explained in Section 11.
  8142.     Two    examples of the    routing    table build process are    presented in
  8143.     Sections 11.2 and 11.3.  This process can be broken    into the
  8144.     following steps:
  8145.  
  8146.  
  8147.     (1)    The present routing table is invalidated.  The routing table is
  8148.     built again from scratch.  The old routing table is saved so
  8149.     that changes in    routing    table entries can be identified.
  8150.  
  8151.     (2)    The intra-area routes are calculated by    building the shortest-
  8152.     path tree for each attached area.  In particular, all routing
  8153.     table entries whose Destination    Type is    "area border router" are
  8154.     calculated in this step.  This step is described in two    parts.
  8155.     At first the tree is constructed by only considering those links
  8156.     between    routers    and transit networks.  Then the    stub networks
  8157.     are incorporated into the tree.    During the area's shortest-path
  8158.     tree calculation, the area's TransitCapability is also
  8159.     calculated for later use in Step 4.
  8160.  
  8161.     (3)    The inter-area routes are calculated, through examination of
  8162.     summary-LSAs.  If the router is    attached to multiple areas
  8163.     (i.e., it is an    area border router), only backbone summary-LSAs
  8164.     are examined.
  8165.  
  8166.     (4)    In area    border routers connecting to one or more transit areas
  8167.     (i.e, non-backbone areas whose TransitCapability is found to be
  8168.     TRUE), the transit areas' summary-LSAs are examined to see
  8169.     whether    better paths exist using the transit areas than    were
  8170.     found in Steps 2-3 above.
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176. Moy                                  [Page 146]
  8177.  
  8178. Internet Draft             OSPF Version 2           February 1997
  8179.  
  8180.  
  8181.     (5)    Routes to external destinations    are calculated,    through
  8182.     examination of AS-external-LSAs.  The locations    of the AS
  8183.     boundary routers (which    originate the AS-external-LSAs)    have
  8184.     been determined    in steps 2-4.
  8185.  
  8186.  
  8187.     Steps 2-5 are explained in further detail below.  The explanations
  8188.     describe the calculations for TOS 0    only.  It may also be necessary
  8189.     to perform each step (separately) for each of the non-zero TOS
  8190.     values.[23]    For more information concerning    the building of    non-zero
  8191.     TOS    routes see Section 16.9.
  8192.  
  8193.     Changes made to routing table entries as a result of these
  8194.     calculations can cause the OSPF protocol to    take further actions.
  8195.     For    example, a change to an    intra-area route will cause an area
  8196.     border router to originate new summary-LSAs    (see Section 12.4).  See
  8197.     Section 16.7 for a complete    list of    the OSPF protocol actions
  8198.     resulting from routing table changes.
  8199.  
  8200.  
  8201.     16.1.  Calculating the shortest-path tree for an area
  8202.  
  8203.     This calculation yields    the set    of intra-area routes associated
  8204.     with an    area (called hereafter Area A).     A router calculates the
  8205.     shortest-path tree using itself    as the root.[24] The formation
  8206.     of the shortest    path tree is done here in two stages.  In the
  8207.     first stage, only links    between    routers    and transit networks are
  8208.     considered.  Using the Dijkstra    algorithm, a tree is formed from
  8209.     this subset of the link    state database.     In the    second stage,
  8210.     leaves are added to the    tree by    considering the    links to stub
  8211.     networks.
  8212.  
  8213.     The procedure will be explained    using the graph    terminology that
  8214.     was introduced in Section 2.  The area's link state database is
  8215.     represented as a directed graph.  The graph's vertices are
  8216.     routers, transit networks and stub networks.  The first    stage of
  8217.     the procedure concerns only the    transit    vertices (routers and
  8218.     transit    networks) and their connecting links.  Throughout the
  8219.     shortest path calculation, the following data is also associated
  8220.     with each transit vertex:
  8221.  
  8222.  
  8223.     Vertex (node) ID
  8224.         A 32-bit number uniquely identifying the vertex.  For router
  8225.         vertices this is the router's OSPF Router ID.  For network
  8226.         vertices, this is the IP address of    the network's Designated
  8227.         Router.
  8228.  
  8229.  
  8230.  
  8231.  
  8232. Moy                                  [Page 147]
  8233.  
  8234. Internet Draft             OSPF Version 2           February 1997
  8235.  
  8236.  
  8237.     An LSA
  8238.         Each transit vertex    has an associated LSA.    For router
  8239.         vertices, this is a    router-LSA.  For transit networks, this
  8240.         is a network-LSA (which is actually    originated by the
  8241.         network's Designated Router).  In any case,    the LSA's Link
  8242.         State ID is    always equal to    the above Vertex ID.
  8243.  
  8244.     List of    next hops
  8245.         The    list of    next hops for the current set of shortest paths
  8246.         from the root to this vertex.  There can be    multiple
  8247.         shortest paths due to the equal-cost multipath capability.
  8248.         Each next hop indicates the    outgoing router    interface to use
  8249.         when forwarding traffic to the destination.     On broadcast,
  8250.         Point-to-MultiPoint    and NBMA networks, the next hop    also
  8251.         includes the IP address of the next    router (if any)    in the
  8252.         path towards the destination.
  8253.  
  8254.     Distance from root
  8255.         The    link state cost    of the current set of shortest paths
  8256.         from the root to the vertex.  The link state cost of a path
  8257.         is calculated as the sum of    the costs of the path's
  8258.         constituent    links (as advertised in    router-LSAs and
  8259.         network-LSAs).  One    path is    said to    be "shorter" than
  8260.         another if it has a    smaller    link state cost.
  8261.  
  8262.  
  8263.     The first stage    of the procedure (i.e.,    the Dijkstra algorithm)
  8264.     can now    be summarized as follows. At each iteration of the
  8265.     algorithm, there is a list of candidate    vertices.  Paths from
  8266.     the root to these vertices have    been found, but    not necessarily
  8267.     the shortest ones.  However, the paths to the candidate    vertex
  8268.     that is    closest    to the root are    guaranteed to be shortest; this
  8269.     vertex is added    to the shortest-path tree, removed from    the
  8270.     candidate list,    and its    adjacent vertices are examined for
  8271.     possible addition to/modification of the candidate list.  The
  8272.     algorithm then iterates    again.    It terminates when the candidate
  8273.     list becomes empty.
  8274.  
  8275.     The following steps describe the algorithm in detail.  Remember
  8276.     that we    are computing the shortest path    tree for Area A.  All
  8277.     references to link state database lookup below are from    Area A's
  8278.     database.
  8279.  
  8280.  
  8281.     (1) Initialize the algorithm's data structures.     Clear the list
  8282.         of candidate vertices.  Initialize the shortest-path tree to
  8283.         only the root (which is the    router doing the calculation).
  8284.         Set    Area A's TransitCapability to FALSE.
  8285.  
  8286.  
  8287.  
  8288. Moy                                  [Page 148]
  8289.  
  8290. Internet Draft             OSPF Version 2           February 1997
  8291.  
  8292.  
  8293.     (2) Call the vertex just added to the tree vertex V.  Examine
  8294.         the    LSA associated with vertex V.  This is a lookup    in the
  8295.         Area A's link state    database based on the Vertex ID.  If
  8296.         this is a router-LSA, and bit V of the router-LSA (see
  8297.         Section A.4.2) is set, set Area A's    TransitCapability to
  8298.         TRUE.  In any case,    each link described by the LSA gives the
  8299.         cost to an adjacent    vertex.     For each described link, (say
  8300.         it joins vertex V to vertex    W):
  8301.  
  8302.         (a)    If this    is a link to a stub network, examine the next
  8303.         link in    V's LSA.  Links    to stub    networks will be
  8304.         considered in the second stage of the shortest path
  8305.         calculation.
  8306.  
  8307.         (b)    Otherwise, W is    a transit vertex (router or transit
  8308.         network).  Look    up the vertex W's LSA (router-LSA or
  8309.         network-LSA) in    Area A's link state database.  If the
  8310.         LSA does not exist, or its LS age is equal to MaxAge, or
  8311.         it does    not have a link    back to    vertex V, examine the
  8312.         next link in V's LSA.[25]
  8313.  
  8314.         (c)    If vertex W is already on the shortest-path tree,
  8315.         examine    the next link in the LSA.
  8316.  
  8317.         (d)    Calculate the link state cost D    of the resulting path
  8318.         from the root to vertex    W.  D is equal to the sum of the
  8319.         link state cost    of the (already    calculated) shortest
  8320.         path to    vertex V and the advertised cost of the    link
  8321.         between    vertices V and W.  If D    is:
  8322.  
  8323.         o   Greater than the value that    already    appears    for
  8324.             vertex W on    the candidate list, then examine the
  8325.             next link.
  8326.  
  8327.         o   Equal to the value that appears for    vertex W on the
  8328.             candidate list, calculate the set of next hops that
  8329.             result from    using the advertised link.  Input to
  8330.             this calculation is    the destination    (W), and its
  8331.             parent (V).     This calculation is shown in Section
  8332.             16.1.1.  This set of hops should be    added to the
  8333.             next hop values that appear    for W on the candidate
  8334.             list.
  8335.  
  8336.         o   Less than the value    that appears for vertex    W on the
  8337.             candidate list, or if W does not yet appear    on the
  8338.             candidate list, then set the entry for W on    the
  8339.             candidate list to indicate a distance of D from the
  8340.             root.  Also    calculate the list of next hops    that
  8341.  
  8342.  
  8343.  
  8344. Moy                                  [Page 149]
  8345.  
  8346. Internet Draft             OSPF Version 2           February 1997
  8347.  
  8348.  
  8349.             result from    using the advertised link, setting the
  8350.             next hop values for    W accordingly.    The next hop
  8351.             calculation    is described in    Section    16.1.1;    it takes
  8352.             as input the destination (W) and its parent    (V).
  8353.  
  8354.     (3) If at this step the    candidate list is empty, the shortest-
  8355.         path tree (of transit vertices) has    been completely    built
  8356.         and    this stage of the procedure terminates.     Otherwise,
  8357.         choose the vertex belonging    to the candidate list that is
  8358.         closest to the root, and add it to the shortest-path tree
  8359.         (removing it from the candidate list in the    process). Note
  8360.         that when there is a choice    of vertices closest to the root,
  8361.         network vertices must be chosen before router vertices in
  8362.         order to necessarily find all equal-cost paths. This is
  8363.         consistent with the    tie-breakers that were introduced in the
  8364.         modified Dijkstra algorithm    used by    OSPF's Multicast routing
  8365.         extensions (MOSPF).
  8366.  
  8367.     (4) Possibly modify the    routing    table.    For those routing table
  8368.         entries modified, the associated area will be set to Area A,
  8369.         the    path type will be set to intra-area, and the cost will
  8370.         be set to the newly    discovered shortest path's calculated
  8371.         distance.
  8372.  
  8373.         If the newly added vertex is an area border    router or AS
  8374.         boundary router, a routing table entry is added whose
  8375.         destination    type is    "router".  The Options field found in
  8376.         the    associated router-LSA is copied    into the routing table
  8377.         entry's Optional capabilities field. Call the newly    added
  8378.         vertex Router X.  If Router    X is the endpoint of one of the
  8379.         calculating    router's virtual links,    and the    virtual    link
  8380.         uses Area A    as Transit area:  the virtual link is declared
  8381.         up,    the IP address of the virtual interface    is set to the IP
  8382.         address of the outgoing interface calculated above for
  8383.         Router X, and the virtual neighbor's IP address is set to
  8384.         Router X's interface address (contained in Router X's
  8385.         router-LSA)    that points back to the    root of    the shortest-
  8386.         path tree; equivalently, this is the interface that    points
  8387.         back to Router X's parent vertex on    the shortest-path tree
  8388.         (similar to    the calculation    in Section 16.1.1).
  8389.  
  8390.         If the newly added vertex is a transit network, the    routing
  8391.         table entry    for the    network    is located.  The entry's
  8392.         Destination    ID is the IP network number, which can be
  8393.         obtained by    masking    the Vertex ID (Link State ID) with its
  8394.         associated subnet mask (found in the body of the associated
  8395.         network-LSA).  If the routing table    entry already exists
  8396.         (i.e., there is already an intra-area route    to the
  8397.  
  8398.  
  8399.  
  8400. Moy                                  [Page 150]
  8401.  
  8402. Internet Draft             OSPF Version 2           February 1997
  8403.  
  8404.  
  8405.         destination    installed in the routing table), multiple
  8406.         vertices have mapped to the    same IP    network.  For example,
  8407.         this can occur when    a new Designated Router    is being
  8408.         established.  In this case,    the current routing table entry
  8409.         should be overwritten if and only if the newly found path is
  8410.         just as short and the current routing table    entry's    Link
  8411.         State Origin has a smaller Link State ID than the newly
  8412.         added vertex' LSA.
  8413.  
  8414.         If there is    no routing table entry for the network (the
  8415.         usual case), a routing table entry for the IP network should
  8416.         be added.  The routing table entry's Link State Origin
  8417.         should be set to the newly added vertex' LSA.
  8418.  
  8419.     (5) Iterate the    algorithm by returning to Step 2.
  8420.  
  8421.  
  8422.     The stub networks are added to the tree    in the procedure's
  8423.     second stage.  In this stage, all router vertices are again
  8424.     examined.  Those that have been    determined to be unreachable in
  8425.     the above first    phase are discarded.  For each reachable router
  8426.     vertex (call it    V), the    associated router-LSA is found in the
  8427.     link state database.  Each stub    network    link appearing in the
  8428.     LSA is then examined, and the following    steps are executed:
  8429.  
  8430.  
  8431.     (1) Calculate the distance D of    stub network from the root.  D
  8432.         is equal to    the distance from the root to the router vertex
  8433.         (calculated    in stage 1), plus the stub network link's
  8434.         advertised cost.  Compare this distance to the current best
  8435.         cost to the    stub network.  This is done by looking up the
  8436.         stub network's current routing table entry.     If the
  8437.         calculated distance    D is larger, go    on to examine the next
  8438.         stub network link in the LSA.
  8439.  
  8440.     (2) If this step is reached, the stub network's    routing    table
  8441.         entry must be updated.  Calculate the set of next hops that
  8442.         would result from using the    stub network link.  This
  8443.         calculation    is shown in Section 16.1.1; input to this
  8444.         calculation    is the destination (the    stub network) and the
  8445.         parent vertex (the router vertex).    If the distance    D is the
  8446.         same as the    current    routing    table cost, simply add this set
  8447.         of next hops to the    routing    table entry's list of next hops.
  8448.         In this case, the routing table already has    a Link State
  8449.         Origin.  If    this Link State    Origin is a router-LSA whose
  8450.         Link State ID is smaller than V's Router ID, reset the Link
  8451.         State Origin to V's    router-LSA.
  8452.  
  8453.  
  8454.  
  8455.  
  8456. Moy                                  [Page 151]
  8457.  
  8458. Internet Draft             OSPF Version 2           February 1997
  8459.  
  8460.  
  8461.         Otherwise D    is smaller than    the routing table cost.
  8462.         Overwrite the current routing table    entry by setting the
  8463.         routing table entry's cost to D, and by setting the    entry's
  8464.         list of next hops to the newly calculated set.  Set    the
  8465.         routing table entry's Link State Origin to V's router-LSA.
  8466.         Then go on to examine the next stub    network    link.
  8467.  
  8468.  
  8469.     For all    routing    table entries added/modified in    the second
  8470.     stage, the associated area will    be set to Area A and the path
  8471.     type will be set to intra-area.     When the list of reachable
  8472.     router-LSAs is exhausted, the second stage is completed.  At
  8473.     this time, all intra-area routes associated with Area A    have
  8474.     been determined.
  8475.  
  8476.     The specification does not require that    the above two stage
  8477.     method be used to calculate the    shortest path tree.  However, if
  8478.     another    algorithm is used, an identical    tree must be produced.
  8479.     For this reason, it is important to note that links between
  8480.     transit    vertices must be bidirectional in order    to be included
  8481.     in the above tree.  It should also be mentioned    that more
  8482.     efficient algorithms exist for calculating the tree; for
  8483.     example, the incremental SPF algorithm described in [Ref1].
  8484.  
  8485.  
  8486.     16.1.1.     The next hop calculation
  8487.  
  8488.         This section explains how to calculate the current set of
  8489.         next hops to use for a destination.     Each next hop consists
  8490.         of the outgoing interface to use in    forwarding packets to
  8491.         the    destination together with the IP address of the    next hop
  8492.         router (if any).  The next hop calculation is invoked each
  8493.         time a shorter path    to the destination is discovered.  This
  8494.         can    happen in either stage of the shortest-path tree
  8495.         calculation    (see Section 16.1).  In    stage 1    of the
  8496.         shortest-path tree calculation a shorter path is found as
  8497.         the    destination is added to    the candidate list, or when the
  8498.         destination's entry    on the candidate list is modified (Step
  8499.         2d of Stage    1).  In    stage 2    a shorter path is discovered
  8500.         each time the destination's    routing    table entry is modified
  8501.         (Step 2 of Stage 2).
  8502.  
  8503.         The    set of next hops to use    for the    destination may    be
  8504.         recalculated several times during the shortest-path    tree
  8505.         calculation, as shorter and    shorter    paths are discovered.
  8506.         In the end,    the destination's routing table    entry will
  8507.         always reflect the next hops resulting from    the absolute
  8508.         shortest path(s).
  8509.  
  8510.  
  8511.  
  8512. Moy                                  [Page 152]
  8513.  
  8514. Internet Draft             OSPF Version 2           February 1997
  8515.  
  8516.  
  8517.         Input to the next hop calculation is a) the    destination and
  8518.         b) its parent in the current shortest path between the root
  8519.         (the calculating router) and the destination.  The parent is
  8520.         always a transit vertex (i.e., always a router or a    transit
  8521.         network).
  8522.  
  8523.         If there is    at least one intervening router    in the current
  8524.         shortest path between the destination and the root,    the
  8525.         destination    simply inherits    the set    of next    hops from the
  8526.         parent.  Otherwise,    there are two cases.  In the first case,
  8527.         the    parent vertex is the root (the calculating router
  8528.         itself).  This means that the destination is either    a
  8529.         directly connected network or directly connected router.
  8530.         The    outgoing interface in this case    is simply the OSPF
  8531.         interface connecting to the    destination network/router. If
  8532.         the    destination is a router    which connects to the
  8533.         calculating    router via a Point-to-MultiPoint network, the
  8534.         destination's next hop IP address(es) can be determined by
  8535.         examining the destination's    router-LSA: each link pointing
  8536.         back to the    calculating router and having a    Link Data field
  8537.         belonging to the Point-to-MultiPoint network provides an IP
  8538.         address of the next    hop router. If the destination is a
  8539.         directly connected network,    or a router which connects to
  8540.         the    calculating router via a point-to-point    interface, no
  8541.         next hop IP    address    is required. If    the destination    is a
  8542.         router connected to    the calculating    router via a virtual
  8543.         link, the setting of the next hop should be    deferred until
  8544.         the    calculation in Section 16.3.
  8545.  
  8546.         In the second case,    the parent vertex is a network that
  8547.         directly connects the calculating router to    the destination
  8548.         router.  The list of next hops is then determined by
  8549.         examining the destination's    router-LSA.  For each link in
  8550.         the    router-LSA that    points back to the parent network, the
  8551.         link's Link    Data field provides the    IP address of a    next hop
  8552.         router.  The outgoing interface to use can then be derived
  8553.         from the next hop IP address (or it    can be inherited from
  8554.         the    parent network).
  8555.  
  8556.  
  8557.     16.2.  Calculating the inter-area routes
  8558.  
  8559.     The inter-area routes are calculated by    examining summary-LSAs.
  8560.     If the router has active attachments to    multiple areas,    only
  8561.     backbone summary-LSAs are examined.  Routers attached to a
  8562.     single area examine that area's    summary-LSAs.  In either case,
  8563.     the summary-LSAs examined below    are all    part of    a single area's
  8564.     link state database (call it Area A).
  8565.  
  8566.  
  8567.  
  8568. Moy                                  [Page 153]
  8569.  
  8570. Internet Draft             OSPF Version 2           February 1997
  8571.  
  8572.  
  8573.     Summary-LSAs are originated by the area    border routers.     Each
  8574.     summary-LSA in Area A is considered in turn.  Remember that the
  8575.     destination described by a summary-LSA is either a network (Type
  8576.     3 summary-LSAs)    or an AS boundary router (Type 4 summary-LSAs).
  8577.     For each summary-LSA:
  8578.  
  8579.  
  8580.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8581.         LSA's LS age is equal to MaxAge, then examine the the next
  8582.         LSA.
  8583.  
  8584.     (2) If the LSA was originated by the calculating router    itself,
  8585.         examine the    next LSA.
  8586.  
  8587.     (3) If it is a Type 3 summary-LSA, and the collection of
  8588.         destinations described by the summary-LSA equals one of the
  8589.         router's configured    area address ranges (see Section 3.5),
  8590.         and    the particular area address range is active, then the
  8591.         summary-LSA    should be ignored.  "Active" means that    there
  8592.         are    one or more reachable (by intra-area paths) networks
  8593.         contained in the area range.
  8594.  
  8595.     (4) Else, call the destination described by the    LSA N (for Type
  8596.         3 summary-LSAs, N's    address    is obtained by masking the LSA's
  8597.         Link State ID with the network/subnet mask contained in the
  8598.         body of the    LSA), and the area border originating the LSA
  8599.         BR.     Look up the routing table entry for BR    having Area A as
  8600.         its    associated area.  If no    such entry exists for router BR
  8601.         (i.e., BR is unreachable in    Area A), do nothing with this
  8602.         LSA    and consider the next in the list.  Else, this LSA
  8603.         describes an inter-area path to destination    N, whose cost is
  8604.         the    distance to BR plus the    cost specified in the LSA. Call
  8605.         the    cost of    this inter-area    path IAC.
  8606.  
  8607.     (5) Next, look up the routing table entry for the destination N.
  8608.         (If    N is an    AS boundary router, look up the    "router" routing
  8609.         table entry    associated with    Area A).  If no    entry exists for
  8610.         N or if the    entry's    path type is "type 1 external" or "type
  8611.         2 external", then install the inter-area path to N,    with
  8612.         associated area Area A, cost IAC, next hop equal to    the list
  8613.         of next hops to router BR, and Advertising router equal to
  8614.         BR.
  8615.  
  8616.     (6) Else, if the paths present in the table are    intra-area
  8617.         paths, do nothing with the LSA (intra-area paths are always
  8618.         preferred).
  8619.  
  8620.  
  8621.  
  8622.  
  8623.  
  8624. Moy                                  [Page 154]
  8625.  
  8626. Internet Draft             OSPF Version 2           February 1997
  8627.  
  8628.  
  8629.     (7) Else, the paths present in the routing table are also
  8630.         inter-area paths.  Install the new path through BR if it is
  8631.         cheaper, overriding    the paths in the routing table.
  8632.         Otherwise, if the new path is the same cost, add it    to the
  8633.         list of paths that appear in the routing table entry.
  8634.  
  8635.  
  8636.     16.3.  Examining transit areas' summary-LSAs
  8637.  
  8638.     This step is only performed by area border routers attached to
  8639.     one or more non-backbone areas that are    capable    of carrying
  8640.     transit    traffic    (i.e., "transit    areas",    or those areas whose
  8641.     TransitCapability parameter has    been set to TRUE in Step 2 of
  8642.     the Dijkstra algorithm (see Section 16.1).
  8643.  
  8644.     The purpose of the calculation below is    to examine the transit
  8645.     areas to see whether they provide any better (shorter) paths
  8646.     than the paths previously calculated in    Sections 16.1 and 16.2.
  8647.     Any paths found    that are better    than or    equal to previously
  8648.     discovered paths are installed in the routing table.
  8649.  
  8650.     The calculation    proceeds as follows. All the transit areas'
  8651.     summary-LSAs are examined in turn.  Each such summary-LSA
  8652.     describes a route through a transit area Area A    to a Network N
  8653.     (N's address is    obtained by masking the    LSA's Link State ID with
  8654.     the network/subnet mask    contained in the body of the LSA) or in
  8655.     the case of a Type 4 summary-LSA, to an    AS boundary router N.
  8656.     Suppose    also that the summary-LSA was originated by an area
  8657.     border router BR.
  8658.  
  8659.     (1) If the cost    advertised by the summary-LSA is LSInfinity, or
  8660.         if the LSA's LS age    is equal to MaxAge, then examine the
  8661.         next LSA.
  8662.  
  8663.     (2) If the summary-LSA was originated by the calculating router
  8664.         itself, examine the    next LSA.
  8665.  
  8666.     (3) Look up the    routing    table entry for    N. (If N is an AS
  8667.         boundary router, look up the "router" routing table    entry
  8668.         associated with the    backbone area).    If it does not exist, or
  8669.         if the route type is other than intra-area or inter-area, or
  8670.         if the area    associated with    the routing table entry    is not
  8671.         the    backbone area, then examine the    next LSA. In other
  8672.         words, this    calculation only updates backbone intra-area
  8673.         routes found in Section 16.1 and inter-area    routes found in
  8674.         Section 16.2.
  8675.  
  8676.  
  8677.  
  8678.  
  8679.  
  8680. Moy                                  [Page 155]
  8681.  
  8682. Internet Draft             OSPF Version 2           February 1997
  8683.  
  8684.  
  8685.     (4) Look up the    routing    table entry for    the advertising    router
  8686.         BR associated with the Area    A. If it is unreachable, examine
  8687.         the    next LSA. Otherwise, the cost to destination N is the
  8688.         sum    of the cost in BR's Area A routing table entry and the
  8689.         cost advertised in the LSA.    Call this cost IAC.
  8690.  
  8691.     (5) If this cost is less than the cost occurring in N's    routing
  8692.         table entry, overwrite N's list of next hops with those used
  8693.         for    BR, and    set N's    routing    table cost to IAC. Else, if IAC
  8694.         is the same    as N's current cost, add BR's list of next hops
  8695.         to N's list    of next    hops. In any case, the area associated
  8696.         with N's routing table entry must remain the backbone area,
  8697.         and    the path type (either intra-area or inter-area)    must
  8698.         also remain    the same.
  8699.  
  8700.     It is important    to note    that the above calculation never makes
  8701.     unreachable destinations reachable, but    instead    just potentially
  8702.     finds better paths to already reachable    destinations.  The
  8703.     calculation installs any better    cost found into    the routing
  8704.     table entry, from which    it may be readvertised in summary-LSAs
  8705.     to other areas.
  8706.  
  8707.     As an example of the calculation, consider the Autonomous System
  8708.     pictured in Figure 17.    There is a single non-backbone area
  8709.  
  8710.               ........................
  8711.               .    Area 1 (transit)     .          +
  8712.               .                 .          |
  8713.               .         +---+1       1+---+100      |
  8714.               .         |RT2|----------|RT4|=========|
  8715.               .       1/+---+********* +---+      |
  8716.               .       /*******         .          |
  8717.               .     1/*Virtual         .          |
  8718.            1+---+/*  Link         .           Net|work
  8719.          =======|RT1|*             .          | N1
  8720.             +---+\             .          |
  8721.               .      \             .          |
  8722.               .       \             .          |
  8723.               .       1\+---+1       1+---+20      |
  8724.               .         |RT3|----------|RT5|=========|
  8725.               .         +---+        +---+      |
  8726.               .                 .          |
  8727.               ........................          +
  8728.  
  8729.  
  8730.             Figure 17: Routing through transit areas
  8731.  
  8732.  
  8733.  
  8734.  
  8735.  
  8736. Moy                                  [Page 156]
  8737.  
  8738. Internet Draft             OSPF Version 2           February 1997
  8739.  
  8740.  
  8741.     (Area 1) that physically divides the backbone into two separate
  8742.     pieces.    To maintain connectivity of the    backbone, a virtual link
  8743.     has been configured between routers RT1    and RT4. On the    right
  8744.     side of    the figure, Network N1 belongs to the backbone.    The
  8745.     dotted lines indicate that there is a much shorter intra-area
  8746.     backbone path between router RT5 and Network N1    (cost 20) than
  8747.     there is between Router    RT4 and    Network    N1 (cost 100). Both
  8748.     Router RT4 and Router RT5 will inject summary-LSAs for Network
  8749.     N1 into    Area 1.
  8750.  
  8751.     After the shortest-path    tree has been calculated for the
  8752.     backbone in Section 16.1, Router RT1 (left end of the virtual
  8753.     link) will have    calculated a path through Router RT4 for all
  8754.     data traffic destined for Network N1. However, since Router RT5
  8755.     is so much closer to Network N1, all routers internal to Area 1
  8756.     (e.g., Routers RT2 and RT3) will forward their Network N1
  8757.     traffic    towards    Router RT5, instead of RT4. And    indeed,    after
  8758.     examining Area 1's summary-LSAs    by the above calculation, Router
  8759.     RT1 will also forward Network N1 traffic towards RT5. Note that
  8760.     in this    example    the virtual link enables transit data traffic to
  8761.     be forwarded through Area 1, but the actual path the transit
  8762.     data traffic takes does    not follow the virtual link.  In other
  8763.     words, virtual links allow transit traffic to be forwarded
  8764.     through    an area, but do    not dictate the    precise    path that the
  8765.     traffic    will take.
  8766.  
  8767.     16.4.  Calculating AS external routes
  8768.  
  8769.     AS external routes are calculated by examining AS-external-LSAs.
  8770.     Each of    the AS-external-LSAs is    considered in turn.  Most AS-
  8771.     external-LSAs describe routes to specific IP destinations.  An
  8772.     AS-external-LSA    can also describe a default route for the
  8773.     Autonomous System (Destination ID = DefaultDestination,
  8774.     network/subnet mask = 0x00000000).  For    each AS-external-LSA:
  8775.  
  8776.  
  8777.     (1) If the cost    specified by the LSA is    LSInfinity, or if the
  8778.         LSA's LS age is equal to MaxAge, then examine the next LSA.
  8779.  
  8780.     (2) If the LSA was originated by the calculating router    itself,
  8781.         examine the    next LSA.
  8782.  
  8783.     (3) Call the destination described by the LSA N.  N's address is
  8784.         obtained by    masking    the LSA's Link State ID    with the
  8785.         network/subnet mask    contained in the body of the LSA.  Look
  8786.         up the routing table entries (potentially one per attached
  8787.         area) for the AS boundary router (ASBR) that originated the
  8788.         LSA. If no entries exist for router    ASBR (i.e., ASBR is
  8789.  
  8790.  
  8791.  
  8792. Moy                                  [Page 157]
  8793.  
  8794. Internet Draft             OSPF Version 2           February 1997
  8795.  
  8796.  
  8797.         unreachable), do nothing with this LSA and consider    the next
  8798.         in the list.
  8799.  
  8800.         Else, this LSA describes an    AS external path to destination
  8801.         N.    Examine    the forwarding address specified in the    AS-
  8802.         external-LSA.  This    indicates the IP address to which
  8803.         packets for    the destination    should be forwarded.
  8804.  
  8805.         If the forwarding address is set to    0.0.0.0, packets should
  8806.         be sent to the ASBR    itself.    Among the multiple routing table
  8807.         entries for    the ASBR, select the preferred entry as    follows.
  8808.         If RFC1583Compatibility is set to "disabled", prune    the set
  8809.         of routing table entries for the ASBR as described in
  8810.         Section 16.4.1. In any case, among the remaining routing
  8811.         table entries, select the routing table entry with the least
  8812.         cost; when there are multiple least    cost routing table
  8813.         entries the    entry whose associated area has    the largest OSPF
  8814.         Area ID (when considered as    an unsigned 32-bit integer) is
  8815.         chosen.
  8816.  
  8817.         If the forwarding address is non-zero, look    up the
  8818.         forwarding address in the routing table.[26] The matching
  8819.         routing table entry    must specify an    intra-area or inter-area
  8820.         path; if no    such path exists, do nothing with the LSA and
  8821.         consider the next in the list.
  8822.  
  8823.     (4) Let    X be the cost specified    by the preferred routing table
  8824.         entry for the ASBR/forwarding address, and Y the cost
  8825.         specified in the LSA.  X is    in terms of the    link state
  8826.         metric, and    Y is a type 1 or 2 external metric.
  8827.  
  8828.     (5) Look up the    routing    table entry for    the destination    N.  If
  8829.         no entry exists for    N, install the AS external path    to N,
  8830.         with next hop equal    to the list of next hops to the
  8831.         forwarding address,    and advertising    router equal to    ASBR.
  8832.         If the external metric type    is 1, then the path-type is set
  8833.         to type 1 external and the cost is equal to    X+Y.  If the
  8834.         external metric type is 2, the path-type is    set to type 2
  8835.         external, the link state component of the route's cost is X,
  8836.         and    the type 2 cost    is Y.
  8837.  
  8838.     (6) Compare the    AS external path described by the LSA with the
  8839.         existing paths in N's routing table    entry, as follows. If
  8840.         the    new path is preferred, it replaces the present paths in
  8841.         N's    routing    table entry.  If the new path is of equal
  8842.         preference,    it is added to N's routing table entry's list of
  8843.         paths.
  8844.  
  8845.  
  8846.  
  8847.  
  8848. Moy                                  [Page 158]
  8849.  
  8850. Internet Draft             OSPF Version 2           February 1997
  8851.  
  8852.  
  8853.         (a)    Intra-area and inter-area paths    are always preferred
  8854.         over AS    external paths.
  8855.  
  8856.         (b)    Type 1 external    paths are always preferred over    type 2
  8857.         external paths.    When all paths are type    2 external
  8858.         paths, the paths with the smallest advertised type 2
  8859.         metric are always preferred.
  8860.  
  8861.         (c)    If the new AS external path is still indistinguishable
  8862.         from the current paths in the N's routing table    entry,
  8863.         and RFC1583Compatibility is set    to "disabled", select
  8864.         the preferred paths based on the intra-AS paths    to the
  8865.         ASBR/forwarding    addresses, as specified    in Section
  8866.         16.4.1.
  8867.  
  8868.         (d)    If the new AS external path is still indistinguishable
  8869.         from the current paths in the N's routing table    entry,
  8870.         select the preferred path based    on a least cost
  8871.         comparison.  Type 1 external paths are compared    by
  8872.         looking    at the sum of the distance to the forwarding
  8873.         address    and the    advertised type    1 metric (X+Y).     Type 2
  8874.         external paths advertising equal type 2    metrics    are
  8875.         compared by looking at the distance to the forwarding
  8876.         addresses.
  8877.  
  8878.     16.4.1.     External path preferences
  8879.  
  8880.         When multiple intra-AS paths are available to
  8881.         ASBRs/forwarding addresses,    the following rules indicate
  8882.         which paths    are preferred. These rules apply when the same
  8883.         ASBR is reachable through multiple areas, or when trying to
  8884.         decide which of several AS-external-LSAs should be
  8885.         preferred. In the former case the paths all    terminate at the
  8886.         same ASBR, while in    the latter the paths terminate at
  8887.         separate ASBRs/forwarding addresses. In either case, each
  8888.         path is represented    by a separate routing table entry as
  8889.         defined in Section 11.
  8890.  
  8891.         This section only applies when RFC1583Compatibility    is set
  8892.         to "disabled".
  8893.  
  8894.         The    path preference    rules, stated from highest to lowest
  8895.         preference,    are as follows.    Note that as a result of these
  8896.         rules, there may still be multiple paths of    the highest
  8897.         preference.    In this    case, the path to use must be determined
  8898.         based on cost, as described    in Section 16.4.
  8899.  
  8900.  
  8901.  
  8902.  
  8903.  
  8904. Moy                                  [Page 159]
  8905.  
  8906. Internet Draft             OSPF Version 2           February 1997
  8907.  
  8908.  
  8909.         o    Intra-area paths using non-backbone areas are always the
  8910.         most preferred.
  8911.  
  8912.         o    Otherwise, intra-area backbone paths are preferred.
  8913.  
  8914.         o    Inter-area paths are the least preferred.
  8915.  
  8916.     16.5.  Incremental updates -- summary-LSAs
  8917.  
  8918.     When a new summary-LSA is received, it is not necessary    to
  8919.     recalculate the    entire routing table.  Call the    destination
  8920.     described by the summary-LSA N (N's address is obtained    by
  8921.     masking    the LSA's Link State ID    with the network/subnet    mask
  8922.     contained in the body of the LSA), and let Area    A be the area to
  8923.     which the LSA belongs. There are then two separate cases:
  8924.  
  8925.     Case 1:    Area A is the backbone and/or the router is not    an area
  8926.         border router.
  8927.         In this case, the following    calculations must be performed.
  8928.         First, if there is presently an inter-area route to    the
  8929.         destination    N, N's routing table entry is invalidated,
  8930.         saving the entry's values for later    comparisons. Then the
  8931.         calculation    in Section 16.2    is run again for the single
  8932.         destination    N. In this calculation,    all of Area A's
  8933.         summary-LSAs that describe a route to N are    examined.  In
  8934.         addition, if the router is an area border router attached to
  8935.         one    or more    transit    areas, the calculation in Section 16.3
  8936.         must be run    again for the single destination.  If the
  8937.         results of these calculations have changed the cost/path to
  8938.         an AS boundary router (as would be the case    for a Type 4
  8939.         summary-LSA) or to any forwarding addresses, all AS-
  8940.         external-LSAs will have to be reexamined by    rerunning the
  8941.         calculation    in Section 16.4.  Otherwise, if    N is now newly
  8942.         unreachable, the calculation in Section 16.4 must be rerun
  8943.         for    the single destination N, in case an alternate external
  8944.         route to N exists.
  8945.  
  8946.     Case 2:    Area A is a transit area and the router    is an area
  8947.         border router.
  8948.         In this case, the following    calculations must be performed.
  8949.         First, if N's routing table    entry presently    contains one or
  8950.         more inter-area paths that utilize the transit area    Area A,
  8951.         these paths    should be removed. If this removes all paths
  8952.         from the routing table entry, the entry should be
  8953.         invalidated.  The entry's old values should    be saved for
  8954.         later comparisons. Next the    calculation in Section 16.3 must
  8955.         be run again for the single    destination N. If the results of
  8956.         this calculation have caused the cost to N to increase, the
  8957.  
  8958.  
  8959.  
  8960. Moy                                  [Page 160]
  8961.  
  8962. Internet Draft             OSPF Version 2           February 1997
  8963.  
  8964.  
  8965.         complete routing table calculation must be rerun starting
  8966.         with the Dijkstra algorithm    specified in Section 16.1.
  8967.         Otherwise, if the cost/path    to an AS boundary router (as
  8968.         would be the case for a Type 4 summary-LSA)    or to any
  8969.         forwarding addresses has changed, all AS-external-LSAs will
  8970.         have to be reexamined by rerunning the calculation in
  8971.         Section 16.4.  Otherwise, if N is now newly    unreachable, the
  8972.         calculation    in Section 16.4    must be    rerun for the single
  8973.         destination    N, in case an alternate    external route to N
  8974.         exists.
  8975.  
  8976.     16.6.  Incremental updates -- AS-external-LSAs
  8977.  
  8978.     When a new AS-external-LSA is received,    it is not necessary to
  8979.     recalculate the    entire routing table.  Call the    destination
  8980.     described by the AS-external-LSA N.  N's address is obtained by
  8981.     masking    the LSA's Link State ID    with the network/subnet    mask
  8982.     contained in the body of the LSA. If there is already an intra-
  8983.     area or    inter-area route to the    destination, no    recalculation is
  8984.     necessary (internal routes take    precedence).
  8985.  
  8986.     Otherwise, the procedure in Section 16.4 will have to be
  8987.     performed, but only for    those AS-external-LSAs whose destination
  8988.     is N.  Before this procedure is    performed, the present routing
  8989.     table entry for    N should be invalidated.
  8990.  
  8991.  
  8992.     16.7.  Events generated as a result    of routing table changes
  8993.  
  8994.     Changes    to routing table entries sometimes cause the OSPF area
  8995.     border routers to take additional actions.  These routers need
  8996.     to act on the following    routing    table changes:
  8997.  
  8998.  
  8999.     o   The    cost or    path type of a routing table entry has changed.
  9000.         If the destination described by this entry is a Network or
  9001.         AS boundary    router,    and this is not    simply a change    of AS
  9002.         external routes, new summary-LSAs may have to be generated
  9003.         (potentially one for each attached area, including the
  9004.         backbone).    See Section 12.4.3 for more information.  If a
  9005.         previously advertised entry    has been deleted, or is    no
  9006.         longer advertisable    to a particular    area, the LSA must be
  9007.         flushed from the routing domain by setting its LS age to
  9008.         MaxAge and reflooding (see Section 14.1).
  9009.  
  9010.     o   A routing table entry associated with a configured virtual
  9011.         link has changed.  The destination of such a routing table
  9012.         entry is an    area border router.  The change    indicates a
  9013.  
  9014.  
  9015.  
  9016. Moy                                  [Page 161]
  9017.  
  9018. Internet Draft             OSPF Version 2           February 1997
  9019.  
  9020.  
  9021.         modification to the    virtual    link's cost or viability.
  9022.  
  9023.         If the entry indicates that    the area border    router is newly
  9024.         reachable (via TOS 0), the corresponding virtual link is now
  9025.         operational.  An InterfaceUp event should be generated for
  9026.         the    virtual    link, which will cause a virtual adjacency to
  9027.         begin to form (see Section 10.3).  At this time the    virtual
  9028.         link's IP interface    address    and the    virtual    neighbor's
  9029.         Neighbor IP    address    are also calculated.
  9030.  
  9031.         If the entry indicates that    the area border    router is no
  9032.         longer reachable (via TOS 0), the virtual link and its
  9033.         associated adjacency should    be destroyed.  This means an
  9034.         InterfaceDown event    should be generated for    the associated
  9035.         virtual link.
  9036.  
  9037.         If the cost    of the entry has changed, and there is a fully
  9038.         established    virtual    adjacency, a new router-LSA for    the
  9039.         backbone must be originated.  This in turn may cause further
  9040.         routing table changes.
  9041.  
  9042.  
  9043.     16.8.  Equal-cost multipath
  9044.  
  9045.     The OSPF protocol maintains multiple equal-cost    routes to all
  9046.     destinations.  This can    be seen    in the steps used above    to
  9047.     calculate the routing table, and in the    definition of the
  9048.     routing    table structure.
  9049.  
  9050.     Each one of the    multiple routes    will be    of the same type
  9051.     (intra-area, inter-area, type 1    external or type 2 external),
  9052.     cost, and will have the    same associated    area.  However,    each
  9053.     route specifies    a separate next    hop and    Advertising router.
  9054.  
  9055.     There is no requirement    that a router running OSPF keep    track of
  9056.     all possible equal-cost    routes to a destination.  An
  9057.     implementation may choose to keep only a fixed number of routes
  9058.     to any given destination.  This    does not affect    any of the
  9059.     algorithms presented in    this specification.
  9060.  
  9061.  
  9062.     16.9.  Building the    non-zero-TOS portion of    the routing table
  9063.  
  9064.     The OSPF protocol can calculate    a different set    of routes for
  9065.     each IP    TOS (see Section 2.5).    Support    for TOS-based routing is
  9066.     optional.  TOS-capable and non-TOS-capable routers can be mixed
  9067.     in an OSPF routing domain.  Routers not    supporting TOS calculate
  9068.     only the TOS 0 route to    each destination.  These routes    are then
  9069.  
  9070.  
  9071.  
  9072. Moy                                  [Page 162]
  9073.  
  9074. Internet Draft             OSPF Version 2           February 1997
  9075.  
  9076.  
  9077.     used to    forward    all data traffic, regardless of    the TOS
  9078.     indications in the data    packet's IP header.  A router that does
  9079.     not support TOS    indicates this fact to the other OSPF routers by
  9080.     clearing the T-bit in the Options field    of its router-LSA.
  9081.  
  9082.     The above sections detailing the routing table calculations
  9083.     handle the TOS 0 case only.  In    general, for routers supporting
  9084.     TOS-based routing, each    piece of the routing table calculation
  9085.     must be    rerun separately for the non-zero TOS values.  When
  9086.     calculating routes for TOS X, only TOS X metrics can be    used.
  9087.     Any LSA    may specify a separate cost for    each TOS (a cost for TOS
  9088.     0 must always be specified).  The encoding of TOS in OSPF LSAs
  9089.     is described in    Section    12.3.
  9090.  
  9091.     An LSA can specify that    it is restricted to TOS    0 (i.e., non-
  9092.     zero TOS is not    handled) by clearing the T-bit in the LSA's
  9093.     Option field.  Such LSAs are not used when calculating routes
  9094.     for non-zero TOS.  For this reason, it is possible that    a
  9095.     destination is unreachable for some non-zero TOS.  In this case,
  9096.     the TOS    0 path is used when forwarding packets (see Section
  9097.     11.1).
  9098.  
  9099.     The following lists the    modifications needed when running the
  9100.     routing    table calculation for a    non-zero TOS value (called TOS
  9101.     X).  In    general, routers and LSAs that do not support TOS are
  9102.     omitted    from the calculation.
  9103.  
  9104.  
  9105.     Calculating the    shortest-path tree (Section  16.1).
  9106.         Routers that do not    support    TOS-based routing should be
  9107.         omitted from the shortest-path tree    calculation.  These
  9108.         routers are    identified as those having the T-bit reset in
  9109.         the    Options    field of their router-LSAs.  Such routers should
  9110.         never be added to the Dijkstra algorithm's candidate list,
  9111.         nor    should their router-LSAs be examined when adding the
  9112.         stub networks to the tree.    In particular, if the T-bit is
  9113.         reset in the calculating router's own router-LSA, it does
  9114.         not    run the    shortest-path tree calculation for non-zero TOS
  9115.         values.
  9116.  
  9117.     Calculating the    inter-area routes (Section  16.2).
  9118.         Inter-area paths are the concatenation of a    path to    an area
  9119.         border router with a summary link.    When calculating TOS X
  9120.         routes, both path components must also specify TOS X.  In
  9121.         other words, only TOS X paths to the area border router are
  9122.         examined, and the area border router must be advertising a
  9123.         TOS    X route    to the destination.  Note that this means that
  9124.         summary-LSAs having    the T-bit reset    in their Options field
  9125.  
  9126.  
  9127.  
  9128. Moy                                  [Page 163]
  9129.  
  9130. Internet Draft             OSPF Version 2           February 1997
  9131.  
  9132.  
  9133.         are    not considered.
  9134.  
  9135.     Examining transit areas' summary-LSAs (Section 16.3).
  9136.         This calculation again considers the concatenation of a path
  9137.         to an area border router with a summary link.  As with
  9138.         inter-area routes, only TOS    X paths    to the area border
  9139.         router are examined, and the area border router must be
  9140.         advertising    a TOS X    route to the destination.
  9141.  
  9142.     Calculating AS external    routes (Section    16.4).
  9143.         This calculation considers the concatenation of a path to a
  9144.         forwarding address with an AS external link.  Only TOS X
  9145.         paths to the forwarding address are    examined, and the AS
  9146.         boundary router must be advertising    a TOS X    route to the
  9147.         destination.  Note that this means that AS-external-LSAs
  9148.         having the T-bit reset in their Options field are not
  9149.         considered.
  9150.  
  9151.         In addition, the advertising AS boundary router must also be
  9152.         reachable for its LSAs to be considered (see Section 16.4).
  9153.         However, if    the advertising    router and the forwarding
  9154.         address are    not one    in the same, the advertising router need
  9155.         only be reachable via TOS 0.
  9156.  
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166.  
  9167.  
  9168.  
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.  
  9182.  
  9183.  
  9184. Moy                                  [Page 164]
  9185.  
  9186. Internet Draft             OSPF Version 2           February 1997
  9187.  
  9188.  
  9189. Footnotes
  9190.  
  9191.  
  9192.     [1]The graph's vertices represent either routers, transit networks,
  9193.     or stub networks.  Since routers may belong    to multiple areas, it is
  9194.     not    possible to color the graph's vertices.
  9195.  
  9196.     [2]It is possible for all of a router's interfaces to be unnumbered
  9197.     point-to-point links.  In this case, an IP address must be assigned
  9198.     to the router.  This address will then be advertised in the    router's
  9199.     router-LSA as a host route.
  9200.  
  9201.     [3]Note that in these cases    both interfaces, the non-virtual and the
  9202.     virtual, would have    the same IP address.
  9203.  
  9204.     [4]Note that no host route is generated for, and no    IP packets can
  9205.     be addressed to, interfaces    to unnumbered point-to-point networks.
  9206.     This is regardless of such an interface's state.
  9207.  
  9208.     [5]It is instructive to see    what happens when the Designated Router
  9209.     for    the network crashes.  Call the Designated Router for the network
  9210.     RT1, and the Backup    Designated Router RT2.    If Router RT1 crashes
  9211.     (or    maybe its interface to the network dies), the other routers on
  9212.     the    network    will detect RT1's absence within RouterDeadInterval
  9213.     seconds.  All routers may not detect this at precisely the same
  9214.     time; the routers that detect RT1's    absence    before RT2 does    will,
  9215.     for    a time,    select RT2 to be both Designated Router    and Backup
  9216.     Designated Router.    When RT2 detects that RT1 is gone it will move
  9217.     itself to Designated Router.  At this time,    the remaining router
  9218.     having highest Router Priority will    be selected as Backup Designated
  9219.     Router.
  9220.  
  9221.     [6]On point-to-point networks, the lower level protocols indicate
  9222.     whether the    neighbor is up and running.  Likewise, existence of the
  9223.     neighbor on    virtual    links is indicated by the routing table
  9224.     calculation.  However, in both these cases,    the Hello Protocol is
  9225.     still used.     This ensures that communication between the neighbors
  9226.     is bidirectional, and that each of the neighbors has a functioning
  9227.     routing protocol layer.
  9228.  
  9229.     [7]When the    identity of the    Designated Router is changing, it may be
  9230.     quite common for a neighbor    in this    state to send the router a
  9231.     Database Description packet; this means that there is some momentary
  9232.     disagreement on the    Designated Router's identity.
  9233.  
  9234.     [8]Note that it is possible    for a router to    resynchronize any of its
  9235.     fully established adjacencies by setting the adjacency's state back
  9236.     to ExStart.     This will cause the other end of the adjacency    to
  9237.  
  9238.  
  9239.  
  9240. Moy                                  [Page 165]
  9241.  
  9242. Internet Draft             OSPF Version 2           February 1997
  9243.  
  9244.  
  9245.     process a SeqNumberMismatch    event, and therefore to    also go    back to
  9246.     ExStart state.
  9247.  
  9248.     [9]The address space of IP networks    and the    address    space of OSPF
  9249.     Router IDs may overlap.  That is, a    network    may have an IP address
  9250.     which is identical (when considered    as a 32-bit number) to some
  9251.     router's Router ID.
  9252.  
  9253.     [10]"Discard" entries are necessary    to ensure that route
  9254.     summarization at area boundaries will not cause packet looping.
  9255.  
  9256.     [11]It is assumed that, for    two different address ranges matching
  9257.     the    destination, one range is more specific    than the other.    Non-
  9258.     contiguous subnet masks can    be configured to violate this
  9259.     assumption.    Such subnet mask configurations    cannot be handled by the
  9260.     OSPF protocol.
  9261.  
  9262.     [12]MaxAgeDiff is an architectural constant.  It indicates the
  9263.     maximum dispersion of ages,    in seconds, that can occur for a single
  9264.     LSA    instance as it is flooded throughout the routing domain.  If two
  9265.     LSAs differ    by more    than this, they    are assumed to be different
  9266.     instances of the same LSA.    This can occur when a router restarts
  9267.     and    loses track of the LSA's previous LS sequence number.  See
  9268.     Section 13.4 for more details.
  9269.  
  9270.     [13]When two LSAs have different LS    checksums, they    are assumed to
  9271.     be separate    instances.  This can occur when    a router restarts, and
  9272.     loses track    of the LSA's previous LS sequence number.  In the case
  9273.     where the two LSAs have the    same LS    sequence number, it is not
  9274.     possible to    determine which    LSA is actually    newer.    However, if the
  9275.     wrong LSA is accepted as newer, the    originating router will    simply
  9276.     originate another instance.     See Section 13.4 for further details.
  9277.  
  9278.     [14]There is one instance where a lookup must be done based    on
  9279.     partial information.  This is during the routing table calculation,
  9280.     when a network-LSA must be found based solely on its Link State ID.
  9281.     The    lookup in this case is still well defined, since no two
  9282.     network-LSAs can have the same Link    State ID.
  9283.  
  9284.     [15]This is    the way    RFC 1583 specified point-to-point
  9285.     representation.  It    has three advantages: a) it does not require
  9286.     allocating a subnet    to the point-to-point link, b) it tends    to bias
  9287.     the    routing    so that    packets    destined for the point-to-point
  9288.     interface will actually be received    over the interface (which is
  9289.     useful for diagnostic purposes) and    c) it allows network
  9290.     bootstrapping of a neighbor, without requiring that    the bootstrap
  9291.     program contain an OSPF implementation.
  9292.  
  9293.  
  9294.  
  9295.  
  9296. Moy                                  [Page 166]
  9297.  
  9298. Internet Draft             OSPF Version 2           February 1997
  9299.  
  9300.  
  9301.     [16]This is    the more traditional point-to-point representation used
  9302.     by protocols such as RIP.
  9303.  
  9304.     [17]This clause covers the case: Inter-area    routes are not
  9305.     summarized to the backbone.     This is because inter-area routes are
  9306.     always associated with the backbone    area.
  9307.  
  9308.     [18]This clause is only invoked when a non-backbone    Area A supports
  9309.     transit data traffic (i.e.,    has TransitCapability set to TRUE).  For
  9310.     example, in    the area configuration of Figure 6, Area 2 can support
  9311.     transit traffic due    to the configured virtual link between Routers
  9312.     RT10 and RT11. As a    result,    Router RT11 need only originate    a single
  9313.     summary-LSA    into Area 2 (having the    collapsed destination N9-
  9314.     N11,H1), since all of Router RT11's    other eligible routes have next
  9315.     hops belonging to Area 2 itself (and as such only need be advertised
  9316.     by other area border routers; in this case,    Routers    RT10 and RT7).
  9317.  
  9318.     [19]By keeping more    information in the routing table, it is    possible
  9319.     for    an implementation to recalculate the shortest path tree    for only
  9320.     a single area.  In fact, there are incremental algorithms that allow
  9321.     an implementation to recalculate only a portion of a single    area's
  9322.     shortest path tree [Ref1].    However, these algorithms are beyond the
  9323.     scope of this specification.
  9324.  
  9325.     [20]This is    how the    Link state request list    is emptied, which
  9326.     eventually causes the neighbor state to transition to Full.     See
  9327.     Section 10.9 for more details.
  9328.  
  9329.     [21]It should be a relatively rare occurrence for an LSA's LS age to
  9330.     reach MaxAge in this fashion.  Usually, the    LSA will be replaced by
  9331.     a more recent instance before it ages out.
  9332.  
  9333.     [22]Only the TOS 0 routes are important here because all OSPF
  9334.     protocol packets are sent with TOS = 0.  See Appendix A.
  9335.  
  9336.     [23]It may be the case that    paths to certain destinations do not
  9337.     vary based on TOS.    For these destinations,    the routing calculation
  9338.     need not be    repeated for each TOS value.  In addition, there need
  9339.     only be a single routing table entry for these destinations    (instead
  9340.     of a separate entry    for each TOS value).
  9341.  
  9342.     [24]Strictly speaking, because of equal-cost multipath, the
  9343.     algorithm does not create a    tree.  We continue to use the "tree"
  9344.     terminology    because    that is    what occurs most often in the existing
  9345.     literature.
  9346.  
  9347.     [25]Note that the presence of any link back    to V is    sufficient; it
  9348.     need not be    the matching half of the link under consideration from V
  9349.  
  9350.  
  9351.  
  9352. Moy                                  [Page 167]
  9353.  
  9354. Internet Draft             OSPF Version 2           February 1997
  9355.  
  9356.  
  9357.     to W. This is enough to ensure that, before    data traffic flows
  9358.     between a pair of neighboring routers, their link state databases
  9359.     will be synchronized.
  9360.  
  9361.     [26]When the forwarding address is non-zero, it should point to a
  9362.     router belonging to    another    Autonomous System.  See    Section    12.4.4
  9363.     for    more details.
  9364.  
  9365.  
  9366.  
  9367.  
  9368.  
  9369.  
  9370.  
  9371.  
  9372.  
  9373.  
  9374.  
  9375.  
  9376.  
  9377.  
  9378.  
  9379.  
  9380.  
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.  
  9404.  
  9405.  
  9406.  
  9407.  
  9408. Moy                                  [Page 168]
  9409.  
  9410. Internet Draft             OSPF Version 2           February 1997
  9411.  
  9412.  
  9413. References
  9414.  
  9415.     [Ref1]  McQuillan, J., I. Richer and E. Rosen, "ARPANET Routing
  9416.         Algorithm Improvements", BBN Technical Report 3803,    April
  9417.         1978.
  9418.  
  9419.     [Ref2]  Digital Equipment Corporation, "Information    processing
  9420.         systems -- Data communications -- Intermediate System to
  9421.         Intermediate System    Intra-Domain Routing Protocol",    October
  9422.         1987.
  9423.  
  9424.     [Ref3]  McQuillan, J. et.al., "The New Routing Algorithm for the
  9425.         ARPANET", IEEE Transactions    on Communications, May 1980.
  9426.  
  9427.     [Ref4]  Perlman, R., "Fault-Tolerant Broadcast of Routing
  9428.         Information", Computer Networks, December 1983.
  9429.  
  9430.     [Ref5]  Postel, J.,    "Internet Protocol", STD 5, RFC    791,
  9431.         USC/Information Sciences Institute,    September 1981.
  9432.  
  9433.     [Ref6]  McKenzie, A., "ISO Transport Protocol specification    ISO DP
  9434.         8073", RFC 905, ISO, April 1984.
  9435.  
  9436.     [Ref7]  Deering, S., "Host extensions for IP multicasting",    STD 5,
  9437.         RFC    1112, Stanford University, May 1988.
  9438.  
  9439.     [Ref8]  McCloghrie,    K., and    M. Rose, "Management Information Base
  9440.         for    network    management of TCP/IP-based internets: MIB-II",
  9441.         STD    17, RFC    1213, Hughes LAN Systems, Performance Systems
  9442.         International, March 1991.
  9443.  
  9444.     [Ref9]  Moy, J., "OSPF Version 2", RFC 1583, Proteon, Inc.,    March
  9445.         1994.
  9446.  
  9447.     [Ref10] Fuller, V.,    T. Li, J. Yu, and K. Varadhan, "Classless
  9448.         Inter-Domain Routing (CIDR): an Address Assignment and
  9449.         Aggregation    Strategy", RFC1519, BARRNet, cisco, MERIT,
  9450.         OARnet, September 1993.
  9451.  
  9452.     [Ref11] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC
  9453.         1700, USC/Information Sciences Institute, October 1994.
  9454.  
  9455.     [Ref12] Almquist, P., "Type    of Service in the Internet Protocol
  9456.         Suite", RFC    1349, July 1992.
  9457.  
  9458.     [Ref13] Leiner, B.,    et.al.,    "The DARPA Internet Protocol Suite", DDN
  9459.         Protocol Handbook, April 1985.
  9460.  
  9461.  
  9462.  
  9463.  
  9464. Moy                                  [Page 169]
  9465.  
  9466. Internet Draft             OSPF Version 2           February 1997
  9467.  
  9468.  
  9469.     [Ref14] Bradley, T., and C.    Brown, "Inverse    Address    Resolution
  9470.         Protocol", RFC 1293, January 1992.
  9471.  
  9472.     [Ref15] deSouza, O., and M.    Rodrigues, "Guidelines for Running OSPF
  9473.         Over Frame Relay Networks",    RFC 1586, March    1994.
  9474.  
  9475.     [Ref16] Bellovin, S., "Security Problems in    the TCP/IP Protocol
  9476.         Suite", ACM    Computer Communications    Review,    Volume 19,
  9477.         Number 2, pp. 32-38, April 1989.
  9478.  
  9479.     [Ref17] Rivest, R.,    "The MD5 Message-Digest    Algorithm", RFC    1321,
  9480.         April 1992.
  9481.  
  9482.     [Ref18] Moy, J., "Multicast    Extensions to OSPF", RFC 1584, Proteon,
  9483.         Inc., March    1994.
  9484.  
  9485.     [Ref19] Coltun, R. and V. Fuller, "The OSPF    NSSA Option", RFC 1587,
  9486.         RainbowBridge Communications, Stanford University, March
  9487.         1994.
  9488.  
  9489.     [Ref20] Ferguson, D., "The OSPF External Attributes    LSA", work in
  9490.         progress.
  9491.  
  9492.     [Ref21] Moy, J., "Extending    OSPF to    Support    Demand Circuits", RFC
  9493.         1793, Cascade, April 1995.
  9494.  
  9495.     [Ref22] Mogul, J. and S. Deering, "Path MTU    Discovery", RFC    1191,
  9496.         DECWRL, Stanford University, November 1990.
  9497.  
  9498.     [Ref23] Rekhter, Y.    and T. Li, "A Border Gateway Protocol 4    (BGP-
  9499.         4)", RFC 1771, T.J.    Watson Research    Center,    IBM Corp., cisco
  9500.         Systems, March 1995.
  9501.  
  9502.  
  9503.  
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.  
  9512.  
  9513.  
  9514.  
  9515.  
  9516.  
  9517.  
  9518.  
  9519.  
  9520. Moy                                  [Page 170]
  9521.  
  9522. Internet Draft             OSPF Version 2           February 1997
  9523.  
  9524.  
  9525. A. OSPF    data formats
  9526.  
  9527.     This appendix describes the    format of OSPF protocol    packets    and OSPF
  9528.     LSAs.  The OSPF protocol runs directly over    the IP network layer.
  9529.     Before any data formats are    described, the details of the OSPF
  9530.     encapsulation are explained.
  9531.  
  9532.     Next the OSPF Options field    is described.  This field describes
  9533.     various capabilities that may or may not be    supported by pieces of
  9534.     the    OSPF routing domain. The OSPF Options field is contained in OSPF
  9535.     Hello packets, Database Description    packets    and in OSPF LSAs.
  9536.  
  9537.     OSPF packet    formats    are detailed in    Section    A.3.  A    description of
  9538.     OSPF LSAs appears in Section A.4.
  9539.  
  9540. A.1 Encapsulation of OSPF packets
  9541.  
  9542.     OSPF runs directly over the    Internet Protocol's network layer.  OSPF
  9543.     packets are    therefore encapsulated solely by IP and    local data-link
  9544.     headers.
  9545.  
  9546.     OSPF does not define a way to fragment its protocol    packets, and
  9547.     depends on IP fragmentation    when transmitting packets larger than
  9548.     the    network    MTU. If    necessary, the length of OSPF packets can be up
  9549.     to 65,535 bytes (including the IP header).    The OSPF packet    types
  9550.     that are likely to be large    (Database Description Packets, Link
  9551.     State Request, Link    State Update, and Link State Acknowledgment
  9552.     packets) can usually be split into several separate    protocol
  9553.     packets, without loss of functionality.  This is recommended; IP
  9554.     fragmentation should be avoided whenever possible.    Using this
  9555.     reasoning, an attempt should be made to limit the sizes of OSPF
  9556.     packets sent over virtual links to 576 bytes unless    Path MTU
  9557.     Discovery is being performed (see [Ref22]).
  9558.  
  9559.     The    other important    features of OSPF's IP encapsulation are:
  9560.  
  9561.     o    Use of IP multicast.  Some OSPF    messages are multicast,    when
  9562.     sent over broadcast networks.  Two distinct IP multicast
  9563.     addresses are used.  Packets sent to these multicast addresses
  9564.     should never be    forwarded; they    are meant to travel a single hop
  9565.     only.  To ensure that these packets will not travel multiple
  9566.     hops, their IP TTL must    be set to 1.
  9567.  
  9568.     AllSPFRouters
  9569.         This multicast address has been assigned the value
  9570.         224.0.0.5.    All routers running OSPF should    be prepared to
  9571.         receive packets sent to this address.  Hello packets are
  9572.         always sent    to this    destination.  Also, certain OSPF
  9573.  
  9574.  
  9575.  
  9576. Moy                                  [Page 171]
  9577.  
  9578. Internet Draft             OSPF Version 2           February 1997
  9579.  
  9580.  
  9581.         protocol packets are sent to this address during the
  9582.         flooding procedure.
  9583.  
  9584.     AllDRouters
  9585.         This multicast address has been assigned the value
  9586.         224.0.0.6.    Both the Designated Router and Backup Designated
  9587.         Router must    be prepared to receive packets destined    to this
  9588.         address.  Certain OSPF protocol packets are    sent to    this
  9589.         address during the flooding    procedure.
  9590.  
  9591.     o    OSPF is    IP protocol number 89.    This number has    been registered
  9592.     with the Network Information Center.  IP protocol number
  9593.     assignments are    documented in [Ref11].
  9594.  
  9595.     o    Routing    protocol packets are sent with IP TOS of 0.  The OSPF
  9596.     protocol supports TOS-based routing.  Routes to    any particular
  9597.     destination may    vary based on TOS.  However, all OSPF routing
  9598.     protocol packets are sent using    the normal service TOS value of
  9599.     binary 0000 defined in [Ref12].
  9600.  
  9601.     o    Routing    protocol packets are sent with IP precedence set to
  9602.     Internetwork Control.  OSPF protocol packets should be given
  9603.     precedence over    regular    IP data    traffic, in both sending and
  9604.     receiving.  Setting the    IP precedence field in the IP header to
  9605.     Internetwork Control [Ref5] may    help implement this objective.
  9606.  
  9607.  
  9608.  
  9609.  
  9610.  
  9611.  
  9612.  
  9613.  
  9614.  
  9615.  
  9616.  
  9617.  
  9618.  
  9619.  
  9620.  
  9621.  
  9622.  
  9623.  
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632. Moy                                  [Page 172]
  9633.  
  9634. Internet Draft             OSPF Version 2           February 1997
  9635.  
  9636.  
  9637. A.2 The    Options    field
  9638.  
  9639.     The    OSPF Options field is present in OSPF Hello packets, Database
  9640.     Description    packets    and all    LSAs.  The Options field enables OSPF
  9641.     routers to support (or not support)    optional capabilities, and to
  9642.     communicate    their capability level to other    OSPF routers.  Through
  9643.     this mechanism routers of differing    capabilities can be mixed within
  9644.     an OSPF routing domain.
  9645.  
  9646.     When used in Hello packets,    the Options field allows a router to
  9647.     reject a neighbor because of a capability mismatch.     Alternatively,
  9648.     when capabilities are exchanged in Database    Description packets a
  9649.     router can choose not to forward certain LSAs to a neighbor    because
  9650.     of its reduced functionality.  Lastly, listing capabilities    in LSAs
  9651.     allows routers to forward traffic around reduced functionality
  9652.     routers, by    excluding them from parts of the routing table
  9653.     calculation.
  9654.  
  9655.     Six    bits of    the OSPF Options field have been assigned, although only
  9656.     two    (the T-bit and E-bit) are described completely by this memo.
  9657.     Each bit is    described briefly below. Routers should    reset (i.e.
  9658.     clear) unrecognized    bits in    the Options field when sending Hello
  9659.     packets or Database    Description packets and    when originating LSAs.
  9660.     Conversely,    routers    encountering unrecognized Option bits in
  9661.     received Hello Packets, Database Description packets or LSAs should
  9662.     ignore the capability and process the packet/LSA normally.
  9663.  
  9664.                +------------------------------------+
  9665.                | * | * | DC | EA | N/P | MC | E    | T |
  9666.                +------------------------------------+
  9667.  
  9668.                  The Options field
  9669.  
  9670.  
  9671.     T-bit
  9672.     This bit describes the router's    TOS-based routing capability, as
  9673.     specified in Sections 9.5, 10.8, 12.1.2    and 16.9 of this memo.
  9674.  
  9675.     E-bit
  9676.     This bit describes the way AS-external-LSAs are    flooded, as
  9677.     described in Sections 3.6, 9.5,    10.8 and 12.1.2    of this    memo.
  9678.  
  9679.     MC-bit
  9680.     This bit describes whether IP multicast    datagrams are forwarded
  9681.     according to the specifications    in [Ref18].
  9682.  
  9683.     N/P-bit
  9684.     This bit describes the handling    of Type-7 LSAs,    as specified in
  9685.  
  9686.  
  9687.  
  9688. Moy                                  [Page 173]
  9689.  
  9690. Internet Draft             OSPF Version 2           February 1997
  9691.  
  9692.  
  9693.     [Ref19].
  9694.  
  9695.     EA-bit
  9696.     This bit describes the router's    willingness to receive and
  9697.     forward    External-Attributes-LSAs, as specified in [Ref20].
  9698.  
  9699.     DC-bit
  9700.     This bit describes the router's    handling of demand circuits, as
  9701.     specified in [Ref21].
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.  
  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           February 1997
  9747.  
  9748.  
  9749. A.3 OSPF Packet    Formats
  9750.  
  9751.     There are five distinct OSPF packet    types.    All OSPF packet    types
  9752.     begin with a standard 24 byte header.  This    header is described
  9753.     first.  Each packet    type is    then described in a succeeding section.
  9754.     In these sections each packet's division into fields is displayed,
  9755.     and    then the field definitions are enumerated.
  9756.  
  9757.     All    OSPF packet types (other than the OSPF Hello packets) deal with
  9758.     lists of LSAs.  For    example, Link State Update packets implement the
  9759.     flooding of    LSAs throughout    the OSPF routing domain.  Because of
  9760.     this, OSPF protocol    packets    cannot be parsed unless    the format of
  9761.     LSAs is also understood.  The format of LSAs is described in Section
  9762.     A.4.
  9763.  
  9764.     The    receive    processing of OSPF packets is detailed in Section 8.2.
  9765.     The    sending    of OSPF    packets    is explained in    Section    8.1.
  9766.  
  9767.  
  9768.  
  9769.  
  9770.  
  9771.  
  9772.  
  9773.  
  9774.  
  9775.  
  9776.  
  9777.  
  9778.  
  9779.  
  9780.  
  9781.  
  9782.  
  9783.  
  9784.  
  9785.  
  9786.  
  9787.  
  9788.  
  9789.  
  9790.  
  9791.  
  9792.  
  9793.  
  9794.  
  9795.  
  9796.  
  9797.  
  9798.  
  9799.  
  9800. Moy                                  [Page 175]
  9801.  
  9802. Internet Draft             OSPF Version 2           February 1997
  9803.  
  9804.  
  9805. A.3.1 The OSPF packet header
  9806.  
  9807.     Every OSPF packet starts with a standard 24    byte header.  This
  9808.     header contains all    the information    necessary to determine whether
  9809.     the    packet should be accepted for further processing.  This
  9810.     determination is described in Section 8.2 of the specification.
  9811.  
  9812.  
  9813.     0            1            2            3
  9814.     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
  9815.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9816.        |   Version #   |     Type      |     Packet    length           |
  9817.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9818.        |              Router ID                   |
  9819.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9820.        |               Area    ID                   |
  9821.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9822.        |       Checksum           |         AuType           |
  9823.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9824.        |               Authentication                   |
  9825.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9826.        |               Authentication                   |
  9827.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9828.  
  9829.  
  9830.  
  9831.     Version #
  9832.     The OSPF version number.  This specification documents version 2
  9833.     of the protocol.
  9834.  
  9835.     Type
  9836.     The OSPF packet    types are as follows. See Sections A.3.2 through
  9837.     A.3.6 for details.
  9838.  
  9839.  
  9840.  
  9841.               Type     Description
  9842.               ________________________________
  9843.               1     Hello
  9844.               2     Database Description
  9845.               3     Link State Request
  9846.               4     Link State Update
  9847.               5     Link State Acknowledgment
  9848.  
  9849.  
  9850.  
  9851.  
  9852.  
  9853.  
  9854.  
  9855.  
  9856. Moy                                  [Page 176]
  9857.  
  9858. Internet Draft             OSPF Version 2           February 1997
  9859.  
  9860.  
  9861.     Packet length
  9862.     The length of the OSPF protocol    packet in bytes.  This length
  9863.     includes the standard OSPF header.
  9864.  
  9865.     Router ID
  9866.     The Router ID of the packet's source.
  9867.  
  9868.     Area ID
  9869.     A 32 bit number    identifying the    area that this packet belongs
  9870.     to.  All OSPF packets are associated with a single area.  Most
  9871.     travel a single    hop only.  Packets travelling over a virtual
  9872.     link are labelled with the backbone Area ID of 0.0.0.0.
  9873.  
  9874.     Checksum
  9875.     The standard IP    checksum of the    entire contents    of the packet,
  9876.     starting with the OSPF packet header but excluding the 64-bit
  9877.     authentication field.  This checksum is    calculated as the 16-bit
  9878.     one's complement of the    one's complement sum of    all the    16-bit
  9879.     words in the packet, excepting the authentication field.  If the
  9880.     packet's length    is not an integral number of 16-bit words, the
  9881.     packet is padded with a    byte of    zero before checksumming.  The
  9882.     checksum is considered to be part of the packet    authentication
  9883.     procedure; for some authentication types the checksum
  9884.     calculation is omitted.
  9885.  
  9886.     AuType
  9887.     Identifies the authentication procedure    to be used for the
  9888.     packet.     Authentication    is discussed in    Appendix D of the
  9889.     specification.    Consult    Appendix D for a list of the currently
  9890.     defined    authentication types.
  9891.  
  9892.     Authentication
  9893.     A 64-bit field for use by the authentication scheme. See
  9894.     Appendix D for details.
  9895.  
  9896.  
  9897.  
  9898.  
  9899.  
  9900.  
  9901.  
  9902.  
  9903.  
  9904.  
  9905.  
  9906.  
  9907.  
  9908.  
  9909.  
  9910.  
  9911.  
  9912. Moy                                  [Page 177]
  9913.  
  9914. Internet Draft             OSPF Version 2           February 1997
  9915.  
  9916.  
  9917. A.3.2 The Hello    packet
  9918.  
  9919.     Hello packets are OSPF packet type 1.  These packets are sent
  9920.     periodically on all    interfaces (including virtual links) in    order to
  9921.     establish and maintain neighbor relationships.  In addition, Hello
  9922.     Packets are    multicast on those physical networks having a multicast
  9923.     or broadcast capability, enabling dynamic discovery    of neighboring
  9924.     routers.
  9925.  
  9926.     All    routers    connected to a common network must agree on certain
  9927.     parameters (Network    mask, HelloInterval and    RouterDeadInterval).
  9928.     These parameters are included in Hello packets, so that differences
  9929.     can    inhibit    the forming of neighbor    relationships.    A detailed
  9930.     explanation    of the receive processing for Hello packets is presented
  9931.     in Section 10.5.  The sending of Hello packets is covered in Section
  9932.     9.5.
  9933.  
  9934.  
  9935.     0            1            2            3
  9936.     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
  9937.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9938.        |   Version #   |       1       |     Packet    length           |
  9939.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9940.        |              Router ID                   |
  9941.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9942.        |               Area    ID                   |
  9943.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9944.        |       Checksum           |         AuType           |
  9945.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9946.        |               Authentication                   |
  9947.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9948.        |               Authentication                   |
  9949.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9950.        |            Network    Mask                   |
  9951.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9952.        |     HelloInterval           |    Options    |    Rtr    Pri    |
  9953.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9954.        |             RouterDeadInterval                   |
  9955.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9956.        |              Designated Router                   |
  9957.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9958.        |           Backup Designated Router               |
  9959.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9960.        |              Neighbor                   |
  9961.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  9962.        |                  ...                   |
  9963.  
  9964.  
  9965.  
  9966.  
  9967.  
  9968. Moy                                  [Page 178]
  9969.  
  9970. Internet Draft             OSPF Version 2           February 1997
  9971.  
  9972.  
  9973.     Network mask
  9974.     The network mask associated with this interface.  For example,
  9975.     if the interface is to a class B network whose third byte is
  9976.     used for subnetting, the network mask is 0xffffff00.
  9977.  
  9978.     Options
  9979.     The optional capabilities supported by the router, as documented
  9980.     in Section A.2.
  9981.  
  9982.     HelloInterval
  9983.     The number of seconds between this router's Hello packets.
  9984.  
  9985.     Rtr    Pri
  9986.     This router's Router Priority.    Used in    (Backup) Designated
  9987.     Router election.  If set to 0, the router will be ineligible to
  9988.     become (Backup)    Designated Router.
  9989.  
  9990.     RouterDeadInterval
  9991.     The number of seconds before declaring a silent    router down.
  9992.  
  9993.     Designated Router
  9994.     The identity of    the Designated Router for this network,    in the
  9995.     view of    the sending router.  The Designated Router is identified
  9996.     here by    its IP interface address on the    network.  Set to 0.0.0.0
  9997.     if there is no Designated Router.
  9998.  
  9999.     Backup Designated Router
  10000.     The identity of    the Backup Designated Router for this network,
  10001.     in the view of the sending router.  The    Backup Designated Router
  10002.     is identified here by its IP interface address on the network.
  10003.     Set to 0.0.0.0 if there    is no Backup Designated    Router.
  10004.  
  10005.     Neighbor
  10006.     The Router IDs of each router from whom    valid Hello packets have
  10007.     been seen recently on the network.  Recently means in the last
  10008.     RouterDeadInterval seconds.
  10009.  
  10010.  
  10011.  
  10012.  
  10013.  
  10014.  
  10015.  
  10016.  
  10017.  
  10018.  
  10019.  
  10020.  
  10021.  
  10022.  
  10023.  
  10024. Moy                                  [Page 179]
  10025.  
  10026. Internet Draft             OSPF Version 2           February 1997
  10027.  
  10028.  
  10029. A.3.3 The Database Description packet
  10030.  
  10031.     Database Description packets are OSPF packet type 2.  These    packets
  10032.     are    exchanged when an adjacency is being initialized.  They    describe
  10033.     the    contents of the    link-state database.  Multiple packets may be
  10034.     used to describe the database.  For    this purpose a poll-response
  10035.     procedure is used.    One of the routers is designated to be the
  10036.     master, the    other the slave.  The master sends Database Description
  10037.     packets (polls) which are acknowledged by Database Description
  10038.     packets sent by the    slave (responses).  The    responses are linked to
  10039.     the    polls via the packets' DD sequence numbers.
  10040.  
  10041.  
  10042.     0            1            2            3
  10043.     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
  10044.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10045.        |   Version #   |       2       |     Packet    length           |
  10046.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10047.        |              Router ID                   |
  10048.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10049.        |               Area    ID                   |
  10050.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10051.        |       Checksum           |         AuType           |
  10052.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10053.        |               Authentication                   |
  10054.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10055.        |               Authentication                   |
  10056.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10057.        |     Interface MTU           |    Options    |0|0|0|0|0|I|M|MS
  10058.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10059.        |             DD    sequence number                   |
  10060.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10061.        |                                   |
  10062.        +-                                  -+
  10063.        |                                   |
  10064.        +-               An LSA Header                  -+
  10065.        |                                   |
  10066.        +-                                  -+
  10067.        |                                   |
  10068.        +-                                  -+
  10069.        |                                   |
  10070.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10071.        |                  ...                   |
  10072.  
  10073.  
  10074.     The    format of the Database Description packet is very similar to
  10075.     both the Link State    Request    and Link State Acknowledgment packets.
  10076.     The    main part of all three is a list of items, each    item describing
  10077.  
  10078.  
  10079.  
  10080. Moy                                  [Page 180]
  10081.  
  10082. Internet Draft             OSPF Version 2           February 1997
  10083.  
  10084.  
  10085.     a piece of the link-state database.     The sending of    Database
  10086.     Description    Packets    is documented in Section 10.8.    The reception of
  10087.     Database Description packets is documented in Section 10.6.
  10088.  
  10089.     Interface MTU
  10090.     The size in bytes of the largest IP datagram that can be sent
  10091.     out the    associated interface, without fragmentation.  The MTUs
  10092.     of common Internet link    types can be found in Table 7-1    of
  10093.     [Ref22]. Interface MTU should be set to    0 in Database
  10094.     Description packets sent over virtual links.
  10095.  
  10096.     Options
  10097.     The optional capabilities supported by the router, as documented
  10098.     in Section A.2.
  10099.  
  10100.     I-bit
  10101.     The Init bit.  When set    to 1, this packet is the first in the
  10102.     sequence of Database Description Packets.
  10103.  
  10104.     M-bit
  10105.     The More bit.  When set    to 1, it indicates that    more Database
  10106.     Description Packets are    to follow.
  10107.  
  10108.     MS-bit
  10109.     The Master/Slave bit.  When set    to 1, it indicates that    the
  10110.     router is the master during the    Database Exchange process.
  10111.     Otherwise, the router is the slave.
  10112.  
  10113.     DD sequence    number
  10114.     Used to    sequence the collection    of Database Description    Packets.
  10115.     The initial value (indicated by    the Init bit being set)    should
  10116.     be unique.  The    DD sequence number then    increments until the
  10117.     complete database description has been sent.
  10118.  
  10119.  
  10120.     The    rest of    the packet consists of a (possibly partial) list of the
  10121.     link-state database's pieces.  Each    LSA in the database is described
  10122.     by its LSA header.    The LSA    header is documented in    Section    A.4.1.
  10123.     It contains    all the    information required to    uniquely identify both
  10124.     the    LSA and    the LSA's current instance.
  10125.  
  10126.  
  10127.  
  10128.  
  10129.  
  10130.  
  10131.  
  10132.  
  10133.  
  10134.  
  10135.  
  10136. Moy                                  [Page 181]
  10137.  
  10138. Internet Draft             OSPF Version 2           February 1997
  10139.  
  10140.  
  10141. A.3.4 The Link State Request packet
  10142.  
  10143.     Link State Request packets are OSPF    packet type 3.    After exchanging
  10144.     Database Description packets with a    neighboring router, a router may
  10145.     find that parts of its link-state database are out-of-date.     The
  10146.     Link State Request packet is used to request the pieces of the
  10147.     neighbor's database    that are more up-to-date.  Multiple Link State
  10148.     Request packets may    need to    be used.
  10149.  
  10150.     A router that sends    a Link State Request packet has    in mind    the
  10151.     precise instance of    the database pieces it is requesting. Each
  10152.     instance is    defined    by its LS sequence number, LS checksum,    and LS
  10153.     age, although these    fields are not specified in the    Link State
  10154.     Request Packet itself.  The    router may receive even    more recent
  10155.     instances in response.
  10156.  
  10157.     The    sending    of Link    State Request packets is documented in Section
  10158.     10.9.  The reception of Link State Request packets is documented in
  10159.     Section 10.7.
  10160.  
  10161.  
  10162.     0            1            2            3
  10163.     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
  10164.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10165.        |   Version #   |       3       |     Packet    length           |
  10166.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10167.        |              Router ID                   |
  10168.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10169.        |               Area    ID                   |
  10170.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10171.        |       Checksum           |         AuType           |
  10172.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10173.        |               Authentication                   |
  10174.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10175.        |               Authentication                   |
  10176.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10177.        |              LS type                   |
  10178.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10179.        |               Link State ID                   |
  10180.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10181.        |             Advertising Router                   |
  10182.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10183.        |                  ...                   |
  10184.  
  10185.  
  10186.     Each LSA requested is specified by its LS type, Link State ID, and
  10187.     Advertising    Router.     This uniquely identifies the LSA, but not its
  10188.     instance.  Link State Request packets are understood to be requests
  10189.  
  10190.  
  10191.  
  10192. Moy                                  [Page 182]
  10193.  
  10194. Internet Draft             OSPF Version 2           February 1997
  10195.  
  10196.  
  10197.     for    the most recent    instance (whatever that    might be).
  10198.  
  10199.  
  10200.  
  10201.  
  10202.  
  10203.  
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.  
  10210.  
  10211.  
  10212.  
  10213.  
  10214.  
  10215.  
  10216.  
  10217.  
  10218.  
  10219.  
  10220.  
  10221.  
  10222.  
  10223.  
  10224.  
  10225.  
  10226.  
  10227.  
  10228.  
  10229.  
  10230.  
  10231.  
  10232.  
  10233.  
  10234.  
  10235.  
  10236.  
  10237.  
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.  
  10244.  
  10245.  
  10246.  
  10247.  
  10248. Moy                                  [Page 183]
  10249.  
  10250. Internet Draft             OSPF Version 2           February 1997
  10251.  
  10252.  
  10253. A.3.5 The Link State Update packet
  10254.  
  10255.     Link State Update packets are OSPF packet type 4.  These packets
  10256.     implement the flooding of LSAs.  Each Link State Update packet
  10257.     carries a collection of LSAs one hop further from their origin.
  10258.     Several LSAs may be    included in a single packet.
  10259.  
  10260.     Link State Update packets are multicast on those physical networks
  10261.     that support multicast/broadcast.  In order    to make    the flooding
  10262.     procedure reliable,    flooded    LSAs are acknowledged in Link State
  10263.     Acknowledgment packets.  If    retransmission of certain LSAs is
  10264.     necessary, the retransmitted LSAs are always carried by unicast Link
  10265.     State Update packets.  For more information    on the reliable    flooding
  10266.     of LSAs, consult Section 13.
  10267.  
  10268.  
  10269.     0            1            2            3
  10270.     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
  10271.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10272.        |   Version #   |       4       |     Packet    length           |
  10273.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10274.        |              Router ID                   |
  10275.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10276.        |               Area    ID                   |
  10277.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10278.        |       Checksum           |         AuType           |
  10279.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10280.        |               Authentication                   |
  10281.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10282.        |               Authentication                   |
  10283.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10284.        |                # LSAs                   |
  10285.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10286.        |                                   |
  10287.        +-                                 +-+
  10288.        |                 LSAs                   |
  10289.        +-                                 +-+
  10290.        |                  ...                   |
  10291.  
  10292.  
  10293.  
  10294.     # LSAs
  10295.     The number of LSAs included in this update.
  10296.  
  10297.  
  10298.     The    body of    the Link State Update packet consists of a list    of LSAs.
  10299.     Each LSA begins with a common 20 byte header, described in Section
  10300.     A.4.1. Detailed formats of the different types of LSAs are described
  10301.  
  10302.  
  10303.  
  10304. Moy                                  [Page 184]
  10305.  
  10306. Internet Draft             OSPF Version 2           February 1997
  10307.  
  10308.  
  10309.     in Section A.4.
  10310.  
  10311.  
  10312.  
  10313.  
  10314.  
  10315.  
  10316.  
  10317.  
  10318.  
  10319.  
  10320.  
  10321.  
  10322.  
  10323.  
  10324.  
  10325.  
  10326.  
  10327.  
  10328.  
  10329.  
  10330.  
  10331.  
  10332.  
  10333.  
  10334.  
  10335.  
  10336.  
  10337.  
  10338.  
  10339.  
  10340.  
  10341.  
  10342.  
  10343.  
  10344.  
  10345.  
  10346.  
  10347.  
  10348.  
  10349.  
  10350.  
  10351.  
  10352.  
  10353.  
  10354.  
  10355.  
  10356.  
  10357.  
  10358.  
  10359.  
  10360. Moy                                  [Page 185]
  10361.  
  10362. Internet Draft             OSPF Version 2           February 1997
  10363.  
  10364.  
  10365. A.3.6 The Link State Acknowledgment packet
  10366.  
  10367.     Link State Acknowledgment Packets are OSPF packet type 5.  To make
  10368.     the    flooding of LSAs reliable, flooded LSAs    are explicitly
  10369.     acknowledged.  This    acknowledgment is accomplished through the
  10370.     sending and    receiving of Link State    Acknowledgment packets.
  10371.     Multiple LSAs can be acknowledged in a single Link State
  10372.     Acknowledgment packet.
  10373.  
  10374.     Depending on the state of the sending interface and    the sender of
  10375.     the    corresponding Link State Update    packet,    a Link State
  10376.     Acknowledgment packet is sent either to the    multicast address
  10377.     AllSPFRouters, to the multicast address AllDRouters, or as a
  10378.     unicast.  The sending of Link State    Acknowledgement    packets    is
  10379.     documented in Section 13.5.     The reception of Link State
  10380.     Acknowledgement packets is documented in Section 13.7.
  10381.  
  10382.     The    format of this packet is similar to that of the    Data Description
  10383.     packet.  The body of both packets is simply    a list of LSA headers.
  10384.  
  10385.  
  10386.     0            1            2            3
  10387.     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
  10388.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10389.        |   Version #   |       5       |     Packet    length           |
  10390.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10391.        |              Router ID                   |
  10392.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10393.        |               Area    ID                   |
  10394.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10395.        |       Checksum           |         AuType           |
  10396.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10397.        |               Authentication                   |
  10398.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10399.        |               Authentication                   |
  10400.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10401.        |                                   |
  10402.        +-                                  -+
  10403.        |                                   |
  10404.        +-              An LSA Header                  -+
  10405.        |                                   |
  10406.        +-                                  -+
  10407.        |                                   |
  10408.        +-                                  -+
  10409.        |                                   |
  10410.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10411.        |                  ...                   |
  10412.  
  10413.  
  10414.  
  10415.  
  10416. Moy                                  [Page 186]
  10417.  
  10418. Internet Draft             OSPF Version 2           February 1997
  10419.  
  10420.  
  10421.     Each acknowledged LSA is described by its LSA header.  The LSA
  10422.     header is documented in Section A.4.1.  It contains    all the
  10423.     information    required to uniquely identify both the LSA and the LSA's
  10424.     current instance.
  10425.  
  10426.  
  10427.  
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436.  
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445.  
  10446.  
  10447.  
  10448.  
  10449.  
  10450.  
  10451.  
  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           February 1997
  10475.  
  10476.  
  10477. A.4 LSA    formats
  10478.  
  10479.     This memo defines five distinct types of LSAs.  Each LSA begins with
  10480.     a standard 20 byte LSA header.  This header    is explained in    Section
  10481.     A.4.1.  Succeeding sections    then diagram the separate LSA types.
  10482.  
  10483.     Each LSA describes a piece of the OSPF routing domain.  Every router
  10484.     originates a router-LSA.  In addition, whenever the    router is
  10485.     elected Designated Router, it originates a network-LSA.  Other types
  10486.     of LSAs may    also be    originated (see    Section    12.4).    All LSAs are
  10487.     then flooded throughout the    OSPF routing domain.  The flooding
  10488.     algorithm is reliable, ensuring that all routers have the same
  10489.     collection of LSAs.     (See Section 13 for more information concerning
  10490.     the    flooding algorithm).  This collection of LSAs is called    the
  10491.     link-state database.
  10492.  
  10493.     From the link state    database, each router constructs a shortest path
  10494.     tree with itself as    root.  This yields a routing table (see    Section
  10495.     11).  For the details of the routing table build process, see
  10496.     Section 16.
  10497.  
  10498.  
  10499.  
  10500.  
  10501.  
  10502.  
  10503.  
  10504.  
  10505.  
  10506.  
  10507.  
  10508.  
  10509.  
  10510.  
  10511.  
  10512.  
  10513.  
  10514.  
  10515.  
  10516.  
  10517.  
  10518.  
  10519.  
  10520.  
  10521.  
  10522.  
  10523.  
  10524.  
  10525.  
  10526.  
  10527.  
  10528. Moy                                  [Page 188]
  10529.  
  10530. Internet Draft             OSPF Version 2           February 1997
  10531.  
  10532.  
  10533. A.4.1 The LSA header
  10534.  
  10535.     All    LSAs begin with    a common 20 byte header.  This header contains
  10536.     enough information to uniquely identify the    LSA (LS    type, Link State
  10537.     ID,    and Advertising    Router).  Multiple instances of    the LSA    may
  10538.     exist in the routing domain    at the same time.  It is then necessary
  10539.     to determine which instance    is more    recent.     This is accomplished by
  10540.     examining the LS age, LS sequence number and LS checksum fields that
  10541.     are    also contained in the LSA header.
  10542.  
  10543.  
  10544.     0            1            2            3
  10545.     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
  10546.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10547.        |        LS age           |    Options    |    LS type    |
  10548.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10549.        |            Link State ID                   |
  10550.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10551.        |             Advertising Router                   |
  10552.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10553.        |             LS    sequence number                   |
  10554.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10555.        |     LS checksum           |         length           |
  10556.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10557.  
  10558.  
  10559.  
  10560.     LS age
  10561.     The time in seconds since the LSA was originated.
  10562.  
  10563.     Options
  10564.     The optional capabilities supported by the described portion of
  10565.     the routing domain.  OSPF's optional capabilities are documented
  10566.     in Section A.2.
  10567.  
  10568.     LS type
  10569.     The type of the    LSA.  Each LSA type has    a separate advertisement
  10570.     format.     The LSA types defined in this memo are    as follows (see
  10571.     Section    12.1.3 for further explanation):
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584. Moy                                  [Page 189]
  10585.  
  10586. Internet Draft             OSPF Version 2           February 1997
  10587.  
  10588.  
  10589.  
  10590.             LS Type      Description
  10591.             ___________________________________
  10592.             1      Router-LSAs
  10593.             2      Network-LSAs
  10594.             3      Summary-LSAs (IP network)
  10595.             4      Summary-LSAs (ASBR)
  10596.             5      AS-external-LSAs
  10597.  
  10598.  
  10599.  
  10600.  
  10601.     Link State ID
  10602.     This field identifies the portion of the internet environment
  10603.     that is    being described    by the LSA.  The contents of this field
  10604.     depend on the LSA's LS type.  For example, in network-LSAs the
  10605.     Link State ID is set to    the IP interface address of the
  10606.     network's Designated Router (from which    the network's IP address
  10607.     can be derived).  The Link State ID is further discussed in
  10608.     Section    12.1.4.
  10609.  
  10610.     Advertising    Router
  10611.     The Router ID of the router that originated the    LSA.  For
  10612.     example, in network-LSAs this field is equal to    the Router ID of
  10613.     the network's Designated Router.
  10614.  
  10615.     LS sequence    number
  10616.     Detects    old or duplicate LSAs.    Successive instances of    an LSA
  10617.     are given successive LS    sequence numbers.  See Section 12.1.6
  10618.     for more details.
  10619.  
  10620.     LS checksum
  10621.     The Fletcher checksum of the complete contents of the LSA,
  10622.     including the LSA header but excluding the LS age field. See
  10623.     Section    12.1.7 for more    details.
  10624.  
  10625.     length
  10626.     The length in bytes of the LSA.     This includes the 20 byte LSA
  10627.     header.
  10628.  
  10629.  
  10630.  
  10631.  
  10632.  
  10633.  
  10634.  
  10635.  
  10636.  
  10637.  
  10638.  
  10639.  
  10640. Moy                                  [Page 190]
  10641.  
  10642. Internet Draft             OSPF Version 2           February 1997
  10643.  
  10644.  
  10645. A.4.2 Router-LSAs
  10646.  
  10647.     Router-LSAs    are the    Type 1 LSAs.  Each router in an    area originates
  10648.     a router-LSA.  The LSA describes the state and cost    of the router's
  10649.     links (i.e., interfaces) to    the area.  All of the router's links to
  10650.     the    area must be described in a single router-LSA.    For details
  10651.     concerning the construction    of router-LSAs,    see Section 12.4.1.
  10652.  
  10653.  
  10654.     0            1            2            3
  10655.     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
  10656.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10657.        |        LS age           |     Options   |       1       |
  10658.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10659.        |            Link State ID                   |
  10660.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10661.        |             Advertising Router                   |
  10662.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10663.        |             LS    sequence number                   |
  10664.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10665.        |     LS checksum           |         length           |
  10666.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10667.        |    0     |V|E|B|    0      |        # links           |
  10668.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10669.        |              Link ID                   |
  10670.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10671.        |             Link Data                   |
  10672.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10673.        |     Type      |     # TOS     |    TOS 0 metric           |
  10674.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10675.        |      TOS      |    0      |        metric           |
  10676.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10677.        |                  ...                   |
  10678.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10679.        |      TOS      |    0      |        metric           |
  10680.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10681.        |              Link ID                   |
  10682.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10683.        |             Link Data                   |
  10684.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10685.        |                  ...                   |
  10686.  
  10687.  
  10688.     In router-LSAs, the    Link State ID field is set to the router's OSPF
  10689.     Router ID.    The T-bit is set in the    LSA's Option field if and only
  10690.     if the router is able to calculate a separate set of routes    for each
  10691.     IP TOS.  Router-LSAs are flooded throughout    a single area only.
  10692.  
  10693.  
  10694.  
  10695.  
  10696. Moy                                  [Page 191]
  10697.  
  10698. Internet Draft             OSPF Version 2           February 1997
  10699.  
  10700.  
  10701.     bit    V
  10702.     When set, the router is    an endpoint of one or more fully
  10703.     adjacent virtual links having the described area as Transit area
  10704.     (V is for virtual link endpoint).
  10705.  
  10706.     bit    E
  10707.     When set, the router is    an AS boundary router (E is for
  10708.     external).
  10709.  
  10710.     bit    B
  10711.     When set, the router is    an area    border router (B is for    border).
  10712.  
  10713.     # links
  10714.     The number of router links described in    this LSA.  This    must be
  10715.     the total collection of    router links (i.e., interfaces)    to the
  10716.     area.
  10717.  
  10718.  
  10719.     The    following fields are used to describe each router link (i.e.,
  10720.     interface).    Each router link is typed (see the below Type field).
  10721.     The    Type field indicates the kind of link being described.    It may
  10722.     be a link to a transit network, to another router or to a stub
  10723.     network.  The values of all    the other fields describing a router
  10724.     link depend    on the link's Type.  For example, each link has    an
  10725.     associated 32-bit Link Data    field.    For links to stub networks this
  10726.     field specifies the    network's IP address mask.  For    other link types
  10727.     the    Link Data field    specifies the router interface's IP address.
  10728.  
  10729.  
  10730.     Type
  10731.     A quick    description of the router link.     One of    the following.
  10732.     Note that host routes are classified as    links to stub networks
  10733.     with network mask of 0xffffffff.
  10734.  
  10735.  
  10736.  
  10737.          Type    Description
  10738.          __________________________________________________
  10739.          1    Point-to-point connection to another router
  10740.          2    Connection to a    transit    network
  10741.          3    Connection to a    stub network
  10742.          4    Virtual    link
  10743.  
  10744.  
  10745.  
  10746.  
  10747.     Link ID
  10748.     Identifies the object that this    router link connects to.  Value
  10749.  
  10750.  
  10751.  
  10752. Moy                                  [Page 192]
  10753.  
  10754. Internet Draft             OSPF Version 2           February 1997
  10755.  
  10756.  
  10757.     depends    on the link's Type.  When connecting to    an object that
  10758.     also originates    an LSA (i.e., another router or    a transit
  10759.     network) the Link ID is    equal to the neighboring LSA's Link
  10760.     State ID.  This    provides the key for looking up    the neighboring
  10761.     LSA in the link    state database during the routing table
  10762.     calculation. See Section 12.2 for more details.
  10763.  
  10764.  
  10765.  
  10766.                Type   Link ID
  10767.                ______________________________________
  10768.                1      Neighboring router's Router ID
  10769.                2      IP address of Designated Router
  10770.                3      IP network/subnet    number
  10771.                4      Neighboring router's Router ID
  10772.  
  10773.  
  10774.  
  10775.  
  10776.     Link Data
  10777.     Value again depends on the link's Type field. For connections to
  10778.     stub networks, Link Data specifies the network's IP address
  10779.     mask. For unnumbered point-to-point connections, it specifies
  10780.     the interface's    MIB-II [Ref8] ifIndex value. For the other link
  10781.     types it specifies the router interface's IP address. This
  10782.     latter piece of    information is needed during the routing table
  10783.     build process, when calculating    the IP address of the next hop.
  10784.     See Section 16.1.1 for more details.
  10785.  
  10786.     # TOS
  10787.     The number of different    TOS metrics given for this link, not
  10788.     counting the required metric for TOS 0.     For example, if no
  10789.     additional TOS metrics are given, this field is    set to 0.
  10790.  
  10791.     TOS    0 metric
  10792.     The cost of using this router link for TOS 0.
  10793.  
  10794.  
  10795.     For    each link, separate metrics may    be specified for each Type of
  10796.     Service (TOS).  The    metric for TOS 0 must always be    included, and
  10797.     was    discussed above.  Metrics for non-zero TOS are described below.
  10798.     The    encoding of TOS    in OSPF    LSAs is    described in Section 12.3.  Note
  10799.     that the cost for non-zero TOS values that are not specified
  10800.     defaults to    the TOS    0 cost.     Metrics must be listed    in order of
  10801.     increasing TOS encoding.  For example, the metric for TOS 16 must
  10802.     always follow the metric for TOS 8 when both are specified.
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808. Moy                                  [Page 193]
  10809.  
  10810. Internet Draft             OSPF Version 2           February 1997
  10811.  
  10812.  
  10813.     TOS    IP Type    of Service that    this metric refers to.    The encoding of
  10814.     TOS in OSPF LSAs is described in Section 12.3.
  10815.  
  10816.     metric
  10817.     The cost of using this outbound    router link, for traffic of the
  10818.     specified TOS.
  10819.  
  10820.  
  10821.  
  10822.  
  10823.  
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.  
  10831.  
  10832.  
  10833.  
  10834.  
  10835.  
  10836.  
  10837.  
  10838.  
  10839.  
  10840.  
  10841.  
  10842.  
  10843.  
  10844.  
  10845.  
  10846.  
  10847.  
  10848.  
  10849.  
  10850.  
  10851.  
  10852.  
  10853.  
  10854.  
  10855.  
  10856.  
  10857.  
  10858.  
  10859.  
  10860.  
  10861.  
  10862.  
  10863.  
  10864. Moy                                  [Page 194]
  10865.  
  10866. Internet Draft             OSPF Version 2           February 1997
  10867.  
  10868.  
  10869. A.4.3 Network-LSAs
  10870.  
  10871.     Network-LSAs are the Type 2    LSAs.  A network-LSA is    originated for
  10872.     each broadcast and NBMA network in the area    which supports two or
  10873.     more routers.  The network-LSA is originated by the    network's
  10874.     Designated Router.    The LSA    describes all routers attached to the
  10875.     network, including the Designated Router itself.  The LSA's    Link
  10876.     State ID field lists the IP    interface address of the Designated
  10877.     Router.
  10878.  
  10879.     The    distance from the network to all attached routers is zero, for
  10880.     all    Types of Service.  This    is why the TOS and metric fields need
  10881.     not    be specified in    the network-LSA.  For details concerning the
  10882.     construction of network-LSAs, see Section 12.4.2.
  10883.  
  10884.  
  10885.     0            1            2            3
  10886.     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
  10887.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10888.        |        LS age           |      Options  |      2           |
  10889.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10890.        |            Link State ID                   |
  10891.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10892.        |             Advertising Router                   |
  10893.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10894.        |             LS    sequence number                   |
  10895.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10896.        |     LS checksum           |         length           |
  10897.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10898.        |             Network Mask                   |
  10899.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10900.        |            Attached Router                   |
  10901.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10902.        |                  ...                   |
  10903.  
  10904.  
  10905.  
  10906.     Network Mask
  10907.     The IP address mask for    the network.  For example, a class A
  10908.     network    would have the mask 0xff000000.
  10909.  
  10910.     Attached Router
  10911.     The Router IDs of each of the routers attached to the network.
  10912.     Actually, only those routers that are fully adjacent to    the
  10913.     Designated Router are listed.  The Designated Router includes
  10914.     itself in this list.  The number of routers included can be
  10915.     deduced    from the LSA header's length field.
  10916.  
  10917.  
  10918.  
  10919.  
  10920. Moy                                  [Page 195]
  10921.  
  10922. Internet Draft             OSPF Version 2           February 1997
  10923.  
  10924.  
  10925. A.4.4 Summary-LSAs
  10926.  
  10927.     Summary-LSAs are the Type 3    and 4 LSAs.  These LSAs    are originated
  10928.     by area border routers. Summary-LSAs describe inter-area
  10929.     destinations.  For details concerning the construction of summary-
  10930.     LSAs, see Section 12.4.3.
  10931.  
  10932.     Type 3 summary-LSAs    are used when the destination is an IP network.
  10933.     In this case the LSA's Link    State ID field is an IP    network    number
  10934.     (if    necessary, the Link State ID can also have one or more of the
  10935.     network's "host" bits set; see Appendix E for details). When the
  10936.     destination    is an AS boundary router, a Type 4 summary-LSA is used,
  10937.     and    the Link State ID field    is the AS boundary router's OSPF Router
  10938.     ID.     (To see why it    is necessary to    advertise the location of each
  10939.     ASBR, consult Section 16.4.)  Other    than the difference in the Link
  10940.     State ID field, the    format of Type 3 and 4 summary-LSAs is
  10941.     identical.
  10942.  
  10943.  
  10944.     0            1            2            3
  10945.     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
  10946.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10947.        |        LS age           |     Options   |    3 or 4     |
  10948.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10949.        |            Link State ID                   |
  10950.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10951.        |             Advertising Router                   |
  10952.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10953.        |             LS    sequence number                   |
  10954.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10955.        |     LS checksum           |         length           |
  10956.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10957.        |             Network Mask                   |
  10958.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10959.        |     TOS       |          metric               |
  10960.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  10961.        |                  ...                   |
  10962.  
  10963.  
  10964.     For    stub areas, Type 3 summary-LSAs    can also be used to describe a
  10965.     (per-area) default route.  Default summary routes are used in stub
  10966.     areas instead of flooding a    complete set of    external routes.  When
  10967.     describing a default summary route,    the summary-LSA's Link State ID
  10968.     is always set to DefaultDestination    (0.0.0.0) and the Network Mask
  10969.     is set to 0.0.0.0.
  10970.  
  10971.     Separate costs may be advertised for each IP Type of Service.  The
  10972.     encoding of    TOS in OSPF LSAs is described in Section 12.3.    Note
  10973.  
  10974.  
  10975.  
  10976. Moy                                  [Page 196]
  10977.  
  10978. Internet Draft             OSPF Version 2           February 1997
  10979.  
  10980.  
  10981.     that the cost for TOS 0 must be included, and is always listed
  10982.     first.  If the T-bit is reset in the LSA's Option field, only a
  10983.     route for TOS 0 is described by the    LSA.  Otherwise, routes    for the
  10984.     other TOS values are also described; if a cost for a certain TOS is
  10985.     not    included, its cost defaults to that specified for TOS 0.
  10986.  
  10987.     Network Mask
  10988.     For Type 3 summary-LSAs, this indicates    the destination
  10989.     network's IP address mask.  For    example, when advertising the
  10990.     location of a class A network the value    0xff000000 would be
  10991.     used.  This field is not meaningful and    must be    zero for Type 4
  10992.     summary-LSAs.
  10993.  
  10994.  
  10995.     For    each specified Type of Service,    the following fields are
  10996.     defined.  The number of TOS    routes included    can be calculated from
  10997.     the    LSA header's length field.  A value for    TOS 0 must be specified;
  10998.     it is listed first.     Other values must be listed in    order of
  10999.     increasing TOS encoding.  For example, the cost for    TOS 16 must
  11000.     always follow the cost for TOS 8 when both are specified.
  11001.  
  11002.  
  11003.     TOS    The Type of Service that the following cost concerns.  The
  11004.     encoding of TOS    in OSPF    LSAs is    described in Section 12.3.
  11005.  
  11006.     metric
  11007.     The cost of this route.     Expressed in the same units as    the
  11008.     interface costs    in the router-LSAs.
  11009.  
  11010.  
  11011.  
  11012.  
  11013.  
  11014.  
  11015.  
  11016.  
  11017.  
  11018.  
  11019.  
  11020.  
  11021.  
  11022.  
  11023.  
  11024.  
  11025.  
  11026.  
  11027.  
  11028.  
  11029.  
  11030.  
  11031.  
  11032. Moy                                  [Page 197]
  11033.  
  11034. Internet Draft             OSPF Version 2           February 1997
  11035.  
  11036.  
  11037. A.4.5 AS-external-LSAs
  11038.  
  11039.     AS-external-LSAs are the Type 5 LSAs.  These LSAs are originated by
  11040.     AS boundary    routers, and describe destinations external to the AS.
  11041.     For    details    concerning the construction of AS-external-LSAs, see
  11042.     Section 12.4.3.
  11043.  
  11044.     AS-external-LSAs usually describe a    particular external destination.
  11045.     For    these LSAs the Link State ID field specifies an    IP network
  11046.     number (if necessary, the Link State ID can    also have one or more of
  11047.     the    network's "host" bits set; see Appendix    E for details).     AS-
  11048.     external-LSAs are also used    to describe a default route.  Default
  11049.     routes are used when no specific route exists to the destination.
  11050.     When describing a default route, the Link State ID is always set to
  11051.     DefaultDestination (0.0.0.0) and the Network Mask is set to    0.0.0.0.
  11052.  
  11053.  
  11054.     0            1            2            3
  11055.     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
  11056.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11057.        |        LS age           |     Options   |      5           |
  11058.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11059.        |            Link State ID                   |
  11060.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11061.        |             Advertising Router                   |
  11062.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11063.        |             LS    sequence number                   |
  11064.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11065.        |     LS checksum           |         length           |
  11066.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11067.        |             Network Mask                   |
  11068.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11069.        |E|    TOS      |          metric               |
  11070.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11071.        |              Forwarding address               |
  11072.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11073.        |              External Route Tag               |
  11074.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11075.        |                  ...                   |
  11076.  
  11077.  
  11078.  
  11079.     Separate costs may be advertised for each IP Type of Service.  The
  11080.     encoding of    TOS in OSPF LSAs is described in Section 12.3.    Note
  11081.     that the cost for TOS 0 must be included, and is always listed
  11082.     first.  If the T-bit is reset in the LSA's Option field, only a
  11083.     route for TOS 0 is described by the    LSA.  Otherwise, routes    for the
  11084.     other TOS values are also described; if a cost for a certain TOS is
  11085.  
  11086.  
  11087.  
  11088. Moy                                  [Page 198]
  11089.  
  11090. Internet Draft             OSPF Version 2           February 1997
  11091.  
  11092.  
  11093.     not    included, its cost defaults to that specified for TOS 0.
  11094.  
  11095.     Network Mask
  11096.     The IP address mask for    the advertised destination.  For
  11097.     example, when advertising a class A network the    mask 0xff000000
  11098.     would be used.
  11099.  
  11100.  
  11101.     For    each specified Type of Service,    the following fields are
  11102.     defined.  The number of TOS    routes included    can be calculated from
  11103.     the    LSA header's length field.  A value for    TOS 0 must be specified;
  11104.     it is listed first.     Other values must be listed in    order of
  11105.     increasing TOS encoding.  For example, the cost for    TOS 16 must
  11106.     always follow the cost for TOS 8 when both are specified.
  11107.  
  11108.  
  11109.     TOS    The Type of Service that the following fields concern.    The
  11110.     encoding of TOS    in OSPF    LSAs is    described in Section 12.3.
  11111.  
  11112.     bit    E
  11113.     The type of external metric.  If bit E is set, the metric
  11114.     specified is a Type 2 external metric.    This means the metric is
  11115.     considered larger than any link    state path.  If    bit E is zero,
  11116.     the specified metric is    a Type 1 external metric.  This    means
  11117.     that it    is expressed in    the same units as the link state metric
  11118.     (i.e., the same    units as interface cost).
  11119.  
  11120.     metric
  11121.     The cost of this route.     Interpretation    depends    on the external
  11122.     type indication    (bit E above).
  11123.  
  11124.     Forwarding address
  11125.     Data traffic for the advertised    destination and    TOS will be
  11126.     forwarded to this address.  If the Forwarding address is set to
  11127.     0.0.0.0, data traffic will be forwarded    instead    to the LSA's
  11128.     originator (i.e., the responsible AS boundary router).
  11129.  
  11130.     External Route Tag
  11131.     A 32-bit field attached    to each    external route.     This is not
  11132.     used by    the OSPF protocol itself.  It may be used to communicate
  11133.     information between AS boundary    routers; the precise nature of
  11134.     such information is outside the    scope of this specification.
  11135.  
  11136.  
  11137.  
  11138.  
  11139.  
  11140.  
  11141.  
  11142.  
  11143.  
  11144. Moy                                  [Page 199]
  11145.  
  11146. Internet Draft             OSPF Version 2           February 1997
  11147.  
  11148.  
  11149. B. Architectural Constants
  11150.  
  11151.     Several OSPF protocol parameters have fixed    architectural values.
  11152.     These parameters have been referred    to in the text by names    such as
  11153.     LSRefreshTime.  The    same naming convention is used for the
  11154.     configurable protocol parameters.  They are    defined    in Appendix C.
  11155.  
  11156.     The    name of    each architectural constant follows, together with its
  11157.     value and a    short description of its function.
  11158.  
  11159.  
  11160.     LSRefreshTime
  11161.     The maximum time between distinct originations of any particular
  11162.     LSA.  If the LS    age field of one of the    router's self-originated
  11163.     LSAs reaches the value LSRefreshTime, a    new instance of    the LSA
  11164.     is originated, even though the contents    of the LSA (apart from
  11165.     the LSA    header)    will be    the same.  The value of    LSRefreshTime is
  11166.     set to 30 minutes.
  11167.  
  11168.     MinLSInterval
  11169.     The minimum time between distinct originations of any particular
  11170.     LSA.  The value    of MinLSInterval is set    to 5 seconds.
  11171.  
  11172.     MinLSArrival
  11173.     For any    particular LSA,    the minimum time that must elapse
  11174.     between    reception of new LSA instances during flooding.    LSA
  11175.     instances received at higher frequencies are discarded.    The
  11176.     value of MinLSArrival is set to    1 second.
  11177.  
  11178.     MaxAge
  11179.     The maximum age    that an    LSA can    attain.    When an    LSA's LS age
  11180.     field reaches MaxAge, it is reflooded in an attempt to flush the
  11181.     LSA from the routing domain (See Section 14). LSAs of age MaxAge
  11182.     are not    used in    the routing table calculation.    The value of
  11183.     MaxAge is set to 1 hour.
  11184.  
  11185.     CheckAge
  11186.     When the age of    an LSA in the link state database hits a
  11187.     multiple of CheckAge, the LSA's    checksum is verified.  An
  11188.     incorrect checksum at this time    indicates a serious error.  The
  11189.     value of CheckAge is set to 5 minutes.
  11190.  
  11191.     MaxAgeDiff
  11192.     The maximum time dispersion that can occur, as an LSA is flooded
  11193.     throughout the AS.  Most of this time is accounted for by the
  11194.     LSAs sitting on    router output queues (and therefore not    aging)
  11195.     during the flooding process.  The value    of MaxAgeDiff is set to
  11196.     15 minutes.
  11197.  
  11198.  
  11199.  
  11200. Moy                                  [Page 200]
  11201.  
  11202. Internet Draft             OSPF Version 2           February 1997
  11203.  
  11204.  
  11205.     LSInfinity
  11206.     The metric value indicating that the destination described by an
  11207.     LSA is unreachable. Used in summary-LSAs and AS-external-LSAs as
  11208.     an alternative to premature aging (see Section 14.1). It is
  11209.     defined    to be the 24-bit binary    value of all ones: 0xffffff.
  11210.  
  11211.     DefaultDestination
  11212.     The Destination    ID that    indicates the default route.  This route
  11213.     is used    when no    other matching routing table entry can be found.
  11214.     The default destination    can only be advertised in AS-external-
  11215.     LSAs and in stub areas'    type 3 summary-LSAs.  Its value    is the
  11216.     IP address 0.0.0.0. Its    associated Network Mask    is also    always
  11217.     0.0.0.0.
  11218.  
  11219.     InitialSequenceNumber
  11220.     The value used for LS Sequence Number when originating the first
  11221.     instance of any    LSA. Its value is the signed 32-bit integer
  11222.     0x80000001.
  11223.  
  11224.     MaxSequenceNumber
  11225.     The maximum value that LS Sequence Number can attain.  Its value
  11226.     is the signed 32-bit integer 0x7fffffff.
  11227.  
  11228.  
  11229.  
  11230.  
  11231.  
  11232.  
  11233.  
  11234.  
  11235.  
  11236.  
  11237.  
  11238.  
  11239.  
  11240.  
  11241.  
  11242.  
  11243.  
  11244.  
  11245.  
  11246.  
  11247.  
  11248.  
  11249.  
  11250.  
  11251.  
  11252.  
  11253.  
  11254.  
  11255.  
  11256. Moy                                  [Page 201]
  11257.  
  11258. Internet Draft             OSPF Version 2           February 1997
  11259.  
  11260.  
  11261. C. Configurable    Constants
  11262.  
  11263.     The    OSPF protocol has quite    a few configurable parameters.    These
  11264.     parameters are listed below.  They are grouped into    general
  11265.     functional categories (area    parameters, interface parameters, etc.).
  11266.     Sample values are given for    some of    the parameters.
  11267.  
  11268.     Some parameter settings need to be consistent among    groups of
  11269.     routers.  For example, all routers in an area must agree on    that
  11270.     area's parameters, and all routers attached    to a network must agree
  11271.     on that network's IP network number    and mask.
  11272.  
  11273.     Some parameters may    be determined by router    algorithms outside of
  11274.     this specification (e.g., the address of a host connected to the
  11275.     router via a SLIP line).  From OSPF's point    of view, these items are
  11276.     still configurable.
  11277.  
  11278.     C.1    Global parameters
  11279.  
  11280.     In general, a separate copy of the OSPF    protocol is run    for each
  11281.     area.  Because of this,    most configuration parameters are
  11282.     defined    on a per-area basis.  The few global configuration
  11283.     parameters are listed below.
  11284.  
  11285.  
  11286.     Router ID
  11287.         This is a 32-bit number that uniquely identifies the router
  11288.         in the Autonomous System.  One algorithm for Router    ID
  11289.         assignment is to choose the    largest    or smallest IP address
  11290.         assigned to    the router.  If    a router's OSPF    Router ID is
  11291.         changed, the router's OSPF software    should be restarted
  11292.         before the new Router ID takes effect. Before restarting in
  11293.         order to change its    Router ID, the router should flush its
  11294.         self-originated LSAs from the routing domain (see Section
  11295.         14.1), or they will    persist    for up to MaxAge minutes.
  11296.  
  11297.     TOS capability
  11298.         This item indicates    whether    the router will    calculate
  11299.         separate routes based on TOS.  For more information, see
  11300.         Sections 4.5 and 16.9.
  11301.  
  11302.     RFC1583Compatibility
  11303.         Controls the preference rules used in Section 16.4 when
  11304.         choosing among multiple AS-external-LSAs advertising the
  11305.         same destination. When set to "enabled", the preference
  11306.         rules remain those specified by RFC    1583 ([Ref9]). When set
  11307.         to "disabled", the preference rules    are those stated in
  11308.         Section 16.4.1, which prevent routing loops    when AS-
  11309.  
  11310.  
  11311.  
  11312. Moy                                  [Page 202]
  11313.  
  11314. Internet Draft             OSPF Version 2           February 1997
  11315.  
  11316.  
  11317.         external-LSAs for the same destination have    been originated
  11318.         from different areas (see Section G.7). Set    to "enabled" by
  11319.         default.
  11320.  
  11321.         In order to    minimize the chance of routing loops, all OSPF
  11322.         routers in an OSPF routing domain should have
  11323.         RFC1583Compatibility set identically. When there are routers
  11324.         present that have not been updated with the    functionality
  11325.         specified in Section 16.4.1    of this    memo, all routers should
  11326.         have RFC1583Compatibility set to "enabled".    Otherwise, all
  11327.         routers should have    RFC1583Compatibility set to "disabled",
  11328.         preventing all routing loops.
  11329.  
  11330.     C.2    Area parameters
  11331.  
  11332.     All routers belonging to an area must agree on that area's
  11333.     configuration.    Disagreements between two routers will lead to
  11334.     an inability for adjacencies to    form between them, with    a
  11335.     resulting hindrance to the flow    of routing protocol and    data
  11336.     traffic.  The following    items must be configured for an    area:
  11337.  
  11338.  
  11339.     Area ID
  11340.         This is a 32-bit number that identifies the    area.  The Area
  11341.         ID of 0.0.0.0 is reserved for the backbone.     If the    area
  11342.         represents a subnetted network, the    IP network number of the
  11343.         subnetted network may be used for the Area ID.
  11344.  
  11345.     List of    address    ranges
  11346.         An OSPF area is defined as a list of address ranges. Each
  11347.         address range consists of the following items:
  11348.  
  11349.         [IP    address, mask]
  11350.             Describes the collection of    IP addresses contained
  11351.             in the address range. Networks and hosts are
  11352.             assigned to    an area    depending on whether their
  11353.             addresses fall into    one of the area's defining
  11354.             address ranges.  Routers are viewed    as belonging to
  11355.             multiple areas, depending on their attached
  11356.             networks' area membership.
  11357.  
  11358.         Status  Set    to either Advertise or DoNotAdvertise.    Routing
  11359.             information    is condensed at    area boundaries.
  11360.             External to    the area, at most a single route is
  11361.             advertised (via a summary-LSA) for each address
  11362.             range. The route is    advertised if and only if the
  11363.             address range's Status is set to Advertise.
  11364.             Unadvertised ranges    allow the existence of certain
  11365.  
  11366.  
  11367.  
  11368. Moy                                  [Page 203]
  11369.  
  11370. Internet Draft             OSPF Version 2           February 1997
  11371.  
  11372.  
  11373.             networks to    be intentionally hidden    from other
  11374.             areas. Status is set to Advertise by default.
  11375.  
  11376.         As an example, suppose an IP subnetted network is to be its
  11377.         own    OSPF area.  The    area would be configured as a single
  11378.         address range, whose IP address is the address of the
  11379.         subnetted network, and whose mask is the natural class A, B,
  11380.         or C address mask.    A single route would be    advertised
  11381.         external to    the area, describing the entire    subnetted
  11382.         network.
  11383.  
  11384.     ExternalRoutingCapability
  11385.         Whether AS-external-LSAs will be flooded into/throughout the
  11386.         area.  If AS-external-LSAs are excluded from the area, the
  11387.         area is called a "stub".  Internal to stub areas, routing to
  11388.         external destinations will be based    solely on a default
  11389.         summary route.  The    backbone cannot    be configured as a stub
  11390.         area.  Also, virtual links cannot be configured through stub
  11391.         areas.  For    more information, see Section 3.6.
  11392.  
  11393.     StubDefaultCost
  11394.         If the area    has been configured as a stub area, and    the
  11395.         router itself is an    area border router, then the
  11396.         StubDefaultCost indicates the cost of the default summary-
  11397.         LSA    that the router    should advertise into the area.     There
  11398.         can    be a separate cost configured for each IP TOS.    See
  11399.         Section 12.4.3 for more information.
  11400.  
  11401.     C.3    Router interface parameters
  11402.  
  11403.     Some of    the configurable router    interface parameters (such as IP
  11404.     interface address and subnet mask) actually imply properties of
  11405.     the attached networks, and therefore must be consistent    across
  11406.     all the    routers    attached to that network.  The parameters that
  11407.     must be    configured for a router    interface are:
  11408.  
  11409.  
  11410.     IP interface address
  11411.         The    IP protocol address for    this interface.     This uniquely
  11412.         identifies the router over the entire internet.  An    IP
  11413.         address is not required on point-to-point networks.     Such a
  11414.         point-to-point network is called "unnumbered".
  11415.  
  11416.     IP interface mask
  11417.         Also referred to as    the subnet/network mask, this indicates
  11418.         the    portion    of the IP interface address that identifies the
  11419.         attached network.  Masking the IP interface    address    with the
  11420.         IP interface mask yields the IP network number of the
  11421.  
  11422.  
  11423.  
  11424. Moy                                  [Page 204]
  11425.  
  11426. Internet Draft             OSPF Version 2           February 1997
  11427.  
  11428.  
  11429.         attached network.  On point-to-point networks and virtual
  11430.         links, the IP interface mask is not    defined. On these
  11431.         networks, the link itself is not assigned an IP network
  11432.         number, and    so the addresses of each side of the link are
  11433.         assigned independently, if they are    assigned at all.
  11434.  
  11435.     Area ID
  11436.         The    OSPF area to which the attached    network    belongs.
  11437.  
  11438.     Interface output cost(s)
  11439.         The    cost of    sending    a packet on the    interface, expressed in
  11440.         the    link state metric.  This is advertised as the link cost
  11441.         for    this interface in the router's router-LSA.  There may be
  11442.         a separate cost for    each IP    Type of    Service.  The interface
  11443.         output cost(s) must    always be greater than 0.
  11444.  
  11445.     RxmtInterval
  11446.         The    number of seconds between LSA retransmissions, for
  11447.         adjacencies    belonging to this interface.  Also used    when
  11448.         retransmitting Database Description    and Link State Request
  11449.         Packets.  This should be well over the expected round-trip
  11450.         delay between any two routers on the attached network.  The
  11451.         setting of this value should be conservative or needless
  11452.         retransmissions will result.  Sample value for a local area
  11453.         network: 5 seconds.
  11454.  
  11455.     InfTransDelay
  11456.         The    estimated number of seconds it takes to    transmit a Link
  11457.         State Update Packet    over this interface.  LSAs contained in
  11458.         the    update packet must have    their age incremented by this
  11459.         amount before transmission.     This value should take    into
  11460.         account the    transmission and propagation delays of the
  11461.         interface.    It must    be greater than    0.  Sample value for a
  11462.         local area network:    1 second.
  11463.  
  11464.     Router Priority
  11465.         An 8-bit unsigned integer.    When two routers attached to a
  11466.         network both attempt to become Designated Router, the one
  11467.         with the highest Router Priority takes precedence.    If there
  11468.         is still a tie, the    router with the    highest    Router ID takes
  11469.         precedence.     A router whose    Router Priority    is set to 0 is
  11470.         ineligible to become Designated Router on the attached
  11471.         network.  Router Priority is only configured for interfaces
  11472.         to broadcast and NBMA networks.
  11473.  
  11474.     HelloInterval
  11475.         The    length of time,    in seconds, between the    Hello Packets
  11476.         that the router sends on the interface.  This value    is
  11477.  
  11478.  
  11479.  
  11480. Moy                                  [Page 205]
  11481.  
  11482. Internet Draft             OSPF Version 2           February 1997
  11483.  
  11484.  
  11485.         advertised in the router's Hello Packets.  It must be the
  11486.         same for all routers attached to a common network.    The
  11487.         smaller the    HelloInterval, the faster topological changes
  11488.         will be detected; however, more OSPF routing protocol
  11489.         traffic will ensue.     Sample    value for a X.25 PDN network: 30
  11490.         seconds.  Sample value for a local area network: 10    seconds.
  11491.  
  11492.     RouterDeadInterval
  11493.         After ceasing to hear a router's Hello Packets, the    number
  11494.         of seconds before its neighbors declare the    router down.
  11495.         This is also advertised in the router's Hello Packets in
  11496.         their RouterDeadInterval field.  This should be some
  11497.         multiple of    the HelloInterval (say 4).  This value again
  11498.         must be the    same for all routers attached to a common
  11499.         network.
  11500.  
  11501.     AuType
  11502.         Identifies the authentication procedure to be used on the
  11503.         attached network.  This value must be the same for all
  11504.         routers attached to    the network.  See Appendix D for a
  11505.         discussion of the defined authentication types.
  11506.  
  11507.     Authentication key
  11508.         This configured data allows    the authentication procedure to
  11509.         verify OSPF    protocol packets received over the interface.
  11510.         For    example, if the    AuType indicates simple    password, the
  11511.         Authentication key would be    a clear    64-bit password.
  11512.         Authentication keys    associated with    the other OSPF
  11513.         authentication types are discussed in Appendix D.
  11514.  
  11515.     C.4    Virtual    link parameters
  11516.  
  11517.     Virtual    links are used to restore/increase connectivity    of the
  11518.     backbone.  Virtual links may be    configured between any pair of
  11519.     area border routers having interfaces to a common (non-backbone)
  11520.     area.  The virtual link    appears    as an unnumbered point-to-point
  11521.     link in    the graph for the backbone.  The virtual link must be
  11522.     configured in both of the area border routers.
  11523.  
  11524.     A virtual link appears in router-LSAs (for the backbone) as if
  11525.     it were    a separate router interface to the backbone.  As such,
  11526.     it has all of the parameters associated    with a router interface
  11527.     (see Section C.3).  Although a virtual link acts like an
  11528.     unnumbered point-to-point link,    it does    have an    associated IP
  11529.     interface address.  This address is used as the    IP source in
  11530.     OSPF protocol packets it sends along the virtual link, and is
  11531.     set dynamically    during the routing table build process.
  11532.     Interface output cost is also set dynamically on virtual links
  11533.  
  11534.  
  11535.  
  11536. Moy                                  [Page 206]
  11537.  
  11538. Internet Draft             OSPF Version 2           February 1997
  11539.  
  11540.  
  11541.     to be the cost of the intra-area path between the two routers.
  11542.     The parameter RxmtInterval must    be configured, and should be
  11543.     well over the expected round-trip delay    between    the two    routers.
  11544.     This may be hard to estimate for a virtual link; it is better to
  11545.     err on the side    of making it too large.     Router    Priority is not
  11546.     used on    virtual    links.
  11547.  
  11548.     A virtual link is defined by the following two configurable
  11549.     parameters: the    Router ID of the virtual link's    other endpoint,
  11550.     and the    (non-backbone) area through which the virtual link runs
  11551.     (referred to as    the virtual link's Transit area).  Virtual links
  11552.     cannot be configured through stub areas.
  11553.  
  11554.     C.5    NBMA network parameters
  11555.  
  11556.     OSPF treats an NBMA network much like it treats    a broadcast
  11557.     network.  Since    there may be many routers attached to the
  11558.     network, a Designated Router is    selected for the network.  This
  11559.     Designated Router then originates a network-LSA, which lists all
  11560.     routers    attached to the    NBMA network.
  11561.  
  11562.     However, due to    the lack of broadcast capabilities, it may be
  11563.     necessary to use configuration parameters in the Designated
  11564.     Router selection.  These parameters will only need to be
  11565.     configured in those routers that are themselves    eligible to
  11566.     become Designated Router (i.e.,    those router's whose Router
  11567.     Priority for the network is non-zero), and then    only if    no
  11568.     automatic procedure for    discovering neighbors exists:
  11569.  
  11570.  
  11571.     List of    all other attached routers
  11572.         The    list of    all other routers attached to the NBMA network.
  11573.         Each router    is listed by its IP interface address on the
  11574.         network.  Also, for    each router listed, that router's
  11575.         eligibility    to become Designated Router must be defined.
  11576.         When an interface to a NBMA    network    comes up, the router
  11577.         sends Hello    Packets    only to    those neighbors    eligible to
  11578.         become Designated Router, until the    identity of the
  11579.         Designated Router is discovered.
  11580.  
  11581.     PollInterval
  11582.         If a neighboring router has    become inactive    (Hello Packets
  11583.         have not been seen for RouterDeadInterval seconds),    it may
  11584.         still be necessary to send Hello Packets to    the dead
  11585.         neighbor.  These Hello Packets will    be sent    at the reduced
  11586.         rate PollInterval, which should be much larger than
  11587.         HelloInterval.  Sample value for a PDN X.25    network: 2
  11588.         minutes.
  11589.  
  11590.  
  11591.  
  11592. Moy                                  [Page 207]
  11593.  
  11594. Internet Draft             OSPF Version 2           February 1997
  11595.  
  11596.  
  11597.     C.6    Point-to-MultiPoint network parameters
  11598.  
  11599.     On Point-to-MultiPoint networks, it may    be necessary to
  11600.     configure the set of neighbors that are    directly reachable over
  11601.     the Point-to-MultiPoint    network. Each neighbor is identified by
  11602.     its IP address on the Point-to-MultiPoint network. Designated
  11603.     Routers    are not    elected    on Point-to-MultiPoint networks, so the
  11604.     Designated Router eligibility of configured neighbors is
  11605.     undefined.
  11606.  
  11607.     Alternatively, neighbors on Point-to-MultiPoint    networks may be
  11608.     dynamically discovered by lower-level protocols    such as    Inverse
  11609.     ARP ([Ref14]).
  11610.  
  11611.     C.7    Host route parameters
  11612.  
  11613.     Host routes are    advertised in router-LSAs as stub networks with
  11614.     mask 0xffffffff.  They indicate    either router interfaces to
  11615.     point-to-point networks, looped    router interfaces, or IP hosts
  11616.     that are directly connected to the router (e.g., via a SLIP
  11617.     line).    For each host directly connected to the    router,    the
  11618.     following items    must be    configured:
  11619.  
  11620.  
  11621.     Host IP    address
  11622.         The    IP address of the host.
  11623.  
  11624.     Cost of    link to    host
  11625.         The    cost of    sending    a packet to the    host, in terms of the
  11626.         link state metric.    There may be multiple costs configured,
  11627.         one    for each IP TOS.  However, since the host probably has
  11628.         only a single connection to    the internet, the actual
  11629.         configured cost(s) in many cases is    unimportant (i.e., will
  11630.         have no effect on routing).
  11631.  
  11632.     Area ID
  11633.         The    OSPF area to which the host belongs.
  11634.  
  11635.  
  11636.  
  11637.  
  11638.  
  11639.  
  11640.  
  11641.  
  11642.  
  11643.  
  11644.  
  11645.  
  11646.  
  11647.  
  11648. Moy                                  [Page 208]
  11649.  
  11650. Internet Draft             OSPF Version 2           February 1997
  11651.  
  11652.  
  11653. D. Authentication
  11654.  
  11655.     All    OSPF protocol exchanges    are authenticated.  The    OSPF packet
  11656.     header (see    Section    A.3.1) includes    an authentication type field,
  11657.     and    64-bits    of data    for use    by the appropriate authentication scheme
  11658.     (determined    by the type field).
  11659.  
  11660.     The    authentication type is configurable on a per-interface (or
  11661.     equivalently, on a per-network/subnet) basis.  Additional
  11662.     authentication data    is also    configurable on    a per-interface    basis.
  11663.  
  11664.     Authentication types 0, 1 and 2 are    defined    by this    specification.
  11665.     All    other authentication types are reserved    for definition by the
  11666.     IANA (iana@ISI.EDU).  The current list of authentication types is
  11667.     described below in Table 20.
  11668.  
  11669.  
  11670.  
  11671.           AuType       Description
  11672.           ___________________________________________
  11673.           0           Null authentication
  11674.           1           Simple password
  11675.           2           Cryptographic authentication
  11676.           All others   Reserved    for assignment by the
  11677.                    IANA (iana@ISI.EDU)
  11678.  
  11679.  
  11680.               Table 20:    OSPF authentication types.
  11681.  
  11682.  
  11683.  
  11684.     D.1    Null authentication
  11685.  
  11686.     Use of this authentication type    means that routing exchanges
  11687.     over the network/subnet    are not    authenticated.    The 64-bit
  11688.     authentication field in    the OSPF header    can contain anything; it
  11689.     is not examined    on packet reception. When employing Null
  11690.     authentication,    the entire contents of each OSPF packet    (other
  11691.     than the 64-bit    authentication field) are checksummed in order
  11692.     to detect data corruption.
  11693.  
  11694.     D.2    Simple password    authentication
  11695.  
  11696.     Using this authentication type,    a 64-bit field is configured on
  11697.     a per-network basis.  All packets sent on a particular network
  11698.     must have this configured value    in their OSPF header 64-bit
  11699.     authentication field.  This essentially    serves as a "clear" 64-
  11700.     bit password. In addition, the entire contents of each OSPF
  11701.  
  11702.  
  11703.  
  11704. Moy                                  [Page 209]
  11705.  
  11706. Internet Draft             OSPF Version 2           February 1997
  11707.  
  11708.  
  11709.     packet (other than the 64-bit authentication field) are
  11710.     checksummed in order to    detect data corruption.
  11711.  
  11712.     Simple password    authentication guards against routers
  11713.     inadvertently joining the routing domain; each router must first
  11714.     be configured with its attached    networks' passwords before it
  11715.     can participate    in routing.  However, simple password
  11716.     authentication is vulnerable to    passive    attacks    currently
  11717.     widespread in the Internet (see    [Ref16]). Anyone with physical
  11718.     access to the network can learn    the password and compromise the
  11719.     security of the    OSPF routing domain.
  11720.  
  11721.     D.3    Cryptographic authentication
  11722.  
  11723.     Using this authentication type,    a shared secret    key is
  11724.     configured in all routers attached to a    common network/subnet.
  11725.     For each OSPF protocol packet, the key is used to
  11726.     generate/verify    a "message digest" that    is appended to the end
  11727.     of the OSPF packet. The    message    digest is a one-way function of
  11728.     the OSPF protocol packet and the secret    key. Since the secret
  11729.     key is never sent over the network in the clear, protection is
  11730.     provided against passive attacks.
  11731.  
  11732.     The algorithms used to generate    and verify the message digest
  11733.     are specified implicitly by the    secret key. This specification
  11734.     completely defines the use of OSPF Cryptographic authentication
  11735.     when the MD5 algorithm is used.
  11736.  
  11737.     In addition, a non-decreasing sequence number is included in
  11738.     each OSPF protocol packet to protect against replay attacks.
  11739.     This provides long term    protection; however, it    is still
  11740.     possible to replay an OSPF packet until    the sequence number
  11741.     changes. To implement this feature, each neighbor data structure
  11742.  
  11743.  
  11744.     0            1            2            3
  11745.     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
  11746.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11747.        |          0               |    Key    ID     | Auth Data Len |
  11748.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11749.        |         Cryptographic sequence    number               |
  11750.        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  11751.  
  11752.            Figure 18: Usage of the Authentication field
  11753.            in the OSPF packet header when Cryptographic
  11754.               Authentication is employed
  11755.  
  11756.  
  11757.  
  11758.  
  11759.  
  11760. Moy                                  [Page 210]
  11761.  
  11762. Internet Draft             OSPF Version 2           February 1997
  11763.  
  11764.  
  11765.     contains a new field called the    "cryptographic sequence    number".
  11766.     This field is initialized to zero, and is also set to zero
  11767.     whenever the neighbor's    state transitions to "Down". Whenever an
  11768.     OSPF packet is accepted    as authentic, the cryptographic    sequence
  11769.     number is set to the received packet's sequence    number.
  11770.  
  11771.     This specification does    not provide a rollover procedure for the
  11772.     cryptographic sequence number. When the    cryptographic sequence
  11773.     number that the    router is sending hits the maximum value, the
  11774.     router should reset the    cryptographic sequence number that it is
  11775.     sending    back to    0. After this is done, the router's neighbors
  11776.     will reject the    router's OSPF packets for a period of
  11777.     RouterDeadInterval, and    then the router    will be    forced to
  11778.     reestablish all    adjacencies over the interface.    However, it is
  11779.     expected that many implementations will    use "seconds since
  11780.     reboot"    (or "seconds since 1960", etc.)    as the cryptographic
  11781.     sequence number. Such a    choice will essentially    prevent
  11782.     rollover, since    the cryptographic sequence number field    is 32
  11783.     bits in    length.
  11784.  
  11785.     The OSPF Cryptographic authentication option does not provide
  11786.     confidentiality.
  11787.  
  11788.     When cryptographic authentication is used, the 64-bit
  11789.     Authentication field in    the standard OSPF packet header    is
  11790.     redefined as shown in Figure 18. The new field definitions are
  11791.     as follows:
  11792.  
  11793.     Key ID
  11794.         This field identifies the algorithm    and secret key used to
  11795.         create the message digest appended to the OSPF packet. Key
  11796.         Identifiers    are unique per-interface (or equivalently, per-
  11797.         subnet).
  11798.  
  11799.     Auth Data Len
  11800.         The    length in bytes    of the message digest appended to the
  11801.         OSPF packet.
  11802.  
  11803.     Cryptographic sequence number
  11804.         An unsigned    32-bit non-decreasing sequence number. Used to
  11805.         guard against replay attacks.
  11806.  
  11807.     The message digest appended to the OSPF    packet is not actually
  11808.     considered part    of the OSPF protocol packet: the message digest
  11809.     is not included    in the OSPF header's packet length, although it
  11810.     is included in the packet's IP header length field.
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816. Moy                                  [Page 211]
  11817.  
  11818. Internet Draft             OSPF Version 2           February 1997
  11819.  
  11820.  
  11821.     Each key is identified by the combination of interface and Key
  11822.     ID. An interface may have multiple keys    active at any one time.
  11823.     This enables smooth transition from one    key to another.    Each key
  11824.     has four time constants    associated with    it. These time constants
  11825.     can be expressed in terms of a time-of-day clock, or in    terms of
  11826.     a router's local clock (e.g., number of    seconds    since last
  11827.     reboot):
  11828.  
  11829.     KeyStartAccept
  11830.         The    time that the router will start    accepting packets that
  11831.         have been created with the given key.
  11832.  
  11833.     KeyStartGenerate
  11834.         The    time that the router will start    using the key for packet
  11835.         generation.
  11836.  
  11837.     KeyStopGenerate
  11838.         The    time that the router will stop using the key for packet
  11839.         generation.
  11840.  
  11841.     KeyStopAccept
  11842.         The    time that the router will stop accepting packets that
  11843.         have been created with the given key.
  11844.  
  11845.     In order to achieve smooth key transition, KeyStartAccept should
  11846.     be less    than KeyStartGenerate and KeyStopGenerate should be less
  11847.     than KeyStopAccept. If KeyStopGenerate and KeyStopAccept are
  11848.     left unspecified, the key's lifetime is    infinite. When a new key
  11849.     replaces an old, the KeyStartGenerate time for the new key must
  11850.     be less    than or    equal to the KeyStopGenerate time of the old
  11851.     key.
  11852.  
  11853.     Key storage should persist across a system restart, warm or
  11854.     cold, to avoid operational issues. In the event    that the last
  11855.     key associated with an interface expires, it is    unacceptable to
  11856.     revert to an unauthenticated condition,    and not    advisable to
  11857.     disrupt    routing.  Therefore, the router    should send a "last
  11858.     authentication key expiration" notification to the network
  11859.     manager    and treat the key as having an infinite    lifetime until
  11860.     the lifetime is    extended, the key is deleted by    network
  11861.     management, or a new key is configured.
  11862.  
  11863.     D.4    Message    generation
  11864.  
  11865.     After building the contents of an OSPF packet, the
  11866.     authentication procedure indicated by the sending interface's
  11867.     Autype value is    called before the packet is sent. The
  11868.     authentication procedure modifies the OSPF packet as follows.
  11869.  
  11870.  
  11871.  
  11872. Moy                                  [Page 212]
  11873.  
  11874. Internet Draft             OSPF Version 2           February 1997
  11875.  
  11876.  
  11877.     D.4.1 Generating Null authentication
  11878.  
  11879.         When using Null authentication, the    packet is modified as
  11880.         follows:
  11881.  
  11882.         (1)    The Autype field in the    standard OSPF header is    set to
  11883.         0.
  11884.  
  11885.         (2)    The checksum field in the standard OSPF    header is set to
  11886.         the standard IP    checksum of the    entire contents    of the
  11887.         packet,    starting with the OSPF packet header but
  11888.         excluding the 64-bit authentication field.  This
  11889.         checksum is calculated as the 16-bit one's complement of
  11890.         the one's complement sum of all    the 16-bit words in the
  11891.         packet,    excepting the authentication field.  If    the
  11892.         packet's length    is not an integral number of 16-bit
  11893.         words, the packet is padded with a byte    of zero    before
  11894.         checksumming.
  11895.  
  11896.     D.4.2 Generating Simple    password authentication
  11897.  
  11898.         When using Simple password authentication, the packet is
  11899.         modified as    follows:
  11900.  
  11901.         (1)    The Autype field in the    standard OSPF header is    set to
  11902.         1.
  11903.  
  11904.         (2)    The checksum field in the standard OSPF    header is set to
  11905.         the standard IP    checksum of the    entire contents    of the
  11906.         packet,    starting with the OSPF packet header but
  11907.         excluding the 64-bit authentication field.  This
  11908.         checksum is calculated as the 16-bit one's complement of
  11909.         the one's complement sum of all    the 16-bit words in the
  11910.         packet,    excepting the authentication field.  If    the
  11911.         packet's length    is not an integral number of 16-bit
  11912.         words, the packet is padded with a byte    of zero    before
  11913.         checksumming.
  11914.  
  11915.         (3)    The 64-bit authentication field    in the OSPF packet
  11916.         header is set to the 64-bit password (i.e.,
  11917.         authentication key) that has been configured for the
  11918.         interface.
  11919.  
  11920.     D.4.3 Generating Cryptographic authentication
  11921.  
  11922.         When using Cryptographic authentication, there may be
  11923.         multiple keys configured for the interface.    In this    case,
  11924.         among the keys that    are valid for message generation (i.e,
  11925.  
  11926.  
  11927.  
  11928. Moy                                  [Page 213]
  11929.  
  11930. Internet Draft             OSPF Version 2           February 1997
  11931.  
  11932.  
  11933.         that have KeyStartGenerate <= current time <
  11934.         KeyStopGenerate) choose the    one with the most recent
  11935.         KeyStartGenerate time. Using this key, modify the packet as
  11936.         follows:
  11937.  
  11938.         (1)    The Autype field in the    standard OSPF header is    set to
  11939.         2.
  11940.  
  11941.         (2)    The checksum field in the standard OSPF    header is not
  11942.         calculated, but    is instead set to 0.
  11943.  
  11944.         (3)    The Key    ID (see    Figure 18) is set to the chosen    key's
  11945.         Key ID.
  11946.  
  11947.         (4)    The Auth Data Len field    is set to the length in    bytes of
  11948.         the message digest that    will be    appended to the    OSPF
  11949.         packet.    When using MD5 as the authentication algorithm,
  11950.         Auth Data Len will be 16.
  11951.  
  11952.         (5)    The 32-bit Cryptographic sequence number (see Figure 18)
  11953.         is set to a non-decreasing value (i.e.,    a value    at least
  11954.         as large as the    last value sent    out the    interface). The
  11955.         precise    values to use in the cryptographic sequence
  11956.         number field are implementation-specific. For example,
  11957.         it may be based    on a simple counter, or    be based on the
  11958.         system's clock.
  11959.  
  11960.         (6)    The message digest is then calculated and appended to
  11961.         the OSPF packet.  The authentication algorithm to be
  11962.         used in    calculating the    digest is indicated by the key
  11963.         itself.     Input to the authentication algorithm consists
  11964.         of the OSPF packet and the secret key. When using MD5 as
  11965.         the authentication algorithm, the message digest
  11966.         calculation proceeds as    follows:
  11967.  
  11968.         (a) The    16 byte    MD5 key    is appended to the OSPF    packet.
  11969.  
  11970.         (b) Trailing pad and length fields are added, as
  11971.             specified in [Ref17].
  11972.  
  11973.         (c) The    MD5 authentication algorithm is    run over the
  11974.             concatenation of the OSPF packet, secret key, pad
  11975.             and    length fields, producing a 16 byte message
  11976.             digest (see    [Ref17]).
  11977.  
  11978.         (d) The    MD5 digest is written over the OSPF key    (i.e.,
  11979.             appended to    the original OSPF packet). The digest is
  11980.             not    counted    in the OSPF packet's length field, but
  11981.  
  11982.  
  11983.  
  11984. Moy                                  [Page 214]
  11985.  
  11986. Internet Draft             OSPF Version 2           February 1997
  11987.  
  11988.  
  11989.             is included    in the packet's    IP length field. Any
  11990.             trailing pad or length fields beyond the digest are
  11991.             not    counted    or transmitted.
  11992.  
  11993.     D.5    Message    verification
  11994.  
  11995.     When an    OSPF packet has    been received on an interface, it must
  11996.     be authenticated. The authentication procedure is indicated by
  11997.     the setting of Autype in the standard OSPF packet header, which
  11998.     matches    the setting of Autype for the receiving    OSPF interface.
  11999.  
  12000.     If an OSPF protocol packet is accepted as authentic, processing
  12001.     of the packet continues    as specified in    Section    8.2. Packets
  12002.     which fail authentication are discarded.
  12003.  
  12004.     D.5.1 Verifying    Null authentication
  12005.  
  12006.         When using Null authentication, the    checksum field in the
  12007.         OSPF header    must be    verified. It must be set to the    16-bit
  12008.         one's complement of    the one's complement sum of all    the 16-
  12009.         bit    words in the packet, excepting the authentication field.
  12010.         (If    the packet's length is not an integral number of 16-bit
  12011.         words, the packet is padded    with a byte of zero before
  12012.         checksumming.)
  12013.  
  12014.     D.5.2 Verifying    Simple password    authentication
  12015.  
  12016.         When using Simple password authentication, the received OSPF
  12017.         packet is authenticated as follows:
  12018.  
  12019.         (1)    The checksum field in the OSPF header must be verified.
  12020.         It must    be set to the 16-bit one's complement of the
  12021.         one's complement sum of    all the    16-bit words in    the
  12022.         packet,    excepting the authentication field.  (If the
  12023.         packet's length    is not an integral number of 16-bit
  12024.         words, the packet is padded with a byte    of zero    before
  12025.         checksumming.)
  12026.  
  12027.         (2)    The 64-bit authentication field    in the OSPF packet
  12028.         header must be equal to    the 64-bit password (i.e.,
  12029.         authentication key) that has been configured for the
  12030.         interface.
  12031.  
  12032.     D.5.3 Verifying    Cryptographic authentication
  12033.  
  12034.         When using Cryptographic authentication, the received OSPF
  12035.         packet is authenticated as follows:
  12036.  
  12037.  
  12038.  
  12039.  
  12040. Moy                                  [Page 215]
  12041.  
  12042. Internet Draft             OSPF Version 2           February 1997
  12043.  
  12044.  
  12045.         (1)    Locate the receiving interface's configured key    having
  12046.         Key ID equal to    that specified in the received OSPF
  12047.         packet (see Figure 18).    If the key is not found, or if
  12048.         the key    is not valid for reception (i.e., current time <
  12049.         KeyStartAccept or current time >= KeyStopAccept), the
  12050.         OSPF packet is discarded.
  12051.  
  12052.         (2)    If the cryptographic sequence number found in the OSPF
  12053.         header (see Figure 18) is less than the    cryptographic
  12054.         sequence number    recorded in the    sending    neighbor's data
  12055.         structure, the OSPF packet is discarded.
  12056.  
  12057.         (3)    Verify the appended message digest in the following
  12058.         steps:
  12059.  
  12060.         (a) The    received digest    is set aside.
  12061.  
  12062.         (b) A new digest is calculated,    as specified in    Step 6
  12063.             of Section D.4.3.
  12064.  
  12065.         (c) The    calculated and received    digests    are compared. If
  12066.             they do not    match, the OSPF    packet is discarded. If
  12067.             they do match, the OSPF protocol packet is accepted
  12068.             as authentic, and the "cryptographic sequence
  12069.             number" in the neighbor's data structure is    set to
  12070.             the    sequence number    found in the packet's OSPF
  12071.             header.
  12072.  
  12073.  
  12074.  
  12075.  
  12076.  
  12077.  
  12078.  
  12079.  
  12080.  
  12081.  
  12082.  
  12083.  
  12084.  
  12085.  
  12086.  
  12087.  
  12088.  
  12089.  
  12090.  
  12091.  
  12092.  
  12093.  
  12094.  
  12095.  
  12096. Moy                                  [Page 216]
  12097.  
  12098. Internet Draft             OSPF Version 2           February 1997
  12099.  
  12100.  
  12101. E. An algorithm    for assigning Link State IDs
  12102.  
  12103.     The    Link State ID in AS-external-LSAs and summary-LSAs is usually
  12104.     set    to the described network's IP address. However,    if necessary one
  12105.     or more of the network's host bits may be set in the Link State ID.
  12106.     This allows    the router to originate    separate LSAs for networks
  12107.     having the same address, yet different masks. Such networks    can
  12108.     occur in the presence of supernetting and subnet 0s    (see [Ref10]).
  12109.  
  12110.     This appendix gives    one possible algorithm for setting the host bits
  12111.     in Link State IDs.    The choice of such an algorithm    is a local
  12112.     decision. Separate routers are free    to use different algorithms,
  12113.     since the only LSAs    affected are the ones that the router itself
  12114.     originates.    The only requirement on    the algorithms used is that the
  12115.     network's IP address should    be used    as the Link State ID whenever
  12116.     possible; this maximizes interoperability with OSPF    implementations
  12117.     predating RFC 1583.
  12118.  
  12119.     The    algorithm below    is stated for AS-external-LSAs.     This is only
  12120.     for    clarity; the exact same    algorithm can be used for summary-LSAs.
  12121.     Suppose that the router wishes to originate    an AS-external-LSA for a
  12122.     network having address NA and mask NM1. The    following steps    are then
  12123.     used to determine the LSA's    Link State ID:
  12124.  
  12125.     (1)    Determine whether the router is    already    originating an AS-
  12126.     external-LSA with Link State ID    equal to NA (in    such an    LSA the
  12127.     router itself will be listed as    the LSA's Advertising Router).
  12128.     If not,    the Link State ID is set equal to NA and the algorithm
  12129.     terminates. Otherwise,
  12130.  
  12131.     (2)    Obtain the network mask    from the body of the already existing
  12132.     AS-external-LSA. Call this mask    NM2. There are then two    cases:
  12133.  
  12134.     o   NM1    is longer (i.e., more specific)    than NM2. In this case,
  12135.         set    the Link State ID in the new LSA to be the network
  12136.         [NA,NM1] with all the host bits set    (i.e., equal to    NA or'ed
  12137.         together with all the bits that are    not set    in NM1,    which is
  12138.         network [NA,NM1]'s broadcast address).
  12139.  
  12140.     o   NM2    is longer than NM1. In this case, change the existing
  12141.         LSA    (having    Link State ID of NA) to    reference the new
  12142.         network [NA,NM1] by    incrementing the sequence number,
  12143.         changing the mask in the body to NM1 and inserting the cost
  12144.         of the new network.    Then originate a new LSA for the old
  12145.         network [NA,NM2], with Link    State ID equal to NA or'ed
  12146.         together with the bits that    are not    set in NM2 (i.e.,
  12147.         network [NA,NM2]'s broadcast address).
  12148.  
  12149.  
  12150.  
  12151.  
  12152. Moy                                  [Page 217]
  12153.  
  12154. Internet Draft             OSPF Version 2           February 1997
  12155.  
  12156.  
  12157.     The    above algorithm    assumes    that all masks are contiguous; this
  12158.     ensures that when two networks have    the same address, one mask is
  12159.     more specific than the other. The algorithm    also assumes that no
  12160.     network exists having an address equal to another network's
  12161.     broadcast address. Given these two assumptions, the    above algorithm
  12162.     always produces unique Link    State IDs. The above algorithm can also
  12163.     be reworded    as follows:  When originating an AS-external-LSA, try to
  12164.     use    the network number as the Link State ID.  If that produces a
  12165.     conflict, examine the two networks in conflict. One    will be    a subset
  12166.     of the other. For the less specific    network, use the network number
  12167.     as the Link    State ID and for the more specific use the network's
  12168.     broadcast address instead (i.e., flip all the "host" bits to 1).  If
  12169.     the    most specific network was originated first, this will cause you
  12170.     to originate two LSAs at once.
  12171.  
  12172.     As an example of the algorithm, consider its operation when    the
  12173.     following sequence of events occurs    in a single router (Router A).
  12174.  
  12175.  
  12176.     (1)    Router A wants to originate an AS-external-LSA for
  12177.     [10.0.0.0,255.255.255.0]:
  12178.  
  12179.     (a) A Link State ID of 10.0.0.0    is used.
  12180.  
  12181.     (2)    Router A then wants to originate an AS-external-LSA for
  12182.     [10.0.0.0,255.255.0.0]:
  12183.  
  12184.     (a) The    LSA for    [10.0.0,0,255.255.255.0] is reoriginated using a
  12185.         new    Link State ID of 10.0.0.255.
  12186.  
  12187.     (b) A Link State ID of 10.0.0.0    is used    for
  12188.         [10.0.0.0,255.255.0.0].
  12189.  
  12190.     (3)    Router A then wants to originate an AS-external-LSA for
  12191.     [10.0.0.0,255.0.0.0]:
  12192.  
  12193.     (a) The    LSA for    [10.0.0.0,255.255.0.0] is reoriginated using a
  12194.         new    Link State ID of 10.0.255.255.
  12195.  
  12196.     (b) A Link State ID of 10.0.0.0    is used    for
  12197.         [10.0.0.0,255.0.0.0].
  12198.  
  12199.     (c) The    network    [10.0.0.0,255.255.255.0] keeps its Link    State ID
  12200.         of 10.0.0.255.
  12201.  
  12202.  
  12203.  
  12204.  
  12205.  
  12206.  
  12207.  
  12208. Moy                                  [Page 218]
  12209.  
  12210. Internet Draft             OSPF Version 2           February 1997
  12211.  
  12212.  
  12213. F. Multiple interfaces to the same network/subnet
  12214.  
  12215.     There are at least two ways    to support multiple physical interfaces
  12216.     to the same    IP subnet. Both    methods    will interoperate with
  12217.     implementations of RFC 1583    (and of    course this memo). The two
  12218.     methods are    sketched briefly below.    An assumption has been made that
  12219.     each interface has been assigned a separate    IP address (otherwise,
  12220.     support for    multiple interfaces is more of a link-level or ARP issue
  12221.     than an OSPF issue).
  12222.  
  12223.     Method 1:
  12224.     Run the    entire OSPF functionality over both interfaces,    sending
  12225.     and receiving hellos, flooding,    supporting separate interface
  12226.     and neighbor FSMs for each interface, etc. When    doing this all
  12227.     other routers on the subnet will treat the two interfaces as
  12228.     separate neighbors, since neighbors are    identified (on broadcast
  12229.     and NBMA networks) by their IP address.
  12230.  
  12231.     Method 1 has the following disadvantages:
  12232.  
  12233.     (1) You    increase the total number of neighbors and adjacencies.
  12234.  
  12235.     (2) You    lose the bidirectionality test on both interfaces, since
  12236.         bidirectionality is    based on Router    ID.
  12237.  
  12238.     (3) You    have to    consider both interfaces together during the
  12239.         Designated Router election,    since if you declare both to be
  12240.         DR simultaneously you can confuse the tie-breaker (which is
  12241.         Router ID).
  12242.  
  12243.     Method 2:
  12244.     Run OSPF over only one interface (call it the primary
  12245.     interface), but    include    both the primary and secondary
  12246.     interfaces in your Router-LSA.
  12247.  
  12248.     Method 2 has the following disadvantages:
  12249.  
  12250.     (1) You    lose the bidirectionality test on the secondary
  12251.         interface.
  12252.  
  12253.     (2) When the primary interface fails, you need to promote the
  12254.         secondary interface    to primary status.
  12255.  
  12256.  
  12257.  
  12258.  
  12259.  
  12260.  
  12261.  
  12262.  
  12263.  
  12264. Moy                                  [Page 219]
  12265.  
  12266. Internet Draft             OSPF Version 2           February 1997
  12267.  
  12268.  
  12269. G. Differences from RFC    1583
  12270.  
  12271.     This section documents the differences between this    memo and RFC
  12272.     1583.  All differences are backward-compatible. Implementations of
  12273.     this memo and of RFC 1583 will interoperate.
  12274.  
  12275.     G.1    Enhancements to    OSPF authentication
  12276.  
  12277.     An additional OSPF authentication type has been    added: the
  12278.     Cryptographic authentication type. This    has been defined so that
  12279.     any arbitrary "Keyed Message Digest" algorithm can be used for
  12280.     packet authentication. Operation using the MD5 algorithm is
  12281.     completely specified (see Appendix D).
  12282.  
  12283.     A number of other changes were also made to OSPF packet
  12284.     authentication,    affecting the following    Sections:
  12285.  
  12286.     o   The    authentication type is now specified per-interface,
  12287.         rather than    per-area (Sections 6, 9, C.2 and C.3).
  12288.  
  12289.     o   The    OSPF packet header checksum is now considered part of
  12290.         the    authentication procedure, and so has been moved    out of
  12291.         the    packet send and    receive    logic (Sections    8.1 and    8.2) and
  12292.         into the description of authentication types (Appendix D).
  12293.  
  12294.     o   In Appendix    D, sections detailing message generation and
  12295.         message verification have been added.
  12296.  
  12297.     o   For    the OSPF Cryptographic authentication type, a discussion
  12298.         of key management, including the requirement for
  12299.         simultaneous support of multiple keys, key lifetimes and
  12300.         smooth key transition, has been added to Appendix D.
  12301.  
  12302.     G.2    Addition of Point-to-MultiPoint    interface
  12303.  
  12304.     This memo adds an additional method for    running    OSPF over non-
  12305.     broadcast networks: the    Point-to-Multipoint network. To
  12306.     implement this addition, the language of RFC 1583 has been
  12307.     altered    slightly. References to    "multi-access" networks    have
  12308.     been deleted. The term "non-broadcast networks"    is now used to
  12309.     describe networks which    can connect many routers, but which do
  12310.     not natively support broadcast/multicast (such as a public Frame
  12311.     relay network).    Over non-broadcast networks, there are two
  12312.     options    for running OSPF: modelling them as "NBMA networks" or
  12313.     as "Point-to-MultiPoint    networks". NBMA    networks require full
  12314.     mesh connectivity between routers; when    employing NBMA networks
  12315.     in the presence    of partial mesh    connectivity, multiple NBMA
  12316.     networks must be configured, as    described in [Ref15]. In
  12317.  
  12318.  
  12319.  
  12320. Moy                                  [Page 220]
  12321.  
  12322. Internet Draft             OSPF Version 2           February 1997
  12323.  
  12324.  
  12325.     contrast, Point-to-Multipoint networks have been designed to
  12326.     work simply and    naturally when faced with partial mesh
  12327.     connectivity.
  12328.  
  12329.     The addition of    Point-to-MultiPoint networks has impacted the
  12330.     text in    many places, which are briefly summarized below:
  12331.  
  12332.     o   Section 2 describing the OSPF link-state database has been
  12333.         split into additional subsections, with one    of the
  12334.         subsections    (Section 2.1.1)    describing the differing map
  12335.         representations of the two non-broadcast network options.
  12336.         This subsection also contrasts the NBMA network and    Point-
  12337.         to-MultiPoint network options, and describes the situations
  12338.         when one is    preferable to the other.
  12339.  
  12340.     o   In contrast    to NBMA    networks, Point-to-MultiPoint networks
  12341.         have the following properties. Adjacencies are established
  12342.         between all    neighboring routers (Sections 4, 7.1, 7.5, 9.5
  12343.         and    10.4). There is    no Designated Router or    Backup
  12344.         Designated Router for a Point-to-MultiPoint    network
  12345.         (Sections 7.3 and 7.4). No network-LSA is originated for
  12346.         Point-to-MultiPoint    networks (Sections 12.4.2 and A.4.3).
  12347.         Router Priority is not configured for Point-to-MultiPoint
  12348.         interfaces,    nor for    neighbors on Point-to-MultiPoint
  12349.         networks (Sections C.3 and C.6).
  12350.  
  12351.     o   The    Interface FSM for a Point-to-MultiPoint    interface is
  12352.         identical to that used for point-to-point interfaces. Two
  12353.         states are possible: "Down"    and "Point-to-Point" (Section
  12354.         9.3).
  12355.  
  12356.     o   When originating a router-LSA, and Point-to-MultiPoint
  12357.         interface is reported as a collection of "point-to-point
  12358.         links" to all of the interface's adjacent neighbors,
  12359.         together with a single stub    link advertising the interface's
  12360.         IP address with a cost of 0    (Section 12.4.1.4).
  12361.  
  12362.     o   When flooding out a    non-broadcast interface    (when either in
  12363.         NBMA or Point-to-MultiPoint    mode) the Link State Update or
  12364.         Link State Acknowledgment packet must be replicated    in order
  12365.         to be sent to each of the interface's neighbors (see
  12366.         Sections 13.3 and 13.5).
  12367.  
  12368.     G.3    Support    for overlapping    area ranges
  12369.  
  12370.     RFC 1583 requires that all networks falling into a given area
  12371.     range actually belong to a single area.    This memo relaxes that
  12372.     restriction. This is useful in the following example. Suppose
  12373.  
  12374.  
  12375.  
  12376. Moy                                  [Page 221]
  12377.  
  12378. Internet Draft             OSPF Version 2           February 1997
  12379.  
  12380.  
  12381.     that [10.0.0.0,    255.0.0.0] is carved up    into subnets. Most of
  12382.     these subnets are assigned to a    single OSPF area (call it Area
  12383.     X), while a few    subnets    are assigned to    other areas. In    order to
  12384.     get this configuration to work with RFC    1583, you must not
  12385.     summarize the subnets of Area X    with the single    range [10.0.0.0,
  12386.     255.0.0.0], because then the subnets of    10.0.0.0 belonging to
  12387.     other areas would become unreachable. However, with this memo
  12388.     you can    summarize the subnets in Area X, provided that the
  12389.     subnets    belonging to other areas are not summarized.
  12390.  
  12391.     Implementation details for this    change can be found in Sections
  12392.     11.1 and 16.2.
  12393.  
  12394.     G.4    A modification to the flooding algorithm
  12395.  
  12396.     The OSPF flooding algorithm has    been modified as follows. When a
  12397.     Link State Update Packet is received that contains an LSA
  12398.     instance which is actually less    recent than the    the router's
  12399.     current    database copy, the router will now in most cases respond
  12400.     by flooding back its database copy. This is in contrast    to the
  12401.     RFC 1583 behavior, which was to    simply throw the received LSA
  12402.     away.
  12403.  
  12404.     Detailed description of    the change can be found    in Step    8 of
  12405.     Section    13.
  12406.  
  12407.     This change improves MaxAge processing.    There are times    when
  12408.     MaxAge LSAs stay in a router's database    for extended intervals:
  12409.     1) when    they are stuck in a retransmission queue on a slow link
  12410.     or 2) when a router is not properly flushing them from its
  12411.     database, due to software bugs.    The prolonged existence    of these
  12412.     MaxAge LSAs can    inhibit    the flooding of    new instances of the
  12413.     LSA. New instances typically start with    LS sequence number equal
  12414.     to InitialSequenceNumber, and are treated as less recent (and
  12415.     hence were discarded according to RFC 1583) by routers still
  12416.     holding    MaxAge instances. However, with    the above change to
  12417.     flooding, a router holding a MaxAge instance will flood    back the
  12418.     MaxAge instance. When this flood reaches the LSA's originator,
  12419.     it will    then pick the next highest LS sequence number and
  12420.     reflood, overwriting the MaxAge    instance.
  12421.  
  12422.     G.5    Introduction of    the MinLSArrival constant
  12423.  
  12424.     OSPF limits the    frequency that new instances of    any particular
  12425.     LSA can    be accepted during flooding. This is extra protection,
  12426.     just in    case a neighboring router is violating the mandated
  12427.     limit on LSA (re)originations (namely, one per LSA in any
  12428.     MinLSInterval).
  12429.  
  12430.  
  12431.  
  12432. Moy                                  [Page 222]
  12433.  
  12434. Internet Draft             OSPF Version 2           February 1997
  12435.  
  12436.  
  12437.     In RFC 1583, the frequency at which new    LSA instances were
  12438.     accepted was also set equal to once every MinLSInterval    seconds.
  12439.     However, in some circumstances this led    to unwanted link state
  12440.     retransmissions, even when the LSA originator was obeying the
  12441.     MinLSInterval limit on originations. This was due to either 1)
  12442.     choice of clock    granularity in some OSPF implementations or 2)
  12443.     differing clock    speed in neighboring routers.
  12444.  
  12445.     To alleviate this problem, the frequency at which new LSA
  12446.     instances are accepted during flooding has now been increased to
  12447.     once every MinLSArrival    seconds, whose value is    set to 1.  This
  12448.     change is reflected in Steps 5a    and 5d of Section 13, and in
  12449.     Appendix B.
  12450.  
  12451.     G.6    Optionally advertising point-to-point links as subnets
  12452.  
  12453.     When describing    a point-to-point interface in its router-LSA, a
  12454.     router may now advertise a stub    link to    the point-to-point
  12455.     network's subnet. This is specified as an alternative to the RFC
  12456.     1583 behavior, which is    to advertise a stub link to the
  12457.     neighbor's IP address. See Sections 12.4.1 and 12.4.1.1    for
  12458.     details.
  12459.  
  12460.     G.7    Advertising same external route    from multiple areas
  12461.  
  12462.     This document fixes routing loops which    can occur in RFC 1583
  12463.     when the same external destination is advertised by AS boundary
  12464.     routers    in separate areas. There are two manifestations    of this
  12465.     problem. The first, discovered by Dennis Ferguson, occurs when
  12466.     an aggregated forwarding address is in use. In this case, the
  12467.     desirability of    the forwarding address can change for the worse
  12468.     as a packet crosses an area aggregation    boundary on the    way to
  12469.     the forwarding address,    which in turn can cause    the preference
  12470.     of AS-external-LSAs to change, resulting in a routing loop.
  12471.  
  12472.     The second manifestation was discovered    by Richard Woundy. It is
  12473.     caused by an incomplete    application of OSPF's preference of
  12474.     intra-area routes over inter-area routes: paths    to any given
  12475.     ASBR/forwarding    address    are selected first based on intra-area
  12476.     preference, while the comparison between separate
  12477.     ASBRs/forwarding addresses is driven only by cost, ignoring
  12478.     intra-area preference. His example is replicated in Figure 19.
  12479.     Both router A3 and router B3 are originating an    AS-external-LSA
  12480.     for 10.0.0.0/8,    with the same type 2 metric. Router A1 selects
  12481.     B1 as its next hop towards 10.0.0.0/8, based on    shorter    cost to
  12482.     ASBR B3    (via B1->B2->B3). However, the shorter route to    B3 is
  12483.     not available to B1, due to B1's preference for    the (higher
  12484.     cost) intra-area route to B3 through Area A. This leads    B1 to
  12485.  
  12486.  
  12487.  
  12488. Moy                                  [Page 223]
  12489.  
  12490. Internet Draft             OSPF Version 2           February 1997
  12491.  
  12492.  
  12493.     select A1 as its next hop to 10.0.0.0/8, resulting in a    routing
  12494.     loop.
  12495.  
  12496.     The following two changes have been made to prevent these
  12497.     routing    loops:
  12498.  
  12499.     o   When originating a type 3 summary-LSA for a    configured area
  12500.         address range, the cost of the summary-LSA is now set to the
  12501.         maximum cost of the    range's    component networks (instead of
  12502.         the    previous algorithm which set the cost to the minimum
  12503.         component cost).  This change affects Sections 3.5 and
  12504.         12.4.3, Figures 7 and 8, and Tables    6 and 13.
  12505.  
  12506.     o   The    preference rules for choosing among multiple AS-
  12507.         external-LSAs have been changed. Where previously cost was
  12508.         the    only determining factor, now the preference is driven
  12509.         first by type of path (intra-area or inter-area, through
  12510.         non-backbone area or through backbone) to the
  12511.         ASBR/forwarding address, using cost    only to    break ties. This
  12512.         change affects Sections 16.4 and 16.4.1.
  12513.  
  12514.         After implementing this change, the    example    in Figure 19 is
  12515.         modified as    follows. Router    A1 now chooses A3 as the next
  12516.  
  12517.                   10.0.0.0/8
  12518.                   ----------
  12519.                    |
  12520.                 +----+
  12521.                 | XX |
  12522.                 +----+
  12523.            RIP        /    \          RIP
  12524.        ---------------------      --------------------
  12525.        !                         !
  12526.        !                         !
  12527.      +----+         +----+      1      +----+......+----+....
  12528.      | A3 |------| A1 |---------------| B1 |------|    B3 |   .
  12529.      +----+      6  +----+          +----+  8   +----+   .
  12530.                        1|  .     /     .
  12531.                OSPF backbone        |  .    /      .
  12532.                       +----+  2    /       .
  12533.                       | B2 |-------     Area A.
  12534.                       +----+................
  12535.  
  12536.         Figure 19: Example routing loop    when the
  12537.            same external route is advertised from multiple
  12538.                 areas
  12539.  
  12540.  
  12541.  
  12542.  
  12543.  
  12544. Moy                                  [Page 224]
  12545.  
  12546. Internet Draft             OSPF Version 2           February 1997
  12547.  
  12548.  
  12549.         hop    to 10.0.0.0/8, while B1    chooses    B3 as next hop.    The
  12550.         reason for both choices is that ASBRs/forwarding addresses
  12551.         are    now chosen based first on intra-area preference, and
  12552.         then by cost.
  12553.  
  12554.         Unfortunately, this    change is not backward compatible. While
  12555.         the    change prevents    routing    loops when all routers run the
  12556.         new    preference rules, it can actually create routing loops
  12557.         when some routers are running the new preference rules and
  12558.         other routers implement RFC    1583. For this reason, a new
  12559.         configuration parameter has    been added:
  12560.         RFC1583Compatibility. Only when RFC1583Compatibility is set
  12561.         to "disabled" will the new preference rules    take effect. See
  12562.         Appendix C for more    details.
  12563.  
  12564.     G.8    Retransmission of initial Database Description packets
  12565.  
  12566.     This memo allows retransmission    of initial Database Description
  12567.     packets, without resetting the state of    the adjacency. In some
  12568.     environments, retransmission of    the initial Database Description
  12569.     packet may be unavoidable. For example,    the link delay incurred
  12570.     by a satellite link may    exceed the value configured for    an
  12571.     interface's RxmtInterval. In RFC 1583 such an environment
  12572.     prevents a full    adjacency from ever forming.
  12573.  
  12574.     In this    memo, changes have been    made in    the reception of
  12575.     Database Description packets so    that retransmitted initial
  12576.     Database Description packets are treated identically to    any
  12577.     other retransmitted Database Description packets. See Section
  12578.     10.6 for details.
  12579.  
  12580.     G.9    Detecting interface MTU    mismatches
  12581.  
  12582.     When two neighboring routers have a different interface    MTU for
  12583.     their common network segment, serious problems can ensue: large
  12584.     packets    are prevented from being successfully transferred from
  12585.     one router to the other, impairing OSPF's flooding algorithm and
  12586.     possibly creating "black holes"    for user data traffic.
  12587.  
  12588.     This memo provides a fix for the interface MTU mismatch    problem
  12589.     by advertising the interface MTU in Database Description
  12590.     packets. When a    router receives    a Database description packet
  12591.     advertising an MTU larger than the router can receive, the
  12592.     router drops the Database Description packet. This prevents an
  12593.     adjacency from forming,    telling    OSPF flooding and user data
  12594.     traffic    to avoid the connection    between    the two    routers. For
  12595.     more information, see Sections 10.6, 10.8, and A.3.3.
  12596.  
  12597.  
  12598.  
  12599.  
  12600. Moy                                  [Page 225]
  12601.  
  12602. Internet Draft             OSPF Version 2           February 1997
  12603.  
  12604.  
  12605. Security Considerations
  12606.  
  12607.     All    OSPF protocol exchanges    are authenticated. OSPF    supports
  12608.     multiple types of authentication; the type of authentication in use
  12609.     can    be configured on a per network segment basis. One of OSPF's
  12610.     authentication types, namely the Cryptographic authentication
  12611.     option, is believed    to be secure against passive attacks and provide
  12612.     significant    protection against active attacks. When    using the
  12613.     Cryptographic authentication option, each router appends a "message
  12614.     digest" to its transmitted OSPF packets. Receivers then use    the
  12615.     shared secret key and received digest to verify that each received
  12616.     OSPF packet    is authentic.
  12617.  
  12618.     The    quality    of the security    provided by the    Cryptographic
  12619.     authentication option depends completely on    the strength of    the
  12620.     message digest algorithm (MD5 is currently the only    message    digest
  12621.     algorithm specified), the strength of the key being    used, and the
  12622.     correct implementation of the security mechanism in    all
  12623.     communicating OSPF implementations.     It also requires that all
  12624.     parties maintain the secrecy of the    shared secret key.
  12625.  
  12626.     None of the    OSPF authentication types provide confidentiality. Nor
  12627.     do they protect against traffic analysis. Key management is    also not
  12628.     addressed by this memo.
  12629.  
  12630.     For    more information, see Sections 8.1, 8.2, and Appendix D.
  12631.  
  12632. Author's Address
  12633.  
  12634.     John Moy
  12635.     Cascade Communications Corp.
  12636.     5 Carlisle Road
  12637.     Westford, MA 01886
  12638.  
  12639.     Phone: 508-952-1367
  12640.     Fax:   508-692-9214
  12641.     Email: jmoy@casc.com
  12642.  
  12643.     This document expires in August 1997.
  12644.  
  12645.  
  12646.  
  12647.  
  12648.  
  12649.  
  12650.  
  12651.  
  12652.  
  12653.  
  12654.  
  12655.  
  12656. Moy                                  [Page 226]
  12657.  
  12658.