Hello, you are using an old browser that's unsafe and no longer supported. Please consider updating your browser to a newer version, or downloading a modern browser.
Training Camp • Cybersecurity Glossary
OSPF's link metric, derived from interface bandwidth (cost = reference bandwidth / link bandwidth). The lowest total cost wins, so higher-bandwidth links are preferred.
OSPF Cost Definition: OSPF's link metric, derived from interface bandwidth (cost = reference bandwidth / link bandwidth). The lowest total cost wins, so higher-bandwidth links are preferred.
OSPF cost is the metric the Open Shortest Path First (OSPF) routing protocol uses to determine the best path to a destination. Each link is assigned a cost, and OSPF selects the route with the lowest cumulative cost using Dijkstra's shortest-path-first algorithm. Cost is inversely related to bandwidth, so higher-bandwidth links are preferred.
By default on Cisco routers, the cost of an interface is calculated as a reference bandwidth divided by the interface bandwidth, with the reference bandwidth defaulting to 100 Mbps (10^8 bits per second). A 100 Mbps link therefore has a cost of 1, and a 10 Mbps link a cost of 10. OSPF sums the costs of all outbound links along a path and chooses the lowest total. Because the default reference bandwidth treats anything 100 Mbps or faster as cost 1, administrators typically raise the reference bandwidth (or set interface costs manually) so gigabit and faster links are distinguished correctly.
OSPF cost matters because it directly governs traffic flow, making it relevant to both performance and security. Misconfigured costs can push traffic onto suboptimal or congested links, hurting availability, and an attacker who participates in the OSPF domain could advertise artificially low costs to attract and intercept traffic. This is why OSPF authentication (such as HMAC-SHA on OSPFv2) is used to ensure that only trusted routers influence path selection and cost calculations.
For example, a router can reach a destination over two paths: a direct 10 Mbps link (cost 10) or a route across two 100 Mbps links (total cost 2). OSPF chooses the higher-bandwidth two-hop path because its cumulative cost of 2 is lower than the direct link's cost of 10. If an administrator wants the direct link used instead, they can lower its cost manually so OSPF prefers it.
OSPF Cost is one of the topics you'll master in the Cisco CCNA Boot Camp.
Cisco CCNA Boot Camp →