VMware ESXi and vSphere Cluster Management

Routing Metrics Explained: How Routers Choose the Best Path

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

What Is a Routing Metric?

A routing metric is a protocol-specific value used to rank multiple paths to the same destination. A router uses the metric to help select the best path—the route preferred for installation and packet forwarding according to the route-selection rules.

In the usual case, a lower metric is preferred. However, the meaning of a number depends on the routing protocol that produced it. A metric of 2 in RIP means two router hops; a metric from EIGRP represents a different calculation entirely.

Metric comparison applies when the competing routes were learned through the same routing protocol. Before comparing metrics, the router may first need to decide which routing information source it trusts.

Administrative Distance Comes Before the Metric

A router can learn routes to the same destination from different sources, such as a static route, RIP, OSPF, or EIGRP. Administrative distance (AD) is a trust ranking used to choose between routes learned from different routing sources. A lower administrative distance is normally preferred.

After administrative distance identifies the preferred source, the routing protocol's metric is used to choose among paths learned from that same protocol. In short:

  1. Compare administrative distance when routes come from different routing sources.
  2. For routes from the selected protocol, compare that protocol's metrics.
  3. Install the best path, or install multiple qualifying equal-cost paths.

Attribute | Administrative Distance | Routing Metric

What it compares | Route sources or protocols | Paths within one routing protocol

Primary question | Which source is more trusted? | Which path does this protocol rank highest?

Scope | Between different routing information sources | Among routes learned through the same protocol

Typical rule | Lower AD is preferred | Lower metric is usually preferred

Example | Prefer OSPF over RIP when AD values make OSPF more trusted | Prefer a one-hop RIP path over a two-hop RIP path

Protocol-Specific Metrics

Every dynamic routing protocol defines and calculates its metric differently. The metric is not a universal measurement shared by all protocols.

Routing Protocol | Metric Name or Inputs | What the Metric Represents

RIP | Hop count | The number of routers in the path

OSPF | Cost | An OSPF path-cost value used to rank routes

EIGRP | Composite metric using bandwidth and delay | A protocol-specific path calculation based commonly on network characteristics

RIP Hop Count

RIP is a distance-vector routing protocol that uses hop count as its metric. Hop count measures how many routers a packet must cross to reach the destination network. RIP prefers the path with fewer hops.

OSPF Cost

OSPF cost is the metric OSPF uses to rank paths. It represents an OSPF path-cost calculation rather than simply counting routers. OSPF can therefore distinguish paths using its cost rules even when paths have the same number of hops.

EIGRP Composite Metric

An EIGRP composite metric is calculated from network characteristics. Its commonly used inputs include bandwidth and delay. The resulting number is meaningful within EIGRP's calculation system, not as a universal score that can be compared directly with RIP or OSPF values.

Why Metrics from Different Protocols Cannot Be Compared Directly

Different protocols use different scales, formulas, and units. A small RIP number is a hop count, while an EIGRP number is a composite value. The numbers do not represent the same quantity.

For example, suppose a destination has a RIP route with a metric of 2 and an EIGRP route with a displayed metric of 50,000. The RIP route is not automatically better because 2 is numerically smaller. The router does not compare 2 and 50,000 as though they were values on one common scale. It uses administrative distance to choose between the RIP and EIGRP sources, then uses the selected protocol's metric to compare paths within that protocol.

RIP Example: Choosing the Lower-Hop Path

Assume R1 must reach the network 10.0.0.0/24. R1 learns two routes through RIP:

  • Path 1: R1 reaches the destination through R2.
  • Path 2: R1 reaches the destination through R3, then R4, before reaching the destination network.

All routers use RIP, so both candidate routes come from the same routing protocol and have the same administrative-distance relationship. R1 can therefore compare their RIP metrics.

The path through R2 crosses one routing device before reaching the destination network, so its RIP hop-count metric is 1. The path through R3 and R4 crosses two routing devices, so its metric is 2.

