2.1 Describe how MPLS forwards: LSRs, LDP, labels and LSPs

ENARSI 300-410 v1.1 · 2.0 VPN Technologies

MPLS forwards packets by a short label instead of looking up the IP destination at every hop. Routers that switch labels are LSRs; they agree on labels with LDP, and the chain of labels from one edge to the other is an LSP. Enterprises meet MPLS mostly as the carrier service under their WAN, and ENARSI asks you to describe how it works.

What you must know

Labels along a path

OperationWhereWhat happens
Push (impose)Ingress LSR (PE1)Looks up the IP destination once and adds a label
SwapCore LSR (P)Replaces the incoming label with the next one, no IP lookup
PopPenultimate hopRemoves the top label because the egress asked for implicit null (label 3)
RouteEgress LSR (PE2)Ordinary IP lookup

The packet follows the LSP (1). A label is 20 bits, sits between the layer 2 and IP headers (the "shim", 4 bytes with EXP/TC, the bottom-of-stack bit and a TTL), and several can be stacked; L3VPNs use two.

LDP

  1. LSRs send hellos to 224.0.0.2 on UDP 646 on every MPLS interface (mpls ip).
  2. The one with the higher LDP router ID opens a TCP 646 session to the other's transport address; that address must be reachable (usually a loopback).
  3. Each LSR binds a local label to every IGP prefix in its table and advertises the bindings to all neighbours (downstream unsolicited, liberal retention).
  4. It uses only the label from the neighbour that is its IGP next hop, so the LSP follows the IGP path.
P1# show mpls ldp neighbor
    Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 3.3.3.3.646 - 2.2.2.2.31505
        State: Oper; Msgs sent/rcvd: 41/40; Downstream

P1# show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
18         Pop Label  3.3.3.3/32       0             Gi0/1      10.0.23.3
24         Pop Label  10.9.9.0/24      14860         Gi0/1      10.0.23.3

Commands

show mpls interfacesInterfaces with MPLS and LDP enabled.
show mpls ldp neighborLDP sessions and their state.
show mpls ldp bindingsLocal and remote labels per prefix (the LIB).
show mpls forwarding-tableThe LFIB used to switch labelled packets.

Exam traps

Check yourself

Which router does penultimate hop popping?
The one before the egress LSR, when the egress advertises implicit null (label 3).
What decides which neighbour's label an LSR uses for a prefix?
The IGP next hop for that prefix.
Which ports does LDP use?
UDP 646 for hellos, TCP 646 for the session.
How many bytes does one label add?
Four.

More topics in 2.0 VPN Technologies