cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1189
Views
0
Helpful
9
Replies

OSPF Route Metrics

cisco
Level 1
Level 1

Hi there, I'd just like a second opinion on some unexpected behaviour I am seeing in my test network. Please see the image below for an example topology.

OSPF Cost Problem.jpg

Routers are running (C3640-IK9S-M), Version 12.4(25d) inside GNS3 for test pruposes, although I am seeing this in the real world on physical routers.

In the above scenareo, we are simulating a link failure between R2 and R6. Analysis of the routing tables shows the following

On R1

Route to VLAN106 is next hop R2 metric 45

Route to VLAN106 is next hop R3 metric 45

On R2

Route to VLAN106 is next hop R5 metric 70

On R3

Route to VLAN106 is next hop R4 metric 35

On R4

Route to VLAN106 is locally connected

On R5

Route to VLAN106 is next hop R4 metric 50

On R6

Route to VLAN106 is locally connected


So, my question. Is this expected behaviour. R1's metric via R2 to VLAN106 is 45, but R2's metric to VLAN106 is 70????? R1 thinks the route is going to be R1-R2-R4-VLAN106, but R2 thinks the route is R2-R5-R4-VLAN106

If I "show ip ospf database summary" on R2 In Area 0 I see two Summary Network LS for network VLAN106, one advertised from R2 with metric 70 and the other advertised from R4 with metric 25.

I can't figure out why R2 isnt routing to the other BR, instead it using its own route into the area, even though it is a higher cost, than its neighbours BR lower cost route to VLAN106

Any ideas, as I cant figure out from the RFC what is going on here.

Cheers

Graham

9 Replies 9

cadet alain
VIP Alumni
VIP Alumni

Hi,

Are there switches  between routers and how do you simulate failure?

Regards.

Alain.

Don't forget to rate helpful posts.

There are no switches between the routers at all. They are all direct point to point links. When testing in GNS3, i simulate a failure by administratively shutting down the ethernet port on Router R2 that connects it to R6 (Note, this link is not drawn on the diagram as it is in the failed state) In real life testing, I pull the cable.

Cheers

Graham

It is as if this is the correct expected behaviour.

I have a real network built from Dell PowerConnect 8024F switches and that operates in exactly the same way.

I just cant figure out which part of the algorithm favours a route that immediately gets it into the target area, but with a higher cost, than getting to the same area via the other BR with a lower cost.

Maybe I'm just not understanding the way OSPF works well enough.

Graham

Is R2 seeing that VLAN106 is in Area 1, and therefore just chooses the shortest path to ANY border router that has an interface in Area 1. Which in this case is itself, and then once it has chosen that Border Router to use to get to Area 1, it then choses the shortest path within that area from the chosen BR to the destination network. This would certainly explain the behaviour I am seeing, although if this was the case, then you would expect the metric for R1 to VLAN106 via R2 would be 80 and not 45.

This method seems suboptimal.

My understanding of the protocol was that it would choose the lowest-cost combination of the following: the route with the lowest cost to the border router plus the interarea route with the lowest cost.

Here is the diagram without the failure.

Link failure is not the issue here, because even in the above scenareo R2 routes to VLAN106 via R6 with a metric of 45 instead of the lower cost route via R4 which has a metric of 35.

Likewise R4 routes to VLAN 104 via R5 with a metric of 45 instead of the lower cost route via R2 which has a metric of 30.

If you have multiple routes to the same network OPSF chooses as follows -

1) it uses route type to select route ie. intra-area is preferred over inter-area which is preferred over external

2) if you still have multiple routes you then use cost

3) if you still have multiple routes then these are equal cost routes and OPSF will load-balance across the links

In your case R2 (which has an interface in area 0 and area 1)  receives 2 advertisements for vlan 106 -

i) an intra-area advertisement from R5

II) an inter-area advertisement from R4

so using the selection criteria above it will choose the advertisement from R5.

R1 however will see both the advertisement from R4 and from R2 as inter-area routes ie. it doesn't have any interfaces in area 1 so it will use 2) in the selection criteria above and choose the lowest cost path.

Jon

That makes perfect sense Jon, Thanks for that.

I understand now why it chooses the intra area route regardless of cost.

....however

This does mean however that if I suffer a failure of the link between R2 and R6, that all traffic for that link is routed via R5 instead of my 40Gbit backbone to R4.

In my network R5 and R6 are quite highly utilised in terms of bandwidth and I need to avoid pushing data for R5 and R6 down a single link to R5.

The only way I can see round this is to split Area 1 into two areas so R5 has its own area and R6 also has its own area. R2 would then route traffic for R6 via the backbone to R4 and then out to the area which is the desired effect.

Thanks for your help...

Graham

cisco@gwharton.me.uk

That makes perfect sense Jon, Thanks for that.

I understand now why it chooses the intra area route regardless of cost.

That the OSPF design :

when there are multiple routes available to the same network with different route types , the preference order is :
1. Intra-area routes, O
2. Inter-area routes, O IA
3. External Type-1 routes, O E1
4. External Type-2 routes, O E2

Dan

Cheers,

Yeahh, I got that part of the spec. I was a little confused, as for some reason (probably because I thought OSPF ran on the loopback in area 0 on R2) that both adverts were inter area, as they were both advertising an area 1 network, and R2 OSPF was in area 0. But I now see that was wrong.

So just to get it straight, If I am a router and I have an interface in area 0 and an interface in area 1. On my area 0 interface I receive an LSA advertising an area 1 network (come into area 0 and relayed by another ABR), that is inter area (makes sense), and if I receive the LSA on my area 1 interface advertising an area 1 network, then this is intra area..

That makes much more sense now Ive spelt it out to myself.

Cheers Guys

Graham