Load sharing method of switch link aggregation
1. Definition:
When using Eth-Trunk to forward data, since there are multiple physical links between the devices at both ends of the aggregation group, it may happen that the first data frame of the same data flow is transmitted on one physical link, while the second data frame Transmission on another physical link. In this way, the second data frame of the same data flow may arrive at the peer device before the first data frame, causing the received data packets to be out of order.
In order to avoid this situation, Eth-Trunk uses a flow-by-flow load balancing mechanism to generate a HASH-KEY value from the address in the data frame through a HASH algorithm, and then searches for the corresponding outbound interface in the Eth-Trunk forwarding table based on this value. , the HASH-KEY values obtained by HASH of different MAC or IP addresses are different, so the outgoing interfaces are also different. This not only ensures that the frames of the same data flow are forwarded on the same physical link, but also realizes that the traffic can be forwarded in each aggregation group. Load sharing on physical links. Per-flow load balancing can ensure the order of packets, but cannot guarantee bandwidth utilization.
2. Forwarding principle:
Eth-Trunk is located between the MAC and LLC sublayers and belongs to the data link layer.
The Eth-Trunk module maintains a forwarding table internally. This table consists of the following two items.
1) HASH-KEY value: The HASH-KEY value is calculated by the HASH algorithm based on the MAC address or IP address of the data packet.
2) Interface number: The distribution of Eth-Trunk forwarding table entries is related to the number of member interfaces supported by each Eth-Trunk of the device. Different HASH-KEY values correspond to different outbound interfaces.
The distribution of Eth-Trunk forwarding table entries is related to the number of member interfaces supported by each Eth-Trunk of the device. Different HASH-KEY values correspond to different outbound interfaces.
The process of forwarding data frames by the Eth-Trunk module according to the forwarding table is as follows:
[1] After receiving a data frame from the MAC sublayer, the Eth-Trunk module extracts the source MAC address/IP address or destination MAC address/IP address of the data frame according to the load sharing method.
【2】Calculate according to the HASH algorithm to obtain the HASH-KEY value.
【3】The Eth-Trunk module searches the corresponding interface in the forwarding table based on the HASH-KEY value and sends the data frame out of the interface.
3. Load sharing method:
Users can set different load sharing methods according to the traffic model. The more frequently a certain parameter in the traffic changes, the more balanced the traffic selected in the corresponding load sharing method will be. For example, in a network, if the IP addresses of packets change frequently, then choosing a load sharing mode based on the destination IP address, source IP address, or source IP and destination IP address is more conducive to reasonable traffic load among each physical link. Balancing; if the MAC addresses of packets change frequently and the IP addresses are relatively fixed, then choosing a load balancing mode based on the destination MAC address, the source MAC address, or the source MAC and destination MAC addresses is more conducive to the reasonable distribution of traffic between physical links. Load sharing.
The switch can perform load balancing based on the following parameters of the packet:
Source MAC address
Destination MAC address
Source MAC address and destination MAC address
Source IP address
Destination IP address
Source IP address and destination IP address
VLAN, physical source port, etc. (enhanced load balancing for L2, IPv4, IPv6 and MPLS packets)
For example, the source IP address of a TCP packet flow from DeviceA is 192.168.1.1 (MAC address: a-a-a, source port number: 50), and the destination IP address is 172.16.1.1 (MAC address: b-b-b, destination port number: 2000). The source IP address of another TCP packet flow is 192.168.1.1 (MAC address: a-a-a, source port number: 60), and the destination IP address is 10.1.1.1 (MAC address: c-c-c, destination port number: 2000). If load balancing is configured based on the source MAC address of the message on DeviceA, there will be only one outgoing interface for the message; if load balancing is configured based on the destination IP address of the message on DeviceA, there will be two outgoing interfaces for the message. , packets destined for different destination IPs will be forwarded from different outgoing interfaces.
When configuring load balancing, please note:
The load balancing mode only takes effect on the outgoing interface of the traffic. If you find that the traffic on each incoming interface is unbalanced, please modify the load sharing mode of the uplink outgoing interface.
The load balancing mode only takes effect on the outgoing interface of the traffic. If you find that the traffic on each incoming interface is unbalanced, please modify the load sharing mode of the uplink outgoing interface.
For example, if a data packet has only one destination MAC and IP address, you should choose to perform load balancing based on the source MAC and IP address of the packet. If you choose to perform load balancing based on the destination MAC and IP address of the packet, the traffic will only be Transmission on one link causes traffic congestion.
If uneven load sharing traffic occurs after the configuration is completed, please see the following.
4. Configure load balancing for link aggregation:
There are two link aggregation and sharing modes: normal load sharing mode and enhanced load sharing mode. Please choose one of the methods to configure according to your needs.
Configure normal load sharing mode:
【1】Execute the command system-view to enter the system view.
【2】Execute the command interface eth-trunktrunk-id to enter the Eth-Trunk interface view.
【3】Execute the command load-balance { dst-ip | dst-mac | src-ip | src-mac | src-dst-ip | src-dst-mac } to configure the Eth-Trunk load balancing mode.
By default, the load balancing mode of the Eth-Trunk interface is src-dst-ip.
The following example shows how to configure load balancing based on the source MAC address and destination MAC address on interface Eth-Trunk1, and check whether the configuration is successful.
<HUAWEI> system-view
[HUAWEI] interface eth-trunk 1
[HUAWEI-Eth-Trunk1] load-balance src-dst-mac
[HUAWEI-Eth-Trunk1] quit
[HUAWEI] display eth-trunk 1 load-balance
Eth-Trunk1's load-balance information:
Load-balance Configuration: SA-XOR-DA
Load-balance options used per-protocol:
L2: Source XOR Destination MAC address, Vlan ID, Ethertype, Ingress-port
IPv4: Source XOR Destination MAC address, Vlan ID, Ethertype, Ingress-port
IPv6: Source XOR Destination MAC address, Vlan ID, Ethertype, Ingress-port
MPLS: Source XOR Destination MAC address, Vlan ID, Ethertype, Ingress-port
It can be seen from the above information that the "Load-balance Configuration" field displays "SA-XOR-DA", indicating that the load balancing method of interface Eth-Trunk1 is based on the source MAC address and destination MAC address.
Configure enhanced load sharing mode:
【1】Execute the command system-view to enter the system view.
【2】Execute the command load-balance-profile profile-name to create a load balancing template and enter the template view. The device globally shares a load sharing template.
[3] For L2, IPv4, IPv6, and MPLS packets, you can configure the load sharing mode respectively. You can select none, select one or more of the following steps. Please select according to the actual situation of forwarding packets on the network.
Run the command l2 field [ dmac | l2-protocol | smac | sport | vlan ] * to configure the load sharing mode of Layer 2 packets in the specified load balancing template. By default, the load balancing mode of Layer 2 packets is smac or dmac.
Run the command ipv4 field [ dip | l4-dport | l4-sport | protocol | sip | sport | vlan ] * to configure the IPV4 packet load sharing mode in the specified load balancing template. By default, the load balancing mode of IPv4 packets is sip or dip.
Run the command ipv6 field [ dip | l4-dport | l4-sport | protocol | sip | sport | vlan ] * to configure the IPV6 packet load sharing mode in the specified load sharing template. By default, the load balancing mode of IPv6 packets is sip or dip.
Run the command mpls field [ 2nd-label | 3rd-label | dip | dmac | l4-dport | l4-sport | protocol | sip | smac | sport | top-label | vlan ] * to configure the MPLS report in the specified load balancing template Text load sharing mode. By default, the MPLS packet load balancing modes are top-label and 2nd-label.
【4】Execute the quit command to return to the system view.
【5】Execute the command interface eth-trunktrunk-id to enter the Eth-Trunk interface view.
【6】Execute the command load-balance enhanced profileprofile-name to apply the configured load balancing template.
The following example shows how to create a load-sharing template a, configure the IPv6 packet load-sharing mode in the template as sip and protocol, then apply this load-sharing template under interface Eth-Trunk1, and finally check whether the configuration is successful.
<HUAWEI> system-view
[HUAWEI] load-balance-profile a
[HUAWEI-load-balance-profile-a] ipv6 field sip protocol
[HUAWEI-load-balance-profile-a] quit
[HUAWEI] interface eth-trunk 1
[HUAWEI-Eth-Trunk1] load-balance enhanced profile a
[HUAWEI-Eth-Trunk1] quit
[HUAWEI] display eth-trunk 1 load-balance
Eth-Trunk1's load-balance information:
Load-balance Configuration: ENHANCED
Load-balance enhanced profile: a
Load-balance options used per-protocol:
L2: Source XOR Destination MAC address
IPv4: Source XOR Destination IP address
IPv6: Source IP address, IP protocol
MPLS: Top XOR Second label
It can be seen from the above information that the "Load-balance Configuration" field displays "ENHANCED", indicating that the enhanced load sharing mode is configured under interface Eth-Trunk1; the "IPv6" field in "Load-balance options used per-protocol" displays is "Source IP address, IP protocol", indicating that the IPv6 packet load balancing method is load balancing based on the source IP address and protocol.
Contact: Mr.Molle
Phone: 18823647757
E-mail: info@opticsswitch.com
Whatsapp:8618823647757
Add: A508, Hedi Chuangke Building, No. 28 Qingshui Road, Longgang District, Shenzhen, Guangdong Province, China
We chat