The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Layout of LLDP packets

The Link Layer Discovery Protocol is a layer two discovery protocol which we receive and interpret, but do not send. More...

Collaboration diagram for Layout of LLDP packets:

Modules

 LLDP: offsets for LLDP packets
 
 LLDP: Known values for TLV types.
 
 LLDP: Methods of encoding Chassis ID.
 
 LLDP: Methods of encoding Port ID.
 
 LLDP: bit mask of switch capabilities.
 
 LLDP: IEEE 802.1 Organizationally specific TLV subtypes.
 802.1 Organizationally Specific TLVs – OUI == 00-80-C2
 
 LLDP: IEEE 802.3 Organizationally specific TLV subtypes.
 802.3 Organizationally Specific TLVs – OUI == 00-12-0F
 

Detailed Description

The Link Layer Discovery Protocol is a layer two discovery protocol which we receive and interpret, but do not send.

The LLDP protocol is defined by the 802.1AB specification, described in IEEE document entitled Station and Media Access Control Connectivity Discovery. This information is mostly derived from that specification.

All LLDP packets consist of a set of Type/Length/Value entries, ending in a zero (LLDP_TLV_END) entry with zero bytes. It appears that some implementations may omit this final terminator entry, even though it's required by the spec...

The format of the LLDP TLV entries is shown below:

+------------------------------------------------------------+
| Type (7-bits) | Length (9 bits) | Value (arbitrary length) |
+------------------------------------------------------------+

Note that the TLV header (Type + Length) is two bytes with the low-order bit in the first byte serving as the high-order bit of the length field. The TLV types are defined in lldp.h.

For TLVs of type LLDP_TLV_ORG_SPECIFIC (127) additional fields are defined for the purpose of extending the format by specific organizations. Those packets look like this:

+--------+----------+-------------------------------+------------+
|  Type  |  Length |   OUI   | org-defined subtype | org-defined |
| 7 bits |  9 bits | 3 bytes |      1 byte         | info string |
+--------+---------+---------+---------------------+-------------+

The OUI == Organizational Unique Identifier - which is IEEE's way of giving each organization their own name space. The entire list is very long, but a few of them are defined in the 802.1AB spec. These are: