LLDP网络协议帧(二)
LLDP网络协议帧(一) https://www.wlgly.net/post-48.html
五、IEEE 802.1组织定义的TLV
IEEE 802.1子类 | TLV名称 | 含义 |
---|---|---|
0x01 | Port VLAN ID | 是一个可选的固定长度的TLV,允许VLAN桥端口在untagged帧或者带有优先级值的帧中发布其端口VLAN ID(PVID)(请参见IEEE 802.1Q- 2005, 8.4.4章节)。该TLV的格式如下:
+----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length = 6 (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 1 (1 octet) | +----------------------------------------------+ | port VLAN identifier (PVID) (2 octets) | +----------------------------------------------+ 其中,port VLAN identifier域是IEEE Std 802.1Q-2005标准第8.4.4章节中定义的桥端口的VLAN ID。如果设备不知道PVID值或者不支持基于端口的VLAN操作,那么此域的值为0。 |
0x02 | Port And Protocol VLAN ID | 是一个可选的TLV,端口的协议VLAN ID。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length = 7 (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 2 (1 octet) | +----------------------------------------------+ | flags (1 octet) | +----------------------------------------------+ | port and protocol VLAN identifier (PPVID) | | (2 octets) | +----------------------------------------------+ 其中,flags域各比特的含义如下: Bit 功能 值/含义 1 标识是否支持端口的协议VLAN 1表示支持,0表示不支持 2 是否使能端口的协议VLAN 1表示使能,0表示未使能 3 – 8 预留 设置为0 |
0x03 | VLAN Name | 是一个可选TLV,设备端口VLAN的名称。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 3 (1 octet) | +----------------------------------------------+ | VLAN ID (2 octets) | +----------------------------------------------+ | VLAN name length (1 octet) | +----------------------------------------------+ | VLAN name (0-32 octets) | +----------------------------------------------+ 如果一个端口定义了多个VLAN名称TLV,则VLAN ID及对应的VLAN名称的组合必须是唯一的。 VLAN ID域是指VLAN名称所对应的VLAN ID。 VLAN名称长度域是指VLAN名称的长度,字节为单位,如果VLAN名称长度为0,表示该VLAN没有配置对应的VLAN名称。 如果设备支持IETF RFC 4363,则VLAN名称设置为dot1QVLANStaticName对象。 |
0x04 | Protocol Identity | 是一个可选TLV,标识设备端口支持的协议类型。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 4 (1 octet) | +----------------------------------------------+ | protocol identity length (1 octet) | +----------------------------------------------+ | protocol identity ( <= 255 octets) | +----------------------------------------------+ |
0x05 | VID Usage Digest | 是一个可选的TLV,标识设备的VID使用摘要信息。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 5 (1 octet) | +----------------------------------------------+ | VID usage digest (4 octets) | +----------------------------------------------+ |
0x06 | Management VID | 是一个可选的TLV,设备的管理VLAN ID。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 6 (1 octet) | +----------------------------------------------+ | Management ID (2 octets) | +----------------------------------------------+ 如果设备没有管理VID,该值设置为0。 |
0x07 | Link Aggregation | 标识端口的链路聚合能力和使能状态。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-80-C2 (3 octets) | +----------------------------------------------+ | 802.1 subtype = 7 (1 octet) | +----------------------------------------------+ | aggregation status (1 octet) | +----------------------------------------------+ | aggregated port ID (4 octets) | +----------------------------------------------+ “link aggregation status”域各比特含义:
|
0x08 - 0xFF | Reserved | - |
六、IEEE 802.3组织定义的TLV
IEEE 802.3子类 | TLV名称 | 描述 |
---|---|---|
1 | MAC/PHY Configuration/Status | 该TLV是个可选的TLV,标识如下信息:
该TLV的格式: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-12-0F (3 octets) | +----------------------------------------------+ | 802.3 subtype = 1 (1 octet) | +----------------------------------------------+ | auto-negotiation support/status (1 octet) | +----------------------------------------------+ | PMD auto-negotiation advertised capability | | (2 octets) | +----------------------------------------------+ | operational MAU type (2 octets) | +----------------------------------------------+ “auto-negotiation support/status”域的各比特含义如下: Bit 功能 值/含义 IETF RFC 4836参考 0 自协商的支持 1 = 支持 0 = 不支持 ifMauAutoNegSupported 1 自协商状态 1 = 使能 0 = 未使能 ifMauAutoNegAdminStatus 2–7 - 预留 - “PMD auto-negotiation capability”域使用BITS pseudotype编码方式,0为字节的高位(最左)。 “operational MAU type”域是个整数值,标识发送设备的MAU类型。该值设置为IETF RFC 4836或后续更新版本中的dot3MauType对应的位置或者dot3MauType OID对应的最后一个数。 |
2 | Power Via Medium Dependent Interface (MDI) | 该TLV允许网管发布和发现发送设备的端口供电能力。IEEE 802.3定义了三种实现,10BASE-T、100BASE-TX和1000BASE-T。
该TLV的格式: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-12-0F (3 octets) | +----------------------------------------------+ | 802.3 subtype = 2 (1 octet) | +----------------------------------------------+ | MDI power support (1 octet) | +----------------------------------------------+ | PSE power pair (1 octet) | +----------------------------------------------+ | power class (1 octet) | +----------------------------------------------+ MDI power support域的含义: 比特位 含义 值/含义 IETF RFC 3621对象 0 Port class 1 = PSE 0 = PD 1 Power Sourcing 1 = supported Equipment (PSE) 0 = not supported MDI power support 2 PSE MDI power state 1 = enabled 0 = disabled pethPsePortAdminEnable 3 PSE pairs control 1 = pair selection ability can be controlled 0 = pair selection pethPsePortPowerPairContolAbility can not be controlled 4–7 - 预留 - PSE power pair域是一个整数值,设置为IETF RFC 3621的pethPsePortPowerPairs对象。 power class域也是一个整数值,设置为IETF RFC 3621的pethPsePortPowerClassifications对象。 |
3 | Link Aggregation (deprecated) | N/A |
4 | Maximum Frame Size | 标识端口配置的MTU (Max Transmission Unit,最大传输单元)值。
该TLV的格式如下: +----------------------------------------------+ | TLV type= 127 (7 bits) | +----------------------------------------------+ | TLV information string length (9 bits) | +----------------------------------------------+ | 802.1OUI = 0x00-12-0F (3 octets) | +----------------------------------------------+ | 802.3 subtype = 4 (1 octet) | +----------------------------------------------+ | maximum 802.3 frame size (2 octets) | +----------------------------------------------+ 该TLV的值是一个整数值,表示端口支持的最大帧长,以字节为单位:
|
5 - 255 | Reserved | - |
七、LLDP帧(Ethernet II封装格式)报文示例
Frame 1: 331 bytes on wire (2648 bits), 331 bytes captured (2648 bits)
Arrival Time: Jan 1, 1970 08:00:00.018129000
Epoch Time: 0.018129000 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: 331 bytes (2648 bits)
Capture Length: 331 bytes (2648 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:lldp]
[Coloring Rule Name: Broadcast]
[Coloring Rule String: eth[0] & 1]
Ethernet II, Src: 12:34:43:21:12:34 (12:34:43:21:12:34), Dst: LLDP_Multicast (01:80:c2:00:00:0e)
Destination: LLDP_Multicast (01:80:c2:00:00:0e)
Address: LLDP_Multicast (01:80:c2:00:00:0e)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
Source: 12:34:43:21:12:34 (12:34:43:21:12:34)
Address: 12:34:43:21:12:34 (12:34:43:21:12:34)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
.... ..1. .... .... .... .... = LG bit: Locally administered address (this is NOT the factory default)
Type: 802.1 Link Layer Discovery Protocol (LLDP) (0x88cc)
Link Layer Discovery Protocol
Chassis Subtype = MAC address, Id: 12:34:43:21:12:34
0000 001. .... .... = TLV Type: Chassis Id (1)
.... ...0 0000 0111 = TLV Length: 7
Chassis Id Subtype: MAC address (4)
Chassis Id: 12:34:43:21:12:34 (12:34:43:21:12:34)
Port Subtype = Interface name, Id: GigabitEthernet1/1/9
0000 010. .... .... = TLV Type: Port Id (2)
.... ...0 0001 0101 = TLV Length: 21
Port Id Subtype: Interface name (5)
Port Id: GigabitEthernet1/1/9
Time To Live = 120 sec
0000 011. .... .... = TLV Type: Time to Live (3)
.... ...0 0000 0010 = TLV Length: 2
Seconds: 120
System Name = R4
0000 101. .... .... = TLV Type: System Name (5)
.... ...0 0000 0010 = TLV Length: 2
System Name = R4
System Description = Huawei Versatile Routing Platform Software\r\nVRP (R) software, Version 5.70 (NE40E&80E V600R001C00SPCe00)\r\nCopyright (C) 2000-2011 Huawei Technologies Co., Ltd.\r\nHUAWEI NE40E \r\n
0000 110. .... .... = TLV Type: System Description (6)
.... ...0 1011 0000 = TLV Length: 176
System Description = Huawei Versatile Routing Platform Software\r\nVRP (R) software, Version 5.70 (NE40E&80E V600R001C00SPCe00)\r\nCopyright (C) 2000-2011 Huawei Technologies Co., Ltd.\r\nHUAWEI NE40E \r\n
Port Description = HUAWEI, Quidway Series, GigabitEthernet1/1/9 Interface
0000 100. .... .... = TLV Type: Port Description (4)
.... ...0 0011 0110 = TLV Length: 54
Port Description: HUAWEI, Quidway Series, GigabitEthernet1/1/9 Interface
Capabilities
0000 111. .... .... = TLV Type: System Capabilities (7)
.... ...0 0000 0100 = TLV Length: 4
Capabilities: 0x0004
.... .... .... .1.. = Bridge
Enabled Capabilities: 0x0004
.... .... .... .1.. = Bridge
Management Address
0001 000. .... .... = TLV Type: Management Address (8)
.... ...0 0001 1101 = TLV Length: 29
Address String Length: 5
Address Subtype: IPv4 (1)
Management Address: 10.254.161.11 (10.254.161.11)
Interface Subtype: ifIndex (2)
Interface Number: 6016
OID String Length: 18
Object Identifier: 060f2b060104018f5b051929010201010100
End of LLDPDU
0000 000. .... .... = TLV Type: End of LLDPDU (0)
.... ...0 0000 0000 = TLV Length: 0
八、LLDP参考标准
标准 | 描述 |
---|---|
IEEE 802.1AB | IEEE Standard for Local and Metropolitan Area Networks: Station and Media Access Control Connectivity Discovery |
发表评论