In a Nutshell

Multiprotocol Label Switching (MPLS) is the industrial-strength transport mechanism that powers the modern Internet core and global enterprise backbones. By replacing the computationally expensive 'Longest Prefix Match' lookup with deterministic, fixed-length label switching, MPLS decouples packet forwarding from IP routing topology. This masterwork deconstructs the forensics of Label Distribution Protocol (LDP), the physics of label stacking in L3VPNs, the deterministic constraints of RSVP-TE, and the disruptive shift toward stateless Segment Routing (SR-MPLS). We explore how MPLS transforms a 'best-effort' IP network into a multi-tenant, traffic-engineered service fabric.

The Label Anatomy

MPLS operates between the Data Link Layer (Layer 2) and the Network Layer (Layer 3), earning its common moniker as Layer 2.5. It prepends a 32-bit shim header to the IP packet, allowing routers to make forwarding decisions without ever inspecting the IP destination.

MPLS Shim Header (32 bits)

Label Value20 Bits
TC (EXP)3 Bits
S1 Bit
TTL8 Bits
  • Label Value: The identifier used for switching. Values 0-15 are reserved (e.g., IPv4 Explicit Null).
  • Traffic Class (TC): Formerly EXP bits. Used for QoS mapping (DS-TE).
  • Bottom of Stack (S): If set (1), this is the last label before the payload.
  • TTL: Prevents infinite loops within the Label Switched Path (LSP).

Label Distribution Protocol (LDP)

LDP is the control plane mechanism that synchronizes label mappings across the network. It operates on a hop-by-hop basis, following the path determined by the IGP (OSPF or IS-IS).

LDP Session Establishment

  1. Discovery: Routers send UDP Hellos to 224.0.0.2224.0.0.2 on port 646.
  2. TCP Handshake: A TCP session is established between the highest Transport Addresses.
  3. Initialization: Parameters (Keepalive, Label Range) are negotiated.
  4. Label Binding: Routers exchange PrefixLabel\text{Prefix} \rightarrow \text{Label} mappings.

Downstream Unsolicited (DU)

In most service provider networks, LDP uses DU mode. This means a router will automatically advertise label bindings to all its neighbors for all prefixes in its routing table, ensuring that LSPs are built proactively before traffic arrives.

LSP: Label Swapping Simulator

Visualize Push, Swap, and Pop (PHP) operations in a Label Switched Path.

Customer AIngress LERPUSHLSR CoreSWAPPenultimatePOP (PHP)Egress LERIP FORWARDCustomer BDATA

Operation Details

Customer sends standard IP packet to Service Provider edge.

Label Forwarding Table

IN LABELOUT LABELACTION
Standard IP Forwarding...
LSP Core (P)
Edge (LER)
MPLS Label

Interactive Simulation: Label Propagation and LSP Pathfinding

Architectural Isolation: L3VPNs

The primary value proposition of modern MPLS is the BGP/MPLS L3VPN (RFC 4364). It allows a provider to carry multiple overlapping private IP spaces over a single shared core without traffic leakage.

The 2-Label Stack Physics

To support VPNs, MPLS uses Label Stacking. A VPN packet in the core has at least two labels:

Outer Label (Transport Label)

Directs the packet to the correct egress PE (Provider Edge) router. It is swapped at every hop in the core (P-routers).

Inner Label (Service / VPN Label)

Hidden from the core. It tells the egress PE which customer VRF (Virtual Routing and Forwarding) instance to use for the final IP lookup.

Traffic Engineering with RSVP-TE

Standard IP routing is "selfish"; every packet takes the shortest path, leading to congestion on primary links while secondary links sit idle. MPLS-TE allows for global network optimization.

CSPF (Constrained Shortest Path First)

Unlike OSPF which only looks at link costs, CSPF factors in constraints like available bandwidth, link color (affinity), and administrative weight. It calculates a path that satisfies the SLA before signaling it.

CostTE=(Link Metric)+Constraint Penalty\text{Cost}_{TE} = \sum (\text{Link Metric}) + \text{Constraint Penalty}

Fast Re-Route (FRR)

In a standard network, convergence after a link failure takes seconds. With MPLS FRR, the ingress router pre-calculates a Backup LSP.

Link Failure
Local Repair in <50ms

The Future: Segment Routing (SR-MPLS)

The industry is rapidly moving away from LDP and RSVP-TE toward Segment Routing. SR simplifies the control plane by eliminating the need for LDP entirely, using the IGP itself to distribute labels.

Stateless Core Architecture

In RSVP-TE, every router along a path must maintain state for every tunnel. In SR, the Source Router encodes the entire path into a stack of labels (segments). The core routers remain stateless; they simply pop the top label and forward based on the Prefix SID (Segment Identifier).

Prefix SIDIdentifies a node destination. Globally unique within the SR domain.
Adjacency SIDIdentifies a specific link. Locally significant to a node.
Anycast SIDIdentifies a group of nodes (e.g., redundant PE pairs).

Frequently Asked Questions

Share Article

Technical Standards & References

Rosen, E., et al. (2001)
RFC 3031: Multiprotocol Label Switching Architecture
VIEW OFFICIAL SOURCE
Andersson, L., et al. (2007)
RFC 5036: LDP Specification
VIEW OFFICIAL SOURCE
Ina Minei, Julian Lucek (2011)
MPLS-Enabled Applications: Emerging Developments and New Technologies
VIEW OFFICIAL SOURCE
Clarence Filsfils, et al. (2017)
Segment Routing Part I
VIEW OFFICIAL SOURCE
Rosen, E., et al. (2006)
RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)
VIEW OFFICIAL SOURCE
Mathematical models derived from standard engineering protocols. Not for human safety critical systems without redundant validation.

Related Engineering Resources