Free tech learning for everyone, from basics to pro

Routing & SwitchingNetworking SecurityIntermediate

ECMP and CEF load sharing: per-destination, per-packet and why one flow uses one link

In short: When a router has several equal-cost routes to the same destination it can use all of them. CEF chooses a path per flow by hashing addresses (and optionally ports), so packets of one conversation stay in order on one path. This shares load across many flows but means a single large transfer only ever uses one link.

Several best routes

If OSPF finds two paths to 10.50.0.0/16 with exactly the same cost, it installs both. This is equal-cost multipath (ECMP). The default limit is usually four paths in IOS, and you can raise it with maximum-paths under the routing process (up to 16 or 32 depending on the platform). BGP installs only one path by default, so it needs maximum-paths configured explicitly. EIGRP can even use unequal-cost paths with the variance command.

How CEF picks one of several equal pathsPacket arrivessrc, dst, portsHashflow fields +unique IDBucketone of 16 slotsPathexit interface
Figure 1. Every packet of the same flow gives the same hash, so it always takes the same path and stays in order.

Per-destination (per-flow) sharing

CEF's default is per-destination load sharing, which in practice means per flow. For each packet, the router hashes the source and destination IP addresses (and on many platforms the Layer 4 ports, with ip cef load-sharing algorithm include-ports source destination) together with a per-router unique ID. The result points to one of 16 hash buckets, each tied to a path. Every packet in the same flow produces the same hash, so it always goes the same way.

This keeps packets in order, which matters a lot for TCP: out-of-order packets look like loss and make TCP slow down.

Per-packet sharing

With ip load-sharing per-packet on an interface, the router sends packets in turn across the paths. Load is perfectly even, but packets of one flow arrive out of order whenever the paths have slightly different delays. Voice and TCP suffer. It is almost never recommended today.

The catch: one flow, one link

Because each flow sticks to one path, a single big file transfer or backup between two servers can only use one link, however many paths exist. Two 10 Gbps paths do not make one 20 Gbps transfer. Many small flows (users browsing, many servers talking) spread well; a few large "elephant" flows can leave one link full and another nearly empty.

Polarisation

If every router in a chain uses the same hash inputs, flows that went left at the first router all go left again at the next one, leaving some links unused. This is called CEF polarisation. The unique ID that modern IOS adds to the hash (the "universal" algorithm) avoids it, and the fast convergence note covers it in more depth.

Checking it

  • show ip route 10.50.0.0: lists every installed path and the traffic share count.
  • show ip cef 10.50.0.0 internal: shows the hash buckets and which path each uses.
  • show ip cef exact-route 10.10.1.5 10.50.1.20: tells you the exact path a flow between these two addresses will take.

Real-world example: the slow backup

A company upgraded its data centre interconnect from one 10 Gbps link to two, expecting nightly backups to finish twice as fast. They did not change at all. The backup used a single TCP session between two servers, so the hash put it on one link every night. Splitting the backup job into eight parallel streams, each with different source ports, spread it across both links and halved the backup window.

Practice

Why does CEF use per-flow rather than per-packet load sharing by default?
Keeping each flow on one path keeps its packets in order, which TCP and voice depend on.
Why can a single large file transfer not use two equal-cost links at once?
All its packets belong to one flow, so they hash to the same path.
Which BGP command is needed to install more than one equal path?
maximum-paths under the BGP address family.

Key takeaways

  • ECMP installs several equal-cost routes and shares load across them.
  • CEF hashes each flow to one path, keeping packets in order.
  • Per-packet sharing balances perfectly but reorders packets.
  • One flow uses one link; spread large jobs across several flows.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
Mohamed Fayas
Role
Founder of FM TecHub
Credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

He writes practical, plain-English guides on networking, security and cloud.

More about the author →

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Email updates: coming soon

New notes, tools and security news from FM TecHub by email, explained simply. Free. We're not collecting email addresses yet; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesopening soon

Meanwhile, stay connected: