Related Documentation
- M, PTX, T Series
- Configuring Per-Packet Load Balancing
- Configuring Load Balancing Based on MAC Addresses
- M, MX, PTX, T Series
- Configuring Load Balancing Based on MPLS Labels
hash-key
Syntax
Hierarchy Level
Release Information
Statement introduced before Junos OS Release 7.4.
family multiservice and no-label-1-exp options introduced in Junos OS Release 8.0.
label-3 and no-labels options introduced in Junos OS Release 8.1.
ether-pseudowire statement introduced in Junos OS Release 9.1 (M320 and T Series routers only); support extended to M120 and MX Series routers in Junos OS Release 9.4.
ip, label-1, label-2, layer-3-only, and payload options for the family multiservice statement introduced in Junos OS Release 9.4. (M120 and M320 routers only); support for ip and payload statements only to MX Series routers.
layer-3, source-address-only, destination-address-only, and layer-4 statements introduced for the family multiservice statement in Junos OS Release 9.5. (MX Series routers only)
Description
Select which packet header data to use for per-flow load balancing.
The options are explained separately.
![]() | Note: To modify the default hashing mechanism on Modular Port Concentrators (MPCs), you need to configure the statements at the [edit forwarding-options enhanced-hash-key] hierarchy level. Statements at the [edit forwarding-options hash-key] hierarchy level do not support MPCs. |
Options
family inet—Incorporate port data into the hash key for flow determination. By default, port data is ignored when determining flows.
layer-3—Include Layer 3 data into the hash key. You must include the layer-3 statement. If you omit the layer-3 statement, the management process removes the hash-key statement from the configuration and the router behaves as if you specified layer-3.
By default, or if you specify only the layer-3 statement, the router uses the following Layer 3 information in the packet header for per-flow load balancing:
- Source IP address
- Destination IP address
- Protocol
layer-4—Include Layer 4 data into the hash key.
If you include both the layer-3 and layer-4 statements, the router uses the following Layer 3 and Layer 4 information to load-balance:
- Source IP address
- Destination IP address
- Protocol
- Source port number
- Destination port number
- Incoming interface index
family mpls—(aggregated Ethernet interfaces, aggregated SONET/SDH interfaces, and multiple equal-cost MPLS next hops only) Incorporate multiprotocol label switching (MPLS) label and payload information into the hash key for per-flow load balancing. Only the IPv4 protocol is supported.
label-1—Include the first MPLS label into the hash key. This is used for a one-label packet for per-flow load balancing IPv4 VPLS traffic based on IP information and MPLS labels.
label-2—Include the second MPLS label into the hash key. This is used for a two-label packet for per-flow load balancing IPv4 VPLS traffic based on IP information and MPLS labels. To use the second MPLS label in the hash key, include both the label-1 and label-2 statements at the [edit forwarding-options hash-key family mpls] hierarchy level. By default, the router provides hashing on the first and second labels. If both labels are specified, the entire first label and the first 16 bits of the second label are hashed.
label-3—Include the third MPLS label into the hash key. To use the third MPLS label, include the label-1, label-2, and label-3 statements at the [edit forwarding-options hash-key family mpls] hierarchy level.
no-labels—Include no MPLS labels into the hash key.
no-label-1-exp—The EXP bit of the first label is not used in the hash calculation to avoid reordering complication.
payload—Incorporate payload data into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
ether-pseudowire—(M120, M320, MX Series, and T Series routers)—Load-balance IPv4 traffic over Layer 2 Ethernet pseudowires.
ip—Include the IP address of the IPv4 or IPv6 payload into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
layer-3-only—Include only Layer 3 IP information from the IP payload data into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
port-data—Include the source and destination port field information into the hash key. By default, the most significant byte and least significant byte of the source and destination port fields are hashed. To select specific bytes to be hashed, include one or more of the source-msb, source-lsb, destination-msb, and destination-lsb options at the [edit forwarding-options hash-key family mpls payload ip port-data] hierarchy level. To prevent all four bytes from being hashed, include the layer-3-only statement at the [edit forwarding-options hash-key family mpls payload ip] hierarchy level.
destination-lsb—Include the least-significant byte of the destination port.
destination-msb—Include the most-significant byte of the destination port.
source-lsb—Include the least-significant byte of the source port.
source-msb—Include the most-significant byte of the source port.
family multiservice—(M Series, MX Series, and T Series Routers only) Include Layer 2 media access control (MAC) information into the hash key for per-flow load balancing only Layer 2 information.
family multiservice—(M120 and M320 Routers only) Include IP information and MPLS labels into the hash key for per-flow load balancing VPLS traffic. For IPv4 traffic, only the IP source and destination addresses are included in the hash key. For MPLS and IPv4 traffic, one or two MPLS labels and IPv4 source and destination addresses are included. For MPLS Ethernet psuedowires, only one or two MPLS labels are included in the hash key.
destination-mac—Include the destination MAC address into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
source-address-only—Include only the Layer 3 IP source address into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
destination-address-only—Include only the Layer 3 IP destination address into the hash key for per-flow load balancing Layer 2 information based on MPLS labels.
source-mac—Include the source-address MAC information into the hash key.
Required Privilege Level
interface—To view this statement in the configuration.
interface-control—To add this statement to the configuration.
Related Documentation
- M, PTX, T Series
- Configuring Per-Packet Load Balancing
- Configuring Load Balancing Based on MAC Addresses
- M, MX, PTX, T Series
- Configuring Load Balancing Based on MPLS Labels
Published: 2012-06-13
Related Documentation
- M, PTX, T Series
- Configuring Per-Packet Load Balancing
- Configuring Load Balancing Based on MAC Addresses
- M, MX, PTX, T Series
- Configuring Load Balancing Based on MPLS Labels