LLDP

The Link Layer Discovery Protocol (IEEE 802.1AB) is used to exchange information between neighbor systems on each link. The exchanged LLDP PDUs include TLVs such as:

  • Chassis ID (e.g. MAC address).

  • Port ID (character string).

  • Time To Live (for message timeout purposes).

  • Management Address (e.g. IPv4 address).

  • Organizationally Specific TLVs, for example frame preemption capabilities.

The VelocitySP LLDP implementation can store information for one neighbor per switch port.

The following examples operate on the first port ('1') of the switch.

1. LLDP Global Configuration

The interval between the LLDP messages of a normal transmission period is configurable from 1 to 3600 seconds and defaults to 30 seconds. It also determines the Time To Live of the transmitted messages, which is the interval multiplied by the hold multiplier of 4. A shortened interval takes effect at once, without waiting out the transmission that is already scheduled.

IPATCH request message:

- ? "/ieee802-dot1ab-lldp:lldp/message-tx-interval"
  : 10

The global configuration is retrieved as shown below.

FETCH request message:

- "/ieee802-dot1ab-lldp:lldp/message-tx-interval"

FETCH response message:

- ? "/ieee802-dot1ab-lldp:lldp/message-tx-interval"
  : 10

2. LLDP Port Configuration

Rx and Tx of LLDP messages can be enabled per port, using DMAC 01-80-C2-00-00-0E.

IPATCH request message:

- ? "/ieee802-dot1ab-lldp:lldp/\
     port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/admin-status"
  : tx-and-rx

The configuration of the first port is retrieved as shown below.

FETCH request message:

- "/ieee802-dot1ab-lldp:lldp/\
   port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/admin-status"

FETCH response message:

- ? "/ieee802-dot1ab-lldp:lldp/port/admin-status"
  : tx-and-rx

3. LLDP Custom TLV

An Organizationally Specific TLV carries information defined by an organization rather than by IEEE 802.1AB, identified by the Organizationally Unique Identifier (OUI) of that organization and by a subtype it chooses. Each port has a list of these, keyed by OUI and subtype, and one TLV is transmitted for each entry in every LLDPDU sent on the port. An entry is transmitted by virtue of existing, so transmission is stopped by deleting the entry.

The number of entries a port takes, and the maximum size of the information field of each, are declared by the board configuration using lldp_custom_tlv_count (default 1) and lldp_custom_tlv_size (default 8).

The first port is set up to transmit a TLV with OUI 0x010203, subtype 0x04 and the two information octets 0x05 and 0x06 as shown below. The OUI is a 24 bit number, so 0x010203 is written as 66051, and the information field is a binary leaf, so it is written in base64, where 0x0506 is 'BQY='.

IPATCH request message:

- ? "/ieee802-dot1ab-lldp:lldp/\
     port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/\
     mchp-velocitysp-lldp:custom-tlv[oui='66051'][subtype='4']/info"
  : BQY=

The TLV is retrieved by its keys as shown below. Leaving the keys out of the request would retrieve every custom TLV of the port instead.

FETCH request message:

- "/ieee802-dot1ab-lldp:lldp/\
   port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/\
   mchp-velocitysp-lldp:custom-tlv[oui='66051'][subtype='4']"

FETCH response message:

- ? "/ieee802-dot1ab-lldp:lldp/port/mchp-velocitysp-lldp:custom-tlv"
  : oui: 66051
    subtype: 4
    info: BQY=

4. LLDP Rx Processing

Remote data received on the port is retrieved as shown below.

FETCH request message:

- "/ieee802-dot1ab-lldp:lldp/\
   port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/remote-systems-data"

FETCH response message:

- ? "/ieee802-dot1ab-lldp:lldp/port/remote-systems-data"
  : - time-mark: 1234
      remote-index: 1
      chassis-id-subtype: mac-address
      chassis-id: 00-11-22-33-44-55
      port-id-subtype: interface-name
      port-id: '2'
      port-desc: ''
      system-name: ''
      system-description: ''
      remote-org-defined-info:
      - info-identifier: 66051
        info-subtype: 4
        info-index: 1
        remote-info: BQY=

5. LLDP Tx Processing

When Tx is enabled on a port, LLDP messages including the TLVs listed above are sent every 30 seconds. If the IP address is changed, a number of transmissions are done every second.

6. LLDP Counters

LLDP counters for a port are retrieved as shown below.

- "/ieee802-dot1ab-lldp:lldp/\
   port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/tx-statistics"

- "/ieee802-dot1ab-lldp:lldp/\
   port[name='1'][dest-mac-address='01-80-C2-00-00-0E']/rx-statistics"

FETCH response message:

- ? "/ieee802-dot1ab-lldp:lldp/port/tx-statistics"
  : total-frames: 1

- ? "/ieee802-dot1ab-lldp:lldp/port/rx-statistics"
  : total-discarded-frames: 0
    error-frames: 0
    total-frames: 1
    total-discarded-tlvs: 0
    total-unrecognized-tlvs: 1

7. LLDP Frame Preemption Negotiation

Frame preemption is negotiated via LLDP organizationally specific TLVs. The negotiation is done for each data direction on the switch port:

  • Data Rx:

    • LLDP Tx messages always announce Rx frame preemption capability.

    • The remote switch may then use frame preemption when sending data.

  • Data Tx:

    • LLDP Rx messages indicate whether the peer supports Rx frame preemption.

    • The local switch may then use frame preemption when sending data.

Frame preemption may be enabled per Tx queue on a port. By default, all queues are set up for express operation, disabling frame preemption. A number of queues, starting with queue 0 (low priority) may be set up as preemptable.

The first queue on the port is set up as preemptable as shown below.

IPATCH request message:

- ? "/ietf-interfaces:interfaces/interface[name='1']/\
     ieee802-dot1q-bridge:bridge-port/\
     ieee802-dot1q-preemption-bridge:frame-preemption-parameters/\
     frame-preemption-status-table"
  : priority0: preemptable

The frame preemption configuration is retrieved as shown below.

FETCH request message:

- "/ietf-interfaces:interfaces/interface[name='1']/\
   ieee802-dot1q-bridge:bridge-port/\
   ieee802-dot1q-preemption-bridge:frame-preemption-parameters/\
   frame-preemption-status-table"

FETCH response message:

- ? "/ietf-interfaces:interfaces/interface/ieee802-dot1q-bridge:bridge-port/\
     ieee802-dot1q-preemption-bridge:frame-preemption-parameters/\
     frame-preemption-status-table"
  : priority0: preemptable
    priority1: express
    priority2: express
    priority3: express
    priority4: express
    priority5: express
    priority6: express
    priority7: express