Glossary

ECMP

Equal-Cost Multi-Path

What is ECMP

ECMP (Equal-Cost Multi-Path) is a routing technique for improving both network performance and reliability by spreading traffic across multiple links or ports of equal cost, instead of sending it all down a single path. Rather than one link carrying all the traffic while others sit idle, ECMP distributes flows using a hashing algorithm, avoiding congestion on any single link and making full use of the bandwidth a network actually has available.

ECMP also delivers built-in redundancy: if one of the equal-cost paths fails, the switch automatically shifts traffic onto the remaining paths, without requiring any manual intervention or waiting for a slower routing reconvergence. This combination — better bandwidth utilization plus automatic failover — is what makes ECMP a standard building block in server-cluster access networks and core/aggregation-layer interconnects, where multiple parallel paths between devices are the norm rather than the exception.

How ECMP Works

ECMP's core mechanism is a hash function applied to specific fields in each packet, which deterministically maps every flow to one of the available equal-cost paths. Because the same flow always hashes to the same path, packets within a flow arrive in order, while different flows spread out across the available links — the property that makes ECMP a form of load sharing rather than simple round-robin distribution.

What fields go into that hash depends on the traffic type. For IPv4 traffic, the hash typically draws on VLAN ID, IP protocol, source and destination IP, and source and destination Layer 4 ports. For IPv6 traffic, it draws on VLAN ID, source and destination IPv6 address, source and destination Layer 4 ports, ingress port, next header, and flow label. For non-IP traffic, where none of those Layer 3/4 fields exist, the hash falls back to source and destination MAC address, ethertype, and VLAN ID. In every case, combining several fields rather than just one (like destination IP alone) is what spreads traffic evenly even when many flows share the same source or destination.

Because the hash is deterministic, a genuinely static traffic pattern could, in principle, always land on the same subset of paths — under-using others even though they're equally valid. Hash enhancement addresses this by periodically and randomly varying the hash seed (roughly every millisecond), so that over time, traffic distribution smooths out across all the equal-cost paths available, rather than being locked into whatever the static hash happened to produce for a given traffic mix.

Why ECMP is Beneficial

  • Uses available bandwidth fully: Instead of one path carrying everything while parallel links sit idle, ECMP actively spreads traffic across every equal-cost path, extracting real throughput from redundant links that would otherwise be wasted capacity.

  • Automatic failover without waiting: When one path fails, traffic shifts to the remaining equal-cost paths immediately, giving ECMP a redundancy benefit on top of its load-sharing benefit.

  • Keeps flows in order: Because the same flow consistently hashes to the same path, ECMP achieves load distribution without introducing the packet reordering that naive per-packet load balancing would cause.

  • Adapts to different traffic types: Separate hash keys for IPv4, IPv6, and non-IP traffic mean the fields used for load distribution actually make sense for the traffic being hashed, rather than applying one generic scheme to everything.

  • Avoids static hash imbalance: Hash enhancement's periodic reseeding prevents a network from getting stuck with a lopsided traffic pattern simply because a static hash function happened to favor certain paths for certain flows.

At Asteraix

What We Can Do at Asteraix

AsterNOS implements ECMP as a configurable, traffic-aware load-sharing engine, tunable directly from the CLI to match how a network's traffic actually looks.

  • Traffic-type-specific hash keys: hash mode {ipv4|ipv6|non-ip} <hash_key> lets operators define exactly which fields feed the hash for each traffic type — including the sensible defaults AsterNOS ships with (VLAN ID, IP protocol, and source/destination IP and L4 port for IPv4; the IPv6 equivalent plus ingress port, next header, and flow label for IPv6; and MAC/ethertype/VLAN for non-IP traffic).

  • Configurable hash seed: A default hash seed of 10 gives ECMP's distribution a consistent starting point, while remaining fully adjustable for networks that need a specific, reproducible hash behavior.

  • Built-in hash enhancement: hash enhancement enables millisecond-interval random seed variation directly from global configuration, giving operators a one-command way to smooth out traffic distribution across multiple equal-cost paths without redesigning their hash key selection.

  • Fits directly into common data center topologies: ECMP's combination of load sharing and automatic failover is exactly the mechanism that makes leaf-spine and other multi-path data center fabrics work — AsterNOS's implementation is built to support server-cluster access and core/aggregation-layer interconnects where multiple equal-cost paths are the default topology, not the exception.

  • Works alongside other traffic-engineering tools: ECMP configuration in AsterNOS complements link aggregation and policy-based routing, giving network operators multiple, composable tools for shaping how traffic actually moves across the fabric.