MPLS protocol uses a different mechanism to forward packets. Packets are sent based on MPLS lable instead of the conventional packet’s destination IP address. It add the ability to make forwarding decisions based on other factors beside the IP address, such as traffic engineering, QoS, and privecy requirements.
MPLS uses unicast IP forwarding, where forwarding logic works based on the labels. These labels are chosen based on the routes in the unicast IP routing table. Hence, they follow the same path as the normal IP packets without making any advantages over IP routing. It is when used with with the different applications of MPLS it shines over IP routing. Specially when used as MPLS VPN or MPLS traffic engineering, as they use MPLS as the principle protocol and add various advantages to it.
For MPLS to work, it requires the use of control plans, any routing protocol and LDP (or TDP) to learn the routes, learn the labels, and to correlate these labels to particular prefixes.
MPLS is transparent to the end users, they never send or receive labeled packets. The routers will add labels, and another router will remove the label. Injecting labels called (push), while removing labels called (pop) this will be helpful when reading the Label Forwarding Information Base (LFIB) table. LFIB is the table used by Cisco routers to know what action should be done to the labeled packets.
To see an simplified example how MPLS works, refer to the figure below.
1-Host A send a packet to host B
2-R1 is not configured with MPLS, hence the packet is forwarded based on the destination IP address.
3-R2 recieves the packet, and check the LFIB table. It decides to push a new label of value 10 into the packet and send it out the respective interface.
4-R3 checks the LFIB table, and swap the older label with a newer one. From 10 to 33, and forwards the packet.
5-R4 checks the LFIB table, the label is poped and packet is forwarded.
6-R5 forwards the packet as normal IP packet based on the destination IP address.
This is as simple as MPLS unicast IP forwarding works, to understand how the various protocols works, referring to LDP, LFIB will suffice.