Data Link

Link Layer Discovery Protocol (LLDP)

IEEE 802.1AB protocol for network topology discovery and device information exchange.

Introduction to LLDP

In a large network, an administrator must determine which switches, routers, and servers are connected and which ports carry those connections. This previously required physical diagrams and manual cable tracing. Documentation could become outdated, while an undocumented change or misconfiguration made troubleshooting more difficult.

The Link Layer Discovery Protocol (LLDP), defined in the IEEE 802.1AB standard, exchanges physical-topology information between directly connected stations. It is a protocol that lets network devices advertise their identity and capabilities to directly connected neighbors. Messages can include the device name, the connected port, and capabilities such as a switch or VoIP-phone role. LLDP itself does not authenticate these claims, so management systems should consider the data source and configuration.

Why LLDP Was Created: Interoperability

Neighbor discovery was previously implemented through vendor protocols such as . Other manufacturers had similar solutions, but support depended on device compatibility. A Dell switch could not interpret CDP messages from a Cisco switch, and an HP phone could not receive configuration information from a Juniper switch.

LLDP was created by the IEEE as a common, open standard. Its vendor neutrality supports interoperability and lets an administrator collect physical-topology information from equipment made by different vendors. The data supports network mapping, troubleshooting, and configuration of management systems.

How LLDP Works

LLDP operates without establishing a formal connection or session. Devices periodically send protocol data units and store information received from neighbors.

  1. Periodic Advertisements:An LLDP-enabled device, such as a switch, router, or IP phone, periodically sends special frames called LLDPDUs (Link Layer Discovery Protocol Data Units) on active ports. Many implementations and configurations use a 30-second interval, but the value depends on the device. An entry may also be refreshed after a port-state change or during a supported fast-start procedure.
  2. Listening for Neighbors:Simultaneously, the device listens for LLDPDUs coming in from its directly connected neighbors on each port.
  3. Building a Neighbor Table:When a device receives an LLDPDU, it caches the information contained within it in a local database, often called an LLDP neighbors table or a . This table associates a specific port with the identity and capabilities of the neighbor connected to it. Management software can read the data locally or through SNMP when the device exposes the relevant MIB.
  4. Keeping Information Fresh (TTL):Each LLDPDU contains a Time To Live (TTL)value. A typical configuration uses 120 seconds, but the value depends on the transmit interval and device settings. When a neighbor's information is stored, a timer is started. If another LLDPDU does not arrive before it expires, the device treats the entry as stale and removes it from the table. This allows topology information to reflect the current state of the links. The timer is refreshed by a valid LLDPDU from that neighbor, rather than by an arbitrary frame.

Local Traffic Only

LLDP frames have link-local scope. On Ethernet they use EtherType 0x88CC and a special multicast MAC address (01:80:C2:00:00:0E) that switches and bridges do not forward. An advertisement sent by a switch therefore reaches its immediate neighbors without being flooded through the network.

The LLDP TLV Format

LLDP extensibility comes from its message format. Information within an LLDPDU is organized into blocks called TLVs (Type-Length-Value).

Each block has three fields:

  • Type (7 bits): A numeric code that identifies the kind of information being sent, such as Type 1 = Chassis ID and Type 2 = Port ID.
  • Length (9 bits): A number that specifies the length (in bytes) of the Value field. This tells the receiver exactly how much data to read for this piece of information.
  • Value (Variable):The actual information itself, such as the MAC address, the port name, or the device's IP address.

The TLV format makes the protocol extensible. A new Type code can be defined for a new kind of information. A device that does not understand it reads the Length field, skips the Value, and can continue parsing the rest of the frame.

Common TLVs

LLDP defines several standard TLVs, which are divided into mandatory and optional categories.

Mandatory TLVs

Every LLDPDU must contain these three TLVs, plus an "End of LLDPDU" marker, to be considered valid. In the standard order, Chassis ID, Port ID, and TTL come first, optional TLVs may follow, and End of LLDPDU terminates the list. This set links a station to a port and defines the lifetime of its current entry.

  • Chassis ID TLV: This identifies the device as a whole. It can be the base MAC address of a switch or router, or another chassis identifier. A neighbor uses it to distinguish stations even when a device has multiple ports.
  • Port ID TLV:This identifies the port from which the LLDPDU was sent. The value can be the interface MAC address, its configured name such as "GigabitEthernet1/0/23", or another local identifier.
  • Time to Live (TTL) TLV: This specifies how long the information remains valid, in seconds. A neighbor receiving it removes the entry after this time unless a new LLDPDU refreshes it. A value of 120 seconds is typical in many configurations, but it is not a universal setting for every device.

Optional TLVs

These TLVs provide descriptive information useful for network management but are not required for basic protocol operation. A device may transmit only some of them, depending on its implementation and configuration.

  • Port Description TLV: A human-readable text description of the port, configured by the administrator. For example: Uplink to Core-Router-01 or PC-JaneDoe-Desk.
  • System Name TLV: The device's configured hostname, e.g., ACME-Sales-SW1.
  • System Description TLV: A detailed text description of the device, often including the vendor, hardware model, and software version. Example: Cisco Catalyst 9300L Switch, Cisco IOS XE Software, Version 17.06.03.
  • System Capabilities TLV: A bitmap that indicates the primary functions the device can perform (e.g., Bridge, Router, WLAN Access Point) and which of those functions are currently enabled.
  • Management Address TLV: The device IP address that can be used for network management, for example through SNMP or SSH. Management software can use it to find and manage devices.

LLDP-MED for Voice and Video

LLDP-MED (Media Endpoint Discovery), described in ANSI/TIA-1057, extends LLDP for voice and video over IP (VoIP) devices such as IP phones and video conferencing units. It can reduce manual endpoint configuration by conveying network parameters to those devices. The extension adds organizationally specific TLVs for areas including device capabilities, network policy, power, and location.

A switch that supports LLDP-MED can use organizationally specific TLVs to provide media endpoint devices with information needed for operation. The result depends on compatibility and configuration of the phone, switch, and management system:

  • Voice VLAN: The switch can tell an IP phone which to use for voice traffic. The phone and switch can then separate voice from data traffic when their configuration supports it.
  • QoS / Traffic Priority: The switch can provide policy for marking voice packets. It can specify the value that the phone may place on its voice packets.
  • Power Management (PoE): A phone can use LLDP-MED to tell the switch how much power it requires through . The switch can include this information in its power budget and confirm the allocation.
  • Location Information:For emergency services such as E-911, the caller's physical location is important. An LLDP-MED enabled switch can be configured with location information, for example "123 Main Street, London, 4th Floor, East Wing", and provide it to the phone. A phone system can use the data during an emergency call when it supports that mechanism.

Example LLDP-MED Exchange

After an IP phone is connected to a switch, the exchange may proceed as follows.

Example: a new IP phone is connected to an office switch.

  1. Port activation: The switch port to which the phone is connected becomes active. The switch sends an LLDP-MED frame according to its configuration, including a fast-start mechanism when supported.
  2. Phone learns: The phone receives the frame and learns key information: switch name, port ID, etc.
  3. Configuration: The phone reads the LLDP-MED TLV and may configure its Voice VLAN, for example VLAN 100, and set appropriate QoS markings when it supports the received policy.
  4. Phone introduces itself: The phone sends back its own LLDP frame, identifying itself as a phone and providing its data (e.g., MAC address).
  5. Administrator visibility: The network administrator can log into the switch or management system and see: "IP Phone model XYZ, MAC address ABC" connected to port GigabitEthernet1/0/5. Software that collects LLDP data can update the topology documentation.

Related articles