Options

Determining Metric Costs

DerekAustin26DerekAustin26 Member Posts: 275
Net+ book says to determine the cost of a route metric you must divide the bandwidth in bps by 100,000,000

100Mb = 100,000,000 Correct?

Because the book shows a 100Mb path as a cost of 10
and a 1Gb path as a cost of 1

so OSPF will always choose the lowest cost

I thought 100Mb is 100 million. Megabits = Millions

Where am I going wrong?

Comments

  • Options
    Met44Met44 Member Posts: 194
    It looks like you have it flipped around. The OSPF cost calculation is this:

    COST = REFERENCE BANDWIDTH / INTERFACE BANDWIDTH

    And in Ciscoland, at least, the default reference bandwidth is 100 Mbps (100,000,000 bps, or 10^icon_cool.gif. This means that a 100 Mbps link would have a cost of 1, because 100 / 100 = 1.

    With a 1 Gbps link and a reference bandwidth of 100 Mbps, you would end up with a path cost of .1 (one tenth). While that may seem OK to a human, the software responsible for determining the metric will typically not be happy with a decimal number -- it will either be rounded up or dropped off (rounded down) depending on the code.

    For this reason, if you are using gigabit links (or you want to engineer your network with the future in mind), you should manually change the reference bandwidth to something like 1 Gbps -- or 10 Gbps. Using a reference bandwidth of 1 Gbps, the example you cited makes sense mathematically.

    You didn't mention what book you are using. It may have either brought up the point about reference bandwidth and you missed it, or it was meant to be included but instead omitted.

    Also, just a note on terminology. When talking about routing protocols in general, "cost", "metric", and "distance" are synonyms. When talking about a specific protocol, each arrives at a metric using different means. OSPF uses path cost as its metric. RIP uses distance as its metric, measured by hop count. The metric doesn't have a cost -- it is the cost.
  • Options
    DerekAustin26DerekAustin26 Member Posts: 275
    Okay thank you very much for the advice and help!

    The book says the formula is 100,000,000 / Bandwidth in bps = Metric

    I just dont understand how you can take 100,000,000 / 1 Gig and get 1

    Mathematically that should be .1

    Because it got a metric of 10 of the same formula. I can understand if the bandwidth was 10Mbps, that would make sense. I'll have to go get it and copy verbatim what it says so that you can see.
  • Options
    DerekAustin26DerekAustin26 Member Posts: 275
    Could you elaborate a little more on exactly what "reference bandwidth"? And is it relative? it's not a constant?
  • Options
    Met44Met44 Member Posts: 194
    Could you elaborate a little more on exactly what "reference bandwidth"?

    Reference bandwidth is an arbitrary number selected only to make OSPF's metric make sense. For example, you couldn't just take the bandwidth of an interface to use as a metric, because then 100 Mbps links would have lower -- better -- metrics than 1 Gbps (or 1000 Mbps) links. That wouldn't make sense. So, the idea was to find a way to make the opposite true -- 1 Gbps links should be preferred over 100 Mbps links. The easy way to do that is to take some number and divide it by the interface bandwidth. What you divide from is simply given the name "reference bandwidth".

    The only reason the reference bandwidth is some big number is because the programs that make these calculations are written to use only whole numbers (integers) as a metric. If the metric could be stored as a decimal number, you could just take the inverse of the interface bandwidth, like this:

    COST = 1 / INTERFACE BANDWIDTH

    That would work every time -- but decimal numbers won't work, because the metric is stored as a whole number. This is the same reason why you shouldn't use 1 Gbps links with a reference bandwidth of the default 10^8. Instead, change the reference bandwidth to a number greater than or equal to the highest link speed.
    And is it relative? it's not a constant?
    The number itself is not relative to anything. It is constant in the sense that every metric calculation is based off of the same number, but it is also configurable -- no number is immutably written into the spec (in fact, the whole idea of interface bandwidth as a cost is not a requirement of an implementation, but that is the default in practice, and probably what you should know for the exam).
    I just dont understand how you can take 100,000,000 / 1 Gig and get 1
    You don't. You may want to re-read the explanation in my first post. They either mentioned a reference bandwidth of1,000,000,000 (1 billion) somewhere and you missed it, or they should have included that and forgot.

    What book are you reading?
  • Options
    DerekAustin26DerekAustin26 Member Posts: 275
    Okay so the Reference Bandwidth is just the fastest circuit ? Say you have several routes. Route 1 is a 100Mb link, Route # 2 is a 1 gig link & Route #3 is 10Mb Link. The fastest one is 1 gig. So the formula for this network's metrics would be 1,000,000,000 / bandwidth bps. Meaning Route # 2 would have a Cost of 1. Route # 1 would have a Cost of 10. and Route # 3 (though obselete, but just for exercise of your explanation) is a cost of 100. This sound correct?
  • Options
    Met44Met44 Member Posts: 194
    The reference bandwidth is not necessarily the fastest circuit. You should manually configure it to be the speed in bits per second of fastest circuit (or something greater than that), but that burden is on you, the administrator. A device will not automatically figure out what the fastest link is and use that as the reference bandwidth, it will use whatever you configured -- or the default.

    The figures you wrote out are correct -- if you have previously manually configured the reference bandwidth to be 10^9. Just because the device has a Gigabit link doesn't mean OSPF will adjust accordingly. Realize that with the default setting, the Gigabit link would have a metric of .10, which gets bumped up to 1 -- same as Fast Ethernet. That could lead to results that you didn't intend.

    I see you have the calculation right. Other important things to get out of this include knowing the default reference bandwidth, how it affects the calculation when link speeds exceed the reference bandwidth, and how that in turn affects the network and causes "unexpected" results. This allows you to troubleshoot this sort of problem more effectively (at work or on the exam).
  • Options
    DerekAustin26DerekAustin26 Member Posts: 275
    oh okay. I think I understand now. Since the number is arbitrary. Reference Bandwidth is just whatever you configure it as. Say for example, i could choose 10 trillion.. The point is, whatever i'm dividing it by whether that be 1Gig link or 100Mbps all depends on the cost or "product". The higher the divisor (link dividnig the reference bandwidth) the lower the cost will be. Then this is where the OSPF protocol says "hey, i see i have route 1 which is a lower cost than route 2 or 3, so I choose route 1"

    Thanks for the patience and explanation!
Sign In or Register to comment.