100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What is MPLS (Multiprotocol Label Switching)?

Learn what MPLS is, how label-swapping forwarding works, LER vs LSR, and how it enables VPNs and traffic engineering.

mediumQ47 of 224 in Computer Networks Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

MPLS is a WAN forwarding technique that attaches a short fixed-length label to each packet at the edge of a network so that interior routers can forward it purely by looking up the label, instead of re-examining the full IP header at every hop.

When a packet enters an MPLS domain, an ingress Label Edge Router (LER) inspects it once, classifies it into a Forwarding Equivalence Class, and pushes a label onto it. From that point on, interior Label Switch Routers (LSRs) forward the packet using only the label as an index into a local table, swapping it for the next label and sending the packet out the corresponding interface, without inspecting the IP header at all. This label-swapping is faster and more predictable than hop-by-hop IP lookups, and because forwarding decisions no longer depend solely on destination address, MPLS enables traffic engineering, where an operator can force traffic onto a specific path for load balancing or SLA guarantees. MPLS also underlies technologies like Layer 3 VPNs, letting a service provider carry multiple customers’ private, overlapping IP address spaces across a shared backbone by stacking a VPN label under the transport label. At the egress LER, the label is popped and the packet is forwarded as ordinary IP again.

  • Fast label-swapping forwarding instead of per-hop IP lookups
  • Enables traffic engineering to steer traffic along specific paths
  • Underpins Layer 3 VPNs carrying overlapping customer address spaces
  • Decouples forwarding from destination-only IP routing decisions

AI Mentor Explanation

MPLS is like a stadium issuing a colored wristband at the gate that tells every internal steward exactly which section to route a spectator to, instead of each steward re-checking the spectator’s full ticket details at every checkpoint. The gate steward reads the ticket once and assigns the wristband color; every steward after that just glances at the wristband and waves the person through to the next zone. When the spectator exits, the wristband is removed and they are just a normal member of the crowd again. This mirrors how MPLS labels a packet once at the edge so interior routers can forward it by a quick label lookup instead of the full header.

Step-by-Step Explanation

  1. Step 1

    Ingress classification

    A Label Edge Router inspects the packet once and assigns it to a Forwarding Equivalence Class.

  2. Step 2

    Label push

    The ingress LER pushes a label onto the packet representing that FEC and the chosen path.

  3. Step 3

    Label swapping

    Interior Label Switch Routers forward the packet by swapping labels using only a local lookup table, no IP inspection.

  4. Step 4

    Egress pop

    The egress LER pops the label and forwards the packet as ordinary IP toward its final destination.

What Interviewer Expects

  • Explains label-swapping forwarding versus per-hop IP lookup
  • Knows the roles of LER (edge) and LSR (interior) routers
  • Mentions traffic engineering as a key MPLS benefit
  • Aware MPLS underlies Layer 3 VPNs for overlapping customer address spaces

Common Mistakes

  • Thinking MPLS is an encryption or VPN protocol by itself
  • Confusing labels with IP addresses
  • Not knowing forwarding decisions in the interior skip IP header inspection
  • Forgetting the label is pushed at ingress and popped at egress

Best Answer (HR Friendly)

MPLS is a technique carriers use to speed up and control how traffic moves across a large network by attaching a short label to data at the entry point, so every router in between can forward it with a quick label lookup instead of examining the full address every time. It also lets providers guarantee specific paths for critical traffic and keep different customers’ private networks separate while sharing the same backbone.

Code Example

Inspecting MPLS labels on a Linux router (FRRouting/iproute2)
# Show MPLS label forwarding table entries
ip -M route show

# Show LDP neighbor sessions (FRRouting)
vtysh -c "show mpls ldp neighbor"

# Show local label bindings advertised by LDP
vtysh -c "show mpls ldp binding"

Follow-up Questions

  • What is the difference between an LER and an LSR?
  • How does MPLS enable traffic engineering?
  • What is an MPLS Layer 3 VPN and how does the VPN label work?
  • How does penultimate hop popping (PHP) improve efficiency?

MCQ Practice

1. What does an interior MPLS router use to forward a packet?

Interior LSRs forward packets using a label lookup instead of inspecting the IP header.

2. Where is an MPLS label first attached to a packet?

The ingress LER classifies the packet and pushes the initial label.

3. Which capability is a key benefit MPLS adds over plain IP routing?

MPLS allows operators to steer traffic onto specific engineered paths, not just shortest IP routes.

Flash Cards

What is MPLS?A WAN technique that forwards packets using short labels instead of per-hop IP header lookups.

LER vs LSR?LER (edge) classifies and pushes/pops labels; LSR (interior) forwards by swapping labels.

Key MPLS benefit?Fast forwarding plus traffic engineering and Layer 3 VPN support.

When is the label removed?At the egress LER, before the packet continues as ordinary IP.

1 / 4

Continue Learning