The MPLS architecture consists of multiple label distribution protocols, among which LDP is widely used. Label switching routers (LSRs) exchange LDP messages to obtain information about incoming labels, next-hop nodes, and outgoing labels for specified FECs so that they can establish LSPs. For LDP specifications, see RFC 5036 (LDP Specification).
Two LDP peers set up LDP sessions and exchange Label Mapping messages over the session so that they can establish an LSP.
LDP peers learn each other's labels through the LDP session between them.
An LDP session between LSRs helps them exchange messages, such as Label Mapping messages and Label Release messages. LDP sessions are classified into the following types:
Local LDP session: an LDP session between the two LSRs that are directly connected.
Remote LDP session: an LDP session between the two LSRs that are directly or indirectly connected.
The local and remote LDP sessions can be set up simultaneously.
The LDP dynamic capability announcement function allows an LDP extension to be dynamically enabled or disabled on a device during an LDP session, ensuring the stability of an LSP.
LDP maintains peer relationships over adjacencies. The type of peers depends on the type of adjacencies. A peer can be maintained using multiple adjacencies. If a peer is maintained by both local and remote adjacencies, the type of the peer supports both the local and remote adjacencies. An LDP session can only be created if two peers establish a peer relationship.
LSRs exchange the following messages:
Discovery message: used to notify or maintain the presence of an LSR on an MPLS network.
Session message: used to establish, maintain, or terminate an LDP session between LDP peers.
Advertisement message: used to create, modify, or delete a mapping between a specific FEC and label.
Notification message: used to provide advisory information or error information.
LDP transmits Discovery messages using the User Datagram Protocol (UDP) and transmits Session, Advertisement, and Notification messages using the Transmission Control Protocol (TCP).
Label space
Per-Platform Label Space: All interfaces on an LSR share a single label space.
Per-Interface Label Space: Each interface of an LSR is assigned a label space.
LDP ID
An LDP identifier identifies a label space used by a specified LSR. An LDP identifier consists of 6 bytes, including a 4-byte LSR ID and a 2-byte label space. An LDP identifier is in the format of <LSR ID>:<Label space ID>.