OSPFv2 RFC2328文档翻译2

RFC定义了不同版本的OSPFv2协议,这里以RFC2328为基础进行了OSPFv2协议的介绍,并对RFC2328文档进行了分析。
关于OSPFv2的RFC历史版本原文可见
链接: https://blog.csdn.net/fengxingzhe008/article/details/127236380
接下来对其进行介绍
由于篇幅问题,将本文档分为2部分,第1部分位于
链接: https://blog.csdn.net/fengxingzhe008/article/details/127681050
对OSPFv2相关介绍,可查看
链接: https://blog.csdn.net/fengxingzhe008/article/details/127686404

OSPFv2 RFC2328文档翻译2

10.10.一个例子

Figure 14显示了邻接形成的示例。路由器RT1和RT2都连接到广播网络。假设RT2是网络的指定路由器,并且RT2具有比路由器RT1更高的Router ID。

    Figure 14 shows an example of an adjacency forming.  Routers RT1
    and RT2 are both connected to a broadcast network.  It is
    assumed that RT2 is the Designated Router for the network, and
    that RT2 has a higher Router ID than Router RT1.

每个路由器实现的邻居状态变化列在图的两侧。

    The neighbor state changes realized by each router are listed on
    the sides of the figure.

在Figure 14的开头,路由器RT1与网络的接口开始工作。它开始发送Hello数据包,尽管它不知道指定路由器或任何其他相邻路由器的身份。路由器RT2听到这个hello(将邻居移动到Init状态),并且在其下一个hello数据包中表明它自己是指定路由器,并且它已经听到了来自RT1的hello数据。这反过来导致RT1进入ExStart状态,因为它开始调出邻接状态。

    At the beginning of Figure 14, Router RT1's interface to the
    network becomes operational.  It begins sending Hello Packets,
    although it doesn't know the identity of the Designated Router
    or of any other neighboring routers.  Router RT2 hears this
    hello (moving the neighbor to Init state), and in its next Hello
    Packet indicates that it is itself the Designated Router and
    that it has heard Hello Packets from RT1.  This in turn causes
    RT1 to go to state ExStart, as it starts to bring up the
    adjacency.

RT1首先声明自己是主设备。当它看到RT2确实是主(因为RT2的路由器ID更高)时,RT1转换到从属状态并采用其邻居的DD序列号。然后交换DBD包,轮询效果由主设备(RT2)承担,并响应来自从设备(RT1)数据包。当轮询和相关响应都关闭M位时,数据库描述包序列结束。

    RT1 begins by asserting itself as the master.  When it sees that
    RT2 is indeed the master (because of RT2's higher Router ID),
    RT1 transitions to slave state and adopts its neighbor's DD
    sequence number.  Database Description packets are then
    exchanged, with polls coming from the master (RT2) and responses
    from the slave (RT1).  This sequence of Database Description
    Packets ends when both the poll and associated response has the
    M-bit off.

        +---+                                         +---+
        |RT1|                                         |RT2|
        +---+                                         +---+

        Down                                          Down
                        Hello(DR=0,seen=0)
                   ------------------------------>
                     Hello (DR=RT2,seen=RT1,...)      Init
                   <------------------------------
        ExStart        D-D (Seq=x,I,M,Master)
                   ------------------------------>
                       D-D (Seq=y,I,M,Master)         ExStart
                   <------------------------------
        Exchange       D-D (Seq=y,M,Slave)
                   ------------------------------>
                       D-D (Seq=y+1,M,Master)         Exchange
                   <------------------------------
                       D-D (Seq=y+1,M,Slave)
                   ------------------------------>
                                 ...
                                 ...
                                 ...
                       D-D (Seq=y+n, Master)
                   <------------------------------
                       D-D (Seq=y+n, Slave)
         Loading   ------------------------------>
                             LS Request                Full
                   ------------------------------>
                             LS Update
                   <------------------------------
                             LS Request
                   ------------------------------>
                             LS Update
                   <------------------------------

               Figure 14: An adjacency bring-up example

在本例中,假设RT2具有完全最新的数据库。在这种情况下,RT2立即进入Full状态。RT1将在更新其数据库的必要部分后进入Full状态。这是通过发送LSR包和接收LSU包来完成的。请注意,虽然RT1在发送任何LSR包之前一直等待直到(从RT2)接收到一组完整的DBD包,但情况不必如此。RT1可能已经将LSR包的发送与DBD组的接收交织在一起。

    In this example, it is assumed that RT2 has a completely up to
    date database.  In that case, RT2 goes immediately into Full
    state.  RT1 will go into Full state after updating the necessary
    parts of its database.  This is done by sending Link State
    Request Packets, and receiving Link State Update Packets in
    response.  Note that, while RT1 has waited until a complete set
    of Database Description Packets has been received (from RT2)
    before sending any Link State Request Packets, this need not be
    the case.  RT1 could have interleaved the sending of Link State
    Request Packets with the reception of Database Description
    Packets.

11.路由表结构

路由表数据结构包含向其目的地转发IP数据分组所需的所有信息。每个路由表条目描述到特定目的地的最佳路径集合。转发IP数据包时,将找到为该包的IP目的地提供最佳匹配的路由表条目。然后,匹配的路由表条目向分组的目的地提供下一跳。OSPF还提供了默认路由的存在(目的地ID=DefaultDestination,地址掩码=0x00000000)。当默认路由存在时,它会匹配所有IP目的地(尽管任何其他匹配条目都更匹配)。第11.1节进一步描述了查找与IP目的地最匹配的路由表条目。

The routing table data structure contains all the information
necessary to forward an IP data packet toward its destination.  Each
routing table entry describes the collection of best paths to a
particular destination.  When forwarding an IP data packet, the
routing table entry providing the best match for the packet's IP
destination is located.  The matching routing table entry then
provides the next hop towards the packet's destination.  OSPF also
provides for the existence of a default route (Destination ID =
DefaultDestination, Address Mask =  0x00000000).  When the default
route exists, it matches all IP destinations (although any other
matching entry is a better match).  Finding the routing table entry
that best matches an IP destination is further described in Section
11.1.

每个路由器中都有一个路由表。第11.2节和第11.3节描述了两个示例路由表。第16节讨论了路由表的构建。

There is a single routing table in each router.  Two sample routing
tables are described in Sections 11.2 and 11.3.  The building of the
routing table is discussed in Section 16.

--------------------------------------------------------------------[Page 107]

本节的其余部分定义了路由表条目中的字段。第一组字段描述路由表条目的目的地。

The rest of this section defines the fields found in a routing table
entry.  The first set of fields describes the routing table entry's
destination.

目的类型
目标类型为“网络”或“路由器”。转发IP数据流量时,实际上只使用网络条目。路由器路由表条目仅用作路由表构建过程中的中间步骤。

网络是一系列IP地址,IP数据流量可以转发到这些地址。这包括IP网络(A类、B类或C类)、IP子网、IP超网和单个IP主机。默认路由也属于此类别。

保留区域边界路由器和AS边界路由器的路由器条目。区域边界路由器的路由表条目用于计算区域间路由(见第16.2节)和维护配置的虚链路(见第15节)。计算AS外部路由时,使用AS边界路由器的路由表条目(见第16.4节)。

Destination Type
    Destination type is either "network" or "router". Only network
    entries are actually used when forwarding IP data traffic.
    Router routing table entries are used solely as intermediate
    steps in the routing table build process.

    A network is a range of IP addresses, to which IP data traffic
    may be forwarded.  This includes IP networks (class A, B, or C),
    IP subnets, IP supernets and single IP hosts.  The default route
    also falls into this category.

    Router entries are kept for area border routers and AS boundary
    routers.  Routing table entries for area border routers are used
    when calculating the inter-area routes (see Section 16.2), and
    when maintaining configured virtual links (see Section 15).
    Routing table entries for AS boundary routers are used when
    calculating the AS external routes (see Section 16.4).

目的ID
目的地的标识符或名称。这取决于目的地类型。对于网络,标识符是其关联的IP地址。对于路由器,标识符是OSPF路由器ID。[9]

Destination ID
    The destination's identifier or name.  This depends on the
    Destination Type.  For networks, the identifier is their
    associated IP address.  For routers, the identifier is the OSPF
    Router ID.[9]

地址掩码
仅为网络定义。网络的IP地址及其地址掩码定义了一系列IP地址。对于IP子网,地址掩码称为子网掩码。对于主机路由,掩码为“all ones”(0xffffffff)。

Address Mask
    Only defined for networks.  The network's IP address together
    with its address mask defines a range of IP addresses.  For IP
    subnets, the address mask is referred to as the subnet mask.
    For host routes, the mask is "all ones" (0xffffffff).

可选能力
当目标是路由器时,此字段表示目标路由器支持的可选OSPF功能。本规范定义的唯一可选功能是处理AS-external-LSAs。有关OSPF可选功能的进一步讨论,请参见第4.5节。

用于目的地的路径集可以根据路径所属的OSPF区域而变化。这意味着,根据下一个字段的值,同一目的地可能有多个路由表条目。

Optional Capabilities
    When the destination is a router this field indicates the
    optional OSPF capabilities supported by the destination router.
    The only optional capability defined by this specification is
    the ability to process AS-external-LSAs.  For a further
    discussion of OSPF's optional capabilities, see Section 4.5.

--------------------------------------------------------------------[Page 107]

The set of paths to use for a destination may vary based on the OSPF
area to which the paths belong.  This means that there may be
multiple routing table entries for the same destination, depending
on the values of the next field.

区域
该字段指示其链路状态信息导致路由表条目的路径集合的区域。这被称为条目的关联区域。对于AS外部路径集,未定义此字段。对于“路由器”类型的目的地,可能存在与多个区域中的每一个相关联的单独路径集(因此也有单独的路由表条目)。例如,当两个区域边界路由器共用多个区域时,就会发生这种情况。对于“网络”类型的目的地,仅保留与最佳区域(提供首选路线的区域)关联的路径集。

Area
    This field indicates the area whose link state information has
    led to the routing table entry's collection of paths.  This is
    called the entry's associated area.  For sets of AS external
    paths, this field is not defined.  For destinations of type
    "router", there may be separate sets of paths (and therefore
    separate routing table entries) associated with each of several
    areas. For example, this will happen when two area border
    routers share multiple areas in common.  For destinations of
    type "network", only the set of paths associated with the best
    area (the one providing the preferred route) is kept.

路由表条目的其余部分描述了到目标的路径集。以下字段与整个路径集有关。换句话说,路由表条目中包含的每个路径都具有相同的路径类型和成本(见下文)。

The rest of the routing table entry describes the set of paths to
the destination.  The following fields pertain to the set of paths
as a whole.  In other words, each one of the paths contained in a
routing table entry is of the same path-type and cost (see below).

路径类型
有四种可能的路径类型用于将流量路由到目的地,按优先顺序依次列出:区域内、区域间、类型1外部或类型2外部。区域内路径表示属于路由器连接区域之一的目的地。区域间路径是指向其他OSPF区域中目的地的路径。这些是通过检查收到的summary-LSAs发现的。AS外部路径是到AS外部目的地的路径。这些是通过检查接收到的AS-external-LSAs来检测的。

Path-type
    There are four possible types of paths used to route traffic to
    the destination, listed here in decreasing order of preference:
    intra-area, inter-area, type 1 external or type 2 external.
    Intra-area paths indicate destinations belonging to one of the
    router's attached areas.  Inter-area paths are paths to
    destinations in other OSPF areas.  These are discovered through
    the examination of received summary-LSAs.  AS external paths are
    paths to destinations external to the AS.  These are detected
    through the examination of received AS-external-LSAs.

开销
到目标的路径的链接状态开销。对于除类型2外部路径以外的所有路径,这描述了整个路径的开销。对于类型2外部路径,此字段描述AS内部路径部分的开销。该开销计算为路径组成链路的开销之和。

Cost
    The link state cost of the path to the destination.  For all
    paths except type 2 external paths this describes the entire
    path's cost.  For Type 2 external paths, this field describes
    the cost of the portion of the path internal to the AS.  This
    cost is calculated as the sum of the costs of the path's
    constituent links.

类型2开销
仅对类型2外部路径有效。对于这些路径,此字段表示路径外部部分的开销。该开销已由AS边界路由器公布,并且是总路径开销中最重要的部分。例如,无论两个路径的内部组件的成本如何,类型2开销为5的类型2外部路径总是优于类型2开销10的路径。

Type 2 cost
    Only valid for type 2 external paths.  For these paths, this
    field indicates the cost of the path's external portion.  This
    cost has been advertised by an AS boundary router, and is the
    most significant part of the total path cost.  For example, a
    type 2 external path with type 2 cost of 5 is always preferred
    over a path with type 2 cost of 10, regardless of the cost of
    the two paths' internal components.

链路状态起源
仅对区域内路径有效,此字段表示直接引用目标的LSA(router-LSA或network-LSA)。例如,如果目的地是transit网络,则这是transit网络的network-LSA。如果目标是末节网络,则这是所连接路由器的router-LSA。LSA是在最短路径树计算过程中发现的(见第16.1节)。多个LSA可以引用目的地,但是平局打破方案总是选择减少到单个LSA。OSPF协议不使用Link State Origin字段,但OSPF的多播路由扩展(MOSPF)中的路由表计算使用该字段。

Link State Origin
    Valid only for intra-area paths, this field indicates the LSA
    (router-LSA or network-LSA) that directly references the
    destination.  For example, if the destination is a transit
    network, this is the transit network's network-LSA.  If the
    destination is a stub network, this is the router-LSA for the
    attached router.  The LSA is discovered during the shortest-path
    tree calculation (see Section 16.1).  Multiple LSAs may
    reference the destination, however a tie-breaking scheme always
    reduces the choice to a single LSA. The Link State Origin field
    is not used by the OSPF protocol, but it is used by the routing
    table calculation in OSPF's Multicast routing extensions
    (MOSPF).

当一个目的地存在多条路径类型和开销相等的路径(在别处称为“相等开销”路径)时,它们存储在一个路由表条目中。每个“相等开销”路径都由以下字段区分

下一跳
将流量转发到目标时要使用的传出路由器接口。在广播、点对多点和NBMA网络中,下一跳还包括通往目的地的路径中的下一个路由器(如果有)的IP地址

通告路由器
仅对区域间和AS外部路径有效。此字段表示通告summary-LSA路由器的Router ID或通向AS-external-LSA路径的路由器的Router ID

When multiple paths of equal path-type and cost exist to a
destination (called elsewhere "equal-cost" paths), they are stored
in a single routing table entry.  Each one of the "equal-cost" paths
is distinguished by the following fields:

Next hop
    The outgoing router interface to use when forwarding traffic to
    the destination.  On broadcast, Point-to-MultiPoint and NBMA
    networks, the next hop also includes the IP address of the next
    router (if any) in the path towards the destination.

Advertising router
    Valid only for inter-area and AS external paths.  This field
    indicates the Router ID of the router advertising the summary-
    LSA or AS-external-LSA that led to this path.

--------------------------------------------------------------------[Page 110]

11.1.路由表loopup

当接收到IP数据包时,OSPF路由器会找到与包的目的地最匹配的路由表条目。然后,该路由表条目提供用于转发数据包的传出接口和下一跳路由器。本节描述查找最佳匹配路由表条目的过程。

    When an IP data packet is received, an OSPF router finds the
    routing table entry that best matches the packet's destination.
    This routing table entry then provides the outgoing interface
    and next hop router to use in forwarding the packet. This
    section describes the process of finding the best matching
    routing table entry.

在查找开始之前,应将“丢弃”路由表条目插入路由器的每个活动区域地址范围的路由表中(参见第3.5节)。(如果区域范围包含一个或多个可通过区域内路径到达的网络,则该区域范围被视为“活动”。)“丢弃”条目的目的地是由其关联的活动区域地址范围描述的地址集,并且每个“丢弃”条目的路径类型被设置为“区域间”。[10]

    Before the lookup begins, "discard" routing table entries should
    be inserted into the routing table for each of the router's
    active area address ranges (see Section 3.5).  (An area range is
    considered "active" if the range contains one or more networks
    reachable by intra-area paths.) The destination of a "discard"
    entry is the set of addresses described by its associated active
    area address range, and the path type of each "discard" entry is
    set to "inter-area".[10]

有多个路由表条目可能与目标地址匹配。在这种情况下,“最佳匹配”是提供最具体(最长)匹配的路由表条目。另一种说法是选择指定最窄IP地址范围的条目。[11] 例如,(128.185.1.0,0xffffff00)的地址/掩码对的条目比该对的条目(128.155.0.0,0xffff0000)更具体。默认路由是最不特定匹配的路由,因为它匹配所有目的地。(请注意,对于任何一个路由表条目,可能有多条路径。在这些情况下,第16.1、16.2和16.4节中的计算总是产生具有最优先路径类型的路径,如第11节所述)。

    Several routing table entries may match the destination address.
    In this case, the "best match" is the routing table entry that
    provides the most specific (longest) match. Another way of
    saying this is to choose the entry that specifies the narrowest
    range of IP addresses.[11] For example, the entry for the
    address/mask pair of (128.185.1.0, 0xffffff00) is more specific
    than an entry for the pair (128.185.0.0, 0xffff0000). The
    default route is the least specific match, since it matches all
    destinations. (Note that for any single routing table entry,
    multiple paths may be possible. In these cases, the calculations
    in Sections 16.1, 16.2, and 16.4 always yield the paths having
    the most preferential path-type, as described in Section 11).

如果没有匹配的路由表条目,或者最佳匹配路由表条目是上述“丢弃”路由表条目原因之一,则数据包的IP目的地被认为是不可达的。然后应该丢弃数据包,而不是转发数据包,并将ICMP目的地无法到达的消息返回到数据包的源。

    If there is no matching routing table entry, or the best match
    routing table entry is one of the above "discard" routing table
    entries, then the packet's IP destination is considered
    unreachable. Instead of being forwarded, the packet should then
    be discarded and an ICMP destination unreachable message should
    be returned to the packet's source.

11.2.不跨区域的路由表样例

考虑Figure 2所示的自治系统。未配置OSPF区域。每个出接口显示一个metric。路由器RT6路由表的计算如第2.2节所述进行。生成的路由表如Table 12所示。目的地类型缩写为:网络为“N”,路由器为“R”。

    Consider the Autonomous System pictured in Figure 2.  No OSPF
    areas have been configured.  A single metric is shown per
    outbound interface.  The calculation of Router RT6's routing
    table proceeds as described in Section 2.2.  The resulting
    routing table is shown in Table 12.  Destination types are
    abbreviated: Network as "N", Router as "R".

本例中没有多个相等开销最短路径的实例。此外,由于没有区域,因此没有区域间路径。

    There are no instances of multiple equal-cost shortest paths in
    this example.  Also, since there are no areas, there are no
    inter-area paths.

路由器RT5和RT7是AS边界路由器。已计算到路由器RT5和RT7的区域内路由。这允许计算到RT5和RT7通告的目的地(即网络N12、N13、N14和N15)的外部路由。假设由RT5和RT7发起的所有AS-external-LSAs都是类型1外部开销。这导致计算到目的地N12-N15的类型1外部路径。

    Routers RT5 and RT7 are AS boundary routers.  Intra-area routes
    have been calculated to Routers RT5 and RT7.  This allows
    external routes to be calculated to the destinations advertised
    by RT5 and RT7 (i.e., Networks N12, N13, N14 and N15).  It is
    assumed all AS-external-LSAs originated by RT5 and RT7 are
    advertising type 1 external metrics.  This results in type 1
    external paths being calculated to destinations N12-N15.

11.3.跨区域的路由表样例

考虑上一个示例,这一次拆分为OSPF区域。OSPF区域配置如Figure 6所示。路由器RT4的路由表将针对该区域配置进行描述。路由器RT4具有到area1的连接和骨干连接。这导致路由器RT4将AS视为Figures 7和8中所示的两个图的级联。生成的路由表如表13所示。

    Consider the previous example, this time split into OSPF areas.
    An OSPF area configuration is pictured in Figure 6.  Router
    RT4's routing table will be described for this area
    configuration.  Router RT4 has a connection to Area 1 and a
    backbone connection.  This causes Router RT4 to view the AS as
    the concatenation of the two graphs shown in Figures 7 and 8.
    The resulting routing table is displayed in Table 13.

同样,路由器RT5和RT7是AS边界路由器。路由器RT3、RT4、RT7、RT10和RT11是区域边界路由器。请注意,区域边界路由器RT3有两个路由条目,因为它有两个与RT4相同的区域(区域1和骨干)。

    Again, Routers RT5 and RT7 are AS boundary routers.  Routers
    RT3, RT4, RT7, RT10 and RT11 are area border routers.  Note that
    there are two routing entries for the area border router RT3,
    since it has two areas in common with RT4 (Area 1 and the
    backbone).

已计算到所有区域边界路由器的骨干路径。确定区域间路由时使用这些参数。请注意,所有区域间路由都与骨干区域相关联;当计算路由器本身是区域边界路由器时,情况总是如此。路由信息集中在区域边界。在这个例子中,我们假设已经定义了area3,使得网络N9-N11和到H1的主机路由在通告到骨干区域(由路由器RT11)时都被压缩为单个路由。请注意,此路线的开销是其单个组件的成本集合的最大值。

    Backbone paths have been calculated to all area border routers.
    These are used when determining the inter-area routes.  Note
    that all of the inter-area routes are associated with the
    backbone; this is always the case when the calculating router is
    itself an area border router.  Routing information is condensed
    at area boundaries.  In this example, we assume that Area 3 has
    been defined so that networks N9-N11 and the host route to H1
    are all condensed to a single route when advertised into the
    backbone (by Router RT11).  Note that the cost of this route is
    the maximum of the set of costs to its individual components.

  Type   Dest   Area   Path  Type    Cost   Next     Adv.
                                            Hop(s)   Router(s)
  ____________________________________________________________
  N      N1     0      intra-area    10     RT3      *
  N      N2     0      intra-area    10     RT3      *
  N      N3     0      intra-area    7      RT3      *
  N      N4     0      intra-area    8      RT3      *
  N      Ib     0      intra-area    7      *        *
  N      Ia     0      intra-area    12     RT10     *
  N      N6     0      intra-area    8      RT10     *
  N      N7     0      intra-area    12     RT10     *
  N      N8     0      intra-area    10     RT10     *
  N      N9     0      intra-area    11     RT10     *
  N      N10    0      intra-area    13     RT10     *
  N      N11    0      intra-area    14     RT10     *
  N      H1     0      intra-area    21     RT10     *
  R      RT5    0      intra-area    6      RT5      *
  R      RT7    0      intra-area    8      RT10     *
  ____________________________________________________________
  N      N12    *      type 1 ext.   10     RT10     RT7
  N      N13    *      type 1 ext.   14     RT5      RT5
  N      N14    *      type 1 ext.   14     RT5      RT5
  N      N15    *      type 1 ext.   17     RT10     RT7


           Table 12: The routing table for Router RT6
                     (no configured areas).

路由器RT10和RT11之间配置了一条虚链路。如果没有这条配置的虚链路,RT11将无法将网络N9-N11和主机H1的路由通告到骨干区域,路由器RT4的路由表中也不会有这些网络的条目。
在本例中,网络N12有两条成本相等的路径。然而,它们都使用相同的下一跳(路由器RT5)。

    There is a virtual link configured between Routers RT10 and
    RT11.  Without this configured virtual link, RT11 would be
    unable to advertise a route for networks N9-N11 and Host H1 into
    the backbone, and there would not be an entry for these networks
    in Router RT4's routing table.

    In this example there are two equal-cost paths to Network N12.
    However, they both use the same next hop (Router RT5).

--------------------------------------------------------------------[Page 113]

如果在路由器RT4和路由器RT3之间配置了额外的虚拟链路,路由器RT4的路由表将得到改善(即,路由表中的一些路径将变得更短)。新的虚链路本身将与Table 13中区域边界路由器RT3的第一个条目相关联(通过area1的区域内路径)。这将产生虚链路开销1。添加此虚拟链路将导致路由表条目更改,如Table 14所示。

    Router RT4's routing table would improve (i.e., some of the
    paths in the routing table would become shorter) if an
    additional virtual link were configured between Router RT4 and
    Router RT3.  The new virtual link would itself be associated
    with the first entry for area border router RT3 in Table 13 (an
    intra-area path through Area 1).  This would yield a cost of 1
    for the virtual link.  The routing table entries changes that
    would be caused by the addition of this virtual link are shown in Table 14.

Type Dest Area Path Type Cost Next Adv.
Hops(s) Router(s)


N N1 1 intra-area 4 RT1 *
N N2 1 intra-area 4 RT2 *
N N3 1 intra-area 1 * *
N N4 1 intra-area 3 RT3 *
R RT3 1 intra-area 1 * *


N Ib 0 intra-area 22 RT5 *
N Ia 0 intra-area 27 RT5 *
R RT3 0 intra-area 21 RT5 *
R RT5 0 intra-area 8 * *
R RT7 0 intra-area 14 RT5 *
R RT10 0 intra-area 22 RT5 *
R RT11 0 intra-area 25 RT5 *


N N6 0 inter-area 15 RT5 RT7
N N7 0 inter-area 19 RT5 RT7
N N8 0 inter-area 18 RT5 RT7
N N9-N11,H1 0 inter-area 36 RT5 RT11


N N12 * type 1 ext. 16 RT5 RT5,RT7
N N13 * type 1 ext. 16 RT5 RT5
N N14 * type 1 ext. 16 RT5 RT5
N N15 * type 1 ext. 23 RT5 RT7

              Table 13: Router RT4's routing table
                   in the presence of areas.

12.链路状态通告(LSA)

自治系统中的每个路由器发起一个或多个链路状态通告(LSA)。本文档定义了五种不同类型的LSA,描述于第4.3节。LSA集合构成链路状态数据库。每种单独类型的LSA都有单独的功能。Router-LSAs和network-LSAs描述了一个区域的路由器和网络是如何互连的。Summary-LSAs提供了一种压缩区域路由信息的方法。AS-external-LSAs提供了一种在整个自治系统中透明地通告外部派生路由信息的方式。
每个LSA以一个标准的20字节报头开始。下面讨论此LSA头部。

Each router in the Autonomous System originates one or more link
state advertisements (LSAs).  This memo defines five distinct types
of LSAs, which are described in Section 4.3.  The collection of LSAs
forms the link-state database.  Each separate type of LSA has a
separate function.  Router-LSAs and network-LSAs describe how an
area's routers and networks are interconnected.  Summary-LSAs
provide a way of condensing an area's routing information.  AS-
external-LSAs provide a way of transparently advertising
externally-derived routing information throughout the Autonomous
System.

Each LSA begins with a standard 20-byte header.  This LSA header is
discussed below.


Type   Dest        Area   Path  Type   Cost   Next     Adv.
                                              Hop(s)   Router(s)
________________________________________________________________
N      Ib          0      intra-area   16     RT3      *
N      Ia          0      intra-area   21     RT3      *
R      RT3         0      intra-area   1      *        *
R      RT10        0      intra-area   16     RT3      *
R      RT11        0      intra-area   19     RT3      *
________________________________________________________________
N      N9-N11,H1   0      inter-area   30     RT3      RT11


              Table 14: Changes resulting from an
                    additional virtual link.

--------------------------------------------------------------------[Page 115]

12.1.LSA头部

LSA头部包含LS类型、链路状态ID和通告路由器字段。这三个字段的组合唯一地标识LSA。

    The LSA header contains the LS type, Link State ID and
    Advertising Router fields.  The combination of these three
    fields uniquely identifies the LSA.

自治系统中可能同时存在多个LSA实例。然后必须确定哪个实例是最近的。通过检查LS序列、LS校验和和LS age字段来确定。这些字段也包含在20字节的LSA头中。

    There may be several instances of an LSA present in the
    Autonomous System, all at the same time.  It must then be
    determined which instance is more recent.  This determination is
    made by examining the LS sequence, LS checksum and LS age
    fields.  These fields are also contained in the 20-byte LSA
    header.

几种OSPF数据包类型列出了LSA。当实例不重要时,LSA通过其LS类型、链路状态ID和通告路由器来引用(请参见LSR包)。否则,还必须引用LS序列号、LS年龄和LS校验和字段。

    Several of the OSPF packet types list LSAs.  When the instance
    is not important, an LSA is referred to by its LS type, Link
    State ID and Advertising Router (see Link State Request
    Packets).  Otherwise, the LS sequence number, LS age and LS
    checksum fields must also be referenced.

下面将详细解释LSA标头中包含的字段。

    A detailed explanation of the fields contained in the LSA header
    follows.

12.1.1.LS age

此字段是LSA的age(秒)。应将其处理为无符号16位整数。当发起LSA时,它被设置为0。在洪泛过程的每一跳,它必须递增InfTransDelay。LSA在每个路由器的数据库中保存时也会老化。
This field is the age of the LSA in seconds. It should be
processed as an unsigned 16-bit integer. It is set to 0
when the LSA is originated. It must be incremented by
InfTransDelay on every hop of the flooding procedure. LSAs
are also aged as they are held in each router’s database.

LSA的age永远不会超过MaxAge。路由表计算中不使用具有最大年龄的LSA。当LSA的年龄首次达到MaxAge时,它将重新启动。当不再需要MaxAge的LSA来确保数据库同步时,它最终会从数据库中清除。有关LSA老化的更多信息,请参阅第14节。

        The age of an LSA is never incremented past MaxAge.  LSAs
        having age MaxAge are not used in the routing table
        calculation.  When an LSA's age first reaches MaxAge, it is
        reflooded.  An LSA of age MaxAge is finally flushed from the
        database when it is no longer needed to ensure database
        synchronization.  For more information on the aging of LSAs,
        consult Section 14.

当路由器接收到两个LSA实例时,检查LS年龄字段,这两个实例都具有相同的LS序列号和LS校验和。然后,年龄为MaxAge的实例总是被接受为最新的;这允许从路由域快速清除旧LSA。否则,如果年龄相差大于MaxAgeDiff,则年龄较小的实例被接受为最近的实例。[12]详见第13.1节。

        The LS age field is examined when a router receives two
        instances of an LSA, both having identical LS sequence
        numbers and LS checksums.  An instance of age MaxAge is then
        always accepted as most recent; this allows old LSAs to be
        flushed quickly from the routing domain.  Otherwise, if the
        ages differ by more than MaxAgeDiff, the instance having the
        smaller age is accepted as most recent.[12] See Section 13.1
        for more details.

12.1.2.选项

LSA标头中的Options字段指示哪些可选功能与LSA关联。OSPF的可选功能见第4.5节。本规范定义了一种可选功能,由Options字段中的E位表示。选项字段中无法识别的位应设置为零。

E位表示OSPF的外部路由能力。该位应设置在与骨干区域相关的所有LSA中,以及与非末节区域相关的所有LS中(参见第3.6节)。还应在所有AS-external-LSAs中设置。它应该在所有与末节区域相关的router-LSAs, network-LSAs和summary-LSAs中重置。对于所有LSA,E位的设置仅供参考;它不影响路由表计算。

        The Options field in the LSA header indicates which optional
        capabilities are associated with the LSA.  OSPF's optional
        capabilities are described in Section 4.5.  One optional
        capability is defined by this specification, represented by
        the E-bit found in the Options field.  The unrecognized bits
        in the Options field should be set to zero.

        The E-bit represents OSPF's ExternalRoutingCapability.  This
        bit should be set in all LSAs associated with the backbone,
        and all LSAs associated with non-stub areas (see Section
        3.6).  It should also be set in all AS-external-LSAs.  It
        should be reset in all router-LSAs, network-LSAs and
        summary-LSAs associated with a stub area.  For all LSAs, the
        setting of the E-bit is for informational purposes only; it
        does not affect the routing table calculation.

12.1.3.LS类型

LS类型字段规定LSA的格式和功能。不同类型的LSA具有不同的名称(例如router-LSAs或network-LSAs)。本文档定义的所有LSA类型,除AS-external-LSAs(LS类型=5)外,仅在单个区域内泛洪。由于AS-external-LSAs在整个自治系统中泛洪,除了末节区域(见第3.6节)。每个单独的LSA类型在下面的Table 15中进行了简要描述。

        The LS type field dictates the format and function of the
        LSA.  LSAs of different types have different names (e.g.,
        router-LSAs or network-LSAs).  All LSA types defined by this
        memo, except the AS-external-LSAs (LS type = 5), are flooded
        throughout a single area only.  AS-external-LSAs are flooded
        throughout the entire Autonomous System, excepting stub
        areas (see Section 3.6).  Each separate LSA type is briefly
        described below in Table 15.

12.1.4.链路状态ID

此字段标识LSA正在描述的路由域的一部分。根据LSA的LS类型,链路状态ID采用Table 16中列出的值

        This field identifies the piece of the routing domain that
        is being described by the LSA.  Depending on the LSA's LS
        type, the Link State ID takes on the values listed in Table 16

--------------------------------------------------------------------[Page 117]

        LS Type   LSA description
        ________________________________________________
        1         These are the router-LSAs.
                  They describe the collected
                   states of the router's
                  interfaces. For more information,
                  consult Section 12.4.1.
        ________________________________________________
        2         These are the network-LSAs.
                  They describe the set of routers
                  attached to the network. For
                  more information, consult
                  Section 12.4.2.
        ________________________________________________
        3 or 4    These are the summary-LSAs.
                  They describe inter-area routes,
                  and enable the condensation of
                  routing information at area
                  borders. Originated by area border
                  routers, the Type 3 summary-LSAs
                  describe routes to networks while the
                  Type 4 summary-LSAs describe routes to
                  AS boundary routers.
        ________________________________________________
        5         These are the AS-external-LSAs.
                  Originated by AS boundary routers,
                  they describe routes
                  to destinations external to the
                  Autonomous System. A default route for
                  the Autonomous System can also be
                  described by an AS-external-LSA.

        Table 15: OSPF link state advertisements (LSAs).

实际上,对于类型3summary-LSAs(LS类型=3)和AS-external-LSAs(LS类型=5),链路状态ID还可以设置一个或多个目标网络的“主机”位。例如,当为网络10.0.0.0发起掩码为255.0.0.0的AS-external-LSAs时,链路状态ID可以设置为10.0.0.0到10.255.255.255(包括10.0.0.0和10.255.255)范围内的任何值(尽管应尽可能使用10.0.0.0)。设置特定主机位的自由允许路由器为具有相同地址但不同掩码的两个网络发起单独的LSA。详见附录E。

        Actually, for Type 3 summary-LSAs (LS type = 3) and AS-
        external-LSAs (LS type = 5), the Link State ID may
        additionally have one or more of the destination network's
        "host" bits set. For example, when originating an AS-
        external-LSA for the network 10.0.0.0 with mask of
        255.0.0.0, the Link State ID can be set to anything in the
        range 10.0.0.0 through 10.255.255.255 inclusive (although
        10.0.0.0 should be used whenever possible). The freedom to
        set certain host bits allows a router to originate separate
        LSAs for two networks having the same address but different
        masks. See Appendix E for details.

当LSA描述网络(LS类型=2、3或5)时,通过使用LSA中包含的网络/子网掩码匹配链路状态ID,可以轻松导出网络的IP地址。当LSA描述路由器(LS类型=1或4)时,链路状态ID始终是描述的路由器的OSPF路由器ID。

        When the LSA is describing a network (LS type = 2, 3 or 5),
        the network's IP address is easily derived by masking the
        Link State ID with the network/subnet mask contained in the
        body of the LSA.  When the LSA is describing a router (LS
        type = 1 or 4), the Link State ID is always the described
        router's OSPF Router ID.

当AS-external-LSA(LS类型=5)描述默认路由时,其链路状态ID设置为DefaultDestination(0.0.0.0)。

        When an AS-external-LSA (LS Type = 5) is describing a
        default route, its Link State ID is set to
        DefaultDestination (0.0.0.0).

        LS Type   Link State ID
        _______________________________________________
        1         The originating router's Router ID.
        2         The IP interface address of the
                  network's Designated Router.
        3         The destination network's IP address.
        4         The Router ID of the described AS
                  boundary router.
        5         The destination network's IP address.


               Table 16: The LSA's Link State ID.

12.1.5.通告路由器

此字段指定LSA发起方的OSPF路由器ID。对于router-LSAs,此字段与链路状态ID字段相同。Network-LSAs由网络的指定路由器发起。由区域边界路由器发起的Summary-LSAs。AS-external-LSAs由AS边界路由器发起。

        This field specifies the OSPF Router ID of the LSA's
        originator.  For router-LSAs, this field is identical to the
        Link State ID field.  Network-LSAs are originated by the
        network's Designated Router.  Summary-LSAs originated by
        area border routers.  AS-external-LSAs are originated by AS
        boundary routers.

12.1.6.LS序列号

序列号字段是有符号的32位整数。它用于检测旧的和重复的LSA。序列号的空间是线性有序的。序列号越大(与有符号32位整数相比),LSA越新。为了更精确地描述序列号空间,让N在下面的讨论中表示常数2^31。

        The sequence number field is a signed 32-bit integer.  It is
        used to detect old and duplicate LSAs.  The space of
        sequence numbers is linearly ordered.  The larger the
        sequence number (when compared as signed 32-bit integers)
        the more recent the LSA.  To describe to sequence number
        space more precisely, let N refer in the discussion below to
        the constant 2**31.

序列号-N(0x80000000)已保留(且未使用)。这使得-N+1(0x8000001)成为最小(因此也是最古老的)序列号;该序列号被称为常数InitialSequenceNumber。路由器在第一次发起任何LSA时使用InitialSequenceNumber。之后,每次路由器发起LSA的新实例时,LSA的序列号都会递增。当尝试将序列号递增超过最大值N-1(0x7fffffff;也称为MaxSequenceNumber)时,必须首先从路由域中清除LSA的当前实例。这是通过提前老化LSA(参见第14.1节)并重新启动它来完成的。一旦所有邻接邻居都确认了该泛洪,就可以使用序列号InitialSequenceNumber发起一个新实例。

        The sequence number -N (0x80000000) is reserved (and
        unused).  This leaves -N + 1 (0x80000001) as the smallest
        (and therefore oldest) sequence number; this sequence number
        is referred to as the constant InitialSequenceNumber. A
        router uses InitialSequenceNumber the first time it
        originates any LSA.  Afterwards, the LSA's sequence number
        is incremented each time the router originates a new
        instance of the LSA.  When an attempt is made to increment
        the sequence number past the maximum value of N - 1
        (0x7fffffff; also referred to as MaxSequenceNumber), the
        current instance of the LSA must first be flushed from the
        routing domain.  This is done by prematurely aging the LSA
        (see Section 14.1) and reflooding it.  As soon as this flood
        has been acknowledged by all adjacent neighbors, a new
        instance can be originated with sequence number of
        InitialSequenceNumber.

当在洪泛过程中意外接收到LSA的较新实例时,路由器可能被迫提升其LSA之一的序列号。这应该是一个罕见的事件。这可能表明自主系统中仍然存在由路由器自身在上次重启/重新加载之前发起的过期LSA。有关更多信息,请参见第13.4节。

        The router may be forced to promote the sequence number of
        one of its LSAs when a more recent instance of the LSA is
        unexpectedly received during the flooding process.  This
        should be a rare event.  This may indicate that an out-of-
        date LSA, originated by the router itself before its last
        restart/reload, still exists in the Autonomous System.  For
        more information see Section 13.4.

--------------------------------------------------------------------[Page 117]

12.1.7.LS校验和

该字段是除LS年龄字段外LSA完整内容的校验和。LS年龄字段是例外,因为这样LSA的年龄可以在不更新校验和的情况下递增。使用的校验和与ISO无连接数据报相同;它通常被称为Fletcher校验和。其记录在[参考文献6]的附录B中。LSA头部还包含以字节为单位的LSA长度;减去LS年龄字段的大小(两个字节)得到要校验和的数据量。

        This field is the checksum of the complete contents of the
        LSA, excepting the LS age field.  The LS age field is
        excepted so that an LSA's age can be incremented without
        updating the checksum.  The checksum used is the same that
        is used for ISO connectionless datagrams; it is commonly
        referred to as the Fletcher checksum.  It is documented in
        Annex B of [Ref6].  The LSA header also contains the length
        of the LSA in bytes; subtracting the size of the LS age
        field (two bytes) yields the amount of data to checksum.

校验和用于检测LSA的数据损坏。当LSA被泛洪或被保存在路由器的内存中时,可能会发生这种损坏。LS校验和字段不能取零值;这种值的出现应被视为校验和失败。换句话说,校验和的计算不是可选的。

        The checksum is used to detect data corruption of an LSA.
        This corruption can occur while an LSA is being flooded, or
        while it is being held in a router's memory.  The LS
        checksum field cannot take on the value of zero; the
        occurrence of such a value should be considered a checksum
        failure.  In other words, calculation of the checksum is not
        optional.

LSA的校验和在两种情况下被验证:a)当接收到LSU包时,以及b)在链路状态数据库老化期间的某些时候。在每种情况下,检测校验和故障会导致单独的操作。详见第13节和第14节。

        The checksum of an LSA is verified in two cases:  a) when it
        is received in a Link State Update Packet and b) at times
        during the aging of the link state database.  The detection
        of a checksum failure leads to separate actions in each
        case.  See Sections 13 and 14 for more details.

每当LS序列号字段指示LSA的两个实例相同时,都会检查LS校验和字段。如果存在差异,则具有较大LS校验和的实例被认为是最新的。[13]详见第13.1节。

        Whenever the LS sequence number field indicates that two
        instances of an LSA are the same, the LS checksum field is
        examined.  If there is a difference, the instance with the
        larger LS checksum is considered to be most recent.[13] See
        Section 13.1 for more details.

12.2.链路状态数据库

路由器对于其所属的每个区域都有一个单独的链路状态数据库。属于同一区域的所有路由器都具有该区域的相同链路状态数据库。

    A router has a separate link state database for every area to
    which it belongs. All routers belonging to the same area have
    identical link state databases for the area.

每个单独区域的数据库始终单独处理。对每个区域分别进行最短路径计算(见第16节)。区域链接状态数据库的组件仅在整个区域中泛滥。最后,当邻接(属于区域A)被启动时,只有区域A的数据库在两个路由器之间同步。

    The databases for each individual area are always dealt with
    separately.  The shortest path calculation is performed
    separately for each area (see Section 16).  Components of the
    area link-state database are flooded throughout the area only.
    Finally, when an adjacency (belonging to Area A) is being
    brought up, only the database for Area A is synchronized between
    the two routers.

区域数据库由路由器router-LSAs、network-LSAs和summary-LSAs(均列在区域数据结构中)组成。此外,外部路由(AS-external-LSAs)包含在所有非末节区数据库中(见第3.6节)。

    The area database is composed of router-LSAs, network-LSAs and
    summary-LSAs (all listed in the area data structure).  In
    addition, external routes (AS-external-LSAs) are included in all
    non-stub area databases (see Section 3.6).

OSPF的实现必须能够访问区域数据库的各个部分。此查找功能基于LSA的LS类型、链路状态ID和通告路由器。[14] 数据库中每个LSA都有一个实例(最新的)。在LSA洪泛过程(第13节)和路由表计算(第16节)期间调用数据库查找功能。此外,使用此查找功能,路由器可以确定它自己是否曾经发起过特定的LSA,如果是,则使用什么LS序列号。

    An implementation of OSPF must be able to access individual
    pieces of an area database.  This lookup function is based on an
    LSA's LS type, Link State ID and Advertising Router.[14] There
    will be a single instance (the most up-to-date) of each LSA in
    the database.  The database lookup function is invoked during
    the LSA flooding procedure (Section 13) and the routing table
    calculation (Section 16).  In addition, using this lookup
    function the router can determine whether it has itself ever
    originated a particular LSA, and if so, with what LS sequence
    number.

当a)在洪泛过程中接收到LSA(第13节)或b)它由路由器自身发起(第12.4节)时,LSA被添加到路由器的数据库中。当a)LSA在洪泛过程中被较新实例覆盖(第13节)或b)路由器发起其自身发起的LSA之一的较新实例(第12.4节)或c)LSA老化并从路由域中清除(第14节)时,从路由器的数据库中删除LSA。每当从数据库中删除LSA时,它也必须从所有邻居的链路状态重传列表中删除(参见第10节)。

    An LSA is added to a router's database when either a) it is
    received during the flooding process (Section 13) or b) it is
    originated by the router itself (Section 12.4).  An LSA is
    deleted from a router's database when either a) it has been
    overwritten by a newer instance during the flooding process
    (Section 13) or b) the router originates a newer instance of one
    of its self-originated LSAs (Section 12.4) or c) the LSA ages
    out and is flushed from the routing domain (Section 14).
    Whenever an LSA is deleted from the database it must also be
    removed from all neighbors' Link state retransmission lists (see
    Section 10).

12.3.TOS代表

为了向后兼容OSPF规范的先前版本([Ref9]),TOS特定信息可以包含在router-LSAs、summary-LSAs和AS-external-LSAs中。OSPF LSA中TOS的编码如Table 17所示。该表将OSPF编码与IP分组报头的TOS字段(在[Ref12]中定义)相关联。OSPF编码表示为十进制整数,IP分组报头的TOS字段表示为[Ref12]中使用的二进制TOS值。

    For backward compatibility with previous versions of the OSPF
    specification ([Ref9]), TOS-specific information can be included
    in router-LSAs, summary-LSAs and AS-external-LSAs.  The encoding
    of TOS in OSPF LSAs is specified in Table 17. That table relates
    the OSPF encoding to the IP packet header's TOS field (defined
    in [Ref12]).  The OSPF encoding is expressed as a decimal
    integer, and the IP packet header's TOS field is expressed in
    the binary TOS values used in [Ref12].

                OSPF encoding   RFC 1349 TOS values
                ___________________________________________
                0               0000 normal service
                2               0001 minimize monetary cost
                4               0010 maximize reliability
                6               0011
                8               0100 maximize throughput
                10              0101
                12              0110
                14              0111
                16              1000 minimize delay
                18              1001
                20              1010
                22              1011
                24              1100
                26              1101
                28              1110
                30              1111

                    Table 17: Representing TOS in OSPF.

12.4.LSAs的起源

12.4.LSAs的起源
在任何给定的OSPF区域中,路由器将发起多个LSA。每个路由器发起一个router-LSA。如果路由器也是该区域任何网络的指定路由器,它将为这些网络发起network-LSAs。

    Into any given OSPF area, a router will originate several LSAs.
    Each router originates a router-LSA.  If the router is also the
    Designated Router for any of the area's networks, it will
    originate network-LSAs for those networks.

区域边界路由器为每个已知的区域间目的地发起单个summary-LSA。AS边界路由器为每个已知AS外部目的地发起单个AS-external-LSA。目的地一次发布一个,这样任何一条路线中的更改都可以被泛洪,而不会导致整个路由条目更改。在洪泛过程中,单个LSU包可以携带许多LSA。

    Area border routers originate a single summary-LSA for each
    known inter-area destination.  AS boundary routers originate a
    single AS-external-LSA for each known AS external destination.
    Destinations are advertised one at a time so that the change in
    any single route can be flooded without reflooding the entire
    collection of routes.  During the flooding procedure, many LSAs
    can be carried by a single Link State Update packet.

--------------------------------------------------------------------[Page 117]

例如,考虑Figure 6中的路由器RT4。它是一个区域边界路由器,与area1和骨干区域连接。路由器RT4向骨干区域发起5个不同的LSA(一个router-LSA,以及每个网络N1-N4的一个summary-LSA)。路由器RT4还将向区域1发起8个不同的LSA(如Figure 7所示,一个router-LSA和七个summary-LSAs)。如果RT4已被选择为网络N3的指定路由器,则它还将向区域1发起N3的network-LSA。

    As an example, consider Router RT4 in Figure 6.  It is an area
    border router, having a connection to Area 1 and the backbone.
    Router RT4 originates 5 distinct LSAs into the backbone (one
    router-LSA, and one summary-LSA for each of the networks N1-N4).
    Router RT4 will also originate 8 distinct LSAs into Area 1 (one
    router-LSA and seven summary-LSAs as pictured in Figure 7).  If
    RT4 has been selected as Designated Router for Network N3, it
    will also originate a network-LSA for N3 into Area 1.

在同一图中,路由器RT5将发起3个不同的AS-external-LSAs(每个N12-N14网络一个)。假设没有一个区域被配置为末节区域,这些LSA将在整个AS中泛洪。然而,如果区域3被配置为末节区域,则网络N12-N14的AS-external-LSAs不会泛洪到area3中(参见第3.6节)。相反,路由器RT11将发起一个默认summary-LSA,该summary-LSA将在整个area3中被泛洪(参见第12.4.3节)。这指示区域3的所有内部路由器将其AS外部流量发送到RT11。

    In this same figure, Router RT5 will be originating 3 distinct
    AS-external-LSAs (one for each of the networks N12-N14).  These
    will be flooded throughout the entire AS, assuming that none of
    the areas have been configured as stubs.  However, if area 3 has
    been configured as a stub area, the AS-external-LSAs for
    networks N12-N14 will not be flooded into area 3 (see Section
    3.6).  Instead, Router RT11 would originate a default summary-
    LSA that would be flooded throughout area 3 (see Section
    12.4.3).  This instructs all of area 3's internal routers to
    send their AS external traffic to RT11.

每当发起LSA的新实例时,其LS序列号递增,其LS年龄设置为0,计算其LS校验和,并将LSA添加到链路状态数据库中,并在适当的接口泛洪。有关将LSA安装到LSDB的详细信息,请参见第13.2节。关于新产生的LSA的泛洪详情,请参见第13.3节。

    Whenever a new instance of an LSA is originated, its LS sequence
    number is incremented, its LS age is set to 0, its LS checksum
    is calculated, and the LSA is added to the link state database
    and flooded out the appropriate interfaces.  See Section 13.2
    for details concerning the installation of the LSA into the link
    state database.  See Section 13.3 for details concerning the
    flooding of newly originated LSAs.

可能导致发起LSA新实例的十个事件是:

1@路由器自身发起的LSA之一的LS年龄字段达到值LSRefreshTime。在这种情况下,将发起LSA的新实例,即使LSA的内容(除LSA标头外)相同。这保证了所有LSA的定期发起。LSA的这种周期性更新增加了链路状态算法的稳健性。仅描述不可到达目的地的LSA不应刷新,而应从路由域中刷新(参见第14.1节)。

    The ten events that can cause a new instance of an LSA to be
    originated are:

    (1) The LS age field of one of the router's self-originated LSAs
        reaches the value LSRefreshTime. In this case, a new
        instance of the LSA is originated, even though the contents
        of the LSA (apart from the LSA header) will be the same.
        This guarantees periodic originations of all LSAs.  This
        periodic updating of LSAs adds robustness to the link state
        algorithm.  LSAs that solely describe unreachable
        destinations should not be refreshed, but should instead be
        flushed from the routing domain (see Section 14.1).

--------------------------------------------------------------------[Page 124]

当LSA所描述的内容发生变化时,就会产生一个新的LSA。但是,同一LSA的两个实例可能不会在MinLSInterval时间段内发起。这可能需要将下一个实例的生成延迟至多MinLSInterval。以下事件可能会导致LSA的内容发生变化。如果且仅当新LSA的内容不同时,这些事件应引起新的发起:

2@接口的状态发生变化(参见第9.1节)。这可能意味着需要生成router-LSA的新实例。

3@连接的网络的指定路由器发生更改。应发起新的router-LSA。此外,如果路由器本身现在是指定路由器,则应生成新的network-LSA。如果路由器本身不再是指定路由器,则应该从路由域中清除它可能为网络发起的任何network-LSA(参见第14.1节)。

4@其中一个相邻路由器更改为/从FULL状态。这可能意味着需要生成router-LSA的新实例。此外,如果路由器本身是连接网络的指定路由器,则应生成新的network-LSA

    When whatever is being described by an LSA changes, a new LSA is
    originated.  However, two instances of the same LSA may not be
    originated within the time period MinLSInterval.  This may
    require that the generation of the next instance be delayed by
    up to MinLSInterval.  The following events may cause the
    contents of an LSA to change.  These events should cause new
    originations if and only if the contents of the new LSA would be
    different:

    (2) An interface's state changes (see Section 9.1).  This may
        mean that it is necessary to produce a new instance of the
        router-LSA.

    (3) An attached network's Designated Router changes.  A new
        router-LSA should be originated.  Also, if the router itself
        is now the Designated Router, a new network-LSA should be
        produced.  If the router itself is no longer the Designated
        Router, any network-LSA that it might have originated for
        the network should be flushed from the routing domain (see
        Section 14.1).

    (4) One of the neighboring routers changes to/from the FULL
        state.  This may mean that it is necessary to produce a new
        instance of the router-LSA.  Also, if the router is itself
        the Designated Router for the attached network, a new
        network-LSA should be produced.

以下4个事件仅发生于区域边界路由器上:

5@已在路由表中添加/删除/修改区域内路由。这可能会导致在每个连接区域(可能包括骨干区域)中发起摘要的新summary-LSA(针对该路由)

6@已在路由表中添加/删除/修改区域间路由。这可能会导致在每个连接区域(但决不会针对骨干)中产生一个新的summary-LSA(针对该路由)

7@路由器重新连接到某个区域。然后,路由器必须为路由器路由表中的所有相关区域内和区域间路由将summary-LSAs发起到新连接的区域中。详见第12.4.3节。

8@当其中一个路由器配置的虚链路的状态发生变化时,可能需要将新的router-LSA发起到虚链路的过渡区域(参见第12.4.1节中对路由器LSA位V的讨论),以及将新router-LSA启动到骨干区域。

    (5) An intra-area route has been added/deleted/modified in the
        routing table.  This may cause a new instance of a summary-
        LSA (for this route) to be originated in each attached area
        (possibly including the backbone).

    (6) An inter-area route has been added/deleted/modified in the
        routing table.  This may cause a new instance of a summary-
        LSA (for this route) to be originated in each attached area
        (but NEVER for the backbone).

--------------------------------------------------------------------[Page 124]

    (7) The router becomes newly attached to an area.  The router
        must then originate summary-LSAs into the newly attached
        area for all pertinent intra-area and inter-area routes in
        the router's routing table.  See Section 12.4.3 for more
        details.

    (8) When the state of one of the router's configured virtual
        links changes, it may be necessary to originate a new
        router-LSA into the virtual link's Transit area (see the
        discussion of the router-LSA's bit V in Section 12.4.1), as
        well as originating a new router-LSA into the backbone.

最后2个事件仅与AS边界路由器相关(并且由AS边界路由器形成)

9@通过直接体验外部路由协议(如BGP)而获得的外部路由。这将导致AS边界路由器发起AS-external-LSA的新实例

10@路由器可能在重新启动后不再是AS边界路由器。在这种情况下,路由器应清除其先前发起的所有AS-external-LSAs。这些LSA可通过第14.1节规定的过早老化机制进行清除。

    The last two events concern AS boundary routers (and former AS
    boundary routers) only:

    (9) An external route gained through direct experience with an
        external routing protocol (like BGP) changes.  This will
        cause an AS boundary router to originate a new instance of
        an AS-external-LSA.

    (10)
        A router ceases to be an AS boundary router, perhaps after
        restarting. In this situation the router should flush all
        AS-external-LSAs that it had previously originated.  These
        LSAs can be flushed via the premature aging procedure
        specified in Section 14.1.

每种类型的LSA的结构将在下面详细说明。一般来说,这些部分描述了LSA主体的内容(即20字节LSA头后面的部分)。有关LSA头部构建的信息,请参见第12.1节。

    The construction of each type of LSA is explained in detail
    below.  In general, these sections describe the contents of the
    LSA body (i.e., the part coming after the 20-byte LSA header).
    For information concerning the building of the LSA header, see
    Section 12.1.

12.4.1.路由器LSA-router-LSA

路由器为其所属的每个区域发起一个router-LSA。这样的LSA收集描述了路由器到该区域的链路的状态。LSA在整个特定区域都泛洪,没有进一步的泛洪。

        A router originates a router-LSA for each area that it
        belongs to.  Such an LSA describes the collected states of
        the router's links to the area.  The LSA is flooded
        throughout the particular area, and no further.

--------------------------------------------------------------------[Page 126]

              ....................................
              . 192.1.2                   Area 1 .
              .     +                            .
              .     |                            .
              .     | 3+---+1                    .
              .  N1 |--|RT1|-----+               .
              .     |  +---+      \              .
              .     |              \  _______N3  .
              .     +               \/       \   .  1+---+
              .                     * 192.1.1 *------|RT4|
              .     +               /\_______/   .   +---+
              .     |              /     |       .
              .     | 3+---+1     /      |       .
              .  N2 |--|RT2|-----+      1|       .
              .     |  +---+           +---+8    .         6+---+
              .     |                  |RT3|----------------|RT6|
              .     +                  +---+     .          +---+
              . 192.1.3                  |2      .   18.10.0.6|7
              .                          |       .            |
              .                   +------------+ .
              .                     192.1.4 (N4) .
              ....................................


                Figure 15: Area 1 with IP addresses shown

路由器LSA的格式如附录a(第a.4.2节)所示。LSA的前20个字节由第12.1节中讨论的通用LSA报头组成。路由器LSA的LS类型为1。

        The format of a router-LSA is shown in Appendix A (Section
        A.4.2).  The first 20 bytes of the LSA consist of the
        generic LSA header that was discussed in Section 12.1.
        router-LSAs have LS type = 1.

路由器还通过在其router-LSAs中设置适当的位(分别为位B和位E)来指示它是区域边界路由器还是AS边界路由器。这使得到这些类型路由器的路径可以保存在路由表中,以便以后处理summary-LSAs和AS-external-LSAs。当路由器主动连接到两个或更多区域时,应设置位B,即使路由器当前未连接到OSPF骨干区域。决不应在路由器LSA中为末节区域设置位E(末节区域不能包含AS边界路由器)

        A router also indicates whether it is an area border router,
        or an AS boundary router, by setting the appropriate bits
        (bit B and bit E, respectively) in its router-LSAs. This
        enables paths to those types of routers to be saved in the
        routing table, for later processing of summary-LSAs and AS-
        external-LSAs.  Bit B should be set whenever the router is
        actively attached to two or more areas, even if the router
        is not currently attached to the OSPF backbone area.  Bit E
        should never be set in a router-LSA for a stub area (stub
        areas cannot contain AS boundary routers).

--------------------------------------------------------------------[Page 127]

此外,路由器在其router-LSA中为aeraA设置位V,当且仅当路由器是一个或多个完全相邻的虚链路的端点,该虚链路将areaA作为其传输区域。位V的设置使区域A中的其他路由器能够发现该区域是否支持中转流量(参见第6节中的TransitCapability)。

        In addition, the router sets bit V in its router-LSA for
        Area A if and only if the router is the endpoint of one or
        more fully adjacent virtual links having Area A as their
        Transit area. The setting of bit V enables other routers in
        Area A to discover whether the area supports transit traffic
        (see TransitCapability in Section 6).

router-LSA然后描述路由器到该区域的工作连接(即接口或链路)。每个链接都是根据连接的网络类型键入的。每个链接也标有其链路ID。该链路ID为链接另一端的实体命名。Table 18总结了用于类型和链接ID字段的值。

        The router-LSA then describes the router's working
        connections (i.e., interfaces or links) to the area.  Each
        link is typed according to the kind of attached network.
        Each link is also labelled with its Link ID.  This Link ID
        gives a name to the entity that is on the other end of the
        link.  Table 18 summarizes the values used for the Type and
        Link ID fields.

               Link type   Description       Link ID
               __________________________________________________
               1           Point-to-point    Neighbor Router ID
                           link
               2           Link to transit   Interface address of
                           network           Designated Router
               3           Link to stub      IP network number
                           network
               4           Virtual link      Neighbor Router ID


                       Table 18: Link descriptions in the
                                  router-LSA.

此外,为每个链路指定了链路数据字段。该字段为链路提供32位额外信息。对于到transit网络的链路、编号的点对点链路和虚链路,此字段指定相关路由器接口的IP接口地址(路由表计算需要此地址,见第16.1.1节)。对于到stub网络的链接,此字段指定stub网络IP地址掩码。对于未编号的点对点链路,链路数据字段应设置为未编号接口的MIB-II[Ref8]ifIndex值。

        In addition, the Link Data field is specified for each link.
        This field gives 32 bits of extra information for the link.
        For links to transit networks, numbered point-to-point links
        and virtual links, this field specifies the IP interface
        address of the associated router interface (this is needed
        by the routing table calculation, see Section 16.1.1).  For
        links to stub networks, this field specifies the stub
        network's IP address mask.  For unnumbered point-to-point
        links, the Link Data field should be set to the unnumbered
        interface's MIB-II [Ref8] ifIndex value.

--------------------------------------------------------------------[Page 128]

最后,指定了使用链接进行输出的开销。链路的输出开销是可配置的。除了到stub网络的链路之外,输出开销必须始终为非零。

        Finally, the cost of using the link for output is specified.
        The output cost of a link is configurable.  With the
        exception of links to stub networks, the output cost must
        always be non-zero.

为了进一步描述建立链路描述列表的过程,假设路由器希望为areaA建立router-LSA。路由器检查其接口数据结构集合。对于每个接口,采取以下步骤:

@如果所连接的网络不属于areaA,则不会向LSA添加任何链接,应检查下一个接口。

@如果接口状态为Down,不添加链路

@如果接口的状态为环回,则添加类型3链路(stub网络),只要这不是到未编号点对点网络的接口。链路ID应设置为IP接口地址,链路数据应设置为掩码0xffffff(表示主机路由),成本应设置为0

@否则,添加到router-LSA的链路描述取决于OSPF接口类型。第12.4.1.1节规定了点对点接口的链路描述,第12.4.1.2节规定了虚链路的链路描述、第12.4.1.3节规定了广播和NBMA接口的链路说明以及第12.4.1.4节规定的点对多点接口的描述。

        To further describe the process of building the list of link
        descriptions, suppose a router wishes to build a router-LSA
        for Area A.  The router examines its collection of interface
        data structures.  For each interface, the following steps
        are taken:

        o   If the attached network does not belong to Area A, no
            links are added to the LSA, and the next interface
            should be examined.

        o   If the state of the interface is Down, no links are
            added.

        o   If the state of the interface is Loopback, add a Type 3
            link (stub network) as long as this is not an interface
            to an unnumbered point-to-point network.  The Link ID
            should be set to the IP interface address, the Link Data
            set to the mask 0xffffffff (indicating a host route),
            and the cost set to 0.

        o   Otherwise, the link descriptions added to the router-LSA
            depend on the OSPF interface type. Link descriptions
            used for point-to-point interfaces are specified in
            Section 12.4.1.1, for virtual links in Section 12.4.1.2,
            for broadcast and NBMA interfaces in 12.4.1.3, and for
            Point-to-MultiPoint interfaces in 12.4.1.4.

