10-28-2021 10:07 AM
Hi there,
I just have a general question about OSPF . Does OSPF Algorithm selects the best path on basis of cost of interface or the link between two routers in same prefix and if that is true , what happens lets say if there are two routers in WAN and they are in same prefix but one router R1 interface is 10 gb port and other is 1 gb port , autonegotiation is turned off . So auto-mdix checks the cable and brings the link operationally up but what speed would the link share ?
10-28-2021 10:18 AM
OSPF uses cost of egress interface toward destination network, if it's using that (there are exceptions, for example, E1 vs. E2).
Cisco (historically) uses bandwidth of egress interface for cost calculation using a base of 100 Mbps, so, for such, Cisco's OSPF implementation might "cost" both gig and 10g as just 1.
10-28-2021 10:27 AM
So basically cisco OSPF implementation doesn't support more than 1 gig interface bandwidth ? And Can you please also answer I am confused as to if there are different speed interfaces in the network when those are connected to each other what speed does would the link be established upon ? I know it is going to be full duplex assuming autonegotiation is turned off .
Also when we connect a router interface to switch , interfaces comes up operationally do does that mean auto-mdix plays role here in brining that link up with the best speed supported for both interfaces ?
Thank you
10-28-2021 02:53 PM
"So basically cisco OSPF implementation doesn't support more than 1 gig interface bandwidth ?"
As already noted by the others, no/incorrect. Cisco's usual default it to OSPF cost based on what it believes is the interface bandwidth using 100 Mbps as the reference bandwidth. I.e., generally the default cost for 100 Mbps or better is 1.
As also already noted by others, there is a OSPF command to change the reference bandwidth so that higher bandwidths, than 100 Mbps, do not all become a cost of 1.
"And Can you please also answer I am confused as to if there are different speed interfaces in the network when those are connected to each other what speed does would the link be established upon ?"
How would you accomplish "different speeds" on the same link?
You could, though have, for example, a switch that interconnects devices with different speeds which "think" they are on the same physical link. In such cases, egress bandwidth (or OSPF defined cost) is what's used, even though that bandwidth isn't actually available between the end points of the "link".
Basically, if you create a situation where one OSPF path "appears" better than another, when it's really not, OSPF goes by what "appears".
Also BTW, I mentioned you can explicitly set OSPF cost per interface, but you can also explicitly set an interface's "bandwidth" which may not actually be the interface's bandwidth. If you use the interface bandwidth command, OSPF uses that over whatever the interface would consider its physical interface bandwidth, which might actually be "more correct", such as an Ethernet interface hand-off of some bandwidth (i.e. 10, 100, gig, 10g, etc.) while the provider polices the available bandwidth to some lower value.
10-29-2021 07:28 AM
Hi Joseph thank you for biref explanation but I am still confused. My understanding is there are two ways to distinguish higher bandwidth links in routing domain for OSPF configuration, one is to use higher reference bandwidth value across the routing domain or set individual OSPF interface cost .So where my confusion starts is when there are 2 interfaces constituting a path (subnet) thats needs to be advertised to the routing domain and one consist of higher bandwidth and lets say I configure with interface badnwidth command the cost on it manually does that mean when that link is advertised any traffic going towards that destination subnet is going to be forwarded through that egress interface ?
10-29-2021 09:12 AM
Again, it would help if you would provide an example of a topology that's causing your confusion. Unclear how your are doing your "two interfaces".
BTW, generally Cisco doesn't support more than one L3 interface to same connected network on L3 switch or router, i.e. NO 192.168.1.0/24) <> R1 <> (192.168.1.0/24).
However, let's try something like:
(192.168.1.0/24) <FE> R2 <FE> R1 <FE> R3 <10Mbps> (192.168.1.0/24)
From R1, usually we would expect OSPF to chose the R1 => R2 => (192.168.1.0/24), unless, for example, we manually changed OSPF interface costs, manually set logical bandwidth "different"than physical bandwidths on interfaces, changed reference cost to be different on different routers, etc.
If we had, instead:
(192.168.1.0/24) <FE> R2 <10Mbps> R1 <FE> R3 <10Mbps> (192.168.1.0/24)
We would expect, from R1 ECMP, i.e. "round-robin" usage of R1 => R2 => (192.168.1.0/24) AND R1 => R3 => (192.168.1.0/24)
10-29-2021 09:36 AM
I understand what you are stating I cannot provide topology as it wont let me post it here .
We have three routers R1,R2,R3 . R1 is directly connected to R2, R3 .
(192.168.1.0/24)R3-R1-R2(192.168.1.0/24)
R3 interface connecting to 192 subnet is 10 gig and R2 is 1 Gig
So if interface is configured with logical bandwidth on the interface configuration context of R3 and R2 and assuming reference bandwidth is 100 Mb so that means OSPF will propagate 192.168.1.0/24 through R3 egress interface as 10 gig interface cost is lower than 1 gig manually configured . Is that correct?
10-29-2021 02:23 PM
"Is that correct?"
Unclear because you describe setting manually on gig interface.
However, without configuring bandwidth or OSPF cost manually, no, not correct, if, as you note, reference bandwidth is 100 Mbps. If such, OSPF will treat 10g, gig and FE all alike for costing purposes.
However, if you set reference bandwidth to 10g, then OSPF will direct traffic to 10G interface (this also assumes inter router connections also cost the same).
10-29-2021 05:41 PM
What do you mean by inter router connections same ???
All i am stating here is that R3 to its directly connected network has 10 gig interface and OSPF is enabled on it but with manual configuration so that when R1 gets LSA through R3 AND R2 it picks R3 route to its remote network as the link cost is less.
10-30-2021 08:40 AM
". . . but with manual configuration . . ."
Which is?
Again, by default, Cisco's OSPF may (i.e. usually) cost FE, gig and 10g all alike. I.e. R1 might not be able to "see" a difference between R2's and R3's connection to the subnet. (That the reason my earlier examples use FE and 10 Mbps.)
Also, again, you didn't describe what R1's connections to R2 and R3 are. I.e. R1 will sum those transit links along with R2's and R3's egress interfaces to subnet.
Unfortunately, you've provided insufficient information to determine how R1's OSPF will select path, or paths, to subnet.
10-28-2021 10:48 AM - edited 10-28-2021 03:53 PM
Hello
Ospf path calculation is based on a default reference bandwidth 10^8/interface bandwidth
however this could mean a 1gb and 100gb interface could be costed out the same so to negate such a miscalculation ospf has enabled to change the reference bandwidth default to accommodate much higher interface bw unless you managed costing via interface.
router ospf xx
auto-cost reference bandwidth xxxxx
int x/x
ip ospf cost xxx
10-28-2021 11:14 AM
Thank you for reply,
So just to put in context we can manually configure auto reference bandwidth on both links but this would cause cost miscalculation for SPF Computation. So it is better to manually adjust it to same bandwidth ? I am hoping I wrote it correctly here
10-28-2021 01:30 PM
Hello,
As Paul stated the command would be entered under the global Router OSPF command instead of per interface.
Ideally you would want to enter the same command (reference bandwidth) on all routers in your domain so they all come to the same cost. The reference BW configured should be the highest BW in the routing domain so all routers are using the same calculation. This is not required and neighbors/adjacency's will still form but it will cause SFP miscalculations. Secondly, if you adjust the BW on the interface you can create suboptimal routing depending on your configuration. Anything higher than 100Mbps configured on the interface is a standard cost of 1 unless configured explicitly.
-David
Please rate and mark posts accordingly if you have found any of the information provided useful.
It will hopefully assist others with similar issues in the future
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