MPLS

MPLS Basics

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

The Problem with Traditional IP Routing

A computer sends application data in small . Each packet carries a destination IP address in its header together with control information and a payload. Network operate at Layer 3, analyze the destination, consult a forwarding table, select a next hop and outgoing interface, and forward packets between different networks.

In traditional IP routing, every router along the path performs the following forwarding operations:

  1. Receive a packet.
  2. Inspect the destination IP address and relevant header fields.
  3. Look up the destination in the routing table and select the route with the longest matching prefix. With many routes, specialized data structures and hardware can support this lookup.
  4. Select a next hop and outgoing interface, then forward the packet.

This process is repeated at every router a packet encounters. Early deployments performed some of these operations in software, while modern routers also use hardware forwarding tables. As networks grew faster and more complex, the following limitations of the traditional model became apparent:

  • Forwarding has implementation costs: Longest-prefix matching and header processing can require specialized tables and hardware to keep pace with the link rate.
  • Traffic control is limited: Ordinary routing decisions mainly follow the destination address and protocol metrics. Traffic engineering can add constraints, while MPLS-TE provides explicit LSPs for this purpose. This can steer traffic away from a congested segment when another route is available.
  • Service separation needs additional mechanisms: IP routing alone does not isolate customers or classify traffic. VPNs, labels, and traffic-class fields can separate services and support priority handling.

The MPLS solution: forwarding with labels

Multi-Protocol Label Switching (MPLS) was developed to support predictable packet forwarding, traffic engineering, and VPN services. It introduces FEC identifiers and labels that can be handled in forwarding tables.

The core idea of MPLS is simple: Classify a packet into a forwarding equivalence class, then use a local identifier at subsequent hops.

When a packet enters an MPLS domain, the ingress router classifies it into a FEC and applies a label. The control plane determines the LSP, for example through LDP or MPLS-TE. The label identifies a local forwarding action rather than a globally meaningful path address.

A core router can use the label to find a local forwarding action, usually swapping the label and sending the packet to the next node. This is label switching; the control plane still uses IP routing and signaling protocols. The label may be removed by the penultimate hop or by the egress LER, depending on the configuration.

A label value has local significance. An LSR maps an incoming label to an outgoing label, an interface, and an operation such as swap, push, or pop. The numeric value can therefore change on successive links. The mapping applies to one hop. The control plane creates these mappings, while the data plane applies them to packets.

A label stack can contain multiple entries. One label can identify a VPN context while another identifies the transport LSP.

MPLS terminology

The MPLS world has its own vocabulary. These terms describe how the protocol 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 packet leaves the MPLS domain. It may receive a packet without a label after PHP or remove a label that remains on the packet.
  • Label:

    A short, locally significant identifier used to direct packets through the MPLS network. In the basic shim entry, the label has 20 bits, while the traffic-class, stack, and TTL fields occupy the remaining bits of the 32-bit entry.

  • Forwarding Equivalence Class (FEC):

    A FEC is a group of IP packets that are treated in the same way by the network. Packets in the same FEC receive a label mapping and are forwarded according to the same LSP plan. The decision to group packets into a FEC is made at the domain ingress, 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 a one-way path through an MPLS network that packets belonging to a specific FEC can follow. It can be established hop by hop with LDP or explicitly selected by traffic-engineering mechanisms. In practice, it provides the forwarding path from the ingress LER to the egress LER.

  • Label Distribution Protocol (LDP):

    This protocol lets LSRs distribute FEC-to-label mappings. The mappings coordinate LSP construction across the network.

MPLS functions beyond basic IP routing

The label-based model supports several functions that classic IP routing alone does not provide.

  • Forwarding operations

    One original goal of MPLS was to use simple label operations in hardware forwarding tables. Modern IP routers also perform prefix matching in hardware, so MPLS does not by itself guarantee higher speed. Labels remain useful for identifying FECs, LSPs, and VPN services.

  • Traffic Engineering (TE)

    A standard IGP such as OSPF selects a route according to its metric. MPLS-TE can establish an explicit LSP with additional constraints, including a path outside the one selected by ordinary IGP routing. This supports load balancing and congestion avoidance. If the preferred IGP path is congested, an administrator can steer lower-priority traffic onto a longer, less-congested backup route.

  • Virtual Private Networks (VPNs)

    MPLS supports scalable Layer 3 VPNs for customers. A two-label stack can contain an inner label for the customer destination and an outer label for carrying the packet across the provider core. The provider can carry traffic for many customers over the same infrastructure, while separate VPN tables and labels keep their forwarding contexts distinct. This separation does not provide encryption, which requires additional protocols.

  • Quality of Service (QoS)

    MPLS is not a QoS protocol, but its header contains a 3-bit Traffic Class (TC) field, historically called the Experimental (EXP) field. The TC field can carry a traffic-class marking used for packet queuing and drop behavior. Its interpretation depends on the operator's configuration.

Why does MPLS mean 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: The MPLS label is inserted between the Layer 2 header and the Layer 3 header. MPLS is therefore not tied to one Layer 2 technology. It can run over Ethernet as well as technologies such as Frame Relay, ATM, or PPP over SONET/SDH. It provides a forwarding mechanism independent of the underlying link technology.

MPLS is often described as Layer 2.5. This is an informal term, since MPLS does not define a separate OSI layer; in practice, it connects label forwarding with network-layer routing.

Related articles