MPLS – Multiprotocol Label Switching
1. What Is MPLS and Why Was It Created?
MPLS (Multiprotocol Label Switching) is a high-performance packet-forwarding technology used predominantly in service provider networks. Instead of forwarding packets by performing a routing table (IP longest-prefix match) lookup at every hop, MPLS forwards packets based on a short fixed-length label prepended to the packet. Label lookups are performed in a simple table and are far faster than recursive IP routing table lookups — particularly on older hardware.
MPLS was originally developed in the late 1990s to solve a speed problem: early IP routers performed software-based routing lookups that could not keep up with the rapidly growing Internet. MPLS moved forwarding decisions to hardware-based label switching. While modern routers use hardware ASICs for IP lookups (largely eliminating the speed advantage), MPLS remains essential in service provider networks for a different set of capabilities it uniquely enables: traffic engineering, VPN services, and service differentiation.
| Capability | Traditional IP Routing | MPLS |
|---|---|---|
| Forwarding decision | Destination IP longest-prefix match in routing table at every hop | Simple label lookup in Label Forwarding Information Base (LFIB) — no IP lookup in the core |
| Traffic engineering | Limited — traffic follows IGP shortest path; no ability to direct specific flows onto specific paths | Full TE — LSPs (Label Switched Paths) can be explicitly routed across any path, bypassing IGP shortest path |
| VPN services | Complex — requires GRE/IPsec overlay per customer | Native — MPLS L3VPN and L2VPN provide scalable, elegant multi-customer VPN services |
| Protocol independence | IPv4 and IPv6 require separate forwarding planes | Multiprotocol — same label infrastructure carries IPv4, IPv6, Ethernet, ATM, Frame Relay payloads |
| QoS and CoS | Per-hop DSCP marking and queuing | EXP/TC bits in label allow end-to-end QoS class marking across the MPLS domain |
Related pages: WAN Technologies Overview | WAN Technologies | DMVPN | GRE Tunnels | IPsec VPN | BGP Overview | OSPF Configuration | MPLS Fundamentals Lab
2. The MPLS Label — Structure and Fields
The MPLS label is a 32-bit (4-byte) header inserted between the Layer 2 (Data Link) header and the Layer 3 (IP) header. This position — between Layer 2 and Layer 3 — is why MPLS is often called a "Layer 2.5" protocol. The label can be stacked: multiple labels can be placed one on top of another, forming a label stack, which is how MPLS VPNs work.
Reserved Label Values
| Label Value | Name | Purpose |
|---|---|---|
| 0 | IPv4 Explicit NULL | Signals the egress LER to pop the label and forward the packet as plain IPv4 using the IP header |
| 1 | Router Alert Label | Signals special processing required at each hop (e.g., OAM operations) |
| 2 | IPv6 Explicit NULL | Same as label 0 but for IPv6 payloads |
| 3 | Implicit NULL | Used in Penultimate Hop Popping (PHP) — instructs the second-to-last router to pop the label before forwarding to the egress LER |
| 4–15 | Reserved | Reserved by IANA — not used in normal forwarding |
3. MPLS Roles — LER and LSR
Routers in an MPLS network have different roles depending on their position in the network. The two fundamental roles are LER (Label Edge Router) and LSR (Label Switching Router).
3.1 LER — Label Edge Router
An LER sits at the edge of the MPLS domain — between the customer network and the service provider MPLS core. LERs are the routers that impose (push) labels onto packets entering the MPLS domain and remove (pop) labels from packets leaving the domain. There are two types:
| LER Type | Also Called | Function |
|---|---|---|
| Ingress LER | PE router (Provider Edge), ingress PE | Receives an unlabelled IP packet from the customer network. Classifies the packet into a Forwarding Equivalence Class (FEC). Pushes (imposes) one or more MPLS labels. Forwards the labelled packet into the MPLS core. |
| Egress LER | PE router (Provider Edge), egress PE | Receives a labelled packet from the MPLS core at the far end. Pops (removes) the label(s). Forwards the unlabelled IP packet to the customer network at the destination. |
3.2 LSR — Label Switching Router
An LSR is a router inside the MPLS core — it never touches unlabelled IP packets in normal operation. An LSR receives a labelled packet, looks up the incoming label in its LFIB (Label Forwarding Information Base), swaps the label for a new outgoing label, and forwards the packet. No IP routing table lookup is performed — the entire forwarding decision is based on the label alone.
Three MPLS Forwarding Operations
| Operation | Where It Happens | Description |
|---|---|---|
| PUSH (Impose) | Ingress LER | Add one or more labels to an incoming unlabelled packet. Turns a plain IP packet into an MPLS-labelled packet. |
| SWAP | LSR (transit) | Replace the top label with a new label. The packet continues through the core with the new label identifying the next hop. |
| POP (Dispose) | Egress LER (or penultimate LSR with PHP) | Remove the top label. If this reveals another label below (label stack), continue label forwarding. If S=1 (bottom of stack), forward as plain IP. |
4. Forwarding Equivalence Class (FEC)
A Forwarding Equivalence Class (FEC) is a group of packets that will all be forwarded in the same way through the MPLS domain — same path, same treatment. At the ingress LER, each incoming packet is classified into exactly one FEC, and a label is assigned to that FEC. All packets in the same FEC receive the same label and follow the same Label Switched Path (LSP) through the network.
5. Label Distribution — LDP and RSVP-TE
Labels are not statically configured — they are distributed dynamically between MPLS routers using a label distribution protocol. The two main protocols are LDP and RSVP-TE.
5.1 LDP — Label Distribution Protocol
LDP (Label Distribution Protocol) is the standard protocol for distributing labels in an MPLS network. Every LSR and LER running LDP advertises a label binding for each prefix in its routing table to all neighbouring MPLS routers. LDP follows the IGP topology — it creates LSPs that mirror the IGP shortest path.
5.2 RSVP-TE — Resource Reservation Protocol with Traffic Engineering
RSVP-TE (Resource Reservation Protocol – Traffic Engineering) extends the original RSVP signalling protocol to establish explicit LSPs that can follow any path through the network — not just the IGP shortest path. RSVP-TE enables MPLS Traffic Engineering (MPLS-TE).
LDP vs RSVP-TE Comparison
| Feature | LDP | RSVP-TE |
|---|---|---|
| Path selection | Follows IGP shortest path — no deviation | Explicit path — can route around congestion or failures |
| Bandwidth reservation | No | Yes — per-LSP bandwidth guarantee |
| Fast Reroute (FRR) | No (relies on IGP reconvergence) | Yes — pre-provisioned backup paths, <50 ms failover |
| Configuration complexity | Low — enable per interface | High — requires OSPF-TE/IS-IS-TE, CSPF, tunnel config |
| Use case | Basic MPLS forwarding, MPLS L3VPN | Traffic engineering, bandwidth-sensitive applications, fast failover requirements |
| Protocol / port | UDP/TCP 646 | IP protocol 46 (RSVP) |
6. Label Switched Path (LSP) and LFIB
A Label Switched Path (LSP) is the end-to-end path through the MPLS domain that a specific FEC's traffic follows. An LSP is unidirectional — traffic in each direction follows a separate LSP. The LFIB (Label Forwarding Information Base) is the forwarding table each LSR uses to make label-switching decisions.
7. Penultimate Hop Popping (PHP)
Penultimate Hop Popping (PHP) is a standard MPLS optimisation. Without PHP, the egress LER (PE router) would need to perform two lookups for every arriving packet: first look up the label in the LFIB (to confirm it is the egress), then look up the destination IP in the routing table to forward the packet. PHP eliminates one of these lookups by having the second-to-last router (the penultimate hop) pop the label before forwarding to the egress LER.
8. MPLS VPNs — Overview
MPLS VPNs are the most commercially significant application of MPLS. They allow a single shared service provider MPLS network to carry completely isolated traffic for multiple customers simultaneously — each customer sees a private network with no awareness of other customers' traffic. MPLS VPNs come in two major variants: Layer 3 VPN (L3VPN) and Layer 2 VPN (L2VPN).
| Feature | MPLS L3VPN | MPLS L2VPN |
|---|---|---|
| OSI layer | Layer 3 — SP participates in customer routing | Layer 2 — SP is transparent; customer controls routing |
| Routing relationship | PE router peers with CE router using BGP, OSPF, EIGRP, or static routes | No routing relationship — SP forwards Layer 2 frames |
| Customer sees | A routed IP network with PE routers as next-hops | A transparent Layer 2 circuit — as if directly connected |
| Scalability | Highly scalable — SP uses MP-BGP to carry VPN routes | More complex at scale — each circuit requires provisioning |
| Use case | Enterprise WAN connectivity — replace Frame Relay/ATM | Metro Ethernet, circuit emulation, legacy WAN replacement |
| Technology examples | RFC 4364 (BGP/MPLS IP VPN) | VPLS (Virtual Private LAN Service), VPWS (Virtual Private Wire Service), AToM (Any Transport over MPLS) |
9. MPLS L3VPN — How It Works
MPLS L3VPN (RFC 4364) is the most widely deployed MPLS VPN service. The service provider participates in customer routing: each PE router maintains a separate routing table per customer called a VRF (VPN Routing and Forwarding) instance. Customer routes are distributed between PE routers using MP-BGP (Multiprotocol BGP) with a special address family. A two-label stack carries traffic through the core.
Key Components
| Component | Role |
|---|---|
| CE (Customer Edge) router | Customer's router at the site edge. Peers with the PE router using a routing protocol (BGP, OSPF, EIGRP, or static). Has no knowledge of MPLS — sees a normal IP routing peering. |
| PE (Provider Edge) router | Service provider router at the edge of the MPLS core. Maintains a VRF per customer. Exchanges customer routes with CE via CE–PE routing protocol. Distributes VPN routes to remote PEs via MP-BGP. Imposes/removes the VPN label stack. |
| P (Provider) router | Core LSR — has no awareness of customer VPNs or VRFs. Only swaps transport labels. Does not participate in MP-BGP. |
| VRF | Virtual Routing and Forwarding — a separate routing table and forwarding table instance on the PE router, one per customer. Provides complete Layer 3 isolation between customers even if they use overlapping IP address spaces. |
| Route Distinguisher (RD) | 64-bit value prepended to customer IPv4 prefixes to make them globally unique across all VPNs in the MP-BGP infrastructure (VPNv4 address = RD + IPv4 prefix). Allows overlapping customer address spaces. |
| Route Target (RT) | BGP extended community attached to VPN routes that controls which VRFs import and export which routes — defines the VPN topology (hub-and-spoke, full-mesh, etc.). |
| MP-BGP | Multiprotocol BGP — carries VPN route information (VPNv4 prefixes + VPN labels) between PE routers across the core. P routers do not participate in MP-BGP. |
MPLS L3VPN Label Stack — Two Labels
10. MPLS L2VPN — VPLS and VPWS
MPLS L2VPN services carry Layer 2 frames across the MPLS core — the service provider transports Ethernet, Frame Relay, ATM, or other Layer 2 frames transparently between customer sites. The customer retains full control of routing; the SP is simply a transparent wire. Two primary L2VPN technologies are VPLS and VPWS.
VPWS — Virtual Private Wire Service (Point-to-Point)
VPLS — Virtual Private LAN Service (Multipoint)
11. MPLS Traffic Engineering (MPLS-TE)
MPLS Traffic Engineering uses RSVP-TE to create explicit LSPs that route traffic along paths that are not necessarily the IGP shortest path. This allows service providers to distribute load across their network and ensure certain traffic classes get guaranteed bandwidth — capabilities that plain IP routing cannot provide.
Why Traffic Engineering Is Needed
MPLS-TE Key Features
| Feature | Description |
|---|---|
| Explicit routing | TE tunnels specify the exact sequence of hops an LSP must follow — completely independent of IGP shortest path |
| Bandwidth reservation | RSVP-TE reserves bandwidth at each hop along the TE tunnel — provides a guaranteed bandwidth pipe end-to-end |
| Fast Reroute (FRR) | Pre-computed backup paths are provisioned alongside the primary LSP. On link or node failure, traffic switches to the backup path in under 50 ms — much faster than IGP reconvergence (seconds) |
| Constraint-based routing | CSPF algorithm selects paths based on constraints: available bandwidth, administrative colour/affinity (avoid certain links), explicit hop list, shared risk link groups (SRLG) |
| Autoroute | TE tunnels can be announced into the IGP so normal traffic is automatically steered into the tunnel by the IGP without per-flow policy configuration |
MPLS-TE vs Plain IP Routing
12. Why Service Providers Use MPLS — Commercial Value
MPLS is the backbone technology for the majority of global service provider networks. Its commercial appeal comes from the ability to deliver multiple services — Internet transit, enterprise VPNs, voice, and video — all on the same shared physical infrastructure with strong isolation and quality guarantees.
| Business Need | How MPLS Addresses It |
|---|---|
| Multi-customer isolation | MPLS L3VPN with VRFs completely isolates each customer's traffic — even if they use identical IP address ranges. One physical network serves hundreds of enterprise customers. |
| Scalable VPN services | Adding a new customer site only requires configuring a new VRF on the PE router and a BGP route-target — no per-site tunnels or encryption keys to manage (unlike IPsec overlays). |
| Traffic engineering for SLAs | Service providers sell SLAs (Service Level Agreements) with guaranteed bandwidth and latency. MPLS-TE reserves bandwidth per customer class and provides fast failover to meet uptime commitments. |
| QoS differentiation | MPLS EXP/TC bits carry CoS marking across the entire SP backbone — voice gets absolute priority, video gets bandwidth guarantee, bulk traffic gets best effort — all on one network. |
| Layer 2 transport services | VPLS and VPWS allow SPs to sell Metro Ethernet and leased-line replacement services without deploying separate physical infrastructure for each customer. |
| Network utilisation | MPLS-TE distributes load across all available links — not just IGP shortest paths. Better utilisation means more revenue per dollar of infrastructure investment. |
13. MPLS Summary — Key Facts
| Topic | Key Fact |
|---|---|
| MPLS position | Layer 2.5 — between Layer 2 (Ethernet) and Layer 3 (IP) |
| Label size | 32 bits: 20-bit label value, 3-bit EXP/TC (QoS), 1-bit S (bottom of stack), 8-bit TTL |
| LER | Label Edge Router — pushes labels at ingress, pops labels at egress; also called PE router in VPN context |
| LSR | Label Switching Router — swaps labels in the core; no IP routing table lookup; only uses LFIB |
| Three operations | PUSH (ingress), SWAP (transit), POP (egress) |
| FEC | Forwarding Equivalence Class — group of packets treated identically; one label per FEC at ingress |
| LDP | Label Distribution Protocol — UDP/TCP 646; distributes labels following IGP path; no TE capability |
| RSVP-TE | Distributes labels for explicit paths; enables bandwidth reservation and Fast Reroute (<50 ms failover) |
| PHP | Penultimate Hop Popping — second-to-last router pops label; reduces egress PE processing; uses implicit null label (3) |
| MPLS L3VPN | Two-label stack (transport + VPN); VRF per customer; MP-BGP carries VPN routes; RD makes prefixes unique; RT controls route import/export |
| MPLS L2VPN | VPWS = point-to-point pseudowire; VPLS = multipoint Layer 2 LAN service; SP is transparent to customer routing |
| MPLS-TE benefit | Routes traffic onto explicit paths; reserves bandwidth; Fast Reroute for <50 ms failover; optimises network utilisation |
14. MPLS Quiz
Related Topics & Step-by-Step Tutorials
Continue your WAN studies:
- WAN Technologies Overview — comprehensive overview of all WAN types
- MPLS – Multiprotocol Label Switching — label switching operation, CE/PE/P roles, Traffic Engineering
- DMVPN – Dynamic Multipoint VPN — dynamic spoke-to-spoke tunnels over hub-and-spoke infrastructure
- SD-WAN Overview — centralised control, multi-transport, app-aware routing
- IPsec VPN – Concepts & Protocols — site-to-site encrypted tunnels; Phase 1 IKE and Phase 2 SA
- IPsec — ESP, AH, IKE explained
- GRE Tunnels – Generic Routing Encapsulation — encapsulating multicast/routing protocols over WAN links
- Site-to-Site vs. Remote-Access VPN – Complete Compar… — site-to-site vs remote access VPN comparison
- BGP – Border Gateway Protocol Overview — EGP for inter-AS routing; the Internet routing protocol
- OSPF Overview – Open Shortest Path First Explained — most common IGP in enterprise WANs
- OSPF Areas and LSAs – Detailed Explanation — hierarchical OSPF design for large WANs
- EIGRP Overview — Cisco proprietary IGP with unequal-cost load balancing
- Floating Static Routes – Backup Routes, AD & Failover — WAN backup routing with elevated AD
- Default Routes – Complete Guide — 0.0.0.0/0 used at WAN edge to reach the internet
- QoS – Quality of Service Overview — prioritising VoIP and video over congested WAN links
- NAT – Network Address Translation Overview — translating private addresses at the WAN edge
- show interfaces – Interface Statistics & Error Analy… — check WAN interface up/down and error counters
- show ip route — verify routes to remote WAN sites
- Ping — test WAN reachability
- Traceroute – Packet Path Analysis & Troubleshooting — find where WAN path breaks
- DMVPN Phase 1, 2 & 3 (Step-by-Step)
- Site-to-Site IPsec VPN — IKEv1 & IKEv2 (Step-by-Step)
- GRE Tunnel Configuration (Step-by-Step)
- PPPoE Client Configuration (Step-by-Step)
- MPLS Fundamentals (Step-by-Step)