What is LDP Protocol?
In Multiprotocol Label Switching (MPLS) networks, Label Distribution Protocol (LDP) is a signalling protocol that allows Label Switching Routers (LSRs) to automatically distribute, manage, and exchange label bindings. LDP maps network-layer routing information directly to data link layer-switched pathways, enabling routers to create Label Switched pathways (LSPs) across a network.
In MPLS networks, LDP is the most popular protocol for label distribution, especially for applications that are not traffic-engineered.

Also Read About Protocol Based Intrusion Detection System PBIDS Advantages
Fundamental Mechanism and Function
Operating in an MPLS environment, LDP mostly depends on the underlying Interior Gateway Protocol (IGP) for routing information, such as OSPF or IS-IS. Because they automatically use the shortest route as determined by the IGP, LDP-signaled LSPs are referred to as best-effort LSPs.
Four primary processes are usually involved in the operation of LDP: notification, label management, session formation, and discovery.
- Peer Discovery and Adjacency
Discovery messages, often known as “Hello messages,” are used by LSRs to identify possible LDP peers and to announce and maintain their presence in the network.
- Mechanism: UDP port 646 is used to send hello messages on a regular basis.
- Link LDP: The ‘all routers on this subnet’ multicast address (224.0.0.2 for IPv4) receives Hello messages as UDP packets as part of the fundamental discovery method.
- LDP Peers: LDP peers are two LSRs that exchange label bindings via LDP.
Also Read About What Is EIGRP Enhanced Interior Gateway Routing Protocol?
- Session Establishment
The LSRs create an LDP session (or peering) after they find an LDP neighbour.
- Mechanism: A dependable TCP connection on port 646 is used to establish the session.
- Session Messages: To maintain the session and negotiate settings (such as the timer values and LDP version), session messages more especially, Initialization and Keepalive messages are utilized.
- Active/Passive Role: When routers compare their transport addresses to start a TCP session, the router with the higher IP address often assumes the active role.
- Label Distribution (Advertisement)
Label binding information is exchanged by LSRs when the session is established.
- FEC Association: For every LSP it generates, LDP assigns a Forwarding Equivalence Class (FEC). In the context of LDP, an FEC is usually an IP prefix and represents a group of similar actions linked to a class of packets.
- Label Binding: The prefixes that each LSR learns from the IGP are assigned a local label. The Label Information Base (LIB) is where this binding the mapping between FECs and labels is kept.
- Advertisement Messages: To add, modify, and remove label mappings, LSRs utilize the Label Mapping, Label Request, and Label Withdraw messages.
- LSP Establishment: As each LSR splices incoming labels for an FEC to the outgoing label given to the next hop for that FEC, LSPs are extended throughout the network. Which neighbour to send an advertising label to is determined by the next hop that the IGP determines.
- Forwarding: The router employs label-based packet forwarding in the data plane using the Label Forwarding Information Base (LFIB), which is filled with this label information.
Also Read About Advantages and Disadvantages of bgp Border Gateway Protocol
Distribution Methods
LDP allows LSRs to exchange label bindings in a variety of ways:
- Downstream Unsolicited (DU): An LSR promotes label mappings to peers without receiving specific requests.
- Downstream On Demand (DOD): Only when specifically requested by another LSR does an LSR distribute an FEC label binding.
To manage the connections between labels and their matching FECs, LDP works in tandem with the MPLS label manager. LDP does not support determining FECs of a BGP prefix; it can only resolve FECs for IGP and static prefixes.
Key LDP Concepts and Extensions
LDP Identifier and Label Spaces
An LDP Identifier (LDP ID), a 6-octet value used to name label spaces, is used to identify an LDP peer.
- The LDP ID is made up of a 2-octet local label space ID that identifies the label space inside the LSR and a 4-octet LDP router ID that identifies the LSR.
- Per-interface (for interfaces that need interface-specific labels) and Per-platform (where interfaces share the same label space, often indicated by a local label space ID of 0) are the two label space kinds that LDP supports.
Targeted LDP (T-LDP)
To create LDP sessions between routers that are not directly linked, utilise the T-LDP extension.
- Instead of using multicast, an LSR uses this enhanced discovery technique to send Targeted Hello messages to a specific unicast IP address on a regular basis.
- In an overall MPLS Transport Tunnel created by Link LDP, T-LDP is frequently used to distribute inner labels (VC/VPN/service labels) for MPLS services like VPLS and VPWS.
Also Read About Advantages Of Routing Information Protocol And How RIP Works
LDP Optimizations and Resilience
The close linkage between LDP and the IGP is addressed by the LDP/IGP Synchronisation function. The IGP (OSPF or IS-IS) can advertise a connection with a maximum metric in the event that an LDP session fails on it. This effectively removes the link from the best path calculation until LDP is operational again.
- LDP Loop Detection: This optional feature avoids routing loops during label distribution by using the Hop Count TLV (counting the LSRs travelled) and the Path Vector TLV (listing the LSR IDs traversed).
- When the LSR right before the egress router removes (pops) the packet’s label, sending a plain IP packet to the egress router is known as penultimate hop popping (PHP).
- LDP Over RSVP Tunnels: Without requiring a complete mesh of RSVP LSPs across PE routers, MPLS services can span vast networks or several IGP areas by configuring LDP to use RSVP-TE tunnels, which provide traffic engineering and quick reroute, as transport for LDP LSPs.
- TTL Security: To defend against infrastructure assaults, LDP peering sessions can be secured by employing the TTL Security Hack (TSH), which discards packets if the receiving Time-to-Live (TTL) value is less than the configured expected TTL value.
LDP for MPLS Services
Label distribution is only carried out via LDP in MPLS setups. Virtual Leased Lines (VLLs) and Virtual Private LAN Services (VPLSs) are two examples of Layer 2 services for which it is mostly utilized to exchange labels. LDP signals VLLs and VPLSs for these service-based FECs in conjunction with the Service Manager.
RFC 5036 contains the definition of the LDP protocol.
Also Read About IPv4 Address Exhaustion: Simple Guide To IP Address Shortage
