2023-HCIA-Datacom Nanny Level Study Notes (10): Ethernet Link Aggregation

1. Terminology

eth-trunk Ethernet link aggregation

LACP (Link Aggregation Control Protocol)-Link Aggregation Control Protocol

LACPDU (Link Aggregation Control Protocol Data Unit)-Link Aggregation Control Protocol Data Unit

System Priority - 32768

interface priority - 32768

2. Basic principles

1. Technical Background

When there are multiple links between devices, due to the existence of STP, only one link actually forwards traffic, and the link bandwidth between devices cannot be improved. Ethernet link aggregation Eth-Trunk bundles multiple physical interfaces into A logical interface can achieve the purpose of increasing link bandwidth without hardware upgrade

2. Basic terms

Link Aggregation Group (LAG): A logical link formed by bundling several links together. Each aggregation group corresponds to only one logical interface, which is also called link aggregation interface or Eth-Trunk interface.

Member interface and member link: The physical interfaces that make up an Eth-Trunk interface are called member interfaces. Links corresponding to member interfaces are called member links.

Active interface and active link: The active interface is also called the selected (Selected) interface, which is a member interface participating in data forwarding. The link corresponding to the active interface is called the active link (Activelink)

Inactive interface and inactive link: Also called unselected (Unselected) interface, it is a member interface that does not participate in data forwarding. Links corresponding to inactive interfaces are called inactive links.

Aggregation mode: Depending on whether LACP (Link Aggregation Control Protocol, Link Aggregation Control Protocol) is enabled, link aggregation can be divided into manual mode and LACP mode.

Other concepts: Active Interface Upper Threshold and Active Interface Lower Threshold.

3. Application scenarios

Between switches: To ensure link bandwidth and reliability between switches, you can deploy multiple physical links between switches and use Eth-Trunk

Between the switch and the server: In order to improve the access bandwidth and reliability of the server, aggregate two or more physical network cards into a network card group, and establish link aggregation with the switch

Switch and stacking system: The stacking system makes two switches a logical device, and the switch and stacking system can be connected through link aggregation to form a highly reliable, loop-free network

Firewall dual-system hot standby heartbeat line: In the firewall dual-system hot standby network, the heartbeat line is used to detect the status of the peer device. To prevent status monitoring errors caused by single-port and single-link failures, Eth-Trunk can be deployed, and Eth-Trunk can be used. Trunk as a heartbeat line for detecting status

3. Manual mode

1. Principle

The establishment of Eth-Trunk and the addition of member interfaces are all manually configured, and LACP is not used for negotiation between the two systems. Under normal circumstances, all links are active links. In this mode, all active links participate in data forwarding and share the traffic evenly. If an active link fails, the link aggregation group will automatically average among the remaining active links. share traffic

2. Limitations

In manual mode, there is no message exchange between devices, so it can only be manually confirmed by the administrator

In manual mode, the device can only judge whether the peer interface is working normally through the status of the physical layer.

Four, LACP mode

1 Overview

A link aggregation mode using the LACP protocol. Devices interact through Link Aggregation Control Protocol Data Unit (LACPDU), and protocol negotiation ensures that the opposite end is a member interface of the same device and the same aggregation interface. The LACPDU message contains device priority, MAC address, interface priority, interface number, etc.

2. Basic terms

System priority: 32768 by default, the smaller the better, usually keep the default. When the priority is the same, LACP will select the active end by comparing the MAC address. The smaller the MAC address, the better.

Interface priority: the default is 32768, the smaller the better, usually keep the default, when the priority is the same, LACP will select the active interface through the interface number, the smaller the better

Maximum number of active interfaces:

LACP模式支持配置最大活动接口数目,当成员接口数目超过最大活动接口数目时会通过比较接口优先级、接口号选举出较优的接口成为活动接口,其余的则成为备份端口(非活动接口),同时对应的链路分别成为活动链路、非活动链路。交换机只会从活动接口中发送、接收报文。

当活动链路中出现链路故障时,可以从非活动链路中找出一条优先级最高(接口优先级、接口编号比较)的链路替换故障链路,实现总体带宽不发生变化、业务的不间断转发。

3.活动链路选举

1)SW1、SW2配置LACP模式的链路聚合。两端都设置最大活跃接口数为2。

2)通过LACPDU选举出优先级较高的交换机SW1,作为LACP协商过程的主动端。

3)SW1在本端通过比较接口优先级、接口编号选举出活动接口,其中1、2号接口在相同的接口优先级下拥有更小的接口编号,成为活动接口。

4)SW1通过LACPDU将本端活动端口选举结果告知对端。

5)SW2依据SW1的选举结果,明确本端的活动接口,同时对应的链路成为活动链路。

五、负载分担模式

-基于包

在使用Eth-Trunk转发数据时,由于聚合组两端设备之间有多条物理链路,如果每个数据帧在不同的链路上转发,则有可能导致数据帧到达对端时间不一致,从而引起数据乱序

-基于流

Eth-Trunk推荐采用逐流负载分担的方式,即一条相同的流负载到一条链路,这样既保证了同一数据流的数据帧在同一条物理链路转发,又实现了流量在聚合组内各物理链路上的负载分担

-负载分担算法的选择

常见的模式:源IP、源MAC、目的IP、目的MAC、源目IP、源目MAC

