4.4.3.9. 区域内 Prefix LSA (Intra-Area-Prefix-LSAs)
intra-area-prefix-LSA 的 LS type 设置为 0x2009. intra-area-prefix-LSA 具有区域泛洪范围. intra-area-prefix-LSA 有两种功能之一. 它要么通过引用 network-LSA 将一组 IPv6 地址 prefix 与 transit network link 关联, 要么通过引用 router-LSA 将一组 IPv6 地址 prefix 与路由器关联. stub link 的 prefix 与其连接的路由器关联.
对于给定区域, 路由器可以发起多个 intra-area-prefix-LSA. 每个 intra-area-prefix-LSA 都具有唯一的 Link State ID, 并包含整数个 prefix 描述.
Designated Router 发起
链路的 Designated Router 会发起一个或多个 intra-area-prefix-LSA, 以在整个区域内通告该链路的 prefix. 对于链路 L, L 的 Designated Router 按以下方式构建 intra-area-prefix-LSA:
-
为了指示这些 prefix 应与 Link L 关联, Referenced LS Type, Referenced Link State ID 和 Referenced Advertising Router 字段会设置为 Link L 的 network-LSA 中对应字段的值. 这意味着 Referenced LS Type 设置为 0x2002, Referenced Link State ID 设置为 Designated Router 在 Link L 上的 Interface ID, Referenced Advertising Router 设置为 Designated Router 的 Router ID.
-
检查与 Link L 关联的每个 link-LSA. 如果该 link-LSA 的 Advertising Router 与 Designated Router 完全邻接, 且 Link State ID 与邻居的 interface ID 匹配, 则将该 link-LSA 中的 prefix 列表复制到 intra-area-prefix-LSA 中. 不应复制 Options 字段中设置了 NU-bit 和/或 LA-bit 的 prefix, 也不应复制链路本地地址. 每个 prefix 由 PrefixLength, PrefixOptions 和 Address Prefix 字段描述. 具有相同 PrefixLength 和 Address Prefix 的多个 prefix 被视为重复. 在这种情况下, 它们的 PrefixOptions 字段应进行逻辑 OR, 并且只应在 intra-area-prefix-LSA 中包含该重复 prefix 的一个实例. 所有 prefix 的 Metric 字段设置为 0.
-
"# prefixes" 字段设置为路由器复制到 LSA 中的 prefix 数量. 如有必要, 为了保持 LSA 大小较小, prefix 列表可以分布到多个 intra-area-prefix-LSA 中.
路由器发起
路由器构建 intra-area-prefix-LSA, 用于通告其连接的 stub link, looped-back interface 和主机的 prefix. Router RTX 将按以下方式构建其 intra-area-prefix-LSA:
-
为了指示这些 prefix 应与 Router RTX 自身关联, RTX 将 Referenced LS Type 设置为 0x2001, 将 Referenced Link State ID 设置为 0, 并将 Referenced Advertising Router 设置为 RTX 自己的 Router ID.
-
Router RTX 检查其通往该区域的接口列表. 如果接口处于 Down 状态, 则不包含其 prefix. 如果该接口已在 RTX 的 router-LSA 中报告为 Type 2 link description (link to transit network), 则跳过将包含在该链路 intra-area-prefix-LSA 中的 prefix. 但是, 任何通常会设置 LA-bit 的 prefix 都应被通告, 与该接口是否作为 transit link 通告无关. 如果接口类型为 point-to-multipoint, 或接口处于 Loopback 状态, 则与该接口关联的全局范围 IPv6 地址 (如果有) 会复制到 intra-area-prefix-LSA 中, 并设置 PrefixOptions 的 LA-bit, PrefixLength 设置为 128, metric 设置为 0. 否则, 通过指定 PrefixLength, PrefixOptions 和 Address Prefix 字段, 将 RTX 中为该链路配置的全局 prefix 列表复制到 intra-area-prefix-LSA 中. 这些 prefix 中每个 prefix 的 Metric 字段设置为该接口的输出 cost.
-
RTX 将属于该区域的任何直连主机的 IPv6 prefix 添加到 intra-area-prefix-LSA.
-
如果 RTX 配置了一个或多个穿越该区域的 virtual link, 则它会在 LSA 中包含自己的一个全局范围 IPv6 接口地址 (如果尚未包含), 并设置 PrefixOptions 字段中的 LA-bit, 将 PrefixLength 设置为 128, 将 Metric 设置为 0. 这些信息稍后会在路由计算中使用, 使 virtual link 的两端能够发现彼此的 IPv6 地址.
-
"# prefixes" 字段设置为路由器复制到 LSA 中的 prefix 数量. 如有必要, prefix 列表可以分布到多个 intra-area-prefix-LSA 中.
示例
例如, 下面展示 RT4 为 Network N3 发起的 intra-area-prefix-LSA (假设 RT4 是 N3 的 Designated Router), 以及 Router RT3 向 Area 1 发起的, 用于其自身 prefix 的 intra-area-prefix-LSA:
; RT4's Intra-area-prefix-LSA for network link N3
LS age = 0 ; newly (re)originated
LS type = 0x2009 ; Intra-area-prefix-LSA
Link State ID = 5 ; LSA type/scope unique identifier
Advertising Router = 192.0.2.4 ; RT4's Router ID
# prefixes = 1
Referenced LS Type = 0x2002 ; network-LSA reference
Referenced Link State ID = 1
Referenced Advertising Router = 192.0.2.4
PrefixLength = 56 ; N3's prefix
PrefixOptions = 0
Metric = 0
Address Prefix = 2001:0db8:c001:0100 ; pad
; RT3's Intra-area-prefix-LSA for its own prefixes
LS age = 0 ; newly (re)originated
LS type = 0x2009 ; Intra-area-prefix-LSA
Link State ID = 177 ; LSA type/scope unique identifier
Advertising Router = 192.0.2.3 ; RT3's Router ID
# prefixes = 1
Referenced LS Type = 0x2001 ; router-LSA reference
Referenced Link State ID = 0
Referenced Advertising Router = 192.0.2.3
PrefixLength = 56 ; N4's prefix
PrefixOptions = 0
Metric = 2 ; N4 interface cost
Address Prefix = 2001:0db8:c001:0400 ; pad
当网络条件变化时, 路由器可能需要将 prefix 从一个 intra-area-prefix-LSA 移动到另一个 intra-area-prefix-LSA. 例如, 如果某路由器是某条链路的 Designated Router, 但该链路没有连接其他路由器, 则该链路的 prefix 会在一个引用 Designated Router 的 router-LSA 的 intra-area-prefix-LSA 中通告. 当链路上出现其他路由器时, 会为该链路发起 network-LSA, 并将该链路的 prefix 移动到引用该 network-LSA 的 intra-area-prefix-LSA 中.
注意, 在 intra-area-prefix-LSA 中, Referenced Advertising Router 始终等于发起该 intra-area-prefix-LSA 的路由器, 即该 LSA 的 Advertising Router. 出现 Referenced Advertising Router 字段的原因是, 尽管它当前是冗余的, 但未来可能不再冗余.