Skip to content

MPLS Label Operations: Pushing, Swapping, and Popping Explained

MPLS Packet Journey: The Three Label Operations at Each Hop

This walkthrough follows a packet from CE1 (192.168.11.0/24) to CE2 (192.168.12.0/24) across an ISP's MPLS infrastructure. The CE routers are MPLS-unaware and forward packets using standard routing protocols between CE and PE routers. For a foundational understanding of how MPLS differs from traditional routing, see this MPLS Explained: What Is Multi-Protocol Label Switching? (Simple Guide).

1. Label Push at PE1 (Ingress LSR)

  • PE1 receives the unlabeled IP packet from CE1
  • It performs a destination IP lookup in its LFIB (Label Forwarding Information Base)
  • LFIB shows: local label = 101 (not pushed), outgoing label = 201
  • PE1 pushes label 201 onto the packet (only the remote label, not its own)
  • This label was learned via LDP from P1
  • The packet exits via the interface pointing toward P1's underlay IP

Note on Label Ranges:

  • Labels 0-15 are reserved (see RFC 3032)
  • Most vendors start dynamic assignment at label 16
  • For easier troubleshooting, administrators can assign unique ranges per router (e.g., PE1: 100-199, P1: 200-299, P2: 300-399)

2. Label Swap at P1 (Transit LSR)

  • P1 receives the labeled packet and inspects the top label (201)
  • LFIB lookup for destination prefix reveals:
    • Outgoing label = 301
    • Exit interface toward P2
    • Next-hop underlay IP = P2
  • P1 performs a swap: removes label 201 and pushes label 301 in its place
  • This is the core MPLS switching operation at each transit LSR

To better understand how labels are initially distributed between neighbors, check out LDP in MPLS: Label Distribution Protocol Simply Explained.

3. Label Pop at P2 (Penultimate Hop Popping - PHP)

  • P2 receives the packet with label 301
  • LFIB shows: outgoing label = "Pop label" (explicit PHP instruction)
  • P2 pops the label entirely (removes the MPLS header)
  • The unlabeled IP packet is forwarded to PE2 using standard routing

Why PHP Matters:

  • Reduces the processing load on the egress PE router (PE2)
  • PE2 only needs to perform a simple IP routing lookup, not an LFIB lookup
  • This optimization is configured by the egress LSR (PE2) advertising an implicit null label (label 3) to its upstream neighbor

Practical Takeaways for MPLS Implementation

  • Label stacking enables multiple services: When MPLS is combined with Layer 3 VPNs, multiple labels can be pushed (e.g., outer label for transport, inner label for VPN identification)
  • All operations (push/swap/pop) are based on information exchanged via LDP (Label Distribution Protocol) between neighboring LSRs
  • Labels are locally significant and only meaningful between directly connected peers
  • The packet's original IP header is never inspected after the first LSR, enabling fast forwarding through the MPLS core

For a foundational understanding of MPLS router roles and how these operations fit into the bigger picture, review MPLS Labels, Device Roles & LDP Protocol Explained Simply.

Key Mnemonic:

  • Push = add a new label at ingress
  • Swap = replace the incoming label with the outgoing label at each transit LSR
  • Pop = remove the label at the penultimate hop (PHP) or egress LSR

For configuration details on setting label ranges and advanced label stacks (e.g., for Layer 3 MPLS VPNs), watch the follow-up videos in this series on telecom.Tech.

If you're new to networking concepts, you might find the CCNA Day 1: How Switches Work vs Hubs & Hands-On Packet Tracer Lab helpful for understanding the switching fundamentals underlying MPLS operations.

For those interested in broader tech terms, we also have a guide on 20 Key AI Terms Every Engineer Must Know Explained Simply.

Keep this summary

Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.

Save to LunaNotes

Or summarise for another video.

32K+ people have turned 65K+ videos into notes

“Very useful tool. I'm using it for the last couple weeks and I'm loving it so far. Makes learning on YouTube a great experience.”
Bhai Chrome Web Store review

This summary and transcript were automatically generated using AI with the Free YouTube transcript summary tool by LunaNotes.

Related summaries

LDP in MPLS: Label Distribution Protocol Simply Explained

LDP in MPLS: Label Distribution Protocol Simply Explained

Learn how Label Distribution Protocol (LDP) works in MPLS networks. This comprehensive guide explains label exchange, LIB and LFIB constructs, and penultimate label popping from first principles.

MPLS Labels, Device Roles & LDP Protocol Explained Simply

MPLS Labels, Device Roles & LDP Protocol Explained Simply

This video from telecom.Tech breaks down MPLS labels, the roles of CE, PE, and P routers, and how the Label Distribution Protocol (LDP) auto-populates forwarding tables. A clear, beginner-friendly overview of MPLS core network operations and packet switching mechanics.

MPLS Explained: What Is Multi-Protocol Label Switching? (Simple Guide)

MPLS Explained: What Is Multi-Protocol Label Switching? (Simple Guide)

MPLS is a high-performance network protocol used in ISP core networks to efficiently direct data between nodes using labels instead of IP lookups. It sits between Layer 2 and Layer 3, encapsulates multiple protocols, and is ideal for interconnecting customer sites securely. This video provides a simple introduction to MPLS, comparing it to traditional IP routing and explaining its key benefits.

Basic MPLS Configuration on Cisco IOS: Step-by-Step Guide

Basic MPLS Configuration on Cisco IOS: Step-by-Step Guide

Learn how to configure MPLS on Cisco IOS routers in a typical ISP network. This video walks through the full process: eBGP peerings with customers, OSPF underlay, iBGP full mesh among PEs, and finally enabling MPLS with LDP, followed by verification using LFIB and PHP.

How BGP Is Used in the MPLS Core: Edge Routing Explained

How BGP Is Used in the MPLS Core: Edge Routing Explained

Learn how BGP operates only on the perimeter of an MPLS network, enabling PE routers to share customer routes while core P routers stay label-switching only. This video breaks down the CE/PE/P router roles, IBGP full-mesh on edges, and why MPLS beats IP routing for scalability.

Found this summary useful?

Take it with you. One click puts it in your own LunaNotes library.

Save to LunaNotes

Start taking better notes today with LunaNotes