cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8574
Views
25
Helpful
14
Replies

OSPF path selection

Difan Zhao
Level 5
Level 5

Hi experts,

I'm reading the CCIE exam certification guide and I 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. I'm so confused... Help please... Thanks!

OSPF Path Selection.jpg

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

This is a nice example

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.

Best regards,

Peter

View solution in original post

14 Replies 14

ahmed.saud
Level 1
Level 1

Hi

I am like you studying for CCIE

As far as I understand

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.

Thanks,

Hey Ahmed,

Thanks for the reply. The rules make sense. Are they rules for Inter-area routes? Because the rules in the certificate guide say that the Intra-area routes are most prefered.

Thanks,

There are two types of OSPF external routes(E1 and E2)

  • E1:It will add individual metric
  • E2:It will not add individual metric
  1. O(LSA 1):Networks within the same Area
  2. OIA(LSA 3):Network from outside the area of the router but within the OSPF Autonomous System.
  3. OE1(LSA 5):It will add the individual metric.It is the network outside the autonomous system of the router.It redistributes routes into ospf
  4. OE2(LSA 5):It will not add the individual metric.It is the network outside the autonomous system of the router.It redistributes routes into ospf

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

This is a nice example

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.

Best regards,

Peter

Hi Peter,

Your explaination is very clear! Thanks so much. So this rule is a separate rule from the rules that listed in my earlier post, correct? Or is the rule actually somehow concluded from the other rules?

Peter explained it in good way as he always do

Intra-area routes are preferred over all routes but in this example subnet1 is inter-area route at ABR2 from ABR1 and ABR3.

So here in this case we are looking at path selection criteria when both routes are inter-area routes

Hello Ahmed,

Thank you for your compliment - you are very kind!

Best regards,

Peter

Hello,

Thank you very much. It was a pleasure.

When speaking about rules concerning path selection in OSPF, we have to carefully distinguish between two different sets of rules. The first set of rules governs what topological information is used in the first place to construct the shortest path tree, i.e. what can the shortest path tree actually be constructed from. The second set of rules kicks in only after the shortest path tree has been built and multiple paths to the same destination are found. One set does not imply the other - both sets are complementary.

The rule I have cited from the RFC 2328 belongs to the first set of rules while the ordering O < OIA < OE1=ON1 < OE2=ON2 is the second set of rules.

As there are quite a few similar "hidden" rules to OSPF, I really recommend the RFC 2328. It is not that hard, and it really is the definitive source of information.

Best regards,

Peter

Got it! Thanks for the clairification!

Hi Peter,

Could you elaborate on this -The rule I have cited from the RFC 2328 belongs to the first set of rules while the ordering O < OIA < OE1=ON1 < OE2=ON2 is the second set of rules.

Thanks

Hi Ravi,

Man, this is an old thread :)

The first set of rules I have mentioned is related to the choice of LSAs you can use for the shortest path computation. In general, when performing an SPF computation, every router has to go through the following list of checks:

  • Any LSA whose Age is MAXAGE (3600 seconds) or more is ignored.
  • If an LSA1 or an LSA2 (call it LSA X) references another LSA1 or LSA2 (call it LSA Y), check whether LSA Y includes a reference back to LSA X. If not, ignore LSA Y.
  • If an LSA1 or an LSA2 (call it LSA X) references another LSA1 or LSA2 (call it LSA Y), check whether LSA Y is already on the computed shortest path tree. If yes, ignore LSA Y.
  • If the router performing the SPF is an Area Border Router (ABR), ignore any LSA3 and LSA4 that have been received over non-backbone areas.
  • Any LSA3, LSA4 and LSA5 that indicates a cost of LSInfinity (16777215) is ignored.
  • Any LSA3, LSA4 and LSA5 originated by the router itself is ignored.
  • Any LSA3 advertising a network/netmask equal to a configured active area range is ignored. An area range is active when the router has at least one intra-area path that falls under this area range, and is thus performing the summarization.
  • Any LSA5 whose originating ASBR is unreachable (no intra-area or inter-area path exists) is ignored.
  • Any LSA5 with a non-zero Forwarding Address whose Forwarding Address is unreachable (no intra-area or inter-area path exists) is ignored.

The second set of rules relates to the fact that after you perform the shortest path tree computation, you can still arrive at multiple paths to the destination. In that case, intra-area paths are preferred to inter-area paths, inter-area paths are preferred to external Type1 paths, and external Type1 paths are preferred to external Type2 paths.

I did not comment on checking LSA7 used in NSSA areas but their checks are similar to LSA5, with some additional rules I don't want to dive in here.

Would this help a little?

Best regards,
Peter

Thanks a lot for your help.

I got it.

What resource would you recommend  for ccie  routing and switching?

Hi Ravi,

You are welcome. As for CCIE R&S preparation - I really suggest asking this question on the Cisco Learning Network because that is exactly the forum where people discuss the ways they prepare for their exam.

There is no single resource. I co-wrote the CCIE Routing & Switching v5.0 Official Certification Guide Volume 1, and I recommend using the entire CCIE Routing & Switching v5.0 Official Guide Library as a reviewer and refresher of all topics before you go for your Written Exam. But to get a deep dive into individual topics you will need to look into other books and sources because each of them is a topic for a book on its own. As a preparation for the Lab Exam, again, Cisco Press has a series of books from Martin Duggan with practical labs on the CCIE level; a new book by Narbik Kocharians with introductory labs covering the CCNP-to-CCIE gap is in preparations, and I strongly suggest you consider purchasing either a workbook from one of the CCIE bootcamp providers to work on in your free time, or even attend a bootcamp yourself.

But these are only very approximate suggestions - really, the CLN is the best place to ask these types of questions.

Best regards,
Peter

Hello Ravi Pande.We are providing our customers official and 100% real CCIE Routing and Switching Lab Question. Which are best to pass your CCIE Routing and Switching Lab in first attempt. If you have short time then this link is your key to success. For more information visit: www.ccieroutingandswitchinglabdumps.blogspot.com

I hope this link help you.

Review Cisco Networking for a $25 gift card