Route My World!

A CCNA/CCNP Blog

MPLS Concepts

Posted by Aragoen Celtdra on February 26th, 2011

Ok, Ok, I know I said in a previous post that I will be going away from my usual bullet-style blog posts. But I just can’t see any better way to take notes than to do it the way I’ve been doing it for the last couple of years. So here are some notes I’ve compiled over the last few days on MPLS.

MPLS

  • Stands for Multi-Protocol Label Switching
  • Uses a new way for routers to forward packets. Instead of the traditional way of  forwarding packets based on destination IP address, MPLS routers forward packets using MPLS labels.
    • Label Switching indicates that the packets are no longer IPv4 packets, IPv6 packets, or even Layer 2 frames when switched. They are instead labeled.
  • MPLS allows forwarding decisions based on other factors, such as:
    • Traffic Engineering
    • QoS requirements
    • Privacy requirements for multiple customers connected to the same MPLS network (MPLS VPN)

MPLS Header and Label

  • The MPLS header is a 4-byte (32-bit) field, located immediately before the IP header

  • The header is also often times referred to as a shim header.
  • Most will simply refer to the MPLS header as the MPLS label, but in fact the label is actually a 20-bit field in the MPLS header.
    • The label identifies the portion of a label switched path (LSP). LSP will be discussed later.
    • The label value can be between 0 and 1,048,575 (or 2^20 – 1)
  • The MPLS EXP bits is a 3-bit field used for QoS marking. Historically it was called Experimental because the actual used for it was then undetermined.
  • The bottom-of-stack (S) field (1-bit) is a flag, which when set to 1, means that this is the label immediately preceding the IP header. (see label stacking)
  • Time-to-Live (TTL) is an 8-bit field used for the same purpose as the IP header’s TTL field.

Label Stacking

  • Label stacking is the encapsulation of an MPLS packet inside another MPLS packet. In other words, an MPLS header is added “on top of” an existing MPLS header; hence “stacking”.
  • This is done so that one MPLS LSP can tunnel inside another LSP.
  • The first label in the stack is called the top label.
  • The last label is called the bottom label.

  •  The BoS bits for all labels is 0 except the very bottom, which has a value on 1. A value of 1 means that this label is the bottom label and is immediately followed by the IP header.

Encapsulation of Labeled Packet

  • The label stack sits in front of the Layer 3 packet, before the header of the transported protocol, but after the Layer 2 header.

 

  • The MPLS label stack is often called the shim header because of the placement of the packet in the frame.
  • The Layer 2 encapsulation of the link can almost be any encapsulation that Cisco supports. For example:
    • PPP
    • High-Level Data Link Control (HDLC)
    • Ethernet
  • The transported protocol could be anything:
    • IPv4
    • IPv6
    • Frame Relay
    • PPP
    • HDLC
    • ATM
    • Ethernet

Label Switch Router

  • A Label Switch Router (LSR) is a router that supports MPLS. It is capable of understanding MPLS labels and or receiving and transmitting a labeled packet on data link.
  • Three kinds of LSRs:
    • Ingress (edge) LSR – receives unlabeled packet from customers equipment. It inserts a label in front of the packet and send it on a data link.
    • Egress (edge) LSR – receives labeled packets, removes the labels, and send them onto the data link towards the customer’s equipment.
    • Intermediate LSR – receives labeled packets, perform an operation on them, switches the packet, and send the packet on the correct data link.
  • LSRs can do three types of operation:
    • Pop – removes labels.
    • Push – adds the label onto the received packet
    • Swap – the top label of the label stack is replaced with a new label and the packet is switched on the outgoing data link.
  • Imposing LSR – an LSR that pushes labels onto a packet that was not labeled yet. Done by the ingress LSR.
  • DisposingLSR – removes all labels form the packet. Done by the egress LSR.

Label Switched Path

  • It is the path through which a packet takes in the MPLS network (or part of it).
  • It is a sequence of LSRs that switch a labeled packet through an MPLS network.
  • The LSP is unidirectional. That means a path to go back requires a complete separate LSP.

Forwarding Equivalance Class

  • An FEC is a set of packets that a sintgle router forwards:
    • To the same next hop
    • Out the same interface
    • With the same forwarding treatment
  • All packets belonging to the same FEC have the same label.

