MPLS Cheat sheet
Notes taken from MPLS, writups by Peter J. Welcher, the Cisco MPLS FAQ for beginners, - 9/28/2005 and MPLS Configuration on IOS Software by Umesh Lakshman.
Table of Contents
- Labels are 'shimmed' between L3 & L2 to provide for quick switching through MPLS network.
- Over PPP, Ethernet, 802.3, or ATM links
- PPP Header (Packet over SONET/SDH) - | PPP Header | Label | L2/L3 Packet |
- LAN MAC Label Header - | MAC Header | Label | L2/L3 Packet |
- ATM MPLS Cell Header (VPI & VCI together are Label) - | GFC | VPI | VCI | PTI | CLP | HEC | DATA |
- Labels have local significance to each hop only. If a packet is found to have no label (only possible in an IP MPLS network, not Frame Relay or ATM), routing lookup is done, and possibly a new label is applied.
- MPLS has it's own ethertype code.
- P routers - Provider core rtrs
- C routers - Customer core rtrs
- CE routers - Customer edge routers
- PE routers - Provider edge routers. Maintain VPN routes for VPNs associated with the connected interfaces.
- Existing routing protocols (OSPF, IS-IS, etc...) work in cloud. BGP usually between customer and provider routers.
- Label Distribution Protocols (LDP) Establishes Label to Destination Network Mappings. Works in cloud. Distributs labels for prefixes advertised by unicast routing protocols. RFCs 3035 and 3036
- Label changed at each switch/rtr in cloud. For every route, table has:
- In Label | Address Prefix | Out Interface | Out Label
MPLS allows for VPNs, Traffic Engineering (TE), QoS, ATM over MPLS (AToM). Additionally, in decreases forwarding overhead on the core routers.
- LSR - Label Switch Router.
- Edge LSR - LSR connecting to non-LSR. Ingress is where packet comes in. Egress is where packet goes out.
- LIB - Label Information Base - based in ingress port and label, egress port and label are determined. LSR can substitute outbound label for incoming and forwrad frame. Incoming Label is the label it comes in with. Outgoing label is the label it goes out with (for a downstream neighbor), local binding is a label that has local significance (i.e. goes through your LIB). Remote binding is something that has significance for the downstream router.
- LSP - Label Switch Path
- FEC - Forward Equivalency Class - all packets to which specific label is applied.
- LDP - Label Distribution Protocol (uses TCP port 646) - Communication between LSRs to communicate and bind labels. Explicit routing (with a source or controller setting up a Traffeic Engineering path), or CR-LDP (constraint based routing), RSVP-TE (extended RSVP driving and LDP). Cisco has their own TDP (Tag Distribution Protocol - Uses TCP port 711.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
| Label | Exp |S| TTL |
- Label: Label Value (Unstructured), 20 bits
- Exp: Experimental Use, 3 bits; currently used as a Class of Service (CoS) field.
- S: Bottom of Stack, 1 bit
- TTL: Time to Live, 8 bits
0 through 2^20 - 1.
0-15 reserved; 4-15 reserved for future use.
| 0 ||IPv4 Explicit NULL Label. Label indicates that label stack must be popped, and packet forwarding must be based on IPv4 header. Useful in keeping Exp bits safe until egress router. Used in MPLS based QoS.|
| 1 ||Router Alert Label. When at top of label stack, packet delivered to local software module for processing. Actual packet forwarding determined by the label beneath it in the stack. If packet is forwarded further, Router Alert Label should be pushed back onto label stack before forwarding. Use of this label is analogous to use of "Router Alert Option" in IP packets (for example, ping with record route option|
| 2 ||IPv6 Explicit NULL Label. Indicates that stack must be popped, and packet forwarding must be based on IPv6 header.|
| 3 ||Implicit NULL Label. Indicates that LSR will pop top label from stack and forward rest of packet (labeled or unlabled) through outgoing interface (per LIB). Value never appears in encapsulation, but needs to be specified in LDP, so value is reserved.|
- what's distributed is label, IP prefix, mask
- can be distributed in:
- Ordered LSP control mode - wait for downstream neighbor to send you label before you send to upstream rtr - usually used in cell-based nets
- Independent LSP control mode - just send label to upstream rtr - don't wait - usually used in frame-based nets
- label distribution types
- unsolicited label distribution - advertise labels for all prefixes in IGP to neighbors - don't use on ATM switches (can overwhelm tables)
- DoD label distribution (Downstream On Demand)- LSR asks downstream neighbor for label. When request get's (recursively) repeated to LER, the bindings than flow back upstream.
- Label Retention Modes
- liberal - keep label even if neighbors are not yet next hops - default for Cisco?
- conservative - if label no currently useful, discard
Label determines LSRs outbound interface and label via LIB, but precedence or EXP field is used to determine queuing treatment. Cisco only has 4 queues by default(?).
Use unidirectional tunnels to shift traffic off one path and onto another. Can be static or Automatic.
network implemented using shared net infrastructure but so as to provide security and privacy of a private leased line network.
- 8 byte Route Distinguisher prefaces IP address (i.e. 23:10.1.1.0 means IP address 10.1.1.0 in VPN 23)
- MBGP propagates routing info between peer routers.
- Route distinguisher 0 and VPN 0 can be regarded as the curent Internet.
- Extended communities (8 byte version of BGP 2 byte communities) is way to get between customers (VPNs).
Ethertypes for MPLS
|MPLS Control Packet (MPLSCP) for PPP||0x8281|
Cisco config and statements
Global MPLS Config
mpls ip (global or interface level)
mpls label protocol ldp|tdp (ldp is standardized)
(global or interface level)
mpls ldp router-id loopback 0 (ties to loopback 0)
ip addr <ipaddr>
mpls ip (possibly need this)
tag-switching ip (alternate form of mpls ip - don't need both)
Interface-Level MPLS Config
interface ethernet 0
mpls mtu <sizeInBytes> (should be IP MTU +(4 * max num of labels))
Cell-Mode Interface Config
int atm 3/0
no ip address
no atm ilmi-keepalive
int atm 3/0.1 mpls
ip address <ipaddr> <netmask>
mpls ldp address-message
mpls ldp atm contro|vcmerge
assign lp router id
mpls ldp router-id loopback 0
Configuring LDP Params
mpls ldp discovery hello holdtime <seconds>
mpls ldp discovery hello interval <seconds>
ip cef distributed (only on dist platfrms - 12000 or 7500, not 7200)
sh ip interface <interface> (to show that CEF is enable)
sh ip cef summary (show stats, whether running in distributed mode)
router ospf 100
network 10.10.10.0 0.0.0.255 area 0
General Show Commands
sh mpls interfaces
sh mpls ldp discovery Verify status of LDP discovery process
sh mpls ldp neighbor
sh mpls forwarding <ipaddr> detail
(label stack info)
sh ip cef <ipaddr> internal (IP to IP, IP to MPLS)
(if entry indicates tags imposed - it's mpls)
(shows mpls or routing path frame/cell will take)
sh mpls forwarding-table (MPLS to MPLS, MPLS to IP)
sh mpls ip bindings <addr> (shows LIB (label info base - populated by LDP or TDP))
(only next hop rtrs make it from LIB to fwd table)
show mpls ldp bindings
sh mpls ldp discovery (shows if hellos are being sent and received)
sh mpls ldp neighbor
sh mpls ldp parameters
sh mpls interfaces [detail]