Search this Blog

Monday, November 1, 2010

What are the rules that OSPF uses to select the best path.

We can't quite understand the rules that OSPF uses to select the best path.

1. Intra-area routes
2. Interarea routes

3. E1 routes
4. E2 routes

In the following example the ABR2 will choose the Cost=100 path to reach subnet 1 instead of going through ABR1 which has lower cost. However how to explain it by the rules?

ABR2 learns Subnet1 either through T3 LSA originated by ABR3 in Area0 or a T3 LSA in Area1 from ABR1. Are the routes learned through Type 3 LSA all called "Interarea routes"? Or "Intra"/"Inter" are actually refering to whether the next-hop/forwarding IP is learned through L1/L2 or L3? Even so it still doesn't make sense because ABR2 has interfaces in both Area0 and Area1 so no matter which one is the next hop the ABR2 can always reach it within the same Area... I think it only makes sense if Area 0 has higher priority than other areas so routes or LSAs (maybe only for T3 LSAs) learned in Area 0 are taking preference than LSAs learned through other areas.

OSPF Path Selection.jpg

Tips:

OSPF Path selection rules say:

-Take shortest path to area0

-Take shortest path across area0 without traversing nonzero area

-Take shortes path to destination without traversing area0

or you can say within the area OSPF use link state logic and between areas OSPF act pretty much as Distance Vector protocols. Also area0 is backbone and all areas should be connected to area0(apart from virtual link) so it doesnt make sense that traffic destined for non zero area traverse via non zero area ---> area0 then again ---> non zero area.

The ABR2 has links both in areas 0 and 1, and if you examined its link-state database, you would indeed see that it is aware of the Subnet 1 both via ABR1 and ABR3. However, because the ABR2 is an area border router, it considers only LSA3 and LSA4 received from the area 0 for routing table calculation. The RFC 2328 states explicitly in the Section 16.2:

The inter-area routes are calculated by examining summary-LSAs.

If the router has active attachments to multiple areas, only

backbone summary-LSAs are examined. Routers attached to a

single area examine that area's summary-LSAs.

This requirement essentially forces a multi-area router to reach inter-area routes using only the backbone. This is also the reason for the ABR2 to ignore the more feasible path via ABR1 to reach the Subnet 1, and use the only remaining path directly via ABR3. As the link between ABR1 and ABR2 already belongs to the Area 1, the LSA-3/4 received via this link are not considered on ABR2 to calculate inter-area routes.

Citation - This blog post does not reflect original content from the author. Rather it summarizes content that are relevant to the topic from different sources in the web. The sources might include any online discussion boards, forums, websites and others.

No comments :

Post a Comment

 
/* Google Analytics begin ----------------------------------------------- */ /* Google Analytics end ----------------------------------------------- */