05-17-2022 08:40 AM - last edited on 05-23-2022 04:17 AM by Translator
Hi all,
I'm having a hard time understanding the calculation of the cost for OSPF metric.
I know that the cost is calculated with:
Cost = Reference Bandwidth / Interface Bandwidth
and that the default value is 100 Mbps.
But what if an assignment says to configure a router so that GigabitEthernet cost will be 10 and FastEthernet will be 100?
Could that be done by shuffling the equation, so that it would be:
Reference Bandwidth = Cost * Interface Bandwidth?
Then it would be:
10 Mbps * 1000 Mbps = 10.000 Mbps.
Is that correct?
I'm especially asking because I'm doing the Packet Tracer 2.7.1 assignment, and it only allows (give points) when using 1.000 as reference bandwidth. All I learned so far points me to the conclusion that the assignment is wrong, but I feel like I'm getting more and more confused.
I appreciate your help and time
Best regards
Jacob
Solved! Go to Solution.
05-17-2022 09:02 AM - last edited on 05-23-2022 04:23 AM by Translator
Hello,
you can do this 1 of 2 ways.
1. configure the reference bandwidth to 10000 (10 Gbps) That will give your desired result of GigabitEthernet cost will be 10 and FastEthernet will be 100 (preferred as you can do this in global router mode for ospf for the device. Make sure every device is configure with the same reference bandwidth to avoid Issues)
2.) You can Individually configure each fastethernet and gig link with the
ip ospf cost <#>
command (not recommended as you would have to configure each interface separately)
But since the reference BW is set in your lab assignment you may have to modify link settings individually.
Hope that helps
-David
05-17-2022 08:51 AM - last edited on 05-23-2022 04:20 AM by Translator
Your undertanding correct.
The calculation is Reference Bandwidth / Configured Bandwidth
For a 100Mb switch / Router interface using the default reference bandwidth of 100Mb
The calculation is 100Mb / 100Mb =1
The calculation is 1000Mb / 100Mb =10
you can also change the cost as per the requirement.
autocost reference-bandwidth X
<1-4294967> The reference bandwidth in terms of Mbits per second
But when you change this all the routers should be same reference bandwit
I know bit confusing, but when you do couple of test Labs you can understand more here.
05-17-2022 09:02 AM
Hi Balaji,
Thank you very much for your answer.
So, what I'm understanding from your answer is that to get the gigabitethernet to have a cost of 10, I would need a reference-bandwidth of 10.000, correct?
In that case, the assignment is wrong, I guess.
05-18-2022 03:28 AM
Cost only required if you looking to Traffic engineer for Loadbalance the Links. we need to setup the reference bandwidth in reasonable way it works as expected in the entire path of the links.
I would need a reference-bandwidth of 10.000, correct?
this 10GB right ? why do you want setup as 10GB reference bandwidth ?
05-17-2022 09:02 AM - last edited on 05-23-2022 04:23 AM by Translator
Hello,
you can do this 1 of 2 ways.
1. configure the reference bandwidth to 10000 (10 Gbps) That will give your desired result of GigabitEthernet cost will be 10 and FastEthernet will be 100 (preferred as you can do this in global router mode for ospf for the device. Make sure every device is configure with the same reference bandwidth to avoid Issues)
2.) You can Individually configure each fastethernet and gig link with the
ip ospf cost <#>
command (not recommended as you would have to configure each interface separately)
But since the reference BW is set in your lab assignment you may have to modify link settings individually.
Hope that helps
-David
05-17-2022 09:21 AM
Hi David,
Thank you very much for your response.
The assignment says "Configure the OSPF routers so that the gig interface cost will be 10 and the fa interface will be 100". If I set the auto-cost reference-bandwidth to 1.000 I get full points, but not if I use 10.000. Could that be considered an error in the assignment, or is there another factor I'm not aware of that would cause this issue?
Thanks again
05-17-2022 09:29 AM - edited 05-17-2022 09:30 AM
In my response above the other way to change the cost is manually per interface while still keeping the reference bandwidth at 1.000 still keeping inline with the assignment.
I don’t think it’s an error in the assignment since there are multiple ways to configure cost in OSPF. To me the assignment is just verifying that you know the ways in case one way is limited in future assignments/tests or real world.
-David
05-19-2022 09:34 AM
Hi again David,
I talked to the instructor today, and he made it clear that there was an erorr in the assignment. It should have been 10.000 as reference and done on the ospf process.
However, he told me exactly what you've been saying - stay alert of the different ways to do something. Tests, future assignments and/or real-world doesn't always have all the options
Thanks a bunch for your help, I really appreciate you taking the time to answer
05-17-2022 09:29 AM - last edited on 05-23-2022 04:28 AM by Translator
A. OSPF uses a reference bandwidth of 100 Mbps for cost calculation. The formula to calculate the cost is reference bandwidth divided by interface bandwidth. For example, in the case of Ethernet, it is 100 Mbps / 10 Mbps = 10.
Note: If
ip ospf costcost is used on the interface, it overrides this formulated cost. For more information, refer to OSPF Cost.
https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/9237-9.html
all Q about the OSPF here
05-17-2022 09:35 AM
BTW, another way to look at this, OSPF reference is the bandwidth that will compute a cost of 1, or the "highest" bandwidth (as in anything above it will also be computed as 1).
So, for example, with Cisco's (other vendors often use a different default reference bandwidth, if they support auto OSPF costing based on bandwidth) default OSPF bandwidth of 100 Mbps, a FE at 100 Mbps computes as 1, so goes a 1 Gbps. 10 Mbps, Ethernet, will compute as 10.
If we make the reference bandwidth 1 Gbps, 1 Gbps will still compute as 1, FE now 10, and Ethernet as 100.
If we make the reference bandwidth 10 Gbps, 1 Gbps will now be 10, FE 100 and Ethernet 1,000 (and a 10 G will be [still] 1, although not previously mentioned).
BTW, reference bandwidth doesn't need to match a real interface bandwidth, so, for example, if we use an OSPF reference bandwidth of 2 Gbps (10G would be 1), 1 Gbps 2, FE 20 and Ethernet 200.
Also BTW, keep in mind reference bandwidth is per device. If your reference bandwidth doesn't meet or exceed your highest bandwidth, OSPF will consider such all the same, for example, with the default, 10g, 1g, and FE will also be consider equal. If you set a very high reference bandwidth, "slow" interfaces will generate a very high cost which might exceed OSPF cost allowance (used to be 64K, later implementation might go larger). So, on devices with high speed LAN OSPF connections, you'll likely want to increase reference bandwidth, but on devices with low speed WAN connections, might may want to leave the setting at its Cisco default.
05-19-2022 09:36 AM
I did not know that you could use fx. 2 Gpbs as a reference! That's really nice to know!
Thanks for explaining it in detail
05-17-2022 05:00 PM
Hello
@jacobholmjensen wrote:
Then it would be: "10 Mbps * 1000 Mbps = 10.000 Mbps". Is that correct?
Correct - for your assignment the ref BW would be set to 10000
Not sure if noted by others, but if you set ref BW in a production ospf domain its suggested to apply it to all routers within that ospf domain, and given the current high BW availability on new hardware, 100,000 could be an acceptable value.
Lasty, Manual costing is most applicable however it can be an administrative burden to manage as your network expands.
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