Candidate Path | Routing Protocol | Administrative Distance Relationship | Hop Count | Selected?

R1 → R2 → 10.0.0.0/24 | RIP | Same as the other RIP route | 1 | Yes

R1 → R3 → R4 → 10.0.0.0/24 | RIP | Same as the other RIP route | 2 | No

R1 selects the route through R2 because RIP prefers the lower hop count: 1 is lower than 2. The selected route is placed in R1's routing table, the table containing routes selected for forwarding packets. When R1 receives a packet destined for 10.0.0.0/24, it consults that table and forwards the packet toward R2.

Limitations of RIP Hop Count

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

Consider two RIP paths:

  • A one-hop path crosses a slow 56 kbps connection.
  • A two-hop path crosses a high-speed WAN link.

RIP still selects the one-hop path because its metric is 1, while the other path has a metric of 2. RIP does not include bandwidth in its hop-count calculation. The one-hop path may perform worse for real traffic despite having the lower RIP metric.

This illustrates an important principle: a lower metric is better according to the criteria used by that protocol. It does not necessarily identify the path with the highest bandwidth or lowest delay.

Equal-Cost Load Balancing

If a router learns multiple routes to the same destination with equal administrative distance and equal metric, the routes may qualify as equal-cost paths. The routing protocol can install multiple qualifying paths and distribute traffic across them. This behavior is called equal-cost load balancing.

Equal-cost load balancing applies to comparable routes that satisfy the protocol's rules. Two routes merely having similar-looking numbers from different protocols do not qualify. For example, a RIP metric of 3 and an EIGRP metric of 3 are not automatically equal-cost paths because those values come from different metric systems.

Applying the Selection Process

  1. Confirm that the routes reach the same destination prefix, such as 10.0.0.0/24.
  2. Identify the source of each route: static configuration, RIP, OSPF, EIGRP, or another source.
  3. If the sources differ, compare administrative distance to select the more trusted source.
  4. If the routes come from the same protocol, compare that protocol's metrics.
  5. Prefer the lower metric when the protocol defines lower as better.
  6. If qualifying routes have equal administrative distance and equal metric, consider equal-cost load balancing.
  7. Use the selected route or routes in the routing table for packet forwarding.

Conceptual Troubleshooting

Fewer Hops but a Slower Link

Symptom: A router selects a path with fewer hops even though another path has much higher bandwidth.

Likely cause: The routes are being evaluated by RIP, which uses hop count only and does not use bandwidth in its metric.

Conceptual check: Count the routers in each RIP path. If the selected route has the lower hop count, RIP is behaving as designed.

A Small Metric Versus a Large Metric

Symptom: An engineer assumes a route with metric 3 must be preferred over a route with a much larger metric from another protocol.

Likely cause: Metrics from separate protocols are being treated as though they share one scale.

Conceptual check: Identify the protocol supplying each route. Compare administrative distance first, then compare metrics only among routes from the selected protocol.

Expected Load Balancing Does Not Occur

Symptom: Multiple paths are expected to share traffic, but only one path is installed or used.

Likely cause: The paths may not have matching administrative distance and metric, may reach different destination prefixes, or may come from different routing sources.

Conceptual check: Verify the destination prefix, routing source, administrative distance, and protocol-specific metric for every candidate route.

Summary

  • A routing metric is a protocol-specific value used to rank paths to the same destination.
  • Administrative distance compares route sources; a metric compares paths within a routing protocol.
  • Administrative distance is considered before the protocol metric when different sources advertise the same destination.
  • RIP uses hop count, OSPF uses cost, and EIGRP uses a composite calculation commonly involving bandwidth and delay.
  • Metric numbers from different protocols cannot be compared directly.
  • Equal administrative distance and equal metric can allow equal-cost load balancing.
  • RIP may select a slow one-hop path over a faster multi-hop path because it measures hops rather than performance.

Continue with routing metric concepts and route selection as you review how routers choose forwarding paths.