LLDP - Link Layer Discovery Protocol ====================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is LLDP?** LLDP stands for Link Layer Discovery Protocol. It’s a vendor-neutral Layer 2 protocol used by network devices to advertise their identity and capabilities to directly connected devices. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is LLDP useful?** Without LLDP, network administrators would have to manually trace cables or log into devices to identify what’s connected where. LLDP simplifies network mapping, troubleshooting, and management by automatically sharing device information. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works** * Device sends LLDP advertisements – Each LLDP-enabled device periodically sends out LLDP Data Units (LLDPDUs) on its interfaces. * Neighbor receives and stores info – Connected devices receive these messages and store the information in a neighbor table. * Information includes – Device name, port ID, capabilities, IP address, and more. * Network management tools – Can query this data to build a topology map of the network. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is LLDP used?** * Enterprise networks – For automatic device discovery and documentation. * Data centers – To manage complex interconnections between switches, servers, and routers. * VoIP deployments – Phones use LLDP to learn VLAN and QoS settings from switches. * Multi-vendor environments – Since LLDP is standards-based, it works across different brands. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI layer does this protocol belong to?** * LLDP operates at the Data Link Layer (Layer 2). * It uses Ethernet frames with EtherType 0x88CC. * It does not require IP addressing or higher-layer protocols. * It only communicates with directly connected neighbors. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What are the key features of LLDP?** * Vendor-Neutral Standard * Neighbor Discovery * TLV Structure (Type-Length-Value) .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is LLDP-MED?** LLDP-MED is an extension to LLDP used mainly in VoIP and telephony, defined in ANSI/TIA-1057. It provides: * Network policy (voice VLAN, DSCP) * Location data (for 911 services) * Inventory management .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What type of devices support LLDP?** * Switches * Routers * Wireless access points * IP phones * Servers .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What information does LLDP share?** Each LLDP message (called an LLDPDU) includes: * Device name (System Name) * Port ID (interface name/number) * System description * Port description * MAC address * VLAN info * Capabilities (e.g., bridge, router, etc.) * Management IP address .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How long is LLDP information retained?** * The default Time to Live (TTL) is 120 seconds. * If no LLDP messages are received within TTL, the neighbor entry is removed. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is the working flow of LLDP?** * LLDP is enabled on a device * Devices like switches, routers, or servers have LLDP service running. * On Linux, the `lldpd` service does this. LLDP gathers local details such as: * Device name * Port number * System description * VLAN info * Management IP * Capabilities LLDP sends LLDPDU messages: * Sent every 30 seconds by default * Broadcast in Ethernet frames using reserved multicast MAC: `01:80:C2:00:00:0E` Neighbor devices receive and store: * Devices that support LLDP listen for LLDPDUs * Store received neighbor data in an LLDP table * If no LLDP messages are received within TTL, the entry is removed .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Is LLDP suitable for real-time applications?** No, LLDP is intended for network discovery and management purposes. It is **not** designed for real-time traffic such as voice, video, or live data streaming. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Is LLDP Windows specific?** No. * LLDP is a vendor-neutral standard protocol. * It is implemented on many operating systems and network devices including Windows. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Is LLDP Linux specific?** No. * LLDP is not Linux specific. * Linux supports LLDP through tools like lldpd and OpenLLDP. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which Transport Protocol is used by LLDP?** * LLDP operates at the Data Link Layer (Layer 2). * It uses Ethernet frames directly, not a transport layer protocol like TCP or UDP. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which Port is used by LLDP?** * LLDP does not use network ports. * It uses a dedicated Ethernet multicast MAC address: 01:80:C2:00:00:0E. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Is LLDP using Client server model?** No. * LLDP uses a peer-to-peer model. * Network devices advertise their identity and capabilities directly to neighbors. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`LLDP Version&IEEE Details ` * :ref:`LLDP Basic Setup on Ubuntu ` * :ref:`LLDP Protocol Packet Details ` * :ref:`LLDP Usecases ` * :ref:`LLDP Basic Features ` * :ref:`LLDP Feature : Vendor Neutral Protocol ` * :ref:`LLDP Feature : Uses TLV Structure ` * :ref:`LLDP Feature : Layer 2 Protocol ` * :ref:`LLDP Feature : Periodic Advertisements ` * :ref:`LLDP Feature : One Way Communication ` * :ref:`LLDP Feature : Supports Optional TLVs ` * :ref:`LLDP Feature : Low Overhead ` * :ref:`LLDP Feature : Fast Link Detection ` * :ref:`LLDP Feature : Supports Multiple Neighbors ` * :ref:`LLDP Feature : Extensible For Custom ` * :ref:`Reference links ` .. _LLDP_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _LLDP_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _LLDP_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _LLDP_step5: .. tab-set:: .. tab-item:: LLDP Version&IEEE Details .. csv-table:: :file: ./LLDP/LLDP_IEEE.csv :widths: 10,10,10,30,40 :header-rows: 1 .. _LLDP_step20: .. tab-set:: .. tab-item:: LLDP Basic Setup on Ubuntu **LLDP Basic Test Case** * To verify that the LLDP daemon is correctly advertising local device information and receiving neighbor information. * Step-1: Install the LLDP daemon .. code-block:: shell test:~$sudo apt update test:~$sudo apt install lldpd -y * Step-2: Start and Enable the LLDP daemon .. code-block:: shell test:~$sudo systemctl start lldpd test:~$sudo systemctl enable lldpd * Step-3: Verfiy whether LLDP is running or not. .. code-block:: shell test:~$sudo lldpcli show configuration Global configuration: Configuration: Transmit delay: 30 Transmit delay in milliseconds: 30000 Transmit hold: 4 Maximum number of neighbors: 32 Receive mode: no Pattern for management addresses: (none) Interface pattern: (none) Permanent Interface pattern: (none) Interface pattern for chassis ID: (none) Override chassis ID with: (none) Override description with: (none) Override platform with: Linux Override system name with: (none) Override system capabilities: no Advertise version: yes Update interface descriptions: по Promiscuous mode on managed interfaces: no Disable LLDP-MED inventory: yes LLDP-MED fast start mechanism: yes LLDP-MED fast start interval: 1 Source MAC for LLDP frames on bond slaves: local Port ID TLV subtype for LLDP frames: unknown Agent type: unknown .. code-block:: shell test:~$sudo systemctl status lldpd 11dpd.service LLDP daemon Loaded: loaded (/usr/lib/systemd/system/11dpd.service; enabled; preset: enabled) Drop-In: /etc/systemd/system/11dpd.service.d Active: active (running) since Sun 2025-08-03 04:57:22 UTC; 1 day 6h ago Docs: man:11dpd(8) Main PID: 712 (11dpd) Tasks: 2 (limit: 2267) Memory: 9.31 (peak: 9.9M) CPU: 1.380s CGroup: /system.slice/1ldpd.service 712"11dpd: monitor." 721 "11dpd: 2 neighbors." * Step-4: Check local LLDP information being advertised. .. code-block:: shell test:~$sudo lldpcli show chassis Local chassis: Chassis: ChassisID:mac 08:00:27:4a:81:10 SysName:gayatrib SysDescr:Ubuntu 24.04.2 LTS Linux 6.8.0-64-gener ic #67-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 15 20:23:31 UTC 2025 x86 64 MgmtIP:192.168.2.1 MgmtIface:3 MgmtIP:fe80::a00:27ff:feda: 8110 MgmtIface:2 Capability:Bridge, off Capability:Router, off Capability:Wlan, off Capability:Station, on * Step-5: Check LLDP neighbors (from other connected LLDP-enabled devices). .. code-block:: shell test:~$sudo lldpcli show neighbors * Step-6: * Expected result: * This LLDP captures LLDP Data Units (LLDPDUs) on the wire. * Wireshark captures: * LLDP frames are visible every ~30 seconds. * Frames show local system name, port ID, TTL, and optional fields. * Step-7: Wireshark Capture. :download:`Download wireshark capture ` **LLDP Basic Setup Test Case using SNMP** * To verify that the SNMP manager can successfully retrieve LLDP data (e.g., local system name via LLDP MIB) from the SNMP agent using an SNMP GET request. * Step-1: Install SNMP tools, agent, and LLDP daemon on the device. .. code-block:: shell test:~$ sudo apt update test:~$ sudo apt install snmp snmpd lldpd -y * Step-2: Configure the SNMP agent to allow access and enable AgentX. .. code-block:: shell test:~$ sudo nano /etc/snmp/snmpd.conf # Ensure these lines exist: agentAddress udp:161,udp6:[::1]:161 rocommunity public master agentx # Save and exit. * Step-3: Restart the SNMP service. .. code-block:: shell test:~$ sudo systemctl restart snmpd test:~$ sudo systemctl enable snmpd * Step-4: Start the LLDP daemon in SNMP subagent mode. .. code-block:: shell test:~$ sudo lldpd -x -d # `-x` enables AgentX support so LLDP info can be fetched via SNMP. * Step-5: Use `snmpwalk` or `snmpget` to query LLDP MIB objects (e.g., system name via LLDP). .. code-block:: shell test:~$ snmpwalk -v2c -c public localhost 1.0.8802.1.1.2.1.3.2.0 # This OID corresponds to lldpLocSysName.0 * Step-6: Capture the SNMP traffic using Wireshark during the request. * Expected result: * The SNMP agent responds with the correct LLDP system name. * Wireshark captures: * An SNMP get-request or get-next-request packet from the manager to the agent. * An SNMP response from the agent with LLDP information (e.g., system name from LLDP daemon). * Step-7: Wireshark Capture. :download:`Download wireshark capture ` .. _LLDP_step6: .. tab-set:: .. tab-item:: LLDP Protocol Packet Details **LLDP CHASSIS ID TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_Chassis_ID_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP PORT ID TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_PORT_ID_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP TIME TO LIVE TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_Time_to_Live_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP SYSTEM NAME TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_System_Name_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP SYSTEM DESCRIPTION TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_System_Description_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP SYSTEM CAPABILITIES TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_System_Capabilities_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP MANAGEMENT ADDRESS TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_Management_address_TLV_Header_Packet.csv :widths: 10,20,30,40 :header-rows: 1 **LLDP END OF LLDPDU TLV Packet** .. csv-table:: :file: ./LLDP/LLDP_End_of_LLDPDU_TLV_Packet.csv :widths: 10,20,30,40 :header-rows: 1 .. _LLDP_step7: .. tab-set:: .. tab-item:: LLDP Usecases .. csv-table:: :file: ./LLDP/LLDP_Use_Cases.csv :widths: 10,20,30 :header-rows: 1 .. _LLDP_step8: .. tab-set:: .. tab-item:: LLDP Basic Features .. csv-table:: :file: ./LLDP/LLDP_Features.csv :widths: 10,10,30 :header-rows: 1 .. _LLDP_step9: .. tab-set:: .. tab-item:: LLDP Feature : Vendor Neutral Protocol **Vendor Neutral Protocol - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature1_Vendor_Neutral_Protocol_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step10: .. tab-set:: .. tab-item:: LLDP Feature : Uses TLV Structure **Uses TLV Structure - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature2_Uses_TLV_Structure_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step11: .. tab-set:: .. tab-item:: LLDP Feature : Layer 2 Protocol **Layer 2 Protocol - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature3_Layer2_Protocol_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step12: .. tab-set:: .. tab-item:: LLDP Feature : Periodic Advertisements **Periodic Advertisements - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature4_Periodic_Advertisements_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step13: .. tab-set:: .. tab-item:: LLDP Feature : One Way Communication **One Way Communication - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature5_One_Way_Communication_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step14: .. tab-set:: .. tab-item:: LLDP Feature : Supports Optional TLVs **Support Optional TLVs - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature6_Supports_optional_TLVs_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step15: .. tab-set:: .. tab-item:: LLDP Feature : Low Overhead **Low Overheaad - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature7_LowOverhead_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step16: .. tab-set:: .. tab-item:: LLDP Feature : Fast Link Detection **Fast Link Detection - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature8_Fast_link_Detection_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step17: .. tab-set:: .. tab-item:: LLDP Feature : Supports Multiple Neighbors **Supports Multiple Neighbors - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature9_Supports_Multiple_Neighbors_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step18: .. tab-set:: .. tab-item:: LLDP Feature : Extensible For Custom **Extensible For Custom - Testcases** .. csv-table:: :file: ./LLDP/LLDP_Feature10_Extensible_for_Custom_Test_Cases.csv :widths: 10,10,30,20 :header-rows: 1 .. _LLDP_step19: .. tab-set:: .. tab-item:: Reference links * Reference links