Configuring Dynamic Load Balancing
Overview
Traditional static load balancing does not consider the utilization of each member link within the load-balancing group, leading to uneven load distribution among the member links. This issue becomes more pronounced with the appearance of large data flows, exacerbating congestion on the selected member link and potentially causing packet loss.
By enabling dynamic load balancing, the traffic of Equal-Cost Multi-Path (ECMP) routing can be distributed across different member links through dynamic load balancing, maximizing load balancing among the member links.
Implementation Principle
PICOS supports three modes of Dynamic load balancing: Normal Mode, Optimal Mode and Assigned Mode.
Normal Mode
There is link transmission delay between two directly connected devices. If the time interval between two data packets to be sent is greater than the maximum link transmission delay of the member links in the load-balancing group, these two packets can be forwarded using different member links without causing out-of-order delivery at the receiving end. Normal mode dynamic load balancing is based on this principle.
In Normal mode, the device determines the time interval between the packet to be forwarded and the previous packet in its flow. If the interval is greater than the maximum link transmission delay of the member links, the packet to be forwarded is considered the first packet of a new flowset. If the interval is less than the maximum link transmission delay, the packet is considered part of the same flowset as the previous packet.
The device forwards the packets based on the flowset, selecting the member link with the lighter load for forwarding. Packets within the same flowset are forwarded using the same member link.
Optimal Mode
The Optimal mode of dynamic load balancing operates on a per-packet distribution system, where each packet is forwarded independently based on the real-time load conditions of the available links. This mechanism allows the device to select the least congested or lightly loaded link at any given moment, distributing the packets dynamically to optimize network performance. However, this method introduces a potential issue when packets belonging to the same flow are forwarded through different links. If the time interval between two consecutively sent packets is shorter than the maximum transmission delay across the links, the packets may arrive out of order at the receiving end. This happens because different links may have varying transmission delays, causing later-sent packets to arrive before earlier ones.
For this reason, Optimal mode can lead to out-of-order packet delivery, particularly in scenarios where flows are split across multiple paths. Out-of-order packets can disrupt certain types of network traffic, especially those that rely on sequence consistency, such as real-time voice or video communication. To mitigate this, it is crucial that the receiving device or terminal has the capability to reorder packets properly. Devices must be equipped with reassembly buffers or out-of-order packet handling mechanisms to ensure the integrity of the flow, allowing the receiving system to reorder the packets correctly before processing them. Optimal mode, while improving load distribution and avoiding bottlenecks, requires robust support on the receiving end to handle these potential sequencing issues effectively.
Assigned Mode
In Assigned mode dynamic load balancing, the system ensures that each packet within a specific flow follows a consistent path by using the same forwarding link as the previous packet in that flow. This approach minimizes the risk of out-of-order packet delivery by keeping the traffic for the flow on the same route. However, when a flow starts and the first packet is sent, the system cannot rely on a previous packet’s path. In this case, a static load balancing mechanism comes into play, where a hash-based algorithm determines the member link to forward the packet. The hash function typically considers factors such as source and destination IP addresses or port numbers to ensure an even distribution of traffic across the available links while maintaining flow consistency. Once the path is set for the first packet, subsequent packets in the same flow will continue to follow that route until the flow is completed.
Restrictions and Guidelines
When you configure Dynamic Load Balancing, follow these restrictions and guidelines:
Dynamic Load Balancing for ECMP is only supported on Trident3 and Tomahawk3 platforms.
When the ECMP hash-mapping mode configuration (set/delete) changes, a system restart is required for the configuration to take effect.
ECMP hash-mapping modes (round-robin-load-balancing, randomized-load-balancing, symmetric, dlb-optimal, dlb-assigned and dlb-normal) are mutually exclusive. To switch between modes, you must first delete the configured mode before setting up the new one. Then, restart the system for the configuration to take effect.
Configuring Dynamic Load Balancing
Procedure
Step 1 Enable one of the three modes of Dynamic load balancing for ECMP: Normal mode, Optimal mode and Assigned mode.
set interface ecmp hash-mapping dlb-normal [flowset-time <flowset-time>]
set interface ecmp hash-mapping dlb-optimal
set interface ecmp hash-mapping dlb-assigned
By default, Dynamic Load Balancing for ECMP is disabled.
Step 2 Commit the configuration.
commit
Step 3 Under CLI operational mode (prompted with “>“), run the following command to restart the system for the configuration to take effect.
request system reboot
Configuration Example
The following commands enable normal mode of Dynamic Load Balancing for ECMP.
admin@PICOS# set interface ecmp hash-mapping dlb-normal
admin@PICOS# commit
admin@PICOS# exit
admin@PICOS> request system reboot
The following commands change Dynamic Load Balancing normal mode to optimal mode for ECMP.
admin@PICOS# delete interface ecmp hash-mapping dlb-normal
admin@PICOS# commit
admin@PICOS# set interface ecmp hash-mapping dlb-optimal
admin@PICOS# commit
admin@PICOS# exit
admin@PICOS> request system reboot
Verify the Configuration
Use the command run show route ipv4 to view the ECMP routes. In the following show result, we can see that the destination address 10.20.51.0/24 is reached via three different next hops: 192.168.0.1, 192.168.1.1, and 192.168.2.1, forming ECMP routes.
admin@PICOS# run show route ipv4
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, T - Table, D - SHARP,
F - PBR,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
K * 0.0.0.0/0 [255/8192] unreachable (blackhole), 23:42:36
K>* 0.0.0.0/0 [0/2] via 10.10.51.1, eth0, 23:42:36
C>* 10.10.51.0/24 is directly connected, eth0, 23:42:36
S>* 10.20.51.0/24 [1/0] via 192.168.0.1, vlan10, weight 1, 00:09:06
* via 192.168.1.1, vlan20, weight 1, 00:09:06
* via 192.168.2.1, vlan30, weight 1, 00:09:06
C>* 192.168.0.0/24 is directly connected, vlan10, 00:09:09
C>* 192.168.1.0/24 is directly connected, vlan20, 00:09:09
C>* 192.168.2.0/24 is directly connected, vlan30, 00:09:09
Use the command run show interface gigabit-ethernet <interface-name> to view the traffic distribution for each interface. Here is an example:
Copyright © 2024 Pica8 Inc. All Rights Reserved.