Enhance your Career in Networking With IPinBits!!!​



  • MPLS is multiprotocol label switching, which is between L2 and L3 Header also known as L2.5 protocol.
  • We will have more detail articles on how mpls works, this article is more related to the MPLS Label.
  • Basic in short, MPLS uses Push, Swap, POP mechanism for the labels.
  • Labels are generated by each and every router for each and every entry in the FIB table.
  • Basically router’s this day maintains 4 tables


  • RIB: Present in control plane, has routing information.
  • FIB: It’s derived from RIB and is actually used for forwarding packets in the Data plane.
  • LIB: has all the labels for all the prefix in RIB. 
  • LFIB : Has the Best label for particular prefix ( derived from FIB and LFIB)

The below diagram has the basic functioning of how mpls works,

  • R-1, R-4 are called Provider Edge ( Edge LSR) .
  • R-2, R-3 are called Provider (LSR)
  • R1, R2 are CE customer Edge routers.

Lets look at the MPLS label, more on Mpls working in L3 VPN article, lets concentrate on MPLS label.

MPLS label is a 32 bit label as you see in the below packet capture it lies exactly between L2 and L3.

Lets see all the fields inside:

  • Label : It’s a 20 bit value, 2^20, 0-15 bits are Reserved, 16-20 are usable.
    • 0: is for explicit null ( will have that in another article about PHP).
    • 3: is for implicit null (more in PHP article).
  • Experimental : 3bits are there for EXP, used for COS inside the MPLS cloud, basically, MPLS converts the QOS bits received on its PE (Egress router) and applies it own Experimental bits inside the cloud.
  • Stack: it is 1 bit value which indicates end of stack, i.e. if we have more than one label.
    • For L3 VPN we do use two labels, Transport and VPN, here you will see this bit in action.
    • If this bit is 1 : it means end of stack no more MPLS headers/labels.
    • If this bit is 0 : it means one or more labels to follow ( For e.g. L3 VPN)
  • TTL : Time to live counter. Which gets decremented by one as it crosses each hop.

This is it about MPLS label, the following articles will have MPLS fundamentals, MPLS L3 VPNS along with PHP.

Related blog posts