For the active route, when there are multiple equal-cost paths to the same destination, by default, the JUNOS software chooses in a random fashion one of the next-hop addresses to install into the forwarding table. 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 the JUNOS software 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 load balancing to spread traffic across multiple paths between routers. The behavior of the per-packet load-balancing function varies according to the version of the Internet Protocol ASIC in the router.
On routers with an Internet Processor I ASIC, when per-packet load balancing is configured, traffic between routers with multiple paths is spread in a random fashion across the available interfaces. The forwarding table balances the traffic headed to a destination, transmitting packets 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.
![]() |
Note: Per-packet load distribution uses a hashing algorithm that distributes packets over equal-cost links. The algorithm is designed to distribute packets to prevent any single link from being saturated. However, per-packet load balancing offers no guarantee of equal distribution of traffic over equal-cost links, nor does it guarantee that increasing the number of Internet flows will create a better hash distribution. |
On routers with the Internet Processor II ASIC and T-series 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. To recognize individual flows in the transit traffic, the router examines each of the following:
The router recognizes packets in which all of these parameters are identical, and it 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.
The following steps shows how to configure per-packet load balancing:
- policy-statement policy-name {
-
- from {
-
match-conditions;
- route-filter destination-prefix match-type <actions>;
- prefix-list name;
- }
-
- then {
- load-balance per-packet;
- }
- }
-
export policy-name;
![]() |
Note: You cannot apply the export policy to VRF routing instances. |
For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.
![]() |
Note: Specify all next-hops of that route, if more than one exists, when allocating a label corresponding to a route that is being advertised. |
![]() |
Note: Configure the forwarding-options hash key for MPLS to include the IP payload. |
Perform per-packet load balancing for all routes:
- [edit]
- policy-options {
-
- policy-statement load-balancing-policy {
-
- then {
- load-balance per-packet;
- }
- }
- }
- routing-options {
-
-
forwarding-table {
-
export load-balancing-policy;
- }
- }
Perform per-packet load balancing for only a limited set of routes:
- [edit]
- policy-options {
-
- policy-statement load-balancing-policy {
-
- from {
- route-filter 192.168.10/24 orlonger;
- route-filter 9.114/16 orlonger;
- }
-
- then {
- load-balance per-packet;
- }
- }
- }
- routing-options {
-
-
forwarding-table {
-
export load-balancing-policy;
- }
- }