08-MPLS Configuration Guide-Basic MPLS Configuration
08-MPLS Configuration Guide-Basic MPLS Configuration
i
Configuring basic MPLS
Multiprotocol Label Switching (MPLS) provides connection-oriented label switching over
connectionless IP backbone networks. It integrates both the flexibility of IP routing and the simplicity
of Layer 2 switching.
Overview
MPLS has the following features:
• High speed and efficiency—MPLS uses short- and fixed-length labels to forward packets,
avoiding complicated routing table lookups.
• Multiprotocol support—MPLS resides between the link layer and the network layer. It can
work over various link layer protocols to provide connection-oriented services for various
network layer protocols (for example, IPv4, IPv6, and IPX).
• Good scalability—The connection-oriented switching and multilayer label stack features
enable MPLS to deliver various extended services, such as VPN, traffic engineering, and QoS.
Basic concepts
FEC
MPLS groups packets with the same characteristics (such as packets with the same destination or
service class) into a forwarding equivalence class (FEC). Packets of the same FEC are handled in
the same way on an MPLS network.
Label
A label uniquely identifies an FEC and has local significance.
Figure 1 Format of a label
A label is encapsulated between the Layer 2 header and Layer 3 header of a packet. It is four bytes
long and consists of the following fields:
• Label—20-bit label value.
• TC—3-bit traffic class, used for QoS. It is also called Exp.
• S—1-bit bottom of stack flag. A label stack can contain multiple labels. The label nearest to the
Layer 2 header is called the top label, and the label nearest to the Layer 3 header is called the
bottom label. The S field is set to 1 if the label is the bottom label and set to 0 if not.
• TTL—8-bit time to live field used for MPLS loop prevention.
LSR
A router that performs MPLS forwarding is a label switching router (LSR).
1
LSP
A label switched path (LSP) is the path along which packets of an FEC travel through an MPLS
network.
An LSP is a unidirectional packet forwarding path. Two neighboring LSRs are called the upstream
LSR and downstream LSR along the direction of an LSP. As shown in Figure 2, LSR B is the
downstream LSR of LSR A, and LSR A is the upstream LSR of LSR B.
Figure 2 Label switched path
LFIB
The Label Forwarding Information Base (LFIB) on an MPLS network functions like the Forwarding
Information Base (FIB) on an IP network. When an LSR receives a labeled packet, it searches the
LFIB to obtain information for forwarding the packet. The information includes the label operation
type, the outgoing label value, and the next hop.
Control plane and forwarding plane
An MPLS node consists of a control plane and a forwarding plane.
• Control plane—Assigns labels, distributes FEC-label mappings to neighbor LSRs, creates the
LFIB, and establishes and removes LSPs.
• Forwarding plane—Forwards packets according to the LFIB.
2
• Egress LSR—Egress LSR of packets. It removes labels from packets and forwards the
packets to their destination networks.
LSP establishment
LSPs include static and dynamic LSPs.
• Static LSP—To establish a static LSP, you must configure an LFIB entry on each LSR along the
LSP. Establishing static LSPs consumes fewer resources than establishing dynamic LSPs, but
static LSPs cannot automatically adapt to network topology changes. Therefore, static LSPs
are suitable for small-scale networks with simple, stable topologies.
• Dynamic LSP—Established by a label distribution protocol (also called an MPLS signaling
protocol). A label distribution protocol classifies FECs, distributes FEC-label mappings, and
establishes and maintains LSPs. Label distribution protocols include protocols designed
specifically for label distribution, such as the Label Distribution Protocol (LDP), and protocols
extended to support label distribution, such as MP-BGP and RSVP-TE.
In this document, the term "label distribution protocols" refers to all protocols for label distribution.
The term "LDP" refers to the RFC 5036 LDP.
A dynamic LSP is established in the following steps:
1. A downstream LSR classifies FECs according to destination addresses.
2. The downstream LSR assigns a label for each FEC, and distributes the FEC-label binding to its
upstream LSR.
3. The upstream LSR establishes an LFIB entry for the FEC according to the binding information.
After all LSRs along the LSP establish an LFIB entry for the FEC, a dynamic LSP is established for
the packets of this FEC.
Figure 4 Dynamic LSP establishment
3
MPLS forwarding
Figure 5 MPLS forwarding
PHP
An egress node must perform two forwarding table lookups to forward a packet:
• Two LFIB lookups (if the packet has more than one label).
4
• One LFIB lookup and one FIB lookup (if the packet has only one label).
The penultimate hop popping (PHP) feature can pop the label at the penultimate node, so the egress
node only performs one table lookup.
A PHP-capable egress node sends the penultimate node an implicit null label of 3. This label never
appears in the label stack of packets. If an incoming packet matches an LFIB entry containing the
implicit null label, the penultimate node pops the top label and forwards the packet to the egress
node. The egress node directly forwards the packet.
Sometimes, the egress node must use the TC field in the label to perform QoS. To keep the TC
information, you can configure the egress node to send the penultimate node an explicit null label of
0. If an incoming packet matches an LFIB entry containing the explicit null label, the penultimate hop
replaces the top label value with value 0, and forwards the packet to the egress node. The egress
node gets the TC information, pops the label of the packet, and forwards the packet.
Enabling MPLS
Before you enable MPLS, perform the following tasks:
• Configure link layer protocols to ensure connectivity at the link layer.
• Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.
5
• Configure static routes or an IGP protocol to ensure IP connectivity among LSRs.
To enable MPLS:
6
Specifying the label type advertised by the egress
In an MPLS network, an egress can advertise the following types of labels:
• Implicit null label with a value of 3.
• Explicit null label with a value of 0.
• Non-null label.
For LSPs established by a label distribution protocol, the label advertised by the egress determines
how the penultimate hop processes a labeled packet.
• If the egress advertises an implicit null label, the penultimate hop directly pops the top label of a
matching packet.
• If the egress advertises an explicit null label, the penultimate hop swaps the top label value of a
matching packet with the explicit null label.
• If the egress advertises a non-null label, the penultimate hop swaps the top label of a matching
packet with the label assigned by the egress.
Configuration guidelines
As a best practice, configure the egress to advertise an implicit null label to the penultimate hop if the
penultimate hop supports PHP. If you want to simplify packet forwarding on the egress but keep
labels to determine QoS policies, configure the egress to advertise an explicit null label to the
penultimate hop. Use non-null labels only in particular scenarios. For example, when OAM is
configured on the egress, the egress can get the OAM function entity status only through non-null
labels.
As a penultimate hop, the device accepts the implicit null label, explicit null label, or non-null label
advertised by the egress device.
For LDP LSPs, the mpls label advertise command triggers LDP to delete the LSPs established
before the command is executed and re-establishes new LSPs.
For BGP LSPs, the mpls label advertise command takes effect only on the BGP LSPs established
after the command is executed. To apply the new setting to BGP LSPs established before the
command is executed, delete the routes corresponding to the BGP LSPs, and then redistribute the
routes.
For CRLSPs established by using RSVP, the mpls label advertise command takes effect only on
the CRLSPs established after the command is executed. To apply the new setting to CRLSPs
established before the command is executed, delete the CRLSPs and re-establish them.
Configuration procedure
To specify the type of label that the egress node will advertise to the penultimate hop:
7
reflect how many hops the packet has traversed in the MPLS network. The IP tracert facility can
show the real path along which the packet has traveled.
Figure 6 TTL propagation
When TTL propagation is disabled, the ingress node sets the label TTL to 255. Each LSR on the LSP
decreases the label TTL value by 1. The LSR that pops the label does not change the IP TTL value
when popping the label. Therefore, the MPLS backbone nodes are invisible to user networks, and
the IP tracert facility cannot show the real path in the MPLS network.
Figure 7 Without TTL propagation
8
Enabling sending of MPLS TTL-expired
messages
This feature enables an LSR to generate an ICMP TTL-expired message upon receiving an MPLS
packet with a TTL of 1. If the MPLS packet has only one label, the LSR sends the ICMP TTL-expired
message back to the source through IP routing. If the MPLS packet has multiple labels, the LSR
sends it along the LSP to the egress, which then sends the message back to the source.
To enable sending of MPLS TTL-expired messages:
9
Displaying and maintaining MPLS
Execute display commands in any view and reset commands in user view.
Task Command
Display usage information for NIDs. display mpls nid [ nid-value1 [ to nid-value2 ] ]
Display ILM entries. display mpls forwarding ilm [ label ] [ slot slot-number ]
Display NHLFE entries. display mpls forwarding nhlfe [ nid ] [ slot slot-number ]
10