Hi Reader today I am going to Explain you , How mpls works ?
Mpls is multiprotocol label switching is mostly found in service provider networks.
MPLS is a technology that is primarily see in the service provider, In service provider networks, the result of using MPLS is that only the routers on the edge of the MPLS domain perform routing lookup; all other routers forward packets based on labels.
MPLS is very useful in service provider (and large enterprise) networks bcoz it enhances
BGP routing and provides different services and applications, such as Layer 2 and 3 VPNs,
QoS, and TE ( Traffic engineering )
In an MPLS , there are two types of routers:
Label-switched router (LSR): A device that forwards packets that are mainly based on
Edge LSR: A device that mainly labels packets or forwards IP packets out of an MPLS
domain, it means it is going to be a part of mpls as well as traditional ip routing.
Lets see what is inside MPLS Label ?
1. 20-bit label The actual label used for switching. Values 0 to 15 are reserved.
2. 3-bit experimental (EXP) field Undefined in the RFC. Used by Cisco to define a class of service (CoS) (IP precedence).
3. Bottom-of-stack bit MPLS allows multiple labels to be inserted. The bottom-of-stack
bit determines if this label is the last label in the packet. If this bit is set (1), it indicates that this is the last label.
8-bit Time to Live (TTL) field Has the same purpose as the TTL field in the IP header.
In this snapshot you can see Router A receives the ip packet and adds the label ( PUSH ),
Router A is the Edge LSR – ( Label Switch Router ), Router A also looks for FIB ( Forwarding information base ) which works on Traditional IP , LFIB ( Label Forwarding information base ) is responsible for Labeling the packets.
Router B receives the labeled packet from Router A, and again router is going to check the LFIB and swaps the labeled packet with another label , you can see in above snapshot 25 label swapped to label 35. Router B is not edge LSR , This is the P router ( Provide Router ).
Now the labeled packet comes to router C , Now Router checks LFIB , A label is removed and the ip packet is sent out to interface .
Now Edge LSR receives the packet and this time it Checks FIB instead of LFIB, Because now we don’t have labels on our packets, and the packet sent to exit interface.