I’m still excited as I’m writing this post about MPLS…Initially, the topics of MPLS is quite intimidating and seems quite difficult to understand…But with the aid of right tools, e.g. wireshark and RFC’s…learning should be fun….

On this post, I’m going into the details of the MPLS Labels… RFC 3032 provides a complete details of MPLS …MPLS labels has 4 components as shown below,



  

  Generally, we have to take note that MPLS labels have 4 components …

 1.  Label Value – This 20-bit field carries the actual value of the Label. 

 2. Experimental – Which is a 3 bit field that is used for QoS…

 3.  Bottom of Stack (S)– this is used to informed if additional MPLS header is in the    
      queue. If the value of this is set to 1, this will be the final MPLS header but when this is 
     set 0, their is another MPLS header in stack..

 4.  TTL – This is similar to any TTL value which decrements by 1 everytime it passes a layer 

     3 devices.

To explore the MPLS labels, I will be using just a simple connections and will be using wireshark to capture the traffic…Below is my topology…

So here is my LDP configurations on both R1 and R2:

R1(config)#int s2/0
R1(config-if)#ip add 172.16.12.1 255.255.255.0
R1(config-if)#no shut

R1(config-if)#mpls ip
 

R2(config)#int s2/0
R2(config-if)#ip add 172.16.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#mpls ip


The moment that I have enabled LDP on both routers, LDP neighbors were formed as shown below,

R1(config-if)#
*Oct 18 12:16:28.919: %LDP-5-NBRCHG: LDP Neighbor 172.16.12.2:0 (1) is UP

R1(config-if)#


R2(config-if)#
*Oct 18 12:16:28.711: %LDP-5-NBRCHG: LDP Neighbor 172.16.12.1:0 (1) is UP

We can quickly checked this as well with the command ” show mpls ldp neighbor” :

R1#show mpls ldp neighbor
    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0
        TCP connection: 2.2.2.2.37014 – 1.1.1.1.646
        State: Oper; Msgs sent/rcvd: 21/20; Downstream
        Up time: 00:13:18
        LDP discovery sources:
          Serial2/0, Src IP addr: 172.16.12.2
        Addresses bound to peer LDP Ident:
          172.16.12.2     2.2.2.2
 

 Now, let’s capture the LDP sessions via wireshark…

 
**** As observed above, a Hello Message is exchange between R1 and R2

 
Taking a look at the IP Header, it shows that the Destination address is a multicast address 224.0.0.2 with Source and Destination Port set to 646…



Now, let’s take a look on the LDP protocol…



 

IMPORTANT:

1.  We can see the important fields such as the LSR ID which is the Router ID…This should be the 
    highest loopback interface address on the router..

2. We can also see the Transport Address which is the same as the LSR ID and is used which is used 
    to established the TCP connection between the routers.

Now, let’s check the LDP neighbor status:

R1#show mpls ldp discovery
 Local LDP Identifier:
    1.1.1.1:0
    Discovery Sources:
    Interfaces:
        Serial2/0 (ldp): xmit/recv
            LDP Id: 2.2.2.2:0; no route  <<< It shows that there’s no route…

R2#show mpls ldp discovery
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial2/0 (ldp): xmit/recv
            LDP Id: 1.1.1.1:0; no route  <<< It shows that there’s no route..
 

 In this case, I still need to built the connectivity between loopbacks..I never set up static route or dynamic routes..In my example, I will prefer to used BGP to enable connectivity between the loopbacks..As I’m running IBGP, I’m setting up IGP using OSPF and peer the BGP with the loopback interface..Then to ensure connectivity, I have to advertise the loopbacks into BGP…

( Note: Even just configuring OSPF between this two routers will keep the LDP TCP connection works) … Just trying to simulate environment within the ISP setup with simple IBGP..

R1#sh run | sec ospf
router ospf 1
 network 1.1.1.1 0.0.0.0 area 0
 network 172.16.12.0 0.0.0.255 area 0


R1#sh run | sec bgp
router bgp 65000
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 2.2.2.2 remote-as 65000
 neighbor 2.2.2.2 update-source Loopback1
 neighbor 2.2.2.2 next-hop-self


R2#sh run | sec ospf
router ospf 1
 network 2.2.2.2 0.0.0.0 area 0
 network 172.16.12.0 0.0.0.255 area 0


R2#sh run | sec bgp
 router bgp 65000
 bgp log-neighbor-changes
 network 2.2.2.0 mask 255.255.255.0
 neighbor 1.1.1.1 remote-as 65000
 neighbor 1.1.1.1 update-source Loopback2
 neighbor 1.1.1.1 next-hop-self

Checking the status of both routers IGP and BGP…


R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/  –        00:00:39    172.16.12.2     Serial2/0

R1#show ip bgp summary
!
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4        65000       8       8        3    0    0 00:03:24        1
R1#

Now, going back and checking the LDP status discovery,

R1#show mpls ldp discovery
 Local LDP Identifier:
    1.1.1.1:0
    Discovery Sources:
    Interfaces:
        Serial2/0 (ldp): xmit/recv
            LDP Id: 2.2.2.2:0


R2#show mpls ldp discovery
 Local LDP Identifier:
    2.2.2.2:0
    Discovery Sources:
    Interfaces:
        Serial2/0 (ldp): xmit/recv
            LDP Id: 1.1.1.1:0
 

I should be able to see as well the LDP forwarding tables ( or the so called Label Forwarding Information Based – LFID)…

R1#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
16         No Label   2.2.2.2/32       0             Se2/0      point2point

IMPORTANT:

1. It should be notice that LFIB is analogous the the CEF Table which is stored on a part of router’s memory called the Forwarding Information Based (FIB)…

2. As we know the routing table of any dynamic or static routing protocols is stored on the Routing Information Based ( RIB)…With LDP, this is called LIB or Label Information Based…This is where all the Prefix or Tunnel ID’s have automatically generated with a Local Label which is keep in the LIB…It is important to note that all the prefix on the RIB have been automatically assigned a local Label by each routers which are stored in the LIB…

3. Another important thing to note is that both the RIB and LIB are part of the routers Control Plane while the FIB and the LFIB are part of the Data Plane… 

So what is Contol Plane and Data Plane?

Just imagine that Control Plane is responsible for building the routing table, gathering the ARP and MAC address entries while Data Plane is responsible for the actual forwarding of packets..

So in comparisons, here are the mappings of the important tables for Dynamic protocols and LDP:

BGP/OSPF              LDP

RIB                       LIB

FIB                        LFIB

RIB – Routing Information Based
FIB – Forwarding Information Based

LIB – Label Information Based
LFID – Label Forwarding Information Based

Now, let’s check the LIB of R1 using the command ” show mpls ldp bindings
 
R1#show mpls ldp bindings
  lib entry: 1.1.1.0/24, rev 2
        local binding:  label: imp-null
  lib entry: 1.1.1.1/32, rev 8
        remote binding: lsr: 2.2.2.2:0, label: 16
  lib entry: 2.2.2.0/24, rev 7
        remote binding: lsr: 2.2.2.2:0, label: imp-null
  lib entry: 2.2.2.2/32, rev 6
        local binding:  label: 16
  lib entry: 172.16.12.0/24, rev 4
        local binding:  label: imp-null
        remote binding: lsr: 2.2.2.2:0, label: imp-null
 


So in summary, I have the following important concepts to understand with MPLS labels:

1. MPLS labels have 4 fields as follows:

    Label Value – 20 bits
    EXP – 3 bits
    S Field or Bottom of Stack field with 1 bit
    TTL field with 3 bits

2. To enabled LDP, we can use the command “mpls ip” under the participating LDP interface.

3. The RIB or Routing Information Based which keeps a copy of the routing tables of any IGP when LDP is enabled will be PUSH (attached with a label)…This prefix will be stored on LDP’s LIB or Label Information Based….

4. The actual switching of LIB’s are done by the LFIB or the Label Forwarding Information Based which is in data plane of the router…This is where the SWAP label is happening…

5. Below are summary of important show commands to check for the LDP status:

  •     show mpls ldp neighbor  — used to check LDP neighbor status
  •       show mpls forwarding-table  — this is used to check the LFIB

  •    show mpls ldp binding  — this is used to check LIB

  •    show ip route – to check RIB
  •     show ip cef  — to check FIB

 
 
 **********************END OF LAB *********************************************

Leave a comment

Quote of the week

"People ask me what I do in the winter when there's no baseball. I'll tell you what I do. I stare out the window and wait for spring."

~ Rogers Hornsby