In Section 6 of RFC-4364, it is stated that, if MPLS is being used as the tunneling technology (in the scope of forwarding VPN-IPV4 traffic from one PE to an other) , this means that a router in the backbone MUST NOT accept a labeled packet from any adjacent non-backbone device unless the following two conditions hold :

  2. the backbone router can determine that use of that label will
     cause the packet to leave the backbone before any labels lower
     in the stack will be inspected, and before the IP header will
     be inspected.

I'm trying to understand how is the first P router inside the backbone, able to determine that a given label sent from a PE router will cause the packet to leave the backbone.

This also made me wonder about MPLS, say in the following configuration where it has been enabled between P1-P3 routers, each (L< number>) represents their inner label (IGRP) :

ingressPE (L0) <--> P1 (L1) <---> P2 (L2)<--> P3 (L3) <--> egressPE (L4)

When P1 receives a packet from ingressPE with label L4 on the top of the stack, i suppose it knows that the corresponding egressPE is the way out of the backbone, but then this L4 label will be replaced with L2 then with L3.

So how does P3 knows that it needs to send the packet to L4, with all the labels being switched, does it look up the information based on the IP ?

  • "When P1 receives a packet from ingressPE with label L4 on the top of the stack, i suppose it knows that the corresponding egressPE is not in the backbone, but then this L4 label will be replaced with L2 then with L3." Why do you think the egressPE is not part of the backbone? Certainly, the egressPE interface to P3 is in the backbone, even if the egressPE interface to the CE is not in the backbone.
    – Ron Maupin
    Commented Jan 1, 2021 at 19:18
  • You're definitely right, i've corrected that sentence ...
    – Segfault
    Commented Jan 1, 2021 at 20:35
  • 2
    The interesting thing about label switching is that switching is merely done by the label to the next hop without the backbone router knowing the final destination. If you have ever understood frame relay, where packets use DLCI frames and send that to the DLCI number, then the frame relay switch swaps out the DLCI number for a new DLCI number to the next DLCI switch, then you start to get the idea of how MPLS works. MPLS was modeled on frame relay, although it is not exactly the same.
    – Ron Maupin
    Commented Jan 1, 2021 at 20:45

1 Answer 1


The routers within the backbone use a label distribution protocol: LDP or RSVP. Each router binds a label to each IP prefix it knows about and advertises these labels to its LDP/RSVP peers. Let's say router egress PE advertised its BGP loopback address to P3 with a label of 20. P3 then advertises it to P2 with a label of 21, P2 advertises this network to P1 with a label of 22 and finally P1 advertises to ingress PE with a label of 23. After this process an LSP has been formed. Now when a packet arrives to ingress PE with a destination of BGP loopback address, ingress PE imposes the label of 23 and forwrads to P1 which swaps with label 22 and forwards to P2 that swaps with 21... finally the label arrives at egress PE which pops the label and does an IP lookup (unless PHP is used, in such case egress PE advertises label 0 which allows it to perform just an IP lookup).

  • 1
    Thank you for the crystal clear explanation, i finally understand what the Local tag means in the mpls forwarding-table, it's describing the in interface label. It's also worth mentioning that there seems to be no outgoing label for a point to point link considered as (implicit null), and shows as "Pop label" inside the forwarding table.
    – Segfault
    Commented Jan 2, 2021 at 13:48
  • @Segfault you are right, implicit null signals the PHP router to not use any label when sending traffic to PE. While explicit null will signal the use of the explicit label "0". Regarding local tag - this is called ILM. Which is a bit similar to an IP forwarding table just instead of using IP address as a search key an MPLS label is used.
    – manish ma
    Commented Jan 3, 2021 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.