01 MPLS Implementation and Configuration
01 MPLS Implementation and Configuration
Configuration
age 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Forewor
d
In the mid-1990s, Internet traffic grew rapidly. Traditional IP packets were forwarded by
routers based on routing tables. However, due to hardware technology limitations, the
forwarding performance of routers is low. As a result, this mode becomes a bottleneck for
network data forwarding.
As such, the Multiprotocol Label Switching (MPLS) protocol is proposed. It is designed to speed
up packet forwarding on routers. On an MPLS network, IP packet headers are analyzed on
network edges only, and MPLS uses labels to guide packet forwarding inside the MPLS
network. Label-based forwarding features high efficient, shortening the packet processing
time.
With the continuous improvement of devices' hardware performance, the advantage of MPLS
in improving the data forwarding speed is gradually weakened. However, as MPLS supports
multi-layer label nesting and forwarding-and-control separation inside a device, MPLS is
applicable to many scenarios, such as virtual private network (VPN) and quality of service
(QoS).
age 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objective
s
On completion of this course, you will be able to:
Understand basic MPLS concepts and terms.
Understand the principles of MPLS.
Configure static LSPs.
Describe the MPLS forwarding process.
age 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. MPLS Basics
▪ MPLS Overview
▫ MPLS Terms
▫ MPLS Labels
2. MPLS Forwarding
3. Static LSP Configuration
age 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Traditional IP Routing and Forwarding
Traditional IP forwarding uses the hop-by-hop forwarding mode, in which a packet is decapsulated by all
routers that receive the packet. Each router needs to obtain the network layer information and search its
routing table for a route based on the longest match rule. The repeated processes of decapsulating packets,
searching routing tables, and re-encapsulating the packets on routers result in low forwarding performance.
age 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic MPLS Concepts
MPLS is located between the data link layer and the network layer in the TCP/IP protocol stack
and can provide services for all network layers.
An MPLS header is added between a data-link-layer header and a network-layer header, and
data can be forwarded quickly based on the Label field in the MPLS header.
This course describes the application of MPLS on IP networks only.
IP header-based
Destination: MPLS label-based MPLS label-based forwarding
3.3.3.3 forwarding forwarding
IP network IP
network
3.3.3.0/24
Etherne
MPLS IP
t
Header Packet
Header
age 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. MPLS Basics
▫ MPLS Overview
▪ MPLS Terms
▫ MPLS Labels
2. MPLS Forwarding
3. Static LSP Configuration
age 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Terms - LSR and MPLS Domain
MPLS domain: consists of a series of consecutive network devices that run MPLS.
Label switching router (LSR): a routing device, such as a router or switch, that runs MPLS. An
LSR that resides at the edge of an MPLS domain and connects to a non-MPLS network is called
a label edge router (LER). An LSR that resides inside an MPLS domain is called a core LSR.
IP IP
network network
LE Core LE
R MPLSLSR R
Domain
Etherne
MPLS IP
t
Header Packet
Header
age 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Terms - LSR Classification
In addition to location-based LSR classification, LSRs can also be classified according to data
processing modes:
Ingress LSR: generally pushes an MPLS header into an IP packet and generates an MPLS packet.
Transit LSR: generally pushes a label, swaps a label, or pops out a label in a received MPLS packet, and
then forwards the packet inside the MPLS domain.
Egress LSR: generally pops out an MPLS header to restore the IP packet.
IP IP
network network
Ingress Transit Egress
LSR MPLSLSR LSR
Domain
Etherne
MPLS IP
t
Header Packet
Header
age 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Terms - FEC
Forwarding equivalence class (FEC): a set of packets with similar or identical characteristics
and forwarded in the same way by LSRs.
On an MPLS network, FECs can be classified based on destination IP addresses, network masks, DSCP
values, and so on.
When a packet enters an MPLS domain, the ingress LSR determines the LSP to which the packet
belongs.
MPLS labels match FECs. A mechanism must be available for LSRs to obtain label information about
FECs.
Destination:
3.3.3.3
IP IP
network network
Ingress Transit Egress 3.3.3.0/24
LSR MPLSLSR LSR
The ingress LSR
determines the LSP to Domain
which the data belongs Etherne
MPLS IP
and adds a label to the t
Header Packet
packet. Header
age 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Terms - LSP
Label switched path (LSP): a path through which a labeled packet traverses an MPLS domain to reach a
destination.
The packets of the same FEC usually traverse an MPLS domain through the same LSP. Therefore, an LSR
always uses the same label to forward the packets of the same FEC.
LSP
1
R R
4 5
Destination:
3.3.3.3
IP network IP network
1.1.1.0/24 3.3.3.0/24
R R R
Destination: 1 2 3
3.3.3.3
IP network
2.2.2.0/24
R R LSP R
8 2 MPLS
7 Etherne
6 MPLS IP
Domain t
Header Packet
Header
age 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. MPLS Basics
▫ MPLS Overview
▫ MPLS Terms
▪ MPLS Labels
age 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Labels
Before an IP packet enters an MPLS domain, the ingress LSR pushes an MPLS header (also called
an MPLS label) into the packet to form an MPLS labeled packet. An MPLS labeled packet can
contain one or more labels.
age 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Label Space
A label is a short and fixed-length identifier that has only local significance. A label
space means a label value range. The label value range and planning are as follows:
age 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MPLS Label Processing
LSRs can perform the following operations on labels: push, swap, and pop.
Push Swap Pop
Pus Swa
h Po
30 20 p 30 30
IP IP IP IP IP p IP
0 0 0 0
Pus Swa
20 40 30 40 Po
40 h 30 40 p 30 40 40
IP IP IP IP IP p IP
0 0 0 0 0 0 0 0 0 0
When an IP packet enters an MPLS When the packet is forwarded Before the packet leaves the MPLS
domain, the ingress adds a label inside the MPLS domain, a transit domain, the egress removes the
between the Layer 2 frame header node searches the label forwarding label of the MPLS packet.
and IP header of the packet. When table and replaces the top label
the packet reaches a transit node, with the label that is assigned by
the transit node can also add a the next hop.
new label at the top of the label
stack.
age 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. MPLS Basics
2. MPLS Forwarding
3. Static LSP Configuration
age 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic LSP Label-based
Concepts Establishment Forwarding
IP IP IP IP
network network network network
1.1.1.0/24 2.2.2.0/24 3.3.3.0/24 4.4.4.0/24
Destination: 4.4.4.4 Destination: 4.4.4.4 Destination: 4.4.4.4
MPLS
Domain
R R R R
1 2 3
FEC1 4
Label: 200
FEC1 LSP3: {R3,
Label: 100 R4}
FEC1 LSP2: {R2, R3, R4}
Label: 100
LSP1: {R1, R2, R3, R4}
age 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic LSP Label-based
Concepts Establishment Forwarding
MPLS Architecture
The MPLS architecture consists of a control plane and a forwarding plane.
age 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic LSP Label-based
Concepts Establishment Forwarding
RIB RIB
Label
information LDP LDP
exchange
age 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
LSP
Label-based
Basic Concepts Establishme
Forwarding
nt
IP MPLS IP network
network Domain 4.4.4.0/24
1.1.1.0/24 R R R R
1 2 3 4
• A device provides an incoming label and an outgoing label for each FEC. The incoming label indicates the one
that needs to be carried in a received packet. The outgoing label indicates the one that needs to be carried in a
sent packet.
• Assume that a packet destined for 4.4.4.0/24 is sent from R1 to R2. R1 is the upstream LSR of R2, and R3 is the
downstream LSR of R2. To ensure that a labeled packet is correctly processed and forwarded, the outgoing label
carried in the packet sent from R1 to R2 must be the same as the incoming label on R2 for the FEC to 4.4.4.0/24.
Similarly, the outgoing label on R2 for the FEC to 4.4.4.0/24 must be the same as the incoming label of R3.
age 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
LSP
Label-based
Basic Concepts Establishme
Forwarding
nt
age 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Label-
LSP
Basic Concepts based
Establishment
Forwarding
3.3.3.1/2
IF1 IF2 IF1 IF2 IF1 IF2 Note:
1.1.1.1/24 1.1.1.2/24 2.2.2.1/24 2.2.2.2/24
4
NH=NEXTHO
Ingres Transi Egress P
s t IF=Interface
age 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Label-
LSP
Basic Concepts based
Establishment
Forwarding
3.3.3.1/2
IF1 IF2 IF1 IF2 IF1 IF2 Note:
1.1.1.1/24 1.1.1.2/24 2.2.2.1/24 2.2.2.2/24
4
NH=NEXTHO
Ingres Transi Egress P
s t IF=Interface
age 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Label-
LSP
Basic Concepts based
Establishment
Forwarding
8. An egress LSR searches the ILM table for the • S = 1: The current label is
operation type that matches the FEC of the packet. the bottom label, and IP
The operation type is always pop on an egress LSR. forwarding is performed for
As such, the egress LSR removes the label from the the packet.
packet. 9
• S = 0: The current label is
9. The egress LSR performs further processing based on not the bottom label, and a
ILM lower-layer label exists. In
the inner header in the packet. In Tunnel
In IF OPER
Label ID this case, the packet is
Y IF1 0x22 Pop
performed based on the
8
IP: Push IP: Swap IP: IP: lower-layer label.
3.3.3.1
Z
3.3.3.1
Y 3.3.3.1 3.3.3.1
3.3.3.1/2
IF1 IF2 IF1 IF2 IF1 IF2 Note:
1.1.1.1/24 1.1.1.2/24 2.2.2.1/24 2.2.2.2/24
4
NH=NEXTHO
Ingres Transi Egress P
s t IF=Interface
age 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Label-
LSP
Basic Concepts based
Establishment
Forwarding
FIB LIM
DEST Tunnel ID In Label In IF Tunnel ID In Label In IF Tunnel ID
3.3.3.1/2 Z IF1 0x15 Y IF1 0x22
0x11
4
1 4 5 7 8
IP: Push IP: Swap IP: IP:
3.3.3.1
Z
3.3.3.1
Y 3.3.3.1 3.3.3.1
3.3.3.1/2
IF1 IF2 IF1 IF2 IF1 IF2 Note:
1.1.1.1/24 1.1.1.2/24 2.2.2.1/24 2.2.2.2/24
4
NH=NEXTHO
Ingres Transi Egress P
s t IF=Interface
age 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. MPLS Basics
2. MPLS Forwarding
3. Static LSP Configuration
age 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic MPLS Configuration Commands
1. Set an LSR ID.
The mpls lsr-id command sets an LSR ID. An LSR ID uniquely identifies an LSR on a network. By default, no LSR ID
is set for an LSR, and an LSR ID can only be manually set. To improve network reliability, you are advised to use the
IP address of a loopback interface on an LSR as the LSR ID and plan the LSR IDs of all LSRs on the network in a
unified manner before configuration.
2. Enable MPLS.
[Huawei] mpls
The mpls command enables MPLS on the current node and displays the MPLS view.
[Huawei-GigabitEthernet0/0/0] mpls
Enable MPLS on an interface. Before running this command, enable MPLS globally.
age 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Commands
(1)
1. Configure a static LSP on an ingress LSR.
age 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Commands
(2)
3. Configure a static LSP on an egress LSR.
age 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Example (1)
Use case: An IGP has been deployed on R1, R2, and R3. The networks 1.1.1.0/24 and 3.3.3.0/24 can
communicate with each other. In this scenario, configure static LSPs to allow the two networks to
communicate through MPLS. The following figure shows the distributed labels.
Configuration roadmap:
1. Enable MPLS on the devices and interfaces.
age 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Example (2)
1. The LSR IDs of the three routers are 10.1.1.1, 10.1.1.2, and 10.1.1.3, respectively. The following
example uses R1 to describe the configuration. Enable MPLS globally and on interfaces on R1.
age 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Example (3)
2. Configure a static LSP from R1 to R3.
[R1] static-lsp ingress 1to3 destination 3.3.3.0 24 nexthop 10.0.12.2 out-label 200
[R2] static-lsp transit 1to3 incoming-interface GigabitEthernet 0/0/0 in-label 200 nexthop 10.0.23.3 out-label
300
[R3] static-lsp egress 1to3 incoming-interface GigabitEthernet 0/0/0 in-label 300
age 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Example -
Checking the Configuration
[R1]display mpls lsp [R2]display mpls lsp
--------------------------------------------------------------------- ---------------------------------------------------------------------
LSP Information: STATIC LSP LSP Information: STATIC LSP
--------------------------------------------------------------------- ---------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name FEC In/Out Label In/Out IF Vrf Name
age 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Static LSP Configuration Example -
Packet Header Obtaining Analysis
No. Time Source Destination Protocol Length Info
5 12.109000 1.1.1.1 3.3.3.3 ICMP 102 Echo
(ping) request
Frame 5: 102 bytes on wire (816 bits), 102 bytes captured (816 bits) on interface 0
Ethernet II, Src: HuaweiTe_b1:15:3e (00:e0:fc:b1:15:3e), Dst: HuaweiTe_49:20:bb
(00:e0:fc:49:20:bb)
MultiProtocol Label Switching Header, Label: 300, Exp: 0, S: 1, TTL: 254
Internet Protocol Version 4, Src: 1.1.1.1, Dst: 3.3.3.3
Internet
No. Control
TimeMessageSource
Protocol Destination Protocol Length Info
6 12.141000 3.3.3.3 1.1.1.1 ICMP 98 Echo (ping) reply
Frame 6: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0
Ethernet II, Src: HuaweiTe_49:20:bb (00:e0:fc:49:20:bb), Dst: HuaweiTe_b1:15:3e
(00:e0:fc:b1:15:3e)
Internet Protocol Version 4, Src: 3.3.3.3, Dst: 1.1.1.1
Internet Control Message Protocol
According to the obtained packet information, the packets from the
host on the 1.1.1.0/24 network segment to the host on the 3.3.3.0/24
network segment are forwarded based on MPLS labels.
The packets from the host on the 3.3.3.0/24 network segment to the
host on the 1.1.1.0/24 network segment are forwarded based on IP
packet headers.
age 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. (Multi-Answer) Which of the following statements about an MPLS header are
correct?
A. An MPLS header is 32 bits long.
B. The value of the Label field in an MPLS header ranges from 0 to 65535.
D. The max_hop field in an MPLS header can be used to prevent labeled packets from being
infinitely forwarded.
2. (Single-Answer) The values of the incoming and the outgoing label both range from
16 to 1023 for a static LSP to be configured on a transit LSR.
A. True
B. False
age 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summar
y
MPLS was originally proposed to solve the problem of low forwarding speed of
traditional IP routers. MPLS implements fast forwarding through label headers.
An MPLS label is a short and fixed-length identifier that has only local significance. It
is used to uniquely identify the FEC to which a packet belongs. Label operations on
an LSR include push, swap, and pop.
MPLS consists of the control plane and data plane. The control plane transmits
routing information and distributes labels, and the data plane forwards data.
With the development of technologies, the advantage of MPLS in the data
forwarding speed is weakened gradually, but MPLS is widely used in the VPN area
due to its pros.
age 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
age 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.