Saturday, February 22, 2020

Link Layer Discovery Protocol (LLDP)

LLDP is a layer two discovery protocol, similar to Cisco’s CDP. The big difference between the two is that LLDP is a standard while CDP is a Cisco proprietary protocol.
Cisco devices support the IEEE 802.1ab version of LLDP. This allows non-Cisco devices to advertise information about themselves to our network devices.
LLDP uses attributes that contain a type, length and value descriptions. These are called TLVs (Type, Length, Value). Devices that support LLDP use TLVs to send and receive information to their directly connected neighbors. Here’s an example of some basic TLVs:
  • Port description TLV
  • System name TLV
  • System description TLV
  • System capabilities TLV
  • Management Address TLV
Some network end devices (like IP Phones) can use LLDP for VLAN assignment or PoE (Power over Ethernet) requirements. To accomplish this, an enhancement was made which is called MED (Media Endpoint Discovery). This is typically known as LLDP-MED.
Configuration of LLDP is really simple, depending on your switch and IOS version it might be enabled or disabled by default. Let’s take a look at an example:
sw1-sw2
I have two Cisco Catalyst 3560 switches, directly connected to each other. LLDP is disabled by default on these switches so let’s enable it:
SW1, SW2
(config)#lldp run
This enables LLDP globally on all interfaces. After a couple of seconds we can see something:
SW1#show lldp neighbors

Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID           Local Intf     Hold-time  Capability      Port ID
SW2                 Fa0/24         120        B               Fa0/24

Total entries displayed: 1
This output looks very similar to CDP. We can also take a detailed look at our neighbor:
SW1#show lldp neighbors detail


Chassis id: 0011.bb0b.361a
Port id: Fa0/24
Port Description: FastEthernet0/24
System Name: SW2.cisco.com

System Description:
Cisco IOS Software, C3560 Software (C3560-ADVIPSERVICESK9-M), Version 12.2(46)SE, RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Thu 21-Aug-08 15:26 by nachen

Time remaining: 106 seconds
System Capabilities: B,R
Enabled Capabilities: B
Management Addresses - not advertised
Auto Negotiation - supported, enabled
Physical media capabilities:
    100base-TX(FD)
    100base-TX(HD)
    10base-T(FD)
    10base-T(HD)
Media Attachment Unit type: 16
---------------------------------------------


Total entries displayed: 1
Above you can see some details about SW2, it’s hostname, platform, IOS version, capabilities etc. One little extra that LLDP offers is that it also sends interface descriptions. Here’s an example:
SW1(config)#interface FastEthernet 0/24
SW1(config-if)#description LINK_SW1_SW2
This description will show up if we look on SW2:
SW2#show lldp neighbors detail


Chassis id: 0019.569d.571a
Port id: Fa0/24
Port Description: LINK_SW1_SW2
System Name: SW1.cisco.com
hostname SW1
!
interface FastEthernet 0/24
 description LINK_SW1_SW2
!
lldp run
!
end
hostname SW2
!
lldp run
!
end

Hopefully this example has helped to understand LLDP and how to enable it on your Cisco devices. If you have any questions, feel free to leave a comment!

No comments:

Post a Comment