Step 2: Configuring the IPv4 Address Family to Load-Balance LSP Traffic
Purpose
If the outbound traffic across equal-cost next hops is not well balanced after you have load balancing configured, you can use the IPv4 address family (INET) to provide additional information to identify traffic flows and balance traffic more evenly. You configure the INET or port data on an ingress router. Configuring port data is useful if you are using TCP or UDP. However, it may not be useful to include port data when you are using protocols that are not associated with a Layer 4 port, for example, Layer 2 VPNs, generic routing encapsulation (GRE) tunneling, or Internet Control Message Protocol (ICMP).
To configure port data, you include the
layer-3orlayer-4options under thefamily-inetstatement at the[edit forwarding-options hash-key]hierarchy level. When you include thelayer-4option, you must also include thelayer-3statement. If you omit thelayer-3statement, the management process removes thehash-keystatement from the configuration and the router works as if you specifiedlayer-3.If you specify only the
layer-3statement in the configuration, the router uses the incoming interface index as well as the following Layer 3 information in the packet header to load-balance:If you include both the
layer-3andlayer-4statements, 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
The router recognizes packets in which all of these Layer 3 and Layer 4 parameters are identical, and ensures that these packets are sent out through the same interface. This prevents problems that might otherwise occur with packets arriving at their destination out of their original sequence.
Before you use port data to send packets through the same interface, you must have the
load-balance per-packetstatement configured at the[edit policy-options]hierarchy level and that policy applied as an export policy at the[edit forwarding-options]hierarchy level. For more information about configuring load balancing, see Configuring and Verifying Load Balancing.Action
To configure the hash key with port data, follow these steps:
- Ensure that you have load balancing configured, see Configuring and Verifying Load Balancing.
- In configuration mode, go to the following hierarchy level:
[edit]user@host#edit forwarding-options hash-key- Include Layer 3 (IP) data in the hash key:
[edit forwarding-options hash-key]user@host#set family inet layer-3- Include Layer 4 TCP or UDP data in the hash key:
[edit forwarding-options hash-key]user@host#set family inet layer-4- Verify and commit the configuration:
user@host#showuser@host#commitSample Output
user@R6>editEntering configuration mode[edit]user@R1#edit forwarding-options hash-key[edit forwarding-options hash-key]user@R1#set family inet layer-3[edit forwarding-options hash-key]user@R1#set family inet layer-4[edit forwarding-options hash-key]user@R1#showfamily inet {layer-3;layer-4;}[edit forwarding-options hash-key]user@R1#commitcommit completeWhat It Means
The sample output shows both the
layer-3andlayer-4options included in the hash key. Including both options provides additional information to identify traffic flows and balance traffic more evenly.