Metric – Concept Checklist

  • ✅ Metric = numerical value used by routing protocols
  • ✅ Determines the “cost” of reaching a destination
  • ✅ Lower metric = preferred route
  • ✅ Each routing protocol calculates metric differently
  • ✅ Metrics are only comparable within the same protocol
  • ✅ Can be manually configured for influence and control
  • ✅ Key role in route selection, load balancing, and redistribution

📘 Definition of Metric in Routing

A metric is a value assigned by routing protocols to each route, which determines the preference or desirability of a path to a destination network. The lower the metric, the more preferred the route.

🎯 Purpose of Metric in Route Selection

Routing protocols often learn multiple routes to the same destination. The purpose of the metric is to provide a quantitative basis to select the best path. It enables routers to:

  • Prefer faster, more reliable, or more efficient routes.
  • Support policy-based routing or load balancing.
  • Make dynamic adjustments to changing network conditions.

⚖️ Difference Between Metric and Administrative Distance (AD)

FeatureMetricAdministrative Distance (AD)
Used within a protocol✅ Yes❌ No
Used between protocols❌ No✅ Yes
Lower value preferred?✅ Yes✅ Yes
Example protocolsRIP, OSPF, EIGRPRIP (120), OSPF (110), EIGRP (90), etc.
PurposeChoose best path within a protocolChoose best protocol for same route

📌 Example: If RIP and OSPF both know how to reach 10.0.0.0/24, AD will decide. If two OSPF paths exist, metric decides.

📡 How Routers Use Metrics to Choose the Best Path

When a router has multiple routes to a network from the same protocol, it:

  • Compares the metric values of all routes.
  • Selects the route with the lowest metric.
  • If multiple routes have equal metric, it may install all (ECMP).
  • If from different protocols, AD is used first, then metric.

📐 Metric Calculation Methods in Different Routing Protocols

1. RIP – Hop Count

  • Metric = Number of routers (hops) between source and destination.
  • Max = 15 hops (16 = unreachable).
  • ❌ Doesn’t consider bandwidth or delay.

2. OSPF – Cost

  • Metric = Reference Bandwidth ÷ Interface Bandwidth
  • Default Reference = 100 Mbps
  • Lower bandwidth = higher cost.

3. EIGRP – Composite Metric

  • Uses formula involving bandwidth, delay, reliability, load
  • Metric = [ (10⁷ / bandwidth) + delay ] × 256

4. BGP – Path Attributes

  • Uses attributes: AS_PATH, LOCAL_PREF, MED, Origin, Weight
  • Very policy-driven

📊 Default Metric Values and Their Meaning

ProtocolDefault MetricMeaning
RIPHop countNumber of routers
OSPFCostBased on bandwidth
EIGRPCompositeBandwidth, delay
BGPAttributesAS_PATH, etc.

🛠️ Configuring and Modifying Metrics Manually

interface GigabitEthernet0/1
 ip ospf cost 5
router rip
 network 192.168.1.0
 distance 120
 metric 3

⚖️ Equal-Cost Multi-Path (ECMP) Routing and Metrics

If a protocol finds multiple paths to the same destination with equal metrics, it may install all in the routing table.

📏 Metric Comparison Within the Same Routing Protocol Only

Metrics are not comparable across protocols.

⚙️ Metric Manipulation for Load Balancing or Policy Routing

Adjust metrics to avoid certain paths or control routing behavior.

🧭 Using Route Maps to Influence Metrics

route-map SET_METRIC permit 10
 match ip address 1
 set metric 20
router rip
 redistribute ospf 1 route-map SET_METRIC

🔁 Metric Conversions During Route Redistribution

router eigrp 1
 redistribute ospf 1 metric 10000 100 255 1 1500

🕒 Metric’s Impact on Routing Convergence Time

Lower metrics converge faster, but unstable metrics may cause flapping.

🔍 Viewing and Troubleshooting Metrics

CommandDescription
show ip routeSee routing table with metrics
show ip protocolsShows protocol info and metrics
show ip ospf interfaceOSPF cost per interface
show ip eigrp topologyEIGRP metrics per route

🧠 Best Practices for Metric Design and Optimization

  • ✅ Ensure consistent metric assignment
  • ✅ Use manual tuning to prioritize critical paths
  • ✅ Avoid route flapping by avoiding dynamic metric fluctuation
  • ✅ Plan for ECMP where applicable
  • ✅ When redistributing, explicitly define metrics
  • ✅ Use route maps and policy routing carefully
  • ✅ Document metric policies for maintenance and audits

🧾 Summary Table: Protocols & Metrics

ProtocolMetric TypeDescription
RIPHop CountSimple, limited, no bandwidth consideration
OSPFCostInversely proportional to bandwidth
EIGRPComposite MetricBandwidth + Delay + (optional reliability/load)
BGPPath AttributesAS_PATH, LOCAL_PREF, MED, WEIGHT, etc.

Routing Metric Quiz

1. What is the primary purpose of a routing metric?

Correct answer is C. Metric is used by routing protocols to determine the cost of using a route.

2. Which metric value is preferred by routing protocols?

Correct answer is A. Lower metric values indicate more preferred routes.

3. Which routing protocol uses hop count as its metric?

Correct answer is D. RIP uses hop count as its metric.

4. How does OSPF calculate its metric?

Correct answer is B. OSPF uses cost, which is calculated from bandwidth.

5. What components does EIGRP's composite metric include?

Correct answer is C. EIGRP uses a composite metric including bandwidth, delay, reliability, and load.

6. Which protocol uses path attributes like AS_PATH for route selection instead of numeric metrics?

Correct answer is A. BGP uses path attributes like AS_PATH instead of numeric metrics.

7. What happens if multiple equal-metric routes exist in the same routing protocol?

Correct answer is D. Equal-cost multi-path (ECMP) allows routers to load balance across all equal-metric routes.

8. Can routing metrics be compared between different routing protocols?

Correct answer is B. Metrics only have meaning within the same protocol; AD is used between protocols.

9. Which Cisco IOS command is used to set the OSPF cost on an interface?

Correct answer is C. The command 'ip ospf cost' sets the OSPF cost on an interface.

10. Why is manual metric tuning important?

Correct answer is A. Manual tuning controls route priority and traffic flow.

← Back to Home