Wednesday 20 September 2023

What is Link Layer Discovery Protocol (LLDP)? | How link layer discovery protocol work? | LLDP default configuration? | how to configure LLDP?

  

Link Layer Discovery Protocol

LLDP it’s a nonproprietary protocol that works at layer 2. It is an open IEEE-standard 802.1AB.  LLDP is an alternative to CDP.  LLDP runs over the data link layer and it collects information about the neighboring devices. This information will help us in troubleshooting and documentation. LLDP and Cisco CDP work similarly but the big difference is that LLDP is a standard while CDP is a Cisco proprietary.

LLDP has similar capabilities to CDP and there is an enhanced version to specifically address the voice application this version is called LLDP-MED (media endpoint discovery) but LLDP and LLDP-MED are not compatible.

LLDP supports a defined set of attributes that contain a T-type, L-length, and V-value, these are called TLVs. It is used to discover neighbors’ devices. LLDP support devices use TLV to send and receive information and store the information in a local table.





How link layer discovery protocol work?

First, you must enable it on the devices because by default LLDP is disabled, and remember not all Cisco IOS routers support LLDP. LLDP-enabled devices send LLDP advertisements to LLDP neighbors and the information is stored in the MIB database locally. This information can be accessed using SNMP.

What information is stored?

  • Device name and description
  • Port name
  • IP management address
  • Capabilities
  • MAC address
  • MDI power
  • Link aggregation
  • VLAN

 

LLDP default configuration: -

IOU1(config)#lldp ?

  holdtime    Specify the holdtime (in sec) to be sent in packets

  reinit      Delay (in sec) for LLDP initialization on any interface

  run         Enable LLDP

  timer       Specify the rate at which LLDP packets are sent (in seconds)

  tlv-select Selection of LLDP TLVs to send


  • LLDP is disabled by default
  • LLDP hold time – 120 seconds
  • LLDP reinitialization delay – 2 seconds
  • LLDP timer (packet update frequency) – 30 seconds
  • LLDP tlv-select – to send and receive all TLVs.

 

Let's see the configuration: -

 Topology; -



 

  •  configure the topology as per the diagram.
  • configure Trunk 802.1q
  • enable LLDP in global configuration mode.
  • change the hold time to 180,  reinit to 5 sec, and the timer to 20 sec.
  • clear the LLDP table.
  • disable the LLDP

 

 

 

 




Core-switch-(config)#interface range ethernet 0/1-3

Core-switch-(config-if-range)#switchport trunk encapsulation dot1q

Core-switch-(config-if-range)#switchport mode trunk

Core-switch-(config-if-range)#switchport trunk allowed vlan all

Core-switch-(config-if-range)#exit


Core-switch-(config)#interface range ethernet 1/0-1

Core-switch-(config-if-range)#switchport trunk encapsulation dot1q

Core-switch-(config-if-range)#switchport mode trunk

Core-switch-(config-if-range)#switchport trunk allowed vlan all

Core-switch-(config-if-range)#exit






Core-switch-#show lldp
% LLDP is not enabled

(By default, LLDP is disabled)


Core-switch-(config)#lldp run

switch-A-(config)#lldp run

switch-B-(config)#lldp run

switch-D-(config)#lldp run

switch-E-(config)#lldp run




Core-switch-#show lldp ?
  entry      Information for specific neighbor entry
  errors     LLDP computational errors and overflows
  interface  LLDP interface status and configuration
  neighbors  LLDP neighbor entries
  traffic    LLDP statistics
  |          Output modifiers
  <cr>


Core-switch-#show lldp entry *

Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
------------------------------------------------
Local Intf: Et1/0
Chassis id: aabb.cc00.0400
Port id: Et0/0
Port Description: Ethernet0/0
System Name: switch-E-

System Description:
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20150703)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  DSGS_PI5_POSTCOLLAPSE_TEAM_TRACK_CLONE
Technical Support: http://www.cisco.com/techsupport
Co

Time remaining: 116 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised

------------------------------------------------
Local Intf: Et1/1
Chassis id: aabb.cc00.0500
Port id: Et0/0
Port Description: Ethernet0/0
System Name: switch-A-

System Description:
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20150703)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  DSGS_PI5_POSTCOLLAPSE_TEAM_TRACK_CLONE
Technical Support: http://www.cisco.com/techsupport
Co

Time remaining: 97 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised

------------------------------------------------
Local Intf: Et0/2
Chassis id: aabb.cc00.0600
Port id: Et0/0
Port Description: Ethernet0/0
System Name: switch-D-

System Description:
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(2)T4, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Thu 08-Oct-15 21:21 by prod_rel_te

Time remaining: 111 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised

------------------------------------------------
Local Intf: Et0/1
Chassis id: aabb.cc00.0100
Port id: Et0/0
Port Description: Ethernet0/0
System Name: switch-B-

System Description:
Cisco IOS Software, Linux Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Version 15.2(CML_NIGHTLY_20150703)FLO_DSGS7, EARLY DEPLOYMENT DEVELOPMENT BUILD, synced to  DSGS_PI5_POSTCOLLAPSE_TEAM_TRACK_CLONE
Technical Support: http://www.cisco.com/techsupport
Co

Time remaining: 104 seconds
System Capabilities: B,R
Enabled Capabilities: R
Management Addresses - not advertised
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised


Total entries displayed: 4


(Total entries we have 4 and we have all the information about our neighbor)



Core-switch-#show lldp errors

LLDP errors/overflows:
    Total memory allocation failures: 0
    Total encapsulation failures: 0
    Total input queue overflows: 0
    Total table overflows: 0

(Show lldp errors help to find the errors)



Core-switch-#show lldp interface ethernet 1/1

Ethernet1/1:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE
    Rx state: WAIT FOR FRAME

(show lldp interface command help us to find enable service)


Core-switch-#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
switch-E-           Et1/0          120        R               Et0/0
switch-A-           Et1/1          120        R               Et0/0
switch-D-           Et0/2          120        R               Et0/0
switch-B-           Et0/1          120        R               Et0/0

Total entries displayed: 4

(Show lldp neighbor command show us the device ID, port interface, hold time, capability and end port ID)




Core-switch-#show lldp traffic

LLDP traffic statistics:
    Total frames out: 544
    Total entries aged: 0
    Total frames in: 74
    Total frames received in error: 0
    Total frames discarded: 0
    Total TLVs discarded: 0
    Total TLVs unrecognized: 0

(Show lldp traffic command used to find statistics)

(Change the holdtime from the default 120 seconds to 25 seconds.)


Core-switch-#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
switch-E-           Et1/0          120        R               Et0/0
switch-A-           Et1/1          120        R               Et0/0
switch-D-           Et0/2          120        R               Et0/0
switch-B-           Et0/1          120        R               Et0/0

(change the hold time to 180,  reinit to 5 sec, and the timer to 20 sec.)



Core-switch-(config)#lldp holdtime 180
Core-switch-(config)#lldp reinit 5
Core-switch-(config)#lldp timer 20
Core-switch-(config)#exit




Core-switch-#show lldp

Global LLDP Information:
    Status: ACTIVE
    LLDP advertisements are sent every 20 seconds
    LLDP hold time advertised is 180 seconds
    LLDP interface reinitialisation delay is 5 seconds



Core-switch-#clear lldp table
Core-switch-#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

Total entries displayed: 0

(Disable the LLDP)



Core-switch-(config)#no lldp run
Core-switch-(config)#end

Core-switch-#show lldp
% LLDP is not enabled


(I hope you like this post, if you do, please visit our YouTube channel)
















1 comment:

thetechfirm said...

i enjoyed the article and featured it today on www.networkdatapedia.com
https://www.networkdatapedia.com/post/great-article-about-link-layer-discovery-protocol-lldp-by-edgar-francis

cheers

What is layer 3 etherchannel? How to configure layer 3 etherchannel?

EtherChannel technology allows us to bundle multiple physical links into one logical link. It is used to increase the bandwidth and provide ...