LLDP

The IEEE 802.1ab Link Layer Discovery Protocol (LLDP) standard defines protocol and management elements that are suitable for advertising information to devices attached to the same LAN, for the purpose of populating physical or logical topology and device discovery management information databases.

SR Linux supports the ability to run LLDP on all physical interfaces (both in-band and out-of-band). You can enable or disable LLDP as follows:

  • at the global level, using .system.lldp.admin-state
  • at the interface level, using .system.lldp.interface{}.admin-state

If you globally disable LLDP, no interfaces use LLDP. SR Linux does not currently supported TLV suppression.

Devices send LLDP information in Ethernet frames from each of their interfaces at a fixed interval. Each frame contains one LLDP Data Unit (LLDPDU), which is a sequence of Type-Length-Value (TLV) structures. LLDP Ethernet frames have the destination MAC address typically set to a special multicast address which 802.1D-compliant bridges do not forward. The EtherType field is set to 0x88cc.

As shown in LLDP frame structure, each LLDP frame starts with the following mandatory TLVs:

  • Chassis-ID
  • Port-ID
  • Time-to-Live (TTL)

Any number of optional TLVs follow the mandatory TLVs. The frame ends with a special TLV named End of LLDPDU, in which both the type and length fields are 0.

Figure 1. LLDP frame structure

LLDP implementation in SR Linux

LLDP is implemented in SR Linux using the lldp_mgr application, which controls sending of packets using in-band and out-of-band interfaces (a Linux-native LLDP such as lldpad is not used). The lldp_mgr crafts packets based on its configuration and forwards them using xdp. The SR Linux xdp process manages the sending and receiving of frames using in-band and out-of-band ports as follows:

  • For ingress in-band, the xdp process forwards frames to the active CPM lldp_mgr application.
  • For egress, the xdp process sends frames out the correct interface.

Instead of a hold-time, SR Linux allows you to configure the following two values, which together create the TTL TLV in the LLDPDU (by multiplying the hello-timer by the hold-multiplier):

  • hello-timer at.system.lldp.hello-timer
  • hold-multiplier at .system.lldp.hold-multiplier

You cannot configure the following referenced fields:

  • The system-name is a leaf reference to .system.name.host-name.
  • The system-description is auto-generated based on system information. The following is the template for this field.
    SRLinux-<version> <hostname> <kernel> <build date>

Although multiple neighbors are supported under the YANG model, LLDP is not available per VLAN.

LLDP transmitting system capabilities TLV

Each LLDPDU received and transmitted contains a TLV that references the transmitting system capabilities. The following are the available capabilities:

  • SYSTEM_CAPABILITIES_OTHER
  • SYSTEM_CAPABILITIES_REPEATER
  • SYSTEM_CAPABILITIES_BRIDGE
  • SYSTEM_CAPABILITIES_WLAN_AP
  • SYSTEM_CAPABILITIES_ROUTER
  • SYSTEM_CAPABILITIES_PHONE
  • SYSTEM_CAPABILITIES_DOCSIS
  • SYSTEM_CAPABILITIES_STATION
  • SYSTEM_CAPABILITIES_CVLAN
  • SYSTEM_CAPABILITIES_SVLAN
  • SYSTEM_CAPABILITIES_TPMR

SR Linux sends only the following capabilities:

  • SYSTEM_CAPABILITIES_BRIDGE
  • SYSTEM_CAPABILITIES_ROUTER
  • SYSTEM_CAPABILITIES_SVLAN

Configuring LLDP

Use the info command in running mode to display LLDP configuration information, in candidate mode to display configuration information and any pending uncommitted changes, and in state mode to display configuration information, statistics, and neighbour information.

The following example shows a basic configuration for LLDP.

--{ + running }--[  ]--
A:node-2# info system lldp
    system {
        lldp {
            admin-state enable
            hello-timer 1
            hold-multiplier 255
            management-address ethernet-1/17.1 {
                type [
                    IPv4
                    IPv6
                ]
            }
            management-address mgmt0.0 {
                type [
                    IPv4
                    IPv6
                ]
            }
            interface ethernet-1/17 {
                admin-state enable
            }
            interface mgmt0 {
                admin-state enable
            }
        }
    }

