Cost based on bandwidth parameter on Cisco devices

© 2002, Cisco Systems, Inc. All rights reserved. Cisco CCIE Prep v1.0—Module 7-19

Cisco's OSPF default cost assignment is based on the bandwidth of the link. Other vendors might use a different mechanism to assign OSPF cost to a link, so you may have to manually set the cost associated with a link in some scenarios. OSPF requires that all interfaces connected to a link agree on the link's cost. By default, Cisco routers calculate the cost of a link using the following formula.

■ Reference Bandwidth / Bandwidth

The default reference bandwidth is Fast Ethernet (100 Mbps). Therefore, the formula can also be written as:

Using this formula, here are some examples that yield the default costs:

■ 56-Kilobits per second (Kbps) serial link: Default cost is 1785

■ T1 (1.544-Megabits per second (Mbps) serial link): Default cost is 64

■ Ethernet: Default cost is 10

■ 16-Mbps Token Ring: Default cost is 6

Table 6-3: <ip ospf cost> Commands

Command

Description

ip ospf cost <165,53 5>

Interface configuration command that assigns a value from 1 to 65535 that indicates the cost of the interface. The cost of a route in OSPF is the sum of the costs of all outgoing interfaces to that destination.

Note On serial lines, the default bandwidth is 1.544 Mbps. If the link's speed is actually slower than that, use the bandwidth command to specify the real link speed. This will ensure accurate metrics in routing protocols, such as OSPF, Interior Gateway Routing Protocol (IGRP), and Enhanced IGRP (EIGRP).

Packets Received Out of Order

In the default OSPF configuration, links greater than or equal to 100MBPS are seen as equal cost

This behavior can be modified through the "auto-cost reference bandwidth" command

© 2002, Cisco Systems, Inc. All rights reserved.

Cisco CCIE Prep v1.0—Module 7-20

When OSPF was developed in the early 1990s, the designers seemed to believe that the fastest media that would ever be available was 100 Mbps. At least, that is how they wrote the formula that OSPF uses to calculate costs. This becomes a problem when you add some newer technologies such as Asynchronous Transfer Mode (ATM) and Gigabit Ethernet into your OSPF network. Using the default reference bandwidth of 100,000,000, OSPF will see all of these link types including Fast Ethernet as a cost of 1. For example, this becomes a problem when a certain destination is accessible over both Gigabit Ethernet and Fast Ethernet. OSPF will actually try and load balance across these two links. If you are running a media type that is faster than 100 Mbps you should actually change the reference bandwidth that OSPF uses in its formula for calculating costs. Since Gigabit Ethernet is now widely available it is suggested that you change the reference bandwidth to reflect Gigabit Ethernet speeds, which correlates to 1,000,000,000.

Table 6-4: < auto-cost > Commands

Command

Description

auto-cost reference-bandwidth <ref-bw>

Reference bandwidth, in Mbps. The range is 1 to 4294967; the default is 100. Performed from router configuration mode.

Note Any change using this command must be done on all routers in the autonomous system so that they are all using the same formula to calculate cost. The value set by the ¡p ospf cost command still overrides the cost resulting from the auto-cost reference-bandwtfth command.

Hello and Dead Timers

Continue reading here: Timers can be manually adjusted through the ip ospf hellointerval and ip ospf deadinterval commands

Was this article helpful?

0 0