Type Length Value (TLV)
A TLV (Type-Length-Value) is a flexible data encoding scheme that is commonly used in a wide variety of networking protocols. It structures information into three parts:
- Type – Identifies the kind of data being transmitted.
- Length – Specifies the size of the value field.
- Value – Contains the actual data.
This structure allows protocols to be extensible, backward-compatible, and efficient in parsing since each field is self-describing.
There are various protocols that use TLVs in their design. Some are listed below:
Routing Protocols:
- OSPF (Open Shortest Path First) – Uses TLVs in Opaque LSAs for extensibility.
- IS-IS (Intermediate System to Intermediate System) – Uses TLVs extensively for carrying routing information.
- BGP (Border Gateway Protocol) – Uses TLVs in Path Attributes and MP-BGP extensions.
Switching & Labeling Protocols:
- LLDP (Link Layer Discovery Protocol) – Uses TLVs for device and neighbor discovery.
- MPLS (Multiprotocol Label Switching) – Uses TLVs in LDP]] (Label Distribution Protocol) and RSVP-TE for label and path signaling.
Network Configuration & Management:
- SNMP (Simple Network Management Protocol) – Uses TLV in ASN.1 encoding.
- NETCONF & YANG – Encodes configuration data using TLVs in some transport layers.
Security Protocols:
- RADIUS (Remote Authentication Dial-In User Service) – Uses TLVs to carry authentication attributes.
- Diameter – An advanced replacement for RADIUS, also using TLVs.
- EAP (Extensible Authentication Protocol) – Uses TLVs for authentication exchanges.