flex-hashing
Syntax
flex-hashing name {
ethtype {
inet {
conditional-match conditional-match;
hash-offset {
offset1 {
base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset1-mask offset1-mask;
offset1-value offset1-value;
offset2 {
base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset2-mask offset2-mask;
offset2-value offset2-value;
}
}
}
interface interface;
}
inet6 {
conditional-match conditional-match;
hash-offset {
offset1 {
base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset1-mask offset1-mask;
offset1-value offset1-value;
offset2 {
base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset2-mask offset2-mask;
offset2-value offset2-value;
}
}
}
interface interface;
}
mpls {
conditional-match conditional-match;
hash-offset {
offset1 {
base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset1-mask offset1-mask;
offset1-value offset1-value;
offset2 {
base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header);
offset2-mask offset2-mask;
offset2-value offset2-value;
}
}
}
interface interface;
num-labels num-labels;
}
}
}
Hierarchy Level
[edit forwarding-options enhanced-hash-key]
Description
Configure user-defined flex hashing to load-balance MPLS traffic based on TCP or UDP
source/destination port information. User-defined flex hashing, which supports
protocol versions IPv4 and IPv6, enables you to set byte offsets in packet headers
to influence hashing computation. Specify two offsets, each 2 bytes in length, from
the first 128 bytes of a packet. Configure the selected bytes to be directly used
for hashing or to be used only when the data pattern in these bytes matches specific
values (conditional match). To provide load balancing in spine layers, configure
flex hashing and encapsulate the traffic in VXLAN, thus enabling entropy at UDP
source ports. At de-encapsulation, configure the no-inner-payload
statement to load-balance based on the outer UDP header.
Limitations:
-
Use a maximum of two MPLS labels.
-
Use only even values for offset1 and offset2.
-
If you are using conditional matches, configure the conditions before you attach them to the flex-hashing entry.
-
An aggregated Ethernet (ae) or LAG interface is not supported as an input interface. You can configure input interfaces on LAGs by configuring the same user-defined flex-hashing data and the same conditional-match data on all member interfaces of a LAG interface.
Required Privilege Level
Interface
Release Information
Statement introduced in Junos OS Release 20.4R1.