Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring Per-Packet Load Balancing

    By default, when there are multiple equal-cost paths to the same destination for the active route, Junos OS chooses one of the next-hop addresses to install into the forwarding table in a random fashion. Whenever the set of next hops for a destination changes in any way, the next-hop address is chosen again, also in a random fashion.

    You can configure Junos OS so that, for the active route, all next-hop addresses for a destination are installed in the forwarding table. This is called per-packet load balancing. You can use this feature to spread traffic across multiple paths.

    On a QFX3500 standalone switch, with static routing configured, whenever a route pointing to an ECMP next-hop changes to a new ECMP next-hop with a different member list but contains the exact member count as before, the location of the retained members in the new member list is the same as in the old member list.

    For example, if you have the following configuration on the switch:

    set routing-options static route 0.0.0.0/0 next-hop 192.0.2.2set routing-options static route 0.0.0.0/0 next-hop 192.0.2.3set routing-options static route 0.0.0.0/0 next-hop 192.0.2.4set routing-options static route 0.0.0.0/0 next-hop 198.51.100.2set routing-options static route 0.0.0.0/0 next-hop 198.51.100.3set routing-options static route 0.0.0.0/0 next-hop 198.51.100.4set routing-options static route 0.0.0.0/0 next-hop 203.0.113.1set routing-options static route 0.0.0.0/0 next-hop 203.0.113.2

    and want to change the first and eighth route to point to another location, you can issue the following commands:

    delete routing-options static route 0.0.0.0/0 next-hop 192.0.2.3delete routing-options static route 0.0.0.0/0 next-hop 203.0.113.2set routing-options static route 0.0.0.0/0 next-hop 192.0.2.5set routing-options static route 0.0.0.0/0 next-hop 203.0.113.3

    This configuration does not affect the second next-hop through the seventh next-hop.

    When per-packet load balancing is configured, traffic is divided into individual flows (up to a maximum of 16). Packets for an individual flow are sent out a single interface. To determine flows, the switch examines each of the following packet fields:

    • Source IP address
    • Destination IP address
    • Protocol
    • Source port number
    • Destination port number
    • Source interface index
    • Type of service (ToS)

    The switch recognizes packets in which all of these 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.

    Note: Load balancing is not supported on management interfaces.

    The following steps shows how to configure per-packet load balancing:

    1. Define a load-balancing routing policy by including one or more policy-statement statements at the [edit policy-options] hierarchy level, defining an action of load-balance per-packet:
      policy-statement policy-name {from {match-conditions;route-filter destination-prefix match-type <actions>;prefix-list name;}then {load-balance per-packet;}}
    2. Apply the policy to routes exported from the routing table to the forwarding table. To do this, include the forwarding-table and export statements:
      forwarding-table {export policy-name;}

    When you enable per-packet load balancing on a QFabric system, packets might be switched across the fabric even though there is a local port with a same-cost route to the destination. For example, if per-packet load balancing is enabled and a packet arrives at network Node device A, it might be switched to network Node device B and forwarded from there even if there is a same-cost route through a port on Node device A to the destination. In this case, traffic transits the fabric needlessly. you can configure a QFabric system to choose a locally switched route if one is available. To enable this feature, include the ecmp-do-local-lookup statement at the [edit forwarding-options] hierarchy level.

    Modified: 2016-06-21