跳到主要内容

4.3. 路由表结构

OSPF for IPv4 使用的 routing table 在 [OSPFV2] Section 11 中定义. 对于 IPv6, 存在类似的 routing table entry: 有用于 IPv6 address prefix 的 routing table entry, 也有用于 AS boundary router 的 routing table entry. 后一种 routing table entry 仅用于在 routing table 构建过程中保存中间结果 (见 Section 4.8).

此外, 为了保存每个 area 的 shortest-path calculation 期间的中间结果, 每个 area 都有一个单独的 routing table, 其中保存以下 entry:

  • area 中每个路由器都有一个 entry. 路由器由其 OSPF Router ID 标识. 这些 routing table entry 保存穿过给定 area 到达给定路由器的 shortest path 集合, 进而允许计算到该路由器在 intra-area-prefix-LSA 中通告的 IPv6 prefix 的路径. 如果该路由器也是 area border router, 这些 entry 还用于计算 inter-area address prefix 的路径. 如果该路由器同时还是 virtual link 的另一端点, 则 routing table entry 描述该 virtual link 的 cost 和可用性.

  • area 中每个 transit link 都有一个 entry. transit link 具有关联的 network-LSA. transit link 和 network-LSA 都由该 link 上 Designated Router 的 Interface ID 与 Designated Router 的 OSPF Router ID 组合来标识. 这些 routing table entry 允许之后计算到 intra-area-prefix-LSA 中为该 transit link 通告的 IP prefix 的路径.

IPv4 OSPF routing table 中的字段 (见 [OSPFV2] Section 11) 对 IPv6 仍然有效: optional capabilities (仅 router), path type, cost, type 2 cost, link state origin, 以及对于到达 destination 的每条 equal cost path, next-hop 和 advertising router.

对于 IPv6, routing table entry 中的 link-state origin 字段是直接或间接产生该 routing table entry 的 router-LSA 或 network-LSA. 例如, 如果 routing table entry 描述到某个 IPv6 prefix 的 route, 则 link state origin 是产生该 route 的 intra-area-prefix-LSA 正文中列出的 router-LSA 或 network-LSA (见 Appendix A.4.10).

4.3.1. 路由表查找

routing table lookup (即在 IP forwarding 期间确定最佳匹配的 routing table entry) 对 IPv6 与 IPv4 相同.