🌏MPLS Labels: PUSH, SWAP AND POP
✈️The primary purpose of MPLS is to create a BGP free core between the P routers (provider). It uses labels switching as tunnelling mechanism to route packets. Ultimately it’s does not use the control planes RIB(routing table) to route packets. Its uses labels as switching mechanisms, subsequently it’s very fast, compared routing which requires routing table look-ups.
🤷♂️Lately I’ve been fascinated by how, provider routers(P) performs switching.
🕵️The core P routers in MPLS network are also known as LSR(Label Switch Routers).
⁉️Why they known as label switch routers? well the name does justify its action as its primary role is to switch packets based on label or remove labels from them.
📌MPLS Labels have a lifecycle and there are specifically three actions that P(LSR) routers perform on labels
🏷️Label Push: on this stage the P router will add a MPLS header to the IP packet and as a result a value to the label field on the MPLS header it self. This is usually the ingress provider edge router.
🏷️Label Swap: On this stage the P router will remove the label value from the MPLS header field and replace with another value.
🏷️Label Pop: This phase is usually performed by the last P router(provider edge) in the MPLS network and its function is to completely remove the MPLS header label.
I have added a MPLS header diagram for better visualisation.
There are two types of LSR(label switching routers):
iLSR: This is the first PE routers which performs the label push action.
eLSR: This is the last PE router on the MPLS network which perform the POP action.
👀The diagram below should provide a visual representation of the process.
Here are some details and breakdown of the diagram.
- The CE-HQ(Customer Edge) router sends an IP packet. The customer edge does not have an idea what a MPLS header is, it’s simply sending an IP packet to CE-BR. This is a customer owned router.
- The PE1 (Provider Edge aka iLSR) this is the ISP networks routers. This is also where the first MPLS header is attached to the IP packet. This encapsulation of the IP packet with an MPLS header is called a label PUSH, it will add a value to the MPLS header’s label field.
- The first P1 router on the core will perform a label SWAP. The label is only significant locally to the P router.
- P2 will also perform a swap and switch it to the next P router
- P3 will perform another swap of the label field value.
- Now comes the interesting part P4(eLSR)will perform a label POP. Now we understand the 1st P router (P1) performed a swap, so why is the last P router (P4) performing POP? This known as “penultimate hop popping”. The reason behind this process is to save the recipient Provider Edge (PE 2) from looking at the MPLS label field hence speeding up the process.
- PE2 will receive the IP packet without the MPLS header
- The CE-BR(Customer Edge)will receive the IP packet.






Leave a comment