Appendix C. 可配置参数 (Configurable Parameters)
在 router-LSAs 中, Link State ID 字段设置为路由器的 OSPF Router ID. Router-LSAs 只在单个区域内泛洪.
bit V
置位时, 表示该路由器是一条或多条完全邻接虚链路的端点, 且被描述区域是这些虚链路的 Transit area (V 表示 virtual link endpoint).
bit E
置位时, 表示该路由器是 AS boundary router (E 表示 external).
bit B
置位时, 表示该路由器是 area border router (B 表示 border).
# links
此 LSA 中描述的 router links 数量. 这必须是路由器到该区域的 router links (即 interfaces) 的完整集合.
以下字段用于描述每条 router link (即 interface). 每条 router link 都有类型 (见下面的 Type 字段). Type 字段指示所描述链路的种类. 它可以是到 transit network 的链路、到另一台路由器的链路, 或到 stub network 的链路. 描述 router link 的所有其他字段的值都取决于链路的 Type. 例如, 每条链路都有一个关联的 32 位 Link Data 字段. 对到 stub networks 的链路, 此字段指定该网络的 IP 地址掩码. 对其他链路类型, Link Data 字段指定路由器接口的 IP 地址.
Type
router link 的简要描述. 取以下值之一. 注意, host routes 被归类为到 stub networks 的链路, 网络掩码为 0xffffffff.
Type Description
__________________________________________________
1 Point-to-point connection to another router
2 Connection to a transit network
3 Connection to a stub network
4 Virtual link
Link ID
标识此 router link 连接到的对象. 取值取决于链路的 Type. 当连接到一个也产生 LSA 的对象时, 即另一台路由器或 transit network, Link ID 等于相邻 LSA 的 Link State ID. 这为路由表计算期间在链路状态数据库中查找相邻 LSA 提供键. 更多细节见 Section 12.2.
Type Link ID
______________________________________
1 Neighboring router's Router ID
2 IP address of Designated Router
3 IP network/subnet number
4 Neighboring router's Router ID
Link Data
取值同样取决于链路的 Type 字段. 对到 stub networks 的连接, Link Data 指定该网络的 IP 地址掩码. 对未编号点到点连接, 它指定接口的 MIB-II [Ref8] ifIndex 值. 对其他链路类型, 它指定路由器接口的 IP 地址. 路由表构建过程中计算下一跳 IP 地址时需要后一项信息. 更多细节见 Section 16.1.1.
# TOS
为该链路给出的不同 TOS metrics 数量, 不包括必需的链路 metric (在 [Ref9] 中称为 TOS 0 metric). 例如, 如果没有给出额外 TOS metrics, 此字段设置为 0.
metric
使用此 router link 的代价.
为了与 OSPF 规范以前版本 ([Ref9]) 向后兼容, 还可以包含额外的 TOS-specific information. 在每条链路内, 对每个期望的 TOS, 可按如下方式编码 TOS-specific link information:
TOS IP Type of Service that this metric refers to. TOS 在 OSPF LSA 中的编码见 Section 12.3.
TOS metric
TOS-specific metric information.
A.4.3 Network-LSAs
Network-LSAs 是 Type 2 LSAs. 对区域中每个支持两台或更多路由器的广播网络和 NBMA 网络, 都会产生一个 network-LSA. network-LSA 由该网络的 Designated Router 产生. 该 LSA 描述连接到该网络的所有路由器, 包括 Designated Router 自身. 该 LSA 的 Link State ID 字段列出 Designated Router 的 IP 接口地址.
从网络到所有连接路由器的距离为零. 这就是 network-LSA 中无需指定 metric 字段的原因. 有关构造 network-LSAs 的细节, 见 Section 12.4.2.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Attached Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Network Mask
该网络的 IP 地址掩码. 例如, class A 网络的掩码为 0xff000000.
Attached Router
连接到该网络的每台路由器的 Router ID. 实际上, 只列出那些与 Designated Router 完全邻接的路由器. Designated Router 会把自身包含在此列表中. 包含的路由器数量可从 LSA 头部的 length 字段推导出来.
A.4.4 Summary-LSAs
Summary-LSAs 是 Type 3 和 4 LSAs. 这些 LSA 由 area border routers 产生. Summary-LSAs 描述 inter-area destinations. 有关构造 summary-LSAs 的细节, 见 Section 12.4.3.
当目的地是 IP 网络时, 使用 Type 3 summary-LSAs. 在这种情况下, LSA 的 Link State ID 字段是 IP 网络号 (如有必要, Link State ID 也可以设置网络的一个或多个 "host" 位; 细节见 Appendix E). 当目的地是 AS boundary router 时, 使用 Type 4 summary-LSA, 且 Link State ID 字段是 AS boundary router 的 OSPF Router ID. 关于为什么必须通告每个 ASBR 的位置, 见 Section 16.4. 除 Link State ID 字段不同外, Type 3 和 4 summary-LSAs 的格式相同.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 3 or 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0 | metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TOS | TOS metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
对于 stub areas, Type 3 summary-LSAs 也可以用于描述按区域的默认路由. 在 stub areas 中使用默认 summary routes, 而不是泛洪完整的外部路由集合. 描述默认 summary route 时, summary-LSA 的 Link State ID 始终设置为 DefaultDestination (0.0.0.0), Network Mask 设置为 0.0.0.0.
Network Mask
对 Type 3 summary-LSAs, 此字段指示目的网络的 IP 地址掩码. 例如, 通告 class A 网络的位置时会使用值 0xff000000. 对 Type 4 summary-LSAs, 此字段没有意义且必须为零.
metric
该路由的代价. 使用与 router-LSAs 中接口代价相同的单位表示.
为了与 OSPF 规范以前版本 ([Ref9]) 向后兼容, 还可以包含额外的 TOS-specific information. 对每个期望的 TOS, TOS-specific information 按如下方式编码:
TOS IP Type of Service that this metric refers to. TOS 在 OSPF LSA 中的编码见 Section 12.3.
TOS metric
TOS-specific metric information.
A.4.5 AS-external-LSAs
AS-external-LSAs 是 Type 5 LSAs. 这些 LSA 由 AS boundary routers 产生, 并描述 AS 外部的目的地. 有关构造 AS-external-LSAs 的细节, 见 Section 12.4.3.
AS-external-LSAs 通常描述某个特定外部目的地. 对这些 LSA, Link State ID 字段指定 IP 网络号 (如有必要, Link State ID 也可以设置网络的一个或多个 "host" 位; 细节见 Appendix E). AS-external-LSAs 也用于描述默认路由. 当不存在到目的地的具体路由时, 使用默认路由. 描述默认路由时, Link State ID 始终设置为 DefaultDestination (0.0.0.0), Network Mask 设置为 0.0.0.0.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS age | Options | 5 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Link State ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Advertising Router |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS sequence number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LS checksum | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Network Mask |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| 0 | metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Forwarding address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| External Route Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|E| TOS | TOS metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Forwarding address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| External Route Tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... |
Network Mask
被通告目的地的 IP 地址掩码. 例如, 通告 class A 网络时会使用掩码 0xff000000.
bit E
外部 metric 的类型. 如果 bit E 置位, 指定的 metric 是 Type 2 external metric. 这意味着该 metric 被视为大于任何链路状态路径. 如果 bit E 为零, 指定的 metric 是 Type 1 external metric. 这意味着它使用与链路状态 metric 相同的单位, 即与接口代价相同的单位.
metric
该路由的代价. 解释取决于外部类型指示 (上面的 bit E).
Forwarding address
通告目的地的数据流量将转发到此地址. 如果 Forwarding address 设置为 0.0.0.0, 数据流量将改为转发到该 LSA 的产生者, 即负责的 AS boundary router.
External Route Tag
附加到每条外部路由的 32 位字段. OSPF 协议本身不使用它. 它可用于在 AS boundary routers 之间传递信息; 这类信息的确切性质超出本规范范围.
为了与 OSPF 规范以前版本 ([Ref9]) 向后兼容, 还可以包含额外的 TOS-specific information. 对每个期望的 TOS, TOS-specific information 按如下方式编码:
TOS The Type of Service that the following fields concern. TOS 在 OSPF LSA 中的编码见 Section 12.3.
bit E
为了与 [Ref9] 向后兼容.
TOS metric
TOS-specific metric information.
Forwarding address
为了与 [Ref9] 向后兼容.
External Route Tag
为了与 [Ref9] 向后兼容.
B. 架构常量 (Architectural Constants)
若干 OSPF 协议参数具有固定的架构值. 文中用 LSRefreshTime 等名称引用这些参数. 可配置协议参数也使用相同命名约定. 它们在 Appendix C 中定义.
下面列出每个架构常量的名称、值以及其功能的简短描述.
LSRefreshTime
任意特定 LSA 两次不同产生之间的最长时间. 如果路由器某个 self-originated LSA 的 LS age 字段达到 LSRefreshTime 值, 即使该 LSA 的内容 (除 LSA 头部外) 相同, 也会产生该 LSA 的新实例. LSRefreshTime 的值设置为 30 分钟.
MinLSInterval
任意特定 LSA 两次不同产生之间的最短时间. MinLSInterval 的值设置为 5 秒.
MinLSArrival
对任意特定 LSA, 泛洪期间接收新 LSA 实例之间必须经过的最短时间. 以更高频率收到的 LSA 实例会被丢弃. MinLSArrival 的值设置为 1 秒.
MaxAge
LSA 可以达到的最大 age. 当 LSA 的 LS age 字段达到 MaxAge 时, 会重新泛洪该 LSA, 以尝试从路由域中清除它 (见 Section 14). age 为 MaxAge 的 LSA 不用于路由表计算. MaxAge 的值设置为 1 小时.
CheckAge
当链路状态数据库中某个 LSA 的 age 达到 CheckAge 的倍数时, 会验证该 LSA 的 checksum. 此时 checksum 不正确表示严重错误. CheckAge 的值设置为 5 分钟.
MaxAgeDiff
LSA 在整个 AS 中泛洪时可能出现的最大时间离散度. 该时间的大部分来自泛洪过程中位于路由器输出队列上 (因此不老化) 的 LSA. MaxAgeDiff 的值设置为 15 分钟.
LSInfinity
指示 LSA 所描述目的地不可达的 metric 值. 在 summary-LSAs 和 AS-external-LSAs 中用作 premature aging 的替代方式 (见 Section 14.1). 它定义为全 1 的 24 位二进制值: 0xffffff.
DefaultDestination
指示默认路由的 Destination ID. 当找不到其他匹配路由表条目时使用该路由. 默认目的地只能在 AS-external-LSAs 和 stub areas 的 type 3 summary-LSAs 中通告. 其值为 IP 地址 0.0.0.0. 其关联 Network Mask 也始终为 0.0.0.0.
InitialSequenceNumber
产生任意 LSA 的第一个实例时用于 LS Sequence Number 的值. 其值为有符号 32 位整数 0x80000001.
MaxSequenceNumber
LS Sequence Number 可以达到的最大值. 其值为有符号 32 位整数 0x7fffffff.