Intermediate

MPLS: Label Switching Basics

PE1 pushes a label, P swaps it, PE2 pops it. P has no route to either host's network, so the only thing carrying the packets across it is the label.

Open this lab

Free interactive lab. No signup. Runs in your browser.

The scenario

Host-A (10.0.1.10) and Host-B (10.0.3.10) are joined by three routers in a line: PE1, P and PE2. PE1 has a static route to 10.0.3.0/24 via P and an LSP bound to that route, so it pushes label 16001 onto packets for Host-B. P looks up 16001 in its label table, swaps it for 16002 and sends the packet to PE2. PE2 pops 16002 and delivers the plain IP packet to Host-B. Replies use a second LSP the other way: PE2 pushes 16010, P swaps it for 16011, PE1 pops it. P has only its two connected networks in its routing table and no route to 10.0.1.0/24 or 10.0.3.0/24; no router here runs OSPF, and every label is configured by hand.

What you will work out

Understand the three MPLS operations (push, swap, pop), why a label switched path runs in one direction only, and how a core router can forward traffic it has no IP route for.

Why this matters

MPLS carries traffic across many service-provider and large enterprise networks, and push, swap and pop are the operations everything else is built on: L3VPNs, traffic engineering and fast reroute all come down to which labels a router pushes and what each router does with them. Remembering that an LSP runs one way explains a common puzzle, a path that works in one direction and silently fails in the other.

Running it

MPLS: Label Switching Basics opens on a canvas, already wired and addressed. Trace a packet through it hop by hop, or run the same topology live on real Linux network namespaces. How the two modes differ.

Open MPLS: Label Switching Basics

Runs in your browser. No install, no signup, and the simulation starts instantly.

Open the lab →