3 Replies Latest reply: Oct 6, 2015 8:04 PM by manoj RSS

    MPLS label stack in different scenarios


      Hi guys,one of my friend attended a interview in a  company, where he has been asked some specific questions about mpls label stacks,
      myself also working in a SP environment,but i don;t have deep knowledge about mpls label stacks in different scenarios.

      here are the questions i just wanted to know the answers for

      1) how many labels can a mpls packet can hold ?

      2) In L2/L3 VPN environments which label comes first and last in label stack?
      (i.e )vpn label or ldp label ?

      3)is it possible to swap these labels in the label stack ?
      i.e is it possible to influence the order of these labels in the label stack.

      4) Assume there are 2 "P" routers running ldp/ospf between THEM
      they have A-------->B
      loopback address of A is B is physical interface ip
      address is on A on B .

      when A is creating LDP session with B what is the source and destination IP address used in the Ldp SESSION ?

      5)This question is mine

      Common label stacks


      VC label + LDP label


      VC label + LDP label


      TE label + VC label

      TE label + LDP label + VC label


      FRR label + TE label + VC label

      FRR label + TE label + LDP label + VC label

      5)AToM & TE/FRR & CsC
      FRR label + TE label + LDP label + VPN label + VC label

      Is the order of type of labels in the mpls stack correct in the above mentioned scenarios?

        • 1. Re: MPLS label stack in different scenarios
          Mark Holm - 3xCCIE #34763/CCDE #2016::20

          Hi Manoj,


          That's a lot of questions, so we'll take it from the beginning.


          1) There's actually no limit to the amount of labels you can put on a single packet. Typically you'll be limited by the MTU along the path, as each label adds 4 bytes to the total packet size. In my own "crazy" labs, I've tried to accumulate a huge label stack just for the fun of it - when I reached six labels, I decided to stop.


          2) MPLS labels are pushed to the front of the packet, so the bottom label will be the VPN label (learned via MP-BGP VPNv4 address-family), while the topmost label will be the IGP/LDP label to the egress PE router.


          3) Changing the order of the label stack is not something you'd want to do. It will break things. Most switches and routers perform label operations on the topmost label only by default, so if you for some reason had the VPN label as the topmost label, traffic would be switched to a wrong destination or simply dropped if there was no entry for that label value in the LFIB.


          4) The source and destination addresses of the LDP session will be whatever the LDP router-id is configured to be. LDP performs neighbor discovery and thereby learns the router-id of its connected neighbors. LDP will use this address as the destination address when setting up the LDP session to that neighbor. Typically you use a loopback address for this purpose, and even more often you want to specify which interface to use to make sure it doesn't change all of a sudden.



          Scenario 1: The order of the labels is swapped, if you have written the labels in the order they are added to the packet. Consider this simple example:


          3003 is the VPN label and 2001 is LDP label. 3003 will have the bottom-of-stack bit set to indicate it is the last label.


          Scenario 2: Same as scenario 1.


          Scenario 3: Here I'm assuming that you are running a L2VPN or L3VPN service. If you are running strictly MPLS-TE without any LDP involved, the label order from top-to-bottom will be just as you've written: First TE label, then VPN label - identical to scenario 1 and 2. For the LDP label part, I'm not sure in which cases you'd actually have a LDP label when forwarding traffic down a TE tunnel. The small lab I've setup for this doesn't add a LDP label, even if I enable MPLS on the TE-tunnel itself.


          Scenario 3 would require additional lab to completely determine if LDP will be added at all. I need some time to setup scenario 4 and 5 to verify if the label order is correct. As it's getting late here, I'll continue setting up the lab over the next days.



          • 2. Re: MPLS label stack in different scenarios
            Elvin Arias

            Great answers!



            • 3. Re: MPLS label stack in different scenarios

              Thanks @markholm,Thanks for those answers,actually a blog post inspired me to ask  this question,sorry for asking a lot of questions tough,it was just in my head ,kindly provide update about the order of type of labels in the label stack whenever possible,Thanks again for the nice explanation.