Add `hierarchical-fec` bool leaf to Static NHG
A hierarchical forwarding equivalence class (FEC) is a system for organizing and classifying IP packets into groups that can be forwarded identically through a network, typically using a tiered or hierarchical structure to handle different levels of traffic priority or type. This allows for more complex and granular control over network traffic, especially for quality of service (QoS) and differentiated services, by creating multiple layers of FECs, where an outer layer might classify a broad category of traffic and an inner layer can further subdivide it.
We want to introduce a new boolean leaf to control hierarchical forwarding equivalence class (FEC) behavior on next-hop groups:
-
/network-instances/network-instance/static/next-hop-groups/next-hop-group/config/hierarchical-fec -
/network-instances/network-instance/static/next-hop-groups/next-hop-group/state/hierarchical-fec
When True: The Next-Hop Group (NHG) preserves its hierarchical structure, explicitly pointing to the resolving NHG for each next-hop.
When False: The NHG contents are flattened, or a single random next-hop is selected.
This provides operators with fine-grained control over the hierarchical FEC structure, facilitating advanced Traffic Engineering and QoS strategies.
Reference: Arista documentation (copying over from TOI link): ECMP and UCMP for nexthopgroups feature resolves each nexthopgroup entry through all paths of a route by using hierarchical FEC. Hierarchical FEC enables load-balancing of traffic forwarded through each nexthopgroup entry based on link bandwidth. It is supported from EOS 4.21.0F onwards. Prior to this feature (or with the feature being disabled), each nexthopgroup entry was resolved through a single path randomly selected from the resolving route of that entry.
This feature is supported by all nexthopgroup types : ip, gre, mplsOverGre and mpls. The feature can be enabled per nexthopgroup.
Configuring NHGs to use hierarchical fecs :
nexthop-group n1 type mpls
fec hierarchical
entry 0 push label-stack 100 200 300 nexthop 10.2.1.3
The ‘fec hierarchical’ command enables the nexthop group to use hierarchical fecs.
ip route 11.12.13.0/24 Nexthop-Group n1
show nexthop-group n1
n1
Id 2
Type mpls
Size 1 (auto size enabled, programmed size 1)
Counters shared
Hierarchical FECs enabled
Entries (left most label is the top of the stack)
0 push label-stack 100 200 300 nexthop 10.2.1.3
Tunnel destination is using second level FEC 4294967316 (platform FEC 1152921508901814292), resolved through 10.2.0.0/20 Nexthopgroup n1 is resolved through 10.2.0.0/20. This address is recursively resolved through the following ECMP or UCMP route components:
show ip route 10.2.0.0/20
S 10.2.0.0/20 [1/0] via 1.1.1.1, Ethernet23/1
via 2.2.2.2, Ethernet23/3
show platform fap ip nexthop-group
n1
Type: MPLS
Ecmp Fec Id: -
------------------------------------------------------------------------------------------------------> -------------
|Pos| Label Action | FEC |Next FEC |OLIF |Cmd | Intf |VID | MAC / CPU Code |
------------------------------------------------------------------------------------------------------> -------------
|0 |Push 100 200 300 |49152|2 |16382|MPLS|- |- |- |
The next level fec (49152) can be used to read the corresponding interface , vlan id , mac:
show platform fap fec 49152
Tunnel Type: Mpop(mpls pop), Mpush(mpls push), Mswap(mpls swap),
MoG(mpls-over-gre), T(IPv4 tunnels GRE/VXLAN)
D - ECMP is divergent across switching chips
-----------------------------------------------------------------------------------
| FEC Entry |
|-----------------------------------------------------------------------------------
| | | | | | | |
| ECMP| FEC | | | | | | Tunnel
|Index| Index| Cmd | Destination | VID |Outlif | MAC / CPU Code |T Value
----------------------------------------------------------------------------------
| - |49152 |ROUTE| FEC 2 |0 | - | 00:00:00:00:00:00 |Mpush 100 200 300
|2 | D |ROUTE| Et23/1 |1006 |0 | 00:0a:00:0b:00:0c | -
|2 | D |ROUTE| Et23/3 |1007 |0 | 00:0c:00:0d:00:0e | -
Section Configuring IP-over-IP Hierarchical FEC
https://www.arista.com/en/um-eos/eos-ipv4#xx1165975