Technical Documentation

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-3 or layer-4 options under the family-inet statement at the [edit forwarding-options hash-key] hierarchy level. When you include the layer-4 option, you must also 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 works as if you specified layer-3.

If you specify only the layer-3 statement 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:

  • Source IP address
  • Destination IP address
  • Protocol

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

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-packet statement 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:

  1. Ensure that you have load balancing configured, see Configuring and Verifying Load Balancing.
  2. In configuration mode, go to the following hierarchy level:
    [edit]user@host# edit forwarding-options hash-key
  3. Include Layer 3 (IP) data in the hash key:
    [edit forwarding-options hash-key]user@host# set family inet layer-3
  4. Include Layer 4 TCP or UDP data in the hash key:
    [edit forwarding-options hash-key]user@host# set family inet layer-4
  5. Verify and commit the configuration:
    user@host# showuser@host# commit

Sample Output


user@R6> edit
Entering 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# show
family inet {
    layer-3;
    layer-4;
}

[edit forwarding-options hash-key]
user@R1# commit  
commit complete

Meaning

The sample output shows both the layer-3 and layer-4 options included in the hash key. Including both options provides additional information to identify traffic flows and balance traffic more evenly.


Published: 2010-01-30