10 Replies Latest reply: Sep 19, 2018 1:27 PM by Vikram Sisodia RSS

    MPLS Overview

    Hatem Farag - CCIE R&S# 54446 ,CCNP-SP, CCNA Security

      Multiprotocol Label Switching “MPLS” is a standard protocol with “RFC 3031”.

      Firstly, We will discuss together the meaning of the name …

      • Multiprotocol  : Transport different payloads whether L2 “FR, Ethernet, ATM, PPP & HDLC” or L3 “IPv4 or IPv6”.
      • Label Switching : It’s about to switch the traffic between interfaces based on a significant label values.

       

      The general idea behind the MPLS isn’t looking at the payload while forwarding the traffic to find the destination IP, just enough to look at the mpls encapsulation to able to switch the traffic based on the assigned label value.Why use MPLS?

      • ISP no longer have the requirement to run BGP in its core “BGP Free Core”.
      • Offer L2/L3 VPN Services to customers.
      • Improve the user experience by  implements QOS mechanism that enables the creation of LSPs with guaranteed bandwidth.
      • Control network utilization using the traffic engineering mechanisms which enables one to control traffic routing via constraint-based routing.
      • Support the high stability rates for the network by using the traffic engineering fast reroute (FRR) features which about detect and repair the failures quickly.

      MPLS Terminology


      • LSR : Label Switch Router, is a router that forwards packets based on labels.
      • Edge-LSR : Router that receives an unlabeled packet and inserts one or more labels before the IP header.
      • Ingress E-LSR : Router that receives an unlabeled packet and inserts one or more labels before the IP header.
      • Egress E-LSR : Router that receives a labeled packet, removes all the labels and forwards it unlabeled.
      • Label : A 4-byte identifier used by MPLS to make forwarding decisions.
      • FEC : A group of packets forwarded in the same manner, over the same path.
      • LSP : Label Switch Path, a series of LSRs that forward labeled packets to their destinations based on the FEC.
      • PHP : Penultimate-Hop-Popping is the act of popping/removing a label one hop before the Egress LSR/PE router.
      • LDP : Standard protocol which responsible on distributing the bindings for non-BGP routes in the routing table.

      MPLS Label


      While LSR receives an IP packet, it will insert a 4-identifier label which consists of :


      • 20-bit label value
      • 3-bit EXP “class of service”.
      • 1-bit S “which defines last label in case of the label stack”.
      • 8-bit TTL

      label

      How MPLS works ? “Label Switching mechanism”

      1. The Ingress E-LSR receives a pure ip packet and pushes a label onto it.
      2. A transit LSR receives the labeled packet, swaps the label, and forwards the packet to the next LSR.
      3. The egress E-LSR receives labeled packet, pops label, and forwards IP packet.

      When a packet arrives on an MPLS-enabled interface, the Ingress E-LSR determines to which Forwarding Equivalence Class (FEC) the packet belongs; When a packet belongs to a FEC, and an LSP is mapped to that FEC, the packet is assigned to the LSP and forwarded to the next hop after push the assigned label to it.When a transit LSR receives an MPLS packet, it looks up the label in its MPLS forwarding table. This table maps the label and inbound interface to a new label and outbound interface.When the packet reaches the egress E-LSR , the MPLS label is removed “pop”, and the packet can then be forwarded to its destination using standard routing protocols.


      What the types of tables used by MPLS ?

       

      • Routing Information Base “RIB”
        • That’s the IP routing table which seen by “show ip route”
        • Table Structure is “PROTOCOL, PREFIX, NEXT-HOP”.
      • Label Information Base “LIB”
        • A label exchange protocol stores local and received label bindings in the LIB table.
        • The label exchange protocols are LDP, TDP, MP-BGP and RSVP.
        • LDP/TDP labels are ONLY assigned to non-BGP routes in the RIB table.
        • MP-BGP is used to dis tribute the label bindings for BGP routes in the RIB.
        • A label exchange protocols stores local and received label bindings in the LIB table and it seen by “show mpls ip bindings”.
        • The LIB table structure is : PREFIX, LSR/LOCAL, LABEL.
      • Forwarding Information Base “FIB”
        • A CEF built table sourced from the information in the RIB table and then used to forward incoming IP packets.
        • It seen by “show ip cef detail” with structure : PREFIX, NEXT-HOP, LABEL.
      • Label Forwarding Information Base “LFIB”
        • LFIB is build by CEF and it only stores the labels used to forward packets , unlike the LIB table that stores all label bindings.
        • It seen by “show mpls forwarding table” with structure : INLABEL, OUTLABEL, NEXT-HOP.


      To forward the traffic on a mpls enabled router, the decision be took depending only on the LFIB table based on the assigned label.Penultimate-Hop-Popping (PHP) Technique (implicit & explicit)While the labeled packet transmits through MPLS enabled network the LSR perform one of the three actions “push, swap & pop”, the last LSR “Egress LSR” at LSP performs two different lookup the first one is MPLS label lookup and the other is regarding normal ipv4/ipv6 routing lookup in order to send traffic to customer.PHP is about the last LSR before egress LSR will do the pop operation and egress LSR will receive a pure IP packet & to talk with more deeply at this point we will should clarify below points:


      1. By Default each Edge-LSR advertises a implicit null label (3) for its directly connected & summarized prefixes to all neighboring LSRs.
      2. Any LSR will receive  a binding with an implicit null label will pop the top label before forwarding packets to that E-LSR.
      3. Although implicit null label  optimizes lookups but it also removes the EXP bits in those labels that might be needed in end-to-end QOS proceess.
      4. To overcome previous issue, we will use the explicit null label (0 or 2) as the E-LSR advertises a explicit null label instead of implicit which enable the LSR to swap the top label value with 0 or 2 and packet which received by E-LSR will have its label with intact EXP bits.
      By: Hatem Farag | CCIE#54446
        • 1. Re: MPLS Overview
          Nazmus

          Nice article. Thank you for your contribution. My question is which plane the routing table reside. Is it control plane or data plane ? What is the logic behind the answer ?

          • 2. Re: MPLS Overview
            Pablo

            Thanks for this overview, very helpful!

             

            I currently have the topology in the image below, the end IPs 192.168.0.0/24 and 10.0.0.0/24 are networks in loopback interfaces, I find interesting that in the IOS-XR device in the very middle my output of "sh mpls forwarding" is:

             

            RP/0/0/CPU0:ios#sh mpls forwarding

            Tue Nov  7 15:56:51.229 UTC

            Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes

            Label  Label       or ID              Interface                    Switched

            ------ ----------- ------------------ ------------ --------------- ------------

            24000  Unlabelled  192.168.0.1/32     Gi0/0/0/0    3.3.3.1         0

            24001  Unlabelled  2.2.2.0/30         Gi0/0/0/0    3.3.3.1         0

            24002  Unlabelled  1.1.1.0/30         Gi0/0/0/0    3.3.3.1         0

            24003  Unlabelled  5.5.5.0/30         Gi0/0/0/1    4.4.4.2         0

            24004  Unlabelled  6.6.6.0/30         Gi0/0/0/1    4.4.4.2         0

            24005  Unlabelled  10.0.0.1/32        Gi0/0/0/1    4.4.4.2         0

             

            R3's and R4's interfaces facing the IOS-XR router have mpls enabled, shouldn't I be seeing numbered labels in the "outgoing label" field instead of "unlabelled"?

             

             

             

            .Topology.jpeg.jpg

            • 3. Re: MPLS Overview
              Liz Cacic

              Hi Pablo,

               

              This output tells me that the XRV1-1 is not learning any MPLS label from it neighbors.

              Can you check if the MPLS LDP neighborship is establish using the following commands?

              sh mpls ldp discovery

              sh mpls ldp neighbor


              Regards,

              Liz

              • 4. Re: MPLS Overview
                Pablo

                Seems like I'm not forming neighbors. MPLS is enabled in the interfaces and I am able to ping from XRV to R3-R4, Maybe there's something I'm missing, I'll review the IOS-XR fundamentals book.

                 

                RP/0/0/CPU0:ios#sh mpls ldp discovery

                Wed Nov  8 07:29:29.043 UTC

                 

                Local LDP Identifier: 0.0.0.0:0

                Discovery Sources:

                 

                RP/0/0/CPU0:ios#sh mpls ldp neighbor

                Wed Nov  8 07:29:36.453 UTC

                 

                RP/0/0/CPU0:ios#sh run | b int

                Wed Nov  8 07:31:23.325 UTC

                Building configuration...

                !

                interface GigabitEthernet0/0/0/0

                ipv4 address 3.3.3.2 255.255.255.252

                !

                interface GigabitEthernet0/0/0/1

                ipv4 address 4.4.4.1 255.255.255.252

                !

                router ospf 1

                area 0

                  interface GigabitEthernet0/0/0/0

                  !

                  interface GigabitEthernet0/0/0/1

                !

                mpls ldp

                interface GigabitEthernet0/0/0/0

                !

                interface GigabitEthernet0/0/0/1

                 

                ***********************************************

                R4#sh run | b int

                interface FastEthernet0/0

                ip address 4.4.4.2 255.255.255.252

                duplex auto

                speed auto

                mpls ip

                !

                interface FastEthernet0/1

                ip address 5.5.5.1 255.255.255.252

                duplex auto

                speed auto

                mpls ip

                 

                ***********************************************

                R3#sh run | b int

                interface FastEthernet0/0

                ip address 3.3.3.1 255.255.255.252

                duplex auto

                speed auto

                mpls ip

                !

                interface FastEthernet0/1

                ip address 2.2.2.2 255.255.255.252

                duplex auto

                speed auto

                mpls ip

                 

                ***********************************************

                R4(config-if)#do sh mpls for

                Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

                tag    tag or VC   or Tunnel Id      switched   interface

                16     Untagged    3.3.3.0/30        0          Fa0/0      4.4.4.1

                17     Untagged    2.2.2.0/30        0          Fa0/0      4.4.4.1

                18     Untagged    1.1.1.0/30        0          Fa0/0      4.4.4.1

                19     Pop tag     6.6.6.0/30        0          Fa0/1      5.5.5.2

                20     Untagged    192.168.0.1/32    0          Fa0/0      4.4.4.1

                21     21          10.0.0.1/32       0          Fa0/1      5.5.5.2

                 

                ***********************************************

                R3#sho mpls for

                Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

                tag    tag or VC   or Tunnel Id      switched   interface

                16     Untagged    4.4.4.0/30        0          Fa0/0      3.3.3.2

                17     Untagged    5.5.5.0/30        0          Fa0/0      3.3.3.2

                18     Pop tag     1.1.1.0/30        0          Fa0/1      2.2.2.1

                19     Untagged    6.6.6.0/30        0          Fa0/0      3.3.3.2

                20     20          192.168.0.1/32    0          Fa0/1      2.2.2.1

                21     Untagged    10.0.0.1/32       0          Fa0/0      3.3.3.2

                 

                ***********************************************

                 

                R4#sh mpls ldp neighbor

                    Peer LDP Ident: 6.6.6.1:0; Local LDP Ident 5.5.5.1:0

                        TCP connection: 6.6.6.1.59123 - 5.5.5.1.646

                        State: Oper; Msgs sent/rcvd: 23/24; Downstream

                        Up time: 00:11:23

                        LDP discovery sources:

                          FastEthernet0/1, Src IP addr: 5.5.5.2

                        Addresses bound to peer LDP Ident:

                          6.6.6.1         5.5.5.2

                R4#

                 

                ***********************************************

                 

                R3#sh mpls ldp neighbor

                    Peer LDP Ident: 2.2.2.1:0; Local LDP Ident 3.3.3.1:0

                        TCP connection: 2.2.2.1.646 - 3.3.3.1.29885

                        State: Oper; Msgs sent/rcvd: 24/24; Downstream

                        Up time: 00:11:18

                        LDP discovery sources:

                          FastEthernet0/1, Src IP addr: 2.2.2.1

                        Addresses bound to peer LDP Ident:

                          1.1.1.2         2.2.2.1

                R3#

                • 5. Re: MPLS Overview
                  Liz Cacic

                  Hi Pablo,

                   

                  From the XR output, you can see that LDP-id is 0.0.0.0.

                   

                  You need to either setup up manually a MPLS LDP id using one of the physical interface or create a loopback interface.

                  If you decide to create a loopback interface, ensure that the ip-address is advertise via IGP.

                   

                  Regards,

                  Liz

                  • 6. Re: MPLS Overview
                    Pablo

                    Hi Liz, I read this the IOS-XR fundamentals:

                    1.JPG

                     

                    However I was setting a router ID with a random IP such as 7.7.7.7 and was not forming a neighbor either, after I set it up with the same IP number of one of the interfaces as you suggested, it worked, woohoo !! see my outputs now:

                     

                    RP/0/0/CPU0:ios#sh mpls forwarding

                    Wed Nov  8 14:43:46.886 UTC

                    Local  Outgoing    Prefix             Outgoing     Next Hop        Bytes

                    Label  Label       or ID              Interface                    Switched

                    ------ ----------- ------------------ ------------ --------------- ------------

                    24000  Pop         2.2.2.0/30         Gi0/0/0/0    3.3.3.1         0

                    24001  Pop         5.5.5.0/30         Gi0/0/0/1    4.4.4.2         0

                    24002  19          192.168.0.1/32     Gi0/0/0/0    3.3.3.1         0

                    24003  17          1.1.1.0/30         Gi0/0/0/0    3.3.3.1         0

                    24004  20          6.6.6.0/30         Gi0/0/0/1    4.4.4.2         0

                    24005  21          10.0.0.1/32        Gi0/0/0/1    4.4.4.2         0

                     

                    ********************************************************

                     

                    RP/0/0/CPU0:ios#sh mpls ldp discovery

                    Wed Nov  8 14:47:57.748 UTC

                     

                    Local LDP Identifier: 3.3.3.2:0

                    Discovery Sources:

                      Interfaces:

                        GigabitEthernet0/0/0/0 : xmit/recv

                          VRF: 'default' (0x60000000)

                          LDP Id: 3.3.3.1:0, Transport address: 3.3.3.1

                              Hold time: 15 sec (local:15 sec, peer:15 sec)

                              Established: Nov  8 14:43:25.927 (00:04:32 ago)

                     

                        GigabitEthernet0/0/0/1 : xmit/recv

                          VRF: 'default' (0x60000000)

                          LDP Id: 5.5.5.1:0, Transport address: 5.5.5.1

                              Hold time: 15 sec (local:15 sec, peer:15 sec)

                              Established: Nov  8 14:43:24.067 (00:04:34 ago)

                     

                    ********************************************************

                     

                    R4#sh mpls for

                    Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

                    tag    tag or VC   or Tunnel Id      switched   interface

                    16     Pop tag     3.3.3.0/30        0          Fa0/0      4.4.4.1

                    17     24000       2.2.2.0/30        0          Fa0/0      4.4.4.1

                    18     24003       1.1.1.0/30        0          Fa0/0      4.4.4.1

                    19     24002       192.168.0.1/32    0          Fa0/0      4.4.4.1

                    20     Pop tag     6.6.6.0/30        0          Fa0/1      5.5.5.2

                    21     21          10.0.0.1/32       0          Fa0/1      5.5.5.2

                     

                    ********************************************************

                     

                    R3#sh mpls forwarding-table

                    Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop

                    tag    tag or VC   or Tunnel Id      switched   interface

                    16     Pop tag     4.4.4.0/30        0          Fa0/0      3.3.3.2

                    17     Pop tag     1.1.1.0/30        0          Fa0/1      2.2.2.1

                    18     24001       5.5.5.0/30        0          Fa0/0      3.3.3.2

                    19     16          192.168.0.1/32    0          Fa0/1      2.2.2.1

                    20     24004       6.6.6.0/30        0          Fa0/0      3.3.3.2

                    21     24005       10.0.0.1/32       0          Fa0/0      3.3.3.2

                     

                    ********************************************************

                     

                    Thank you very much for your help !!!

                    • 7. Re: MPLS Overview
                      Liz Cacic

                      Hi Pablo,

                       

                      For LDP, the LDP-ID must be reachable, because the TCP session is formed by using the LDP-ID.

                      This is the reason why when you setup an random ID, it didn't work, because the ip-address wasn't reachable by the neighbors, so the TCP session couldn't be establish.

                       

                      We learn a lot doing the lab. Keep practicing.

                       

                      All the best,

                       

                      Liz

                      • 8. Re: MPLS Overview
                        Pablo

                        Thanks Liz, I understand now!

                         

                        So what is the best practice for real life scenarios? Is it advisable to set the router ID with a loopback address that is also advertised out through IGP?

                        • 9. Re: MPLS Overview
                          Liz Cacic

                          Hi Pablo,

                           

                          You are correct, the best practice is to always setup a router ID, and ensure that the IP address used for this router ID is from a Loopback interface and also it is advertised via an IGP.

                           

                          Regards,

                          Liz

                          • 10. Re: MPLS Overview
                            Vikram Sisodia

                            RIB/LIB(Routing table or MPLS label bindings) is always maintained in Control plane while FIB/LFIB are maintained in Data plane.