MPLS Overview

Unicast IP Forwarding in Traditional IP Networks

In traditional IP networks, routing protocols are used to distribute Layer 3 routing information.

Regardless of the routing protocol, packet forwarding is based on the destination address alone. Therefore, when a packet is received by the router, it determines the next-hop address using the packet’s destination IP address along with the information from its own forwarding/routing table. This process of determining the next hop is repeated at each hop (router) from the source to the destination except in the case of policy-based routing where a certain outbound policy might affect packet forwarding.

Figure depicts a traditional IP network where network layer reachability information (NLRI) for network is propagated using an IP routing protocol. The following process takes place:

  1. R4 receives a data packet destined for network.
  2. R4 performs route lookup for network in the forwarding table, and the packet is forwarded to the next-hop Router R3.
  3. R3 receives the data packet with destination, performs a route lookup for network, and forwards the packet to next-hop Router R2.
  4. R2 receives the data packet with destination, performs a route lookup for network, and forwards the packet to next-hop Router R1.
  5. Because R1 is directly connected to network, the router forwards the packet on to the appropriate connected interface.

Overview of MPLS Forwarding

In MPLS enabled networks, packets are forwarded based on labels.

  • These labels might correspond to IP destination addresses or to other parameters, such as QoS classes and source address.
  • Labels are generated per router (and in some cases, per interface on a router) and bear local significance to the router generating them.
  • Routers assign labels to define paths called Label Switched Paths (LSP) between endpoints. Because of this, only the routers on the edge of the MPLS network perform a routing lookup.

With MPLS forwarding where route table lookups are performed only by MPLS edge border routers, R1 and R4. The routers in MPLS network R1, R2, and R3 propagate updates for network via an IGP routing protocol just like in traditional IP networks. This leads to the creation of an IP forwarding table.

Also, because the links connecting the routers are MPLS enabled, they assign local labels for destination and propagate them upstream to their directly connected peers using a label distribution protocol.

For example:

  • R1 assigns a local label L1 and propagates it to the upstream neighbor R2.
  • R2 and R3 similarly assign labels and propagate the same to upstream neighbors R3 and R4, respectively.

The following process takes place in the data forwarding path from R4 to R1:

  1. R4 receives a data packet for network and identifies that the path to the destination is MPLS enabled. Therefore, R4 forwards the packet to next-hop Router R3 after applying a label L3 (from downstream Router R3) on the packet and forwards the labeled packet to R3.
  2. R3 receives the labeled packet with label L3 and swaps the label L3 with L2 and forwards the packet to R2.
  3. R2 receives the labeled packet with label L2 and swaps the label L2 with L1 and forwards the packet to R1.
  4. R1 is the border router between the IP and MPLS domains; therefore, R1 removes the labels on the data packet and forwards the IP packet to destination network

Architectural Blocks of MPLS

MPLS functionality on Cisco devices is divided into two main architectural blocks:

  • Control plane: Performs functions related to identifying reachability to destination prefixes. Therefore, the control plane contains all the Layer 3 routing information, as well as the processes within, to exchange reachability information for a specific Layer 3 prefix.
    • Common examples of control plane functions are routing protocol information exchange like in OSPF and BGP.
    • Hence, IP routing information exchange is a control plane function.
    • In addition, all protocol functions that are responsible for the exchange of labels between neighboring routers function in the control plane as well.
  • Data Plane: Performs the functions relating to forwarding data packets. These packets can be either Layer 3 IP packets or labeled IP packets.
    • The information in the data plane, such as label values, are derived from the control plane.
    • Information exchange between neighboring routers creates mappings of IP destination prefixes to labels in the control plane, which is used to forward data plane labeled packets.
Control Plane and Data Plane on a Router

MPLS Terminology

  • Forwarding Equivalence Class (FEC): this group of packets are forwarded in the same manner (over the same path with the same forwarding treatment). Describes a set of incoming packets with similar characteristics, allowing those packets to be allocated the same label and forwarded down the same LSP (Label Switch Path).
  • MPLS Label Switch Router (LSR): Performs the function of label switching; the LSR receives a labeled packet and swaps the label with an outgoing label and forwards the new labeled packet from the appropriate interface.
    • The LSR, depending on its location in the MPLS domain, can either perform label disposition (removal, also called pop), label imposition (addition, also called push) or label swapping (replacing the top label in a label stack with a new outgoing label value).
    • During label swapping, the LSR replaces only the top label in the label stack; the other labels in the label stack are left untouched during label swapping and forwarding operation at the LSR.
  • MPLS Edge-Label Switch Router (E-LSR):
    • The ingress Edge LSR performs the functions of label imposition (push) and forwarding of a packet to destination through the MPLS-enabled domain.
    • The egress Edge LSR performs the functions of label disposition or removal (pop) and forwarding an IP packet to the destination.
  • MPLS Label Switched Path (LSP): The path from source to destination for a data packet through an MPLS-enabled network.
    • LSPs are unidirectional in nature.
    • The LSP is usually derived from IGP routing information but can diverge from the IGP’s preferred path to the destination.
  • Upstream and downstream: The concept of downstream and upstream are pivotal in understanding the operation of label distribution (control plane) and data forwarding in an MPLS domain. Both downstream and upstream are defined with reference to the destination network: prefix or FEC.
    • Data intended for a particular destination network always flows downstream.
    • Updates (routing protocol or label distribution, LDP/TDP) pertaining to a specific prefix are always propagated upstream.
  • MPLS labels and label stacks: An MPLS label is a 20-bit number that is assigned to a destination prefix on a router.