1)如果报文的IP地址变化较频繁,那么选择基于源IP、目的IP或者源目IP的负载分担模式更有利于流量在各物理链路间合理的负载分担;

2)如果报文的MAC地址变化较频繁,IP地址比较固定,那么选择基于源MAC、目的MAC或源目MAC的负载分担模式更有利于流量在各物理链路间合理的负载分担。

注意:如果负载分担模式选择的和实际业务特征不相符,可能会导致流量分担不均,部分成员链路负载很高,其余的成员链路却很空闲,如在报文源目IP变化频繁但是源目MAC固定的场景下选择源目MAC模式,那将会导致所有流量都分担在一条成员链路上

六、配置

1.基础配置命令

1.创建链路聚合组.

[Huaweil]interface eth-trunk trunk-id

创建Eth-Trunk接口,并进入Eth-Trunk接口视图。

2.配置链路聚合模式

[Huawei- Eth-Trunk1]mode {lacp /manual load-balance}

Mode lacp配置链路聚合模式为lacp模式,mode manualload-balance配置链路聚合模式为手工模式。

注意:需要保持两端链路聚合模式一致

3.将接口加入链路聚合组中(以太网接口视图)

[Huawei-GigabitEthernet0/0/1]eth-trunk trunk-id

在接口视图下,把接口加入到Eth-Trunk中。

4.将接口加入链路聚合组中(Eth-Trunk视图)

[Huawei-Eth-Trunk1]trunkport interface -type {interface-number}

在Eth-Trunk视图中将接口加入到链路聚合组中。3、4两种方式都可以将接口加入到链路聚合组中。

5.使能允许不同速率端加入同一Eth-Trunk接口的功能

[Huawei-Eth-Trunk1]mixed-rate link enable

缺省情况下,设备未使能允许不同速率端口加入同一Eth-Trunk接口的功能,只能相同速率的接口加入到同一个Eth-Trunk接口中。

6.配置系统LACP优先级

[Huawei] lacp priority priority.

系统LACP优先级值越小优先级越高,缺省情况下,系统L ACP优先级为32768。

7.配置接口LACP优先级

[Huawei-GigabitEthernet0/0/1]lacp priority priority

在接口视图下配置接口LACP优先级。缺省情况下,接口的LACP优先级是32768。接口优先级取值越小,接口的LACP优先级越高。

只有在接口已经加入到链路聚合中才可以配置该命令。

8.配置最大活动接口数

[Huawei-Eth-Trunk1]max active-linknumber {number}

配置时需注意保持本端和对端的最大活动接口数一致,只有LACP模式支持配置最大活动接口数。

9.配置最小活动接口数

[Huawei-Eth-Trunk1]least active-linknumber {number}

本端和对端设备的活动接口数下限阈值可以不同,手动模式、LACP模式都支持配置最小活动接口数。

配置最小活动接口数目的是为了保证最小带宽,当前活动链路数目小于下限阈值时,Eth-Trunk接口的状态转为Down。

2.配置示例

-手工模式

需求

SW1、SW2都连接着VLAN10、VLAN20的网络。SW1和SW2之间通过两根以太网链路互联,为了提供链路冗余以及保证传输可靠性,在SW1、SW2之间配置手工模式的链路聚合。

拓扑图

配置步骤

#SW 1

[SW1] interfaceeth-trunk 1

[SW1-Eth-Trunk1] trunkportgigabitethernet 0/0/1 to 0/0/2

[SW1-Eth-Trunk1] portlink-type trunk

[SW1-Eth-Trunk1] porttrunk allow-pass vlan 10 20

#SW2

[SW2] interfaceeth-trunk 1

[SW2-Eth-Trunk1] trunkportgigabitethernet 0/0/1 to 0/0/2

[SW2-Eth-Trunk1] portlink-type trunk

[SW2-Eth-Trunk1] porttrunk allow-pass vlan 10 20

-LACP模式

需求

SW1、SW2都连接着VLAN10、VLAN20的网络。SW1和SW2之间通过三根以太网链路互联,为了提供链路冗余以及保证传输可靠性,在SW1、SW2之间配置LACP模式的链路聚合,并且手动调整优先级让SW1成为主动端,并配置最大活跃端口为2,另外一条链路作为备份

拓扑

配置步骤

#SW1

[SW1] interfaceeth-trunk 1

[SW1-Eth-Trunk1] modelacp

[SW1-Eth-Trunk1] maxactive-linknumber 2

[SW1-Eth-Trunk1] trunkportgigabitethernet 0/0/1 to 0/0/3

[SW1-Eth-Trunk1] portlink-type trunk

[SW1-Eth-Trunk1] porttrunk allow-pass vlan 10 20

[SW1-Eth-Trunk1] quit

[SW1] lacp priority 30000

#SW2

[SW2] interface eth-trunk 1

[SW2-Eth-Trunk1] mode lacp

[SW2-Eth-Trunk1] maxactive-linknumber 2

[SW2-Eth-Trunk1] trunkportgigabitethernet 0/0/1 to 0/0/3

[SW2-Eth-Trunk1] portlink-type trunk

[SW2-Eth-Trunk1] porttrunk allow-pass vlan 10 20

[SW2-Eth-Trunk1] quit

Guess you like

Origin blog.csdn.net/2301_76170756/article/details/129634728
Recommended