MPLS: Label Switched Path Mechanics
The Shift to Layer 2.5 Switching
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.
Operation Details
Customer sends standard IP packet to Service Provider edge.
Label Forwarding Table
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."
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).
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.