Kahibaro
Discord Login Register

9.6 Metrics

Introduction

Routing metrics are simple numerical values that help routers choose one path over another when several routes exist to the same destination. They are the way a routing protocol expresses “how good” or “how bad” a path is. Each routing protocol has its own rules for calculating and comparing metrics, but the idea is always to pick the path with the best metric according to that protocol.

This chapter focuses only on the concept of metrics themselves and on common metric types. Details about how individual routing protocols work are covered in their own chapters.

What a Metric Represents

A metric represents a cost. The lower the cost, the more preferred the route. This cost is not always about money. It can represent distance, time, speed, or quality of the path. A router does not look at the physical map of the network. It only sees numbers in the routing protocol’s updates and chooses the route with the lowest metric value for a destination network.

A router always prefers, for a given routing protocol, the route with the lowest metric to a destination.

If two routes from the same protocol have identical metrics, many protocols can use equal cost load balancing to send traffic across both paths. How that works is handled in specific protocol chapters.

Metrics vs Administrative Distance

Metrics and administrative distance are related to route selection but they solve different problems.

Administrative distance decides which routing source is more trusted, for example static route vs OSPF vs RIP. This is used when different routing protocols know about the same destination.

A metric is used inside a single routing protocol to choose among multiple paths that come from that protocol.

You can think of it as a two step decision.

StepQuestionUses
1Which routing source do I trust more?Administrative distance
2Inside that source, which path is best?Metric

This chapter only explains the second step, the metric comparison inside a given protocol.

Common Properties of Metrics

Although different protocols define different metrics, most routing metrics share some common properties.

First, they are numeric values. Smaller is better. Second, they are relative. A metric of 10 is only meaningful when compared with another metric like 20 for the same destination.

Many metrics are additive along a path. For example, if each link has a cost, a router sums the costs of all links along a route to get the total metric for that route.

Some metrics use a formula based on link characteristics such as bandwidth or delay. These are usually protocol specific. You will see exact formulas when learning each protocol.

Routing metrics are relative, numeric costs used to compare multiple routes inside the same routing protocol. Smaller metric values are always preferred by that protocol.

Types of Metric Components

Different protocols may use one or more of the following basic ideas when they build a metric value.

Hop Count

Hop count is the simplest metric. It counts how many routers a packet must go through to reach the destination. Each router between source and destination is a “hop.” The path with fewer hops has a better metric.

Hop count does not care about link speed or quality, only about the number of routers along the path. As a result, a path with two very slow links might be chosen over a path with three very fast links, simply because 2 is less than 3.

Bandwidth Based Cost

Many protocols base their metric on interface bandwidth. Higher bandwidth links are usually preferred because they can carry more traffic.

A common idea is to define cost as some reference bandwidth divided by the link bandwidth. In such a system, faster links produce lower cost values. The exact reference value and unit conversions depend on the protocol and version.

In practice, bandwidth based cost lets routers choose a high speed path over a low speed backup link even if the high speed path has more hops.

Delay

Delay is the time it takes for a bit of data to travel across a link or path. Some protocols can measure or estimate delay per interface and combine these delays along the route.

When delay is used in a metric, a path with lower total delay is considered better. This can sometimes conflict with pure bandwidth choices. A link might be fast in terms of bandwidth but introduce more delay than a simpler path.

Reliability

Reliability describes how often a link fails or experiences errors. Links with frequent errors or flaps are less reliable. Some protocols can track an interface reliability value and then factor that into the metric.

A high reliability value usually reduces the cost, so more reliable links are preferred. If a link becomes unstable, its reliability component might worsen the total metric so that another path becomes more attractive.

Load

Load reflects how busy a link is. A heavily used link has higher load. Some metrics can consider current load to push traffic away from congested paths.

However, using load as part of the metric can cause constant rebalancing if the traffic pattern changes quickly. For this reason, not all protocols actively use dynamic load based metric changes in simple networks.

MTU and Other Attributes

MTU, the maximum size of packets over a link, does not usually appear directly as the numeric metric value, but it can influence routing behavior and path suitability for certain applications.

Protocols may also use other internal attributes as part of their composite metric calculations, but to a beginner it is enough to understand that they are different ways to express the quality or cost of a path.

Single Metric vs Composite Metric

Some routing protocols use a single simple metric component. For example, using only hop count is an example of a single metric.

Others use a composite metric, which combines multiple factors such as bandwidth and delay into one overall number. A composite metric is usually a function that takes each component, maybe applies weights, and outputs a single value that can be compared between routes.

You can view it like this at a high level.

$$
\text{Composite Metric} = f(\text{bandwidth}, \text{delay}, \text{reliability}, \text{load}, \dots)
$$

The details of $f$ are specific to each protocol. What matters here is that composite metrics can make more intelligent decisions but are also more complex to understand and tune.

A single metric uses one factor, for example hop count. A composite metric combines several factors such as bandwidth, delay, reliability, and load into one numeric cost.

Metric Limits and Maximum Values

Every metric type has some minimum and maximum values. Typically, the minimum meaningful value is 1, and very large values can be treated as infinite cost.

If a route’s metric becomes too large, the protocol may consider that route unreachable. For example, some protocols define a specific maximum metric value that means “infinite” and use it to signal that a route is no longer valid.

This prevents faulty routes from being considered just because they existed at some point. You will see concrete numbers for maximum metric values in the chapters that describe individual routing protocols.

Manual Metric Tuning

Network administrators can usually change metric related settings on their routers. This allows manual control over which path is preferred when multiple paths exist.

Common reasons to tune metrics include preferring a certain link as primary and keeping another one as backup, or steering specific types of traffic through a more suitable path.

You might, for example, increase the cost on a slower satellite link so that it is used only if a terrestrial link fails. The routing protocol still runs normally, but the adjusted metrics guide its decisions.

Manual tuning must be done carefully. Inconsistent or extreme metric changes across routers can create unexpected traffic flows or even routing loops. The design chapters and protocol specific chapters will connect metric tuning to real world scenarios.

Metrics in Equal Cost Paths

Sometimes two or more routes to the same destination have exactly the same metric value within the same protocol. In that situation, many modern routers and protocols support equal cost multipath routing.

This means the router installs both routes into its forwarding table and shares traffic across them. The details of how this load sharing is performed, for instance per flow or per packet, are not part of basic metric theory but are important in practical design.

The key point is that identical metrics from the same protocol do not always force a single winner. Instead, they can create multiple parallel paths that are all considered equally good.

Summary

Routing metrics are the internal “scores” that routing protocols assign to paths. They decide which path is best inside a single protocol, while administrative distance decides which protocol to trust more overall.

Metrics can be based on simple ideas such as hop count or on richer information such as bandwidth and delay. Some protocols use a single factor, others combine multiple factors into a composite metric. Metric values must remain within defined limits, and manual tuning allows administrators to shape traffic patterns by influencing which paths are preferred.

In later routing protocol chapters, you will see exactly how each protocol defines and calculates its metric, and how those definitions impact the behavior of real networks.

Views: 39

Comments

Please login to add a comment.

Don't have an account? Register now!