A metric is a value that routing protocols use to compare paths to the same destination. When multiple routes exist, the route with the lowest metric wins.
Different protocols use different metrics:
- RIP: Hop count (number of routers to cross)
- OSPF: Cost (based on interface bandwidth)
- EIGRP: Composite (bandwidth, delay, reliability, load)
- BGP: Multiple attributes (AS path length, MED, etc.)
Metrics only compare routes from the same protocol. If OSPF and RIP both have a route to , administrative distance decides which protocol wins. The metric then compares routes within the winning protocol.