Load balancing can work in per-flow mode or per-packet mode, irrespective of whether it is route load balancing, tunnel load balancing, or trunk load balancing.
Per-flow load balancing classifies packets into different flows based on a certain rule, such as the IP 5-tuple (source IP address, destination IP address, protocol number, source port number, and destination port number). Packets of the same flow go over the same link.
On the network shown in Figure 1, R1 sends six packets, P1, P2, P3, P4, P5, and P6 in sequence to R2 over Link A and Link B in load balancing mode. P2, P3, and P5 are destined for R3; P1, P4, and P6 are destined for R4. If per-flow load balancing is used, packets destined for R3 can go over Link A, and packets destined for R4 can go over Link B. Alternatively, packets destined for R3 can go over Link B, and packets destined for R4 can go over Link A.
Symmetric Load Balancing
Symmetric load balancing is a special type of per-flow load balancing.
Symmetric load balancing distinguishes data flows based on the source and destination IP addresses of packets so that data of the same flow is transmitted over the member link with the same serial number on two connected devices.
As shown in Figure 2, router R1 forwards data of a bidirectional flow over link A to router R2. R2 obtains the index of link A by interchanging the source and destination IP addresses carried in the packets. The reverse traffic (traffic from R2 to R1) is hashed over the same link (link A) to R1.
Symmetric load balancing guarantees the data sequence but not the bandwidth usage.
Per-packet load-balancing means that the device sends packets in sequence alternately over the links used for load balancing, as shown in Figure 3. Load is evenly distributed over the links.
Per-packet load balancing balances traffic more equally than per-flow balancing. Load balancing rules and service flow characteristics determine whether load can be equally balanced in per-flow load balancing. In many practical cases, per-flow load-balancing can have unequal link utilization.
In per-packet load balancing, packets may arrive out of order due to the following causes:
As per-packet load balancing may cause packet disorder, it is not recommended for key services that are sensitive to packet sequence, such as voice and video services.
By default, the load balancing modes of the traffic on control plane and forwarding plane are per-flow.