LACP网络协议帧
基于IEEE802.3ad标准的LACP(Link Aggregation Control Protocol),链路汇聚控制协议是一种实现链路动态聚合与解聚合的协议。LACP协议通过LACPDU(Link Aggregation Control Protocol Data Unit)与对端交互信息。LACPDU帧为慢协议(平均每秒发送的协议报文不超过5个),如果接口板收到报文的DMAC是特殊的组播地址0x01-80-c2-00-00-02,二层协议类型字段为0x8809,协议子类型为0x01,则说明此数据报文为LACPDU帧。
一、 LACPDU格式
+-------------------------------+
| Destination Address |
+-------------------------------+
| Source Address |
+-------------------------------+
| Length/Type |
+-------------------------------+
| Subtype = LACP |
+-------------------------------+
| Version Number |
+-------------------------------+
| TLV_type = Actor Information |
+-------------------------------+
| Actor_Information_Length = 20 |
+-------------------------------+
| Actor_System_Priority |
+-------------------------------+
| Actor_System |
+-------------------------------+
| Actor_key |
+-------------------------------+
| Actor_Port_Priority |
+-------------------------------+
| Actor_Port |
+-------------------------------+
| Actor_State |
+-------------------------------+
| Reserved |
+-------------------------------+
| TLV_Type=Partner Information |
+-------------------------------+
| Partner_Information_length=20 |
+-------------------------------+
| Partner_System_Priority |
+-------------------------------+
| Partner_System |
+-------------------------------+
| Partner_Key |
+-------------------------------+
| Partner_Port_Priority |
+-------------------------------+
| Partner_Port |
+-------------------------------+
| Partner_State |
+-------------------------------+
| Reserved |
+-------------------------------+
| TLV_type=Collector Information|
+-------------------------------+
|Collector_Information_Length=16|
+-------------------------------+
| CollectorMaxDelay |
+-------------------------------+
| Reserved |
+-------------------------------+
| TLV_type = Terminator |
+-------------------------------+
| Terminator_Length=0 |
+-------------------------------+
| Reserved |
+-------------------------------+
| FCS |
+-------------------------------+
二、 LACPDU格式字段释义
字段 | 长度 | 说明 |
---|---|---|
Destination Address | 6字节 | 目的MAC地址,是一个组播地址(01-80-C2-00-00-02)。 |
Source Address | 6字节 | 源MAC地址,发送端口的MAC地址。 |
Length/Type | 2字节 | 协议类型:0x8809。 |
Subtype | 1字节 | 报文子类型:0x01,说明是LACP报文。 |
Version Number | 1字节 | 协议版本号:0x01。 |
TLV_type = Actor Information | 1字节 | 标识TLV的类型,值为0x01代表Actor字段。 |
Actor_Information_Length | 1字节 | actor信息字段长度,取值为20(即0x14),以字节为单位。 |
Actor_System_Priority | 2字节 | 本端系统优先级,可以设置,默认情况下为32768(即0x8000)。 |
Actor_System | 6字节 | 系统ID,本端系统的MAC地址。 |
Actor_key | 2字节 | 端口KEY值,系统根据端口的配置生成,是端口能否成为聚合组中的一员的关键因素,影响Key值的因素有trunk ID、接口的速率和双工模式。 |
Actor_Port_Priority | 2字节 | 接口优先级,可以配置,默认为0x8000。 |
Actor_Port | 2字节 | 端口号,根据算法生成,由接口所在的槽位号、子卡号和端口号决定。 |
Actor_State | 1字节 | 本端状态信息,比特0~7的含义分别为:
|
Reserved | 3字节 | 保留字段,可用于功能调试以及扩展。 |
TLV_type = Partner Information | 1字节 | 标识TLV的类型,值为0x02代表Partner字段。 |
Partner_Information_Length | 1字节 | Partner信息字段长度,取值为20(即0x14),以字节为单位。
Partner字段代表了链路接口接收到对端的系统信息、接口信息和状态信息,与actor字段含义一致。在协商最开始未收到对端信息时,partner字段填充0,接收到对端信息后会把收到的对端信息补充到partner字段当中。 |
Partner_System_Priority | 2字节 | 对端系统优先级。 |
Partner_System | 6字节 | 对端系统ID,对端系统的MAC地址。 |
Partner_key | 2字节 | 对端端口KEY值。 |
Partner_Port_Priority | 2字节 | 对端接口优先级。 |
Partner_Port | 2字节 | 对端端口号。 |
Partner_State | 2字节 | 对端状态信息。 |
Reserved | 3字节 | 保留字段,可用于功能调试以及扩展。 |
TLV_type = Collector Information | 1字节 | 标识TLV的类型,值为0x03代表Collector字段。 |
Collector_Information_Length | 1字节 | Collector信息字段长度,取值为16(即0x10),以字节为单位。 |
CollectorMaxDelay | 2字节 | 最大延时,以10微秒为单位。 |
Reserved | 12字节 | 保留字段,可用于功能调试以及扩展。 |
TLV_type = Terminator Information | 1字节 | 标识TLV的类型,值为0x00代表Terminator字段。 |
Terminator_Length | 1字节 | Terminator信息字段长度,取值为0(即0x00)。 |
Reserved | 50字节 | 保留字段,全置0,接收端忽略此字段。 |
FCS | 4字节 | 用于帧内后续字节差错的循环冗余检验(也称为FCS或帧检验序列)。 |
三、LACPDU报文示例
Frame 1: 128 bytes on wire (1024 bits), 128 bytes captured (1024 bits)
Arrival Time: Jul 6, 2011 15:51:27.199195000
Epoch Time: 1309938687.199195000 seconds
[Time delta from previous captured frame: 0.000000000 seconds]
[Time delta from previous displayed frame: 0.000000000 seconds]
[Time since reference or first frame: 0.000000000 seconds]
Frame Number: 1
Frame Length: 128 bytes (1024 bits)
Capture Length: 128 bytes (1024 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:slow]
[Coloring Rule Name: Broadcast]
[Coloring Rule String: eth[0] & 1]
Ethernet II, Src: HuaweiTe_3f:17:8f (00:18:82:3f:17:8f), Dst: Slow-Protocols (01:80:c2:00:00:02)
Destination: Slow-Protocols (01:80:c2:00:00:02)
Address: Slow-Protocols (01:80:c2:00:00:02)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: HuaweiTe_3f:17:8f (00:18:82:3f:17:8f)
Address: HuaweiTe_3f:17:8f (00:18:82:3f:17:8f)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Type: Slow Protocols (0x8809)
Link Aggregation Control Protocol
Slow Protocols subtype: LACP (0x01)
LACP Version Number: 0x01
Actor Information: 0x01
Actor Information Length: 0x14
Actor System Priority: 100
Actor System: HuaweiTe_3f:17:8f (00:18:82:3f:17:8f)
Actor Key: 6449
Actor Port Priority: 100
Actor Port: 1811
Actor State: 0x3d (Activity, Aggregation, Synchronization, Collecting, Distributing)
.... ...1 = LACP Activity: Yes
.... ..0. = LACP Timeout: No
.... .1.. = Aggregation: Yes
.... 1... = Synchronization: Yes
...1 .... = Collecting: Yes
..1. .... = Distributing: Yes
.0.. .... = Defaulted: No
0... .... = Expired: No
Reserved: 000000
Partner Information: 0x02
Partner Information Length: 0x14
Partner System Priority: 1
Partner System: HuaweiTe_93:e1:98 (28:6e:d4:93:e1:98)
Partner Key: 6449
Partner Port Priority: 100
Partner Port: 260
Partner State: 0x0f (Activity, Timeout, Aggregation, Synchronization)
.... ...1 = LACP Activity: Yes
.... ..1. = LACP Timeout: Yes
.... .1.. = Aggregation: Yes
.... 1... = Synchronization: Yes
...0 .... = Collecting: No
..0. .... = Distributing: No
.0.. .... = Defaulted: No
0... .... = Expired: No
Reserved: 000000
Collector Information: 0x03
Collector Information Length: 0x10
Collector Max Delay: 65535
Reserved: 000000000000000000000000
Terminator Information: 0x00
Terminator Length: 0x00
Reserved: 000000000000000000000000000000000000000000000000...
四、LACP报文参考标准
标准 | 描述 |
---|---|
IEEE 802.3ad | IEEE Standard for Information Technology - Local and Metropolitan Area Networks - Part 3: Carrier Sense Multiple Access with Collision Detection (CSMA/CD) Access Method and Physical Layer Specifications-Aggregation of Multiple Link Segments |
发表评论