跳到主要内容

4.4.3.2. Router-LSAs (路由器 LSA)

Router-LSA 的 LS type 被设置为值 0x2001. Router-LSA 具有区域泛洪范围. 对于给定区域, 路由器可以发起一个或多个 Router-LSA. 每个 Router-LSA 都包含整数个接口描述. 综合来看, 路由器为某一区域发起的 Router-LSA 集合描述了该路由器连接到该区域的所有接口的汇总状态. 使用多个 Router-LSA 时, 它们通过各自的 Link State ID 字段来区分.

在 Options 字段左侧, 路由器能力 bit V, E 和 B 应按 [OSPFV2] 第 12.4.1 节设置.

然后, 通过向 Router-LSA 附加 "link descriptions" 来描述该路由器到该区域的每个接口. 每个 link description 长度为 16 字节, 由五个字段组成: (link) Type, Metric, Interface ID, Neighbor Interface ID 和 Neighbor Router ID (见附录 A.4.3). 处于 "Down" 或 "Loopback" 状态的接口不会被描述 (尽管 looped back 接口可以向 intra-area-prefix-LSA 贡献前缀), 没有任何完全邻接的接口也不会被描述 (第 4.9 节所述多个 Standby Interface 的情况除外). 到该区域的所有其他接口会添加零个, 一个或多个 link description. 这些描述的数量和内容取决于接口类型. 在每个 link description 中, Metric 字段始终设置为该接口的输出代价, Interface ID 字段设置为该接口的 OSPF Interface ID.

Point-to-point interfaces 如果相邻路由器完全邻接, 则添加一个 Type 1 link description (point-to-point). Neighbor Interface ID 字段设置为邻居在其 Hello 包中通告的 Interface ID, Neighbor Router ID 字段设置为该邻居的 Router ID.

Broadcast and NBMA interfaces 如果路由器与该链路的 Designated Router 完全邻接, 或者路由器自身是 Designated Router 且与至少一个其他路由器完全邻接, 则添加一个 Type 2 link description (transit network). Neighbor Interface ID 字段设置为 Designated Router 在其 Hello 包中通告的 Interface ID, Neighbor Router ID 字段设置为 Designated Router 的 Router ID.

Virtual links 如果相邻路由器完全邻接, 则添加一个 Type 4 link description (virtual). Neighbor Interface ID 字段设置为邻居在其 Hello 包中通告的 Interface ID, Neighbor Router ID 字段设置为该邻居的 Router ID. 注意, virtual link 的输出代价是在路由表计算期间计算的 (见第 4.7 节).

Point-to-Multipoint interfaces 对于与该接口关联的每个完全邻接邻居, 添加一个单独的 Type 1 link description (point-to-point), 其中 Neighbor Interface ID 字段设置为邻居在其 Hello 包中通告的 Interface ID, Neighbor Router ID 字段设置为该邻居的 Router ID.

例如, 考虑路由器 RT3 将为图 1 中 Area 1 发起的 Router-LSA. 只需要描述一个接口, 即连接到 transit network N3 的接口. 这里假定 RT4 已被选举为 Network N3 的 Designated Router.

; RT3's router-LSA for Area 1

LS age = 0 ; newly (re)originated
LS type = 0x2001 ; router-LSA
Link State ID = 0 ; first fragment
Advertising Router = 192.0.2.3 ; RT3's Router ID
bit E = 0 ; not an AS boundary router
bit B = 1 ; area border router
Options = (V6-bit|E-bit|R-bit)
Type = 2 ; connects to N3
Metric = 1 ; cost to N3
Interface ID = 1 ; RT3's Interface ID on N3
Neighbor Interface ID = 1 ; RT4's Interface ID on N3
Neighbor Router ID = 192.0.2.4 ; RT4's Router ID

例如, 如果另一个路由器被添加到 Network N4, RT3 将必须为其到 (现在成为 transit 的) network N4 的连接通告第二个 link description. 这可以通过重新发起上述 Router-LSA 来完成, 这次包含两个 link description. 或者, 也可以使用单独的 Link State ID (例如使用 Link State ID 1) 发起一个单独的 Router-LSA, 用于描述到 N4 的连接.

stub network 的主机路由不再出现在 Router-LSA 中. 相反, 它们包含在 intra-area-prefix-LSA 中.