An Introduction to MPLS (Multiprotocol Label Switching) Operations.
- Francisco Augusto Nascimento Antonio
- Aug 20, 2020
- 5 min read
Updated: Jul 15, 2021
MPLS is a packet-forwarding method that makes forwarding decisions based on labels instead of on the Layer3 destination of the packet. MPLS was designed to support many different Layer3 protocols.
MPLS decreases forwarding overhead on core routers, making them more efficient. Being MPLS very efficient and flexible, MPLS can forward other Layer3 protocols besides IPv4, and MPLS supports multiple services such as unicast routing, multicast routing, VPNs, Traffic Engineering (TE), QoS, and Any Transport Over MPLS (AToM).
I gonna examine here the Label Information Base (LIB), the Label Forwarding Information Base (LFIB), Label Distribution Protocol (LDP), the Label-Switched Path (LSP), and Label Switching Routers (LSRs).

MPLS LIB and LFIB
Once the IP routing table is built and the network is converged, each LSR assigns labels to each network destination represented in the routing table. These assigned labels are only locally significant and stored in a Label Information Base (LIB).
The LSR then announces its assigned labels to its adjacent peers, who, in turn, propagate the information to their peers. Peers use received label information to associate nest hope label information with network information, with network destination. This information is stored in the Forwarding Information Base (FIB) and Label Forwarding Information Base (LFIB).
Each LSR builds its LIB, LRIB, and FIB based on received labels.
LIB
The LIB is part of the control plane and provides the database used by LDP for label distribution. This is where IP prefixes are associated with their local and next-hop label entries learned from downstream peers. The LIB maintains the mapping between the IP prefix, the assigned label, and the assigning label.
LFIB
The LFIB is part of the data plane and provides the database used in forwarding labelled packets. The IGP is used to populate the routing tables in all MPLS routers throughout the network. Based on information shared in IGP routing updates, each router determines the path with the most attractive metric for a given network destination.
Label Switching Routers.
See figure above, routers R1 through R5 are part of the MPLS. They understand MPLS labels and can receive and transmit labelled packets on their interfaces. In this case, R1 and R5 are considered edge LSRs, and R2, R3, and R4 are considered intermediate LSRs. An edge LSR sits at the edge of the MPLS domain and adds labels to packets that are entering the MPLS domain (known as an ingress LSR), removes labels from packets that will be leaving the MPLS domain (know as an egress LSR), and even forwards packets as needed based on labels or lack of a label.
An intermediate LSR sits within the MPLS domain and primarily forwards packets using label information.

Label-Switching Path.
A label-switched path (LSP) is a path through an MPLS network.
The path begins at a label edge router (LER), which makes a decision on which label t prefix to a packet, based on the appropriate FEC. It then forwards the packet along to the next router in the path, which swaps the packet's outer label, and forwards it to the next router. The last router removes the label from the packet and forwards the packet based on the header of its next layer, for example, IPv4.
LSPs are unidirectional; they enable a packet to be label switched through the MPLS network from one endpoint to another since bidirectional communication is typically desired, the aforementioned dynamic signalling protocols can set up an LSP in the other direction to compensate for this.
Label
A label is a short, fixed-length (4 bytes) identifier that is only locally significant. A label identifies an FEC to which a packet belongs. In some cases, such as load balancing, an FEC can be mapped to multiple incoming labels. Each label, however, represents only one FEC on a device.
Compared with an IP packet, an MPLS packet has the additional 4-byte MPLS label. The MPLS label is between the link-layer header and the network layer header and allows the use of any link layer protocol. The following figure shows the position of an MPLS label and fields in the MPLS label.

An MPLS label contains the following fields:
Label: 20-bit label value.
Exp: 3-bit, used as an extension value. Generally, this field is used as the class of service (CoS) field. When congestion occurs, devices prioritize packets that have a larger value in this field.
S: a 1-bit value indicating the bottom of a label stack. MPLS supports nesting of multiple labels. When the S field is 1, the label is at the bottom of the label stack.
TTL: time to live. This 8-bit field is the same as the TTL field in IP packets.
MPLS-enabled routers automatically assign labels to every network that they know about.
How does a router know about a network? It can be locally configured by configuring an IP address on a router interface and issuing no shutdown command on the interface or through the propagation of routing information with dynamic routing protocols such as OSPF and EIGRP.
Label Distribution Protocol
Label Distribution Protocol (LDP) is a protocol in which routers capable of Multiprotocol Label Switching (MPLS) exchange label mapping information. Two routers with an established session are called LDP peers and the exchange of information is bi-directional. LDP is used to build and maintain LSP databases that are used to forward traffic through MPLS networks.
LDP can be used to distribute the inner label (VC/VPN/service label) and outer label (path label) in MPLS. For inner label distribution, targeted LDP (tLDP) is used. LDP and tLDP discovery run on UDP port 646 and the session is built on TCP port 646. During the discovery phase hello packets are sent on UDP port 646 to the 'all routers on this subnet' group multicast address (224.0.0.2). However, tLDP unicasts the hello packets to the targeted neighbour's address.

Label Distribution Protocol
Label Switching
Label switching is a technique of network relaying to overcome the problems perceived by traditional IP-table switching (also known as traditional layer 3 hop-by-hop routing. Here, the switching of network packets occurs at a lower level, namely the data link layer rather than the traditional network layer.
Each packet is assigned a label number and the switching takes place after examination of the label assigned to each packet. The switching is much faster than IP-routing. New technologies such as Multiprotocol Label Switching (MPLS) use label switching. The established ATM protocol also uses label switching at its core.
Penultimate Hop Popping
Penultimate hop popping (PHP) is a function performed by certain routers in an MPLS enabled network. It refers to the process whereby the outermost label of an MPLS tagged packet is removed by a Label Switch Router (LSR) before the packet is passed to an adjacent Label Edge Router (LER). The benefit is that the LSR has to do a label lookup anyway and it doesn't make a difference whether this results in a label swap or pop. However, for the LER this saves one cycle of label lookup.
The process is important in a Layer 3 MPLS VPN (RFC 2547) environment as it reduces the load on the LER. If this process didn't happen, the LER would have to perform at least 2 label lookups:
The outer label, identifying that the packet was destined to have its label stripped on this router.
The inner label, to identify which Virtual Routing and Forwarding (VRF) instance to use for the subsequent IP routing lookup.
In large, loaded networks the additional time required for second label lookup can make a difference in the overall forwarding performance and reduce buffering.
PHP functionality is achieved by the LER advertising a label with a value of 3 to its neighbours. This label is defined as implicit-null and informs the neighbouring LSR(s) to perform PHP.
Comments