What metric does each common routing protocol use?
Show the answer
Say this first
RIP counts hops, up to 15. OSPF uses cost, by default 100 Mbps divided by interface bandwidth, summed along the path. EIGRP uses a composite of the slowest bandwidth and total delay. IS-IS uses a metric of 10 per interface by default regardless of speed. BGP has no single metric: it picks a path with an ordered list of attributes, and its MED attribute is the one called "metric".
Go deeper
| Protocol | Metric | Default behaviour to know |
|---|---|---|
| RIP | hop count | 16 means unreachable, so the network is at most 15 hops wide |
| OSPF | cost = reference bandwidth / interface bandwidth | reference is 100 Mbps, so FastEthernet, 1G and 10G all cost 1 |
| EIGRP | 256 x (10^7 / slowest bandwidth in kbps + total delay in tens of microseconds) | with default K values only bandwidth and delay count |
| IS-IS | sum of interface metrics | every interface is 10 unless you set it; narrow metrics cap a link at 63 |
| BGP | best path algorithm | weight, local preference, AS path length, origin, MED and more, in order |
OSPF reference bandwidth
Because the default reference is 100 Mbps, OSPF cannot tell 1G from 100G. Set the same value on every router in the domain, in Mbps:
router ospf 1
auto-cost reference-bandwidth 400000EIGRP worked number
One GigabitEthernet hop to a neighbor's GigabitEthernet LAN: 10^7 / 1,000,000 = 10, total delay
10 + 10 microseconds = 2 tens of microseconds, so 256 x (10 + 2) = 3072. That is the [90/3072] you see
so often in labs. Named mode with wide metrics scales this for links faster than 1 Gbps.
They will ask next
Why does hop count make RIP a poor choice on mixed links?
It treats a 1 Gbps hop and a slow WAN hop as equal, so RIP happily sends traffic over two slow links instead of three fast ones.
What do you set the IS-IS metric to in practice?
Operators enable wide metrics (
metric-style wide) and set metrics per link by bandwidth or by design intent, because the default of 10 everywhere ignores speed.
Traps
- Forgetting to raise the OSPF reference bandwidth, then wondering why OSPF load balances a 1G and a 10G link.
- Saying BGP uses hop count. AS path length is one tie-breaker deep in the list, not a metric.