MPLS

Also known as: Multiprotocol Label Switching

On this page 8

MPLS, short for Multiprotocol Label Switching, is a forwarding technique in which routers move packets along predetermined label-switched paths by reading a short fixed-length label instead of performing a full IP lookup at every hop. In networking and routing, it sits between the data link layer and the network layer, which is why engineers often call it a layer 2.5 technology.

MPLS does not replace routing protocols. An interior gateway protocol such as OSPF or IS-IS still computes reachability, while MPLS adds a separate forwarding plane that service providers and large enterprises use for Layer 3 VPNs, traffic engineering and fast recovery from link failures.

How MPLS forwards packets with labels

MPLS forwards packets by swapping labels rather than by matching destination prefixes. When an IP packet enters the MPLS domain, the ingress label edge router classifies it into a forwarding equivalence class (FEC), which is a group of packets that receive identical treatment, and pushes a label onto it.

Each label switching router (LSR) in the core then looks up the incoming label in its label forwarding information base, replaces it with an outgoing label and sends the packet to the next hop. Because the lookup is an exact match on a 20-bit value, it avoids the longest prefix match that ordinary IP forwarding requires. At the far edge, the egress router removes the last label and forwards the original packet normally.

The label itself lives in a 32-bit shim header inserted between the layer 2 header and the IP header. The following table describes its four fields.

FieldSizePurpose
Label20 bitsIdentifies the path or service; values 0 to 15 are reserved
Traffic class3 bitsCarries quality of service markings, formerly called EXP
Bottom of stack1 bitSet to 1 on the last label in the stack
Time to live8 bitsPrevents loops, usually copied from the IP header
Fields of the MPLS label stack entry

Labels can be stacked, so a packet may carry an outer transport label and an inner service label. This label stacking is what allows one core network to carry many independent customer VPNs at the same time.

Label operations and router roles

Every MPLS router performs one of three basic operations on the top label: push, swap or pop. Where each operation happens depends on the router’s position along the label-switched path (LSP), which is always unidirectional, so two-way traffic needs two LSPs.

RoleCommon nameMain operation
Ingress LERProvider edge (PE)Classifies traffic and pushes labels
Transit LSRProvider (P) routerSwaps the top label
Penultimate LSRProvider (P) routerPops the transport label
Egress LERProvider edge (PE)Removes the service label and routes the packet
Router roles along a label-switched path

Penultimate hop popping removes the transport label one hop before the egress router, so the egress device performs only one lookup instead of two. An egress router signals this behavior by advertising the implicit null label (value 3); it advertises explicit null instead when the traffic class marking must survive to the last hop.

Label distribution protocols in MPLS

Routers must agree on label meanings, and several control plane protocols distribute those bindings. The choice of protocol determines whether paths simply follow the IGP shortest path or are engineered explicitly.

ProtocolWhat it signalsTypical use
LDPLabels for IGP prefixesBasic transport following shortest paths
RSVP-TEExplicit paths with bandwidthTraffic engineering and fast reroute
MP-BGPVPN and service labelsLayer 3 VPNs and EVPN services
IGP extensionsSegment identifiersSegment routing without LDP or RSVP
Protocols that distribute MPLS labels

LDP is the simplest option because it follows the routing table, but it cannot steer traffic away from congested links. RSVP-TE reserves bandwidth along a computed path and supports fast reroute that switches traffic to a precomputed backup in about 50 milliseconds, although it keeps per-path state on every transit router. Segment routing, a neighboring concept, moves that state into the packet header and is now a common successor design.

Services built on MPLS

The main value of MPLS today lies in the services it carries, not in faster lookups, since modern hardware performs IP lookups at line rate. Providers sell these services under names such as MPLS VPN or IP VPN.

  • Layer 3 VPN (L3VPN): each customer gets a virtual routing and forwarding instance on the PE router, and MP-BGP carries customer routes with route distinguishers so that overlapping address spaces do not collide.
  • Layer 2 VPN: pseudowires and VPLS emulate point-to-point circuits or a shared Ethernet segment across the core.
  • EVPN: a BGP-based control plane for Ethernet services with all-active multihoming and better MAC address handling than VPLS.
  • Traffic engineering: RSVP-TE or segment routing policies place flows on paths other than the shortest one to balance link utilization.

Enterprises usually compare a managed MPLS service with SD-WAN over internet links and with plain IP routing. The comparison below summarizes the practical trade-offs.

CriterionMPLS VPNSD-WAN over internetPlain IP routing
Path controlEngineered by providerApplication-aware overlayShortest path only
Performance guaranteesContractual SLABest effort, mitigatedNone
EncryptionNot built inIPsec by defaultOptional
Cost per megabitHighLowLow
Provisioning timeWeeks to monthsDaysDays
MPLS, SD-WAN and plain IP routing

Many organizations now run a hybrid design, keeping MPLS for latency-sensitive traffic such as voice and ERP and moving bulk traffic to SD-WAN. A common misconception is that MPLS is inherently encrypted; it provides traffic separation, not confidentiality, so sensitive data still needs IPsec or MACsec when that matters.

Limitations and common mistakes

MPLS adds operational complexity that small networks rarely need. Troubleshooting requires familiarity with label tables, LSP ping and traceroute, and a mismatch between IGP and LDP can silently drop traffic.

SymptomLikely causeRemedy
Large packets droppedLabel overhead exceeds link MTURaise core MTU by 4 bytes per label
Traffic black-holed after IGP changeLDP not yet synchronizedEnable LDP-IGP synchronization
Hidden core hopsTTL propagation disabledAdjust TTL policy as needed
VPN routes missingRoute target mismatchAlign import and export targets
Typical MPLS problems and their remedies

Another frequent mistake is assuming that an MPLS service guarantees performance end to end. The SLA covers only the provider core, so congestion on access circuits or inside the customer site still degrades applications.

Stripped to the essentials

Normally, every router reads the full address on a packet and decides where to send it next. MPLS works more like a sorting tag on a parcel. The first router decides the whole route once and attaches a short tag, and every router after that only reads the tag.

This makes it easy for a network provider to keep different customers apart, to send traffic along chosen roads instead of the shortest one, and to switch to a backup road quickly. The key point is that MPLS is about controlled, separated paths, not about secrecy, because the tags do not encrypt anything.

Where it is applied

A retail chain with 120 stores and two data centers buys a Layer 3 MPLS VPN from a regional carrier. Each store connects to the nearest provider edge router over a 50 Mbit/s access circuit, and the carrier places all sites in one virtual routing and forwarding instance, so stores reach the data centers without any tunnels on the store routers.

Point-of-sale and voice traffic is marked with a high traffic class, and the carrier’s RSVP-TE tunnels with fast reroute keep card payments flowing during a fiber cut that would otherwise interrupt them for several seconds. Guest internet and software updates go out over cheaper local broadband through SD-WAN. The result is predictable latency for critical systems at a lower total cost than carrying everything over MPLS.