Multi Protocol Label Switching (MPLS) is an IP packet routing technique that routes IP packet through paths via labels instead of looking at complex routing tables of routers. This feature helps in increasing the delivery rate of IP packets.
MPLS uses layer 3 service i.e, Internet Protocol, and uses router as forwarding device. The traffic of different customers is separated from each other because MPLS works somewhat like VPN. It does not work like regular VPN that encrypts the data but it ensures packet from one customer cannot be received by another customer. An MPLS header is added to packet that lies between layers 2 and 3. Hence, it is also considers to be Layer 2.5 protocol.
MPLS Header –
The MPLS Header is 32 bit long and is divided into four parts –
- Label – This field is 20 bit long and can take value b/w 0 & 220 – 1.
- Exp – They are 3 bits long and used for Quality of Service(QoS).
- Bottom of stack (S) – It is of size 1 bit. MPLS labels are stacked one over other. If there is only one label remained in MPLS header, then its value is 1 otherwise 0.
- Time to Live (TTL) – It is 8 bit long and its value is decreased by one at each hop to prevent packet to get stuck in network.
Important terms used in MPLS :
|Provider Edge(PE) Router||Router at edge of MPLS network that add or remove label from IP packet.|
|Customer Edge(CE) Router||Router at edge of customer network that send or receive IP packet from PE.|
|Label Switch Router(LSR)||Routers used in MPLS network that can understand labels.|
|Ingress LSR||LSR routers that receive IP packet from CE Routers and add MPLS header.|
|Intermediate LSR||LSR routers that swap label in MPLS header and assigned for forwarding labeled IP packet.|
|Egress LSR||LSR routers that send IP packet to CE routers and removes MPLS header.|
|Push, Pop and Swap||Action of addition, removal and swapping of labels by LSR respectively.|
Forwarding in MPLS :
LSRs receive IP packet CE and add an MPLS header in between layer 3 and layer 2 means it encapsulates the link-layer i.e, layer 2 frames. This feature allows LSRs to support receiving packets containing frames from different protocols like Frame Relay, Metro Ethernet, etc, that’s why it is called multi-protocol.
MPLS forwarding is based on label attached to IP packet. This label attachment is regulated by protocol called Label Distribution Protocol(LDP). Each LSR initially learns routes as normal routers do. This learning starts with PE routers. Each PE router learns routes to different subnets from CE router. Suppose PE router PE1 learns route to subnet (say subnet1) from CE router. Now PE1 will add label to packet, forward to its neighboring LSR, and tells them that if you receive packet which destination address to subnet1 then forward it to me.
Again this process is repeated by this LSR. In this way, LSR learns routes and add this information in Label Forwarding Information Base(LFIB). Now if any PE receives packet with destination to subnet1, then looking at labels and LFIB, LSRs can easily forward IP packet.