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
- Name the router roles: CE, PE (edge LSR), P (core LSR).
- Describe push, swap and pop, and penultimate hop popping.
- Explain how LDP discovers neighbours and binds labels to IGP prefixes.
- Read the LFIB:
show mpls forwarding-table,show mpls ldp neighbor.
Labels along a path
| Operation | Where | What happens |
|---|---|---|
| Push (impose) | Ingress LSR (PE1) | Looks up the IP destination once and adds a label |
| Swap | Core LSR (P) | Replaces the incoming label with the next one, no IP lookup |
| Pop | Penultimate hop | Removes the top label because the egress asked for implicit null (label 3) |
| Route | Egress 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
- LSRs send hellos to 224.0.0.2 on UDP 646 on every MPLS interface (
mpls ip). - 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).
- Each LSR binds a local label to every IGP prefix in its table and advertises the bindings to all neighbours (downstream unsolicited, liberal retention).
- 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.3Commands
show mpls interfaces | Interfaces with MPLS and LDP enabled. |
show mpls ldp neighbor | LDP sessions and their state. |
show mpls ldp bindings | Local and remote labels per prefix (the LIB). |
show mpls forwarding-table | The LFIB used to switch labelled packets. |
Exam traps
- The penultimate router pops the label; the egress router does an IP lookup.
- LDP's transport address must be reachable, or hellos work and the session never forms.
- Labels are local to each router; the same prefix has different labels on different LSRs.
- The LSP follows the IGP: LDP does not choose paths.
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.