cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1541
Views
5
Helpful
4
Replies

OSPF Cost Calculation

Blackhawk1278
Level 1
Level 1

Does anyone know what OSPF uses to calculate cost when the link between it and the next router is a trunk link?  I am trying to setup OSPF between 3 different routers, in one connection its a /30 with the ip address configured directly on the interface and the other its OSPF configured on an SVI and a trunk is configured on the actual interface.  Instead of getting ECMP like I expected I am just seeing the routed link in the RIB and I think I recall something different about OSPF when it goes over L2 interfaces.  Thanks for any help

2 Accepted Solutions

Accepted Solutions

balaji.bandi
Hall of Fame
Hall of Fame

I believe OSPF cost for SVI is 100 (not the Link bandwidth or Trunk bandwidth), that can be changed based on the config or referecen bandwidth.

 

you can get  cost by issue command below :


show ip ospf interface brief

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

Hello,

That is a very correct observation. OSPF derives interface costs based on the perceived bandwidth of the Layer3 interface - in your case, from the SVI - and from the reference bandwidth.

Very importantly, IOS/IOS-XE and NX-OS differ in the default setting of the reference bandwidth. On IOS/IOS-XE platforms, it is set to 100Mbps. On NX-OS platforms, it is set to 40Gbps. That is why IOS and NX-OS platforms will produce vastly different interface costs for the same interfaces. It is not going to cause a routing loop but it can easily end up in asymmetric routing and inability to use parallel paths that you'd otherwise expect to have the same cost.

If you run OSPF in your network and you have a mixed NX-OS and IOS/IOS-XE environment, you should definitely make sure that all OSPF speakers use the same reference bandwidth.

Best regards,
Peter

View solution in original post

4 Replies 4

balaji.bandi
Hall of Fame
Hall of Fame

I believe OSPF cost for SVI is 100 (not the Link bandwidth or Trunk bandwidth), that can be changed based on the config or referecen bandwidth.

 

you can get  cost by issue command below :


show ip ospf interface brief

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Going to the other router where the destination SVI is configured it looks like it is giving all the SVI a cost of 40, I should also include the distant router is a nexus.  It looks like NXOS is giving SVI a cost of 40 while catalyst is giving a cost of 1

Hello,

That is a very correct observation. OSPF derives interface costs based on the perceived bandwidth of the Layer3 interface - in your case, from the SVI - and from the reference bandwidth.

Very importantly, IOS/IOS-XE and NX-OS differ in the default setting of the reference bandwidth. On IOS/IOS-XE platforms, it is set to 100Mbps. On NX-OS platforms, it is set to 40Gbps. That is why IOS and NX-OS platforms will produce vastly different interface costs for the same interfaces. It is not going to cause a routing loop but it can easily end up in asymmetric routing and inability to use parallel paths that you'd otherwise expect to have the same cost.

If you run OSPF in your network and you have a mixed NX-OS and IOS/IOS-XE environment, you should definitely make sure that all OSPF speakers use the same reference bandwidth.

Best regards,
Peter

Blackhawk1278
Level 1
Level 1

The cost is showing 1 for all SVI but when I look at the RIB i am getting 110/41

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: