Octet

What is ECMP, and how does a Cisco router share traffic across equal paths?

Show the answer

Say this first

Equal-cost multipath installs several paths with the same best metric for one prefix. On IOS, OSPF, EIGRP and RIP install up to 4 by default and BGP only 1; maximum-paths raises it to the platform limit. CEF shares traffic per flow: it hashes source and destination addresses so packets of one flow stay on one path and arrive in order. EIGRP can also share unequal paths with variance.

Go deeper

What it looks like

Output
O        10.1.0.0/24 [110/2] via 10.0.12.2, 01:12:44, GigabitEthernet0/0/1
                     [110/2] via 10.0.13.2, 01:12:44, GigabitEthernet0/0/2

Configuration

Cisco IOS
router ospf 1
 maximum-paths 8
!
router bgp 65001
 address-family ipv4
  maximum-paths 4
  maximum-paths ibgp 4

BGP is pickier

BGP only treats paths as multipath candidates when they tie on weight, local preference, AS path length, origin and MED, are of the same type (all eBGP or all iBGP) and have the same IGP cost to the next hop. By default the AS paths must also be identical; bgp bestpath as-path multipath-relax relaxes that to the same length, which is common when multihoming to two providers.

Per flow, not per packet

Per-packet sharing (ip load-sharing per-packet on the interface) spreads load evenly but reorders TCP segments, which causes duplicate ACKs and slows transfers. Per-flow is the default and the right choice. The cost is that one large flow can only ever use one link.

Traps

  • Saying ECMP doubles the speed of a single download. A single flow stays on one path.
  • Forgetting that BGP defaults to one path. Without maximum-paths, the second ISP link sits idle for outbound traffic.
How did you do?Book 3.4 Routing