HomeNetworking › MPLS Label Stack

MPLS Label Stack Visualizer

A packet crossing a label-switched path, hop by hop. See where each label is imposed, swapped and removed — and why the last router usually receives one fewer than you expect.

Local toolYour network plan stays in your browser. Nothing you enter is uploaded, logged, or sent to any server.

The path

What happens at each hop

Push, swap, pop — and the two nulls

MPLS forwards on a label rather than on the IP header. Each router looks up the top label, performs one action, and sends the packet on.

Penultimate hop popping is the default nearly everywhere. The egress router advertises implicit null — label 3, which never actually travels in a packet — and that tells the router before it to pop the transport label instead of swapping. The last router then receives an unlabelled packet, or in a VPN one carrying only the service label, and does a single lookup instead of two.

Explicit null — label 0 for IPv4, 2 for IPv6 — is the alternative. The label stays on the stack to the very last hop, which preserves the traffic class bits for quality of service. You pay for it with an extra lookup at the egress.

The two-label stack in an L3VPN is the thing worth understanding. The transport label gets the packet across the core and is popped by the penultimate hop. The service label underneath survives, and tells the egress which VRF the packet belongs to. That is why PHP does not break VPNs.

Related tools

MPLS MTU Calculator counts what those labels cost. SR Label Stack Calculator covers segment routing. VRF Planner covers the route targets behind a VPN.