MPLS Basics

Introduction to Multi-Protocol Label Switching and its advantages over traditional IP routing.

The Problem with Traditional IP Routing

The internet, at its core, works like a massive postal service. Your computer sends data in small envelopes called , and each packet has a detailed destination IP address written on it. The task of network is to act as postal sorting offices.

In traditional IP routing, every single sorting office (router) along the path must perform the same complex task:

  1. Receive a packet.
  2. Stop the packet and carefully read its full destination IP address.
  3. Look up that address in a huge, complicated phone book (its routing table) to find out where to send it next. This lookup is computationally intensive, as it often requires a longest-prefix match against tens of thousands of routes.
  4. Forward the packet to the next sorting office.

This process is repeated at every single router a packet encounters on its journey. This worked well for a long time, but as networks grew faster and more complex, several critical limitations became apparent:

  • It is slow: The hop-by-hop analysis of complex IP headers is done in software by the router鈥檚 CPU, which is a bottleneck compared to the raw speed of hardware-based switching.
  • It is inefficient: All routing decisions are based solely on the destination address. This is like a postal service where every letter to London, regardless of priority or content, must take the exact same congested main highway, even if other perfectly good roads are empty. There is no easy way to steer traffic around congestion.
  • It lacks service separation: All packets are treated more or less equally. Providing a guaranteed, high-quality connection for a video conference while simultaneously handling low-priority file downloads on the same network is very difficult.

The MPLS Solution: From Address Reading to Sticker Sorting

Multi-Protocol Label Switching (MPLS) was developed to solve these problems. It introduces a fundamentally new way of forwarding packets that is significantly faster and more flexible.

The core idea of MPLS is simple: Make a complex routing decision once, then use a simple identifier for fast forwarding everywhere else.

Let's return to our postal service analogy. With MPLS, when a packet first enters the network, the initial router (the first post office) performs the one and only full, complex IP address lookup. It determines the entire path the packet should take to its final destination. But instead of just sending the packet on its way, it does something new: it sticks a simple, brightly colored, numbered sticker on the packet. This sticker is called a label.

Now, every subsequent router in the core of the network no longer needs to read the complex IP address. It only needs to look at the simple label. Based on that label, it instantly knows where to forward the packet. This process is not routing anymore; it is label switching, and it can be done in specialized, high-speed hardware, which is dramatically faster than software-based routing. The final router at the edge of the network peels off the label before delivering the original IP packet to its destination.

Key MPLS Terminology

The MPLS world has its own specific vocabulary. Understanding these terms is crucial to understanding how it operates.

  • Label Switching Router (LSR):

    This is any router within an MPLS-enabled network. All LSRs have the ability to forward packets based on their labels.

  • Edge LSR (LER - Label Edge Router):

    This is a special LSR that sits at the boundary of an MPLS network. LERs are the entry and exit points.

    • An Ingress LER is where an IP packet enters the MPLS domain and gets its first label applied (pushed).
    • An Egress LER is where a labeled packet leaves the MPLS domain and has its label removed (popped).
  • Label:

    A short, fixed-length, locally significant identifier that is used to direct packets through the MPLS network. It's the "sticker" in our analogy.

  • Forwarding Equivalence Class (FEC):

    This is a fundamental concept. A FEC is a group of IP packets that are treated in the same way by the network. All packets that belong to the same FEC will receive the same label and be forwarded along the same path. The decision to group packets into a FEC is made by the Ingress LER, typically based on the destination IP network.

    Analogy: The FEC is the destination city. All letters going to London are treated the same and get the same sticker at the entry point.

  • Label Switched Path (LSP):

    An LSP is the one-way path through an MPLS network that packets belonging to a specific FEC will follow. It's a predefined tunnel from the Ingress LER to the Egress LER. Think of it as a specially designated express highway for all traffic with a particular sticker.

  • Label Distribution Protocol (LDP):

    This is the protocol that LSRs use to talk to each other and agree on which labels will be used for which FECs. It's how the routers coordinate to build the LSPs across the network.

The Advantages of MPLS Over Traditional IP Routing

Switching to this label-based model provides a host of powerful benefits that address the shortcomings of classic IP routing.

  • Increased Performance and Speed

    This was the original driving force behind MPLS. Looking up a small, fixed-length label in a table is far simpler and faster for a router than performing a complex longest-prefix match on a 32-bit (or 128-bit) IP address. This allows the core forwarding decisions to be made in highly optimized hardware (ASICs) rather than the main CPU, resulting in significantly higher packet forwarding rates.

  • Traffic Engineering (TE)

    This is arguably the most powerful feature of MPLS today. Standard IGPs like OSPF will always route traffic along the mathematically shortest path. With MPLS, an administrator can create an explicit LSP that forces traffic to follow a specific, pre-determined path, even if it is not the shortest path. This allows for intelligent load balancing and congestion avoidance. For example, if the shortest path is congested, an administrator can create a new LSP to steer less critical traffic onto a longer, less-congested backup route.

  • Virtual Private Networks (VPNs)

    MPLS makes it remarkably easy to create secure, scalable Layer 3 VPNs for customers. By using a stack of two labels: an inner label to identify the customer's destination and an outer label to get the packet across the provider's core network, a service provider can securely carry traffic for hundreds of different customers over the same physical infrastructure. Because the core routers only look at the outer label, the customers' internal IP addresses (which might even overlap) are never seen by the core, providing complete separation.

  • Quality of Service (QoS)

    While not a QoS protocol itself, MPLS provides powerful tools to implement it. The MPLS header contains a 3-bit "Experimental" (EXP) field. This field can be used to mark packets with different priority levels. Routers in the MPLS core can then be configured to give preferential treatment (e.g., lower delay, less chance of being dropped) to packets with a higher priority marking, making it perfect for carrying real-time traffic like VoIP and video conferencing.

Why is it Called "Multi-Protocol"?

The "MP" in MPLS stands for Multi-Protocol. This refers to its ability to work with different protocols at both the Network Layer (Layer 3) and the Data Link Layer (Layer 2).

  • At Layer 3: While primarily used to forward IPv4 packets, the FEC concept is generic. MPLS can also be used to create LSPs for IPv6 traffic, or even for non-IP protocols.
  • At Layer 2: This is a key feature. The MPLS label is "shimmed" in between the Layer 2 header and the Layer 3 header. This means MPLS is not tied to any single Layer 2 technology. It can run over Ethernet, but also over older technologies like Frame Relay, ATM, or PPP over SONET/SDH. It provides a consistent forwarding mechanism regardless of the underlying link technology.

This flexibility positions MPLS as a Layer 2.5 protocol, creating a bridge between the physical link technologies and the network routing layer.

    MPLS Basics | Teleinf Edu