Basic MPLS LDP Configuration
NOTE:
Before configuring MPLS, routing protocols such as OSPF/ ISIS need to be configured on each LSR to achieve IP connectivity between LSRs.
MPLS (Multiprotocol Label Switching) is a technique used in modern networking to improve packet forwarding efficiency by using labels rather than traditional IP routing. Label Distribution Protocol (LDP) is the most commonly used protocol for distributing labels in MPLS networks. It is responsible for establishing and maintaining Label-Switched Paths (LSPs) by advertising the mapping between IP prefixes and labels across routers.
This section provides a comprehensive description of basic MPLS LDP configuration and its importance in a typical MPLS network.
Enable MPLS on Interfaces
Before enabling LDP, MPLS must be enabled on each interface that will participate in the MPLS label switching process.
The following example enables MPLS on VLAN interface vlan200.
admin@PICOS# set protocols mpls interface vlan200
admin@PICOS# commit
This ensures that MPLS forwarding is active on the specified L3 interface (VLAN interface, loopback interface, routed interface or sub-interface). This enables MPLS for all traffic passing through that interface, making it part of the MPLS domain for the labeled packet switching. Usually, both the incoming and outgoing interfaces of the packets need to enable MPLS.
Configuring a Router ID
The router ID should be configured first when you configure MPLS LDP. The router ID is a string similar to the IP address, and is the identifier of a LSR. You should not change the router ID after completing the configuration. By default, the MPLS LDP router ID is not configured.
admin@PICOS# set protocols mpls ldp router-id 2.2.2.2
admin@PICOS# commit
Enable MPLS LDP on the L3 Interface
LDP must be explicitly enabled on each interface that will be used for label distribution. This ensures that LDP neighbors are discovered on those interfaces and that labels are exchanged.
The following command can be used to enable MPLS LDP on an L3 interface under IPv4/IPv6 address family.
set protocols mpls ldp {ipv4-family|ipv6-family} interface <interface-name>
It is required to be configured on all nodes in the MPLS domain.
MPLS can support multiple protocol families (IPv4, IPv6, etc.). By specifying ipv4-family (ipv6-family)
, you ensure that LDP only distributes labels for IPv4 (IPv6) prefixes over this interface.
The following commands enable MPLS LDP on interface vlan200 of IPv4 address family.
admin@PICOS# set protocols mpls ldp ipv4-family interface vlan200
admin@PICOS# commit
The following commands enable MPLS LDP on interface vlan400 of IPv6 address family.
Once LDP is enabled on the L3 interface for the IP family, the router starts advertising and learning labels for IP routes over this interface.
Configure MPLS LDP Transport Address
This address is used as the source address in the Hello message of LDP link.
LDP session is based on TCP connection, when two LSRs want to establish an LDP session between them, they need to confirm the LDP transport address of the peer before they can establish a TCP connection.
The following commands configure MPLS LDP transmission address under IPv4 address family.
The following commands configure MPLS LDP transmission address under IPv6 address family.
(Optional) Enable Ordered Control Mode for MPLS LDP
In MPLS LDP, ordered control is one of two label distribution modes (the other being independent control). In ordered control, a router only distributes a label for a particular FEC (Forwarding Equivalence Class) if it is the egress router for that FEC, or if it has already received a label for that FEC from its next hop. This ensures a more structured and synchronized label distribution process.
Independent Control (the alternative mode) allows routers to advertise labels for a FEC as soon as they learn about it, without waiting for downstream routers to assign labels. This the default label distribution mode for MPLS LDP.
Advantages When Using Ordered-Control
Enabling ordered control offers the following advantages; therefore, it is recommended to enable the ordered control mode.
Label distribution is more controlled and happens from downstream routers to upstream routers.
It helps to avoid issues such as forwarding loops in complex network topologies.
Useful in situations where label distribution must be tightly synchronized between routers.
Example
Enable LDP Ordered Label Distribution Control.
This command would typically be configured on MPLS-enabled routers to ensure they follow the ordered control mode for LDP, improving synchronization and reducing potential issues with label assignment.
Verify LDP Neighbor Discovery
After configuration, check that LDP neighbors are discovered. Run the command run show mpls ldp neighbor to display the current LDP neighbors.
Ensure that the router has assigned labels to IP routes and that the labels are being advertised to LDP neighbors. You can use the command run show mpls ldp binding to view Label Information Base (LIB) information.
Copyright © 2024 Pica8 Inc. All Rights Reserved.