Evil_TTL> show | s

OSPF Cost

Category:Cisco Systems -> Routing and Switching

Look at the diagram:

OSPF-Cost-10.png

OSFP is the routing protocol used in the network. The cost of each interface is highlighted by letter C and a number from 1 to 100.

Which way router R1 would prefer to send a packet to network 10.0.5.0/24? Why? How is the cost of routing calculated?

Router R1 would take route through router R2 because the route cost is lower than that taken through router R3 and is equal to 75 against 111:

Cost of route R1->R3->R4100 10 111
Cost of route R1
->R2->R464 10 75 

NOTE
Only the cost of outbound interfaces is taken into account when calculating OSPF route metrics.

The cost of an interface is calculated by the formula:

Cost Reference Bandwidth 

By default reference equals 100000 [Kbit/s].

If so, then to calculate T1 (1544) connection cost we would do the following:

Cost 100000 1544 64,76 

Number 64,76 is rounded down to 64. So we get T1 interface cost that equals 64.

NOTE
Connection speeds higher than 100 Mbit/s will always have cost equalled 1.

Interface cost can be customized by ip ospf cost {value} command, or it can be calculated by the mentioned formula with changed bandwidth value.

By privilege15