LLDP is the neighbor discovery protocol defined in IEEE 802.1ab. Using the LLDP technology, the Network Management System (NMS) can rapidly learn the current network topology and topology changes when the network scale increases rapidly.
LLDP provides a standard link-layer discovery mode, which organizes the main capabilities, management address, device identifier, and interface identifier of the local device into different Type/Length/Value (TLVs), constructs a Link Layer Discovery Protocol Data Units (LLDPDU) with several TLVs, and encapsulates the LLDPDU in the data field of an LLDP frame, and then advertises LLDP frame to the directly connected neighbors. After receiving the LLDP frame, the neighbors store them as the standard Management Information Base (MIB) for the NMS to check and analyze the communication status along the links.
LLDP working modes
The LLDP working modes are categorized into:
After LLDP is enabled on a device, the device periodically sends LLDP packets to neighboring devices. If the configuration of the local device changes, the device immediately sends LLDP packets to neighboring devices to advertise the changes. If information changes frequently, you can set a delay for an interface to send LLDP packets to reduce the number of LLDP packets to be sent. After an interface sends an LLDP packet, the interface does not send another LLDP packet until the configured delay interval elapses.
The fast sending mechanism allows the device to override pre-configured delay interval and quickly advertise local information to other devices in the following situations:
The fast sending mechanism shortens the interval at which LLDP packets are sent to 1 second. After a specified number of LLDP packets are sent, the pre-configured delay interval is restored.
Principles for receiving LLDP packets
A device checks whether TLVs carried in LLDP packets it receives are valid. If the TLVs are valid, the device saves information about neighboring devices and uses the TTL value carried in the LLDPDU to set an aging time for the information.
LLDP frame
Figure 1 shows the LLDP frame format.
An LLDP frame contains the following fields:
LLDPDU
An LLDPDU is a data unit encapsulated in the data field in an LLDP packet.
A device encapsulates local device information in Type/Length/Value (TLV) format and combines several TLVs in an LLDPDU for transmission. You can combine various TLVs to form an LLDPDU as required. TLVs allow a device to advertise its own status and learn the status of neighboring devices.
Figure 2 shows the LLDPDU format.
Each LLDPDU starts with the Chassis ID TLV, Port ID TLV, and Time to Live TLV, and ends with the End of LLDPDU TLV. Other TLVs are optional, and you can determine whether to encapsulate them in an LLDPDU.
When LLDP is disabled on an interface or an interface is shut down, the interface sends a shutdown LLDPDU to the neighbors. In the shutdown LLDPDU, the value of the Time to Live TLV is 0. A shutdown LLDPDU contains no optional TLVs.
TLV
A TLV is the smallest unit of an LLDPDU. It gives type, length, and other information for a device object.
LLDPDUs can encapsulate basic TLVs, TLVs defined by IEEE 802.1 working groups, and TLVs defined by IEEE 802.3 working groups:
| TLV | Description | Mandatory |
|---|---|---|
| Chassis ID TLV | MAC address of the GE0/0/0 of the device sending an LLDPDU. | Yes |
| Port ID TLV | Port from which an LLDPDU is sent. |
Yes |
| Time To Live TLV | Time to live (TTL) of the local device information stored on the neighbor device. | Yes |
| End of LLDPDU TLV | End of an LLDPDU. | Yes |
| Port Description TLV | Character string that describes the port sending an LLDPDU. | No |
| System Name TLV | System name. | No |
| System Description TLV | Character string that describes the system. | No |
| System Capabilities TLV | Main functions of the system and the functions that have been enabled. | No |
| Management Address TLV | Address used by the NMS to identify and manage the local device. Management IP addresses uniquely identify network devices, facilitating layout of the network topology and network management. | No |
| TLV | Description |
|---|---|
| Port VLAN ID TLV | VLAN ID of a port. |
| Port And Protocol VLAN ID TLV | Protocol VLAN ID of a port. |
| VLAN Name TLV | Name of the VLAN on a port. |
| Protocol Identity TLV | Protocol types that a port supports. |
| TLV | Description |
|---|---|
| Link Aggregation TLV | Whether a port supports link aggregation and has link aggregation enabled. |
| MAC/PHY Configuration/Status TLV | Rate and duplex mode of a port, whether the port supports auto-negotiation, and whether auto-negotiation is enabled on the port. |
| Maximum Frame Size TLV | Maximum frame length that a port supports. The value is the maximum transmission unit (MTU) of the port. |
| Power Via MDI TLV | Power capabilities of a port, for example, whether a port supplies or demands power. |