Saturday, October 17, 2015

LSA Recursion Process of OSPF in Path Selection for E2 Routes (LSA Type 5)

OSPF default external route type E2 has a fixed metric while E1 increments its metric when its goes through hop by hop. So when E2 is used, a router in a regular area which has several paths to ASBR will see equal metric values but chooses the lowest cost path correctly. Technically that seed metric does not do anything in path selection. It is done through the route recursion process of OSPF.

You can download initial configuration files of the above topology from here.

Quick summary of the topology:
Area 1 & 2 are regular areas. 
R5 has a loopback 0 which is not advertised in the OSPF process directly but redistributed into the OSPF process as an E2 route. It will be the only external route.

IP address:
R1 e0/0:     e0/1:                            R2 e0/0:     e0/1:
R3 e0/0:     e0/1:                            R4 e0/2:     e0/3:
R5 e0/0:     e0/1:                            e0/2:     loopback0:
R6 e0/0:

You can see there are 2 ABRs in area 1 for R4. 

If you see the database for the route to you can see the metric is 20 which is the seed metric in the LSA Type 5.

But if you see the routing table it shows the best path as R3, not R2.

Surely the metric is 20 from both R2 & R3 because it is a fixed value. But somehow the router has figured out that the R2 path is not the best path. 

Recursion process for E2 routes is simple. This is how the router takes the above decision.

When router sees the external LSA (Type 5), it can see that the routing bit is set. If the routing bit is not set it will not start recursion. Also it can see that the advertising router is & the forwarding address is which means it should start recursion towards the advertising router.

1) Find whether the ASBR which is advertising is in the same area

No entry for router LSA --> Not in the same area

2) Query LSA Type 4 to find the ABSR summary to advertising router 

Now the router can see the forwarding metric to ASBR from 2 ABRs R2 & R3.

That means the cost to the ASBR is 20 from R2 & 10 from R3.

Now the router has to find the cost to the ABRs through his local area using the LSA type 1 (Shortest Path Tree)

3) Query LSA type 1 for both ABRs

Now the router can see to get to the R2 & R3 from his location it costs equally 10

Final calculation will be;

Through R2 = 10 + 20 = 30
Through R3 = 10 + 10 = 20

So the R3 is selected as the best ABR to reach the ASBR for the E2 route.

This is the fundamental logic how the router thinks for any complex E2 route.

So in show ip route command output you can see a forwarding metric variable which is 20 through R3 which is the real metric through the network to the destination.

0 comments to “LSA Recursion Process of OSPF in Path Selection for E2 Routes (LSA Type 5)”

Post a Comment