In a Nutshell

Traditional IP routing requires an expensive 'Longest Prefix Match' lookup at every hop. Multiprotocol Label Switching (MPLS) optimizes this by introducing high-performance label switching, effectively creating virtual circuits over an IP fabric. This article explores the mechanics of Label Distribution Protocol (LDP), the efficiency of the Label Switched Path (LSP), and the physics of label stacking.

Beyond the RIB: The Label Edge

In a standard IP network, every router along a path must inspect the destination IP and search its entire Routing Information Base (RIB). In MPLS, this lookup happens only once at the Label Edge Router (LER). The LER assigns a fixed-length 'label' to the packet and forwards it into the MPLS core.

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

Label Distribution Protocol (LDP) Logic

How do routers agree on which label represents which destination? LDP is the signaling protocol that disseminated label mappings. A router allocates a local label for a prefix and informs its neighbors: "If you want to reach prefix X, send it to me with label Y."

MPLS Frame=[Label (20 bits)TC/EXP (3 bits)S (1 bit)TTL (8 bits)]\text{MPLS Frame} = [\text{Label (20 bits)} | \text{TC/EXP (3 bits)} | \text{S (1 bit)} | \text{TTL (8 bits)}]

QoS and the Traffic Class (EXP) Field

The 3-bit Traffic Class (TC) field, formerly known as the EXP (Experimental) field, is used for Quality of Service (QoS). Because it is only 3 bits, it can represent 8 distinct priority levels (0-7).

  • Pipe Mode: The IP DSCP value is ignored in the core; the MPLS label's EXP bits dictate priority.
  • Uniform Mode: The DSCP value is mapped directly to the EXP bits at the ingress and mapped back at the egress, ensuring end-to-end QoS consistency.

The Power of Label Stacking

MPLS allows for multiple labels to be 'pushed' onto a single packet, creating a Label Stack. This is the foundation of modern VPNs and many advanced carrier services.

  • Outer Label (Transport): Gets the packet across the provider core to the correct egress router (PE).
  • Inner Label (Service (VPN)): Identifies the specific customer VRF (Virtual Routing and Forwarding) or pseudo-wire at the destination.

Traffic Engineering (MPLS-TE)

Unlike standard routing which always follows the 'shortest' path (often leading to congestion on primary links while secondary links sit idle), MPLS-TE allows engineers to steer traffic along paths with guaranteed bandwidth or specific latency characteristics. This is achieved by combining MPLS with RSVP (Resource Reservation Protocol).

LSP Cost=Metric+Constraint Penalty\text{LSP Cost} = \text{Metric} + \text{Constraint Penalty}

By calculating the Constrained Shortest Path First (CSPF), the network can automatically bypass congested nodes or choose paths that meet specific SLA (Service Level Agreement) requirements.

The Transition to Segment Routing (SR-MPLS)

While LDP and RSVP have served the industry for decades, the overhead of maintaining state on every router is becoming a bottleneck for 5G and cloud-scale networks. Segment Routing (SR) simplifies this by using the existing IGP (OSPF or IS-IS) to distribute labels, removing the need for LDP entirely.

In SR, the source router encodes the entire path into the label stack itself (Source Routing). The core routers remain stateless, only looking at the top label to determine the next hop. This "Source-based Forwarding" allows for massive scalability and is the future of the high-performance internet.

Share Article

Technical Standards & References

Rosen, E., et al. (2001)
MPLS: Architecture and Framework (RFC 3031)
VIEW OFFICIAL SOURCE
Andersson, L., et al. (2007)
LDP: Label Distribution Protocol (RFC 5036)
VIEW OFFICIAL SOURCE
Awduche, D., et al. (2002)
MPLS Traffic Engineering (RFC 3272)
VIEW OFFICIAL SOURCE
Awduche, D., et al. (2001)
RSVP-TE: Extensions to RSVP for LSP Tunnels (RFC 3209)
VIEW OFFICIAL SOURCE
Mathematical models derived from standard engineering protocols. Not for human safety critical systems without redundant validation.

Related Engineering Resources