CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

Why do I need the LDP protocol?

MPLS itself is a label switching protocol, so who is responsible for label switching?

At this time, LDP protocol is required, which is independent of all routing protocols and can be used together with all IGP protocols

For each IP prefix of the IGP in the IP routing table, each LSR running the LDP protocol will be locally bound. That is, the IPv4 prefix is ​​assigned a label, and then the LSR distributes the assigned label to all The received labels of the LSR neighbor are converted into remote labels, and then the neighbor stores the remote labels and local labels in a special table, which is the label information library LIB

LDP (Label Distribution Protocol) is a control protocol for multi-protocol label switching MPLS, which is equivalent to the signaling protocol in the traditional network. It is responsible for forwarding the classification of FEC (Forwarding Equivalence Class), label distribution, and labeling. The establishment and maintenance of Label Switched Path (LSP). LDP stipulates various messages and related processing procedures in the label distribution process.

RIB and LFIB

Usually an LDP router will have multiple LDP neighbors, then these neighbors will assign labels to the routes and then pass these labels to themselves. Among all remote labels bundled with a specific prefix, LSR uses only one of the labels to determine the outbound label of that prefix. RIB, that is, the routing table, determines what the next hop of the IPv4 prefix is. The LSR selects the label of the next hop in the routing table that reaches the prefix from the remote label received by the downstream LSR. LSR uses this information to create its own label forwarding information base LFIB.

Introduction to LDP protocol

Define the Label Distribution Protocol in RFC 3036 in detail:

LDP neighbor establishment is divided into two stages: neighbor discovery stage and session establishment stage

LDP protocol packets except Hello packets are based on UDP. All other packets are above TCP and the port number is 646. Similar to BGP, this reliable TCP-based connection makes the protocol state machine relatively simple

LDP adjacency establishment process

Two processes: neighbor discovery process and session establishment process

Neighbor discovery process

Neighbor discovery process

After discovering neighbors through Hello messages, LDP sessions are established between LSRs. After the session is established, LDP peers maintain this session by continuously sending Hello messages and Keepalive messages.

LDP peers periodically send Hello messages to indicate that they want to maintain this adjacency. If the Hello hold timer expires and no new Hello message is received, the Hello adjacency is deleted. After the adjacency relationship is deleted, the local LSR will send a Notification message to end the LDP session.

LDP peers maintain the LDP session through Keepalive messages transmitted on the LDP session connection. If the session keep timer (Keepalive keep timer) times out and no keepalive messages are received, the TCP connection is closed, and the local LSR will send a Notification message to end the LDP session.

Sending Hello packets: Both routers are sending HELLO packets and find that the neighbor transmission address is the LDP Router-ID of the router by default. Therefore, it must be ensured that the two transport addresses are reachable.

Verify whether the hello packet is received:

LDP ID is the LDP identifier of LSR. IT contains LSR identifier and label space.

Modify the address interface:

Mpls LDP router-id interface [force]

Adding the force keyword will take effect immediately, otherwise, it will only be re-selected when the current interface selected as router ID is down.

Mpls LDP router-id interface [force]

The 0 following LDP ID: 2.2.2.2: 0 represents the label space. If the label spaces are all 0, it is the label space based on the device. If it is not 0, it means that the label space based on the interface is used.

label distribution protocol

The party with the larger transmission address acts as the active initiator and uses the transmission address to connect to the TCP session

IP address can be modified under special circumstances

Configuration modification:

Under the interface

Mpls LDP discovery transport-address interface

Configure the transmission address as the IP address of the directly connected interface

Session establishment process

Session establishment process

Establish a session:

LDP establishes LSPs by sending label requests and label mapping messages to announce the binding relationship between FEC and labels between LDP peers, and label publishing and management are determined by label publishing methods, label distribution control methods, and label retention methods

Hello messages are sent between the two LSRs.

The Hello message carries the transport address (that is, the IP address of the device), and both parties use the transport address to establish an LDP session. The party with the larger transmission address acts as the active party and initiates the establishment of a TCP connection.

As shown in the figure above, LSR_1 as the active party initiates the establishment of a TCP connection, and LSR_2 as the passive party waits for the other party to initiate a connection.

After the TCP connection is successfully established, the active party LSR_1 sends an initialization message to negotiate the relevant parameters for establishing an LDP session.

The relevant parameters of the LDP session include the LDP protocol version, label distribution method, Keepalive hold timer value, maximum PDU length, and label space.

After the passive party LSR_2 receives the initialization message, LSR_2 accepts the relevant parameters, and then sends the initialization message, and at the same time sends the keepalive message to the active party LSR_1.

If the passive party LSR_2 cannot accept the relevant parameters, a Notification message is sent to terminate the establishment of the LDP session.

The initialization message includes the LDP protocol version, label distribution method, Keepalive holding timer value, maximum PDU length, and label space.

After the active party LSR_1 receives the initialization message and accepts the relevant parameters, it sends a keepalive message to the passive party LSR_2.

If the active party LSR_1 cannot accept the relevant parameters, it sends a Notification message to the passive party LSR_2 to terminate the establishment of the LDP session.

When both parties receive the Keepalive message from the peer, the LDP session is successfully established.

The establishment is success

The establishment is success

LDP basic configuration commands

LDP basic configuration commands
Please follow and like us:
Last modified: November 15, 2021

Author

Comments

Write a Reply or Comment

Your email address will not be published.