The Multiprotocol Label Switching (MPLS) approach leverages the intelligence of the IP routing infrastructure and the efficiency of Cisco Express Forwarding (CEF). MPLS functions by appending a label to any type of packet. The packet will then be forwarded through the network infrastructure based on this label’s value instead of any Layer 3 information. This ability to label a packet for efficient forwarding allows MPLS to work with a wide range of underlying technologies. By simply adding a label in the packet header, MPLS can be used in many Physical and Data Link Layer WAN implementations.
The MPLS label is positioned between the Layer 2 header and the Layer 3 header. In MPLS, overhead is added a single time, when the packet goes into the service provider cloud. After entering the MPLS network, packet switching is performed much faster than in traditional Layer 3 networks because it only needs to swap the MPLS label instead of stripping the entire Layer 3 header.
MPLS-capable routers are also called Label Switched Routers (LSRs), and they come in the following two flavors:
- Edge LSR (PE routers)
- LSR (P routers)
PE routers are Provider Edge devices that ensure label distribution, forward packets based on labels, and are responsible for label insertion and removal. P routers are Provider routers, and they are responsible for label forwarding and efficient packet forwarding based on labels.
MPLS separates the control plane from the data plane. This leads to a great efficiency in how the LSR routers work. Resources that are constructed for efficient control plane operations include the routing protocol, the routing table, and the exchange of labels, and these are completely separated from resources that are designed only to forward traffic in the data plane as quickly as possible.
CEF contains a Forwarding Information Base (FIB) that is a copy of the routing table information in the cache memory and is used for quick forwarding. MPLS contains a Label Forwarding Information Base (LFIB), which is for label-based traffic exchange.
The term Forwarding Equivalence Class (FEC) describes a class of packets that receives the same forwarding treatment (e.g., traffic forwarded based on a specific QoS marking through the service provider cloud).
Figure 5.9 – MPLS Label Fields
The MPLS label has a length of 4 bytes and it consists of the following fields (as illustrated in Figure 5.9 above):
- 20-bit Label Value field
- 3-bit Experimental field (QoS marking)
- 1-bit Bottom of the Stack field (useful when multiple labels are used, it is set to 1 for the last label in the stack)
- 8-bit TTL field (to avoid looping)
You might need to use a stack of labels when dealing with MPLS VPNs. MPLS VPN is the most important technology that uses MPLS, which was developed to serve the MPLS VPN technology. This concept is illustrated in Figure 5.10 below:
Figure 5.10 – Example of MPLS VPN
An example of an MPLS VPN application would be an ISP that offers MPLS VPN services. The PE routers connect to different customers, with the same customer having multiple sites, each connected to a different PE router. With the MPLS approach, two sites with the same customer receive transparent secure communication capabilities based on the unique customer labels assigned. The ISP uses MPLS to carry the traffic between the PE routers, through the P devices.
Note: An important advantage of MPLS VPN technology is that its secure connectivity is assured without the customer having to run MPLS on any device. The customer only needs to run a standard routing protocol with the ISP because all the MPLS VPN logic is located in the ISP cloud.
When using MPLS VPNs, a stack of labels is used to identify the customer (VPN identification) and another label is used to initiate the forwarding through the ISP cloud (i.e., the egress router location).
Layer 3 MPLS VPN technology is a very powerful and flexible option that allows service providers to give customers the transparent WAN access connectivity they need. This is very scalable for the ISP because it is very easy for them to add customers and sites.
MPLS comes in the following two flavors:
- Frame Mode MPLS
- Cell Mode MPLS
Frame Mode MPLS is the most popular MPLS type, and in this scenario, the label is placed between the Layer 2 header and the Layer 3 header (for this reason, MPLS is often considered a Layer 2.5 technology). Cell Mode MPLS is used in ATM networks and uses fields in the ATM header that are used as the label.
One important issue that must be solved with MPLS is determining the devices that will ensure the insertion and removal of labels. The creation of labels (i.e., label push) is performed on the Ingress Edge LSR and the label removal (i.e., label popping) is performed on the Egress Edge LSR. The LSRs in the interior of the MPLS topology are only responsible for label swapping (i.e., replacing the label with another label) in order to forward the traffic on a specific path.
The MPLS devices need a way in which to exchange the labels that will be utilized for making forwarding decisions. This label exchange process is executed using a protocol. The most popular of these protocols is called Label Distribution Protocol (LDP). LDP is a session-based UDP technology that allows for the exchange of labels. UDP and multicast are used initially to set up the peering, and then TCP ensures that there is a reliable transmission of the label information.
A technology that improves MPLS efficiency is Penultimate Hop Popping (PHP). This allows for the second to last LSR in the MPLS path to be the one that pops out the label. This adds efficiency to the overall operations of MPLS.
Route Distinguisher (RD) is a way in which the ISP can distinguish between the traffic of different customers. This allows different customers who are participating in the MPLS VPN to use the exact same IP address space. For example, you can have both customer A and customer B using the 10.10.10.0/24 range, with the traffic being differentiated between customers by RDs.
Devices can create their own virtual routing tables, called VPN Routing and Forwarding (VRFs) tables, so a PE router can store each customer’s specific data in a different isolated table, providing increased security.
Prefixes are carried through the MPLS cloud by relying on Multiprotocol BGP (MP-BGP). MP-BGP carries the VPNv4 prefixes (the prefix that results after the RD is prepended to the normal prefix). You can filter customers’ access to each other’s prefixes with import and export targets.

