Service Provider & MPLS

MPLS Fundamentals

Multiprotocol Label Switching — the forwarding architecture underneath almost every carrier backbone and enterprise WAN. Four chapters: why labels replaced longest-match lookups, how LDP distributes them, what the data plane really does with the stack, and how to verify the whole LSP end to end.

read in order, or dip in
4 chapters

read in order, or dip in

updated 31 Aug 2026
Free — no signup

updated 31 Aug 2026

Contents

  1. 01MPLS Label Switching ExplainedMPLS forwards packets on a 32-bit label inserted between the layer-2 and layer-3 headers instead of on the IP destination address: the ingress router classifies a packet once into a forwarding equivalence class, and every subsequent router just swaps labels along a pre-established label-switched path. Its modern value is not lookup speed but what the label indirection enables — VPNs, traffic engineering and fast reroute.
  2. 02LDP: How Labels Are DistributedLDP is the workhorse protocol that binds labels to IGP prefixes: routers discover each other with hellos to 224.0.0.2 on UDP 646, build TCP sessions on port 646, and advertise a label mapping for every prefix in their routing table. Cisco defaults — liberal retention, unsolicited advertisement, independent control — mean every router labels everything, and the IGP decides which bindings are used.
  3. 03The MPLS Data Plane: LFIB, PHP and Label StackingThe MPLS data plane is the LFIB: incoming label in, operation (swap, pop, push) and outgoing interface out. Penultimate-hop popping removes the transport label one hop early — signalled by implicit-null (label 3) — saving the egress router a double lookup, while explicit-null (label 0) preserves QoS bits to the last hop. Label stacks let one outer transport LSP carry many inner service contexts, which is the mechanism behind every MPLS VPN.
  4. 04Verifying and Troubleshooting an LSP End to EndMPLS breaks in layers, so verification walks layers: IGP route to the egress loopback, LDP neighbourship and bindings, LFIB programming, and finally the data plane itself with MPLS-aware ping and traceroute. The classic silent failure is an LSP that breaks mid-path and falls back to IP — invisible to normal ping, fatal to VPN traffic — which lsp ping and per-hop LFIB checks expose immediately.

Spotted something out of date? Tell us — this library is maintained by the faculty.