Configuring LLDP

This section includes the following configuration topics for LLDP:

Link Layer Discovery Protocol (LLDP)

Cisco Discovery Protocol (CDP) is a device discovery protocol that runs over Layer 2. Layer 2 is also known as the data link layer that runs on all Cisco-manufactured devices, such as routers, bridges, access servers, and switches. CDP allows the network management applications to automatically discover and learn about other Cisco devices that connect to the network.

To support non-Cisco devices and to allow for interoperability between other devices, it also supports the IEEE 802.1AB LLDP. LLDP is also a neighbor discovery protocol that is used for network devices to advertise information about themselves to other devices on the network. This protocol runs over the data link layer, which allows two systems running different network layer protocols to learn about each other.

With LLDP, you can also access the information about a particular physical network connection. If you use a non-Cisco monitoring tool (via SNMP,) LLDP helps you identify the Object Identifiers (OIDs) that the system supports. The following are the supported OIDs:
  • 1.0.8802.1.1.2.1.4.1.1.4

  • 1.0.8802.1.1.2.1.4.1.1.5

  • 1.0.8802.1.1.2.1.4.1.1.6

  • 1.0.8802.1.1.2.1.4.1.1.7

  • 1.0.8802.1.1.2.1.4.1.1.8

  • 1.0.8802.1.1.2.1.4.1.1.9

  • 1.0.8802.1.1.2.1.4.1.1.10

  • 1.0.8802.1.1.2.1.4.1.1.11

  • 1.0.8802.1.1.2.1.4.1.1.12

LLDP Frame Format

LLDP frames use the IEEE 802.3 format, which consists of the following fields:

  • Destination address (6 bytes)—Uses a multicast address of 01-80-C2-00-00-0E.

  • Source address (6 bytes)—MAC address of the sending device or port.

  • LLDP Ethertype (2 bytes)—Uses 88-CC.

  • LLDP PDU (1500 bytes)—LLDP payload consisting of TLVs.

  • FCS (4 bytes)—Cyclic Redundancy Check (CRC) for error checking.

LLDP TLV Format

LLDP TLVs carry the information about neighboring devices within the LLDP PDU using the following basic format:

  • TLV Header (16 bits), which includes the following fields:

    • TLV Type (7 bits)

    • TLV Information String Length (9 bits)

  • TLV Information String (0 to 511 bytes)

LLDP Operation

LLDP is a one-way protocol. The basic operation of LLDP consists of a device enabled for transmit of LLDP information sending periodic advertisements of information in LLDP frames to a receiving device.

Devices are identified using a combination of the Chassis ID and Port ID TLVs to create an MSAP (MAC Service Access Point). The receiving device saves the information about a neighbor for a certain amount time specified in the TTL TLV, before aging and removing the information.

LLDP supports the following additional operational characteristics:

  • LLDP can operate independently in transmit or receive modes.

  • LLDP operates as a slow protocol using only untagged frames, with transmission speeds of less than 5 frames per second.

  • LLDP packets are sent when the following occurs:

    • The packet update frequency specified by the lldp timer command is reached. The default is 30 seconds.

    • When a change in the values of the managed objects occurs from the local system’s LLDP MIB.

    • When LLDP is activated on an interface (3 frames are sent upon activation similar to CDP).

  • When an LLDP frame is received, the LLDP remote services and PTOPO MIBs are updated with the information in the TLVs.

  • LLDP supports the following actions on these TLV characteristics:

    • Interprets a TTL value of 0 as a request to automatically purge the information of the transmitting device. These shutdown LLDPDUs are typically sent prior to a port becoming inoperable.

    • An LLDP frame with a malformed mandatory TLV is dropped.

    • A TLV with an invalid value is ignored.

    • A copy of an unknown organizationally-specific TLV is maintained if the TTL is non-zero, for later access through network management.

Supported LLDP Functions

  • IPv4 and IPv6 management addresses—In general, both IPv4 and IPv6 addresses will be advertised if they are available, and preference is given to the address that is configured on the transmitting interface.

    If the transmitting interface does not have a configured address, then the TLV will be populated with an address from another interface. The advertised LLDP IP address is implemented according to the following priority order of IP addresses for interfaces on the router:

    • Locally configured address

    • MgmtEth0/RP0/CPU0/0

    • MgmtEth0/RP0/CPU0/1

    • Loopback interfaces

      There are some differences between IPv4 and IPv6 address management in LLDP:

  • For IPv4, as long as the IPv4 address is configured on an interface, it can be used as an LLDP management address.

  • For IPv6, after the IPv6 address is configured on an interface, the interface status must be Up and pass the DAD (Duplicate Address Detection) process before it is can be used as an LLDP management address.

  • LLDP is supported for the nearest physically attached and tunneled neighbors.

  • Port ID TLVs are supported for Ethernet interfaces, subinterfaces, bundle interfaces, and bundle subinterfaces.

Unsupported LLDP Functions

These LLDP functions are not supported:

  • LLDP-MED organizationally unique extension—However, interoperability still exists between other devices that do support this extension.

  • LLDP TLVs cannot be disabled on a per-interface basis; However, certain optional TLVs can be disabled globally.

  • LLDP SNMP trap lldpRemTablesChange.

Enabling LLDP Per Interface

When you enable LLDP globally, all interfaces that support LLDP are automatically enabled for both transmit and receive operations. However, if you want to enable LLDP per interface, perform the following configuration steps:

  1. RP/0/RSP0/CPU0:router(config)# int gigabitEthernet 0/2/0/0

  2. RP/0/RSP0/CPU0:router(config-if)# no sh

  3. RP/0/RSP0/CPU0:router(config-if)#commit

  4. RP/0/RSP0/CPU0:router(config-if)#lldp ?

  5. RP/0/RSP0/CPU0:router(config-if)#lldp enable

  6. RP/0/RSP0/CPU0:router(config-if)#commit

Running configuration

RP/0/RSP0/CPU0:router#sh running-config  
Wed Jun 27 12:40:21.274 IST
Building configuration...
!! IOS XR Configuration 0.0.0
!! Last configuration change at Wed Jun 27 00:59:29 2018 by UNKNOWN
!
interface GigabitEthernet0/1/0/0
 shutdown
!
interface GigabitEthernet0/1/0/1
 shutdown
!
interface GigabitEthernet0/1/0/2
 shutdown
!
interface GigabitEthernet0/2/0/0
 Shutdown
!
interface GigabitEthernet0/2/0/1
 shutdown
!
interface GigabitEthernet0/2/0/2
 shutdown
!
end

Verification

Verifying the config
==================
RP/0/RSP0/CPU0:router#sh lldp interface <===== LLDP enabled only on GigEth0/2/0/0
Wed Jun 27 12:43:26.252 IST


GigabitEthernet0/2/0/0:
        Tx: enabled
        Rx: enabled
        Tx state: IDLE
        Rx state: WAIT FOR FRAME
RP/0/RSP0/CPU0:router# 

RP/0/RSP0/CPU0:router# show lldp neighbors 
Wed Jun 27 12:44:38.977 IST
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
ios             Gi0/2/0/0           120        R               Gi0/2/0/0       <====== LLDP enabled only on GigEth0/2/0/0 and neighborship seen for the same.

Total entries displayed: 1

RP/0/RSP0/CPU0:router#