在考虑所有路由器接口后,通过检查属于areaA的连接主机列表,将主机链路添加到router-LSA。主机路由表示为类型3链路(stub网络),其链路ID是主机的IP地址,链路数据是所有链路的掩码(0xffffff),并花费主机的配置开销(参见第C.7节)

        After consideration of all the router interfaces, host links
        are added to the router-LSA by examining the list of
        attached hosts belonging to Area A.  A host route is
        represented as a Type 3 link (stub network) whose Link ID is
        the host's IP address, Link Data is the mask of all ones
        (0xffffffff), and cost the host's configured cost (see
        Section C.7)

--------------------------------------------------------------------[Page 129]

12.4.1.1.描述点到点接口

对于点对点接口,路由器LSA中添加了一个或多个链路描述,如下所示

@如果相邻路由器完全邻接,请添加类型1链路(点对点)。链路ID应设置为相邻路由器的Router ID。对于编号的点对点网络,链路数据应指定IP接口地址。对于未编号的点对点网络,链路数据字段应指定接口的MIB-II[Ref8]ifIndex值。开销应设置为点对点接口的输出成本。

@此外,只要接口的状态为“点对点”(且不考虑相邻路由器的状态),就应添加类型3链路(stub网络)。此stub链路可以采用两种形式:
情形1
假设邻居路由器的IP地址已知,将类型3链路的链路ID设置为邻居的IP地址,将链路数据设置为掩码0xffffff(表示主机路由),并将开销设置为接口的配置输出开销。[15]

情形2
如果已将子网分配给点对点链路,则将类型3链路的链路ID设置为子网的IP地址,将链路数据设置为子网络的掩码,并将开销设置为接口的配置输出开销。[16]

            For point-to-point interfaces, one or more link
            descriptions are added to the router-LSA as follows:

            o   If the neighboring router is fully adjacent, add a
                Type 1 link (point-to-point). The Link ID should be
                set to the Router ID of the neighboring router. For
                numbered point-to-point networks, the Link Data
                should specify the IP interface address. For
                unnumbered point-to-point networks, the Link Data
                field should specify the interface's MIB-II [Ref8]
                ifIndex value. The cost should be set to the output
                cost of the point-to-point interface.

            o   In addition, as long as the state of the interface
                is "Point-to-Point" (and regardless of the
                neighboring router state), a Type 3 link (stub
                network) should be added. There are two forms that
                this stub link can take:

                Option 1
                    Assuming that the neighboring router's IP
                    address is known, set the Link ID of the Type 3
                    link to the neighbor's IP address, the Link Data
                    to the mask 0xffffffff (indicating a host
                    route), and the cost to the interface's
                    configured output cost.[15]

                Option 2
                    If a subnet has been assigned to the point-to-
                    point link, set the Link ID of the Type 3 link
                    to the subnet's IP address, the Link Data to the
                    subnet's mask, and the cost to the interface's
                    configured output cost.[16]
12.4.1.2.描述广播和NBMA接口

对于可操作的广播和NBMA接口,路由器LSA中添加了单链路描述,如下所示:
@如果接口的状态为“Waiting”,请添加类型3链路(stub网络),其中链路ID设置为连接网络的IP网络号,链路数据设置为连接的网络地址掩码,开销设置为接口的配置输出开销。

@否则,已为连接的网络选择了指定路由器。如果路由器与指定路由器完全邻接,或者如果路由器本身是指定路由器并且与至少一个其他路由器完全相邻的话,则添加一个2类链路(transit网络),其链路ID设置为连接网络的指定路由器(可能是路由器本身)的IP接口地址,链接数据集到路由器自己的IP接口地址,开销设置为接口的配置输出开销。否则,添加一个链接就像接口状态为“Waiting”一样(参见上文)。

            For operational broadcast and NBMA interfaces, a single
            link description is added to the router-LSA as follows:
            o   If the state of the interface is Waiting, add a Type
                3 link (stub network) with Link ID set to the IP
                network number of the attached network, Link Data
                set to the attached network's address mask, and cost
                equal to the interface's configured output cost.

            o   Else, there has been a Designated Router elected for
                the attached network.  If the router is fully
                adjacent to the Designated Router, or if the router
                itself is Designated Router and is fully adjacent to
                at least one other router, add a single Type 2 link
                (transit network) with Link ID set to the IP
                interface address of the attached network's
                Designated Router (which may be the router itself),
                Link Data set to the router's own IP interface
                address, and cost equal to the interface's
                configured output cost.  Otherwise, add a link as if
                the interface state were Waiting (see above).
12.4.1.3.描述虚链路

对于虚链路,只有当虚邻居完全邻接时,才会向router-LSA添加链路描述。在这种情况下,添加类型4链路(虚链路),其中链路ID设置为虚拟邻居的Router ID,链路数据设置为与虚链路相关联的IP接口地址,开销设置为路由表计算期间为虚拟链路计算的开销(见第15节)。

            For virtual links, a link description is added to the
            router-LSA only when the virtual neighbor is fully
            adjacent. In this case, add a Type 4 link (virtual link)
            with Link ID set to the Router ID of the virtual
            neighbor, Link Data set to the IP interface address
            associated with the virtual link and cost set to the
            cost calculated for the virtual link during the routing
            table calculation (see Section 15).
12.4.1.4.描述点到多点接口

对于可操作的点对多点接口,路由器LSA中添加了一个或多个链路描述,如下所示:
@添加了单个类型3链路(stub网络),其中链路ID设置为路由器自己的IP接口地址,链路数据设置为掩码0xffffff(表示主机路由),开销设置为0。

@对于与接口关联的每个完全相邻的邻接,添加一个额外的类型1链路(点对点),链路ID设置为相邻路由器的Router ID,链路数据设置为IP接口地址,开销等于接口的配置输出开销。

            For operational Point-to-MultiPoint interfaces, one or
            more link descriptions are added to the router-LSA as
            follows:

            o   A single Type 3 link (stub network) is added with
                Link ID set to the router's own IP interface
                address, Link Data set to the mask 0xffffffff
                (indicating a host route), and cost set to 0.

--------------------------------------------------------------------[Page 131]

            o   For each fully adjacent neighbor associated with the
                interface, add an additional Type 1 link (point-to-
                point) with Link ID set to the Router ID of the
                neighboring router, Link Data set to the IP
                interface address and cost equal to the interface's
                configured output cost.
12.4.1.5.router-LSAs的例子

考虑路由器RT3生成的router-LSAs,如Figure 6所示。包含路由器RT3的区域(area1)已在Figure 15中用实际网络地址重新绘制。假设所有RT3接口地址的最后一个字节为3,给出接口地址192.1.1.3和192.1.4.3,并且其他路由器具有类似的地址方案。此外,假设所有链路都正常工作,并且路由器ID被分配为最小的IP接口地址。

            Consider the router-LSAs generated by Router RT3, as
            pictured in Figure 6.  The area containing Router RT3
            (Area 1) has been redrawn, with actual network
            addresses, in Figure 15.  Assume that the last byte of
            all of RT3's interface addresses is 3, giving it the
            interface addresses 192.1.1.3 and 192.1.4.3, and that
            the other routers have similar addressing schemes.  In
            addition, assume that all links are functional, and that
            Router IDs are assigned as the smallest IP interface
            address.

RT3产生两个router-LSAs,一个用于area1,另一个用于骨干区域。假设路由器RT4已被选为网络192.1.1.0的指定路由器。RT3的area1router-LSA如下所示。它表示RT3有两个到area1的连接,第一个是到transit网络192.1.1.0的链路,第二个是到stub网络192.1.4.0的链路。请注意,transit网络由其指定路由器的IP接口标识(即,链路ID=192.1.1.4,它是指定路由器RT4到192.1.1.0之间的IP接口)。还请注意,RT3已指示它是一个区域边界路由器。

            RT3 originates two router-LSAs, one for Area 1 and one
            for the backbone.  Assume that Router RT4 has been
            selected as the Designated router for network 192.1.1.0.
            RT3's router-LSA for Area 1 is then shown below.  It
            indicates that RT3 has two connections to Area 1, the
            first a link to the transit network 192.1.1.0 and the
            second a link to the stub network 192.1.4.0.  Note that
            the transit network is identified by the IP interface of
            its Designated Router (i.e., the Link ID = 192.1.1.4
            which is the Designated Router RT4's IP interface to
            192.1.1.0).  Note also that RT3 has indicated that it is
            an area border router.


    ; RT3's router-LSA for Area 1

    LS age = 0                     ;always true on origination
    Options = (E-bit)              ;
    LS type = 1                    ;indicates router-LSA
    Link State ID = 192.1.1.3      ;RT3's Router ID
    Advertising Router = 192.1.1.3 ;RT3's Router ID
    bit E = 0                      ;not an AS boundary router
    bit B = 1                      ;area border router
    #links = 2
           Link ID = 192.1.1.4     ;IP address of Desig. Rtr.
           Link Data = 192.1.1.3   ;RT3's IP interface to net
           Type = 2                ;connects to transit network
           # TOS metrics = 0
           metric = 1

           Link ID = 192.1.4.0     ;IP Network number
           Link Data = 0xffffff00  ;Network mask
           Type = 3                ;connects to stub network
           # TOS metrics = 0
           metric = 2

显示了下一个用于骨干区域的RT3router-LSA。这表明RT3具有到骨干区域的单个连接。该连接通过一个未编号的点对点链路连接到路由器RT6。RT3再次表明它是一个区域边界路由器。

                Next RT3's router-LSA for the backbone is shown.  It
                indicates that RT3 has a single attachment to the
                backbone.  This attachment is via an unnumbered
                point-to-point link to Router RT6.  RT3 has again
                indicated that it is an area border router.

    ; RT3's router-LSA for the backbone

    LS age = 0                     ;always true on origination
    Options = (E-bit)              ;
    LS type = 1                    ;indicates router-LSA
    Link State ID = 192.1.1.3      ;RT3's router ID
    Advertising Router = 192.1.1.3 ;RT3's router ID
    bit E = 0                      ;not an AS boundary router
    bit B = 1                      ;area border router
    #links = 1
           Link ID = 18.10.0.6     ;Neighbor's Router ID
           Link Data = 0.0.0.3     ;MIB-II ifIndex of P-P link
           Type = 1                ;connects to router
           # TOS metrics = 0
           metric = 8

12.4.2.网络LSAs-network-LSA

为每个中转广播或NBMA网络生成network-LSA。(transit网络是具有两个或多个连接路由器的网络)。network-LSA描述了连接到网络的所有路由器。

        A network-LSA is generated for every transit broadcast or
        NBMA network.  (A transit network is a network having two or
        more attached routers).  The network-LSA describes all the
        routers that are attached to the network.

--------------------------------------------------------------------[Page 133]

网络的指定路由器发起LSA。指定路由器仅在与网络上的至少一个其他路由器完全邻接时才发起LSA。network-LSA在包含transit网络的整个区域被洪水淹没。transit列出了与指定路由器完全邻接的路由器;每个完全邻接的路由器由其OSPF Router ID标识。指定路由器将其自身包括在该列表中。

        The Designated Router for the network originates the LSA.
        The Designated Router originates the LSA only if it is fully
        adjacent to at least one other router on the network.  The
        network-LSA is flooded throughout the area that contains the
        transit network, and no further.  The transit lists
        those routers that are fully adjacent to the Designated
        Router; each fully adjacent router is identified by its OSPF
        Router ID.  The Designated Router includes itself in this
        list.

network-LSA的链路状态ID是指定路由器的IP接口地址。该值被网络的地址掩码(也包含在network-LSA中)掩盖,生成网络的IP地址。

        The Link State ID for a network-LSA is the IP interface
        address of the Designated Router.  This value, masked by the
        network's address mask (which is also contained in the
        network-LSA) yields the network's IP address.

以前是网络的指定路由器但现在不再是的路由器应清理它以前发起的network-LSA。此LSA不再用于路由表计算。通过提前将LSA的年龄增加到MaxAge并重新泛洪(参见第14.1节)来清除它。此外,在路由器的Router ID发生更改的罕见情况下,必须清除使用路由器先前的路由器ID发起的任何network-LSAs。由于路由器可能不知道其先前的路由器ID可能是什么,这些network-LSAs通过使其链路状态ID等于路由器的IP接口地址之一,并使其通告路由器等于路由器当前路由器ID以外的某个值来表示(详见第13.4节)。

        A router that has formerly been the Designated Router for a
        network, but is no longer, should flush the network-LSA that
        it had previously originated.  This LSA is no longer used in
        the routing table calculation.  It is flushed by prematurely
        incrementing the LSA's age to MaxAge and reflooding (see
        Section 14.1). In addition, in those rare cases where a
        router's Router ID has changed, any network-LSAs that were
        originated with the router's previous Router ID must be
        flushed. Since the router may have no idea what it's
        previous Router ID might have been, these network-LSAs are
        indicated by having their Link State ID equal to one of the
        router's IP interface addresses and their Advertising Router
        equal to some value other than the router's current Router
        ID (see Section 13.4 for more details).
12.4.2.1.网络LSA的例子

再次考虑Figure 6中的区域配置。Network-LSAs起源于area1中的网络N3、area2中的网络N6和N8以及区域3中的网络N9。假设路由器RT4已被选为网络N3的指定路由器,则RT4代表网络N3生成以下network-LSA(地址分配见Figure 15):

            Again consider the area configuration in Figure 6.
            Network-LSAs are originated for Network N3 in Area 1,
            Networks N6 and N8 in Area 2, and Network N9 in Area 3.
            Assuming that Router RT4 has been selected as the
            Designated Router for Network N3, the following
            network-LSA is generated by RT4 on behalf of Network N3
            (see Figure 15 for the address assignments):

    ; Network-LSA for Network N3


    LS age = 0                     ;always true on origination
    Options = (E-bit)              ;
    LS type = 2                    ;indicates network-LSA
    Link State ID = 192.1.1.4      ;IP address of Desig. Rtr.
    Advertising Router = 192.1.1.4 ;RT4's Router ID
    Network Mask = 0xffffff00
           Attached Router = 192.1.1.4    ;Router ID
           Attached Router = 192.1.1.1    ;Router ID
           Attached Router = 192.1.1.2    ;Router ID
           Attached Router = 192.1.1.3    ;Router ID

12.4.3摘要LSAs-Summary-LSAs
summary-LSA描述的目的地是IP网络、AS边界路由器或一系列IP地址。summary-LSA仅在单个区域泛洪。所描述的目的地位于该区域外部,但仍属于自治系统。

        The destination described by a summary-LSA is either an IP
        network, an AS boundary router or a range of IP addresses.
        Summary-LSAs are flooded throughout a single area only.  The
        destination described is one that is external to the area,
        yet still belongs to the Autonomous System.

Summary-LSAs由区域边界路由器发起。根据下面描述的算法,通过检查路由表结构(参见第11节)来确定向某个区域通告的精确摘要路由。请注意,只有区域内路由被通告到骨干区域,而区域内和区域间路由都被通告到其他区域。

        Summary-LSAs are originated by area border routers.  The
        precise summary routes to advertise into an area are
        determined by examining the routing table structure (see
        Section 11) in accordance with the algorithm described
        below. Note that only intra-area routes are advertised into
        the backbone, while both intra-area and inter-area routes
        are advertised into the other areas.

为了确定要通告到连接区域A中的路由,每个路由表条目被如下处理。请记住,每个路由表条目都描述了一组到特定目的地的开销相等的最佳路径

        To determine which routes to advertise into an attached Area
        A, each routing table entry is processed as follows.
        Remember that each routing table entry describes a set of
        equal-cost best paths to a particular destination:

@在summary-LSAs中仅通告网络和AS边界路由器的目的地类型。如果路由表条目的目标类型是区域边界路由器,请检查下一个路由表条目。

        o   Only Destination Types of network and AS boundary router
            are advertised in summary-LSAs.  If the routing table
            entry's Destination Type is area border router, examine
            the next routing table entry.

@AS外部路由从未在summary-LSAs中通告。如果路由表条目的路径类型为外部类型1或外部类型2,请检查下一个路由表条目

        o   AS external routes are never advertised in summary-LSAs.
            If the routing table entry has Path-type of type 1
            external or type 2 external, examine the next routing
            table entry.

--------------------------------------------------------------------[Page 133]

@否则,如果与这组路径相关的区域是区域A本身,则不为该路由生成路由的summary-LSA。[17]

        o   Else, if the area associated with this set of paths is
            the Area A itself, do not generate a summary-LSA for the
            route.[17]

@否则,如果与这组路径关联的下一跳属于areaA本身,则不为该路由生成summary-LSA。[18] 这是距离矢量协议的分割范围逻辑的逻辑等价物。

        o   Else, if the next hops associated with this set of paths
            belong to Area A itself, do not generate a summary-LSA
            for the route.[18] This is the logical equivalent of a
            Distance Vector protocol's split horizon logic.

@否则,如果路由表开销等于或超过值LSInfinity,则无法为此路由生成summary-LSA。

        o   Else, if the routing table cost equals or exceeds the
            value LSInfinity, a summary-LSA cannot be generated for
            this route.

@否则,如果此路由的目的地是AS边界路由器,则当且仅当路由表条目描述到AS边界路由器的首选路径时,应发起summary-LSA(参见第16.4节的步骤3)。如果是,则为目的地发起类型4 summary-LSA,链路状态ID等于AS边界路由器的Router ID,度量等于路由表条目的开销。注意:如果areaA已配置为末节区域,则不应生成这些LSA。

        o   Else, if the destination of this route is an AS boundary
            router, a summary-LSA should be originated if and only
            if the routing table entry describes the preferred path
            to the AS boundary router (see Step 3 of Section 16.4).
            If so, a Type 4 summary-LSA is originated for the
            destination, with Link State ID equal to the AS boundary
            router's Router ID and metric equal to the routing table
            entry's cost. Note: these LSAs should not be generated
            if Area A has been configured as a stub area.

@否则,目的类型为network。如果这是一个区域间路由,请为目的地生成一个类型3summary-LSA,其中链路状态ID等于网络地址(如果需要,链路状态ID还可以设置一个或多个网络主机位;有关详细信息,请参见附录E),度量等于路由表开销。

        o   Else, the Destination type is network. If this is an
            inter-area route, generate a Type 3 summary-LSA for the
            destination, with Link State ID equal to the network's
            address (if necessary, the Link State ID can also have
            one or more of the network's host bits set; see Appendix
            E for details) and metric equal to the routing table
            cost.

@剩下的一种情况是到网络的区域内路由。这意味着网络包含在路由器的一个直接连接区域中。一般来说,这些信息在出现在summary-LSAs中之前必须进行压缩。请记住,一个区域有一个已配置的地址范围列表,每个范围由一个[地址,掩码]对和一个通告或DoNotAdvertise的状态指示组成。最多为每个范围生成一个类型3 summary-LSAs。当范围的状态指示为“通告”时,将生成一个类型3 summary-LSAs,其中链路状态ID等于范围的地址(如有必要,链路状态ID还可以设置一个或多个范围的“主机”位;有关详细信息,请参见附录E),开销等于任何组成网络的最大开销。当范围的状态指示DoNotAdvertise时,类型3 summary-LSAs被抑制,组成网络对其他区域保持隐藏。

默认情况下,如果网络不包含在任何显式配置的地址范围中,则生成类型3 summary-LSAs,其中链路状态ID等于网络地址(如果需要,链路状态ID还可以设置一个或多个网络“主机”位;详细信息见附录E),度量等于网络路由表开销。

如果一个区域能够承载transit流量(即,其TransitCapability设置为TRUE),则在汇总到该区域之前,不应压缩有关骨干区域的路由信息。也不应禁止骨干区域在transit地区的通告。换言之,在将summary-LSAs发送到transit区域时,应忽略主干的骨干区域范围。

        o   The one remaining case is an intra-area route to a
            network.  This means that the network is contained in
            one of the router's directly attached areas.  In
            general, this information must be condensed before
            appearing in summary-LSAs.  Remember that an area has a
            configured list of address ranges, each range consisting
            of an [address,mask] pair and a status indication of
            either Advertise or DoNotAdvertise.  At most a single
            Type 3 summary-LSA is originated for each range. When
            the range's status indicates Advertise, a Type 3
            summary-LSA is generated with Link State ID equal to the
            range's address (if necessary, the Link State ID can
            also have one or more of the range's "host" bits set;
            see Appendix E for details) and cost equal to the
            largest cost of any of the component networks. When the
            range's status indicates DoNotAdvertise, the Type 3
            summary-LSA is suppressed and the component networks
            remain hidden from other areas.

            By default, if a network is not contained in any
            explicitly configured address range, a Type 3 summary-
            LSA is generated with Link State ID equal to the
            network's address (if necessary, the Link State ID can
            also have one or more of the network's "host" bits set;
            see Appendix E for details) and metric equal to the
            network's routing table cost.

            If an area is capable of carrying transit traffic (i.e.,
            its TransitCapability is set to TRUE), routing
            information concerning backbone networks should not be
            condensed before being summarized into the area.  Nor
            should the advertisement of backbone networks into
            transit areas be suppressed.  In other words, the
            backbone's configured ranges should be ignored when
            originating summary-LSAs into transit areas.

如果路由器为无法到达的目的地通告summary-LSA,则路由器必须通过将其年龄设置为MaxAge并重新泛洪来清除路由域中的LSA(参见第14.1节)。此外,如果目的地仍然是可到达的,但根据上述过程不能再被通告(例如,它现在是一个区域间路由,当它以前是与某个非主干区域相关联的区域内路由时;因此,它将不再可以通告给骨干区域),则也应该从路由域中清除LSA。

        If a router advertises a summary-LSA for a destination which
        then becomes unreachable, the router must then flush the LSA
        from the routing domain by setting its age to MaxAge and
        reflooding (see Section 14.1).  Also, if the destination is
        still reachable, yet can no longer be advertised according
        to the above procedure (e.g., it is now an inter-area route,
        when it used to be an intra-area route associated with some
        non-backbone area; it would thus no longer be advertisable
        to the backbone), the LSA should also be flushed from the
        routing domain.
12.4.3.1.为末节区域产生summary-LSA

当areaA是OSPF末节区域时,第12.4.3节中的算法是可选的。在配置控制下,连接到末节区域的区域边界路由器可以根据第12.4.3节的算法将summary-LSA发起到该区域,或者可以选择仅发起summary-LSA的子集。发起的LSA越少,F末节区域的链路状态数据库就越小,从而进一步减少了对路由器资源的需求。然而,省略LSA也可能导致次优的区域间路由,尽管路由将继续发挥作用。

            The algorithm in Section 12.4.3 is optional when Area A
            is an OSPF stub area. Area border routers connecting to
            a stub area can originate summary-LSAs into the area
            according to the Section 12.4.3's algorithm, or can
            choose to originate only a subset of the summary-LSAs,
            possibly under configuration control.  The fewer LSAs
            originated, the smaller the stub area's link state
            database, further reducing the demands on its routers'
            resources. However, omitting LSAs may also lead to sub-
            optimal inter-area routing, although routing will
            continue to function.

如第12.4.3节所述,4类summary-LSAs(ASBR-summary-LSAs)从不泛洪给末节区域。

            As specified in Section 12.4.3, Type 4 summary-LSAs
            (ASBR-summary-LSAs) are never originated into stub
            areas.

在末节区域中,每个区域边界路由器将向该区域发起一个“默认summary-LSAs”,而不是导入外部路由。默认summary-LSAs的链路状态ID设置为DefaultDestination,度量设置为(每个区域)可配置参数StubDefaultCost。请注意,StubDefaultCost不需要在所有末节区域的区域边界路由器中进行相同的配置。

            In a stub area, instead of importing external routes
            each area border router originates a "default summary-
            LSA" into the area. The Link State ID for the default
            summary-LSA is set to DefaultDestination, and the metric
            set to the (per-area) configurable parameter
            StubDefaultCost.  Note that StubDefaultCost need not be
            configured identically in all of the stub area's area
            border routers.
12.4.3.2.summary-LSAs的举例

再次考虑Figure 6中的区域配置。路由器RT3、RT4、RT7、RT10和RT11都是区域边界路由器,因此是都产生summary-LSAs。特别考虑路由器RT4。其路由表如第11.3节中的示例计算。RT4将为骨干区域和区域1产生summary-LSAs。在骨干区域中,路由器RT4为每个网络N1-N4发送单独的LSA。在区域1中,路由器RT4为网络N6-N8和AS边界路由器RT5发送单独的LSA,它还将主机路由Ia和Ib压缩为单个summary-LSA。最后,到网络N9、N10、N11和主机H1的路由由单个summary-LSA通告。该压缩最初由路由器RT11执行。

            Consider again the area configuration in Figure 6.
            Routers RT3, RT4, RT7, RT10 and RT11 are all area border
            routers, and therefore are originating summary-LSAs.
            Consider in particular Router RT4.  Its routing table
            was calculated as the example in Section 11.3.  RT4
            originates summary-LSAs into both the backbone and Area
            1.  Into the backbone, Router RT4 originates separate
            LSAs for each of the networks N1-N4.  Into Area 1,
            Router RT4 originates separate LSAs for networks N6-N8
            and the AS boundary routers RT5,RT7.  It also condenses
            host routes Ia and Ib into a single summary-LSA.
            Finally, the routes to networks N9,N10,N11 and Host H1
            are advertised by a single summary-LSA.  This
            condensation was originally performed by the router
            RT11.

--------------------------------------------------------------------[Page 138]

这些LSA如Figures 7和8所示。路由器RT4发起的两个summary-LSAs如下。有关网络和路由器的实际IP地址已在Figure 15中分配。

            These LSAs are illustrated graphically in Figures 7 and
            8.  Two of the summary-LSAs originated by Router RT4
            follow.  The actual IP addresses for the networks and
            routers in question have been assigned in Figure 15.

    ; Summary-LSA for Network N1,
    ; originated by Router RT4 into the backbone

    LS age = 0                  ;always true on origination
    Options = (E-bit)           ;
    LS type = 3                 ;Type 3 summary-LSA
    Link State ID = 192.1.2.0   ;N1's IP network number
    Advertising Router = 192.1.1.4       ;RT4's ID
    metric = 4

    ; Summary-LSA for AS boundary router RT7
    ; originated by Router RT4 into Area 1

    LS age = 0                  ;always true on origination
    Options = (E-bit)           ;
    LS type = 4                 ;Type 4 summary-LSA
    Link State ID = Router RT7's ID
    Advertising Router = 192.1.1.4       ;RT4's ID
    metric = 14

12.4.4.自治系统外部LSAs-AS-external-LSAs

AS-external-LSAs描述了通往自治系统外部目的地的路由。大多数AS-external-LSAs描述到特定外部目的地的路由;在这些情况下,LSA的链路状态ID被设置为目标网络的IP地址(如有必要,链路状态ID还可以设置一个或多个网络的“主机”位;详见附录E)。然而,通过将LSA的链路状态ID设置为DefaultDestination(0.0.0.0),可以在AS-external-LSAs中描述自治系统的默认路由。AS-external-LSAs由AS边界路由器发起。AS边界路由器通过另一个路由协议(如BGP)或通过配置信息,为其学习的每个外部路由发起单个AS-external-LSAs

        AS-external-LSAs describe routes to destinations external to
        the Autonomous System.  Most AS-external-LSAs describe
        routes to specific external destinations; in these cases the
        LSA's Link State ID is set to the destination network's IP
        address (if necessary, the Link State ID can also have one
        or more of the network's "host" bits set; see Appendix E for
        details).  However, a default route for the Autonomous
        System can be described in an AS-external-LSA by setting the
        LSA's Link State ID to DefaultDestination (0.0.0.0).  AS-
        external-LSAs are originated by AS boundary routers.  An AS
        boundary router originates a single AS-external-LSA for each
        external route that it has learned, either through another
        routing protocol (such as BGP), or through configuration
        information

--------------------------------------------------------------------[Page 139]

AS-external-LSAs是唯一在整个自治系统中泛洪的LSA类型;所有其他类型的LSA都特定于单个区域。但是,AS-external-LSAs不会泛洪/贯穿末节区域(见第3.6节)。这可以减少末节区域内部路由器的链路状态数据库大小。

        AS-external-LSAs are the only type of LSAs that are flooded
        throughout the entire Autonomous System; all other types of
        LSAs are specific to a single area.  However, AS-external-
        LSAs are not flooded into/throughout stub areas (see Section
        3.6).  This enables a reduction in link state database size
        for routers internal to stub areas.

为外部路由通告的度量可以是两种类型之一。类型1度量与链路状态度量相当。类型2假设度量大于任何AS内路径的成本。

        The metric that is advertised for an external route can be
        one of two types.  Type 1 metrics are comparable to the link
        state metric.  Type 2 metrics are assumed to be larger than
        the cost of any intra-AS path.

如果路由器为无法到达的目的地通告AS-external-LSA,则路由器必须通过将其年龄设置为MaxAge并重新泛洪来从路由域中清除LSA(参见第14.1节)。

        If a router advertises an AS-external-LSA for a destination
        which then becomes unreachable, the router must then flush
        the LSA from the routing domain by setting its age to MaxAge
        and reflooding (see Section 14.1).
12.4.4.1.AS-external-LSAs举例

再次考虑Figure 6所示的AS。有两个AS边界路由器:RT5和RT7。路由器RT5为网络N12-N14产生三个AS-external-LSAs。路由器RT7为网络N12和N15产生二个AS-external-LSAs。假设RT7已通过BGP获知其到N12的路由,并希望向AS通告类型2度量。RT7随后将为N12产生以下LSA:

            Consider once again the AS pictured in Figure 6.  There
            are two AS boundary routers: RT5 and RT7.  Router RT5
            originates three AS-external-LSAs, for networks N12-N14.
            Router RT7 originates two AS-external-LSAs, for networks
            N12 and N15.  Assume that RT7 has learned its route to
            N12 via BGP, and that it wishes to advertise a Type 2
            metric to the AS.  RT7 would then originate the
            following LSA for N12:

    ; AS-external-LSA for Network N12,
    ; originated by Router RT7

    LS age = 0                  ;always true on origination
    Options = (E-bit)           ;
    LS type = 5                 ;AS-external-LSA
    Link State ID = N12's IP network number
    Advertising Router = Router RT7's ID
    bit E = 1                   ;Type 2 metric
    metric = 2
    Forwarding address = 0.0.0.0

--------------------------------------------------------------------[Page 140]

在上面的示例中,转发地址字段被设置为0.0.0.0,这表示外部目的地的包应该被转发到通告OSPF路由器(RT7)。这并不总是可取的。考虑Figure 16所示的示例。有三个OSPF路由器(RTA、RTB和RTC)连接到一个公共网络。这些路由器中只有一个RTA与非OSPF路由器RTX交换BGP信息。RTA必须为其从RTX了解到的目的地产生AS-external-LSAs。通过使用AS-external-LSAs的转发地址字段,RTA可以指定将这些目的地的数据包直接转发到RTX。如果没有此功能,路由器RTB和RTC将需要额外的一跳才能到达这些目的地。

                In the above example, the forwarding address field
                has been set to 0.0.0.0, indicating that packets for
                the external destination should be forwarded to the
                advertising OSPF router (RT7).  This is not always
                desirable.  Consider the example pictured in Figure
                16.  There are three OSPF routers (RTA, RTB and RTC)
                connected to a common network.  Only one of these
                routers, RTA, is exchanging BGP information with the
                non-OSPF router RTX.  RTA must then originate AS-
                external-LSAs for those destinations it has learned
                from RTX.  By using the AS-external-LSA's forwarding
                address field, RTA can specify that packets for
                these destinations be forwarded directly to RTX.
                Without this feature, Routers RTB and RTC would take
                an extra hop to get to these destinations.

请注意,当转发地址字段为非零时,它应该指向属于另一个自治系统的路由器

                Note that when the forwarding address field is non-
                zero, it should point to a router belonging to
                another Autonomous System.

