The purpose of this document is to demonstrate the Open Shortest Path First (OSPF) path selection behavior when a router receives two type 5 link-state advertisement (LSAs) for a given external network. In this example, one LSA has the forwarding address set to zero (0.0.0.0), and the other has the forwarding address set to non-zero.
Readers of this document should be knowledgeable of the following:
General IP routing
OSPF routing protocol concepts and terms
For more information on document conventions, see the Cisco Technical Tips Conventions.
The information in this document is based on the software and hardware versions below.
Cisco 2503 routers
Cisco IOS® Software Release 12.2(24a) running on all the routers
The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command before using it.
The topology shown below is used to demonstrate how the forwarding address in an OSPF type 5 LSA can affect the path selection of the type 5 LSA.
In the diagram above, all routers, other than Router 8, are running OSPF in area 0. For the purpose of this document, the configurations of Router 3 and Router 4 are most important because they are the autonomous system boundary router (ASBRs) generating the type 5 LSAs. As shown below, Router 3 and Router 4 have a static route to network 200.200.200.0 255.255.255.0, which is being redistributed into OSPF.
Router 3 |
---|
interface Ethernet0 ip address 172.16.3.3 255.255.255.0 ip ospf cost 15 ! interface Serial0 ip address 172.16.2.3 255.255.255.0 ! router ospf 7 redistribute static subnets network 172.16.2.0 0.0.0.255 area 0 ! ip route 200.200.200.0 255.255.255.0 172.16.3.8 |
Router 4 |
---|
interface Ethernet0 ip address 172.16.3.4 255.255.255.0 ! interface Serial0 ip address 172.16.7.4 255.255.255.0 ! router ospf 7 redistribute static subnets network 172.16.7.0 0.0.0.255 area 0 ! ip route 200.200.200.0 255.255.255.0 172.16.3.8 |
Note: Router 3 and Router 4 do not include network 172.16.3.0 255.255.255.0 in the OSPF process; therefore, the type 5 LSAs generated by both routers have the forwarding addresses set to 0.0.0.0
In this example, Router 5 can be used to view the external LSAs. To view the external LSAs, issue the show ip ospf database external command on Router 5. The output of this command is shown below.
Router 5 |
---|
router-5# show ip ospf database external OSPF Router with ID (172.16.6.5) (Process ID 7) Type-5 AS External Link States Routing Bit Set on this LSA LS age: 1514 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 200.200.200.0 (External Network Number ) Advertising Router: 172.16.3.3 LS Seq Number: 80000030 Checksum: 0x93C0 Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 Routing Bit Set on this LSA LS age: 1922 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 200.200.200.0 (External Network Number ) Advertising Router: 172.16.7.4 LS Seq Number: 80000027 Checksum: 0x83D4 Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 router-5# |
What you can see above is that the forwarding addresses for the type 5 LSAs generated by both Router 3 and Router 4 are set to 0.0.0.0. In this case, the LSA to be installed in the Router 5 routing table is determined by comparing the metrics to the ASBRs generating the LSAs. By issuing the show ip ospf border-routers command on Router 5, you can see the metrics that Router 5 has for the ASBRs. The output of this command is shown below.
Router 5 |
---|
router-5# show ip ospf border-routers OSPF Process 7 internal Routing Table Codes: i - Intra-area route, I - Inter-area route i 172.16.7.4 [74] via 172.16.6.6, Ethernet0, ASBR, Area 0, SPF 14 i 172.16.3.3 [64] via 172.16.2.3, Serial0, ASBR, Area 0, SPF 14 router-5# |
As shown above, 64 is the Router 5 metric to reach ASBR 172.16.3.3, while the metric to reach ASBR 172.16.7.4 is 74; therefore, Router 5 chooses the LSA generated by ASBR 172.16.3.3 to place in its routing table (shown below).
Router 5 |
---|
router-5# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set O E2 200.200.200.0/24 [110/20] via 172.16.2.3, 19:59:25, Serial0 172.16.0.0/24 is subnetted, 3 subnets C 172.16.6.0 is directly connected, Ethernet0 O 172.16.7.0 [110/74] via 172.16.6.6, 19:59:25, Ethernet0 C 172.16.2.0 is directly connected, Serial0 router-5# |
The same topology as above is used for this portion of the document. The Router 4 configuration also remains unchanged, but the configuration for Router 3 has changed to include network 172.16.3.0 255.255.255.0 in area 0 of the OSPF process. The Router 3 configuration is shown below with the change highlighted in bold.
Router 3 |
---|
interface Ethernet0 ip address 172.16.3.3 255.255.255.0 ip ospf cost 15 ! interface Serial0 ip address 172.16.2.3 255.255.255.0 ! router ospf 7 redistribute static subnets network 172.16.2.0 0.0.0.255 area 0 network 172.16.3.0 0.0.0.255 area 0 ! ip route 200.200.200.0 255.255.255.0 172.16.3.8 |
The result of the above configuration change is that the type 5 LSA generated by Router 3 now has the forwarding address set to the IP address of Router 8, as shown in the database output taken from Router 5 below.
Router 5 |
---|
router-5# show ip ospf database external OSPF Router with ID (172.16.6.5) (Process ID 7) Type-5 AS External Link States Routing Bit Set on this LSA LS age: 270 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 200.200.200.0 (External Network Number ) Advertising Router: 172.16.3.3 LS Seq Number: 80000033 Checksum: 0x5138 Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 172.16.3.8 External Route Tag: 0 Routing Bit Set on this LSA LS age: 258 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: 200.200.200.0 (External Network Number ) Advertising Router: 172.16.7.4 LS Seq Number: 80000029 Checksum: 0x7FD6 Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 0.0.0.0 External Route Tag: 0 router-5# |
You can see above that the type 5 LSA generated by Router 3 now has the forwarding address set to 172.16.3.8, while the type 5 LSA generated by Router 4 still has a forwarding address of 0.0.0.0.
In this case, the LSA to be installed in the Router 5 routing table is determined by comparing the Router 5 metric to the ASBR (Router 4) that generated the LSA with a forwarding address of 0.0.0.0 to the Router 5 metric to reach the forwarding address of 172.16.3.8, which was set for the LSA generated by the ASBR (Router 3).
To see the metrics to the ASBRs, issue the show ip ospf border command in Router 5. The output is shown below.
Router 5 |
---|
router-5# show ip ospf border-routers OSPF Process 7 internal Routing Table Codes: i - Intra-area route, I - Inter-area route i 172.16.7.4 [74] via 172.16.6.6, Ethernet0, ASBR, Area 0, SPF 15 i 172.16.3.3 [64] via 172.16.2.3, Serial0, ASBR, Area 0, SPF 15 router-5# |
In the above output, the metric to Router 4 is 74. This is compared to the Router 5 metric to reach the forwarding address of 172.16.3.8, which can be seen using the show ip route 172.16.3.8 command. The output of this command is below.
Router 5 |
---|
router-5# show ip route 172.16.3.8 Routing entry for 172.16.3.0/24 Known via "ospf 7", distance 110, metric 79, type intra area Last update from 172.16.2.3 on Serial0, 00:30:49 ago Routing Descriptor Blocks: * 172.16.2.3, from 172.16.3.3, 00:30:49 ago, via Serial0 Route metric is 79, traffic share count is 1 router-5# |
So, the metric to reach the ASBR Router 4, which is 74, is compared to the metric to reach the forwarding address of 172.16.3.8 (generated by Router 3), which is 79. Therefore, the LSA installed in the routing table is the LSA generated by Router 4, as shown in the Router 5 output of show ip route below.
Router 5 |
---|
router-5# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set O E2 200.200.200.0/24 [110/20] via 172.16.6.6, 00:35:14, Ethernet0 172.16.0.0/24 is subnetted, 4 subnets C 172.16.6.0 is directly connected, Ethernet0 O 172.16.7.0 [110/74] via 172.16.6.6, 00:35:14, Ethernet0 C 172.16.2.0 is directly connected, Serial0 O 172.16.3.0 [110/79] via 172.16.2.3, 00:35:14, Serial0 router-5# |
When the metric of the redistributed route from multiple ASBRs are equal as illustrated in the document, the forwarding address changes the behavior of the type 5 LSA path selection. When a router receives two type 5 LSAs to the same destination with the forwarding addresses set on both LSAs, the router makes a comparison based on the metric to the forwarding addresses. The LSA with a forwarding address that offers the smaller metric is placed into the routing table.
If the metric of the redistributed routes are different, the routers prefer the route with the lowest metric and not the lowest metric to the forwarding address.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
28-Mar-2005 |
Initial Release |