Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

OSPF SPF calculation

In OSPF or ISIS, When I "show ip ospf border-router"

there is SPF value at the end of each line. anybody can tell me how to calculate that?

for example,

i 192.168.1.1 [1626] via 192.1.40.1, serial 3, ABR/ASBR, Area 0, SPF 8

i 192.168.1.1 [74] via 192.1.30.1, Serial1, ABR/ASBR, Area 3, SPF 27

how to get the SPF value 8 or 27?

for this example, traffice will go through serial 3 instead of serial 1, even serial 1 has low cost.

is it possible to increase/decrease the value?

Thanks a lot

13 REPLIES
Cisco Employee

Re: OSPF SPF calculation

These values correspond to the number of times the SPF was executed for the respective areas. You can also see that same information using the "sh ip ospf" command.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: OSPF SPF calculation

Thanks.

I am still confused.

Lower SPF with higher cost is the better path than higher SPF with lower cost?

Cisco Employee

Re: OSPF SPF calculation

SPF (shortest path first) is not a metric but rather an algorithm that is executed to calculate the best path to any given prefix in the network. Every time the state of a link changes in a given area, SPF is executed and this counter is incremented.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: OSPF SPF calculation

see my topology

R1--64K ospf area2---R2---EIGRP---R3

R1--10M ospf area3---R4---10M area3--R5--10M area3--R6--10M area 0---R2

R1 has two paths to R3(ospf external network), first is via 64K, second is via some 10M

the cost of 64K link is higher than the 10M link, but the traffice still go throuth 64K

I don't know why, I am looking for answer now

I just guess, if between R2 and R3, run OSPF instead of EIGRP, the traffic will go through the 10M link, I will simulate later after this got solved.

thanks

Cisco Employee

Re: OSPF SPF calculation

R1 prefers the 64Kbps link since the path to the ASBR is learnt via an intra-area route.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: OSPF SPF calculation

Thanks for your answer.

I don't understand

R1 has two paths to ASBR, both of them via intra-area (area 2 and area 3). and 10M link's cost is lower than 64K', why prefer to 64K? because 64K link only one hop(ospf is not a protocol based hop)?

If EIGRP was replaced to OSPF, the traffice still prefer 64K link?

would you like to explain more ?

otherwise, how to let all traffic via 10M link, and prevent traffice via 64K (maybe ISDN)?

Thanks a lot

Cisco Employee

Re: OSPF SPF calculation

According to the diagram you posted, R1 has an intra-area route to R2 via the 64Kbps link and and inter-area route (has to traverse area 3, 0 to get to R2)via the 10M links. The intra-area route is preferred.

Replacing Eigrp by OSPF on the link between R2 and R3 and making sure you pur that link in area 0 should force the traffic to go through the 10M links.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: OSPF SPF calculation

Great.

I need to confirm that.

if EIGRP is still between R2 and R3, so all traffic will go via 64K link, may I force all traffic go the 10M link?

Thanks a log

Cisco Employee

Re: OSPF SPF calculation

Unfortunately, because OSPF always prefer a intra-area route over an inter-area route you will not be able to force R1 to send its traffic to R3 via the 10M link using OSPF without changing the topology. You could always resort to using a static route on R1 pointing to R4.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
New Member

Re: OSPF SPF calculation

I will confirm that.

if the 64K link is ISDN, when I ping EIGRP from R1, the ISDN will up and flapping.

I will try now.

Thanks

New Member

Re: OSPF SPF calculation

Thanks again

I got all information.

for multi-path, the prefer order is

longest match---intra area----inter area ----E1 external---E2 external

Thanks

New Member

Re: OSPF SPF calculation

Wrong result

the IP of R3' Loopback0 is 192.168.3.3/24

on R1, I set a static route point to R4,

like

ip route 0.0.0.0 0.0.0.0 E0_ip_of_R4

"sh ip route " on R1, there is a route still via 64K

O E2 192.168.3.3 via 64K link

traceroute 192.168.3.3 on R1, all traffic go 64K link.

after I shutdown the 64K link,

"sh ip route" on R1

O E2 192.168.3.3 via 10M link

so, see "O E2", both of them are "O E2", so 64K link is still prefered, even I set static route.

(from R1 see R2 loopback is "O" via 64k, intra-area, O IA via 10M, inter-area, this is right)

Cisco Employee

Re: OSPF SPF calculation

I was actually referring to specific static routes to whatever networks are redistributed from EIGRP to OSPF. This is not a very good way to address the issue but as I stated this morning you will not be able to do it with OSPF without changing the topology.

Hope this helps,

Harold Ritter
Sr. Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México 
Paseo de la Reforma 222 Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
421
Views
14
Helpful
13
Replies
CreatePlease login to create content