LLDP is a standardized network discovery protocol (IEEE 802.1AB) designed to supplement the multitude of proprietary protocols of the same type (Cisco Discovery Protocol, Nortel Discovery Protocol, etc.) and to allow equipment of different manufacturers to discover mutually. 

Introduction
LLDP is defined by the IEEE 802.1AB standard. It is a protocol of the data link layer of the OSI model (protocol of level 2). This means that LLDP is directly conveyed in a frame. It is designed to work on IEEE 802 networks (Ethernet, ...). As for CDP, it is a simple transmission of messages at regular intervals (This is not a bidirectional communication). 

LLDP messages carry the sweet name of LLDPDU. Each of these messages consists of a series of structures called TLV (Type-Length-Value) used to contain the information. 

LLDPDUs are sent to a special destination MAC address that is not forwarded by the switches (0180.c200.000e, 0180.c200.0003 or 0180.c200.0000), which means that, like CDP, LLDP is used to communicate through a link only. From equipment to equipment. 

LLDP has its own Ether Type (0x88CC) which is indicated in the "Type" field of the Ethernet frame.
Structure of the LLDPDU 
LLDPDU
LLDPDU
  • DMAC: Destination MAC address (0180.c200.000e, 0180.c200.0003 or 0180.c200.0000).
  • SMAC: MAC address of the sending machine.
  • TYPE: 0x88CC.
  • TLV1: Chassis ID, identifier of the machine.
  • TLV2: Port ID, identifies the port from which the LLDPDU is issued.
  • TLV3: TTL TLV, Indicates the viewing time of the LLDPDU.
  • TLVx: Additional optional TLVs.
  • ENDTLV: Indicates the end of the TLVs in the LLDPDU.
Structure of a TLV
 
TLV
TLV
  • TLV Type (7 bits): indicates the nature of the TLV.
  • TLV Length (9 bits): Indicates the length of the information.
  • TLV String (0-511 bytes): TLV information.
Main TLVs
  • Chassis ID (Type 1): Identifies the transmitter machine (required).
  • Port ID (Type 2): The port ID from which the LLDPDU is issued (mandatory).
  • TTL TLV (Type 3): Indicates the lifetime of the LLDPDU (required).
  • Port Description (Type 4): Text description of the port (optional).
  • System Name (Type 5): Name of the emitting machine (optional).
  • System Description (Type 6): Description of the emitting machine (optional).
  • System Capabilities (Type 7): Features of the emitting machine (optional).
  • Management Address (Type 8): Machine management IP address (optional).
LLDP-MED (LLDP for Media Endpoint Devices)
LLDP-MED is an extension of LLDP used to communicate with terminal equipment (VoIP phones for example), which provides additional TLVs to support PoE (Power Over Ethernet) information, device location, fonts Network access (VLAN information, etc.), or inventory management (equipment model, software version, serial number, ...). On Cisco devices, LLDP-MED is active when using LLDP.
LLDP default settings (for Cisco devices)
  • LLDP Initial State: Disabled
  • LLDP Initial State: Disabled
  • LLDP Holdtime (TTL): 120 seconds
  • LLDP Timer: 30 seconds (interval between two LLDPDUs)
  • LLDP init delay: 2 seconds (waiting time before first sending to an interface)
  • LLDP tlv-select: disabled (all TLVs are sent by default)
  • LLDP med-tlv-select: disabled (all special TLVs are sent by default)
Availability of LLDP on Cisco devices
LLDP is a fairly recent protocol and is therefore implemented on fairly recent platforms.
For IOS type plateforms:
  • On the switch side, it can be found from the WS-C2960, WS-C3560, WS-C3750 and ME3400 from version 12.2 (37) SE for all licenses combined.
  • On the router side, an IOS version 15.2M is required for common platforms and therefore only in the last generation, such as the 1900, 2900, 3900 series or the smaller 880 and 890 series.
LLDP Basic Configuration
Let's start by checking the initial state of LLDP in a default configuration ...

3750-1#show lldp
% LLDP is not enabled
3750-1#

As expected LLDP is disabled by default. Let's turn it on ... and see what changes. 


3750-1#configure terminal
3750-1(config)#lldp run
3750-1(config)#end
3750-1#show lldp 

Global LLDP Information:
Status: ACTIVE
LLDP advertisements are sent every 30 seconds
LLDP hold time advertised is 120 seconds
LLDP interface reinitialisation delay is 2 seconds
3750-1#

LLDP is now active with a default timer of 30 seconds, a lifetime of the LLDPDUs of 120 seconds and a delay of initialization on interfaces of 2 seconds.
What about interfaces? Are they active or not? 

3750-1#show lldp interface

FastEthernet1/0/1:
    Tx: enabled
    Rx: enabled
    Tx state: INIT
    Rx state: WAIT PORT OPER

FastEthernet1/0/2:
    Tx: enabled
    Rx: enabled
    Tx state: INIT
    Rx state: WAIT PORT OPER
 
 ....

Enabling LLDP globally also activates all possible interfaces!
But does the switch really discuss? To check, let's plug another switch to it (with LLDP activated in the same way). 

3750-1#debug lldp packets
LLDP packet info debugging is on
3750-1#
*Mar  1 00:44:50.989: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up
*Mar  1 00:44:51.996: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
3750-1#
*Mar  1 00:45:20.836: LLDP advertisement packet RX'd on intf FastEthernet1/0/1
*Mar  1 00:45:20.920: LLDP advertisement packet TX'd on intf FastEthernet1/0/1
3750-1#

The interface passes UP / UP, the time that Spanning-Tree does its job and hop, the first LLDPDU are exchanged!
Let's look at what the result looks like ... 

