7.4. ECMP¶
The system supports Equal-Cost Multi-Path (ECMP) forwarding for IP routes. When several next hops with the same cost are available for a destination prefix, the forwarding engine places them into an ECMP group and distributes traffic among these next hops.
Load balancing is based on a hash calculated from selected packet header fields. The hash value determines the ECMP bucket and, as a result, the specific next hop used for a given flows.
Hash-Based ECMP¶
For each VRF, you can configure which packet fields are used to compute the ECMP hash. The following hash types are available:
5-tuple– source IP address, destination IP address, L4 source port, L4 destination port and L4 protocol.src-dst-ip– source and destination IP addresses.src-ip– source IP address only.dst-ip– destination IP address only.src-ip-port– source IP address and L4 source port.dst-ip-port– destination IP address and L4 destination port.
The hash type is configured per VRF. This allows you to use different load-balancing schemes, for example, per-flow balancing in one VRF and per-destination balancing in another.
A per-VRF hash seed can also be configured. The seed changes the hash distribution without modifying the selected hash type. This is useful to reduce polarization between different VRFs that use the same set of next hops or to fine-tune traffic distribution in complex topologies.
- vrf NAME ip hash-type <5-tuple|src-dst-ip|src-ip|src-ip-port|dst-ip|dst-ip-port>¶
Configure the ECMP hash type for the specified VRF. The hash type defines which packet header fields are used to compute the ECMP hash and therefore determines how flows are distributed across the ECMP next hops.
- no vrf NAME ip hash-type <src-dst-ip|src-ip|src-ip-port|dst-ip|dst-ip-port>¶
Remove the explicit hash-type configuration for the specified VRF.
- no vrf NAME ip hash-type¶
Remove any hash-type configuration for the specified VRF.
- vrf NAME ip hash seed (0-4294967295)¶
Set the per-VRF ECMP hash seed. Changing the seed alters the hash distribution without changing the selected hash type, which can help reduce polarization or adjust traffic distribution across ECMP next hops.
Resilient ECMP¶
The platform implements resilient ECMP hashing to minimize traffic disruption when the ECMP group changes (for example, when a next hop is added or removed due to a link failure or routing update).
With standard ECMP hashing, any change in the number or order of next hops usually causes most flows to be rehashed and redistributed across all remaining next hops. Resilient ECMP reduces the amount of rebalancing: only flows that were mapped to a failed or removed next hop are reassigned, and flows that already use healthy next hops continue to use them.
Resilient ECMP operates per VRF and supports two modes that control how next hops are placed into the resilient hash structure:
normal mode – next hops are added in the input order, that is, in the order in which they are provided by the routing process for the ECMP group.
ordered mode – next hops are sorted in ascending order (for example, by address) before being added. This ensures that the same ordered set of next hops produces identical internal ordering across different VRFs, which helps maintain consistent flow distribution when the same ECMP topology is used in multiple VRFs.
Resilient hashing is enabled and configured independently for each VRF. If resilient hashing is disabled, the system uses the standard ECMP hash behavior for that VRF.
- vrf NAME ip resilient-hash enable¶
Enable resilient ECMP hashing for the specified VRF. When enabled, only flows that use a failed or removed next hop are remapped to other next hops.
- no vrf NAME ip resilient-hash enable¶
Disable resilient ECMP hashing for the specified VRF. When disabled, standard ECMP hashing is used, and changes in the ECMP group may cause flows to be redistributed across all remaining next hops.
- vrf NAME ip resilient-hash mode <normal|ordered>¶
Sets the resilient ECMP mode for the specified VRF:
normal– next hops are added to the resilient hash structure in the input order.ordered– next hops are sorted in ascending order before being added to the resilient hash structure to keep consistent next-hop ordering across VRFs that use the same ECMP topology.
- no vrf NAME ip resilient-hash mode¶
Remove the resilient ECMP mode configuration for the specified VRF, and revert to the default mode.