也可以为默认路由指定转发地址。例如,在figure 16中,RTA可能希望指定所有外部目的地数据包在默认情况下应转发到其BGP对等RTX。生成的AS-external-LSA如下图所示。请注意,链接状态ID设置为DefaultDestination。

                A forwarding address can also be specified for the
                default route.  For example, in figure 16 RTA may
                want to specify that all externally-destined packets
                should by default be forwarded to its BGP peer RTX.
                The resulting AS-external-LSA is pictured below.
                Note that the Link State ID is set to DefaultDestination.

    ; Default route, originated by Router RTA
    ; Packets forwarded through RTX

    LS age = 0                  ;always true on origination
    Options = (E-bit)           ;
    LS type = 5                 ;AS-external-LSA
    Link State ID = DefaultDestination  ; default route
    Advertising Router = Router RTA's ID
    bit E = 1                   ;Type 2 metric
    metric = 1
    Forwarding address = RTX's IP address

在figure 16中,假设RTA和RTB都与RTX交换BGP信息。在这种情况下,RTA和RTB将产生同一组AS-external-LSAs。如果这些LSA指定相同的度量,那么它们在功能上是等效的,因为它们将指定相同的目的地和转发地址(RTX)。这导致明显的工作重复。如果RTA或RTB中只有一个发起了AS-external-LSAs,则路由将保持不变,并且链路状态数据库的大小将减小。然而,必须明确定义哪个路由器产生LSA(否则两者都不可能,或者发起方的身份可能会振荡)。由此建立了以下规则:如果两个路由器(都可以彼此到达)发起功能等效的AS-external-LSAs(即,相同的目的地、成本和非零转发地址),则使用由具有最高OSPF Router ID的路由器发起的LSA。然后,具有较低OSPF路由器ID的路由器可以清除其LSA。第14.1节讨论了清除LSA。

                In figure 16, suppose instead that both RTA and RTB
                exchange BGP information with RTX.  In this case,
                RTA and RTB would originate the same set of AS-
                external-LSAs.  These LSAs, if they specify the same
                metric, would be functionally equivalent since they
                would specify the same destination and forwarding
                address (RTX).  This leads to a clear duplication of
                effort.  If only one of RTA or RTB originated the
                set of AS-external-LSAs, the routing would remain
                the same, and the size of the link state database
                would decrease.  However, it must be unambiguously
                defined as to which router originates the LSAs
                (otherwise neither may, or the identity of the
                originator may oscillate).  The following rule is
                thereby established: if two routers, both reachable
                from one another, originate functionally equivalent
                AS-external-LSAs (i.e., same destination, cost and
                non-zero forwarding address), then the LSA
                originated by the router having the highest OSPF
                Router ID is used.  The router having the lower OSPF
                Router ID can then flush its LSA.  Flushing an LSA
                is discussed in Section 14.1.


                            +
                            |
                  +---+.....|.BGP
                  |RTA|-----|.....+---+
                  +---+     |-----|RTX|
                            |     +---+
                  +---+     |
                  |RTB|-----|
                  +---+     |
                            |
                  +---+     |
                  |RTC|-----|
                  +---+     |
                            |
                            +

           Figure 16: Forwarding address example

--------------------------------------------------------------------[Page 142]

13.泛洪程序

LSU包提供了泛洪LSA的机制。LSU包可能包含几个不同的LSA,并在每个LSA离其始发点更远的一跳处对其进行洪泛。为了使泛洪程序可靠,必须单独确认每个LSA。确认在LSAck包中传输。许多单独的确认也可以被分组到单个包中。

Link State Update packets provide the mechanism for flooding LSAs.
A Link State Update packet may contain several distinct LSAs, and
floods each LSA one hop further from its point of origination.  To
make the flooding procedure reliable, each LSA must be acknowledged
separately.  Acknowledgments are transmitted in Link State
Acknowledgment packets.  Many separate acknowledgments can also be
grouped together into a single packet.

当接收到LSU包时,洪泛过程开始。在将接收到的数据包移交到洪泛过程之前,已对其进行了多次一致性检查(见第8.2节)。特别地,LSU包已经与特定邻居和特定区域相关联。如果邻居的状态低于Exchange,则应丢弃数据包而不进行进一步处理。

The flooding procedure starts when a Link State Update packet has
been received.  Many consistency checks have been made on the
received packet before being handed to the flooding procedure (see
Section 8.2).  In particular, the Link State Update packet has been
associated with a particular neighbor, and a particular area.  If
the neighbor is in a lesser state than Exchange, the packet should
be dropped without further processing.

除All types of LSAs外,所有类型的LSA都与特定区域相关联。但是,LSAs不包含区域字段。LSAs的区域必须从LSU报头中推导出来。

All types of LSAs, other than AS-external-LSAs, are associated with
a specific area.  However, LSAs do not contain an area field.  An
LSA's area must be deduced from the Link State Update packet header.

对于LSU包中包含的每个LSA,采取以下步骤:

For each LSA contained in a Link State Update packet, the following
steps are taken:

1@验证LSA的LS校验和。如果校验和无效,则丢弃LSA并从LSU包中获取下一个LSA。

(1) Validate the LSA's LS checksum.  If the checksum turns out to be
    invalid, discard the LSA and get the next one from the Link
    State Update packet.

2@检查LSA的LS类型。如果LS类型未知,则丢弃LSA并从LSU包中获取下一个LSA。本规范定义了LS类型1-5(见第4.3节)。

(2) Examine the LSA's LS type.  If the LS type is unknown, discard
    the LSA and get the next one from the Link State Update Packet.
    This specification defines LS types 1-5 (see Section 4.3).

3@否则,如果这是 AS-external-LSA(LS类型=5),并且该区域已配置为末节区域,则丢弃该LSA并从链路状态更新包中获取下一个LSA。AS-external-LSAs不会泛洪/贯穿末节区域(见第3.6节)

(3) Else if this is an AS-external-LSA (LS type = 5), and the area
    has been configured as a stub area, discard the LSA and get the
    next one from the Link State Update Packet.  AS-external-LSAs
    are not flooded into/throughout stub areas (see Section 3.6).

4@否则,如果LSA的LS年龄等于MaxAge,并且路由器的链路状态数据库中当前没有LSA的实例,并且没有路由器的邻居处于Exchange或Loading状态,则采取以下操作:a)通过向发送邻居发送LSAck包来确认LSA的接收(参见第13.5节),以及b)丢弃LSA并检查LSU包中列出的下一个LSA(如果有)。

(4) Else if the LSA's LS age is equal to MaxAge, and there is
    currently no instance of the LSA in the router's link state
    database, and none of router's neighbors are in states Exchange
    or Loading, then take the following actions: a) Acknowledge the
    receipt of the LSA by sending a Link State Acknowledgment packet
    back to the sending neighbor (see Section 13.5), and b) Discard
    the LSA and examine the next LSA (if any) listed in the Link
    State Update packet.

5@否则,请找到路由器LSDB中当前包含的此LSA的实例。如果没有数据库副本,或者接收到的LSA比数据库副本更新(关于确定哪个LSA更新,请参见下文第13.1节),则必须执行以下步骤

(a)如果已经存在数据库副本,并且数据库副本是通过洪泛接收的,并且安装时间少于MinLSArrival秒,则丢弃新的LSA(不确认)并检查LSU包中列出的下一个LSA(如果有)。

(b)否则,立即将新的LSA洪泛出路由器接口的某个子集(参见第13.3节)。在某些情况下(例如,接收接口的状态为DR,并且LSA是从除备份DR之外的路由器接收的),LSA将从接收接口泛洪出。这种情况应记录下来,以供确认过程(第13.5节)以后使用。

©从所有邻居的链路状态重传列表中删除当前数据库副本。

(d)在LSDB中安装新的LSA(替换当前数据库副本)。这可能会导致路由表计算以便被调度。此外,用当前时间(即,它被接收的时间)为新LSA加上时间戳。在经过MinLSArrival秒之前,泛洪过程无法覆盖新安装的LSA。LSA安装过程将在第13.2节中进一步讨论。

(e)可能通过将LSAck包发送回接收接口来确认LSA的接收。下文第13.5节对此进行了解释。

(f)如果这个新的LSA表明它是由接收路由器自己发起的(即,被认为是自发起的LSA),路由器必须采取特殊措施,更新LSA,或者在某些情况下将其从路由域中清除。有关如何检测和随后处理自己产生LSA的描述,请参见第13.4节。

(5) Otherwise, find the instance of this LSA that is currently
    contained in the router's link state database.  If there is no
    database copy, or the received LSA is more recent than the
    database copy (see Section 13.1 below for the determination of
    which LSA is more recent) the following steps must be performed

    (a) If there is already a database copy, and if the database
        copy was received via flooding and installed less than
        MinLSArrival seconds ago, discard the new LSA (without
        acknowledging it) and examine the next LSA (if any) listed
        in the Link State Update packet.

    (b) Otherwise immediately flood the new LSA out some subset of
        the router's interfaces (see Section 13.3).  In some cases
        (e.g., the state of the receiving interface is DR and the
        LSA was received from a router other than the Backup DR) the
        LSA will be flooded back out the receiving interface.  This
        occurrence should be noted for later use by the
        acknowledgment process (Section 13.5).

    (c) Remove the current database copy from all neighbors' Link
        state retransmission lists.

    (d) Install the new LSA in the link state database (replacing
        the current database copy).  This may cause the routing
        table calculation to be scheduled.  In addition, timestamp
        the new LSA with the current time (i.e., the time it was
        received).  The flooding procedure cannot overwrite the
        newly installed LSA until MinLSArrival seconds have elapsed.
        The LSA installation process is discussed further in Section
        13.2.

    (e) Possibly acknowledge the receipt of the LSA by sending a
        Link State Acknowledgment packet back out the receiving
        interface.  This is explained below in Section 13.5.

--------------------------------------------------------------------[Page 144]

    (f) If this new LSA indicates that it was originated by the
        receiving router itself (i.e., is considered a self-
        originated LSA), the router must take special action, either
        updating the LSA or in some cases flushing it from the
        routing domain. For a description of how self-originated
        LSAs are detected and subsequently handled, see Section
        13.4.

6@否则,如果发送邻居的链路状态请求列表中存在LSA实例,则数据库交换过程中出现错误。在这种情况下,通过为发送邻居生成邻居事件BadLSReq来重新启动数据库交换进程,并停止处理LSU包。

(6) Else, if there is an instance of the LSA on the sending
    neighbor's Link state request list, an error has occurred in the
    Database Exchange process.  In this case, restart the Database
    Exchange process by generating the neighbor event BadLSReq for
    the sending neighbor and stop processing the Link State Update
    packet.

7@否则,如果接收到的LSA与数据库副本是同一实例(即,两者都不是最新的),则应执行以下两个步骤:

(a)如果LSA被列在接收邻接的链路状态重传列表中,则路由器本身期望收到该LSA的确认。路由器应通过从链路状态重传列表中删除LSA,将接收到的LSA视为确认。这被称为“默示承认”。应注意其发生情况,以供确认过程稍后使用(第13.5节)。

(b)可能通过将链路状态确认分组发送回接收接口来确认LSA的接收。下文第13.5节对此进行了解释。

(7) Else, if the received LSA is the same instance as the database
    copy (i.e., neither one is more recent) the following two steps
    should be performed:

    (a) If the LSA is listed in the Link state retransmission list
        for the receiving adjacency, the router itself is expecting
        an acknowledgment for this LSA.  The router should treat the
        received LSA as an acknowledgment by removing the LSA from
        the Link state retransmission list.  This is termed an
        "implied acknowledgment".  Its occurrence should be noted
        for later use by the acknowledgment process (Section 13.5).

    (b) Possibly acknowledge the receipt of the LSA by sending a
        Link State Acknowledgment packet back out the receiving
        interface.  This is explained below in Section 13.5.

8@否则,数据库副本是最近的。如果数据库副本的LS年龄等于MaxAge,LS序列号等于MaxSequenceNumber,则只需丢弃收到的LSA而不确认它。(在这种情况下,LSA的LS序列号正在换行,在引入任何新的LSA实例之前,必须完全刷新MaxSequenceNumber LSA)。否则,只要数据库副本在最后的MinLSArrival秒内未在LSU中发送,就将数据库副本发送回发送邻居,并封装在LSU包中。LSU包应直接发送到邻居。这样做时,不要将LSA的数据库副本放在邻居的链路状态重传列表上,也不要确认接收到的(不太近的)LSA实例。

(8) Else, the database copy is more recent.  If the database copy
    has LS age equal to MaxAge and LS sequence number equal to
    MaxSequenceNumber, simply discard the received LSA without
    acknowledging it. (In this case, the LSA's LS sequence number is
    wrapping, and the MaxSequenceNumber LSA must be completely
    flushed before any new LSA instance can be introduced).
    Otherwise, as long as the database copy has not been sent in a
    Link State Update within the last MinLSArrival seconds, send the
    database copy back to the sending neighbor, encapsulated within
    a Link State Update Packet. The Link State Update Packet should
    be sent directly to the neighbor. In so doing, do not put the
    database copy of the LSA on the neighbor's link state
    retransmission list, and do not acknowledge the received (less
    recent) LSA instance.

13.1.确认LSA的新旧

当路由器遇到两个LSA实例时,它必须确定哪个是最近的。上述情况发生在将接收到的LSA与其数据库副本进行比较时。这种比较也必须在数据库交换过程中进行,该过程发生在邻接调用过程中

    When a router encounters two instances of an LSA, it must
    determine which is more recent.  This occurred above when
    comparing a received LSA to its database copy.  This comparison
    must also be done during the Database Exchange procedure which
    occurs during adjacency bring-up.

LSA由其LS类型、链路状态ID和通告路由器标识。对于同一LSA的两个实例,LS序列号、LS年龄和LS校验和字段用于确定哪个实例最近:

    An LSA is identified by its LS type, Link State ID and
    Advertising Router.  For two instances of the same LSA, the LS
    sequence number, LS age, and LS checksum fields are used to
    determine which instance is more recent:

@具有较新LS序列号的LSA较新。有关LS序列号空间的说明,请参见第12.1.6节。如果两个实例具有相同的LS序列号,则:

@如果两个实例具有不同的LS校验和,则具有较大LS校验和的实例(当被视为16位无符号整数时)被认为是最新的实例。

@否则,如果只有一个实例的LS年龄字段设置为MaxAge,则年龄MaxAge的实例被认为是最新的。

@否则,如果两个实例的LS年龄字段的差异大于MaxAgeDiff,则具有更小(更年轻)LS年龄的实例被认为是最新的。

@否则,这两个实例被认为是相同的。

    o   The LSA having the newer LS sequence number is more recent.
        See Section 12.1.6 for an explanation of the LS sequence
        number space.  If both instances have the same LS sequence
        number, then:

    o   If the two instances have different LS checksums, then the
        instance having the larger LS checksum (when considered as a
        16-bit unsigned integer) is considered more recent.

    o   Else, if only one of the instances has its LS age field set
        to MaxAge, the instance of age MaxAge is considered to be
        more recent.

    o   Else, if the LS age fields of the two instances differ by
        more than MaxAgeDiff, the instance having the smaller
        (younger) LS age is considered to be more recent.

    o   Else, the two instances are considered to be identical.

--------------------------------------------------------------------[Page 146]

13.2.在数据库中安装LSAs

在数据库中安装新的LSA,无论是由于洪泛还是新的自己产生的LSA,都可能导致重新计算OSPF路由表结构。新LSA的内容应与旧实例(如果存在)进行比较。如果没有差异,则无需重新计算路由表。当将LSA与其前一个实例进行比较时,以下内容都被认为是内容上的差异:
@LSAs的Optional字段发生改变

@其中一个LSA实例的LS年龄设置为MaxAge,而另一个没有。

@LSA的头部长发生改变

@LSA的主体(即20字节LSA标头之外的任何内容)已更改。请注意,这不包括LS序列号和LS校验和的更改。

    Installing a new LSA in the database, either as the result of
    flooding or a newly self-originated LSA, may cause the OSPF
    routing table structure to be recalculated.  The contents of the
    new LSA should be compared to the old instance, if present.  If
    there is no difference, there is no need to recalculate the
    routing table. When comparing an LSA to its previous instance,
    the following are all considered to be differences in contents:

        o   The LSA's Options field has changed.

        o   One of the LSA instances has LS age set to MaxAge, and
            the other does not.

        o   The length field in the LSA header has changed.

        o   The body of the LSA (i.e., anything outside the 20-byte
            LSA header) has changed. Note that this excludes changes
            in LS Sequence Number and LS Checksum.

如果内容不同,则必须根据新LSA的LS类型字段重新计算路由表的以下部分:

    If the contents are different, the following pieces of the
    routing table must be recalculated, depending on the new LSA's
    LS type field:

Router-LSAs and network-LSAs
必须重新计算整个路由表,首先计算每个区域的最短路径(而不仅仅是链路状态数据库已更改的区域)。最短路径计算不能局限于单个变化区域,因为AS边界路由器可能属于多个区域的事实有关。当前提供最佳路由的区域的变化可能会迫使路由器使用不同区域提供的区域内路由。[19]

    Router-LSAs and network-LSAs
        The entire routing table must be recalculated, starting with
        the shortest path calculations for each area (not just the
        area whose link-state database has changed).  The reason
        that the shortest path calculation cannot be restricted to
        the single changed area has to do with the fact that AS
        boundary routers may belong to multiple areas.  A change in
        the area currently providing the best route may force the
        router to use an intra-area route provided by a different
        area.[19]

Summary-LSAs
必须重新计算Summary-LSAs中描述的到达目的地的最佳路由(见第16.5节)。如果该目的地是AS边界路由器,可能还需要重新检查所有AS-external-LSAs

    Summary-LSAs
        The best route to the destination described by the summary-
        LSA must be recalculated (see Section 16.5).  If this
        destination is an AS boundary router, it may also be
        necessary to re-examine all the AS-external-LSAs

--------------------------------------------------------------------[Page 146]

AS-external-LSAs
必须重新计算AS-external-LSAs描述的到达目的地的最佳路由(见第16.5节)。

    AS-external-LSAs
        The best route to the destination described by the AS-
        external-LSA must be recalculated (see Section 16.6).

此外,安装新LSA时,必须从数据库中删除LSA的任何旧实例。这个旧实例也必须从所有邻居的链路状态重传列表中删除(参见第10节)。

    Also, any old instance of the LSA must be removed from the
    database when the new LSA is installed.  This old instance must
    also be removed from all neighbors' Link state retransmission
    lists (see Section 10).

13.3.泛洪程序的下一步

当接收到一个新的(和更新的)LSA时,它必须从一些路由器的接口泛洪出去。本节描述了泛洪过程的第二部分(第一部分是第13节中发生的处理),即选择输出接口并将LSA添加到适当的邻居的链路状态重传列表中。洪泛过程的这一部分还包括邻居链路状态请求列表的维护。

    When a new (and more recent) LSA has been received, it must be
    flooded out some set of the router's interfaces.  This section
    describes the second part of flooding procedure (the first part
    being the processing that occurred in Section 13), namely,
    selecting the outgoing interfaces and adding the LSA to the
    appropriate neighbors' Link state retransmission lists.  Also
    included in this part of the flooding procedure is the
    maintenance of the neighbors' Link state request lists.

本节同样适用于路由器自身刚刚发起的LSA的洪泛(见第12.4节)。对于这些LSA,本节提供了整个洪泛过程(即,不执行第13节的处理,因为例如,尚未从邻居接收到LSA,因此不需要确认)。

    This section is equally applicable to the flooding of an LSA
    that the router itself has just originated (see Section 12.4).
    For these LSAs, this section provides the entirety of the
    flooding procedure (i.e., the processing of Section 13 is not
    performed, since, for example, the LSA has not been received
    from a neighbor and therefore does not need to be acknowledged).

根据LSA的LS类型,LSA只能泛洪出某些接口。以下定义的这些接口称为合格接口:

AS-external-LSAs (LS Type = 5)
AS-external-LSAs在整个AS中泛洪,除了末节区域(见第3.6节)。符合泛洪要求的合格接口是路由器的所有接口,不包括虚链路和连接到末节区域的接口。

所有其他LS类型
所有其他类型都特定于单个区域(areaA)。合格的接口是连接到areaA的所有接口。如果区域A是骨干区域,则包括所有虚链路。

    Depending upon the LSA's LS type, the LSA can be flooded out
    only certain interfaces.  These interfaces, defined by the
    following, are called the eligible interfaces:


    AS-external-LSAs (LS Type = 5)
        AS-external-LSAs are flooded throughout the entire AS, with
        the exception of stub areas (see Section 3.6).  The eligible
        interfaces are all the router's interfaces, excluding
        virtual links and those interfaces attaching to stub areas.

    All other LS types
        All other types are specific to a single area (Area A).  The
        eligible interfaces are all those interfaces attaching to
        the Area A.  If Area A is the backbone, this includes all
        the virtual links.

链路状态数据库必须在与上述合格接口相关联的所有邻接上保持同步。这是通过在每个符合条件的接口上执行以下步骤来实现的。应当注意,如果附着的邻居很有可能已经接收到LSA,则该过程可以决定不将LSA洪泛出特定接口。然而,在这些情况下,洪泛过程必须绝对确保邻居最终确实接收到LSA,因此LSA仍然被添加到每个邻接的链路状态重传列表中。对于每个合格接口:

    Link state databases must remain synchronized over all
    adjacencies associated with the above eligible interfaces.  This
    is accomplished by executing the following steps on each
    eligible interface.  It should be noted that this procedure may
    decide not to flood an LSA out a particular interface, if there
    is a high probability that the attached neighbors have already
    received the LSA.  However, in these cases the flooding
    procedure must be absolutely sure that the neighbors eventually
    do receive the LSA, so the LSA is still added to each
    adjacency's Link state retransmission list.  For each eligible
    interface:

1@检查连接到此接口的每个邻居,以确定它们是否必须接收新的LSA。对每个邻居执行以下步骤:

(a)如果邻居的状态低于Exchange,则它不会参与泛洪,应检查下一个邻居。

(b)否则,如果邻接尚未达到full状态(邻居状态为Exchange或Loading),请检查与此邻接关联的链接状态请求列表。如果列表上有新LSA的实例,则表明相邻路由器已经有LSA的一个实例。将新LSA与邻居的副本进行比较:
@如果新的LSA不太新,则检查下一个邻居
@如果两个副本是同一实例,则从链路状态请求列表中删除LSA,并检查下一个邻居。[20]
@除此之外,新的LSA是最近的。从链路状态请求列表中删除LSA。(泛洪)

(c)如果从该邻居接收到新的LSA,请检查下一个邻居。

(d)在这一点上,我们不能肯定邻居有这个新LSA的最新实例。将新的LSA添加到邻接的链路状态重传列表中。这确保了泛洪程序的可靠性;LSA将每隔一段时间重新发送,直到从邻居看到确认

    (1) Each of the neighbors attached to this interface are
        examined, to determine whether they must receive the new
        LSA.  The following steps are executed for each neighbor:

        (a) If the neighbor is in a lesser state than Exchange, it
            does not participate in flooding, and the next neighbor
            should be examined.

        (b) Else, if the adjacency is not yet full (neighbor state
            is Exchange or Loading), examine the Link state request
            list associated with this adjacency.  If there is an
            instance of the new LSA on the list, it indicates that
            the neighboring router has an instance of the LSA
            already.  Compare the new LSA to the neighbor's copy:

            o   If the new LSA is less recent, then examine the next
                neighbor.

            o   If the two copies are the same instance, then delete
                the LSA from the Link state request list, and
                examine the next neighbor.[20]

            o   Else, the new LSA is more recent.  Delete the LSA
                from the Link state request list.

--------------------------------------------------------------------[Page 149]

        (c) If the new LSA was received from this neighbor, examine
            the next neighbor.

        (d) At this point we are not positive that the neighbor has
            an up-to-date instance of this new LSA.  Add the new LSA
            to the Link state retransmission list for the adjacency.
            This ensures that the flooding procedure is reliable;
            the LSA will be retransmitted at intervals until an
            acknowledgment is seen from the neighbor.

(2)路由器现在必须决定是否将新的LSA洪泛出该接口。如果在前一步中,LSA未添加到任何链路状态重传列表中,则无需将LSA从接口中泛洪出,检查下一个接口。

    (2) The router must now decide whether to flood the new LSA out
        this interface.  If in the previous step, the LSA was NOT
        added to any of the Link state retransmission lists, there
        is no need to flood the LSA out the interface and the next
        interface should be examined.

(3)如果在此接口上接收到新的LSA,并且它是从指定路由器或备份指定路由器接收到的,则所有邻居都可能已经接收到LSA。因此,请检查下一个接口。

    (3) If the new LSA was received on this interface, and it was
        received from either the Designated Router or the Backup
        Designated Router, chances are that all the neighbors have
        received the LSA already.  Therefore, examine the next
        interface.

(4)如果在此接口上接收到新的LSA,并且接口状态为备份(即路由器本身是备份指定路由器),请检查下一个接口。指定路由器将对此接口进行洪泛。但是,如果指定路由器出现故障,路由器(即备份指定路由器)将最终重新发送更新。

    (4) If the new LSA was received on this interface, and the
        interface state is Backup (i.e., the router itself is the
        Backup Designated Router), examine the next interface.  The
        Designated Router will do the flooding on this interface.
        However, if the Designated Router fails the router (i.e.,
        the Backup Designated Router) will end up retransmitting the
        updates.

(5)如果达到此步骤,LSA必须从接口中泛洪出。从接口发送LSU包(包括新的LSA作为内容)。当LSA复制到传出链路状态更新数据包中时(直到LS年龄字段达到MaxAge的最大值),LSA的LS年龄必须增加InfTransDelay(必须大于0)。
在广播网络上,LSU包是组播的。为LSU包指定的目标IP地址取决于接口的状态。如果接口状态为DR或Backup,则应使用地址AllSPFRouters。否则,应使用地址AllDRouters。

    (5) If this step is reached, the LSA must be flooded out the
        interface.  Send a Link State Update packet (including the
        new LSA as contents) out the interface.  The LSA's LS age
        must be incremented by InfTransDelay (which must be > 0)
        when it is copied into the outgoing Link State Update packet
        (until the LS age field reaches the maximum value of
        MaxAge).

        On broadcast networks, the Link State Update packets are
        multicast.  The destination IP address specified for the
        Link State Update Packet depends on the state of the
        interface.  If the interface state is DR or Backup, the
        address AllSPFRouters should be used.  Otherwise, the
        address AllDRouters should be used.

        On non-broadcast networks, separate Link State Update
        packets must be sent, as unicasts, to each adjacent neighbor
        (i.e., those in state Exchange or greater).  The destination
        IP addresses for these packets are the neighbors' IP
        addresses.

13.4.收到自己产生的LSAs

路由器通过洪泛过程接收自发起的LSA是一个常见的情况。当1)LSA的通告路由器等于路由器自己的路由器ID或2)LSA是network-LSA并且其链路状态ID等于路由器自己IP接口地址之一时,检测到自己产生的LSA。

    It is a common occurrence for a router to receive self-
    originated LSAs via the flooding procedure. A self-originated
    LSA is detected when either 1) the LSA's Advertising Router is
    equal to the router's own Router ID or 2) the LSA is a network-
    LSA and its Link State ID is equal to one of the router's own IP
    interface addresses.

然而,如果接收到的自己产生的LSA比路由器实际产生的最后一个实例新,则路由器必须采取特殊措施。这种LSA的接收表明路由域中存在路由器在上次重启之前发起的LSA。在大多数情况下,路由器必须将LSA的LS序列号加一个超过接收到的LS序列,并发起LSA的新实例。

    However, if the received self-originated LSA is newer than the
    last instance that the router actually originated, the router
    must take special action.  The reception of such an LSA
    indicates that there are LSAs in the routing domain that were
    originated by the router before the last time it was restarted.
    In most cases, the router must then advance the LSA's LS
    sequence number one past the received LS sequence number, and
    originate a new instance of the LSA.

路由器可能不再希望产生接收到的这一LSA。可能的示例包括:1)LSA是summary-LSA或AS-external-LSA,但路由器不再具有到目的地的(可通告的)路由,2)LSA是network-LSA,但路由器不再是网络的指定路由器,或3)network-LSA(其链路状态ID是路由器自己的IP接口地址之一,但其通告路由器不等于路由器自己的路由器ID)(后一种情况应该很少见,这表明路由器的路由器ID自产生LSA以来已更改)。在所有这些情况下,不更新LSA,而是通过将接收到的LSA的LS年龄增加到MaxAge并重新泛洪,从路由域中清除LSA(参见第14.1节)。

    It may be the case the router no longer wishes to originate the
    received LSA. Possible examples include: 1) the LSA is a
    summary-LSA or AS-external-LSA and the router no longer has an
    (advertisable) route to the destination, 2) the LSA is a
    network-LSA but the router is no longer Designated Router for
    the network or 3) the LSA is a network-LSA whose Link State ID
    is one of the router's own IP interface addresses but whose
    Advertising Router is not equal to the router's own Router ID
    (this latter case should be rare, and it indicates that the
    router's Router ID has changed since originating the LSA).  In
    all these cases, instead of updating the LSA, the LSA should be
    flushed from the routing domain by incrementing the received
    LSA's LS age to MaxAge and reflooding (see Section 14.1).

--------------------------------------------------------------------[Page 151]

13.5.发送LSAck报文

必须确认每个新收到的LSA。这通常通过发送LSAck包来完成。然而,也可以通过发送LSU包来隐含地完成确认(参见第13节的步骤7a)。

    Each newly received LSA must be acknowledged.  This is usually
    done by sending Link State Acknowledgment packets.  However,
    acknowledgments can also be accomplished implicitly by sending
    Link State Update packets (see step 7a of Section 13).

许多确认可以被分到单个LSAck包中。这样的包被发送回接收LSA的接口。数据包可以通过两种方式之一发送:延迟并在间隔定时器上发送,或者直接发送到特定的邻居。使用的特定确认策略取决于LSA接收周围的环境。

    Many acknowledgments may be grouped together into a single Link
    State Acknowledgment packet.  Such a packet is sent back out the
    interface which received the LSAs.  The packet can be sent in
    one of two ways: delayed and sent on an interval timer, or sent
    directly to a particular neighbor.  The particular
    acknowledgment strategy used depends on the circumstances
    surrounding the receipt of the LSA.

发送延迟确认实现了以下几点:1)它便于在单个LSAck包中打包多个确认,2)它使单个LSAck包能够同时(通过组播)向几个邻居一次确认,并且3)它随机化由连接到公共网络的各个路由器发送的链路状态确认包。路由器延迟传输之间的固定间隔必须很短(小于RxmtInterval),否则将发生不必要的重传。

    Sending delayed acknowledgments accomplishes several things: 1)
    it facilitates the packaging of multiple acknowledgments in a
    single Link State Acknowledgment packet, 2) it enables a single
    Link State Acknowledgment packet to indicate acknowledgments to
    several neighbors at once (through multicasting) and 3) it
    randomizes the Link State Acknowledgment packets sent by the
    various routers attached to a common network.  The fixed
    interval between a router's delayed transmissions must be short
    (less than RxmtInterval) or needless retransmissions will ensue.

响应于接收到重复LSA,直接确认被直接发送到特定邻居。收到副本后立即发送直接确认。在多址网络上,这些确认被直接发送到邻居的IP地址。

    Direct acknowledgments are sent directly to a particular
    neighbor in response to the receipt of duplicate LSAs. Direct
    acknowledgments are sent immediately when the duplicate is
    received. On multi-access networks, these acknowledgments are
    sent directly to the neighbor's IP address.

Table 19描述了发送LSAck包的精确过程。左列列出了接收LSA的情况。然后采取的确认动作列在右侧两列中的一列中。此操作取决于相关接口的状态;Backup状态中的接口的行为与所有其他状态中的接口不同。延迟确认必须传递给与接口相关联的所有邻接路由器。在广播网络上,这是通过将延迟的LSAck包作为组播发送来实现的。使用的目标IP地址取决于接口的状态。如果接口状态为DR或Backup,则使用AllSPFRouters为目地。在所有其他状态下,使用AllDRouters为目地。在非广播网络上,延迟的LSAck包必须在每个邻接(即状态>=Exchange的邻居)上分别单播传递。

    The precise procedure for sending Link State Acknowledgment
    packets is described in Table 19.  The circumstances surrounding
    the receipt of the LSA are listed in the left column.  The
    acknowledgment action then taken is listed in one of the two
    right columns.  This action depends on the state of the
    concerned interface; interfaces in state Backup behave
    differently from interfaces in all other states.  Delayed
    acknowledgments must be delivered to all adjacent routers
    associated with the interface.  On broadcast networks, this is
    accomplished by sending the delayed Link State Acknowledgment
    packets as multicasts.  The Destination IP address used depends
    on the state of the interface.  If the interface state is DR or
    Backup, the destination AllSPFRouters is used.  In all other
    states, the destination AllDRouters is used.  On non-broadcast
    networks, delayed Link State Acknowledgment packets must be
    unicast separately over each adjacency (i.e., neighbor whose
    state is >= Exchange).

通过一个例子可以很好地解释将上述包作为组播发送的原因。考虑Figure 15所示的网络配置。假设RT4被选为指定路由器,RT3被选为网络N3的备份指定路由器。当路由器RT4将新的LSA泛洪到网络N3时,路由器RT1、RT2和RT3将接收该LSA。这些路由器不会将LSA泛洪回网络N3,但它们仍然必须确保它们的链路状态数据库与其邻接邻居保持同步。因此,RT1、RT2和RT4都在等待RT3的确认。同样,RT4和RT3都在等待看到RT1和RT2的确认。这最好通过以组播方式发送确认来实现。

    The reasoning behind sending the above packets as multicasts is
    best explained by an example.  Consider the network
    configuration depicted in Figure 15.  Suppose RT4 has been
    elected as Designated Router, and RT3 as Backup Designated
    Router for the network N3.  When Router RT4 floods a new LSA to
    Network N3, it is received by routers RT1, RT2, and RT3.  These
    routers will not flood the LSA back onto net N3, but they still
    must ensure that their link-state databases remain synchronized
    with their adjacent neighbors.  So RT1, RT2, and RT4 are waiting
    to see an acknowledgment from RT3.  Likewise, RT4 and RT3 are
    both waiting to see acknowledgments from RT1 and RT2.  This is
    best achieved by sending the acknowledgments as multicasts.

备份DR的确认逻辑略有不同的原因是,它们在LSA洪泛期间的行为不同(参见第13.3节,步骤4)。

    The reason that the acknowledgment logic for Backup DRs is
    slightly different is because they perform differently during
    the flooding of LSAs (see Section 13.3, step 4).

13.6.LSAs的重传

泛洪邻接的LSA被放置在邻接的链路状态重传列表上。为了确保泛洪是可靠的,这些LSA被重新传输,直到它们被确认为止。重传之间的时间长度是可配置的每个接口值RxmtInterval。如果这对于一个接口设置得太低,将导致不必要的重传。如果该值设置得太高,面对丢失的数据包,洪泛的速度可能会受到影响。

    LSAs flooded out an adjacency are placed on the adjacency's Link
    state retransmission list.  In order to ensure that flooding is
    reliable, these LSAs are retransmitted until they are
    acknowledged.  The length of time between retransmissions is a
    configurable per-interface value, RxmtInterval.  If this is set
    too low for an interface, needless retransmissions will ensue.
    If the value is set too high, the speed of the flooding, in the
    face of lost packets, may be affected.

几个重传的LSA可以适合于单个LSU包。当要重传LSA时,只应发送单个LSU包的号码。每当一些LSA被确认时,或者在重传定时器的下一次触发时,可以发送另一个重传包。

    Several retransmitted LSAs may fit into a single Link State
    Update packet.  When LSAs are to be retransmitted, only the
    number fitting in a single Link State Update packet should be
    sent.  Another packet of retransmissions can be sent whenever
    some of the LSAs are acknowledged, or on the next firing of the
    retransmission timer.

携带重传的LSU包总是直接发送到邻居。在多址网络上,这意味着重传直接发送到邻居的IP地址。当将每个LSA的LS年龄复制到传出LSU包时(直到LS年龄字段达到MaxAge的最大值),必须将其增加InfTransDelay(必须大于0)。

    Link State Update Packets carrying retransmissions are always
    sent directly to the neighbor. On multi-access networks, this
    means that retransmissions are sent directly to the neighbor's
    IP address.  Each LSA's LS age must be incremented by
    InfTransDelay (which must be > 0) when it is copied into the
    outgoing Link State Update packet (until the LS age field
    reaches the maximum value of MaxAge).

如果相邻路由器发生故障,则可能会发生重传,直到相邻路由器被OSPF的Hello协议破坏。当相邻被破坏时,链路状态重传列表被清除。

    If an adjacent router goes down, retransmissions may occur until
    the adjacency is destroyed by OSPF's Hello Protocol.  When the
    adjacency is destroyed, the Link state retransmission list is
    cleared.

13.7.收到LSAck

在将接收到的LSAck包交给洪泛程序之前,已经对其进行了许多一致性检查。特别是,它与特定的邻居关联时。如果此邻居的状态低于Exchange,则将丢弃链路状态确认数据包。

    Many consistency checks have been made on a received Link State
    Acknowledgment packet before it is handed to the flooding
    procedure.  In particular, it has been associated with a
    particular neighbor.  If this neighbor is in a lesser state than
    Exchange, the Link State Acknowledgment packet is discarded.

否则为每个LSAck包执行如下行为
@确认的LSA在邻居的链路状态重传列表上是否有实例?如果没有,请检查下一个确认。否则:

@如果确认是针对列表中包含的同一实例,请从列表中删除该项并检查下一个确认。否则:

@记录有问题的确认,并检查下一个。

    Otherwise, for each acknowledgment in the Link State
    Acknowledgment packet, the following steps are performed:

    o   Does the LSA acknowledged have an instance on the Link state
        retransmission list for the neighbor?  If not, examine the
        next acknowledgment.  Otherwise:

--------------------------------------------------------------------[Page 155]

    o   If the acknowledgment is for the same instance that is
        contained on the list, remove the item from the list and
        examine the next acknowledgment.  Otherwise:

    o   Log the questionable acknowledgment, and examine the next
        one.

14.链路状态数据库的老化

每个LSA都有一个LS年龄字段。LS年龄以秒表示。当LSA的LS年龄字段包含在路由器的数据库中时,它会递增。此外,当复制到链路状态更新包中以淹没特定接口时,LSA的LS age会增加InfTransDelay。

Each LSA has an LS age field.  The LS age is expressed in seconds.
An LSA's LS age field is incremented while it is contained in a
router's database.  Also, when copied into a Link State Update
Packet for flooding out a particular interface, the LSA's LS age is
incremented by InfTransDelay.

LSA的LS年龄从不递增超过MaxAge值。路由表计算中不使用具有最大年龄的LSA。当路由器老化其链路状态数据库时,LSA的LS老化可能达到MaxAge。[21]此时,路由器必须尝试从路由域中清除LSA。这可以简单地通过重新启动具有MaxAge的LSA来完成,就像是新发起一个LSA一样(参见第13.3节)。

An LSA's LS age is never incremented past the value MaxAge.  LSAs
having age MaxAge are not used in the routing table calculation.  As
a router ages its link state database, an LSA's LS age may reach
MaxAge.[21] At this time, the router must attempt to flush the LSA
from the routing domain.  This is done simply by reflooding the
MaxAge LSA just as if it was a newly originated LSA (see Section
13.3).

当为新形成的邻接创建数据库摘要列表时,链路状态数据库中存在的任何具有MaxAge的LSA都会添加到邻居的链路状态重传列表中,而不是邻居的数据库摘要列表中。详见第10.3节。

When creating a Database summary list for a newly forming adjacency,
any MaxAge LSAs present in the link state database are added to the
neighbor's Link state retransmission list instead of the neighbor's
Database summary list.  See Section 10.3 for more details.

一旦a)具有MaxAge的LSA不再包含在任何邻居链路状态重传列表中,以及b)路由器的邻居均未处于Exchange或Loading状态,则必须立即从路由器的链路状态数据库中删除具有MaxAge的LSA。

A MaxAge LSA must be removed immediately from the router's link
state database as soon as both a) it is no longer contained on any
neighbor Link state retransmission lists and b) none of the router's
neighbors are in states Exchange or Loading.

当在链路状态数据库老化过程中,LSA的LS老化达到CheckAge的倍数时,应验证其LS校验和。如果LS校验和不正确,则已检测到程序或内存错误,至少应重新启动路由器本身。

When, in the process of aging the link state database, an LSA's LS
age hits a multiple of CheckAge, its LS checksum should be verified.
If the LS checksum is incorrect, a program or memory error has been
detected, and at the very least the router itself should be
restarted.

--------------------------------------------------------------------[Page 155]

14.1.LSAs的提前老化

通过将LSA的LS年龄设置为MaxAge,同时保留其LS序列号,然后重新泛洪LSA,可以从路由域中清除LSA。该过程与冲洗LS年龄自然达到MaxAge值的LSA的过程相同(参见第14节)。特别是,一旦a)具有MaxAge的LSA不再包含在任何邻居链路状态重传列表中,并且b)路由器的邻居都不处于Exchange或Loading状态,就将其从路由器的链路状态数据库中删除。我们将LSA的LS年龄设置为MaxAge称为“过早老化”。

    An LSA can be flushed from the routing domain by setting its LS
    age to MaxAge, while leaving its LS sequence number alone, and
    then reflooding the LSA.  This procedure follows the same course
    as flushing an LSA whose LS age has naturally reached the value
    MaxAge (see Section 14).  In particular, the MaxAge LSA is
    removed from the router's link state database as soon as a) it
    is no longer contained on any neighbor Link state retransmission
    lists and b) none of the router's neighbors are in states
    Exchange or Loading.  We call the setting of an LSA's LS age to
    MaxAge "premature aging".

提前老化是在自己产生的LSA序列号字段需要包装时使用的。此时,当前LSA实例(具有LS序列号MaxSequenceNumber)必须提前老化并从路由域中清除,然后才能发起序列号等于InitialSequenceNumber的新实例。详见第12.1.6节。

    Premature aging is used when it is time for a self-originated
    LSA's sequence number field to wrap.  At this point, the current
    LSA instance (having LS sequence number MaxSequenceNumber) must
    be prematurely aged and flushed from the routing domain before a
    new instance with sequence number equal to InitialSequenceNumber
    can be originated.  See Section 12.1.6 for more information.

例如,当路由器先前通告的外部路由之一不再可用时,也可以使用过早老化。在这种情况下,路由器可以通过过早老化从路由域中清除其AS-external-LSA。此过程优于另一种方法,即为指定LSInfinity度量的目的地发起新的LSA。在泛洪过程中意外接收自己产生的LSA时,也可使用过早老化(见第13.4节)。

    Premature aging can also be used when, for example, one of the
    router's previously advertised external routes is no longer
    reachable.  In this circumstance, the router can flush its AS-
    external-LSA from the routing domain via premature aging. This
    procedure is preferable to the alternative, which is to
    originate a new LSA for the destination specifying a metric of
    LSInfinity.  Premature aging is also be used when unexpectedly
    receiving self-originated LSAs during the flooding procedure
    (see Section 13.4).

路由器可能只会过早老化其自身发起的LSA。路由器可能不会过早老化由其他路由器发起的LSA。当1)LSA的通告路由器等于路由器自己的Router ID或2)LSA是network-LSA并且其链路状态ID等于路由器自己IP接口地址之一时,LSA被认为是自身发起的。

    A router may only prematurely age its own self-originated LSAs.
    The router may not prematurely age LSAs that have been
    originated by other routers. An LSA is considered self-
    originated when either 1) the LSA's Advertising Router is equal
    to the router's own Router ID or 2) the LSA is a network-LSA and
    its Link State ID is equal to one of the router's own IP
    interface addresses.

--------------------------------------------------------------------[Page 157]

15.虚链路

无法断开单个骨干区域(区域ID=0.0.0.0)的连接,否则自治系统的某些区域将无法访问。为了建立/维护骨干区域的连接完整不可分割性,可以通过非骨干区域配置虚链路。虚拟链路用于连接骨干区域的物理分离配置。虚链路的两个端点是区域边界路由器。必须在两个路由器中配置虚链路。每个路由器中的配置信息由另一个虚拟端点(另一个区域边界路由器)和两个路由器共有的非骨干区域(称为Transit区域)组成。不能通过末节区域配置虚拟链接(参见第3.6节)。

The single backbone area (Area ID = 0.0.0.0) cannot be disconnected,
or some areas of the Autonomous System will become unreachable.  To
establish/maintain connectivity of the backbone, virtual links can
be configured through non-backbone areas.  Virtual links serve to
connect physically separate components of the backbone.  The two
endpoints of a virtual link are area border routers.  The virtual
link must be configured in both routers.  The configuration
information in each router consists of the other virtual endpoint
(the other area border router), and the non-backbone area the two
routers have in common (called the Transit area).  Virtual links
cannot be configured through stub areas (see Section 3.6).

虚链路被视为属于骨干区域并连接两个区域边界路由器的无编号点对点网络。尝试在虚拟链路上建立邻接。当该邻接建立时,虚拟链路将被包括在骨干区域router-LSAs中,并且与骨干区域相关的OSPF包将在邻接上流动。这种邻接在本文件中被称为“虚拟邻接”。

The virtual link is treated as if it were an unnumbered point-to-
point network belonging to the backbone and joining the two area
border routers.  An attempt is made to establish an adjacency over
the virtual link.  When this adjacency is established, the virtual
link will be included in backbone router-LSAs, and OSPF packets
pertaining to the backbone area will flow over the adjacency.  Such
an adjacency has been referred to in this document as a "virtual
adjacency".

在每个端点路由器中,通过检查另一个端点路由器的路由表条目来发现虚链路的开销和可行性。(条目的关联区域必须是配置的Transit区域)。这称为虚拟链路对应的路由表条目。当虚链路的相应路由表条目变得可访问时,会发生InterfaceUp事件。相反,当路由表条目变得不可访问时,会发生InterfaceDown事件。换言之,虚拟链路的可靠性取决于两个端点之间通过过境区域的区域内路径的存在。请注意,底层路径的开销大于十六进制0xffff(router-LSA中接口开销的最大大小)的虚链路应被视为不可操作(即,被视为路径不存在)。

In each endpoint router, the cost and viability of the virtual link
is discovered by examining the routing table entry for the other
endpoint router.  (The entry's associated area must be the
configured Transit area).  This is called the virtual link's
corresponding routing table entry.  The InterfaceUp event occurs for
a virtual link when its corresponding routing table entry becomes
reachable.  Conversely, the InterfaceDown event occurs when its
routing table entry becomes unreachable.  In other words, the
virtual link's viability is determined by the existence of an
intra-area path, through the Transit area, between the two
endpoints.  Note that a virtual link whose underlying path has cost
greater than hexadecimal 0xffff (the maximum size of an interface
cost in a router-LSA) should be considered inoperational (i.e.,
treated the same as if the path did not exist).

虚链路的其他需要详细关注的信息如下:

The other details concerning virtual links are as follows:

@AS-external-LSAs永远不会泛洪于虚邻接。因为相同的AS-external-LSAs已经遍布虚链路的Transit区域。出于同样的原因,在数据库交换过程中,AS-external-LSAs不会在虚邻接上进行汇总。

o   AS-external-LSAs are NEVER flooded over virtual adjacencies.
    This would be duplication of effort, since the same AS-
    external-LSAs are already flooded throughout the virtual link's
    Transit area.  For this same reason, AS-external-LSAs are not
    summarized over virtual adjacencies during the Database Exchange
    process.

@无法配置虚拟链接的开销。它被定义为两个定义区域边界路由器之间的区域内路径的开销。此成本出现在虚拟链路的相应路由表条目中。当虚链路的开销改变时,应该为骨干区域发起新的router-LSA。

o   The cost of a virtual link is NOT configured.  It is defined to
    be the cost of the intra-area path between the two defining area
    border routers.  This cost appears in the virtual link's
    corresponding routing table entry.  When the cost of a virtual
    link changes, a new router-LSA should be originated for the
    backbone area.

@正如虚链路的成本开销和可行性由路由表构建过程(通过构建另一个端点的路由表条目)决定一样,虚接口的IP接口地址和虚邻居的IP地址也是如此。当通过虚链路发送OSPF协议包时,使用这些协议。请注意,当一个(或两个)虚链路端点通过未编号的点对点链路连接到Transit区域时,可能无法计算虚拟接口的IP地址和/或虚拟邻居的IP地址,从而导致虚链路故障。

o   Just as the virtual link's cost and viability are determined by
    the routing table build process (through construction of the
    routing table entry for the other endpoint), so are the IP
    interface address for the virtual interface and the virtual
    neighbor's IP address.  These are used when sending OSPF
    protocol packets over the virtual link. Note that when one (or
    both) of the virtual link endpoints connect to the Transit area
    via an unnumbered point-to-point link, it may be impossible to
    calculate either the virtual interface's IP address and/or the
    virtual neighbor's IP address, thereby causing the virtual link
    to fail.

@在骨干区域每个端点的router-LSA中,虚链路表示为类型4链路,其链路ID设置为虚拟邻居的OSPF路由器ID,其链路数据设置为虚拟接口的IP地址。详见第12.4.1节。

o   In each endpoint's router-LSA for the backbone, the virtual link
    is represented as a Type 4 link whose Link ID is set to the
    virtual neighbor's OSPF Router ID and whose Link Data is set to
    the virtual interface's IP address.  See Section 12.4.1 for more
    information.

@当且仅当非骨干区域用作一个或多个完全相邻虚链路的transit区域时,非骨干区域可以承载转接数据流量(即,被视为“骨干区域”)(参见第6节和第16.1节中的转接能力)。当将主干网络汇总到该区域时(见第12.4.3节),以及在路由计算期间(见第16.3节),需要对该区域进行特殊处理。

o   A non-backbone area can carry transit data traffic (i.e., is
    considered a "transit area") if and only if it serves as the
    Transit area for one or more fully adjacent virtual links (see
    TransitCapability in Sections 6 and 16.1). Such an area requires
    special treatment when summarizing backbone networks into it
    (see Section 12.4.3), and during the routing calculation (see
    Section 16.3).

@链路状态重传之间的时间RxmtInterval是为虚拟链路配置的。这应该远远超过两个路由器之间的预期往返延迟。对于虚拟链路,这可能很难估计;最好是把它做得足够大。

o   The time between link state retransmissions, RxmtInterval, is
    configured for a virtual link.  This should be well over the
    expected round-trip delay between the two routers.  This may be
    hard to estimate for a virtual link; it is better to err on the
    side of making it too large.

16.路由表的计算

本节详细介绍OSPF路由表计算。路由器使用其连接区域的链路状态数据库作为输入,运行以下算法,逐步构建路由表。在每个步骤中,路由器必须访问各个链路状态数据库(例如,由某个路由器发起的router-LSA)。该访问由第12.2节中讨论的查找函数执行。查找过程可以返回LS年龄等于MaxAge的LSA。但在路由表计算中不应使用这样的LSA,并将其视为查找过程失败。

This section details the OSPF routing table calculation.  Using its
attached areas' link state databases as input, a router runs the
following algorithm, building its routing table step by step.  At
each step, the router must access individual pieces of the link
state databases (e.g., a router-LSA originated by a certain router).
This access is performed by the lookup function discussed in Section
12.2.  The lookup process may return an LSA whose LS age is equal to
MaxAge.  Such an LSA should not be used in the routing table
calculation, and is treated just as if the lookup process had
failed.

The OSPF routing table's organization is explained in Section 11.
Two examples of the routing table build process are presented in
Sections 11.2 and 11.3.  This process can be broken into the
following steps:

1@第11节解释了OSPF路由表的组织。第11.2节和第11.3节给出了路由表构建过程的两个示例。该过程可分为以下步骤:

(1) The present routing table is invalidated.  The routing table is
    built again from scratch.  The old routing table is saved so
    that changes in routing table entries can be identified.

2@通过为每个附着区域构建最短路径树来计算区域内路径。特别是,目标类型为“区域边界路由器”的所有路由表条目都将在此步骤中计算。该步骤分为两部分进行描述。首先,只考虑路由器和transit网络之间的链路来构建树。然后将末节网络合并到树中。在区域的最短路径树计算过程中,还将计算区域的TransitCapability,以供稍后在步骤4中使用。

(2) The intra-area routes are calculated by building the shortest-
    path tree for each attached area.  In particular, all routing
    table entries whose Destination Type is "area border router" are
    calculated in this step.  This step is described in two parts.
    At first the tree is constructed by only considering those links
    between routers and transit networks.  Then the stub networks
    are incorporated into the tree. During the area's shortest-path
    tree calculation, the area's TransitCapability is also
    calculated for later use in Step 4.

3@通过检查summary-LSAs,计算区域间路由。如果路由器连接到多个区域(即,它是一个区域边界路由器),则只检查骨干区域summary-LSAs。

(3) The inter-area routes are calculated, through examination of
    summary-LSAs.  If the router is attached to multiple areas
    (i.e., it is an area border router), only backbone summary-LSAs
    are examined.

--------------------------------------------------------------------[Page 157]

4@在连接到一个或多个transit区域(即,发现TransitCapability为TRUE的非骨干区域)的区域边界路由器中,检查transit区域的summary-LSAs,以查看使用transit区域是否存在比上述步骤2-3中发现的更好的路径。

(4) In area border routers connecting to one or more transit areas
    (i.e, non-backbone areas whose TransitCapability is found to be
    TRUE), the transit areas' summary-LSAs are examined to see
    whether better paths exist using the transit areas than were
    found in Steps 2-3 above.

5@通过检查AS-external-LSAs,计算到外部目的地的路由。已经在步骤2-4中确定了AS边界路由器(其发起AS外部LSA)的位置。

(5) Routes to external destinations are calculated, through
    examination of AS-external-LSAs.  The locations of the AS
    boundary routers (which originate the AS-external-LSAs) have
    been determined in steps 2-4.

2-5步将在之后进行详细讨论

Steps 2-5 are explained in further detail below.

由于这些计算对路由表条目所做的更改可能会导致OSPF协议采取进一步的措施。例如,对区域内路由的更改将导致区域边界路由器发起新的summary-LSAs(参见第12.4节)。有关路由表更改导致的OSPF协议操作的完整列表,请参见第16.7节。

Changes made to routing table entries as a result of these
calculations can cause the OSPF protocol to take further actions.
For example, a change to an intra-area route will cause an area
border router to originate new summary-LSAs (see Section 12.4).  See
Section 16.7 for a complete list of the OSPF protocol actions
resulting from routing table changes.

16.1.为区域计算最短生成树

该计算产生与区域(以下称为areaA)相关联的区域内路由集合。路由器以自身为根计算最短路径树。[22]最短路径树的形成在这里分两个阶段完成。在第一阶段,只考虑路由器和transit网络之间的链路。使用Dijkstra算法,从链路状态数据库的这个子集形成一棵树。在第二阶段,通过考虑到stub网络的链接,将叶子添加到树中。

    This calculation yields the set of intra-area routes associated
    with an area (called hereafter Area A).  A router calculates the
    shortest-path tree using itself as the root.[22] The formation
    of the shortest path tree is done here in two stages.  In the
    first stage, only links between routers and transit networks are
    considered.  Using the Dijkstra algorithm, a tree is formed from
    this subset of the link state database.  In the second stage,
    leaves are added to the tree by considering the links to stub
    networks.

将使用第2节中介绍的图形术语解释该过程。该区域的链接状态数据库表示为有向图。图的顶点是路由器、transit网络和stub网络。该过程的第一阶段仅涉及transit点(路由器和transit网络)及其连接链路。在整个最短路径计算过程中,以下数据也与每个transit顶点相关联:

    The procedure will be explained using the graph terminology that
    was introduced in Section 2.  The area's link state database is
    represented as a directed graph.  The graph's vertices are
    routers, transit networks and stub networks.  The first stage of
    the procedure concerns only the transit vertices (routers and
    transit networks) and their connecting links.  Throughout the
    shortest path calculation, the following data is also associated
    with each transit vertex:

--------------------------------------------------------------------[Page 161]

顶点(节点)ID
32位数字,与顶点类型(路由器或网络)一起唯一标识顶点。对于路由器顶点,Vertex ID是路由器的OSPF Router ID。对于网络顶点,它是网络指定路由器的IP地址。

    Vertex (node) ID
        A 32-bit number which together with the vertex type (router
        or network) uniquely identifies the vertex.  For router
        vertices the Vertex ID is the router's OSPF Router ID.  For
        network vertices, it is the IP address of the network's
        Designated Router.

LSA
每个transit顶点都有一个关联的LSA。对于路由器顶点,这是router-LSA。对于transit网络,这是network-LSA(实际上由网络的指定路由器发起)。在任何情况下,LSA的链路状态ID始终等于上述顶点ID。

    An LSA
        Each transit vertex has an associated LSA.  For router
        vertices, this is a router-LSA.  For transit networks, this
        is a network-LSA (which is actually originated by the
        network's Designated Router).  In any case, the LSA's Link
        State ID is always equal to the above Vertex ID.

下一跳列表
从根到该顶点的当前最短路径集的下一跳列表。由于同等开销的多路径能力,可能存在多条最短路径。每个下一跳指示将流量转发到目的地时要使用的传出路由器接口。在广播、点对多点和NBMA网络中,下一跳还包括指向目的地的路径中的下一个路由器(如果有)的IP地址。

    List of next hops
        The list of next hops for the current set of shortest paths
        from the root to this vertex.  There can be multiple
        shortest paths due to the equal-cost multipath capability.
        Each next hop indicates the outgoing router interface to use
        when forwarding traffic to the destination.  On broadcast,
        Point-to-MultiPoint and NBMA networks, the next hop also
        includes the IP address of the next router (if any) in the
        path towards the destination.

从根计算的距离
从根到顶点的当前最短路径集的链接状态开销。路径的链路状态开销计算为路径的组成链路的开销之和(如router-LSAs和network-LSAs中公布的)。如果一条路径的链路状态开销较小,则称其比另一条路径“短”。

    Distance from root
        The link state cost of the current set of shortest paths
        from the root to the vertex.  The link state cost of a path
        is calculated as the sum of the costs of the path's
        constituent links (as advertised in router-LSAs and
        network-LSAs).  One path is said to be "shorter" than
        another if it has a smaller link state cost.

程序的第一阶段(即Dijkstra算法)现在可以总结如下。在算法的每次迭代中,都有一个候选顶点列表。已经找到了从根到这些顶点的路径,但不一定是最短的路径。然而,到最接近根的候选顶点的路径保证是最短的;该顶点被添加到最短路径树中,随后从候选列表中删除,并检查其相邻顶点是否可能添加/修改候选列表。然后算法再次迭代。当候选列表变空时它终止。

    The first stage of the procedure (i.e., the Dijkstra algorithm)
    can now be summarized as follows. At each iteration of the
    algorithm, there is a list of candidate vertices.  Paths from
    the root to these vertices have been found, but not necessarily
    the shortest ones.  However, the paths to the candidate vertex
    that is closest to the root are guaranteed to be shortest; this
    vertex is added to the shortest-path tree, removed from the
    candidate list, and its adjacent vertices are examined for
    possible addition to/modification of the candidate list.  The
    algorithm then iterates again.  It terminates when the candidate
    list becomes empty.

以下步骤详细描述了算法。请记住,我们正在计算areaA的最短路径树。下面对链接状态数据库查找的所有引用都来自区域A的数据库。

    The following steps describe the algorithm in detail.  Remember
    that we are computing the shortest path tree for Area A.  All
    references to link state database lookup below are from Area A's
    database.

1@初始化算法的数据结构。清除候选顶点列表。将最短路径树初始化为仅从根计算(即执行计算的路由器)。将区域A的TransitCapability设置为FALSE。

    (1) Initialize the algorithm's data structures.  Clear the list
        of candidate vertices.  Initialize the shortest-path tree to
        only the root (which is the router doing the calculation).
        Set Area A's TransitCapability to FALSE.

2@调用刚刚添加到树顶点V的顶点。检查与顶点V关联的LSA。这是基于顶点ID在areaA的链路状态数据库中的查找。如果这是router-LSA,并且路由器LSA的V位(参见第a.4.2节)已设置,则将区域a的TransitCapability设置为TRUE。在任何情况下,LSA描述的每个链接都会给邻接顶点带来开销。对于每个描述的链接,(假设它将顶点V连接到顶点W)
(a)如果这是到stub网络的链接,请检查V的LSA中的下一个链接。在最短路径计算的第二阶段,将考虑到stub网络的链路

(b)否则,W是transit顶点(router或transit网络)。在areaA的链路状态数据库中查找顶点W的LSA(router-LSA或network-LSA)。如果LSA不存在,或者它的LS年龄等于MaxAge,或者它没有返回顶点V的链接,请检查V的LSA中的下一个链接。[23]

(c)如果顶点W已经在最短路径树上,请检查LSA中的下一个链接。

(d)计算从根到顶点W的最终路径的链路状态开销D。D等于(已经计算的)到顶点V的最短路径的链路开销与顶点V和W之间的链路的通告开销之和。如果D为:

@大于候选列表上顶点W已经出现的值,然后检查下一个链接。
@等于候选列表上顶点W出现的值,计算使用通告链接产生的下一跳集。此计算的输入是目的地(W)及其父级(V)。该计算如第16.1.1节所示。这组跳数应添加到候选列表上W的下一跳数值中。
@小于候选列表上顶点W出现的值,或者如果W尚未出现在候选列表上,则在候选列表中设置W的条目,以指示与根的距离为D。此外,还计算使用通告链接产生的下一跳列表,并相应地设置W的下一个跳值。第16.1.1节描述了下一跳计算;它将目的地(W)及其父级(V)作为输入。

    (2) Call the vertex just added to the tree vertex V.  Examine
        the LSA associated with vertex V.  This is a lookup in the
        Area A's link state database based on the Vertex ID.  If
        this is a router-LSA, and bit V of the router-LSA (see
        Section A.4.2) is set, set Area A's TransitCapability to
        TRUE.  In any case, each link described by the LSA gives the
        cost to an adjacent vertex.  For each described link, (say
        it joins vertex V to vertex W):

        (a) If this is a link to a stub network, examine the next
            link in V's LSA.  Links to stub networks will be
            considered in the second stage of the shortest path
            calculation.

        (b) Otherwise, W is a transit vertex (router or transit
            network).  Look up the vertex W's LSA (router-LSA or
            network-LSA) in Area A's link state database.  If the
            LSA does not exist, or its LS age is equal to MaxAge, or
            it does not have a link back to vertex V, examine the
            next link in V's LSA.[23]

        (c) If vertex W is already on the shortest-path tree,
            examine the next link in the LSA.

        (d) Calculate the link state cost D of the resulting path
            from the root to vertex W.  D is equal to the sum of the
            link state cost of the (already calculated) shortest
            path to vertex V and the advertised cost of the link
            between vertices V and W.  If D is:

--------------------------------------------------------------------[Page 163]

            o   Greater than the value that already appears for
                vertex W on the candidate list, then examine the
                next link.

            o   Equal to the value that appears for vertex W on the
                candidate list, calculate the set of next hops that
                result from using the advertised link.  Input to
                this calculation is the destination (W), and its
                parent (V).  This calculation is shown in Section
                16.1.1.  This set of hops should be added to the
                next hop values that appear for W on the candidate
                list.

            o   Less than the value that appears for vertex W on the
                candidate list, or if W does not yet appear on the
                candidate list, then set the entry for W on the
                candidate list to indicate a distance of D from the
                root.  Also calculate the list of next hops that
                result from using the advertised link, setting the
                next hop values for W accordingly.  The next hop
                calculation is described in Section 16.1.1; it takes
                as input the destination (W) and its parent (V).

(3)如果在这一步中候选列表是空的,那么(transit顶点的)最短路径树已经完全构建完毕,该过程的这一阶段结束。否则,选择属于最接近根的候选列表的顶点,并将其添加到最短路径树中(在此过程中从候选列表中删除)。请注意,当选择最接近根的顶点时,必须在路由器顶点之前选择网络顶点,以便必须找到所有相等开销的路径。这与OSPF的组播路由扩展(MOSPF)使用的改进Dijkstra算法中引入的tie-breakers一致。

    (3) If at this step the candidate list is empty, the shortest-
        path tree (of transit vertices) has been completely built
        and this stage of the procedure terminates.  Otherwise,
        choose the vertex belonging to the candidate list that is
        closest to the root, and add it to the shortest-path tree
        (removing it from the candidate list in the process). Note
        that when there is a choice of vertices closest to the root,
        network vertices must be chosen before router vertices in
        order to necessarily find all equal-cost paths. This is
        consistent with the tie-breakers that were introduced in the
        modified Dijkstra algorithm used by OSPF's Multicast routing
        extensions (MOSPF).

(4)可能修改路由表。对于修改的路由表条目,相关区域将设置为areaA,路径类型将设置为内部区域,开销将设置为新发现的最短路径的计算距离。

    (4) Possibly modify the routing table.  For those routing table
        entries modified, the associated area will be set to Area A,
        the path type will be set to intra-area, and the cost will
        be set to the newly discovered shortest path's calculated
        distance.

--------------------------------------------------------------------[Page 164]

如果新添加的顶点是区域边界路由器或AS边界路由器,则会添加一个目的地类型为“路由器”的路由表条目。关联router-LSA中的Options字段被复制到路由表条目的可选功能字段中。调用新添加的顶点路由器X。如果路由器X是计算路由器的一个虚链路的端点,并且虚拟链路使用areaA作为Transit 区域:虚链路被声明,则虚拟接口的IP地址被设置为上面为路由器X计算的出站接口的IP,并且虚拟邻居的IP地址被设置为路由器X的接口地址(包含在路由器X的router-LSA中),该接口地址指向最短路径树的根;等效地,这是指向最短路径树上路由器X的父顶点的接口(类似于第16.1.1节中的计算)。

        If the newly added vertex is an area border router or AS
        boundary router, a routing table entry is added whose
        destination type is "router".  The Options field found in
        the associated router-LSA is copied into the routing table
        entry's Optional capabilities field. Call the newly added
        vertex Router X.  If Router X is the endpoint of one of the
        calculating router's virtual links, and the virtual link
        uses Area A as Transit area:  the virtual link is declared
        up, the IP address of the virtual interface is set to the IP
        address of the outgoing interface calculated above for
        Router X, and the virtual neighbor's IP address is set to
        Router X's interface address (contained in Router X's
        router-LSA) that points back to the root of the shortest-
        path tree; equivalently, this is the interface that points
        back to Router X's parent vertex on the shortest-path tree
        (similar to the calculation in Section 16.1.1).

如果新添加的顶点是transit网络,则会找到该网络的路由表条目。条目的Destination ID是IP网络号,可以通过使用关联的子网掩码(在关联network-LSA中找到)匹配Vertex ID(链路状态ID)来获得。如果路由表条目已经存在(即,已经存在到路由表中安装的目的地的区域内路由),则多个顶点已映射到同一IP网络。例如,当建立新的指定路由器时,可能会发生这种情况。在这种情况下,当且仅当新找到的路径同样短,且当前路由表条目的链路状态原点的链路状态ID小于新添加的顶点的LSA时,才应覆盖当前路由表项。

        If the newly added vertex is a transit network, the routing
        table entry for the network is located.  The entry's
        Destination ID is the IP network number, which can be
        obtained by masking the Vertex ID (Link State ID) with its
        associated subnet mask (found in the body of the associated
        network-LSA).  If the routing table entry already exists
        (i.e., there is already an intra-area route to the
        destination installed in the routing table), multiple
        vertices have mapped to the same IP network.  For example,
        this can occur when a new Designated Router is being
        established.  In this case, the current routing table entry
        should be overwritten if and only if the newly found path is
        just as short and the current routing table entry's Link
        State Origin has a smaller Link State ID than the newly
        added vertex' LSA.

如果网络没有路由表条目(通常情况下),则应添加IP网络的路由表条目。路由表条目的链路状态原点应设置为新添加的顶点“LSA”。

        If there is no routing table entry for the network (the
        usual case), a routing table entry for the IP network should
        be added.  The routing table entry's Link State Origin
        should be set to the newly added vertex' LSA.

(5)通过返回步骤2来迭代算法。

   (5) Iterate the algorithm by returning to Step 2.

--------------------------------------------------------------------[Page 165]

在程序的第二阶段,stub网络被添加到树中。在此阶段,再次检查所有路由器顶点。在上述第一阶段中被确定为不可到达的那些被丢弃。对于每个可到达的路由器顶点(称为V),关联的 router-LSA可以在链路状态数据库中找到。然后检查LSA中出现的每个stub网络链路,并执行以下步骤:

    The stub networks are added to the tree in the procedure's
    second stage.  In this stage, all router vertices are again
    examined.  Those that have been determined to be unreachable in
    the above first phase are discarded.  For each reachable router
    vertex (call it V), the associated router-LSA is found in the
    link state database.  Each stub network link appearing in the
    LSA is then examined, and the following steps are executed:

(1)计算stub网络距根的距离D。D等于从根到路由器顶点的距离(在阶段1中计算)加上stub网络链路的通告开销。将此距离与stub网络的当前最佳开销进行比较。这是通过查找开销网络的当前路由表条目来完成的。如果计算的距离D较大,则继续检查LSA中的下一个开销网络链路

    (1) Calculate the distance D of stub network from the root.  D
        is equal to the distance from the root to the router vertex
        (calculated in stage 1), plus the stub network link's
        advertised cost.  Compare this distance to the current best
        cost to the stub network.  This is done by looking up the
        stub network's current routing table entry.  If the
        calculated distance D is larger, go on to examine the next
        stub network link in the LSA.

(2)如果达到此步骤,则必须更新stub网络的路由表条目。计算使用stub网络链路将产生的下一跳集。该计算如第16.1.1节所示;该计算的输入是目标(stub网络)和父顶点(路由器顶点)。如果距离D与当前路由表开销相同,只需将这组下一跳添加到路由表条目的下一跳列表中。在这种情况下,路由表已经有一个链路状态原点。如果此链路状态原点是链路状态ID小于V的路由器ID的router-LSA,请将链路状态原点重置为V的router-LSA

    (2) If this step is reached, the stub network's routing table
        entry must be updated.  Calculate the set of next hops that
        would result from using the stub network link.  This
        calculation is shown in Section 16.1.1; input to this
        calculation is the destination (the stub network) and the
        parent vertex (the router vertex).  If the distance D is the
        same as the current routing table cost, simply add this set
        of next hops to the routing table entry's list of next hops.
        In this case, the routing table already has a Link State
        Origin.  If this Link State Origin is a router-LSA whose
        Link State ID is smaller than V's Router ID, reset the Link
        State Origin to V's router-LSA.

否则D小于路由表开销。通过将路由表条目的开销设置为D,并将条目的下一跳列表设置为新计算的集合,覆盖当前路由表条目。将路由表条目的链路状态原点设置为V的router-LSA。然后继续检查下一个stub网络链接。

        Otherwise D is smaller than the routing table cost.
        Overwrite the current routing table entry by setting the
        routing table entry's cost to D, and by setting the entry's
        list of next hops to the newly calculated set.  Set the
        routing table entry's Link State Origin to V's router-LSA.
        Then go on to examine the next stub network link.

对于在第二阶段中添加/修改的所有路由表条目,关联区域将设置为areaA,路径类型将设置为内部区域。当可达router-LSAs的列表用尽时,第二阶段完成。此时,已经确定了与区域A相关联的所有区域内路线。

    For all routing table entries added/modified in the second
    stage, the associated area will be set to Area A and the path
    type will be set to intra-area.  When the list of reachable
    router-LSAs is exhausted, the second stage is completed.  At
    this time, all intra-area routes associated with Area A have
    been determined.

该规范不要求使用上述两阶段方法来计算最短路径树。然而,如果使用另一种算法,则必须生成相同的树。因此,重要的是要注意,transit顶点之间的链接必须是双向的,才能包含在上述树中。还应该提到的是,存在更有效的算法来计算树;例如[Ref1]中描述的增量SPF算法。

    The specification does not require that the above two stage
    method be used to calculate the shortest path tree.  However, if
    another algorithm is used, an identical tree must be produced.
    For this reason, it is important to note that links between
    transit vertices must be bidirectional in order to be included
    in the above tree.  It should also be mentioned that more
    efficient algorithms exist for calculating the tree; for
    example, the incremental SPF algorithm described in [Ref1].

16.1.1.下一跳计算

本节解释了如何计算要用于目的地的当前下一跳集。每个下一跳包括用于将数据包转发到目的地的出接口以及下一跳路由器的IP地址(如果有)。每次发现到目的地的较短路径时,都会调用下一跳计算。这可能发生在最短路径树计算的任何阶段(见第16.1节)。在最短路径树计算的阶段1中,当目的地被添加到候选列表时,或者当目的地在候选列表上的条目被修改时,找到较短路径(阶段1的步骤2d)。在阶段2中,每次修改目的地的路由表条目时都会发现更短的路径(阶段2的步骤2)。

        This section explains how to calculate the current set of
        next hops to use for a destination.  Each next hop consists
        of the outgoing interface to use in forwarding packets to
        the destination together with the IP address of the next hop
        router (if any).  The next hop calculation is invoked each
        time a shorter path to the destination is discovered.  This
        can happen in either stage of the shortest-path tree
        calculation (see Section 16.1).  In stage 1 of the
        shortest-path tree calculation a shorter path is found as
        the destination is added to the candidate list, or when the
        destination's entry on the candidate list is modified (Step
        2d of Stage 1).  In stage 2 a shorter path is discovered
        each time the destination's routing table entry is modified
        (Step 2 of Stage 2).

当发现越来越短的路径时,在最短路径树计算期间,可以多次重新计算用于目的地的下一跳集。最终,目的地的路由表条目将始终反映由绝对最短路径产生的下一跳。

        The set of next hops to use for the destination may be
        recalculated several times during the shortest-path tree
        calculation, as shorter and shorter paths are discovered.
        In the end, the destination's routing table entry will
        always reflect the next hops resulting from the absolute
        shortest path(s).

下一跳计算的输入是a)目的地和b)根(计算路由器)和目的地之间当前最短路径中的父节点。父节点始终是transit顶点(即,始终是路由器或transit网络)。

        Input to the next hop calculation is a) the destination and
        b) its parent in the current shortest path between the root
        (the calculating router) and the destination.  The parent is
        always a transit vertex (i.e., always a router or a transit
        network).

--------------------------------------------------------------------[Page 167]

如果在目标和根之间的当前最短路径中至少有一个中间路由器,则目标只需从父节点继承下一跳的集合。否则,有两种情况。在第一种情况下,父顶点是根(计算路由器本身)。这意味着目的地是直连的网络或直连的路由器。在这种情况下,出接口只是连接到目标网络/路由器的OSPF接口。如果目的地是经由点对多点网络连接到计算路由器的路由器,可以通过检查目的地的router-LSA来确定目的地的下一跳IP地址:每个指向计算路由器并具有属于点对多点网络的链路数据字段的链路可提供下一跳路由器的IP地址。如果目的地是直连的网络,或者是通过点对点接口连接到计算路由器的路由器,则不需要下一跳IP地址。如果目的地是通过虚链路连接到计算路由器的路由器,则下一跳的设置应推迟到第16.3节中的计算。

        If there is at least one intervening router in the current
        shortest path between the destination and the root, the
        destination simply inherits the set of next hops from the
        parent.  Otherwise, there are two cases.  In the first case,
        the parent vertex is the root (the calculating router
        itself).  This means that the destination is either a
        directly connected network or directly connected router.
        The outgoing interface in this case is simply the OSPF
        interface connecting to the destination network/router. If
        the destination is a router which connects to the
        calculating router via a Point-to-MultiPoint network, the
        destination's next hop IP address(es) can be determined by
        examining the destination's router-LSA: each link pointing
        back to the calculating router and having a Link Data field
        belonging to the Point-to-MultiPoint network provides an IP
        address of the next hop router. If the destination is a
        directly connected network, or a router which connects to
        the calculating router via a point-to-point interface, no
        next hop IP address is required. If the destination is a
        router connected to the calculating router via a virtual
        link, the setting of the next hop should be deferred until
        the calculation in Section 16.3.

在第二种情况下,父顶点是将计算路由器直接连接到目标路由器的网络。然后通过检查目的地的router-LSA来确定下一跳的列表。对于router-LSA指向父网络的每个链路,链路的链路数据字段提供下一跳路由器的IP地址。然后,可以从下一跳IP地址导出要使用的出接口(也可以从父网络继承)。

        In the second case, the parent vertex is a network that
        directly connects the calculating router to the destination
        router.  The list of next hops is then determined by
        examining the destination's router-LSA.  For each link in
        the router-LSA that points back to the parent network, the
        link's Link Data field provides the IP address of a next hop
        router.  The outgoing interface to use can then be derived
        from the next hop IP address (or it can be inherited from
        the parent network).

16.2.计算区域间路由

通过检查summary-LSAs来计算区域间路线。如果路由器有多个区域的活动连接,则只检查骨干区域summary-LSAs。连接到单个区域的路由器检查该区域的summary-LSAs。无论哪种情况,下面检查的summary-LSAs都是单个区域链路状态数据库(称为areaA)的一部分。

    The inter-area routes are calculated by examining summary-LSAs.
    If the router has active attachments to multiple areas, only
    backbone summary-LSAs are examined.  Routers attached to a
    single area examine that area's summary-LSAs.  In either case,
    the summary-LSAs examined below are all part of a single area's
    link state database (call it Area A).

Summary-LSAs由区域边界路由器发起。依次考虑区域A中的每个Summary-LSAs。请记住,Summary-LSAs描述的目的地是网络(类型3 Summary-LSAs)或AS边界路由器(类型4 summary-LSAs)。对于每个summary-LSAs:

    Summary-LSAs are originated by the area border routers.  Each
    summary-LSA in Area A is considered in turn.  Remember that the
    destination described by a summary-LSA is either a network (Type
    3 summary-LSAs) or an AS boundary router (Type 4 summary-LSAs).
    For each summary-LSA:

(1)如果LSA指定的成本是LSInfinity,或者LSA的LS年龄等于MaxAge,则检查下一个LSA。

    (1) If the cost specified by the LSA is LSInfinity, or if the
        LSA's LS age is equal to MaxAge, then examine the the next
        LSA.

(2)如果LSA是由计算路由器本身发起的,请检查下一个LSA。

    (2) If the LSA was originated by the calculating router itself,
        examine the next LSA.

(3)如果它是类型3 summary-LSA,并且summary-LSA描述的目的地集合等于路由器配置的区域地址范围之一(参见第3.5节),并且特定区域地址范围是活动的,则应忽略summary-LSA。“活动”是指区域范围内包含一个或多个可到达的(通过区域内路径)网络。

    (3) If it is a Type 3 summary-LSA, and the collection of
        destinations described by the summary-LSA equals one of the
        router's configured area address ranges (see Section 3.5),
        and the particular area address range is active, then the
        summary-LSA should be ignored.  "Active" means that there
        are one or more reachable (by intra-area paths) networks
        contained in the area range.

(4)否则,调用LSA N描述的目的地(对于类型3 summary-LSAs,N的地址是通过用LSA中包含的网络/子网掩码匹配LSA的链路状态ID而获得的),以及发起LSA BR的区域边界。查找路由表条目,查找以区域A为关联区域的BR。如果路由器BR不存在此类条目(即,BR在areaA中不可访问),则不要对此LSA执行任何操作,并考虑列表中的下一个条目。否则,此LSA描述到目的地N的区域间路径,其成本是到BR的距离加上LSA中指定的开销。调用此区域间路径的开销IAC

    (4) Else, call the destination described by the LSA N (for Type
        3 summary-LSAs, N's address is obtained by masking the LSA's
        Link State ID with the network/subnet mask contained in the
        body of the LSA), and the area border originating the LSA
        BR.  Look up the routing table entry for BR having Area A as
        its associated area.  If no such entry exists for router BR
        (i.e., BR is unreachable in Area A), do nothing with this
        LSA and consider the next in the list.  Else, this LSA
        describes an inter-area path to destination N, whose cost is
        the distance to BR plus the cost specified in the LSA. Call
        the cost of this inter-area path IAC.

(5)接下来,查找目的地N的路由表条目(如果N是AS边界路由器,则查找与areaA关联的“路由器”路由表条目)。如果不存在N的条目或条目的路径类型为“类型1外部”或“类型2外部”,则将区域间路径安装为N,相关区域为区域A,开销为IAC,下一跳等于路由器BR的下一跳列表,通告路由器等于BR。

    (5) Next, look up the routing table entry for the destination N.
        (If N is an AS boundary router, look up the "router" routing
        table entry associated with Area A).  If no entry exists for
        N or if the entry's path type is "type 1 external" or "type
        2 external", then install the inter-area path to N, with
        associated area Area A, cost IAC, next hop equal to the list
        of next hops to router BR, and Advertising router equal to
        BR.

--------------------------------------------------------------------[Page 169]

(6)否则,如果表中存在的路径是区域内路径,则不要使用LSA(区域内路径总是首选)。

    (6) Else, if the paths present in the table are intra-area
        paths, do nothing with the LSA (intra-area paths are always
        preferred).

(7)否则,路由表中存在的路径也是区域间路径。如果更便宜,通过BR安装新路径,覆盖路由表中的路径。否则,如果新路径的开销相同,请将其添加到路由表条目中显示的路径列表中。

    (7) Else, the paths present in the routing table are also
        inter-area paths.  Install the new path through BR if it is
        cheaper, overriding the paths in the routing table.
        Otherwise, if the new path is the same cost, add it to the
        list of paths that appear in the routing table entry.

16.3.检查transit的summary-LSAs