An MPLS label consists of the following parts:

  • 20-bit label value
  • 3-bit experimental field
  • 1-bit bottom-of-stack indicator
  • 8-bit Time-to-Live field

  • The 20-bit label value is a number assigned by the router that identifies the prefix in question. Labels can be assigned either per interface or per chassis.
  • The 3-bit experimental field defines the QoS assigned to the FEC in question that has been assigned a label.
  • A label stack is an ordered set of labels where each label has a specific function.
    • If the router (Edge LSR) imposes more than one label on a single IP packet, it leads to what is called a label stack, where multiple labels are imposed on a single IP packet.
    • Therefore, the bottom-of-stack indicator identifies if the label that has been encountered is the bottom label of the label stack.
  • The TTL field performs the same function as an IP TTL, where the packet is discarded when the TTL of the packet is 0, which prevents looping of unwanted packets in the network. Whenever a labeled packet traverses an LSR, the label TTL value is decremented by 1.

The label is inserted between the Frame Header and the Layer 3 Header in the packet.

If the value of the S bit (bottom-of-stack indicator) in the label is 0, the router understands that a label stack implementation is in use.

  • An LSR swaps only the top label in a label stack.
  • An egress Edge LSR, however, continues label disposition in the label stack until it finds that the value of the S bit is set to 1, which denotes a bottom of the label stack.

After the router encounters the bottom of the stack, it performs a route lookup depending on the information in the IP Layer 3 Header and appropriately forwards the packet toward the destination.

  • In the case of an ingress Edge LSR, the Edge LSR might impose (push) more than one label to implement a label stack where each label in the label stack has a specific function.

Label stacks are implemented when offering MPLS-based services such as MPLS VPN or MPLS traffic engineering.

MPLS Control and Data Plane Components

  • Cisco Express Forwarding (CEF) is the foundation on which MPLS and its services operate on a Cisco router. Therefore, CEF is a prerequisite to implement MPLS on all Cisco platforms.
  • When CEF is used on a router, the router maintains, at a minimum, an FIB, which contains a mapping of destination networks in the routing table to appropriate next-hop adjacencies. This FIB resides in the data plane, which is the forwarding engine for packets processed by the router.
  • In addition to the FIB, two other structures on the router are maintained, which are the Label Information Base (LIB) and Label Forwarding Information Base (LFIB). The distribution protocol in use between adjacent MPLS neighbors is responsible for the creation of entries in the LIB and LFIB.
    • The LIB functions in the control plane and is used by the label distribution protocol where IP destination prefixes in the routing table are mapped to next-hop labels that are received from downstream neighbors, as well as local labels generated by the label distribution protocol.
    • The LFIB resides in the data plane and contains a local label to next-hop label mapping along with the outgoing interface, which is used to forward labeled packets.

Information about reachability to destination networks from routing protocols is used to populate the Routing Information Base (RIB) or the routing table. The routing table, in turn, provides information for the FIB.
The LIB is populated using information from the label distribution protocol and from the RIB along with information from the FIB that is used to populate the LFIB.

MPLS Control and Data Plane Components

MPLS Operation

The implementation of MPLS for data forwarding involves the following four steps:

  1. MPLS label assignment (per LSR)
  2. MPLS LDP or TDP session establishment (between LSRs/ELSRs)
  3. MPLS label distribution (using a label distribution protocol)
  4. MPLS label retention

MPLS operation typically involves adjacent LSR’s forming an LDP session, assigning local labels to destination prefixes and exchanging these labels over established LDP sessions. Upon completion of label exchange between adjacent LSRs, the control and data structures of MPLS, namely FIB, LIB, and LFIB, are populated, and the router is ready to forward data plane information based on label values.

MPLS Label Assignment

A label is assigned to IP networks reachable by a router and then imposed on data packets forwarded to those IP networks.

  • IP routing protocols advertise reachability to destination networks. The same process needs to be implemented for routers or devices that are part of the MPLS domain to learn about the labels assigned to destination networks by neighboring routers.
  • The label distribution protocol (LDP or TDP) assigns and exchanges labels between adjacent LSRs in an MPLS domain following session establishment.
  • Labels can be assigned either globally (per router) or per interface on a router.

LDP Session Establishment

