Link aggregation is a technology that bundles multiple physical links together into a single logical link, thereby increasing link bandwidth and redundancy.
Link aggregation technology has the following three advantages:
- Increase bandwidth
The maximum bandwidth of a link aggregation interface can be the sum of the bandwidths of each member interface.
- Improve reliability
When an active link fails, traffic can be switched to other available member links, improving the reliability of the link aggregation interface.
- Share the load
Within a link aggregation group, load balancing can be achieved on the active links of each member.
- Eth-trunk口
- A Link Aggregation Group (LINK) aggregates multiple physical links into a single logical link and forms an interface called an Eth-trunk interface, which can achieve bandwidth stacking and high reliability. Each aggregation group corresponds to an Eth-trunk port.
- Member interfaces and member links
- All physical ports in the Eth-trunk are member interfaces, and their corresponding links are member links.
- Active interface and active link
- The interface that forwards data is called an active interface, and the link corresponding to the interface is the active link.
- Inactive interfaces and inactive links
- The concept is the opposite of the above;
- Threshold for the maximum number of active interfaces
- To ensure bandwidth reliability, the maximum number of active interfaces that can exist in an Eth-trunk interface is added after the upper limit threshold is reached, and the link status of the newly added member interface is down, which is used as a backup.
- For example, if the number of active interfaces on an Eth-trunk port goes online to 5, and five member interfaces are added to the Eth-Trunk port at the beginning, all of them are in the UP link state. Later, add the sixth member interface to the Eth-trunk port, the port is in the DOWN state, and its link is used as a backup, and the first five ports will be topped if there is a problem.
- The threshold for the lower limit of the number of active interfaces
- To ensure the minimum bandwidth, the minimum number of active interfaces that can exist in the aggregation group, if the active link is less than the lower threshold, the Eth-trunk interface becomes DOWN.
- For example, if each physical link can provide 1 GB of bandwidth, but a minimum of 2 GB of bandwidth is required, the minimum threshold for the number of active interfaces must be greater than or equal to 2, otherwise the Eth-trunk is DOWN.
Depending on whether LACP is enabled, there are two aggregation modes: static and dynamic (LACP).
Static aggregation: The establishment of an Eth-trunk and the addition of member interfaces are manually configured, and all activities participate in traffic balancing without the participation of the link aggregation control protocol, also known as manual load balancing.
动态聚合:基于IEEE802.3ad标准的LACP,链路聚合控制协议是一种实现链路动态聚合与解聚合的协议。 LACP通过链路聚合控制协议数据单元LACPDU(Link Aggregation Control Protocol Data Unit)与对端交互信息。
LACPDU is a Layer 2 multicast packet that advertises information such as system priority, MAC address, interface priority, interface number, and operation key. After receiving this information, the peer compares the information with the information stored by its own interface to select the interface that can be aggregated, and the two parties agree on which interfaces can become active interfaces to determine the active link.
Packets have attributes such as the source destination MAC address, source destination IP address, and source destination port, and the packet parameters are relied upon to select the physical link to implement load balancing when forwarding data on an Eth-trunk port.
Eth-Trunk adopts a flow-by-flow load balancing mechanism, which generates a HASH-KEY value for the address in the data frame through the HASH algorithm, and then finds the corresponding outbound interface in the Eth-Trunk forwarding table according to this value. In addition, the load balancing of traffic on each physical link in the aggregation group is implemented, that is, the load balancing of each stream.
Flow-by-flow load balancing ensures the order of packets, but not bandwidth utilization.
The load balancing modes are:
- Based on the destination IP
- DESTINATION MAC BASED
- Based on the source destination IP
- BASED ON THE SOURCE DESTINATION MAC
- Based on the source IP
- BASED ON THE SOURCE MAC
- The aggregation mode of the devices at both ends must be the same, and one end cannot be dynamic and the other end LACP.
- To prevent loops, you need to configure the wiring after you configure it, and you can also enable the STP function to prevent loops.