该步骤仅由连接到一个或多个能够承载过境流量的非骨干区域(即“transit区域”,或在Dijkstra算法步骤2中TransitCapability参数设置为TRUE的区域)的区域边界路由器执行(见第16.1节)。

    This step is only performed by area border routers attached to
    one or more non-backbone areas that are capable of carrying
    transit traffic (i.e., "transit areas", or those areas whose
    TransitCapability parameter has been set to TRUE in Step 2 of
    the Dijkstra algorithm (see Section 16.1).

以下计算的目的是检查transit区域,看看它们是否提供了比第16.1节和第16.2节中先前计算的路径更好(更短)的路径。发现的任何路径都优于或等于先前发现的路径,都将安装在路由表中。

    The purpose of the calculation below is to examine the transit
    areas to see whether they provide any better (shorter) paths
    than the paths previously calculated in Sections 16.1 and 16.2.
    Any paths found that are better than or equal to previously
    discovered paths are installed in the routing table.

该计算还确定了那些目的地的实际下一跳,这些目的地的下一跳在第16.1节和第16.2节中被计算为虚拟链路。在完成以下计算后,应丢弃第16.1和16.2节计算的仍有未解析的虚拟下一跳的任何路径。

    The calculation also determines the actual next hop(s) for those
    destinations whose next hop was calculated as a virtual link in
    Sections 16.1 and 16.2.  After completion of the calculation
    below, any paths calculated in Sections 16.1 and 16.2 that still
    have unresolved virtual next hops should be discarded.

计算过程如下。依次检查所有transit区的summary-LSAs。每个这样的summary-LSAs描述了通过transit区域areaA到网络N的路由(N的地址是通过用LSA中包含的网络/子网掩码匹配LSA的链路状态ID而获得的),或者在类型4 summary-LSA的情况下,描述了到AS边界路由器N的路由。还假设summary-LSA由区域边界路由器BR发起。

    The calculation proceeds as follows. All the transit areas'
    summary-LSAs are examined in turn.  Each such summary-LSA
    describes a route through a transit area Area A to a Network N
    (N's address is obtained by masking the LSA's Link State ID with
    the network/subnet mask contained in the body of the LSA) or in
    the case of a Type 4 summary-LSA, to an AS boundary router N.
    Suppose also that the summary-LSA was originated by an area
    border router BR.

1@如果摘要LSA公布的开销是LSInfinity,或者LSA的LS年龄等于MaxAge,则检查下一个LSA

    (1) If the cost advertised by the summary-LSA is LSInfinity, or
        if the LSA's LS age is equal to MaxAge, then examine the
        next LSA.

--------------------------------------------------------------------[Page 170]

2@如果summary-LSA是由计算路由器本身发起的,请检查下一个LSA。

    (2) If the summary-LSA was originated by the calculating router
        itself, examine the next LSA.

3@查找N的路由表条目(如果N是AS边界路由器,请查找与骨干区域关联的“路由器”路由表条目)。如果它不存在,或者如果路由类型不是区域内或区域间,或者如果与路由表条目关联的区域不是骨干区域,则检查下一个LSA。换言之,此计算仅更新第16.1节中的骨干区域内路由和第16.2节中的区间路由。

    (3) Look up the routing table entry for N. (If N is an AS
        boundary router, look up the "router" routing table entry
        associated with the backbone area). If it does not exist, or
        if the route type is other than intra-area or inter-area, or
        if the area associated with the routing table entry is not
        the backbone area, then examine the next LSA. In other
        words, this calculation only updates backbone intra-area
        routes found in Section 16.1 and inter-area routes found in
        Section 16.2.

4@查找与areaA关联的通告路由器BR的路由表条目。如果无法访问,请检查下一个LSA。否则,到目的地N的开销是BR的区域A路由表条目中的开销和LSA中通告的开销之和。将此开销称为IAC。

    (4) Look up the routing table entry for the advertising router
        BR associated with the Area A. If it is unreachable, examine
        the next LSA. Otherwise, the cost to destination N is the
        sum of the cost in BR's Area A routing table entry and the
        cost advertised in the LSA. Call this cost IAC.

5@如果此开销小于N的路由表条目中出现的开销,则用用于BR的跳覆盖N的下一跳列表,并将N的路由选择表开销设置为IAC。否则,如果IAC与N的当前开销相同,则将BR的下一跳列表添加到N的下一个跳列表中。在任何情况下,与N的路由表条目关联的区域必须保持与骨干区域一致,并且路径类型(区域内或区域间)也必须保持相同。

    (5) If this cost is less than the cost occurring in N's routing
        table entry, overwrite N's list of next hops with those used
        for BR, and set N's routing table cost to IAC. Else, if IAC
        is the same as N's current cost, add BR's list of next hops
        to N's list of next hops. In any case, the area associated
        with N's routing table entry must remain the backbone area,
        and the path type (either intra-area or inter-area) must
        also remain the same.

需要注意的是,上面的计算从来不会使无法到达的目的地成为可到达的,相反,只是潜在地找到了通往已到达目的地的更好路径。该计算将发现的任何更好的开销路径安装到路由表条目中,从该条目中可以在summary-LSAs中重新转换为其他区域。

    It is important to note that the above calculation never makes
    unreachable destinations reachable, but instead just potentially
    finds better paths to already reachable destinations.  The
    calculation installs any better cost found into the routing
    table entry, from which it may be readvertised in summary-LSAs
    to other areas.

在这里插入图片描述作为计算的一个例子,考虑Figure 17所示的自治系统。有一个单一的非骨干区域(area1),它将主干物理上分为两部分。为了保持骨干区域的连接,在路由器RT1和RT4之间配置了虚链路。在图的右侧,网络N1属于骨干区域。虚线表示路由器RT5和网络N1之间的区域内骨干区域路径(开销20)比路由器RT4和网络N1(开销100)短得多。路由器RT4和路由器RT5都将网络N1的summary-LSAs注入区域1。

    As an example of the calculation, consider the Autonomous System
    pictured in Figure 17.  There is a single non-backbone area
    (Area 1) that physically divides the backbone into two separate
    pieces. To maintain connectivity of the backbone, a virtual link
    has been configured between routers RT1 and RT4. On the right
    side of the figure, Network N1 belongs to the backbone. The
    dotted lines indicate that there is a much shorter intra-area
    backbone path between router RT5 and Network N1 (cost 20) than
    there is between Router RT4 and Network N1 (cost 100). Both
    Router RT4 and Router RT5 will inject summary-LSAs for Network
    N1 into Area 1.


                  ........................
                  . Area 1 (transit)     .            +
                  .                      .            |
                  .      +---+1        1+---+100      |
                  .      |RT2|----------|RT4|=========|
                  .    1/+---+********* +---+         |
                  .    /*******          .            |
                  .  1/*Virtual          .            |
               1+---+/*  Link            .         Net|work
         =======|RT1|*                   .            | N1
                +---+\                   .            |
                  .   \                  .            |
                  .    \                 .            |
                  .    1\+---+1        1+---+20       |
                  .      |RT3|----------|RT5|=========|
                  .      +---+          +---+         |
                  .                      .            |
                  ........................            +

                Figure 17: Routing through transit areas

在第16.1节中为骨干区域计算了最短路径树之后,路由器RT1(虚链路的左端)将为所有去往网络N1的数据流量计算通过路由器RT4的路径。然而,由于路由器RT5离网络N1非常近,区域1内部的所有路由器(例如,路由器RT2和RT3)将向路由器RT5而不是RT4转发其网络N1流量。实际上,在通过上述计算检查area1的summary-LSAs之后,路由器RT1也将向RT5转发网络N1流量,但是transit流量所采用的实际路径并不遵循虚链路。换言之,虚拟链路允许transit流量通过一个区域,但不规定流量将采取的精确路径。

    After the shortest-path tree has been calculated for the
    backbone in Section 16.1, Router RT1 (left end of the virtual
    link) will have calculated a path through Router RT4 for all
    data traffic destined for Network N1. However, since Router RT5
    is so much closer to Network N1, all routers internal to Area 1
    (e.g., Routers RT2 and RT3) will forward their Network N1
    traffic towards Router RT5, instead of RT4. And indeed, after
    examining Area 1's summary-LSAs by the above calculation, Router
    RT1 will also forward Network N1 traffic towards RT5. Note that
    in this example the virtual link enables transit data traffic to
    be forwarded through Area 1, but the actual path the transit
    data traffic takes does not follow the virtual link.  In other
    words, virtual links allow transit traffic to be forwarded
    through an area, but do not dictate the precise path that the
    traffic will take.

--------------------------------------------------------------------[Page 172]

16.4.计算AS外部路由

AS外部路由是通过检查AS-external-LSAs来计算的。依次考虑每个AS-external-LSAs。大多数AS-external-LSAs描述了到特定IP目的地的路由。AS-external-LSAs还可以描述自治系统的默认路由(目标ID=DefaultDestination,网络/子网掩码=0x00000000)。对于每个AS-external-LSAs:

    AS external routes are calculated by examining AS-external-LSAs.
    Each of the AS-external-LSAs is considered in turn.  Most AS-
    external-LSAs describe routes to specific IP destinations.  An
    AS-external-LSA can also describe a default route for the
    Autonomous System (Destination ID = DefaultDestination,
    network/subnet mask = 0x00000000).  For each AS-external-LSA:

1@如果LSA指定的成本是LSInfinity,或者LSA的LS年龄等于MaxAge,则检查下一个LSA。

    (1) If the cost specified by the LSA is LSInfinity, or if the
        LSA's LS age is equal to MaxAge, then examine the next LSA.

2@如果LSA是由计算路由器本身发起的,请检查下一个LSA。

    (2) If the LSA was originated by the calculating router itself,
        examine the next LSA.

3@用LSA N描述的目的地。通过使用LSA中包含的网络/子网掩码匹配LSA的链路状态ID,可以获得N的地址。查找发起LSA的AS边界路由器(ASBR)的路由表条目(可能每个连接区域一个)。如果路由器ASBR不存在条目(即ASBR不可访问),请不要处理此LSA,并考虑列表中的下一个
否则,此LSA描述到目标N的AS-external-LSA。请检查AS-external-LSA中指定的转发地址。这表示目的地的数据包应转发到的IP地址。
如果转发地址设置为0.0.0.0,则应将数据包发送到ASBR本身。在ASBR的多个路由表条目中,如下所示选择首选条目。如果RFC1583兼容性设置为“禁用”,请按照第16.4.1节中的描述修剪ASBR的路由表条目集。在任何情况下,在剩余路由表条目中,选择开销最低的路由表项;当存在多个最低开销路由表条目时,选择其关联区域具有最大OSPF area ID(当被视为无符号32位整数时)的条目。
如果转发地址非零,请在路由表中查找转发地址。[24]匹配路由表条目必须指定区域内或区域间路径;如果不存在这样的路径,则不处理LSA,并考虑列表中的下一个。

    (3) Call the destination described by the LSA N.  N's address is
        obtained by masking the LSA's Link State ID with the
        network/subnet mask contained in the body of the LSA.  Look
        up the routing table entries (potentially one per attached
        area) for the AS boundary router (ASBR) that originated the
        LSA. If no entries exist for router ASBR (i.e., ASBR is
        unreachable), do nothing with this LSA and consider the next
        in the list.

        Else, this LSA describes an AS external path to destination
        N.  Examine the forwarding address specified in the AS-
        external-LSA.  This indicates the IP address to which
        packets for the destination should be forwarded.

        If the forwarding address is set to 0.0.0.0, packets should
        be sent to the ASBR itself. Among the multiple routing table
        entries for the ASBR, select the preferred entry as follows.
        If RFC1583Compatibility is set to "disabled", prune the set
        of routing table entries for the ASBR as described in
        Section 16.4.1. In any case, among the remaining routing
        table entries, select the routing table entry with the least
        cost; when there are multiple least cost routing table
        entries the entry whose associated area has the largest OSPF
        Area ID (when considered as an unsigned 32-bit integer) is
        chosen.

--------------------------------------------------------------------[Page 173]

        If the forwarding address is non-zero, look up the
        forwarding address in the routing table.[24] The matching
        routing table entry must specify an intra-area or inter-area
        path; if no such path exists, do nothing with the LSA and
        consider the next in the list.

4@设X为ASBR/转发地址的首选路由表条目指定的开销,Y为LSA中指定的开销。X表示链路状态度量,Y表示1或2类外部度量。

    (4) Let X be the cost specified by the preferred routing table
        entry for the ASBR/forwarding address, and Y the cost
        specified in the LSA.  X is in terms of the link state
        metric, and Y is a type 1 or 2 external metric.

5@查找目标N的路由表条目。如果不存在N的条目,请将AS外部路径安装为N,下一跳等于转发地址的下一跳列表,并且通告路由器等于ASBR。如果外部度量类型为1,则路径类型设置为外部类型1,并且成本等于X+Y。如果外部度量类型为2,则路径类型设置为类型2外部,路由成本的链路状态分量为X,类型2开销为Y。

    (5) Look up the routing table entry for the destination N.  If
        no entry exists for N, install the AS external path to N,
        with next hop equal to the list of next hops to the
        forwarding address, and advertising router equal to ASBR.
        If the external metric type is 1, then the path-type is set
        to type 1 external and the cost is equal to X+Y.  If the
        external metric type is 2, the path-type is set to type 2
        external, the link state component of the route's cost is X,
        and the type 2 cost is Y.

6@将LSA描述的AS外部路径与N的路由表条目中的现有路径进行比较,如下所示。如果首选新路径,它将替换N的路由表条目中的现有路径。如果新路径具有相同的优先级,则将其添加到N的路由表条目的路径列表中。
(a)区域内和区域间路径总是优于AS外部路径。

(b)类型1外部路径总是优于类型2外部路径。当所有路径都是类型2外部路径时,总是首选具有最小通告类型2度量的路径

©如果新的AS外部路径仍然无法与N的路由表条目中的当前路径区分,并且RFC1583兼容性设置为“禁用”,则根据到ASBR/转发地址的AS内路径选择首选路径,如第16.4.1节所述。

(d)如果新的AS外部路径仍然无法与N的路由表条目中的当前路径区分,请根据最低开销比较选择首选路径。通过查看到转发地址的距离和通告的类型1度量(X+Y)之和来比较类型1外部路径。通过查看到转发地址的距离来比较通告相等类型2度量的类型2外部路径。

    (6) Compare the AS external path described by the LSA with the
        existing paths in N's routing table entry, as follows. If
        the new path is preferred, it replaces the present paths in
        N's routing table entry.  If the new path is of equal
        preference, it is added to N's routing table entry's list of
        paths.

        (a) Intra-area and inter-area paths are always preferred
            over AS external paths.

        (b) Type 1 external paths are always preferred over type 2
            external paths. When all paths are type 2 external
            paths, the paths with the smallest advertised type 2
            metric are always preferred.

        (c) If the new AS external path is still indistinguishable
            from the current paths in the N's routing table entry,
            and RFC1583Compatibility is set to "disabled", select
            the preferred paths based on the intra-AS paths to the
            ASBR/forwarding addresses, as specified in Section
            16.4.1.

--------------------------------------------------------------------[Page 174]

        (d) If the new AS external path is still indistinguishable
            from the current paths in the N's routing table entry,
            select the preferred path based on a least cost
            comparison.  Type 1 external paths are compared by
            looking at the sum of the distance to the forwarding
            address and the advertised type 1 metric (X+Y).  Type 2
            external paths advertising equal type 2 metrics are
            compared by looking at the distance to the forwarding
            addresses.

16.4.1.外部路径偏好

当多个AS内路径可用于ASBR/转发地址时,以下规则指示优选路径。这些规则适用于当可以通过多个区域访问同一ASBR时,或者当试图决定应优选几个AS-external-LSAs中的哪一个时。在前一种情况下,路径都终止于同一ASBR,而在后一种情况中,路径终止于单独的ASBR/转发地址。无论哪种情况,每条路径都由第11节中定义的单独路由表条目表示。

        When multiple intra-AS paths are available to
        ASBRs/forwarding addresses, the following rules indicate
        which paths are preferred. These rules apply when the same
        ASBR is reachable through multiple areas, or when trying to
        decide which of several AS-external-LSAs should be
        preferred. In the former case the paths all terminate at the
        same ASBR, while in the latter the paths terminate at
        separate ASBRs/forwarding addresses. In either case, each
        path is represented by a separate routing table entry as
        defined in Section 11.

本节仅适用于RFC1583兼容性设置为“禁用”的情况。

        This section only applies when RFC1583Compatibility is set
        to "disabled".

从最高到最低的路径偏好规则如下。请注意,由于这些规则,可能仍有多条路径具有最高优先级。在这种情况下,必须根据开销确定使用路径,如第16.4节所述。
@使用非骨干区域的区域内路径始终是最优选的。

@其他路径,区域内骨干路径和区域间路径,具有同等的优先权。

        The path preference rules, stated from highest to lowest
        preference, are as follows. Note that as a result of these
        rules, there may still be multiple paths of the highest
        preference. In this case, the path to use must be determined
        based on cost, as described in Section 16.4.

        o   Intra-area paths using non-backbone areas are always the
            most preferred.

        o   The other paths, intra-area backbone paths and inter-
            area paths, are of equal preference.

16.5.增量更新–summary-LSAs

当接收到新的summary-LSAs时,无需重新计算整个路由表。用summary-LSAs N描述的目的地(N的地址是通过用LSA正文中包含的网络/子网掩码匹配LSA的链路状态ID获得的),并让areaA成为LSA所属的区域。然后有两种不同的情况:

    When a new summary-LSA is received, it is not necessary to
    recalculate the entire routing table.  Call the destination
    described by the summary-LSA N (N's address is obtained by
    masking the LSA's Link State ID with the network/subnet mask
    contained in the body of the LSA), and let Area A be the area to
    which the LSA belongs. There are then two separate cases:

情况1:区域A是骨干和/或路由器不是区域边界路由器。
在这种情况下,必须进行以下计算。首先,如果当前存在到目的地N的区域间路由,则N的路由表条目无效,保存条目的值以供以后比较。然后,针对单个目的地N再次执行第16.2节中的计算。在该计算中,将检查描述到N的路由的所有areaA的summary-LSAs。此外,如果路由器是连接到一个或多个transit区域的区域边界路由器,则必须针对单个目的地再次运行第16.3节中的计算。如果这些计算的结果改变了到AS边界路由器的开销/路径(如类型4 summary-LSAs的情况)或任何转发地址,则必须通过重新运行第16.4节中的计算来重新检查所有AS- external-LSAs。否则,如果N现在无法访问,则必须为单个目的地N重新执行第16.4章中的计算,以防存在到N的备用外部路由的情况。

    Case 1: Area A is the backbone and/or the router is not an area
        border router.
        In this case, the following calculations must be performed.
        First, if there is presently an inter-area route to the
        destination N, N's routing table entry is invalidated,
        saving the entry's values for later comparisons. Then the
        calculation in Section 16.2 is run again for the single
        destination N. In this calculation, all of Area A's
        summary-LSAs that describe a route to N are examined.  In
        addition, if the router is an area border router attached to
        one or more transit areas, the calculation in Section 16.3
        must be run again for the single destination.  If the
        results of these calculations have changed the cost/path to
        an AS boundary router (as would be the case for a Type 4
        summary-LSA) or to any forwarding addresses, all AS-
        external-LSAs will have to be reexamined by rerunning the
        calculation in Section 16.4.  Otherwise, if N is now newly
        unreachable, the calculation in Section 16.4 must be rerun
        for the single destination N, in case an alternate external
        route to N exists.

情况2:区域A是transit区域并且路由器是区域边界路由器。
在这种情况下,必须进行以下计算。首先,如果N的路由表条目当前包含一个或多个利用transit区域区域A的区域间路径,则应删除这些路径。如果这将从路由表条目中删除所有路径,则该条目应无效。应保存条目的旧值,以便以后比较。接下来,必须针对单个目的地N再次运行第16.3节中的计算。如果该计算结果导致N的开销增加,则必须从第16.1节中规定的Dijkstra算法开始重新运行完整的路由表计算。否则,如果到AS边界路由器(如类型4 summary-LSA的情况)或到任何转发地址的开销/路径已经改变,则必须通过重新运行第16.4节中的计算来重新检查所有AS-external-LSAs。否则,如果新N现在是不到达的,则必须针对单个目的地N重新运行第16.4节中的计算,以防存在到N的备用外部路径。

    Case 2: Area A is a transit area and the router is an area
        border router.
        In this case, the following calculations must be performed.
        First, if N's routing table entry presently contains one or
        more inter-area paths that utilize the transit area Area A,
        these paths should be removed. If this removes all paths
        from the routing table entry, the entry should be
        invalidated.  The entry's old values should be saved for
        later comparisons. Next the calculation in Section 16.3 must
        be run again for the single destination N. If the results of
        this calculation have caused the cost to N to increase, the
        complete routing table calculation must be rerun starting
        with the Dijkstra algorithm specified in Section 16.1.
        Otherwise, if the cost/path to an AS boundary router (as
        would be the case for a Type 4 summary-LSA) or to any
        forwarding addresses has changed, all AS-external-LSAs will
        have to be reexamined by rerunning the calculation in
        Section 16.4.  Otherwise, if N is now newly unreachable, the
        calculation in Section 16.4 must be rerun for the single
        destination N, in case an alternate external route to N
        exists.

16.6.增量更新–AS-external-LSAs

当接收到新的AS-external-LSA时,无需重新计算整个路由表。用AS-external-LSA N描述目的地。通过使用LSA中包含的网络/子网掩码匹配LSA的链路状态ID,可以获得N的地址。如果已经有到达目的地的区域内或区域间路线,则无需重新计算(内部路由优先)。

    When a new AS-external-LSA is received, it is not necessary to
    recalculate the entire routing table.  Call the destination
    described by the AS-external-LSA N.  N's address is obtained by
    masking the LSA's Link State ID with the network/subnet mask
    contained in the body of the LSA. If there is already an intra-
    area or inter-area route to the destination, no recalculation is
    necessary (internal routes take precedence).

否则,必须执行第16.4节中的程序,但仅适用于目的地为N的AS-external-LSAs。在执行此程序之前,N的当前路由表条目应无效。

    Otherwise, the procedure in Section 16.4 will have to be
    performed, but only for those AS-external-LSAs whose destination
    is N.  Before this procedure is performed, the present routing
    table entry for N should be invalidated.

16.7.路由表更改导致的事件

对路由表条目的更改有时会导致OSPF区域边界路由器采取其他操作。这些路由器需要对以下路由表更改进行操作:

    Changes to routing table entries sometimes cause the OSPF area
    border routers to take additional actions.  These routers need
    to act on the following routing table changes:

@路由表条目的开销或路径类型已更改。如果此条目描述的目的地是网络或AS边界路由器,并且这不仅仅是AS外部路由的更改,则可能需要生成新的summary-LSAs(可能每个连接区域都有一个,包括骨干区域)。详见第12.4.3节。如果以前通告的条目已被删除,或不通告再通告到特定区域,则必须通过将LSA的LS年龄设置为MaxAge并重新泛洪,从路由域中清除LSA(参见第14.1节)。

    o   The cost or path type of a routing table entry has changed.
        If the destination described by this entry is a Network or
        AS boundary router, and this is not simply a change of AS
        external routes, new summary-LSAs may have to be generated
        (potentially one for each attached area, including the
        backbone).  See Section 12.4.3 for more information.  If a
        previously advertised entry has been deleted, or is no
        longer advertisable to a particular area, the LSA must be
        flushed from the routing domain by setting its LS age to
        MaxAge and reflooding (see Section 14.1).

@与配置的虚链接关联的路由表条目已更改。这种路由表条目的目的地是区域边界路由器。该变化表示对虚链路的开销或可行性进行了修改。

    o   A routing table entry associated with a configured virtual
        link has changed.  The destination of such a routing table
        entry is an area border router.  The change indicates a
        modification to the virtual link's cost or viability.

--------------------------------------------------------------------[Page 177]

如果条目指示区域边界路由器是新可到达的,则相应的虚链路现在可操作。应为虚拟链接生成InterfaceUp事件,这将导致虚邻接开始形成(参见第10.3节)。此时,还计算虚拟链路的IP接口地址和虚拟邻居的邻居IP地址。

        If the entry indicates that the area border router is newly
        reachable, the corresponding virtual link is now
        operational.  An InterfaceUp event should be generated for
        the virtual link, which will cause a virtual adjacency to
        begin to form (see Section 10.3).  At this time the virtual
        link's IP interface address and the virtual neighbor's
        Neighbor IP address are also calculated.

如果条目指示区域边界路由器不可再访问,则应销毁虚链路及其相关联的邻接。这意味着应该为关联的虚拟链接生成InterfaceDown事件。

        If the entry indicates that the area border router is no
        longer reachable, the virtual link and its associated
        adjacency should be destroyed.  This means an InterfaceDown
        event should be generated for the associated virtual link.

如果条目的开销已经改变,并且存在完全建立的虚邻接,则必须为骨干区域发起新的router-LSA。这又可能导致进一步的路由表更改。

        If the cost of the entry has changed, and there is a fully
        established virtual adjacency, a new router-LSA for the
        backbone must be originated.  This in turn may cause further
        routing table changes.

16.8.等价路由

OSPF协议维护到所有目的地的多个等价路由。这可以从上面用于计算路由表的步骤以及路由表结构的定义中看出。

    The OSPF protocol maintains multiple equal-cost routes to all
    destinations.  This can be seen in the steps used above to
    calculate the routing table, and in the definition of the
    routing table structure.

多条路线中的每一条都具有相同的类型(区域内、区域间、外部类型1或外部类型2)、开销,并且具有相同的关联区域。但是,每条路由可以指定单独的下一跳和广告路由器

    Each one of the multiple routes will be of the same type
    (intra-area, inter-area, type 1 external or type 2 external),
    cost, and will have the same associated area.  However, each
    route may specify a separate next hop and Advertising router.

不需要运行OSPF的路由器跟踪所有可能的到达目的地的等价路由。一个实现可以选择只保留到任何给定目的地的固定数量的路由。这不影响本规范中提出的任何算法。

    There is no requirement that a router running OSPF keep track of
    all possible equal-cost routes to a destination.  An
    implementation may choose to keep only a fixed number of routes
    to any given destination.  This does not affect any of the
    algorithms presented in this specification.

--------------------------------------------------------------------[Page 178]

脚注

[1]图的顶点表示路由器、transit网络或stub网络。由于路由器可能属于多个区域,因此无法对图形的顶点进行着色。

[2]路由器的所有接口都可以是无编号的点对点链路。在这种情况下,必须为路由器分配IP地址。然后,该地址将作为主机路由在路由器的router-LSA中通告。

[3]请注意,在这些情况下,非虚接口和虚接口将具有相同的IP地址。

[4]请注意,没有为未编号的点对点网络的接口生成主机路由,也没有IP数据包可以寻址到这些接口。这与此类接口的状态无关。

[5]了解网络的指定路由器崩溃时会发生什么会很有启发性。声明RT1为网络的指定路由器和RT2为备份指定路由器。如果路由器RT1崩溃(或可能其网络接口失效),网络上的其他路由器将在RouterDeadInterval秒内检测到RT1不存在。所有路由器可能不会同时检测到这一点;在RT2之前检测到RT1不存在的路由器将在一段时间内选择RT2作为指定路由器和备份指定路由器。当RT2检测到RT1不在时,它将自己移动到指定路由器。此时,具有最高路由器优先级的剩余路由器将被选择为备份指定路由器。

[6]在点对点网络上,较低级别的协议指示邻居是否已启动并正在运行。同样,虚拟链路上邻居的存在由路由表计算来指示。然而,在这两种情况下,仍然使用Hello协议。这确保了邻居之间的通信是双向的,并且每个邻居都有一个有效的路由协议层。

[7]当指定路由器的身份发生变化时,处于这种状态的邻居向路由器发送DBD包可能很常见;这意味着在指定路由器的身份上存在一些暂时的分歧。

[8]请注意,路由器可以通过将邻接状态设置回ExStart来重新同步其任何完全建立的邻接。这将导致相邻的另一端处理SeqNumberMismatch事件,并因此返回ExStart状态。

[9]IP网络的地址空间和OSPF路由器ID的地址空间可能重叠。也就是说,网络可能具有与某个路由器的路由器ID相同的IP地址(当被视为32位数字时)。

[10]“丢弃”条目是必要的,以确保区域边界处的路由汇总不会导致分组循环。

[11]假设,对于匹配目的地的两个不同地址范围,一个范围比另一个更具体。非连续子网掩码可以被配置为违反此假设。OSPF协议无法处理此类子网掩码配置。

[12]MaxAgeDiff是一个结构常数。它表示单个LSA实例在整个路由域中泛洪时可能出现的最大时间间隔(秒)。如果两个LSA的差异不仅此,则假定它们是同一LSA的不同实例。当路由器重新启动并失去对LSA先前LS序列号的跟踪时,可能会发生这种情况。详见第13.4节。

[13]当两个LSA具有不同的LS校验和时,假定它们是独立的实例。当路由器重新启动并丢失LSA之前的LS序列号时,可能会发生这种情况。在两个LSA具有相同的LS序列号的情况下,无法确定哪个LSA实际上较新。然而,如果错误的LSA被接受为较新的,则发起路由器将简单地发起另一个实例。详见第13.4节。

[14]有一种情况下,必须根据部分信息进行查找。这是在路由表计算期间,此时必须仅根据其链路状态ID找到network-LSA。这种情况下的查找仍然定义良好,因为没有两个network-LSA可以具有相同的链路状态ID。

[15]这是RFC 1583指定点对点表示的方式。它有三个优点:a)它不需要将子网分配给点对点链路,b)它倾向于偏向路由,使得去往点对点接口的数据包实际上将通过该接口接收(这对于诊断有用),c)它允许邻居的网络自举,而不需要引导程序包含OSPF实现。

[16]这是RIP等协议使用的更传统的点对点表示。

[17]本条款涵盖以下情况:区域间路由未汇总至骨干区域。这是因为区域间路由总是与骨干区域相关联。

[18]仅当非骨干区域a支持转接数据流量(即TransitCapability设置为TRUE)时才调用此子句。例如,在Figure 6的区域配置中,由于路由器RT10和RT11之间配置的虚链路,区域2可以支持transit流量。因此,路由器RT11只需要将单个summary-LSA发起到area2(具有折叠的目的地N9-N11,H1),因为路由器RT11的所有其他符合条件的路由都具有属于区域2本身的下一跳(因此仅需要由其他区域边界路由器通告;在这种情况下,路由器RT10和RT7)。

[19]通过在路由表中保留更多信息,实现可以仅为单个区域重新计算最短路径树。事实上,有一些增量算法允许实现仅重新计算单个区域最短路径树的一部分[Ref1]。然而,这些算法超出了本规范的范围。

[20]这就是链路状态请求列表被清空的方式,这最终导致邻居状态转换为full。详见第10.9节。

[21]LSA的LS年龄以这种方式达到MaxAge应该是相对罕见的情况。通常,LLSA在过期之前会被更新的实例替换。

[22]严格来说,由于等价路由,该算法不会创建树。我们继续使用“树”术语,因为这是现有文献中最常见的。

[23]请注意,存在返回V的任何链接就足够了;它不需要是从V到W考虑的链路的匹配一半。这足以确保在一对相邻路由器之间的数据流量流动之前,它们的链路状态数据库将同步。

[24]当转发地址为非零时,它应该指向属于另一个自治系统的路由器。详见第12.4.4节。

[1]The graph's vertices represent either routers, transit networks,
or stub networks.  Since routers may belong to multiple areas, it is
not possible to color the graph's vertices.

[2]It is possible for all of a router's interfaces to be unnumbered
point-to-point links.  In this case, an IP address must be assigned
to the router.  This address will then be advertised in the router's
router-LSA as a host route.

[3]Note that in these cases both interfaces, the non-virtual and the
virtual, would have the same IP address.

[4]Note that no host route is generated for, and no IP packets can
be addressed to, interfaces to unnumbered point-to-point networks.
This is regardless of such an interface's state.

[5]It is instructive to see what happens when the Designated Router
for the network crashes.  Call the Designated Router for the network
RT1, and the Backup Designated Router RT2.  If Router RT1 crashes
(or maybe its interface to the network dies), the other routers on
the network will detect RT1's absence within RouterDeadInterval
seconds.  All routers may not detect this at precisely the same
time; the routers that detect RT1's absence before RT2 does will,
for a time, select RT2 to be both Designated Router and Backup
Designated Router.  When RT2 detects that RT1 is gone it will move
itself to Designated Router.  At this time, the remaining router
having highest Router Priority will be selected as Backup Designated
Router.

[6]On point-to-point networks, the lower level protocols indicate
whether the neighbor is up and running.  Likewise, existence of the
neighbor on virtual links is indicated by the routing table
calculation.  However, in both these cases, the Hello Protocol is
still used.  This ensures that communication between the neighbors
is bidirectional, and that each of the neighbors has a functioning
routing protocol layer.

[7]When the identity of the Designated Router is changing, it may be
quite common for a neighbor in this state to send the router a
Database Description packet; this means that there is some momentary
disagreement on the Designated Router's identity.

[8]Note that it is possible for a router to resynchronize any of its
fully established adjacencies by setting the adjacency's state back
to ExStart.  This will cause the other end of the adjacency to
process a SeqNumberMismatch event, and therefore to also go back to
ExStart state.

[9]The address space of IP networks and the address space of OSPF
Router IDs may overlap.  That is, a network may have an IP address
which is identical (when considered as a 32-bit number) to some
router's Router ID.

[10]"Discard" entries are necessary to ensure that route
summarization at area boundaries will not cause packet looping.

[11]It is assumed that, for two different address ranges matching
the destination, one range is more specific than the other. Non-
contiguous subnet masks can be configured to violate this
assumption. Such subnet mask configurations cannot be handled by the
OSPF protocol.

[12]MaxAgeDiff is an architectural constant.  It indicates the
maximum dispersion of ages, in seconds, that can occur for a single
LSA instance as it is flooded throughout the routing domain.  If two
LSAs differ by more than this, they are assumed to be different
instances of the same LSA.  This can occur when a router restarts
and loses track of the LSA's previous LS sequence number.  See
Section 13.4 for more details.

[13]When two LSAs have different LS checksums, they are assumed to
be separate instances.  This can occur when a router restarts, and
loses track of the LSA's previous LS sequence number.  In the case
where the two LSAs have the same LS sequence number, it is not
possible to determine which LSA is actually newer.  However, if the
wrong LSA is accepted as newer, the originating router will simply
originate another instance.  See Section 13.4 for further details.

[14]There is one instance where a lookup must be done based on
partial information.  This is during the routing table calculation,
when a network-LSA must be found based solely on its Link State ID.

--------------------------------------------------------------------[Page 180]

The lookup in this case is still well defined, since no two
network-LSAs can have the same Link State ID.

[15]This is the way RFC 1583 specified point-to-point
representation.  It has three advantages: a) it does not require
allocating a subnet to the point-to-point link, b) it tends to bias
the routing so that packets destined for the point-to-point
interface will actually be received over the interface (which is
useful for diagnostic purposes) and c) it allows network
bootstrapping of a neighbor, without requiring that the bootstrap
program contain an OSPF implementation.

[16]This is the more traditional point-to-point representation used
by protocols such as RIP.

[17]This clause covers the case: Inter-area routes are not
summarized to the backbone.  This is because inter-area routes are
always associated with the backbone area.

[18]This clause is only invoked when a non-backbone Area A supports
transit data traffic (i.e., has TransitCapability set to TRUE).  For
example, in the area configuration of Figure 6, Area 2 can support
transit traffic due to the configured virtual link between Routers
RT10 and RT11. As a result, Router RT11 need only originate a single
summary-LSA into Area 2 (having the collapsed destination N9-
N11,H1), since all of Router RT11's other eligible routes have next
hops belonging to Area 2 itself (and as such only need be advertised
by other area border routers; in this case, Routers RT10 and RT7).

[19]By keeping more information in the routing table, it is possible
for an implementation to recalculate the shortest path tree for only
a single area.  In fact, there are incremental algorithms that allow
an implementation to recalculate only a portion of a single area's
shortest path tree [Ref1].  However, these algorithms are beyond the
scope of this specification.

[20]This is how the Link state request list is emptied, which
eventually causes the neighbor state to transition to Full.  See
Section 10.9 for more details.

[21]It should be a relatively rare occurrence for an LSA's LS age to
reach MaxAge in this fashion.  Usually, the LSA will be replaced by
a more recent instance before it ages out.

[22]Strictly speaking, because of equal-cost multipath, the
algorithm does not create a tree.  We continue to use the "tree"
terminology because that is what occurs most often in the existing
literature.

[23]Note that the presence of any link back to V is sufficient; it
need not be the matching half of the link under consideration from V
to W. This is enough to ensure that, before data traffic flows
between a pair of neighboring routers, their link state databases
will be synchronized.

[24]When the forwarding address is non-zero, it should point to a
router belonging to another Autonomous System.  See Section 12.4.4
for more details.

--------------------------------------------------------------------[Page 182]

参考文献

参考原文
--------------------------------------------------------------------[Page 184]

附录A.OSPF数据结构

本附录描述了OSPF协议包和OSPF LSA的格式。OSPF协议直接在IP网络层上运行。在描述任何数据格式之前,先解释OSPF封装的细节。

This appendix describes the format of OSPF protocol packets and OSPF
LSAs.  The OSPF protocol runs directly over the IP network layer.
Before any data formats are described, the details of the OSPF
encapsulation are explained.

接下来介绍OSPF Options字段。此字段描述OSPF路由域可能支持或不支持的各种功能。OSPF Options字段包含在OSPF Hello数据包、DBD包和OSPF LSA中。

Next the OSPF Options field is described.  This field describes
various capabilities that may or may not be supported by pieces of
the OSPF routing domain. The OSPF Options field is contained in OSPF
Hello packets, Database Description packets and in OSPF LSAs.

OSPF数据包格式详见第A.3节。OSPF LSA的描述见第A.4节。

OSPF packet formats are detailed in Section A.3.  A description of
OSPF LSAs appears in Section A.4.

附录A.1.OSPF包的封装

OSPF直接在Internet协议的网络层上运行。因此,OSPF包仅由IP和本地数据链路报头封装。

OSPF runs directly over the Internet Protocol's network layer.  OSPF
packets are therefore encapsulated solely by IP and local data-link
headers.

OSPF没有定义一种将其协议分组分段的方法,并且在传输大于网络MTU的分组时依赖于IP分段。如果需要,OSPF数据包的长度可以达到65535字节(包括IP头)。可能较大的OSPF数据包类型(DBD包、LSR、LSU和LSAck包)通常可以拆分为几个独立的协议数据包,而不会丢失功能。建议这样做;应尽可能避免IP分片。使用此推理,应尝试将通过虚拟链路发送的OSPF数据包的大小限制为576字节,除非正在执行路径MTU发现(参见[Ref22])。OSPF的IP封装的其他重要特性是:

OSPF does not define a way to fragment its protocol packets, and
depends on IP fragmentation when transmitting packets larger than
the network MTU. If necessary, the length of OSPF packets can be up
to 65,535 bytes (including the IP header).  The OSPF packet types
that are likely to be large (Database Description Packets, Link
State Request, Link State Update, and Link State Acknowledgment
packets) can usually be split into several separate protocol
packets, without loss of functionality.  This is recommended; IP
fragmentation should be avoided whenever possible.  Using this
reasoning, an attempt should be made to limit the sizes of OSPF
packets sent over virtual links to 576 bytes unless Path MTU
Discovery is being performed (see [Ref22]).
The other important features of OSPF's IP encapsulation are:

@使用IP组播包。当通过广播网络发送时,一些OSPF消息是组播包。使用两个不同的IP组播包地址。发送到这些组播包地址的数据包不应被转发;目的是只传输一跳。为了确保这些数据包不会经过多跳,它们的IP TTL必须设置为1。

o   Use of IP multicast.  Some OSPF messages are multicast, when
    sent over broadcast networks.  Two distinct IP multicast
    addresses are used.  Packets sent to these multicast addresses
    should never be forwarded; they are meant to travel a single hop
    only.  To ensure that these packets will not travel multiple
    hops, their IP TTL must be set to 1.

--------------------------------------------------------------------[Page 185]

AllSPFRouters
此组播地址分配值224.0.0.5。所有运行OSPF的路由器都应准备好接收发送到此地址的数据包。Hello数据包始终发送到此目的地。此外,某些OSPF协议包在洪泛过程中被发送到此地址。

    AllSPFRouters
        This multicast address has been assigned the value
        224.0.0.5.  All routers running OSPF should be prepared to
        receive packets sent to this address.  Hello packets are
        always sent to this destination.  Also, certain OSPF
        protocol packets are sent to this address during the
        flooding procedure.

AllDRouters
此多播地址分配值224.0.0.6。指定路由器和备份指定路由器必须准备好接收发往此地址的数据包。某些OSPF协议包在洪泛过程期间被发送到此地址。

    AllDRouters
        This multicast address has been assigned the value
        224.0.0.6.  Both the Designated Router and Backup Designated
        Router must be prepared to receive packets destined to this
        address.  Certain OSPF protocol packets are sent to this
        address during the flooding procedure.

@OSPF的IP协议号89。该编号已在网络信息中心注册。IP协议编号分配记录在[Ref11]中

o   OSPF is IP protocol number 89.  This number has been registered
    with the Network Information Center.  IP protocol number
    assignments are documented in [Ref11].

@所有OSPF路由协议包都使用[Ref12]中定义的二进制0000的正常服务TOS值发送。

o   All OSPF routing protocol packets are sent using the normal
    service TOS value of binary 0000 defined in [Ref12].

@发送路由协议数据包时,IP优先级设置为Internetwork Control。在发送和接收过程中,OSPF协议包应优先于常规IP数据流量。将IP报头中的IP优先级字段设置为Internetwork Control[Ref5]可能有助于实现此目标。

o   Routing protocol packets are sent with IP precedence set to
    Internetwork Control.  OSPF protocol packets should be given
    precedence over regular IP data traffic, in both sending and
    receiving.  Setting the IP precedence field in the IP header to
    Internetwork Control [Ref5] may help implement this objective.

--------------------------------------------------------------------[Page 186]

附录A.2.Option字段

参考原文
--------------------------------------------------------------------[Page 188]

附录A.3.OSPF包格式

参考原文
--------------------------------------------------------------------[Page 202]

附录A.4.LSA格式

参考原文
--------------------------------------------------------------------[Page 216]

附录B.结构常量

几个OSPF协议参数具有固定的结构值。这些参数在文本中通过名称(如LSRefreshTime)引用。可配置协议参数使用相同的命名约定。它们的定义见附录C。

Several OSPF protocol parameters have fixed architectural values.
These parameters have been referred to in the text by names such as
LSRefreshTime.  The same naming convention is used for the
configurable protocol parameters.  They are defined in Appendix C.

每个结构常量的名称,以及它的值和它的功能的简短描述。

The name of each architectural constant follows, together with its
value and a short description of its function.

LSRefreshTime
任何不同特定LSA的产生时的最长时间差。如果路由器的自己产生LSA之一的LS年龄字段达到值LSRefreshTime,则发起LSA的新实例,即使LSA的内容(除LSA报头外)将相同。LSRefreshTime的值设置为30分钟。

LSRefreshTime
    The maximum time between distinct originations of any particular
    LSA.  If the LS age field of one of the router's self-originated
    LSAs reaches the value LSRefreshTime, a new instance of the LSA
    is originated, even though the contents of the LSA (apart from
    the LSA header) will be the same.  The value of LSRefreshTime is
    set to 30 minutes.

MinLSInterval
任何不同特定LSA的产生时的最短时间差。MinLSInterval的值设置为5秒。

MinLSInterval
    The minimum time between distinct originations of any particular
    LSA.  The value of MinLSInterval is set to 5 seconds.

MinLSArrival
对于任何特定LSA,洪泛期间接收新LSA实例之间必须经过的最短时间。丢弃在较高频率接收的LSA实例。MinLSArrival的值设置为1秒。

MinLSArrival
    For any particular LSA, the minimum time that must elapse
    between reception of new LSA instances during flooding. LSA
    instances received at higher frequencies are discarded. The
    value of MinLSArrival is set to 1 second.

MaxAge
LSA可以达到的最大年龄。当LSA的LS年龄字段达到MaxAge时,它会被重新引导,试图从路由域中清除LSA(参见第14节)。路由表计算中未使用MaxAge年龄的LSA。MaxAge的值设置为1小时。

MaxAge
    The maximum age that an LSA can attain. When an LSA's LS age
    field reaches MaxAge, it is reflooded in an attempt to flush the
    LSA from the routing domain (See Section 14). LSAs of age MaxAge
    are not used in the routing table calculation.  The value of
    MaxAge is set to 1 hour.

CheckAge
当链路状态数据库中LSA的年龄达到CheckAge的倍数时,将验证LSA的校验和。此时校验和不正确表示严重错误。CheckAge的值设置为5分钟。

CheckAge
    When the age of an LSA in the link state database hits a
    multiple of CheckAge, the LSA's checksum is verified.  An
    incorrect checksum at this time indicates a serious error.  The
    value of CheckAge is set to 5 minutes.

MaxAgeDiff
当LSA在整个as中被泛洪时,可能出现的最大时间差。大部分时间都是由洪泛过程中位于路由器输出队列(因此不会老化)上的LSA占用的。MaxAgeDiff的值设置为15分钟。

MaxAgeDiff
    The maximum time dispersion that can occur, as an LSA is flooded
    throughout the AS.  Most of this time is accounted for by the
    LSAs sitting on router output queues (and therefore not aging)
    during the flooding process.  The value of MaxAgeDiff is set to
    15 minutes.

LSInfinity
指示LSA描述的目标不可到达的度量值。summary-LSAs和AS-external-LSAs,作为过早老化的替代品(见第14.1节)。它被定义为所有1的24位二进制值:0xffffff。(十进制的16777215)

LSInfinity
    The metric value indicating that the destination described by an
    LSA is unreachable. Used in summary-LSAs and AS-external-LSAs as
    an alternative to premature aging (see Section 14.1). It is
    defined to be the 24-bit binary value of all ones: 0xffffff.

DefaultDestination
指示默认路由的目的地ID。当找不到其他匹配的路由表条目时,使用此路由。默认目的地只能在AS-external-LSA和末节区域的类型3 summary-LSAs中通告。其值为IP地址0.0.0.0。其关联的网络掩码也始终为0.0.0.0。

DefaultDestination
    The Destination ID that indicates the default route.  This route
    is used when no other matching routing table entry can be found.
    The default destination can only be advertised in AS-external-
    LSAs and in stub areas' type 3 summary-LSAs.  Its value is the
    IP address 0.0.0.0. Its associated Network Mask is also always
    0.0.0.0.

InitialSequenceNumber
发起任何LSA的第一个实例时用于LS序列号的值。其值为有符号32位整数0x80000001

InitialSequenceNumber
    The value used for LS Sequence Number when originating the first
    instance of any LSA. Its value is the signed 32-bit integer
    0x80000001.

MaxSequenceNumber
LS序列号可以达到的最大值。它的值是带符号的32位整数0x7fffffff。

MaxSequenceNumber
    The maximum value that LS Sequence Number can attain.  Its value
    is the signed 32-bit integer 0x7fffffff.

--------------------------------------------------------------------[Page 218]

附录C.配置常量

OSPF协议有相当多的可配置参数。这些参数如下所示。它们分为一般功能类别(区域参数、接口参数等)。给出了一些参数的示例值。

The OSPF protocol has quite a few configurable parameters.  These
parameters are listed below.  They are grouped into general
functional categories (area parameters, interface parameters, etc.).
Sample values are given for some of the parameters.

一些参数设置需要在路由器组之间保持一致。例如,一个区域中的所有路由器必须协商该区域的参数,并且连接到网络的所有路由器都必须协商一致该网络的IP网络号和掩码。

Some parameter settings need to be consistent among groups of
routers.  For example, all routers in an area must agree on that
area's parameters, and all routers attached to a network must agree
on that network's IP network number and mask.

一些参数可以由本规范之外的路由器算法确定(例如,通过SLIP线路连接到路由器的主机的地址)。从OSPF的角度来看,这些项目仍然是可配置的。

Some parameters may be determined by router algorithms outside of
this specification (e.g., the address of a host connected to the
router via a SLIP line).  From OSPF's point of view, these items are
still configurable.

附录C.1.全局参数

通常,每个区域都会运行OSPF协议的单独副本。因此,大多数配置参数都是按区域定义的。下面列出了几个全局配置参数。

C.1 Global parameters

    In general, a separate copy of the OSPF protocol is run for each
    area.  Because of this, most configuration parameters are
    defined on a per-area basis.  The few global configuration
    parameters are listed below.

Router ID
这是一个32位数字,唯一标识自治系统中的路由器。路由器ID分配的一种算法是选择分配给路由器的最大或最小IP地址。如果路由器的OSPF Router ID被更改,则应在新的Router ID生效之前重新启动路由器的OSPF软件。在重新启动以更改其路由器ID之前,路由器应从路由域中清除其自身发起的LSA(参见第14.1节),否则它们将持续最长MaxAge分钟。

    Router ID
        This is a 32-bit number that uniquely identifies the router
        in the Autonomous System.  One algorithm for Router ID
        assignment is to choose the largest or smallest IP address
        assigned to the router.  If a router's OSPF Router ID is
        changed, the router's OSPF software should be restarted
        before the new Router ID takes effect. Before restarting in
        order to change its Router ID, the router should flush its
        self-originated LSAs from the routing domain (see Section
        14.1), or they will persist for up to MaxAge minutes.

RFC1583Compatibility
控制在多个AS-external-LSAs中选择通告相同目的地时第16.4节中使用的首选规则。当设置为“启用”时,首选项规则仍保留RFC 1583([Ref9])指定的规则。当设置为“禁用”时,首选规则为第16.4.1节中规定的规则,当同一目的地的AS-external-LSAs来自不同区域时,该规则可防止路由循环。默认设置为“启用”。

    RFC1583Compatibility
        Controls the preference rules used in Section 16.4 when
        choosing among multiple AS-external-LSAs advertising the
        same destination. When set to "enabled", the preference
        rules remain those specified by RFC 1583 ([Ref9]). When set
        to "disabled", the preference rules are those stated in
        Section 16.4.1, which prevent routing loops when AS-
        external-LSAs for the same destination have been originated
        from different areas. Set to "enabled" by default.

为了最小化路由循环的机会,OSPF路由域中的所有OSPF路由器都应该具有相同的RFC1583兼容性设置。当存在未使用本备忘录第16.4.1节中规定的功能更新的路由器时,所有路由器应将RFC1583兼容性设置为“启用”。否则,所有路由器应将RFC1583兼容性设置为“禁用”,以防止所有路由循环。

        In order to minimize the chance of routing loops, all OSPF
        routers in an OSPF routing domain should have
        RFC1583Compatibility set identically. When there are routers
        present that have not been updated with the functionality
        specified in Section 16.4.1 of this memo, all routers should
        have RFC1583Compatibility set to "enabled". Otherwise, all
        routers should have RFC1583Compatibility set to "disabled",
        preventing all routing loops.

附录C.2.区域参数

属于某个区域的所有路由器必须协商一致该区域的配置。两个路由器之间的分歧将导致它们之间无法形成邻接,从而阻碍路由协议和数据流量的流动。必须为区域配置以下项目:

C.2 Area parameters

    All routers belonging to an area must agree on that area's
    configuration.  Disagreements between two routers will lead to
    an inability for adjacencies to form between them, with a
    resulting hindrance to the flow of routing protocol and data
    traffic.  The following items must be configured for an area:

Area ID
这是一个32位数字,用于标识该区域。区域ID 0.0.0.0为主干保留。如果区域代表子网网络,则子网网络的IP网络号可用于区域ID。

    Area ID
        This is a 32-bit number that identifies the area.  The Area
        ID of 0.0.0.0 is reserved for the backbone.  If the area
        represents a subnetted network, the IP network number of the
        subnetted network may be used for the Area ID.

地址范围列表
OSPF区域定义为地址范围列表。每个地址范围由以下项目组成:

    List of address ranges
        An OSPF area is defined as a list of address ranges. Each
        address range consists of the following items:

[地址, 掩码]
描述地址范围中包含的IP地址集合。网络和主机被分配给一个区域,这取决于它们的地址是否属于该区域的定义地址范围之一。路由器被视为属于多个区域,这取决于它们所连接的网络的区域成员资格。

        [IP address, mask]
                Describes the collection of IP addresses contained
                in the address range. Networks and hosts are
                assigned to an area depending on whether their
                addresses fall into one of the area's defining
                address ranges.  Routers are viewed as belonging to
                multiple areas, depending on their attached
                networks' area membership.

状态
设置为“通告”或“不通告”。路由信息集中在区域边界。在该区域之外,每个地址范围最多只能通告一条路由(通过summary-LSA)。当且仅当地址范围的状态设置为“通告”时,才会通告路由。未经允许通告某些网络范围被故意隐藏在其他区域之外。状态默认设置为“通告”。

例如,假设一个IP子网网络是其自己的OSPF区域。该区域将被配置为单个地址范围,其IP地址是子网的地址,其掩码是A类、B类或C类地址掩码。一条路由将在该区域外部发布广告,描述整个子网网络。

        Status  Set to either Advertise or DoNotAdvertise.  Routing
                information is condensed at area boundaries.
                External to the area, at most a single route is
                advertised (via a summary-LSA) for each address
                range. The route is advertised if and only if the
                address range's Status is set to Advertise.
                Unadvertised ranges allow the existence of certain
                networks to be intentionally hidden from other
                areas. Status is set to Advertise by default.

        As an example, suppose an IP subnetted network is to be its
        own OSPF area.  The area would be configured as a single
        address range, whose IP address is the address of the
        subnetted network, and whose mask is the natural class A, B,
        or C address mask.  A single route would be advertised
        external to the area, describing the entire subnetted
        network.

ExternalRoutingCapability
AS-external-LSAs是否会被淹没到该区域/整个区域。如果AS-external-LSAs被排除在该区域之外,则该区域称为“末节”。从内部到末节区域,到外部目的地的路由将仅基于默认摘要路由。骨干区域不能配置为末节区域。此外,不能配置虚拟链接横穿末节区域。有关更多信息,请参见第3.6节。

    ExternalRoutingCapability
        Whether AS-external-LSAs will be flooded into/throughout the
        area.  If AS-external-LSAs are excluded from the area, the
        area is called a "stub".  Internal to stub areas, routing to
        external destinations will be based solely on a default
        summary route.  The backbone cannot be configured as a stub
        area.  Also, virtual links cannot be configured through stub
        areas.  For more information, see Section 3.6.

StubDefaultCost
如果该区域已被配置为末节区域,并且路由器本身是区域边界路由器,那么末节默认开销表示路由器应该向该区域通告的默认summary-LSA的开销

    StubDefaultCost
        If the area has been configured as a stub area, and the
        router itself is an area border router, then the
        StubDefaultCost indicates the cost of the default summary-
        LSA that the router should advertise into the area.

附录C.3.路由器接口参数

一些可配置的路由器接口参数(如IP接口地址和子网掩码)实际上暗示了连接网络的属性,因此必须在连接到该网络的所有路由器中保持一致。必须为路由器接口配置的参数包括:

C.3 Router interface parameters

    Some of the configurable router interface parameters (such as IP
    interface address and subnet mask) actually imply properties of
    the attached networks, and therefore must be consistent across
    all the routers attached to that network.  The parameters that
    must be configured for a router interface are:

IP接口地址
此接口的IP协议地址。这将唯一标识整个互联网上的路由器。点对点网络不需要IP地址。这样的点对点网络被称为“无编号”。

    IP interface address
        The IP protocol address for this interface.  This uniquely
        identifies the router over the entire internet.  An IP
        address is not required on point-to-point networks.  Such a
        point-to-point network is called "unnumbered".

IP接口掩码
也称为子网/网络掩码,它表示标识所连接网络的IP接口地址部分。用IP接口掩码屏蔽IP接口地址会产生所连接网络的IP网络号。在点对点网络和虚拟链路上,未定义IP接口掩码。在这些网络上,链路本身没有被分配IP网络号,因此链路每一侧的地址都是独立分配的,如果它们被分配的话。

    IP interface mask
        Also referred to as the subnet/network mask, this indicates
        the portion of the IP interface address that identifies the
        attached network.  Masking the IP interface address with the
        IP interface mask yields the IP network number of the
        attached network.  On point-to-point networks and virtual
        links, the IP interface mask is not defined. On these
        networks, the link itself is not assigned an IP network
        number, and so the addresses of each side of the link are
        assigned independently, if they are assigned at all.

Area ID
连接的网络所属的OSPF区域。

    Area ID
        The OSPF area to which the attached network belongs.

接口输出开销
在接口上发送数据包的开销,以链路状态度量表示。这在路由器的router-LSA中被公布为该接口的链路开销。接口输出开销必须始终大于0。

    Interface output cost
        The cost of sending a packet on the interface, expressed in
        the link state metric.  This is advertised as the link cost
        for this interface in the router's router-LSA. The interface
        output cost must always be greater than 0.

RxmtInterval
对于属于此接口的邻接,LSA重传之间的秒数。也用于重传DBD和LSR包。这应该远远超过连接网络上任意两个路由器之间的预期往返延迟。该值的设置应保守,否则将导致不必要的重传。局域网的示例值:5秒。

    RxmtInterval
        The number of seconds between LSA retransmissions, for
        adjacencies belonging to this interface.  Also used when
        retransmitting Database Description and Link State Request
        Packets.  This should be well over the expected round-trip
        delay between any two routers on the attached network.  The
        setting of this value should be conservative or needless
        retransmissions will result.  Sample value for a local area
        network: 5 seconds.

InfTransDelay
通过此接口传输LSU包所需的估计秒数。更新数据包中包含的LSA必须在传输前将其年龄增加该数量。该值应考虑接口的传输和传播延迟。它必须大于0。局域网的示例值:1秒。

    InfTransDelay
        The estimated number of seconds it takes to transmit a Link
        State Update Packet over this interface.  LSAs contained in
        the update packet must have their age incremented by this
        amount before transmission.  This value should take into
        account the transmission and propagation delays of the
        interface.  It must be greater than 0.  Sample value for a
        local area network: 1 second.

Router Priority
8位无符号整数。当连接到网络的两个路由器都试图成为指定路由器时,具有最高路由器优先级的路由器优先。如果仍然存在平局,则具有最高Router ID的路由器优先。路由器优先级设置为0的路由器没有资格成为连接网络上的指定路由器。路由器优先级仅为广播和NBMA网络的接口配置。

    Router Priority
        An 8-bit unsigned integer.  When two routers attached to a
        network both attempt to become Designated Router, the one
        with the highest Router Priority takes precedence.  If there
        is still a tie, the router with the highest Router ID takes
        precedence.  A router whose Router Priority is set to 0 is
        ineligible to become Designated Router on the attached
        network.  Router Priority is only configured for interfaces
        to broadcast and NBMA networks.

HelloInterval
路由器在接口上发送的Hello数据包之间的时间长度(秒)。此值将在路由器的Hello Packets中通告。连接到公共网络的所有路由器都必须相同。HelloInterval越小,检测到的拓扑变化越快;然而,更多的OSPF路由协议流量将随之而来。X.25 PDN网络的示例值:30秒。局域网的示例值:10秒

    HelloInterval
        The length of time, in seconds, between the Hello Packets
        that the router sends on the interface.  This value is
        advertised in the router's Hello Packets.  It must be the
        same for all routers attached to a common network.  The
        smaller the HelloInterval, the faster topological changes
        will be detected; however, more OSPF routing protocol
        traffic will ensue.  Sample value for a X.25 PDN network: 30
        seconds.  Sample value for a local area network: 10 seconds.

RouterDeadInterval
停止听到路由器的Hello Packets后,其邻居宣布路由器关闭前的秒数。这也会在路由器的Hello Packets中的RouterDeadInterval字段中公布。这应该是HelloInterval的倍数(例如4)。对于连接到公共网络的所有路由器,该值也必须相同。

    RouterDeadInterval
        After ceasing to hear a router's Hello Packets, the number
        of seconds before its neighbors declare the router down.
        This is also advertised in the router's Hello Packets in
        their RouterDeadInterval field.  This should be some
        multiple of the HelloInterval (say 4).  This value again
        must be the same for all routers attached to a common
        network.

AuType
标识要在连接的网络上使用的身份验证过程。对于连接到网络的所有路由器,该值必须相同。参见附录D对定义身份验证类型的讨论。

    AuType
        Identifies the authentication procedure to be used on the
        attached network.  This value must be the same for all
        routers attached to the network.  See Appendix D for a
        discussion of the defined authentication types.

Authentication key
该配置数据允许认证程序验证通过接口接收的OSPF协议包。例如,如果AuType表示简单密码,则Authentication密钥将是一个明文的64位密码。附录D中讨论了与其他OSPF认证类型相关的认证密钥。

    Authentication key
        This configured data allows the authentication procedure to
        verify OSPF protocol packets received over the interface.
        For example, if the AuType indicates simple password, the
        Authentication key would be a clear 64-bit password.
        Authentication keys associated with the other OSPF
        authentication types are discussed in Appendix D.

附录C.4.虚链路参数

虚拟链路用于恢复/增加骨干网的连接。可以在具有到公共(非骨干区域)区域的接口的任何一对区域边界路由器之间配置虚拟链路。虚拟链路在骨干区域的图形中显示为未编号的点对点链路。必须在两个区域边界路由器中配置虚拟链路。

C.4 Virtual link parameters

    Virtual links are used to restore/increase connectivity of the
    backbone.  Virtual links may be configured between any pair of
    area border routers having interfaces to a common (non-backbone)
    area.  The virtual link appears as an unnumbered point-to-point
    link in the graph for the backbone.  The virtual link must be
    configured in both of the area border routers.

虚拟链路出现在router-LSAs(用于骨干区域)中,就像它是到骨干区域的单独路由器接口一样。因此,它具有与路由器接口相关的所有参数(参见第C.3节)。尽管虚拟链路的作用类似于未编号的点对点链路,但它确实有关联的IP接口地址。该地址用作OSPF协议包中的IP源,它沿虚拟链路发送,并在路由表构建过程中动态设置。接口输出开销也在虚拟链路上动态设置为两个路由器之间的区域内路径的开销。必须配置参数RxmtInterval,并且应该远远超过两个路由器之间的预期往返延迟。对于虚拟链路,这可能很难估计;最好是把它做得太大。路由器优先级未用于虚拟链路。

    A virtual link appears in router-LSAs (for the backbone) as if
    it were a separate router interface to the backbone.  As such,
    it has all of the parameters associated with a router interface
    (see Section C.3).  Although a virtual link acts like an
    unnumbered point-to-point link, it does have an associated IP
    interface address.  This address is used as the IP source in
    OSPF protocol packets it sends along the virtual link, and is
    set dynamically during the routing table build process.
    Interface output cost is also set dynamically on virtual links
    to be the cost of the intra-area path between the two routers.
    The parameter RxmtInterval must be configured, and should be
    well over the expected round-trip delay between the two routers.
    This may be hard to estimate for a virtual link; it is better to
    err on the side of making it too large.  Router Priority is not
    used on virtual links.

虚拟链路由以下两个可配置参数定义:虚拟链路的另一个端点的Router ID,以及虚拟链路运行的(非骨干)区域(称为虚拟链路的Transit区域)。无法通过末节区域配置虚拟链接。

    A virtual link is defined by the following two configurable
    parameters: the Router ID of the virtual link's other endpoint,
    and the (non-backbone) area through which the virtual link runs
    (referred to as the virtual link's Transit area).  Virtual links
    cannot be configured through stub areas.

附录C.5.NBMA网络参数

C.5 NBMA network parameters

OSPF对待NBMA网络就像对待广播网络一样。由于可能有许多路由器连接到网络,因此为网络选择了指定路由器。然后,该指定路由器发起network-LSA,其中列出了连接到NBMA网络的所有路由器。

    OSPF treats an NBMA network much like it treats a broadcast
    network.  Since there may be many routers attached to the
    network, a Designated Router is selected for the network.  This
    Designated Router then originates a network-LSA, which lists all
    routers attached to the NBMA network.

然而,由于缺乏广播功能,可能需要在指定路由器选择中使用配置参数。这些参数只需要在那些本身有资格成为指定路由器的路由器(即,网络的路由器优先级为非零的路由器)中进行配置,然后仅在不存在用于发现邻居的自动过程的情况下:

所有其他路由器连接的连接
连接到NBMA网络的所有其他路由器的列表。每个路由器都按其在网络上的IP接口地址列出。此外,对于列出的每个路由器,必须定义该路由器成为指定路由器的资格。当NBMA网络的接口出现时,路由器仅向有资格成为指定路由器的邻居发送Hello Packets,直到发现指定路由器的身份。

轮询间隔
如果相邻路由器已变为非活动状态(在RouterDeadInterval秒内未看到Hello Packets),则可能仍需要向死邻居发送Hello Packats。这些Hello数据包将以降低的速率轮询间隔发送,该速率应比HelloInterval大得多。PDN X.25网络的示例值:2分钟

    However, due to the lack of broadcast capabilities, it may be
    necessary to use configuration parameters in the Designated
    Router selection.  These parameters will only need to be
    configured in those routers that are themselves eligible to
    become Designated Router (i.e., those router's whose Router
    Priority for the network is non-zero), and then only if no
    automatic procedure for discovering neighbors exists:


    List of all other attached routers
        The list of all other routers attached to the NBMA network.
        Each router is listed by its IP interface address on the
        network.  Also, for each router listed, that router's
        eligibility to become Designated Router must be defined.
        When an interface to a NBMA network comes up, the router
        sends Hello Packets only to those neighbors eligible to
        become Designated Router, until the identity of the
        Designated Router is discovered.

    PollInterval
        If a neighboring router has become inactive (Hello Packets
        have not been seen for RouterDeadInterval seconds), it may
        still be necessary to send Hello Packets to the dead
        neighbor.  These Hello Packets will be sent at the reduced
        rate PollInterval, which should be much larger than
        HelloInterval.  Sample value for a PDN X.25 network: 2
        minutes.

附录C.6.点到多点网络参数

在点对多点网络上,可能需要配置可通过点对多点通过网络直接到达的邻居集。每个邻居通过其在点对多点网络上的IP地址来标识。未在点对多点网络上选择指定路由器,因此未定义已配置邻居的指定路由器资格。

或者,点对多点网络上的邻居可以由诸如反向ARP([Ref14])之类的低层协议动态地发现。

C.6 Point-to-MultiPoint network parameters

    On Point-to-MultiPoint networks, it may be necessary to
    configure the set of neighbors that are directly reachable over
    the Point-to-MultiPoint network. Each neighbor is identified by
    its IP address on the Point-to-MultiPoint network. Designated
    Routers are not elected on Point-to-MultiPoint networks, so the
    Designated Router eligibility of configured neighbors is
    undefined.

    Alternatively, neighbors on Point-to-MultiPoint networks may be
    dynamically discovered by lower-level protocols such as Inverse
    ARP ([Ref14]).

附录C.7.主机路由参数

主机路由在路由器LSA中作为带有掩码0xffffff的存根网络进行通告。它们表示指向点对点网络的路由器接口、环形路由器接口或直接连接到路由器的IP主机(例如,通过SLIP线路)。对于直接连接到路由器的每个主机,必须配置以下项目:

主机IP地址
主机的IP地址

主机链路开销
根据链路状态度量,向主机发送数据包的开销。然而,由于主机可能只有一个到互联网的连接,因此在许多情况下实际配置的成本并不重要(即,对路由没有影响)。

区域ID
主机所属的OSPF区域。

C.7 Host route parameters

    Host routes are advertised in router-LSAs as stub networks with
    mask 0xffffffff.  They indicate either router interfaces to
    point-to-point networks, looped router interfaces, or IP hosts
    that are directly connected to the router (e.g., via a SLIP
    line).  For each host directly connected to the router, the
    following items must be configured:

    Host IP address
        The IP address of the host.

    Cost of link to host
        The cost of sending a packet to the host, in terms of the
        link state metric.  However, since the host probably has
        only a single connection to the internet, the actual
        configured cost in many cases is unimportant (i.e., will
        have no effect on routing).

    Area ID
        The OSPF area to which the host belongs.

--------------------------------------------------------------------[Page 226]

附录D.认证

参考原文
--------------------------------------------------------------------[Page 235]

附录E.一种分配链路状态ID的算法

AS-external-LSAs和summary-LSAs中的链路状态ID通常设置为所述网络的IP地址。然而,如果需要,可以在链路状态ID中设置网络的一个或多个主机位。这允许路由器为具有相同地址但不同掩码的网络发起不同的LSA。这种网络可以在存在超网和子网0s的情况下发生(参见[参考文献10])。

The Link State ID in AS-external-LSAs and summary-LSAs is usually
set to the described network's IP address. However, if necessary one
or more of the network's host bits may be set in the Link State ID.
This allows the router to originate separate LSAs for networks
having the same address, yet different masks. Such networks can
occur in the presence of supernetting and subnet 0s (see [Ref10]).

本附录给出了一种设置链路状态ID中主机位的可能算法。这种算法的选择是局部决策。单独的路由器可以自由使用不同的算法,因为受影响的唯一LSA是路由器自己发起的LSA。对所用算法的唯一要求是尽可能将网络的IP地址用作链路状态ID;这最大化了与RFC 1583之前的OSPF实现的互操作性。

This appendix gives one possible algorithm for setting the host bits
in Link State IDs.  The choice of such an algorithm is a local
decision. Separate routers are free to use different algorithms,
since the only LSAs affected are the ones that the router itself
originates. The only requirement on the algorithms used is that the
network's IP address should be used as the Link State ID whenever
possible; this maximizes interoperability with OSPF implementations
predating RFC 1583.

以下算法适用于AS-external-LSAs。这只是为了清楚起见;完全相同的算法可以用于summary-LSAs。假设路由器希望为具有地址NA和掩码NM1的网络发起AS-external-LSA 。然后使用以下步骤确定LSA的链路状态ID:

The algorithm below is stated for AS-external-LSAs.  This is only
for clarity; the exact same algorithm can be used for summary-LSAs.
Suppose that the router wishes to originate an AS-external-LSA for a
network having address NA and mask NM1. The following steps are then
used to determine the LSA's Link State ID:

1@确定路由器是否已经产生链路状态ID等于NA的AS-external-LSA(在这种LSA中,路由器本身将被列为LSA的通告路由器)。如果不是,则链路状态ID被设置为NA,并且算法终止。否则

(1) Determine whether the router is already originating an AS-
    external-LSA with Link State ID equal to NA (in such an LSA the
    router itself will be listed as the LSA's Advertising Router).
    If not, the Link State ID is set equal to NA and the algorithm
    terminates. Otherwise,

2@从已经存在的AS-external-LSA中获取网络掩码。将此掩码称为NM2。然后有两种情况:

@NM1比NM2长(即更具体)。在这种情况下,将新LSA中的链路状态ID设置为网络[NA,NM1],并设置所有主机位(即等于NA或与NM1中未设置的所有位一起设置,即网络[NA、NM1]的广播地址)。

@NM2比NM1长。在这种情况下,通过增加序列号、将主体中的掩码更改为NM1并插入新网络的开销,将现有LSA(链路状态ID为NA)更改为引用新网络[NA,NM1]。然后,为旧网络[NA,NM2]发起新的LSA,链路状态ID等于NA或与NM2中未设置的比特(即网络[NA、NM2]的广播地址)一起使用。

(2) Obtain the network mask from the body of the already existing
    AS-external-LSA. Call this mask NM2. There are then two cases:

    o   NM1 is longer (i.e., more specific) than NM2. In this case,
        set the Link State ID in the new LSA to be the network
        [NA,NM1] with all the host bits set (i.e., equal to NA or'ed
        together with all the bits that are not set in NM1, which is
        network [NA,NM1]'s broadcast address).

    o   NM2 is longer than NM1. In this case, change the existing
        LSA (having Link State ID of NA) to reference the new
        network [NA,NM1] by incrementing the sequence number,
        changing the mask in the body to NM1 and inserting the cost
        of the new network. Then originate a new LSA for the old
        network [NA,NM2], with Link State ID equal to NA or'ed
        together with the bits that are not set in NM2 (i.e.,
        network [NA,NM2]'s broadcast address).

上述算法假设所有掩码是连续的;这确保了当两个网络具有相同的地址时,一个掩码比另一个更具体。该算法还假定不存在地址等于另一网络的广播地址的网络。给定这两个假设,上述算法总是生成唯一的链路状态ID。上述算法也可以改写如下:当发起AS-external-LSA时,尝试使用网络号作为链路状态ID。如果这会产生冲突,请检查冲突的两个网络。一个将是另一个的子集。对于不太具体的网络,使用网络号作为链路状态ID,对于更具体的网络则使用网络的广播地址(即,将所有“主机”位翻转为1)。如果最特定的网络首先发起,这将导致同时发起两个LSA。

The above algorithm assumes that all masks are contiguous; this
ensures that when two networks have the same address, one mask is
more specific than the other. The algorithm also assumes that no
network exists having an address equal to another network's
broadcast address. Given these two assumptions, the above algorithm
always produces unique Link State IDs. The above algorithm can also
be reworded as follows:  When originating an AS-external-LSA, try to
use the network number as the Link State ID.  If that produces a
conflict, examine the two networks in conflict. One will be a subset
of the other. For the less specific network, use the network number
as the Link State ID and for the more specific use the network's
broadcast address instead (i.e., flip all the "host" bits to 1).  If
the most specific network was originated first, this will cause you
to originate two LSAs at once.

作为算法的一个示例,请考虑在单个路由器(路由器A)中发生以下事件序列时的操作。

1@路由器A希望为[10.0.0.0,255.255.255.0]发起AS外部LSA:

(a)使用10.0.0.0作为链路ID

2@然后,路由器A想要为[10.0.0.0,255.255.0.0]发起AS外部LSA:

(a)[10.0.0,0,255.255.255.0]的LSA使用10.0.0.255作为新的链路状态ID重新初始化

(b)使用10.0.0.0作为[10.0.0.0,255.255.0.0]的链路ID

3@然后,路由器A想要为[10.0.0.0,255.0.0.0]发起AS外部LSA:

(a)[10.0.0,0,255.255.0.0]的LSA使用10.0.255.255作为新的链路状态ID重新初始化

(b)使用10.0.0.0作为[10.0.0.0,255.255.0.0]的链路ID

©网络[10.0.0.0,255.255.255.0]保持10.0.0.255的链路ID

As an example of the algorithm, consider its operation when the
following sequence of events occurs in a single router (Router A).


(1) Router A wants to originate an AS-external-LSA for
    [10.0.0.0,255.255.255.0]:

    (a) A Link State ID of 10.0.0.0 is used.

(2) Router A then wants to originate an AS-external-LSA for
    [10.0.0.0,255.255.0.0]:

    (a) The LSA for [10.0.0,0,255.255.255.0] is reoriginated using a new Link State ID of 10.0.0.255.

    (b) A Link State ID of 10.0.0.0 is used for [10.0.0.0,255.255.0.0].

(3) Router A then wants to originate an AS-external-LSA for
    [10.0.0.0,255.0.0.0]:

    (a) The LSA for [10.0.0.0,255.255.0.0] is reoriginated using a
        new Link State ID of 10.0.255.255.

    (b) A Link State ID of 10.0.0.0 is used for
        [10.0.0.0,255.0.0.0].

    (c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID
        of 10.0.0.255.

--------------------------------------------------------------------[Page 238]

附录F.同一网络/子网的多个接口

参考原文
--------------------------------------------------------------------[Page 239]

附录G.与RFC 2178的不同

参考原文
--------------------------------------------------------------------[Page 242]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值