Multiprotocol Label Switching “MPLS” is a standard protocol with “RFC 3031”.
Firstly, We will discuss together the meaning of the name …
- Multiprotocol : Transport different payloads whether L2 “FR, Ethernet, ATM, PPP & HDLC” or L3 “IPv4 or IPv6”.
- Label Switching : It’s about to switch the traffic between interfaces based on a significant label values.
The general idea behind the MPLS isn’t looking at the payload while forwarding the traffic to find the destination IP, just enough to look at the mpls encapsulation to able to switch the traffic based on the assigned label value.Why use MPLS?
- ISP no longer have the requirement to run BGP in its core “BGP Free Core”.
- Offer L2/L3 VPN Services to customers.
- Improve the user experience by implements QOS mechanism that enables the creation of LSPs with guaranteed bandwidth.
- Control network utilization using the traffic engineering mechanisms which enables one to control traffic routing via constraint-based routing.
- Support the high stability rates for the network by using the traffic engineering fast reroute (FRR) features which about detect and repair the failures quickly.
- LSR : Label Switch Router, is a router that forwards packets based on labels.
- Edge-LSR : Router that receives an unlabeled packet and inserts one or more labels before the IP header.
- Ingress E-LSR : Router that receives an unlabeled packet and inserts one or more labels before the IP header.
- Egress E-LSR : Router that receives a labeled packet, removes all the labels and forwards it unlabeled.
- Label : A 4-byte identifier used by MPLS to make forwarding decisions.
- FEC : A group of packets forwarded in the same manner, over the same path.
- LSP : Label Switch Path, a series of LSRs that forward labeled packets to their destinations based on the FEC.
- PHP : Penultimate-Hop-Popping is the act of popping/removing a label one hop before the Egress LSR/PE router.
- LDP : Standard protocol which responsible on distributing the bindings for non-BGP routes in the routing table.
While LSR receives an IP packet, it will insert a 4-identifier label which consists of :
- 20-bit label value
- 3-bit EXP “class of service”.
- 1-bit S “which defines last label in case of the label stack”.
- 8-bit TTL
How MPLS works ? “Label Switching mechanism”
- The Ingress E-LSR receives a pure ip packet and pushes a label onto it.
- A transit LSR receives the labeled packet, swaps the label, and forwards the packet to the next LSR.
- The egress E-LSR receives labeled packet, pops label, and forwards IP packet.
When a packet arrives on an MPLS-enabled interface, the Ingress E-LSR determines to which Forwarding Equivalence Class (FEC) the packet belongs; When a packet belongs to a FEC, and an LSP is mapped to that FEC, the packet is assigned to the LSP and forwarded to the next hop after push the assigned label to it.When a transit LSR receives an MPLS packet, it looks up the label in its MPLS forwarding table. This table maps the label and inbound interface to a new label and outbound interface.When the packet reaches the egress E-LSR , the MPLS label is removed “pop”, and the packet can then be forwarded to its destination using standard routing protocols.
What the types of tables used by MPLS ?
- Routing Information Base “RIB”
- That’s the IP routing table which seen by “show ip route”
- Table Structure is “PROTOCOL, PREFIX, NEXT-HOP”.
- Label Information Base “LIB”
- A label exchange protocol stores local and received label bindings in the LIB table.
- The label exchange protocols are LDP, TDP, MP-BGP and RSVP.
- LDP/TDP labels are ONLY assigned to non-BGP routes in the RIB table.
- MP-BGP is used to dis tribute the label bindings for BGP routes in the RIB.
- A label exchange protocols stores local and received label bindings in the LIB table and it seen by “show mpls ip bindings”.
- The LIB table structure is : PREFIX, LSR/LOCAL, LABEL.
- Forwarding Information Base “FIB”
- A CEF built table sourced from the information in the RIB table and then used to forward incoming IP packets.
- It seen by “show ip cef detail” with structure : PREFIX, NEXT-HOP, LABEL.
- Label Forwarding Information Base “LFIB”
- LFIB is build by CEF and it only stores the labels used to forward packets , unlike the LIB table that stores all label bindings.
- It seen by “show mpls forwarding table” with structure : INLABEL, OUTLABEL, NEXT-HOP.
To forward the traffic on a mpls enabled router, the decision be took depending only on the LFIB table based on the assigned label.Penultimate-Hop-Popping (PHP) Technique (implicit & explicit)While the labeled packet transmits through MPLS enabled network the LSR perform one of the three actions “push, swap & pop”, the last LSR “Egress LSR” at LSP performs two different lookup the first one is MPLS label lookup and the other is regarding normal ipv4/ipv6 routing lookup in order to send traffic to customer.PHP is about the last LSR before egress LSR will do the pop operation and egress LSR will receive a pure IP packet & to talk with more deeply at this point we will should clarify below points:
- By Default each Edge-LSR advertises a implicit null label (3) for its directly connected & summarized prefixes to all neighboring LSRs.
- Any LSR will receive a binding with an implicit null label will pop the top label before forwarding packets to that E-LSR.
- Although implicit null label optimizes lookups but it also removes the EXP bits in those labels that might be needed in end-to-end QOS proceess.
- To overcome previous issue, we will use the explicit null label (0 or 2) as the E-LSR advertises a explicit null label instead of implicit which enable the LSR to swap the top label value with 0 or 2 and packet which received by E-LSR will have its label with intact EXP bits.
By: Hatem Farag | CCIE#54446