[Contents] [Prev] [Next] [Index] [Report an Error]

Configuring the Load-Balance Per-Packet Action

By default, when there are multiple equal-cost paths to the same destination for the active route, the JUNOS software uses a hash algorithm to choose one of the next-hop addresses to install in the forwarding table. Whenever the set of next hops for a destination changes in any way, the next-hop address is rechosen using the hash algorithm.

You can configure the JUNOS software so that, for the active route, all next-hop addresses for a destination are installed in the forwarding table. This feature is called per-packet load balancing. You can use load balancing to spread traffic across multiple paths between routers. The behavior of the load-balance per-packet function depends on the version of the Internet Processor application-specific integrated circuit (ASIC) in your routing platform.

On routing platforms with an Internet Processor ASIC, when per-packet load balancing is configured, traffic between routers with multiple paths is spread using the hash algorithm across the available interfaces. The forwarding table balances the traffic headed to a destination, transmitting it in round-robin fashion among the multiple next hops (up to a maximum of eight equal-cost load-balanced paths). The traffic is load-balanced on a per-packet basis.

On routing platforms with the Internet Processor II ASIC, when per-packet load balancing is configured, traffic between routers with multiple paths is divided into individual traffic flows (up to a maximum of 16 equal-cost load-balanced paths). Packets for each individual flow are kept on a single interface.

Note: You can configure per-packet load balancing to optimize VPLS traffic flows across multiple paths.

To configure the load-balance per-packet action, include the load-balance per-packet action in a then statement or a route-filter option in a from statement in a routing policy.

You must apply the routing policy to routes exported from the routing table to the forwarding table to complete the configuration. To do this, include the export statement:

export [ policy-names ];

You can include this statement at the following hierarchy levels:

By default, the software ignores port data when determining flows. To enable per-flow load balancing, you must set the load-balance per-packet action in the routing policy configuration; for more information about this action, see Routing Policy Configuration.

To include port data in the flow determination, include the family inet statement at the [edit forwarding-options hash-key] hierarchy level:

[edit forwarding-options hash-key]
family inet {
layer-3;
layer-4;
}

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.

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:

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.

This is appropriate behavior for Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) packets. For Internet Control Message Protocol (ICMP) packets, the field location offset is the checksum field, which makes each ping packet a separate “flow.” There are other protocols that can be encapsulated in IP that may have a varying value in the 32-bit offset. This may also be problematic because these protocols are seen as a separate flow.

By default, or if you specify only the layer-3 statement, the router uses the incoming interface index as well as the following Layer 3 information in the packet header to load balance traffic:

By default, Internet Protocol version 6 (IPv6) packets are automatically load-balanced based on the following Layer 3 and Layer 4 information:

For more information about load balancing, see the following sections:


[Contents] [Prev] [Next] [Index] [Report an Error]