OcNOS-SP : Multi-Protocol Label Switching Guide : Multi-Protocol Label Switching Configuration Guide : LDP Configuration : Label Distribution Protocol Overview
Label Distribution Protocol Overview
The Label Distribution Protocol (LDP) is a routing protocol used in MPLS technology. The LDP daemon (ldpd) uses NSM services to obtain routing information. Routers send Hello packets to establish Hello Adjacencies with other nearby routers. This opens the way for sessions between routers to be established during which routers exchange labels in preparation for forwarding packets.
LDP generates labels for and exchanges labels between peer routers. It works in with other routing protocols (RIP, OSPF and BGP) to create label-switched paths (LSP) used when forwarding packets. A label-switched path is the path taken by all packets that belong to the Forwarding Equivalence Class (FEC) corresponding to that LSP. This is analogous to establishing a virtual circuit in ATM (Asynchronous Transfer Mechanism). In this way, OcNOS LDP assigns labels to every destination address and destination prefix provided by OcNOS. The LDP interface to the MPLS forwarder adds labels to, and deletes labels from, the forwarding tables.
LDP Adjacencies
LDP defines a mechanism for discovering adjacent, LDP capable Label Switching Routers (LSR) that participate in label switching (adjacencies). Whenever a new router comes up it sends out a hello packet to a specified, multicast address announcing itself to the network. Every router directly connected to the network receives the packet. Receipt of a hello packet from another LSR creates a Hello Adjacency with that LSR. To create a Hello Adjacency with an LSR that cannot send/receive multicast packets, LDP allows a router to be manually configured to send unicast Hello packets to non-multicast LSRs . This non-multicast LSR is a targeted peer. Adjacencies are maintained by sending out periodic Hello packets to the multicast group and to all targeted peers. Hello packets are sent using UDP.
LDP Session
LDP capable LSRs establish a session before exchanging label information. All the session messages are sent using TCP to ensure reliable delivery. After the LSRs establish a session and negotiate options, a given pair of routers may exchange label information. The labels exchanged over a session are valid only during the lifetime of the session and routers release them when session is closed.
Forwarding Equivalence Class
A Forwarding Equivalence Class (FEC) section defines a set of packets that are forwarded on the same path by the MPLS network. Two common methods to define FEC are by advertising the IPv4 routes using:
Host Address The LSR uses the address of the destination host to create this FEC. This means that all the packets going to this destination will take the same LSP.
Prefix The LSR uses destination prefix to create this FEC. This means that all the packets take the LSP corresponding to the longest matching prefix.
Label Generation
An LDP Label is a 20-bit number the LSR uses to forward a packet to its destination. When an LSR creates a new FEC, the router generates new labels and distributes them to its peers. A router keeps both incoming and outgoing labels in its database.
Label Distribution Modes
The OcNOS LDP implementation supports two label distribution modes:
Downstream Unsolicited In this mode, next hop LSRs distribute labels to peers without waiting for a label request.
Downstream on Demand In this mode, a LSR distributes a label to a peer only if there is a pending label request from the peer.
Label Retention Mode
The OcNOS LDP implementation supports two label retention modes:
Liberal Retention Mode In this mode, the LSR retains all labels received from all sources. This mode helps in fast LSP setup in case of a change in next hop.
Conservative Retention Mode In this mode, the LSR retains only those labels received from peers that are the next hop for a given FEC. This mode is used by LSRs that have a constraint on the number of labels that it can retain at any given time.
LSP Control
LSPs can be set up in the following two ways:
Ordered Control In this mode, an LSR distributes a label for a FEC to its peer only if it has a corresponding label from its next hop or it is the egress node.
Independent Control In this mode, an LSR may distribute a label to its peers without waiting for a corresponding label from its next hop.
Loop Detection
Loop detection can be enabled to detect routing loops in LSPs. There are two methods supported for the loop detection mechanism:
Hop Count During setup of an LSP, the LSP passes hop count with the LSP setup messages. This hop count is incriminated by each node router participating in LSP establishment. If the hop count exceeds the maximum configured value, the LSP setup process is stopped and a notification message is passed back to the message originator.
Path Vector A path vector contains a list of LSR identifiers. This is passed as a part of LSP setup messages. Each LSR participating in the LSP establishment adds its own LSR identifier to the path vector. If an LSR finds its own identifier in the path vector, it drops the message and sends a message back to the originator.
The use of these messages ensures that a loop is detected while establishing a label switched path and before any data is passed over that LSP.
Last modified date: 10/17/2023