Comparison

  • In a regular IP forwarding process, each time a packet reaches a router, a lookup is performed on the IP destination, the packet’s FEC (that is, the next-hop, outgoing interface, and forwarding treatment) is determined. Using the gathered information the packet is forwarded to the next router. When the packet arrives to that router, this whole process is repeated.
    • Essentially, the packet’s FEC is determined hop-by-hop at every router that it reaches on its way to the destination.
  • In an MPLS LSP, when a packet arrives at the first LSR, the FEC is determined once and is not repeated until that packet reaches the end of the LSP – the egress LSR. The intermediate LSRs  does not determine a new FEC, as compared to the regular IP forwarding process.

Label Distribution Protocol

  • For the label distribution in an MPLS LSP to work, each intermediate LSR needs to figure out which outgoing label the incoming label should be swapped.
  • LDP is the method of choice among the majority of MPLS vendors to distribute labels for IGP prefixes.
  • LDP is the mechanism that tells the routers which labels to use when forwarding a packet.
  • For every IGP IP prefix in an LSR’s IP routing table, a local binding is created. A label is binded to an IPv4 prefix. The LSR then distributes this binding to all its LDP neighbors. Once receved by other neighbors, these local bindings become remote bindings. These remote and local bindings are stored in a table called Label Information Base (LIB). The LIB contains all lables known to the LSR
  • LDP uses a Hello feature to discover LDP neighbors and to determine to what IP address the enusing TCP connection should be made.
    • Hellos use multicast address 224.0.0.2, using UDP port number 646 for LDP
    • The Hellos list each LSR’s LDP ID (LID), which consists of a 32-bit dotted-decimal number and a 2-byte label space number (this number has a value of 0 for frame-based MPLS).
  • After discovering neighbors via an LDP Hello message, LDP neighbors form a TCP connection to each neighbor, again using port 646 (for TDP, port 711 is used).
  • The unicast address used to form the TCP connections between neighbors must be reachable according to the IP routing table. These addresses can be either the neighbor’s advertised transport address or the address in the LID.
  • Cisco IOS chooses the IP address in the LPD ID in the following priority (similar to OSPF):
    • Manually configured address
    • Highest IP address of a loopback
    • Highest ID of a non-loopback interface

Label Forwarding Instance Base

  • While the LIB contains all labels know to the LSR, the LFIB (and the FIB) contains labels only for the currenlty used best LSP segment.
  • LFIB is the table used to forward labeled packets.
  • It is populated with the incoming label and outgoing labels for the LSPs
  • The incoming label is the label from the local binding ont the particular LSR.
  • The outgoing label is the label from the remote binding chosen by the LSR from all possible remote bindings.

In the following diagrams, observe how LDP advertises bindings betweent the LSRs for the IPv4 prefix 10.0.0.0/8 and how packet switching works when a packet destined to the 10.0.0.0/8 prefix enters the ingress LSR.

  • In the part of the illustration, each LSR allocates one label per IPv4 prefix. This prefix and its assocated label is the local binding
  • An LSR chooses the remote binding received from the downstread LSR, which is the next hop in the routing table for the 10.0.0.0 prefix. 
  • The label from the local bindings server as the incoming label and the label from the one remote binding chosen via the routing table serves as the outgoing label.
  • The bottom of the figure shows a packet entering the Ingress LSR destined to 10.0.0.0/8.
  • There, a label 129 is imposed on the packet and switched toward the next LSR. The second LSR swaps the incomgin label 129 with 17 and forwards to the next LSR. The incoming label 17 is again swapped with the outgoing  label 33.

If I’m inspired, the next post will focus more on the Data Plane and Control Plane of the MPLS forwarding process. And if I’m really brave, I’ll re-read and blog-note the section on MPLS VPN.

References

  1. Understanding MPLS Label Stacking – Jeff Doyle – NetworkWorld
  2. MPLS FAQ For Beginners
  3. Understanding the Role of FECs in MPLS – Jeff Doyle – NetworkWorld

This entry is not an authoritative guide. These are merely notes and rehash of the primary text materials and resources that I use. For a thorough guide of the MPLS concepts, consider purchasing MPLS Fundamentals byLuc De Ghein and the MPLS section of CCIE Routing and Switching Certification Guide (4th Edition) by Wendell Odom; as well as following the links on the reference section of this entry.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Route My World! is Digg proof thanks to caching by WP Super Cache