Link Layer Discovery Protocol (LLDP)

Hello Muhammad

A Type Length Value (TLV) is an encoding scheme used to add optional additional elements within a communications protocol. It is a general scheme that is used for various protocols, including LLDP. Each TLV, as its name suggests, includes three fields:

  1. Type code - this is a code that is used to specify what kind of information is included in this TLV. For example, for LLDP, a code of 2 means the TLV contains information about the Port ID.
  2. Length - This value indicates the length of the field containing the value, in bytes.
  3. Value - this field contains the value of the TLV. If the Type code is 2, then you can expect to see the Port ID in this field.

TLVs for LLDP exist within the LLDP frame structure. Each TLV consists of a 7 bit type field, a 9 bit Length field, and a 0 to 511 bit Value field, depending on the type of TLV. Below is an example of an LLDP frame:
image
There are four mandatory TLVs that all LLDP packets must carry, and these are seen in the above image. These are:

  1. Chassis ID TLV, type 1
  2. Port ID TLV type 2
  3. TTL TLV type 3
  4. End of LLDP PDU type 0 (this TLV always goes at the end to indicate the end of the frame).

In between, there may be additional optional TLVs added. Various such types of optional TLVs include Port description, System name, System description, System capabilities, and management address. Custom TLVs can also be created, using type number 127 where each vendor can specify their own information within the value field.

Now LLDP itself does not contain the capability of negotiating additional information such as PoE management and VLAN assignments, and this capability was added as an enhancement known as Media Endpoint Discovery or MED, resulting in the enhanced protocol LLDP-MED.

The MED enhancement has been standardized by the Telecommunications Industry Association in standard number ANSI/TIA-1057. In the following image, you can see a wireshark capture of an LLDP-MED frame which includes the four additional facilities of negotiation, including media, network policy, location ID and PoE negotiation. The PoE negotiation information is expanded in the image, and information such as power type, power source and power priority, which are exchanged between devices, can clearly be seen.

I hope this has been helpful!

Laz

2 Likes