This post is another study notes about MPLS Labels…I will be going through some deep details on how the labels are Push, Swap and Pop across the LSR’s or Label Switch Routers…It’s good to understand that MPLS is a tunneling protocol that can carry much any other protocols such as IP, IPV6, Ethernet or any other protocols…The magic of MPLS is that it does not forward packet based destination address but rather it forward packet based on LABELS..

As with my previous study notes, MPLS header have 4 fields consisting of the following:

    – Label Value   ( 20 bits )
    – EXP ( 3 bit)
    – S Bit or Bottom of the Stack ( 1 bit)
    – TTL ( 8 bits)

 Here’s my topology for this laboratory:
 

My router configurations:( I need to established the IGP between routers …in this set up, I’m using OSPF and all of them belongs to Area 0)

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


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
 network 172.16.23.0 0.0.0.255 area 0


R3#sh run | sec ospf
  router ospf 1
  network 3.3.3.3 0.0.0.0 area 0
  network 172.16.23.0 0.0.0.255 area 0
  network 172.16.34.0 0.0.0.255 area 0


R4#sh run | sec ospf
   router ospf 1
  network 4.4.4.4 0.0.0.0 area 0
  network 172.16.34.0 0.0.0.255 area 0


Let me ensure that OSPF neighbors and reachability is established:

R2#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  –        00:00:35    172.16.23.3     Serial2/2
1.1.1.1           0   FULL/  –        00:00:32    172.16.12.1     Serial2/1
R2#


R3#show ip ospf neighbor


Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           1   FULL/DR         00:00:32    172.16.34.4     FastEthernet0/0
172.16.23.2       0   FULL/  –        00:00:38    172.16.23.2     Serial2/3
R3#

Ping from R1 towards R4..

 R1#ping 4.4.4.4 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/84/88 ms
R1#


So Here’s where the MPLS Configurations will start…

Let me modify the label range to properly identify each of the Labels on each routers…

R1(config)#mpls label range 100 150

R2(config)#mpls label range 200 250

R3(config)#mpls label range 300 350

R4(config)#mpls label range 400 450

Now, I’m ready to set up the LDP on the routers…

R1(config)#int s2/0
R1(config-if)#no shut
R1(config-if)#mpls ip

 R2(config)#int s2/1
R2(config-if)#mpls ip


R2(config-if)#int s2/2
R2(config-if)#mpls ip

R3(config-router)#int s2/3
R3(config-if)#mpl
R3(config-if)#mpls ip


 R3(config)#int fa0/0
R3(config-if)#mpls ip


R4(config)#int fa1/0
R4(config-if)#mpls ip


After enabling the LDP on the participating interface, I have seen the LDP neighbors coming up…

 R1(config-if)#
*Oct 19 09:48:20.567: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (2) is UP


 
R2#
*Oct 19 10:00:23.499: %LDP-5-NBRCHG: LDP Neighbor 3.3.3.3:0 (2) is UP


R2(config-if)#
*Oct 19 09:48:20.047: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:0 (1) is UP


R3#
*Oct 19 10:00:10.967: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (1) is UP


R3(config-if)#
*Oct 19 09:54:53.087: %LDP-5-NBRCHG: LDP Neighbor 4.4.4.4:0 (2) is UP


R4(config-router)#do sh run | sec ospf
*Oct 19 09:56:26.719: %LDP-5-NBRCHG: LDP Neighbor 3.3.3.3:0 (1) is UP


We can also check the LDP neighbor status using the command ” show mpls ldp neighbor”

R2#show mpls ldp neighbor
    Peer LDP Ident: 1.1.1.1:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 1.1.1.1.646 – 2.2.2.2.44455

        State: Oper; Msgs sent/rcvd: 92/89; Downstream
        Up time: 01:12:40
        LDP discovery sources:
          Serial2/1, Src IP addr: 172.16.12.1
        Addresses bound to peer LDP Ident:
          1.1.1.1         172.16.12.1
    Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 2.2.2.2:0
        TCP connection: 3.3.3.3.55521 – 2.2.2.2.646

        State: Oper; Msgs sent/rcvd: 78/79; Downstream
        Up time: 01:00:37
        LDP discovery sources:
          Serial2/2, Src IP addr: 172.16.23.3
        Addresses bound to peer LDP Ident:
          172.16.23.3     3.3.3.3         172.16.34.3


Now, let’s check the LIB or the Label Information Based …(Analogous to the RIB table which keep the routing table)


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 6
        remote binding: lsr: 2.2.2.2:0, label: 200
  lib entry: 2.2.2.0/24, rev 9
        remote binding: lsr: 2.2.2.2:0, label: imp-null
  lib entry: 2.2.2.2/32, rev 8
        local binding:  label: 100
  lib entry: 3.3.3.3/32, rev 12
        local binding:  label: 102
        remote binding: lsr: 2.2.2.2:0, label: 201

  lib entry: 4.4.4.4/32, rev 16
        local binding:  label: 104
        remote binding: lsr: 2.2.2.2:0, label: 203

  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

  lib entry: 172.16.23.0/24, rev 10
        local binding:  label: 101
        remote binding: lsr: 2.2.2.2:0, label: imp-null

  lib entry: 172.16.34.0/24, rev 14
        local binding:  label: 103
        remote binding: lsr: 2.2.2.2:0, label: 202



Key points to understand here:


1.  LIB entry   — this refers to the prefix that is advertise by IGP’s or directly connected, or static 
                            routes
2. Revision    — Revisions numbers
3.Local binding  — This is the label is bind to the local router..
4. Remote binding — This refers to the Next Hop router…
5. Labels —- ( it can be IMP-Null, EXP-Null, and the the Label value assigned to the routers)
6. LSR — This is the Transit routers…

Let me check the LFIB or the label forwarding information based…

R1#show mpls forwarding-table
Local      Outgoing   Prefix               Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id        Switched      interface
100        No Label   2.2.2.2/32                 0             Se2/0      point2point
101        Pop Label  172.16.23.0/24       0             Se2/0      point2point
102        201        3.3.3.3/32                   0             Se2/0      point2point
103        202        172.16.34.0/24           0             Se2/0      point2point
104        203        4.4.4.4/32                   0             Se2/0      point2point


Okay, let’s dissect the Labels one by one…

1. The Local Label for R1 have a range from 100-150…The first Local label starts at 100, followed by 101 and so on…

 a. The local labels were auto-generated and were assigned to each Prefix…
      –  100 is assigned to R2 loopback…
      –  101 is assigned to the Prefix between R2 and R3
      –  102 were assigned to R3 loopback
      –  103 were assigned to the Prefix between R3 and R4
      – 104 were assigned to R4 loopback

2. R1 were assigned the Outgoing labels  based on the labels from R2…

       — No labels were assigned to 2.2.2.2 this is the default behavior ( through PHP)..if we can see 
          from the results of the LDP bindings, 2.2.2.2 label is IMP-NULL meaning that R2 have done 
         the removal of the label for 2.2.2.2 so that R1 will not do the label lookup as they are directly 
         connected devices.
       — POP Label  for 172.16.23.0/24 meaning that once R1 have switched the packet to R2, R2 will 
           need to removed the label.
        — A label of 201 for 3.3.3.3 … The label 202 is assigned by R2…
        — A label 202 for 172.16.34.0/24…this is also assigned by R2..
        — Finally, a label of 203 for 4.4.4.4/32 which is also assigned by R2…


3. The outgoing interface is the Serial connection of R1 towards R2…

4. The next hop is set to Point to Point…

The fastest method to check which label are assigned to each prefix will be through the command
“show ip cef”…

 R1#show ip cef 2.2.2.2
2.2.2.2/32
  nexthop 172.16.12.2 Serial2/0


R1#
R1#show ip cef 172.16.23.0
172.16.23.0/24
  nexthop 172.16.12.2 Serial2/0


R1#show ip cef 3.3.3.3
3.3.3.3/32
  nexthop 172.16.12.2 Serial2/0 label 201


R1#show ip cef 172.16.34.0
172.16.34.0/24
  nexthop 172.16.12.2 Serial2/0 label 202


R1#show ip cef 4.4.4.4
4.4.4.4/32
  nexthop 172.16.12.2 Serial2/0 label 203
R1#

 Let’s check on R2…

R2#show ip cef 1.1.1.1
1.1.1.1/32
  nexthop 172.16.12.1 Serial2/1


R2#show ip cef 2.2.2.2
2.2.2.2/32
  receive for Loopback2


R2#show ip cef 172.16.12.1
172.16.12.0/24
  attached to Serial2/1


R2#show ip cef 172.16.23.2
172.16.23.2/32
  receive for Serial2/2


R2#show ip cef 172.16.34.4
172.16.34.0/24
  nexthop 172.16.23.3 Serial2/2


R2#show ip cef 4.4.4.4
4.4.4.4/32
  nexthop 172.16.23.3 Serial2/2 label 303


R2#show ip cef 1.1.1.1
1.1.1.1/32
  nexthop 172.16.12.1 Serial2/1


R2#show ip cef 3.3.3.3
3.3.3.3/32
  nexthop 172.16.23.3 Serial2/2
R2#

 Let me stop here..As I have notice, for 4.4.4.4/32 ( R4 Loopback) , Once R2 have received this prefix…the label attached to it is 303… This is the Local Label assigned by R3..This is what we called as the LABEL PUSH…

See below…

R3#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
300        No Label   2.2.2.2/32       0             Se2/3      point2point
301        200        1.1.1.1/32       1800          Se2/3      point2point
302        Pop Label  172.16.12.0/24   0             Se2/3      point2point
303        No Label   4.4.4.4/32       1812          Fa0/0      172.16.34.4
R3#
 

Now, R3 will switched the Packet to R2…So what does R2 tells about this Prefix ?.

R2#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
200        No Label   1.1.1.1/32       2252          Se2/1      point2point
201        No Label   3.3.3.3/32       0             Se2/2      point2point
202        Pop Label  172.16.34.0/24   0             Se2/2      point2point
203        303        4.4.4.4/32       1296          Se2/2      point2point
R2#

>>> So R2 have assigned it’s own Local Label with a value of 203 but still shows that the Outgoing Label is the Local Label Assigned by R3 ( 303)…This process is what we called as LABEL SWAP…

Now, R2 is ready to switched the Packet to R1…let’s take a look on R1 LFIB or Label Forwarding Information Based Table…

R1#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
100        No Label   2.2.2.2/32       0             Se2/0      point2point
101        Pop Label  172.16.23.0/24   0             Se2/0      point2point
102        201        3.3.3.3/32       0             Se2/0      point2point
103        202        172.16.34.0/24   0             Se2/0      point2point
104        203        4.4.4.4/32       0             Se2/0      point2point
R1#

>>> So R1 assigned a Local label for the Prefix 4.4.4.4/32 with a value of 104 ( Again this is what we called as LABEL SWAP)…But as notice, it retains R2 Local Label and it became R1’s Outgoing label..





Let’s examine R2 by this time…

R2#show mpls ldp bindings
  lib entry: 1.1.1.0/24, rev 10
        remote binding: lsr: 1.1.1.1:0, label: imp-null

  lib entry: 1.1.1.1/32, rev 6
        local binding:  label: 200
        remote binding: lsr: 3.3.3.3:0, label: 301

  lib entry: 2.2.2.0/24, rev 9
        local binding:  label: imp-null
  lib entry: 2.2.2.2/32, rev 11
        remote binding: lsr: 1.1.1.1:0, label: 100
        remote binding: lsr: 3.3.3.3:0, label: 300

  lib entry: 3.3.3.0/24, rev 19
        remote binding: lsr: 3.3.3.3:0, label: imp-null
  lib entry: 3.3.3.3/32, rev 13
        local binding:  label: 201
        remote binding: lsr: 1.1.1.1:0, label: 102

  lib entry: 4.4.4.4/32, rev 18
        local binding:  label: 203
        remote binding: lsr: 1.1.1.1:0, label: 104
        remote binding: lsr: 3.3.3.3:0, label: 303

  lib entry: 172.16.12.0/24, rev 2
        local binding:  label: imp-null
        remote binding: lsr: 1.1.1.1:0, label: imp-null
        remote binding: lsr: 3.3.3.3:0, label: 302

  lib entry: 172.16.23.0/24, rev 4
        local binding:  label: imp-null
        remote binding: lsr: 1.1.1.1:0, label: 101
        remote binding: lsr: 3.3.3.3:0, label: imp-null

  lib entry: 172.16.34.0/24, rev 16
        local binding:  label: 202
        remote binding: lsr: 1.1.1.1:0, label: 103
        remote binding: lsr: 3.3.3.3:0, label: imp-null

R2#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
200        No Label     1.1.1.1/32         520           Se2/1      point2point
201        No Label     3.3.3.3/32          0             Se2/2      point2point
202        Pop Label  172.16.34.0/24   0             Se2/2      point2point
203        303            4.4.4.4/32          540           Se2/2      point2point


*** Here’s what we can see from the forwarding table:

1. Each prefix are again assigned a local labels starting from 200…I have set up 200-250..
2. The outgoing labels have the following info…
    
      —  No label for 1.1.1.1/32
      —  No labels for 3.3.3.3/32
      — Pop Label for 172.16.34.0/24 as it’s a prefix that is advertise by R3…
      — Further away, 4.4.4.4/32 were assigned an outgoing label of 303 by R3…

IMPORTANT:

It’s important to understand that the Local Label assigned to a prefix by a LSR becomes the Outgoing label on the next hop router (LSR)..

Finally, I want to test the end to end connectivity between R1 and R4…

R1#ping 4.4.4.4 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/83/88 ms

R1#



Now to check whether the Data Plane for the LDP, we can do a traceroutes towards R4 loopback sourcing R1 loopback address.

R1#traceroute 4.4.4.4 source 1.1.1.1
Type escape sequence to abort.
Tracing the route to 4.4.4.4
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.12.2 [MPLS: Label 203 Exp 0] 84 msec 84 msec 56 msec
  2 172.16.23.3 [MPLS: Label 303 Exp 0] 56 msec 60 msec 56 msec
  3 172.16.34.4 84 msec 80 msec 80 msec

R1#

***********************************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