Latest

Introduction to OSPFv3 AS External LSA Route Calculation

OSPFv3 AS External LSA Route Calculation

Let's talk about Open Shortest Path First Version 3 (OSPFv3) Autonomous System (AS) External Link State Advertisement (LSA) Type 5 route selection mechanism. It presents a network scenario with the configuration for how to select the route received from one Autonomous System Boundary Router (ASBR) over another.

If routes are redistributed into OSPFv3 from other IPv6 routing protocols or from IPv6 static routes, these routes becomes OSPF AS-External routes by default. These AS-External routes fall under two categories, external type 1 (O E1) and external type 2 (O E2).



Fig 1.1- OSPFv3 LSA route Calculation


The difference between the two is in the way the cost (metric) of the route is calculated. The cost of a Type 2 route is always the external cost, irrespective of the interior cost to reach that route. The cost of a Type 1 route is the addition of the external cost and the internal cost used to reach that route. A Type 1 route is always preferred over a Type 2 route for the same destination.

Consider the below network topology to check the AS-External LSA 5 received on R4 in Area 0 that originated from ASBRs in Area 1. R2 and R3 are Area Border Routers (ABRs).

Configurations on R5 Router
!
ipv6 route FD00:AAAA:BBBB:CCCC::/64 Null0             
!
interface FastEthernet0/0
 ipv6 address FD00:AAAA:BBBB:25::5/64
 ipv6 ospf 10 area 1
!
ipv6 router ospf 10
 router-id 192.168.1.5
 redistribute static

Configurations on R1 Router
!
ipv6 route FD00:AAAA:BBBB:CCCC::/64 Null0                 
!
interface FastEthernet0/1
 ipv6 address FD00:AAAA:BBBB:13::1/64
 ipv6 ospf 10 area 1
!
ipv6 router ospf 10
 router-id 192.168.1.1
 redistribute static 

Verify the commands now

R5#show ipv6 ospf
 Routing Process "ospfv3 10" with ID 192.168.1.5
 Event-log enabled, Maximum number of events: 1000, Mode: cyclic
 It is an autonomous system boundary router
 Redistributing External Routes from,
    static
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs
 Minimum LSA arrival 1000 msecs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 2. Checksum Sum 0x0100D4
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 Graceful restart helper support enabled
 Reference bandwidth unit is 100 mbps
 RFC1583 compatibility enabled
    Area 1
        Number of interfaces in this area is 1
        SPF algorithm executed 5 times
        Number of LSA 16. Checksum Sum 0x08011B
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

R1#show ipv6 ospf
 Routing Process "ospfv3 10" with ID 192.168.1.1
 Event-log enabled, Maximum number of events: 1000, Mode: cyclic
 It is an autonomous system boundary router
 Redistributing External Routes from,
    static
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Minimum LSA interval 5 secs
 Minimum LSA arrival 1000 msecs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 2. Checksum Sum 0x0100D4
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 Graceful restart helper support enabled
 Reference bandwidth unit is 100 mbps
 RFC1583 compatibility enabled
    Area 1
        Number of interfaces in this area is 1
        SPF algorithm executed 6 times
        Number of LSA 16. Checksum Sum 0x08AD19
        Number of DCbitless LSA 0
        Number of indication LSA 0
        Number of DoNotAge LSA 0
        Flood list length 0

So, both the ASBR Routers, R5 and R1 redistribute the IPv6 static routes. In order to check the redistributed route in Routing Table and OSPFv3 Database on Router R4 for prefix FD00:AAAA:BBBB:CCCC::/64.

Redistributed metric
As mentioned earlier, the metric value is set by default to 20 when the routes are redistributed into OSPFv3. Next, define the value 10 while you redistribute on ASBR 192.168.1.1 (R1) and check the output on Router 4.

Here are the changes implemented on R1:
R1(config)#ipv6 router ospf 10
R1(config-rtr)#redistribute static metric 10

Forward Metric
The Forward Metric is the cost to reach ASBR from the router. This can be checked with these commands:

R4#show ipv6 ospf border-routers
OSPFv3 Router with ID (192.168.1.4) (Process ID 10)
Codes: i - Intra-area route, I - Inter-area route

I 192.168.1.1 [3] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ASBR, Area 0, SPF 2
I 192.168.1.1 [2] via FE80::C802:BFF:FEB4:6, FastEthernet0/1, ASBR, Area 0, SPF 2
i 192.168.1.3 [1] via FE80::C802:BFF:FEB4:6, FastEthernet0/1, ABR, Area 0, SPF 2
i 192.168.1.2 [1] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ABR, Area 0, SPF 2
I 192.168.1.5 [2] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ASBR, Area 0, SPF 2

 In this output, the cost to reach ASBRs (R1 and R5) is 2 from Router R4. By default, the cost for FastEthernet Interface in OSPFv3 is 1. So in this case, the cost is 2 from R4 to reach R1 or R5: Forward Metric = Router cost to reach ABR (1) + ABR cost to reach the ASBR (1) = 2.

Change the redistribution metric to 10 on R5 as well, so both of the routes are installed again in the IPv6 Routing Table.

Here are the changes implemented on R5:

R5(config)#ipv6 router ospf 10
R5(config-rtr)#redistribute static metric 10

The IPv6 Routing Table and OSPFv3 RIB on R4 shows:

R4#sh ipv6 ospf rib detail
* FD00:AAAA:BBBB:CCCC::/64, Ext-2, cost 10/2
    source 192.168.1.1, tag 0
    via FE80::C801:37FF:FE2C:6, FastEthernet0/0
    via FE80::C802:BFF:FEB4:6, FastEthernet0/1
    LSA: 4005/0/192.168.1.5
    LSA: 4005/0/192.168.1.1

R4#show ipv6 route FD00:AAAA:BBBB:CCCC::/64
Routing entry for FD00:AAAA:BBBB:CCCC::/64
  Known via "ospf 10", distance 110, metric 10, type extern 2
  Route count is 2/2, share count 0
  Routing paths:
    FE80::C802:BFF:FEB4:6, FastEthernet0/1
      Last updated 00:09:49 ago
    FE80::C801:37FF:FE2C:6, FastEthernet0/0
      Last updated 00:00:14 ago

Now lets change the cost to reach one of the ASBRs but with same redistribution metric and check the same output.

Increase the OSPFv3 Cost on fa0/1 for Router R4:
R4(config)#int fa0/1
R4(config-if)#ipv6 ospf cost 10

Check the Forward Metric. It shows that now the cost to reach ASBR R1 is 11 from Fa0/1 Interface:

R4#show ipv6 ospf border-routers
OSPFv3 Router with ID (192.168.1.4) (Process ID 10)
Codes: i - Intra-area route, I - Inter-area route

I 192.168.1.1 [3] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ASBR, Area 0, SPF 3
I 192.168.1.1 [11] via FE80::C802:BFF:FEB4:6, FastEthernet0/1, ASBR, Area 0, SPF 3
i 192.168.1.3 [10] via FE80::C802:BFF:FEB4:6, FastEthernet0/1, ABR, Area 0, SPF 3
i 192.168.1.2 [1] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ABR, Area 0, SPF 3
I 192.168.1.5 [2] via FE80::C801:37FF:FE2C:6, FastEthernet0/0, ASBR, Area 0, SPF 3 

Now the IPv6 Routing Table and OSPFv3 RIB on R4 shows:

R4#sh ipv6 ospf rib detail
* FD00:AAAA:BBBB:CCCC::/64, Ext-2, cost 10/2
    source 192.168.1.5, tag 0
    via FE80::C801:37FF:FE2C:6, FastEthernet0/0
    LSA: 4005/0/192.168.1.5
    LSA: 4005/0/192.168.1.1

R4#show ipv6 route FD00:AAAA:BBBB:CCCC::/64
Routing entry for FD00:AAAA:BBBB:CCCC::/64
  Known via "ospf 10", distance 110, metric 10, type extern 2
  Route count is 1/1, share count 0
  Routing paths:
    FE80::C801:37FF:FE2C:6, FastEthernet0/0
      Last updated 00:02:19 ago

In summary, when you have multiple entries for AS-External LSA, the first preference is given to the metric (Redistributed metric). The route with the lower metric is installed in the IPv6 Routing Table. The second preference is given to the Forward Metric, if the redistributed metric is same. The route with the lower Forward Metric is installed in the IPv6 Routing Table.