Sunday, October 18, 2015

LSA Recursion Process of OSPF in Path Selection for N2 Routes (LSA Type 7)

OSPF default nssa-external route type N2 has a fixed metric while N1 increments its metric when its goes through hop by hop. So when N2 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 is a regualr area & Area 2 is a NSSA. 
R6 has a loopback 0 which is not advertised in the OSPF process directly but redistributed into the OSPF process as an N2 route. It will be the only nssa-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:
R6 e0/0:     LoopBack 0:

When the nssa-external route leaves area 2, it is translated to a regular external type E2 by the 2 ABR R5 which will be propagated to area 1 through area 0 through R2 & R3. 

This is the OSPF database of R4.

This is how R4 see the external route (LSA Type 5)

The metric is 20 which is the seed metric in the LSA Type 5.

Even though the metric is 20 from both paths router has a way to figure out the best path is via R3. It is done by the recursion process.

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 network. Advertising router is not important in E2 translated N2 routes. It is like that R5 is telling that to reach the external route you should find a way to reach not necessarily through me.

Then the recursion process starts.

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 3 to find the Network summary to forwarding address

This is the key difference between the recursion processes for E2 & N2 routes. For E2 routes it starts form querying LSA type 4 while for N2 routes it starts from querying LSA type 3.
Now router can see that if it chooses the R2 path, the cost to the forwarding address is 30 & through R3 the cost is 20.

Now the router has to find out the intra area costs to the routers which advertises the forwarding address to him. 

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 + 30 = 40
Through R3 = 10 + 20 = 30

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

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

Forward metric is the real metric which decides the path. Not the seed metric. But the seed metric is what installed in the routing table which technically has no use in path selection for both E2/N2 routes.

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

Post a Comment