What Is LLDP?
Link Layer Discovery Protocol (LLDP) is a standard Layer 2 topology discovery protocol defined in IEEE 802.1ab. It collects local device information including the management IP address, device ID, and port ID and advertises the information to neighboring devices, which then save the information in their management information bases (MIBs). A network management system (NMS) can search required information in MIBs to determine the link status.
Why Do We Need LLDP?
As networks grow in scale, an NMS must be capable of managing network devices with diverse functions and complex configurations. Most traditional NMSs are limited to detecting Layer 3 network topologies and cannot identify detailed topology information or configuration conflicts. Therefore, a standard protocol is required to exchange Layer 2 information between network devices.
LLDP provides a standard link-layer discovery method. Layer 2 information obtained through LLDP allows the NMS to detect the topology of neighboring devices, and display paths between clients, switches, routers, application servers, and network servers. The NMS can also detect conflicts in configurations between network devices and identify causes of network connection failures. Enterprise users can use an NMS to monitor the link status of LLDP-enabled devices and quickly locate network faults.
Where Is LLDP Used?
LLDP is mainly used in the following scenarios:
Single-neighbor networking
In this networking mode, interfaces between two switches or interfaces between a switch and a media endpoint (ME) are directly connected, and each interface has only one neighbor. As shown in the figure below, SwitchA is directly connected to SwitchB and ME, and each interface on the switches has only one neighbor.
Single-neighbor networkingMulti-neighbor networking
In this networking mode, interfaces between switches are not directly connected, and each interface has more than one neighbor. As shown in the figure below, SwitchA, SwitchB, and SwitchC are connected through Switch that supports transparent transmission of LLDP packets, and each interface on SwitchA, SwitchB, and SwitchC has more than one neighbor.
Multi-neighbor networkingEth-Trunk networking
In this networking mode, interfaces between two switches are directly connected and bundled into an Eth-Trunk, and each member interface has only one neighbor. As shown in the figure below, the interfaces between SwitchA and SwitchB are bundled into an Eth-Trunk, and each member interface has only one neighbor.
Eth-Trunk networking
LLDP Frame Format
LLDP Frame Structure
An LLDP frame is an Ethernet frame encapsulated with an LLDP data unit (LLDPDU). The following figure shows the LLDP frame structure.
LLDP frame structure
An LLDP frame contains the following fields:
LLDPDU Structure
An LLDPDU contains local device information and is encapsulated in an LLDP frame. Each LLDPDU consists of several information elements known as Type-Length-Value (TLV) fields. A device encapsulates its local information into TLVs, assembles them into an LLDPDU, and then encapsulates the LLDPDU within an LLDP frame. The LLDPDU structure is illustrated in the following figure.
LLDPDU structure
As shown in the figure, an LLDPDU has four mandatory TLVs: Chassis ID TLV, Port ID TLV, Time to Live TLV, and End of LLDPDU TLV. Other TLVs are optional and may be included in an LLDPDU at the discretion of the device.
When LLDP is disabled on an interface or an interface is shut down, the interface sends a shutdown LLDPDU to its neighbors, with the Time to Live TLV set to 0 and no optional TLVs present.
TLV Structure
An LLDPDU is composed of multiple TLVs, each representing a distinct information element.
The following figure shows the structure of a TLV.
TLV structure
A TLV contains the following fields:
- TLV Type (7 bits): type of a TLV. Each TLV type has a unique value, such as 0 for End of LLDPDU and 1 for Chassis ID.
- TLV Length (9 bits): size of a TLV.
- TLV Value (0–511 bytes): The first bit indicates the TLV sub-type and the remaining bits carry the actual content.
TLV Type
An LLDPDU can encapsulate basic TLVs, IEEE 802.1-defined TLVs, IEEE 802.3-defined TLVs, and Media Endpoint Discovery (MED) TLVs. Basic TLVs are used for fundamental device management, while IEEE 802.1, IEEE 802.3, and MED TLVs provide enhanced management capabilities. Devices determine whether to include organizationally specific TLVs in LLDPDUs based on actual requirements.
Basic TLVs
The following table lists basic TLVs, four of which are mandatory in LLDP implementation and must be encapsulated in an LLDPDU.Table 1-1 Basic TLVsTLV
Description
Mandatory
Chassis ID TLV
Bridge MAC address of the device sending an LLDPDU.
Yes
Port ID TLV
Name of the 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
Device name.
NOTE:If the ip domain-name command has been configured to add a suffix to the device name, this TLV displays device name.suffix.
For example, if the device name is MyDevice and suffix is area1, this TLV carries the value MyDevice.area1.
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 addresses uniquely identify network devices, facilitating network topology layout and network management.
No
TLVs defined by the IEEE 802.1 working group
Table 1-2 IEEE 802.1-defined TLVsTLV
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.
TLVs defined by the IEEE 802.3 working group
Table 1-3 IEEE 802.3-defined TLVsTLV
Description
EEE TLV
Whether a port supports Energy Efficient Ethernet (EEE).
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 supports PoE and whether a port supplies or demands power.
MED TLVs
MED TLVs are related to voice over IP (VoIP) applications and provide functions such as basic configuration, network policy configuration, address management, and directory management. These TLVs meet the requirements of voice device manufacturers for cost efficiency, easy deployment, and easy management. Use of these TLVs allows the deployment of voice devices on an Ethernet network. This brings great convenience for manufacturers, sellers, and users of voice devices.
When a switch receives an LLDP packet containing any MED TLV from a neighbor on an interface, it responds by advertising all MED TLVs supported on that interface to the neighbor. If the neighbor device can recognize only some of these MED TLVs, LLDP negotiation fails. To avoid this, you can run the undo lldp tlv-enable med-tlv command to prevent the interface from advertising the MED TLVs not supported by its LLDP neighbor. For example, if an interface connects to a terminal that does not support the 802.3af standard and therefore cannot recognize Extended Power-via-MDI TLV, run the undo lldp tlv-enable med-tlv power-over-ethernet command on the interface to disable advertisement of that TLV.
Table 1-4 MED TLVsTLV
Description
LLDP-MED Capabilities TLV
Type of a device and types of MED TLVs that can be encapsulated in an LLDPDU.
Inventory TLV
Manufacturer of the device.
Location Identification TLV
Location of the local device.
Network Policy TLV
VLAN ID, Layer 2 priority, and DSCP of a voice VLAN.
Extended Power-via-MDI TLV
Power capability of the system.
Hardware Revision TLV
Hardware version of a media endpoint (ME).
Firmware Revision TLV
Firmware version of an ME.
Software Revision TLV
Software version of an ME.
Serial Number TLV
Serial number of an ME.
Model Name TLV
Model name of an ME.
Asset ID TLV
Asset identifier of an ME.
Mechanisms for Sending and Receiving LLDP Frames
Mechanism for sending LLDP frames
After LLDP is enabled on a device, it sends LLDP frames periodically to its neighbors and also when its configuration changes. To prevent LLDP frames from flooding the network due to frequent configuration changes, the device implements a delay before sending the next LLDP frame.
Mechanism for receiving LLDP frames
Upon receiving an LLDP frame from a neighbor, a device validates the frame and its TLVs. If the frame and TLVs are valid, the device stores the information about the neighbor and sets its aging time based on the TTL value in the LLDPDU. If the TTL is 0, the device immediately ages out the neighbor information.
How Does LLDP Work?
LLDP enables the local device to collect and send local device information to the remote device and save information received from the remote device to standard MIBs. The following figure shows how LLDP is implemented.
LLDP implementation
LLDP is implemented as follows:
- The LLDP module uses an LLDP agent to interact with various MIBs, including the physical topology, entity, and interface MIBs, to update the LLDP local system MIB, as well as the LLDP extended MIB defined for the local device.
- The LLDP agent encapsulates local device information into LLDP frames and sends them to a remote device.
- After receiving LLDP frames from the remote device, the LLDP agent updates the LLDP remote system MIB, as well as the LLDP extended MIB defined for the remote device.
- By exchanging LLDP frames with remote devices, the local device can obtain information about the remote devices, including remote interfaces connected to the local device and MAC addresses of remote devices.
The LLDP local system MIB stores information about the local device, including the device ID, interface ID, system name, system description, interface description, and network management address, while the LLDP remote system MIB stores similar information about remote devices.
An LLDP agent is responsible for:
- Maintaining the LLDP local system MIB and LLDP remote system MIB.
- Sending information in the LLDP local system MIB to remote devices when the local device status changes, or at a regular interval if no changes occur.
- Identifying and processing incoming LLDP frames.
- Sending LLDP traps to the NMS when any changes occur in the LLDP local system MIB or LLDP remote system MIB.
- Author: Meng Xianhai, Li Qiang
- Updated on: 2025-07-18
- Views: 4648
- Average rating:
Export PDF