MPLS forwards packets based on labels instead of IP lookups and enables scalable VPN solutions and traffic engineering.

Facts

Point Fact
Technology Multiprotocol Label Switching
OSI layer Between L2 and L3 (Layer 2.5)
Forwarding Label-based, not IP longest-prefix match
Classification Traffic grouped in FEC (Forwarding Equivalence Class)
Label size 32-bit header (20-bit label + TC + S-bit + TTL)
Label scope Locally significant
Operations Ingress push · core swap · egress pop
Penultimate hop popping Standard – second-to-last router removes the transport label
Control plane IGP (OSPF/IS-IS) + LDP (TCP 646, discovery UDP)
Data plane CEF + LFIB
Router types CE (no MPLS), PE (VRF + MPLS + MP-BGP), P (MPLS + IGP only)
VPN label Assigned by the egress PE; transport label through the core; typical 2-label stack
Route distribution MP-BGP (VPNv4)
RD / RT RD makes overlapping prefixes unique; RT controls import/export

What problem does MPLS solve?

Problem MPLS solution
Large routing tables Labels instead of IP lookups
Customer separation VRF + labels
Inefficient routing LSPs (Label Switched Paths)
WAN scalability Central routing in the core

How it solves it

  1. Ingress LER classifies traffic into a FEC
  2. Pushes a label
  3. Core routers swap labels (no IP lookup)
  4. Egress LER pops the label and does normal routing

Roles

Component Function
CE Customer Edge – no MPLS
PE Provider Edge – VRF, labels, MP-BGP (LER)
P Provider core – label switching only (LSR)

FEC

A group of packets that get the same label and are treated identically – e.g. by destination prefix, QoS class or VPN membership.

MPLS label fields

Field Description
Label 20 bits
TC Traffic class (QoS)
S-bit Bottom of stack
TTL Loop prevention

PHP

The penultimate router pops the transport label – reduces load on the egress PE, controlled via implicit-null label 3. PHP is the MPLS default.

LIB vs LFIB

Table Function
LIB All known labels (label information base)
LFIB Actually used to forward labeled packets (swap/pop/forward)

LDP

Distributes labels between neighbors – UDP 646 hellos to 224.0.0.2 for discovery, then a TCP 646 session for label exchange; builds LSPs based on the IGP.

MPLS Layer 3 VPN (very important)

Combines VRF (routing separation), MP-BGP (VPNv4 routes) and a label stack:

Label Function
Outer Transport through the core (LDP) – P routers only know this one
Inner Identifies the VPN/VRF (learned via MP-BGP, assigned by egress PE)

RD: format ASN:nn or IP:nn – makes VPNv4 prefixes unique. RT: controls import/export of VPN routes in MP-BGP.

MPLS vs classic IP routing

Feature IP routing MPLS
Lookup Longest prefix match Label
VPN ACL / GRE VRF
Scaling Limited High
Core routing Complex Simple

Special considerations

Configuration

ip cef
mpls ip
!
interface GigabitEthernet0/0
 mpls ip
!
mpls ldp router-id Loopback0 force

Verification (CCNP)

show mpls interfaces
show mpls ldp neighbor
show mpls forwarding-table
show ip cef
show bgp vpnv4 all
show vrf

Extras: MPLS TE (RSVP-TE), Fast Reroute (FRR), QoS awareness, carrier-grade VPNs, foundation for SD-WAN.