注:机翻,未校。
OSPF – how max-metric works
Two costs for an interface 接口的两种成本
When you configure an OSPF interface with a cost, you can do it directly using ip ospf cost or have the cost calculated for you using auto-cost reference bandwidth. Whichever method you choose, the OSPF RFC 2328 calls it “the cost of sending a packet out this interface”. The Router LSA, or type-1 LSA, has a 16-bit field (65535 in decimal) to represent the “interface output cost”. An interface cost of 65535 is also known as “LSInfinity”.
当您配置 OSPF 接口时,可以直接使用 ip ospf cost
设置成本,也可以通过自动计算参考带宽来获得成本。无论您选择哪种方法,OSPF RFC 2328 都称其为“从该接口发送数据包的成本”。路由器 LSA,或称类型 1 LSA,有一个 16 位字段(以十进制表示为 65535)来表示“接口输出成本”。接口成本为 65535 的情况也被称为“LSInfinity”。
We’ll go through an example using links between routers which have been configured with OSPF network type point-to-point. The links have IP addresses and active adjacencies, so are represented by in the router LSA by both Stub and P2P links.
我们将通过一个示例来说明路由器之间配置为 OSPF 网络类型点对点的链接。这些链接具有 IP 地址和活动的邻接关系,因此在路由器 LSA 中同时表示为 Stub 链接和 P2P 链接。
Router_A\# sh ip ospf interface fa1/0
FastEthernet1/0 is up, line protocol is up
Internet Address 192.168.12.1/24, Area 0
Process ID 100, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 10
Router_A#sh ip ospf database router self-originate
OSPF Router with ID (1.1.1.1) (Process ID 100)
Router Link States (Area 0)
LS age: 139
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000006
Checksum: 0xCBB0
Length: 84
Number of Links: 3
Link connected to: a Stub Network
(Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 2.2.2.2
(Link Data) Router Interface address: 192.168.12.1
Number of TOS metrics: 0
TOS 0 Metrics: 10 <--# cost for P2P A_B link
Link connected to: a Stub Network
(Link ID) Network/subnet number: 192.16.12.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS