Open Shortest Path First (OSPF) - Router Alley
Open Shortest Path First (OSPF) - Router Alley
Open Shortest Path First (OSPF) - Router Alley
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>OSPF</strong> v1.31 – Aaron Balchunas<br />
14<br />
The <strong>OSPF</strong> Metric<br />
<strong>OSPF</strong> determines the best (or shortest) path to a destination network using a<br />
cost metric, which is based on the bandwidth of interfaces. The total cost of<br />
a route is the sum of all outgoing interface costs. Lowest cost is preferred.<br />
Cisco applies default costs to specific interface types:<br />
Type<br />
Cost<br />
Serial (56K) 1785<br />
Serial (64K) 1562<br />
T1 (1.544Mbps) 64<br />
Token Ring (4Mbps) 25<br />
Ethernet (10 Mbps) 10<br />
Token Ring (16 Mbps) 6<br />
Fast Ethernet 1<br />
On Serial interfaces, <strong>OSPF</strong> will use the configured bandwidth (measured in<br />
Kbps) to determine the cost:<br />
<strong>Router</strong>(config)# interface s0<br />
<strong>Router</strong>(config-if)# bandwidth 64<br />
The default cost of an interface can be superseded:<br />
<strong>Router</strong>(config)# interface e0<br />
<strong>Router</strong>(config-if)# ip ospf cost 5<br />
Changing the cost of an interface can alter which path <strong>OSPF</strong> deems the<br />
“shortest,” and thus should be used with great care.<br />
To alter how <strong>OSPF</strong> calculates its default metrics for interfaces:<br />
<strong>Router</strong>(config)# router ospf 1<br />
<strong>Router</strong>(config-router)# ospf auto-cost reference-bandwidth 100<br />
The above ospf auto-cost command has a value of 100 configured, which is<br />
actually the default. This indicates that a 100Mbps link will have a cost of 1<br />
(because 100/100 is 1). All other costs are based off of this. For example, the<br />
cost of 4 Mbps Token Ring is 25 because 100/4 = 25.<br />
* * *<br />
All original material copyright © 2007 by Aaron Balchunas (aaron@routeralley.com),<br />
unless otherwise noted. All other material copyright © of their respective owners.<br />
This material may be copied and used freely, but may not be altered or sold without the expressed written<br />
consent of the owner of the above copyright. Updated material may be found at http://www.routeralley.com.