跳到主要内容

4.1. 将 Type-7 LSA 转换为 Type-5 LSA

该步骤是 NSSA 的 Dijkstra 计算的一部分, 在计算完 type-5 和 type-7 路由之后执行. 如果执行计算的路由器不是区域边界路由器, 则应当 (SHOULD) 跳过该转换算法. 现在应当检查 NSSA 中所有可达的区域边界路由器, 并记录其中路由器 ID 最高的那台. 如果该路由器就是本机, 它将负责为该 NSSA 把 type-7 LSA 转换为 type-5 LSA; 否则不应执行该转换算法. 应当检查所有已加入路由表的 type-7 路由. 如果 (与被检查路由相关联的) type-7 LSA 设置了 P 位且具有非零转发地址, 则应当采取以下步骤.

The translation procedure must first check for a configured type-7
address range.  Recall that an type-7 address range consists of an
[address,mask] pair and a status indication of either Advertise or
DoNotAdvertise.  At most a single type-5 LSA is made for each
range.  If the route being examined falls within the type-7
address range, (the [address,mask] pair of the route equal to or a
more specific instance of the [address,mask] pair of the type-7
address range), one of following three actions may take place.

   1. When the range's status indicates Advertise and the
      route's address and mask are equal to the address
      and mask of the type-7 range a type-5 LSA should be
      originated if:

      o there currently is no type-5 LSA originated from
        this router corresponding to the type-7 LSA,

      o the path type or the metric in the corresponding
        type-5 LSA is different from the type-7 LSA or

      o The forwarding address in the corresponding
        type-5 LSA is different from the type-7 LSA.

        The newly originated type-5 LSA will describe
        the same network and have the same network mask,
        metrics, forwarding address, external route tag
        and path type as the type-7 LSA, however, the
        advertising router field will be the router ID
        of this area border router.

   2. When the range's status indicates Advertise and the
      route's address or mask indicates a more specific
      route (i.e., the route's address is subsumed by the
      range or the route has a longer mask), a type-5 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 F of the OSPF specification for details),
      the network mask, external route tag and
      path type will be set to the configured type-7 range
      values. The advertising router field will be the
      router ID of this area border router.
      The forwarding address will not be set.
      The path type should always be set to the highest
      path type that is subsumed by the net range.
      The metric for the type-5 LSA will be set as follows:

      o if the path type is externl type 2, the type-5
        metric should be set to the largest type-7 metric
        subsumed by this net range + 1.

      o if the path type is external type 1, the type-5
        metric should be set to the largest metric.

      For example, given a net range of [10.0.0.0, 255.0.0.0]
      for an area that has type-7 routes of:

              10.1.0.0 path type 1, metric 10
              10.2.0.0 path type 1, metric 11
              10.3.0.0 path type 2, metric 5

       a type-5 LSA will be generated with a path type of 2
       and a metric of 6.

       As another example, given a net range of
       [10.0.0.0, 255.0.0.0] for an area that has
       type-7 routes of:

              10.1.0.0 path type 1, metric 10
              10.2.0.0 path type 1, metric 11
              10.3.0.0 path type 1, metric 5

       a type-5 LSA will be generated with a path type of 1
       and a metric of 11.

       These metric and path type rules will avoid routing
       loops in the event that path type 1 and 2 are both
       used within the area.

   3. When the range's status indicates DoNotAdvertise,
      the type-5 LSA is suppressed and the component networks
      remain hidden from the rest of the AS.

      By default (given that the P-bit is set and the LSA has a
      non-zero forwarding address) if a network is not contained
      in any explicitly configured address range, a type-7 to
      type-5 LSA translation will occur.

      A new instance of a type-5 LSA should be originated and
      flooded to all attached type-5 capable areas if one of the
      following is true.

      1. There currently is no type-5 LSA originated from this
         router corresponding to the type-7 LSA.

      2. The path type or the metric in the corresponding
         type-5 LSA is different from the type-7 LSA.

      3. The forwarding address in the corresponding
         type-5 LSA is different from the type-7 LSA.

      The newly originated type-5 LSAs will describe the same
      network and have the same network mask, metrics, forwarding
      address, external route tag and path type as the type-7 LSA.
      The advertising router field will be the router ID of this
      area border router.

      As with all newly originated type-5 LSAs, a type-5 LSA that
      is the result of a type-7 to type-5 translation (type-7 range
      or default case) is flooded to all attached type-5 capable
      areas.