3750-1#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
3750-2              Fa1/0/1        120        B               Fa3/0/1

Total entries displayed: 1

3750-1#

Note that the display looks very similar to that of CDP and the information is almost identical! "Show lldp neighbors" thus displays a simplified list of directly connected neighbors. As for CDP we can display detailed information for all neighbors (in this case there is only one) ... 

3750-1#show lldp neighbors detail
------------------------------------------------
Chassis id: 001b.d59e.3100<= Adresse MAC principale du switch (TLV Chassis ID)
Port id: Fa3/0/1<= Port émetteur, donc celui du voisin (TLV Port ID)
Port Description: FastEthernet3/0/1<= Nom complet de l'interface du voisin (TLV Port description)
System Name: 3750-2<= Hostname du voisin (TLV System Name)

System Description:
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE7, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Mon 28-Jan-13 10:16 by prod_rel_team

Time remaining: 97 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
Vlan ID: 1


Total entries displayed: 1

3750-1#

Again, this looks very similar to the CDP display, however, the information displayed is for the LLDPDU transmitter ... this also applies to the interface displayed. Beware of confusion!
It is also possible to display detailed information for a single device by specifying its Hostname. 

3750-1#show lldp entry 3750-2

Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
------------------------------------------------
Chassis id: 001b.d59e.3100
Port id: Fa3/0/1
Port Description: FastEthernet3/0/1
System Name: 3750-2

System Description:
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE7, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Mon 28-Jan-13 10:16 by prod_rel_team

Time remaining: 94 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
Vlan ID: 1


Total entries displayed: 1
3750-1#

As for CDP, it is possible to have statistics concerning the number of messages sent and received, the number of errors etc ...

3750-1#show lldp traffic

LLDP traffic statistics:
    Total frames out: 78  <= LLDPDU envoyés
    Total entries aged: 0  <= LLDPDU expirés
    Total frames in: 78   <= LLDPDU reçus
    Total frames received in error: 0   <= Erreurs à la réception
    Total frames discarded: 0           <= Trames rejetées
    Total TLVs discarded: 0             <= TLVs rejetés
    Total TLVs unrecognized: 0          <= TLVs inconnus
3750-1#

To view the status of LLDP on interfaces ... 

3750-1#show lldp interface

FastEthernet1/0/1:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE   <= En attente d'émission (l'interface est fonctionelle)
    Rx state: WAIT FOR FRAME  <= En attente de réception

FastEthernet1/0/2:
    Tx: enabled
    Rx: enabled
    Tx state: INIT   <= En attente d'initialisation de l'interface (rien n'est connecté)
    Rx state: WAIT PORT OPER        <= En attente d'initialisation de l'interface (rien n'est connecté)
 
 ...

To view the LLDP status of a specific interface ...

3750-1#show lldp interface fastEthernet 1/0/1

FastEthernet1/0/1:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE
    Rx state: WAIT FOR FRAME
3750-1#

Setting LLDP
Global activation of LLDP 

3750-1(config)#lldp run

Global deactivation of LLDP

3750-1(config)#no lldp run

Configure the interval between two LLDPDUs (10 seconds for example). You can choose between 5 and 65534 seconds. 

3750-1(config)#lldp timer 10

Configure the lifetime of sent LLDPDUs (eg 60 seconds). You can set a lifetime from 0 to 65535 seconds.

3750-1(config)#lldp holdtime 60

Configure the LLDP initialization delay, (eg 4 seconds). Value between 2 and 5 seconds. 

3750-1(config)#lldp reinit 4

By default LLDP transmits all available TLVs. But you can choose to restrict this by defining which ones to propagate.
Repeat the order for each TLV. Once a TLV is chosen, the equipment will only propagate itself (and those that you will configure later). 

3750-1(config)#lldp tlv-select ?
  mac-phy-cfg          IEEE 802.3 MAC/Phy Configuration/status TLV
  management-address   Management Address TLV
  port-description     Port Description TLV
  port-vlan            Port VLAN ID TLV
  power-management     IEEE 802.3 DTE Power via MDI TLV
  system-capabilities  System Capabilities TLV
  system-description   System Description TLV
  system-name          System Name TLV

3750-1(config)#

To send all TLVs, you have to cancel the various "lldp tlv select" entries.
Specific setting of LLDP to an interface
Enable LLDPDUs 

3750-1(config-if)#lldp transmit

 Disable LLDPDUs 

3750-1(config-if)#no lldp transmit

Enable LLDPDUs

3750-1(config-if)#lldp receive

Disable LLDPDUs

3750-1(config-if)#no lldp receive
 
Note that by default, interfaces send and receive LLDPDUs after LLDP is enabled globally.
You can also set the TVLs but also the MED-TLVs to be transmitted via the interface. For example: 

3750-1(config-if)#lldp tlv-select ?
  power-management  IEEE 802.3 DTE Power via MDI TLV

And…

3750-1(config-if)#lldp med-tlv-select ?
  inventory-management  LLDP MED Inventory Management TLV
  location              LLDP MED Location TLV
  network-policy        LLDP MED Network Policy TLV
  power-management      LLDP MED Power Management TLV

To conclude
Like many standardized protocols, LLDP inherits almost all of its features from its proprietary predecessors. But its implementation is more global, it will replace CDP with ease.
Where Cisco has clearly thought of us, it is in its implementation. Are you using CDP? So change a keyword in the command and you know how to use LLDP! ("Show cdp neighbors" or "show lldp neighbors" ... what difference?).

0 comments:

Post a Comment

 
Top