The Link Layer Discovery Protocol (LLDP) is a crucial networking protocol used to discover the topology of a network and identify changes in it. LLDP allows devices to communicate their local information to neighboring devices by encapsulating this data into LLDP Data Units (LLDPDUs). This protocol is instrumental for network management, monitoring, and troubleshooting.
LLDP supports four different operational modes:
- txrx: The device both transmits and receives LLDP packets.
- tx: The device only transmits LLDP packets.
- rx: The device only receives LLDP packets.
- disable: The device neither transmits nor receives LLDP packets.
By default, a device operates in the `txrx` mode, which allows for both sending and receiving LLDP packets.
LLDP Packet Transmission Mechanism
When LLDP is active in txrx or tx mode, packet transmission can be triggered by:
- Timer Expiry: LLDPDUs are transmitted when the timer associated with the local Management Information Base (MIB) expires to prevent the TTL of information in remote systems from expiring.
- Local MIB Changes: Changes in the local MIB trigger immediate LLDPDU transmission to ensure updates are promptly communicated.
- New Neighbor Detection: When a new neighbor is identified, LLDPDU packets are sent rapidly (default of 4 packets in 1 second) to quickly update neighbor information.
LLDP supports two packet types:
- Standard LLDP Packet: Contains management and configuration information of the local device.
- Shutdown Packet: Transmitted when LLDP mode is disabled or an interface is shut down, marking neighbor information as invalid with TTL set to 0.
LLDP Packet Receiving Mechanism
For devices in txrx or rx mode, receiving LLDP packets involves:
- Frame Identification: Verifies the frame’s destination is the LLDP multicast MAC address and that the frame type is LLDP.
- Frame Verification: Checks TLVs (Type-Length-Value) in the following sequence: Chassis ID TLV, Port ID TLV, and Time to Live TLV. Valid TLVs are decoded until the End of LLDPDU TLV is reached.
- Neighbor Information Update: The system updates or saves the neighbor information based on the received data, with TTL values determining how long the information is valid.
How to Check LLDP Mode
To check the current LLDP mode of your interfaces, use the command:
This command displays the LLDP work mode for each interface, allowing you to verify the current settings.
How to Change LLDP Mode
To change the LLDP mode for a specific interface, use the following command:
sudo config lldp mode set interface_name work_mode
To set into disabled mode on interface Ethernet101 we can use the following configuration-
sudo config lldp mode set Ethernet101 disable
To Verify Changes:
You can use the following commands to confirm the LLDP mode settings:
- show lldp mode: Displays the LLDP mode of each interface.
- show lldp neighbor [port-name]: Provides current neighbor information for a specific port.
- show lldp table: Shows a summary of neighbor information.
Comments
0 comments
Please sign in to leave a comment.