LDP

LDP establishes LSPs dynamically. Using LDP, LSRs can map network layer routing information to data link layer switching paths.

Basic concepts of LDP

LDP message type

LDP uses the following messages:

LDP session, advertisement, and notification messages use TCP for reliability. Discovery messages use UDP for efficiency.

LDP operation

LDP goes through the following phases in operation:

  1. Discovery

    Each LSR sends hello messages periodically to notify neighboring LSRs of its presence. In this way, LSRs can automatically discover their LDP peers. LDP provides the following discovery mechanisms:

    • Basic discovery mechanism—Discovers directly connected LSRs and establishes link hello adjacencies with them. An LSR periodically sends LDP link Hello messages to multicast address 224.0.0.2 that identifies all routers on the subnet to advertise its presence.

    • Extended discovery mechanism—Discovers indirectly connected LDP peers and establishes targeted hello adjacencies. An LSR periodically sends LDP Hello messages to a given IP address so that the LSR with the IP address can discover the LDP peer.

    If two LSRs each have the same transport address (the source IP address used to establish a TCP connection to the peer) for the basic and extended discovery mechanisms, the LSRs can establish both a link hello adjacency and a targeted hello adjacency with each other, and the two adjacencies are associated with the same session. This method is suited for two LDP peers that have both a direct link (only one hop) and an indirect link (more than one hop) in between. It can protect the LDP session between the two peers and avoid LDP convergence upon failure of one link. When the direct link fails, the link hello adjacency is deleted. In this case, if the indirect link operates correctly, the targeted hello adjacency remains. Therefore, the LDP session is not deleted, and the FEC-label bindings based on this session are not deleted either. When the direct link recovers, the LDP peers do not need to re-establish the LDP session or re-learn the FEC-label bindings.

    If two LSRs each have different transport addresses for the basic and extended discovery mechanisms, only one type of hello adjacency (either link or targeted) can exist between them.

  2. Session establishment and maintenance

    After an LSR finds a LDP peer, the LSRs go through the following steps to establish a session:

    1. Establish a TCP connection between them.

    2. Initialize negotiation of session parameters such as the LDP version, label advertisement mode, and Keepalive interval.

    After establishing a session between them, the two LDP peers send Hello and Keepalive messages to maintain the session.

  3. LSP establishment and maintenance

    LDP sends label requests and label binding messages between LDP peers to establish LSPs.

    For the LSP establishment process, see "LSP establishment and label distribution."

  4. Session termination

    An LSR terminates its LDP session with an LDP peer when:

    • All Hello adjacencies deleted between the two peers

      LDP peers periodically send Hello messages to indicate that they intend to keep the Hello adjacency. If an LSR does not receive any Hello message from a peer before the Hello timer expires, it deletes the Hello adjacency with this peer. An LDP session has one or more Hello adjacencies. When the last Hello adjacency for the session is deleted, the LSR sends a Notification message to terminate the LDP session.

    • Loss of session connectivity

      An LSR determines the integrity of an LDP session according to the LDP PDU (which carries one or more LDP messages) transmitted on the session. Before the Keepalive timer times out, if two LDP peers have no information to exchange, they can send Keepalive messages to each other to maintain the LDP session. If an LSR does not receive any LDP PDU from its peer during a Keepalive interval, it closes the TCP connection and terminates the LDP session.

    • Receiving a shutdown message from the peer

      An LSR can also send a Shutdown message to its LDP peer to terminate the LDP session. When receiving the Shutdown message from an LDP peer, an LSR terminates the session with the LDP peer.