Multiprotocol Label Switching: Benefits & How It Works

published
June 12, 2024
TABLE OF CONTENTS
Get Secure Remote Access with Netmaker
Sign up for a 2-week free trial and experience seamless remote access for easy setup and full control with Netmaker.

Multiprotocol label switching (MPLS) is a networking technique used to boost network speed, performance, and security. Primarily used in enterprise networks, MPLS routes traffic based on predetermined “labels’, not source and destination addresses as with other networking protocols.

How the MPLS packet forwarding process works

Instead of sending packets directly from one end to another, MPLS makes use of labels to speed things up. When a data packet enters the MPLS network, it gets a label. This label simplifies forwarding decisions for routers along the path. 

The first router, known as the Label Edge Router (LER), slaps on this label based on predefined criteria like destination IP address, quality of service requirements, or even the type of application. For example, streaming video might get a higher priority label than a simple email.

As the packet moves through the network, it encounters Label Switch Routers (LSRs). These LSRs quickly read the label, consult their label forwarding table, and then forward the packet to the next hop. They don't waste time re-examining the entire packet, just the label. 

Finally, when the packet reaches the exit point of the MPLS network, another LER removes the label and delivers the packet to its final destination. 

When the packet finally arrives at the last router before its final destination, something called "penultimate hop popping" often comes into play. Penultimate hop popping means the router before the last hop removes (or pops) the MPLS label, leaving the packet with its original IP header. 

The final router can then forward the plain IP packet to its destination without dealing with any MPLS labels, making the final delivery step straightforward.

This whole process may sound complex, but it allows for an efficient, speedy, and flexible packet-forwarding process across a network. 

Elements of the Multiprotocol Label Switching (MPLS) network architecture

Label Edge Routers (LER) and MPLS

An LER (label edge router) sits at the edge of the MPLS domain and is responsible for the ingress and egress of packets. When a packet enters the MPLS network, the LER assigns a label to it based on the forwarding equivalence class (FEC). This label tells subsequent routers how to handle the packet along its path.

For example, with data coming from a local office server heading to a remote data center, the LER will inspect the packet, determine its FEC, and tag it with a specific label. This labeled packet is then passed onto the core MPLS routers, which will switch it based on the label without checking the packet's payload. It's like giving the packet a VIP pass through the network.

On the flip side, when a packet exits the MPLS network, another LER strips off the label and forwards the packet to its final destination. So, if our packet from the local office arrives at the data center, the egress LER would remove the label and deliver the data seamlessly. In this way, the LER serves as the gateway, ensuring that the MPLS network operates efficiently.

LERs also participate in label distribution protocols to maintain label information across the network. They might use LDP (Label Distribution Protocol) to communicate and manage the labels, which is crucial for ensuring that all routers in the network understand how to handle each labeled packet.

Now, think about a situation where multiple packets are heading to different destinations but share the same path initially, like cars driving the same route before splitting off at different intersections. The LER groups these packets into a common FEC assigns them a label, and sends them on their way. This aggregation not only optimizes the use of network resources but also simplifies the forwarding process for core routers.

Label Switching Routers (LSR) 

Label Switching Routers (LSRs) perform the essential label-switching function in MPLS. Each LSR's role changes based on its position within the Label Switched Path (LSP). 

At the beginning of an LSP, you'll typically find the ingress label edge router (ILER). This router is responsible for labeling packets with an MPLS header before forwarding them along the defined path. There's only one ingress router per LSP. Imagine an ingress router as the gatekeeper, setting the MPLS packet on its journey.

In the middle of the LSP, any intermediate router is labeled as a Label Switching Router (LSR). These routers swap the incoming label with an outgoing MPLS label, ensuring packets continue along their path. An LSP can have up to 253 transit routers. Think of these intermediate LSRs as relay runners, passing the baton down the line.

At the end of the LSP is the egress label edge router (eLER). This router removes the MPLS encapsulation, transforming the MPLS packet back into a typical data packet before it reaches its final destination. 

Just like the ingress router, each LSP has one egress router. If you imagine the eLER as the finish line, you won't be far off. The packet reaches its final leg, thanks to the information in the forwarding table.

A single router can serve multiple roles across various LSPs in your network. It can be an ingress, egress, or transit router, depending on the network design. For example, Router A could be an ingress router for LSP1 while acting as an intermediate LSR for LSP2 and an egress router for LSP3.

Keep in mind that an LSP is typically confined to a single IGP area when using constrained-path LSPs. They won't cross autonomous system (AS) boundaries. 

However, static LSPs have the flexibility to cross these boundaries, as their intermediate hops are manually configured. This approach means they don't rely on IGP topology or the local forwarding table. So, if you want an LSP that spans multiple AS, static LSPs are your go-to solution.

MPLS Label Format

The most crucial part of the MPLS header is the label value, which directly determines where the packet goes next. Think of it as the address written on an envelope. 

Next, we have the EXP or experimental bits. These bits are usually used for QoS (Quality of Service). Generally, the IP precedence value from the IP packet is copied here.

Then there's the S bit, which stands for "bottom of stack." MPLS can add multiple labels to a packet, like stacking multiple envelopes inside one another. When the S bit is set to one, it means this is the last MPLS label. If it's zero, expect more labels.

Finally, we have the TTL or Time to Live field. This works like the TTL field in IP headers, decremented by one with every hop. It helps avoid packets looping endlessly.

One interesting fact about MPLS is that the header is sandwiched between the L2 and L3 headers. That’s why some people call MPLS a "Layer 2.5" protocol. Here's an example to visualize it better: imagine you've got an Ethernet frame with an IP packet inside. The MPLS header would be inserted between these two.

Multiprotocol Label Switching (MPLS) vs Traditional IP Routing

Multiprotocol Label Switching (MPLS) offers a different networking approach to traditional IP routing. That approach gives it several advantages over traditional IP routing. 

Packet forwarding speed

With traditional IP routing, each router makes an independent forwarding decision for every packet based on the destination IP address. Therefore, MPLS has several advantages over traditional IP routing.

The implication is that every router on the path from the source to the destination must perform a lookup in its routing table, which can introduce latency.

MPLS, on the other hand, uses labels. When a packet enters an MPLS network, it's assigned a short, fixed-length label. Instead of examining the IP address, each router forwards the packet based on the label.

This label-switching mechanism speeds up the packet forwarding process because label lookups happen faster than IP address lookups.

Assume that you are shipping a package. Traditional IP routing has the package inspected and rerouted at every checkpoint. MPLS has a faster process. It acts more like a predetermined shipping route where the package gets a label at the start and follows a direct path without repeated inspections.

Network performance

MPLS improves network performance by supporting traffic engineering. With traditional IP routing, traffic flows follow the shortest path, which can lead to congestion. 

MPLS creates a predetermined path through the network, which allows for more control over traffic distribution. This reduces the need for routers to make routing decisions, improves load balancing, and reduces latency.

Imagine an office network where video conferencing and file transfers happen simultaneously. Traditional IP routing might route both types of traffic over the same congested path, causing video call quality to degrade. MPLS can separate the traffic into different paths, ensuring smooth video calls and efficient file transfers.

MPLS also stands out for its quality of service (QoS) features that allow network administrators to reserve bandwidth and prioritize critical traffic. 

For instance, say your company uses SAP for business-critical applications. We can configure MPLS to prioritize SAP traffic over less critical services, like email. This ensures that essential applications have the bandwidth they need, reducing latency and jitter.

If the network starts to get overloaded, MPLS can also make smart decisions about which packets to drop and which to keep. This is based on the QoS rules you set. For instance, during congestion, your streaming video might buffer a little, but your company’s VoIP phone call will stay crystal clear.

MPLS also makes it easier to enforce Service Level Agreements (SLAs). Since we can tag and prioritize traffic, we can guarantee that certain types of traffic will always meet the required performance metrics. 

For example, an SLA might require 99.99% uptime and no more than 50ms latency for trading applications. With MPLS, we can make that happen.

MPLS-based VPNs

Traditional IP-based VPNs use tunneling protocols like IPsec, which can be complex to configure and manage. MPLS-based VPNs simplify the process by using labels to segregate and direct traffic, providing a scalable and easier-to-manage solution while maintaining a high level of security.

So, while traditional IP routing is straightforward and ubiquitous, MPLS offers more control over the network traffic, making it a preferred choice for many enterprise and service provider networks.

Flexibility

MPLS supports various types of traffic—voice, video, and data—simultaneously. So, whether you're making a VoIP call, attending a virtual conference, or sending an email, MPLS handles it all with ease. 

Network Security

MPLS separates your traffic from public internet traffic, giving you a private and secure path for data. Imagine you're sending important financial data; with MPLS, it's less likely to get intercepted. This is because MPLS operates over a private network rather than the open internet.

MPLS’s ability to prioritize traffic also makes it harder for potential disruptors to time their attacks. Even if someone managed to get into the network, the most critical and time-sensitive data would be protected first.

Another layer of security comes from the way MPLS handles packets. Each packet is labeled and follows a specific path, chosen when the packet enters the MPLS network. So, each router only knows about the next hop, not the entire path. This reduces the risk of an attacker being able to intercept and alter the route mid-transit.

MPLS networks can also be better prepared for Distributed Denial of Service (DDoS) attacks. Because the network is private and traffic is closely managed, it can detect abnormal spikes in traffic more easily. If a surge in traffic occurs that's not consistent with the usual patterns, the network can take steps to mitigate the impact.

Get Secure Remote Access with Netmaker
Sign up for a 2-week free trial and experience seamless remote access for easy setup and full control with Netmaker.
More posts

GET STARTED

A WireGuard® VPN that connects machines securely, wherever they are.
Star us on GitHub
Can we use Cookies?  (see  Privacy Policy).