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)
Feature | Metric | Administrative Distance (AD) |
---|---|---|
Used within a protocol | ✅ Yes | ❌ No |
Used between protocols | ❌ No | ✅ Yes |
Lower value preferred? | ✅ Yes | ✅ Yes |
Example protocols | RIP, OSPF, EIGRP | RIP (120), OSPF (110), EIGRP (90), etc. |
Purpose | Choose best path within a protocol | Choose 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
Protocol | Default Metric | Meaning |
---|---|---|
RIP | Hop count | Number of routers |
OSPF | Cost | Based on bandwidth |
EIGRP | Composite | Bandwidth, delay |
BGP | Attributes | AS_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
Command | Description |
---|---|
show ip route | See routing table with metrics |
show ip protocols | Shows protocol info and metrics |
show ip ospf interface | OSPF cost per interface |
show ip eigrp topology | EIGRP 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
Protocol | Metric Type | Description |
---|---|---|
RIP | Hop Count | Simple, limited, no bandwidth consideration |
OSPF | Cost | Inversely proportional to bandwidth |
EIGRP | Composite Metric | Bandwidth + Delay + (optional reliability/load) |
BGP | Path Attributes | AS_PATH, LOCAL_PREF, MED, WEIGHT, etc. |