Displaying LLDP neighbor information

LLDP neighbor information is available using a Nokia-provided CLI plugin. LLDP neighbor reports include information such as the system name, chassis ID, first message, last update, port, and related BGP details. You can also access LLDP neighbor reports for a particular interface.

Use the following commands to display LLDP neighbour information.
show system lldp neighbor
show system lldp neighbor interface

See the SR Linux System Management Guide, section Pre-defined show reports and System show reports for more information.

Displaying LLDP statistics

You can display aggregate statistics and per-interface statistics for LLDP including frame discards, frame-in and frame-out numbers, last clear, and TLV accepted numbers.

To display statistics use the info from state command in candidate or running mode or the info command in state mode.

Display LLDP statistics

--{ + running }--[  ]--
A:rifa# info from state system lldp statistics
    system {
        lldp {
            statistics {
                frame-in 516
                frame-out 2565
                last-clear "3 minutes ago"
                tlv-accepted 5680
            }
        }
    }

Display LLDP detail statistics

--{ + running }--[  ]--
A:rifa# info detail from state system lldp statistics
    system {
        lldp {
            statistics {
                frame-in 22
                frame-out 88
                last-clear 2022-10-24T18:57:26.468Z
                tlv-accepted 274
            }
        }
    }

Display LLDP detail statistics for the management interface

--{ + running }--[  ]--
A:rifa# info detail from state system lldp interface mgmt0 statistics
    system {
        lldp {
            interface mgmt0 {
                statistics {
                    frame-in 0
                    frame-out 344426
                    frame-error-in 0
                    frame-discard 120
                    tlv-discard 0
                    tlv-unknown 0
                    frame-error-out 1
                }
            }
        }
    }

Display LLDP statistics for the Ethernet interface

--{ + running }--[  ]--
A:rifa# info from state system lldp interface ethernet-1/17 statistics
    system {
        lldp {
            interface ethernet-1/17 {
                statistics {
                    frame-in 331
                    frame-out 333
                    last-clear "5 minutes ago"
                }
            }
        }
    }

Display LLDP detail statistics for the Ethernet interface

--{ + running }--[  ]--
A:rifa#
--{ + running }--[  ]--
A:rifa# info detail from state system lldp interface ethernet-1/17 statistics
    system {
        lldp {
            interface ethernet-1/17 {
                statistics {
                    frame-in 5
                    frame-out 5
                    last-clear 2022-10-24T18:58:44.534Z
                }
            }
        }
    }

Clearing LLDP statistics

You can clear aggregate statistics and per-interface statistics for LLDP. Clearing the statistics counters resets all statistics to 0 and populates the last-clear field with the current timestamp.

Use the following commands in running, candidate, or state mode to clear LLDP statistics counters.

tools system lldp statistics clear
tools system lldp interface name statistics clear

Clear LLD statistics

--{ + running }--[  ]--
A:node-2# tools system lldp statistics clear
--{ + running }--[  ]--
A:rifa# info from state system lldp statistics
    system {
        lldp {
            statistics {
                frame-in 2
                frame-out 11
                last-clear now
                tlv-accepted 28
            }
        }
    }

Clear management-interface statistics

--{ + running }--[  ]--
A:node-2# tools system lldp interface mgmt0 statistics clear
--{ + running }--[  ]--
A:rifa# info detail  from state system lldp interface mgmt0 statistics
    system {
        lldp {
            interface mgmt0 {
                statistics {
                    frame-out 1
                    last-clear 2022-10-24T18:59:46.291Z
                }
            }
        }
    }

Clear Ethernet interface statistics

--{ + running }--[  ]--
A:node-2# tools system lldp interface ethernet-1/17 statistics clear
--{ + running }--[  ]--
A:node-2# info from state system lldp interface ethernet-1/17 statistics
    system {
        lldp {
            interface ethernet-1/17 {
                statistics {
                    frame-in 1
                    frame-out 1
                    last-clear now
                }
            }
        }
    }