cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1633
Views
10
Helpful
8
Replies

OSPF cost on SVI

m1xed0s
Contributor
Contributor

Say I have a 20Gbps L2 Port-Channel (2 x 10Gbps member) and I want to run OSPF peering using SVI on top of the Port-channel. Does OSPF calculate the cost based on 10Gbps, 20Gbps OR SVI as 1Gbps?

 

I did set the reference bandwidth as 10G. When I check the OSPF interface, I can see the OSPF cost is as 10 which means the switch/router calculated the cost using 1Gbps SVI interface?

1 Accepted Solution

Accepted Solutions

Joseph W. Doherty
Hall of Fame Master Hall of Fame Master
Hall of Fame Master

I possibly/likely misread your OP.  I read "I did set the reference bandwidth as 10G." as setting the SVI's bandwidth to 10g, but if you set the OSPF auto cost reference bandwidth to 10g, then yes an OPSF cost of 10 would imply OSPF "sees" the SVI bandwidth as gig.

You're also correct in your later posting how Cisco uses the OSPF reference bandwidth in calculating the OSPF cost and also correct in both that yes anything above the reference bandwidth will be calculated as a cost of 1 and if you want to avoid that, you need to set a higher reference bandwidth.

BTW, don't know if it still applies, but the OSPF metric only was a 16 bit value, so if you use a very high reference bandwidth, for low bandwidth links and/or long (i.e. multiple interfaces) OSPF paths, it's possible OSPF will overflow and once again OSPF cost will not reflect one path being better than another based on bandwidth.  If this is an issue, you can avoid it by manually costing some OSPF interfaces.  Remember, technically OSPF cost isn't a measure of bandwidth, although Cisco chose to use that in auto calculating it.

View solution in original post

8 Replies 8

Richard Burts
Hall of Fame Guru Hall of Fame Guru
Hall of Fame Guru

For a physical interface you do have a bandwidth that is meaningful and that can be used for calculation of routing metrics. But for virtual interfaces such as SVI (or tunnel interface, etc) there is not any real meaningful bandwidth and Cisco provides a default value which is not based on any real bandwidth.

HTH

Rick

Okey, so in my case it is just a coincidence that I got OSPF cost 10 on SVI while setting reference bandwidth as 10Gbps, right? So if I ran that 20Gbps port-channel as L3 for OSPF, the OSPF cost would be 1, same cost as a 10Gbps interface?

Joseph W. Doherty
Hall of Fame Master Hall of Fame Master
Hall of Fame Master

OSPF, by default (on a Cisco L3 switch), should determine OSFP cost based on what it believes is the bandwidth of the OSPF interface, in this case, the SVI.  (BTW, Cisco does, or did, computes the OSPF cost of any interface, 100 Mbps or better, as 1; again by default.)

paul driver
VIP Expert VIP Expert
VIP Expert

Hello
When you change the ref BW this will increase all routed physical ospf interfaces

The default is cost for 1gb interface is 1 and any higher than 1gb is 1 also and the svi cost defaults to 1

Now you've increased the default ref bw from 100million to 100billion(10GB) the svi cost  should increase to 10.

Lastly two 10GB routed ports in a L3 etherchannel the ospf cost should half from 10 to 5


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thanks, the OSPF cost calculation is “reference bandwidth divided by interface bandwidth”, right? So with 10Gbps as the reference bandwidth, the OSPF cost on my 20Gbps Etherchannel would be calculated as 10/20 = 0.5 (~1), right? 

if this is correct, I might need to consider increasing the reference bandwidth to 40 or even 100Gbps.

Hello
Ref bw is insdeed the value ospf uses againist the physcai interfaces

Example:
Default Ref BW:100MB -  <---as you can see 100Mb and 1GB link would cost the same with the ospf default
100MB = 100,000,000/100,000,000=1
1GB = 100,000.000/1,000,000,000 =1

Ref BW:1GB
100MB = 1,000,000,000/100,000,000=10
1GB = 1,000,000.000/1,000,000,000 =1

Ref BW:10GB
100MB = 10,000,000,000/100,000,000=100
1GB = 10,000,000,000/1,000,000,000 =10

Ref BW:100GB
100MB = 100,000,000,000/100,000,000=1000
1GB = 100,000,000,000/1,000,000,000 =100
10GB = 100,000,000,000/10,000,000,000 =10


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Joseph W. Doherty
Hall of Fame Master Hall of Fame Master
Hall of Fame Master

I possibly/likely misread your OP.  I read "I did set the reference bandwidth as 10G." as setting the SVI's bandwidth to 10g, but if you set the OSPF auto cost reference bandwidth to 10g, then yes an OPSF cost of 10 would imply OSPF "sees" the SVI bandwidth as gig.

You're also correct in your later posting how Cisco uses the OSPF reference bandwidth in calculating the OSPF cost and also correct in both that yes anything above the reference bandwidth will be calculated as a cost of 1 and if you want to avoid that, you need to set a higher reference bandwidth.

BTW, don't know if it still applies, but the OSPF metric only was a 16 bit value, so if you use a very high reference bandwidth, for low bandwidth links and/or long (i.e. multiple interfaces) OSPF paths, it's possible OSPF will overflow and once again OSPF cost will not reflect one path being better than another based on bandwidth.  If this is an issue, you can avoid it by manually costing some OSPF interfaces.  Remember, technically OSPF cost isn't a measure of bandwidth, although Cisco chose to use that in auto calculating it.

Thanks! The highest reference bandwidth I am thinking would be 100Gbps, considering what is running and what would be added in next 5-year.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers