Configuring Basic Functions of MPLS LDP
Pre-configuration Tasks
Before configuring basic functions of MPLS LDP, configure static routes or an IGP to ensure that IP routes between LSRs are reachable.
When Routing Information Protocol version 1 (RIP-1) is used, you need to enable LDP to search for routes to establish LSPs according to the longest match principle. For details, see Configuring LDP Extensions for Inter-Area LSPs.
You can build an MPLS network only after basic functions of MPLS LDP are configured.
Configuration Procedure
Configure basic functions of MPLS LDP according to the following sequence.
- Configuring the LSR ID
- Enabling Global MPLS
- Enabling Global MPLS LDP
- Configuring LDP Sessions
- (Optional) Configuring an LDP Transport Address
- (Optional) Configuring Timers for LDP Session
- (Optional) Configuring the PHP Feature
- (Optional) Configuring an LDP Label Distribution Control Mode
- (Optional) Configuring an LDP Label Advertisement Mode
- (Optional) Configuring LDP to Automatically Trigger the Request in DoD Mode
- (Optional) Configuring MPLS MTU
- (Optional) Configuring the MPLS TTL Processing Mode
- (Optional) Configuring the LDP Label Policies
- (Optional) Disabling a Device from Distributing Labels to Remote Peers
- (Optional) Configuring a Policy for Triggering LDP LSP Establishment
- (Optional) Configuring Delayed Transmission of Label Withdraw Messages
- (Optional) Disabling LDP from Tearing Down a Session After Error Packets Are Received
- Verifying the Configuration of Basic MPLS LDP Functions
Configuring the LSR ID
Context
An LSR ID identifies an LSR on a network. An LSR does not have the default LSR ID, and you must configure an LSR ID for it. To enhance network reliability, you are advised to use the IP address of a loopback interface on the LSR as the LSR ID.
Perform the following steps on each node in an MPLS domain.
Enabling Global MPLS
Enabling Global MPLS LDP
Context
You can perform other MPLS LDP configurations only after enabling global MPLS LDP.
Perform the following steps on each node in an MPLS domain.
Procedure
- Run system-view
The system view is displayed.
- Run mpls ldp
MPLS LDP is enabled globally and the MPLS LDP view is displayed.
By default, LDP is not enabled globally.
- (Optional) Run lsr-id lsr-id
The LSR ID is set for an LDP instance.
By default, the LSR ID of the LDP instance is the LSR ID of the local node. It is recommended that the default value be used.
In certain networking where VPN instances are used, such as BGP/MPLS IP VPN networking, if the VPN address and the LSR ID overlap, you need to configure LSR IDs for LDP instances to ensure that TCP connections can be correctly set up.
Configuring LDP Sessions
Context
The MPLS LDP session is classified into local LDP sessions and remote LDP sessions. You can choose one of the following configurations according to your requirements:
Configuring a local LDP session
In most cases, you need to configure a local LDP session when deploying MPLS LDP services.
Configuring a remote LDP session
In most cases, remote LDP sessions are not established between adjacent LSRs. A remote LDP session is used for configuring a VLL in Martini mode.
A local LDP session and a remote LDP session can coexist. That is, two LSRs can establish a local LDP session and a remote LDP session simultaneously. In this case, configurations of the local and remote LDP sessions at both ends must be the same.
(Optional) Configuring an LDP Transport Address
Context
LDP sessions are established based on TCP connections. Before two LSRs establish an LDP session, they need to check the LDP transport address of each other, and then establish a TCP connection.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The view of the interface on which the LDP session is to be set up is displayed.
- Run mpls ldp transport-address { interface-type interface-number | interface }
An LDP transport address is specified.
The default transport address for a node on a public network is the LSR ID of the node, and the default transport address for a node on a private network is the primary IP address of an interface on the node.
If LDP sessions are to be established over multiple links connecting two LSRs, LDP-enabled interfaces on either LSR must use the default transport address or the same transport address. If multiple transport addresses are configured on an LSR, only one transport address can be used to establish only one LDP session.
Changing an LDP transport address interrupts an LDP session. Exercise caution when running this command.
(Optional) Configuring Timers for LDP Session
Context
Table 3-8 describes the timers for an LDP session.
LDP Timer |
Description |
Suggestion |
---|---|---|
Hello send timer:
|
Used to send Hello messages periodically to notify a peer LSR of the local LSR's presence and establish a Hello adjacency. |
On an unstable network, decrease the value of a Hello send timer, speeding up network fault detection. |
Hello hold timer:
|
Used to exchange Hello messages periodically between two LDP peers to maintain the Hello adjacency. If no Hello message is received after the Hello hold timer expires, the Hello adjacency is torn down. |
On a network with unstable links or a large number of packets, increase the value of the Hello hold timer, preventing the LDP session from being torn down and set up frequently. |
Keepalive send timer |
Used to send Keepalive messages periodically, maintaining the LDP sessions. |
On an unstable network, set a smaller value for a Keepalive send timer, speeding up network fault detection. |
Keepalive hold timer |
Used to send LDP PDUs over an LDP session, maintaining the LDP session. If no LDP PDU is received after the Keepalive hold timer expires, the TCP connection is closed and the LDP session is terminated. |
On a network with unstable links, increase the value of the Keepalive hold timer, preventing the LDP session from flapping. |
Exponential backoff timer |
Started by an LSR that plays an active role after an LDP Initialization message sent by the LSR to another LSR that plays a passive role fails to be processed or parameters carried in the message are rejected. The LSP that plays the active role periodically resends an LDP Initialization message to initiate an LDP session before the Exponential backoff timer expires. |
|
When local and remote LDP sessions coexist, the timeout interval of the Keepalive hold timer of the local and remote LDP sessions must be the same.
(Optional) Configuring the PHP Feature
Context
No label needs to be swapped on the egress node of an LSP. PHP can be configured on the egress node to allow the LSR at the penultimate hop to pop out the label from an MPLS packet and send the packet to the egress node. After receiving the packet, the egress node directly forwards the packet through an IP link or according to the next layer label. PHP helps reduce the burden on the egress node.
Procedure
- Run system-view
The system view is displayed.
- Run mpls
The MPLS view is displayed.
- Run label advertise { explicit-null | implicit-null | non-null }
The label allocated to the LSR at the penultimate hop is configured.
The egress node can allocate different labels to the PHP based on the parameter setting.
implicit-null: default value, which indicates that PHP is supported. If this parameter is configured, the egress node allocates an implicit null label with the value of 3 to the LSR at the penultimate hop.
explicit-null: PHP is not supported. If this parameter is configured, the egress node allocates an explicit null label with the value of 0 to the LSR at the penultimate hop. The explicit-null parameter can be configured when MPLS QoS attributes are used.
non-null: PHP is not supported. If this parameter is configured, the egress allocates a common label with a value greater than or equal to 16 to the LSR at the penultimate hop.
After the label advertise command is run to change the label distribution mode on the egress node, the modification takes effect on new LSPs but not on existing LSPs. To enable the modification to take effect on the existing LSPs, run the reset mpls ldp or lsp-trigger command.
(Optional) Configuring an LDP Label Distribution Control Mode
Context
By default, the LDP label distribution control mode is ordered. In the ordered mode, an LSR advertises the mapping between a label and an FEC to its upstream LSR only when this LSR is the outgoing node of the FEC or receives the Label Mapping message of the next hop for the FEC. If you want to quickly deploy services, you can set the LDP label distribution control mode to independent. In the independent mode, a local LSR can distribute a label bound to an FEC and then inform the upstream LSR, without waiting for the label distributed by the downstream LSR.
However, in the independent mode, an LSP cannot be established if the local LSR does not receive the label for the FEC distributed by the downstream LSR. The ingress node cannot detect an LSP establishment failure and keeps on forwarding service packets. When service packets reach the LSR, the LSR fails to forward the packets to its downstream LSR, causing service interruption. For example, services cannot be switched from the primary LSP to the backup LSP, resulting in service interruption.
(Optional) Configuring an LDP Label Advertisement Mode
Context
By default, a downstream node sends Label Mapping messages to its upstream node. When faults occur on the network, services can be fast switched to the standby path, improving network reliability. Edge devices on the MPLS network are low-end devices. To ensure network reliability, resources must be fully used. You can configure the Downstream on Demand (DoD) mode to save system resources. In DoD mode, the downstream LSR sends a Label Mapping message to the upstream LSR only when the upstream LSR sends a Label Request message to the downstream LSR.
Procedure
Run system-view
The system view is displayed.
Run interface interface-type interface-number
The interface view is displayed.
Run mpls ldp advertisement { dod | du }
A label advertisement mode is configured.
By default, the label advertisement mode is downstream unsolicited (DU).
Modifying a configured label advertisement mode leads to the reestablishment of an LDP session, resulting in MPLS service interruption.
(Optional) Configuring LDP to Automatically Trigger the Request in DoD Mode
Context
On a large-scale network, to reduce the burden on edge devices, use the DoD mode. Because edge devices cannot learn the accurate route to the remote peer, an LDP LSP cannot be set up even if LDP extensions for inter-area LSPs are configured. You can configure the DoD mode in which the local LSR requests a Label Mapping message from a specified downstream LSR or all LSRs to set up an LDP LSP.
Configuring a remote LDP session according to Configuring Basic Functions of MPLS LDP
Procedure
- Configure automatic triggering of a request to a downstream
node for a Label Mapping message associated with all remote LDP peers
in DoD mode.
- Configure automatic triggering of a request to a downstream
node for a Label Mapping message associated with a remote LPD peer
with a specified LSR ID in DoD mode.
(Optional) Configuring MPLS MTU
Context
The size of the maximum transmission unit (MTU) determines the maximum number of bytes that can be transmitted by the sender at a time. If the MTU exceeds the maximum number of bytes supported by the receiver or a transit device, packets are fragmented or even discarded, which increases the network transmission load. In this manner, devices have to calculate the MTU before the communication to ensure that sent packets reach the receiver successfully.
LDP MTU = Min {All MTUs advertised by all downstream devices, MTU of the local outbound interface}
If an interface MTU but not an MPLS MTU is configured on an interface, the interface MTU is used.
If both an MPLS MTU and an interface MTU are configured on an interface, the smaller value between the MPLS MTU and the interface MTU is used.
Procedure
- Run system-view
The system view is displayed.
- Run mpls ldp
The MPLS LDP view is displayed.
- Run the following commands as required.
Run undo mtu-signalling
The LSR is disabled from sending Label Mapping messages carrying MTU TLVs.
By default, the router sends Label Mapping messages carrying the Huawei private MTU TLV.
If a non-Huawei device does not support the MTU TLV, to implement interworking, configure the device not to encapsulate the MTU TLV in Label Mapping messages. If the LSR is disabled from sending the MTU TLV, the configured MPLS MTU does not take effect.
Run mtu-signalling apply-tlv
The LSR is configured to send Label Mapping messages carrying MTU TLVs that comply with RFC 3988.
By default, the router sends Label Mapping messages carrying Huawei proprietary MTU TLV.
If a non-Huawei device supports the MTU TLV, to implement interworking, configure the device to send Label Mapping messages carrying MTU TLVs that comply with RFC 3988. Otherwise, the configured MPLS MTU may not take effect.
Enabling or disabling the function to send an MTU TLV leads the reestablishment of existing LDP sessions, resulting in MPLS service interruption.
- Run quit
The system view is displayed.
- Run interface interface-type interface-number
The view of an MPLS-enabled interface is displayed.
- Run mpls mtu mtu
An MPLS MTU is configured on the interface.
By default, the MTU of MPLS packets is equal to the interface MTU.
The MPLS MTU takes effect in L2VPN (VLL and PWE3) scenarios only.
(Optional) Configuring the MPLS TTL Processing Mode
Context
MPLS processes the TTL in the following modes:
MPLS TTL processing modes
In MPLS VPN applications, the MPLS backbone network needs to be shielded to ensure network security. The MPLS Pipe mode on the ingress node is recommended for private network packets. To reflect the path where packets pass, use the MPLS Uniform mode on the ingress node.
Path where ICMP response packets are transmitted
By default, when the received MPLS packet contains only one label, the LSR directly sends an ICMP response packet to the sender using an IP route. When the received MPLS packet contains multiple labels, the LSR sends an ICMP response packet to the sender along an LSP.
The MPLS VPN packets may contain only one label when they arrive at an autonomous system boundary router (ASBR) on the MPLS VPN, or a superstratum PE (SPE) device in HoVPN networking. These devices have no IP routes to the sender, so they forward the ICMP response packets along an LSP.
(Optional) Configuring the LDP Label Policies
Context
The LSR distributes labels to both upstream and downstream LDP peers, which increases the LDP LSP convergence speed. However, receiving and sending Label Mapping messages result in the establishments of a large number of LSPs, which wastes resources. To reduce the number of LSPs and save memory, use the following policies:
Configure the LSP label filtering policy.
Configure LDP inbound policy or outbound policy to restrict the receiving and sending of Label Mapping messages.
Configure the LDP split horizon policy.
Access devices on the MPLS network have low performance If LDP distributes labels to all peers, a large number of LSPs will be established, which cannot be processed by the LSR. The split horizon policy is recommended.
Procedure
- Configure an inbound
LDP policy.
- Configure an outbound
LDP policy.
- Configure an LDP split horizon policy.
Follow-up Procedure
To delete all inbound policies, run the undo command multiple times to delete them one by one, or run the undo inbound peer all command to delete them simultaneously. The first method takes a long time.
To delete all outbound policies, run the undo command multiple times to delete them one by one, or run the undo outbound peer all command to delete them simultaneously. The first method takes a long time.
(Optional) Disabling a Device from Distributing Labels to Remote Peers
Context
In MPLS L2VPN scenarios using LDP (including Martini VLL and PWE3), PEs at both ends need to establish a remote LDP session. The remote LDP session is only used to transmit Label Mapping messages, so LDP is not required. By default, LDP allocates common LDP labels to remote peers. Many useless idle labels are generated, wasting LDP labels.
To solve the preceding problem, disable a device from distributing labels to remote peers to save system resources. You can use either of the following modes:
In the LDP view, disable the PE from distributing labels to all remote peers.
In the view of a specified remote peer, disable the PE from distributing labels to the specified remote peer.
(Optional) Configuring a Policy for Triggering LDP LSP Establishment
Context
After MPLS LDP is enabled, LSPs are automatically established. If no policy is configured, an increasing number of LSPs are established, wasting resources.
Configure the lsp-trigger command on the ingress and egress nodes to trigger LSP setup based on routes. This setting controls the number of LSPs and saves network resources.
Configure the propagate mapping command on the transit node to allow LDP to use routes matching specified conditions to establish transit LSPs. For the routes that do not match specified conditions, the local device does not send Label Mapping messages to the upstream device, which reduces the number of LSPs and saves network resources.
By default, the lsp-trigger command is used. If policies cannot be configured on the ingress and egress nodes, configure the propagate mapping command on the transit node.
(Optional) Configuring Delayed Transmission of Label Withdraw Messages
Context
An LSP on a local node flaps because an LDP session between the node and its downstream peer flaps, a route flaps, or an LDP policy is modified. The local node repeatedly sends Label Withdraw and Label Mapping messages in sequence to upstream nodes. This causes the upstream nodes to repeatedly tear down and reestablish LSPs. As a result, the entire LDP LSP flaps. The label withdraw delay function prevents the entire LDP LSP from flapping.
Perform the following steps on each node of an LDP LSP:
Procedure
- Run system-view
The system view is displayed.
- Run mpls ldp
The MPLS-LDP view is displayed.
- Run label-withdraw-delay
The label withdraw delay function is enabled.
By default, the label withdraw delay function is disabled.
- Run label-withdraw-delay timer time
The delay time for a Label Withdraw message to be sent is set.
The default delay time is 5 seconds.
(Optional) Disabling LDP from Tearing Down a Session After Error Packets Are Received
Disabling LDP from tearing down a session after error packets are received is beneficial to service maintenance and can also be used for LDP fault recovery.
Context
LDP should tear down a session after error TCP packets are received. This processing mode causes the LDP session to frequently flap and L2VPN services carried on the LDP session to be frequently interrupted. To resolve these problems, disable LDP from tearing down a session after error packets are received.
Verifying the Configuration of Basic MPLS LDP Functions
Procedure
- Run the display default-parameter mpls management command to check default configurations of the MPLS management module.
- Run the display default-parameter mpls ldp command to check the default configurations of MPLS LDP.
- Run the display mpls interface [ interface-type interface-number ] [ verbose ] command to check information about MPLS-enabled interfaces.
- Run the display mpls ldp [ all ] [ verbose ] command to check LDP information.
- Run the display mpls ldp interface [ interface-type interface-number | [ all ] [ verbose ] ] command to check information about LDP-enabled interfaces.
- Run the display mpls ldp adjacency [ interface interface-type interface-number | remote ] [ peer peer-id ] [ verbose ] command to check information about LDP adjacencies.
- Run the display mpls ldp adjacency statistics command to check statistics about LDP adjacencies.
- Run the display mpls ldp session [ [ all ] [ verbose ] | peer-id ] command to check the LDP session status.
- Run the display mpls ldp session statistics command to check statistics about sessions between LDP peers.
- Run the display mpls ldp peer [ [ all ] [ verbose ] | peer-id ] command to check information about LDP peers.
- Run the display mpls ldp peer statistics command to check statistics about LDP peers.
- Run the display mpls ldp remote-peer [ remote-peer-name | peer-id lsr-id ] command to check information about the LDP remote peer.
- Run the display mpls ldp lsp [ all ] command to check LDP LSP information.
- Run the display mpls ldp lsp statistics command to check statistics about LDP LSPs.
- Run the display mpls route-state [ { exclude | include } { idle | ready | settingup } * | destination-address mask-length ] [ verbose ] command to check the dynamic LSP route.
- Run the display mpls lsp [ verbose ] command to check LSP information.
- Run the display mpls lsp statistics command to check statistics about the LSPs that are in the Up state and the number of the LSPs that are activated on the ingress, transit, and egress nodes.
- Run the display mpls label all summary command to check allocation information about all MPLS labels.
- Configuring the LSR ID
- Enabling Global MPLS
- Enabling Global MPLS LDP
- Configuring LDP Sessions
- (Optional) Configuring an LDP Transport Address
- (Optional) Configuring Timers for LDP Session
- (Optional) Configuring the PHP Feature
- (Optional) Configuring an LDP Label Distribution Control Mode
- (Optional) Configuring an LDP Label Advertisement Mode
- (Optional) Configuring LDP to Automatically Trigger the Request in DoD Mode
- (Optional) Configuring MPLS MTU
- (Optional) Configuring the MPLS TTL Processing Mode
- (Optional) Configuring the LDP Label Policies
- (Optional) Disabling a Device from Distributing Labels to Remote Peers
- (Optional) Configuring a Policy for Triggering LDP LSP Establishment
- (Optional) Configuring Delayed Transmission of Label Withdraw Messages
- (Optional) Disabling LDP from Tearing Down a Session After Error Packets Are Received
- Verifying the Configuration of Basic MPLS LDP Functions