CCNA online course

Routing Metrics Explained for CCNA

Learn how routing metrics rank paths, how metrics differ from administrative distance, and how RIP, OSPF, and EIGRP select routes.

A routing metric is a protocol-defined value used to rank candidate paths to the same destination network. A router uses the metric when multiple routes to that destination were learned through the same routing protocol.

In general, a lower metric is preferred. The meaning of the number depends on the protocol that calculated it. A RIP hop count, an OSPF cost, and an EIGRP composite metric use different scales and must not be compared as if they were the same measurement.

What a Routing Metric Does

A candidate route is a learned route that the router is evaluating for possible installation and use. When several candidate routes reach the same destination prefix, the routing protocol calculates or advertises a metric for each path.

The router prefers the path with the best metric according to that protocol. The selected route is placed in the routing table, which contains the routes the router can use to forward packets.

For example, if two RIP routes reach 10.0.0.0/24 and their metrics are 1 and 3, RIP prefers the route with metric 1. The router then uses that installed route when traffic matches the destination prefix.

Routing Metric Versus Administrative Distance

Administrative distance (AD) is a preference value used to choose between routes learned from different route sources or routing protocols. A routing metric ranks paths offered by the same routing protocol.

ConceptWhat it comparesExample
Administrative distanceRoute sources or protocolsChoosing between an OSPF route and a RIP route
Routing metricPaths learned through the same protocolChoosing between two RIP paths using hop count

The general route-selection order is:

  1. Identify the route sources that offer the destination prefix.
  2. Compare administrative distance. The route source with the preferred AD is selected.
  3. When competing routes are from the same protocol and have equal AD, compare that protocol's metric.
  4. If the routes are equally preferred under both criteria, the router may use equal-cost load balancing.
Decision stageQuestion askedOutcome
Compare route source preference using ADWhich source or protocol is preferred?Continue with the preferred route source.
Compare metrics for equal-AD, same-protocol routesWhich path has the better protocol-specific metric?Prefer the path with the lower metric.
Use equal-cost load balancingDo the paths have equal AD and equal metric?Multiple equal paths may be installed and used.

How Common Protocols Calculate Metrics

Every routing protocol defines its own metric and calculation rules. The metric describes what that protocol considers a desirable path.

Routing protocolMetric name or typePrimary inputsHow lower values are interpreted
RIPHop countNumber of router hopsA path through fewer routers is preferred.
OSPFCostCommonly derived from interface bandwidth settingsA path with lower total cost is preferred.
EIGRPComposite metricBandwidth and delay are key inputs under default weightingA path with the lower composite value is preferred.

An OSPF cost is the metric OSPF uses to rank paths. An EIGRP composite metric is calculated from route characteristics, notably bandwidth and delay under the default metric weighting. The numerical value produced by either protocol only has meaning within that protocol.

For more background on OSPF configuration and operation, see Configure OSPF.

RIP and Hop-Count Route Selection

RIP is a distance-vector routing protocol that uses hop count as its metric. Hop count is the number of router hops along a path to a remote network, meaning a network that is not directly connected to the local router.

Consider this topology:

  • Path 1: R1 → R2 → 10.0.0.0/24, with a RIP metric of 1.
  • Path 2: R1 → R3 → R4 → 10.0.0.0/24, with a RIP metric of 2.

Both routes are learned through RIP, so the route source and AD are equivalent for this comparison. RIP chooses the path through R2 because its hop-count metric is lower. R1 installs that route in its routing table and uses it for traffic destined for 10.0.0.0/24.

Destination prefixCandidate pathRouting protocolHop-count metricSelected?
10.0.0.0/24R1 via R2RIP1Yes
10.0.0.0/24R1 via R3 and R4RIP2No

Equal-Cost Load Balancing

Equal-cost load balancing means forwarding traffic across multiple routes that are equally preferred for the same destination. It can occur when candidate routes have equal administrative distance and equal metric under the relevant route-selection criteria.

For example, if R1 learns two RIP routes to the same prefix and both have a hop count of 2, neither path is better according to RIP's metric. If their route preference is also equal, the router can install and use both paths.

Equal-cost load balancing does not mean that any two routes can be used together. The paths must reach the identical destination prefix and be equally preferred according to the applicable AD and metric comparisons.

Why Hop Count Has Important Limitations

Hop count measures only the number of routers in a path. It does not measure available bandwidth, delay, congestion, or link quality.

Suppose a one-hop RIP path crosses a 56 kbps link, while a two-hop path crosses higher-speed WAN links. RIP still prefers the one-hop path because its metric is 1 rather than 2. The shorter path may therefore provide worse application performance even though RIP considers it the better route.

This example illustrates why a metric must be interpreted in the context of its protocol. A protocol that considers bandwidth or delay can make different decisions from RIP, which considers only hop count.

Complete Route-Selection Workflow

  1. Find matching destination routes. Determine which candidate routes can reach the destination prefix. Prefix matching is a separate routing-table concept from choosing among routes to the same prefix.
  2. Identify the route source. Determine whether each candidate came from a static route, a directly connected network, or a dynamic routing protocol.
  3. Compare administrative distance. Prefer the route source with the better AD when route sources differ.
  4. Compare the protocol metric. For routes from the same protocol and equal AD, compare that protocol's metric. Prefer the lower value.
  5. Check for equal-cost paths. If multiple candidates have equal route preference and equal metric, the router may use equal-cost load balancing.
  6. Install and use the selected route. The chosen route, or eligible equal-cost routes, becomes part of the usable routing information for forwarding.

Troubleshooting Routing-Metric Decisions

A router chooses a path that appears slower

The active protocol may be using a metric that does not represent the performance characteristic you are considering. RIP can prefer fewer hops even when the selected path has lower bandwidth.

  • Identify the protocol that supplied each candidate route.
  • Compare administrative distances when the routes come from different sources.
  • For routes learned through the same protocol, compare that protocol's metric.
  • Inspect bandwidth, delay, congestion, and link quality separately from the routing metric.

Two routes do not load balance

The routes may not be equal-cost candidates. Verify that both routes reach the identical destination prefix, have equal route preference based on AD, and have equal metrics under the routing protocol's calculation.

An engineer compares RIP and EIGRP metric numbers

Determine whether the routes came from different protocols. A small RIP hop count is not automatically better than a large EIGRP composite metric. Use AD to understand route-source selection, then use the appropriate protocol-specific metric for paths offered by the same protocol.

CCNA Summary

  • A routing metric ranks candidate paths to the same destination within a routing protocol.
  • Lower metric values are generally preferred.
  • AD compares route sources; metrics compare paths from the same protocol.
  • RIP uses hop count, OSPF uses cost, and EIGRP uses a composite metric based notably on bandwidth and delay.
  • Metrics from different protocols are not directly comparable.
  • Equal AD and equal metric can make equal-cost load balancing possible.
  • RIP's hop count ignores bandwidth, delay, congestion, and link quality.