MPLS Labels and Forwarding
Why labels exist
Multiprotocol Label Switching (MPLS) forwards packets through a domain using short numeric labels. At ingress, traffic is classified into a forwarding equivalence class (FEC): packets treated alike for a forwarding purpose. For example, packets destined for one remote router may share a transport FEC. A label-switched path (LSP) is the sequence of forwarding steps for labeled traffic in one direction. The reverse direction needs its own forwarding state. A label is not an IP address, a globally unique identifier, or an encryption key.
Follow push, swap and pop
In this fictional, single-label LSP, PE1 pushes a label, P1 replaces the top label, and P2 removes it before PE2. The stack is written with the outermost label first. Assume P2 has an installed pop action requested for this transport LSP. This is penultimate-hop popping (PHP); it is not mandatory for every LSP. PE2 receives the original IP packet and performs an IP lookup. The label 160 has meaning in the receiving router’s label space, not necessarily elsewhere.
Node Input Action Output (top first)PE1 IP push 160 [160]P1 [160] swap 160 -> 240 [240]P2 [240] pop []PE2 IP IP lookup customer linkRead the stack and budget MTU
Each conventional MPLS stack entry occupies four bytes: a 20-bit label, three traffic-class bits (TC, historically called EXP), a bottom-of-stack bit S and an 8-bit TTL. For two entries, overhead is 8 bytes. If a link budget permits 1500 bytes for the IP packet plus labels, a 1492-byte IP packet fits with two labels. This budget excludes Ethernet headers and other encapsulations; actual device MTU definitions differ. Three labels reduce the same budget to 1488 bytes. TTL handling depends on the configured model; do not infer IP hop counts solely from a label capture.
Where forwarding entries come from
The control plane establishes label bindings; the data plane applies installed actions. LDP (Label Distribution Protocol) distributes bindings typically along ordinary routed paths. RSVP-TE signals traffic-engineered LSPs, which can follow explicit routes and constraints. A working IP route alone does not establish a working label path. A missing incoming-label entry can prevent delivery even if the IP next hop exists. In a real authorized lab inspect the incoming label, operation, next hop, interface and egress state before changing anything. Practice: replace 240 with 280 on P1 and P2 together; then predict what happens if only P1 changes. See RFC 3031, 3032, 5036 and 3209.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
MPLS Labels and Forwarding Quiz
Apply MPLS concepts to fictional offline scenarios.
What does a FEC group?
P1 receives [160] in the first diagram. What leaves P1?
What does P2 remove in the single-label example?
How many bytes do three standard MPLS entries add?
Which statement about LDP is accurate?