Following label assignment on a router, these labels are distributed among directly connected LSRs if the interfaces between them are enabled for MPLS forwarding. This is done either by using LDP or tag distribution protocol (TDP). TDP is deprecated and, by default, LDP is the label distribution protocol.

There are four categories of LDP messages:

  1. Discovery messages: Announce and sustain an LSR’s presence in the network
  2. Session messages: Establish, upkeep, and tear down sessions between LSRs
  3. Advertisement messages: Advertise label mappings to FECs
  4. Notification messages: Signal errors
LDP Session Establishment

LDP uses TCP port 646, and the LSR with the higher LDP router ID opens a connection to port 646 of another LSR:

  1. LDP sessions are initiated when an LSR sends periodic hellos (using UDP multicast on on interfaces enabled for MPLS forwarding. If another LSR is connected to that interface (and the interface enabled for MPLS), the directly connected LSR attempts to establish a session with the source of the LDP hello messages. The LSR with the higher LDP router ID is the active LSR. The active LSR attempts to open a TCP connection with the passive LSR (LSR with a lower router ID) on TCP port 646 (LDP).
  2. The active LSR then sends an initialization message to the passive LSR, which contains information such as the session keepalive time, label distribution method, max PDU length, and receiver’s LDP ID, and if loop detection is enabled.
  3. The passive LDP LSR responds with an initialization message if the parameters are acceptable. If parameters are not acceptable, the passive LDP LSR sends an error notification message.
  4. Passive LSR sends keepalive message to the active LSR after sending an initialization message.
  5. The active LSR sends keepalive to the passive LDP LSR, and the LDP session comes up. At this juncture, label-FEC mappings can be exchanged between the LSRs.

MPLS Label Distribution with LDP

In an MPLS domain running LDP, a label is assigned to a destination prefix found in the FIB, and it is distributed to upstream neighbors in the MPLS domain after session establishment.

  • The labels that are of local significance on the router are exchanged with adjacent LSRs during label distribution.
  • Label binding of a specific prefix to a local label and a next-hop label (received from downstream LSR) is then stored in the LFIB and LIB structures.

The label distribution methods used in MPLS are as follows:

  • Downstream on demand: This mode of label distribution allows an LSR to explicitly request from its downstream next-hop router a label mapping to a particular destination prefix and is thus known as downstream on demand label distribution.
  • Unsolicited downstream: This mode of label distribution allows an LSR to distribute bindings to upstream LSRs that have not explicitly requested them and is referred to as unsolicited downstream label distribution.


  • In the downstream-on-demand distribution process, LSR R2 requests a label for the destination R1 replies with a label mapping of label 17 for
  • In the unsolicited downstream distribution process, R1 does not wait for a request for a label mapping for prefix but sends the label mapping information to the upstream LSR R2.
Unsolicited Downstream Versus Downstream on Demand

MPLS Label Retention

  • With liberal retention mode, an LSR can almost immediately start forwarding labeled packets after IGP convergence, where the numbers of labels maintained for a particular destination are large, thus consuming memory.
  • With conservative label retention, the labels maintained are labels from the confirmed LDP or TDP next-hop neighbors, thus consuming minimal memory.

Special Outgoing Label Types

LSRs perform the operation of label swapping, imposition, or disposition depending on their location in the MPLS domain.

  • Untagged: The incoming MPLS packet is converted to an IP packet and forwarded to the destination (MPLS to IP Domain transition). This is used in the implementation of MPLS VPN.
  • Implicit-null or POP label: This label is assigned when the top label of the incoming MPLS packet is removed and the resulting MPLS or IP packet is forwarded to the next-hop downstream router.
  • Aggregate:  In this label, the incoming MPLS packet is converted to an IP packet (by removing all labels if label stack is found on incoming packet), and a FIB (CEF) lookup is performed to identify the outgoing interface to destination.

Penultimate Hop Popping

Penultimate hop popping is performed in MPLS-based networks where the router upstream to the Edge LSR removes the top label in the label stack and forwards only the resulting packet (either labeled IP or IP packet) for a particular FEC.

This process is signaled by the downstream Edge LSR during label distribution with LDP. The downstream Edge LSR distributes an implicit-null (POP) label to the upstream router, which signals it to pop the top label in the label stack and forward the resulting labeled or IP packet.

When the packet is received by the Edge LSR, no lookup is performed in the LIB if the incoming packet is an IP packet. Therefore, penultimate hop popping saves a single lookup on edge routers.


The downstream Edge LSR1 distributes an implicit-null label mapping for network to its upstream LSR1. Upon receiving a labeled packet, LSR1 pops the top label and sends the resulting IP packet to the Edge-LSR1.

Penultimate Hop Popping

Leave a Reply

Related Post


MPLS Technology Basics P (Provider) router = Label Switching Router (LSR) Runs an IGP and LDP PE (Provider Edge) router = edge router (LER) Imposes and removes MPLS labels Runs