02-18-2021 11:09 AM
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?
Solved! Go to Solution.
02-19-2021 09:18 AM
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.
02-18-2021 11:18 AM
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.
02-18-2021 11:23 AM - edited 02-18-2021 03:16 PM
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?
02-18-2021 11:22 AM
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.)
02-18-2021 03:09 PM - edited 02-19-2021 12:43 AM
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
02-18-2021 03:21 PM
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.
02-19-2021 12:36 AM - edited 02-19-2021 12:42 AM
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
02-19-2021 09:18 AM
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.
02-19-2021 10:04 AM
Thanks! The highest reference bandwidth I am thinking would be 100Gbps, considering what is running and what would be added in next 5-year.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide