The MPLS architecture consists of multiple label distribution protocols, in which LDP is widely used.
LDP defines messages in the label distribution process and procedures for processing the messages. Label switching routers (LSRs) obtain information about incoming labels, next-hop nodes, and outgoing labels for specified FECs based on the local forwarding table. LSRs use the information to establish LSPs.
For detailed information about LDP, see relevant standards (LDP Specification).
Local adjacency: established by exchanging Link Hello messages between two LSRs.
Remote adjacency: established by exchanging Target Hello messages between two LSRs.
Two LDP peers establish LDP sessions and exchange Label Mapping messages over the session so that they establish an LSP.
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: created over a local adjacency. The two LSRs, one on each end of the local LDP session, are directly connected. After a local LDP session is established, LSRs can exchange labels and establish LDP LSPs.
Remote LDP session: created over a remote adjacency. The two LSRs, one on each end of the remote LDP session, can be either directly or indirectly connected. A remote LDP session can be used to transmit protocol packets of an L2VPN. When two devices on an L2VPN are not directly connected, a remote LDP session needs to be established. LDP labels are directly distributed between remote LDP peers through remote LDP sessions. This mode applies to scenarios where LDP tunnels over other types of tunnels, such as LDP over TE.
The local and remote LDP sessions can be created simultaneously.
Differences
Differences among the LDP adjacency, peer, and session are as follows:
An LDP adjacency is a TCP connection established after two devices exchange Hello messages with each other. The LDP adjacency is based on a link between two interconnected interfaces.
LDP peers refer to two devices that run LDP to exchange label messages over an established TCP connection.
An LDP session is a series of processes of exchanging label messages between two LDP peers.
Relations
The association between LDP adjacencies, peers, and sessions is summarized as follows: Before setting up an LDP session, you need to establish a link that establishes a TCP connection. The link is an adjacency. After an adjacency is established, the two devices exchange LDP session messages to establish an LDP session and an LDP peer relationship. Then LDP peers exchange label information. It may be specifically described as follows:
LDP maintains the existence of the peers through adjacencies. The type of peer is determined by the type of the adjacency that maintains the peer.
A peer can be maintained using multiple adjacencies. If a peer is maintained by both local and remote adjacencies, the peer is a local and remote coexistent peer.
Only LDP peers can establish LDP sessions.
Two 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
A label space defines a range of labels allocated between LDP peers. The NetEngine 8000 F only supports per-platform label space. All interfaces on an LSR share a single label space.
LDP identifier
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>.