Žilinská univerzita > Fakulta riadenia a informatiky > Katedra informačných sietí

Configuring simple MPLS network

Objective

Create a simple MPLS network and observe partial parts of MPLS functionality. MPLS network consist of four routers, two edge routers - LSE1 and LSE2 whose fastEthernet interfaces are not parts of the MPLS network and two Label Switch Routers - LSR1 and LSR2 interconnected through serial lines.

Topology

Four routers are connected in a chain line topology:

lan1----fa0/0-LSE1(R1}
                 |
                s1/0
                 |
                 |
                 |
                s1/0
                 |
              LSR1(R2)
                 |
                s1/1
                 |
                 |
                 |
                s1/1
                 |
              LSR2(R3)
                 |
                s1/0
                 |
                 |
                 |
                s1/0
                 |
lan2----fa0/0-LSE2(R4)

IPv4 addressing

For core serial lines:

lse1-lsr1:10.0.12.0/24

lsr1-lsr2:10.0.23.0/24

lsr2-lse2:10.0.34.0/30

 

For loops used in OSPF and MPLS LDP as the Router ID (process stability):

Loops have to be reachable!

LSE1:192.168.255.1/32

LSR1: 192.168.255.2/32

LSR2: 192.168.255.2/32

LSE2:192.168.255.4/32

 

For LAN networks:

SLE1 fa 0/0:1.0.0.0/24

LSE2 fa 0/0:2.0.0.0/24

Prerequisities

Configuration of MPLS requires fully operable network with:

  • correctly applied IP addressing,
  • correctly applied kind of routing (OSPF here),
  • full and operable routing table.

Configuration

First we configure the network to become fully operable.

Example of starting config for the LSE1(R1) router:

enable
conf t
hostname LSE1
int loop 0
ip add 192.168.255.1 255.255.255.255
ip ospf 1 area 0
int s 1/0
ip add 10.0.12.1 255.255.255.0
no sh
ip ospf 1 area 0
int fa 0/0
ip add 1.0.0.1 255.255.255.0
no sh
no keepalive
ip ospf 1 area 0
router ospf 1
router-id 192.168.255.1
end

Verifying addressing and routing

Addressing

First we will check the addressing and interfaces status. We may use the show protocols command, which will display all interfaces with configured IP address, masks and L1/L2 inforamtions. The output should look like as it is at the following listing for LSE1(R1)

LSE1

LSE1#sh protocols
Global values:
  Internet Protocol routing is enabled
FastEthernet0/0 is up, line protocol is up
  Internet address is 1.0.0.1/24
FastEthernet0/1 is administratively down, line protocol is down
Serial1/0 is up, line protocol is up
  Internet address is 10.0.12.1/24
Serial1/1 is administratively down, line protocol is down
Serial1/2 is administratively down, line protocol is down
Serial1/3 is administratively down, line protocol is down
Loopback0 is up, line protocol is up
  Internet address is 192.168.255.1/32

Do it similarly for other routers.

Verifying routing

To verify the routing operation we should simply check the routing table with sh ip route, where we should see all nine networks, as it is in the following listing for LSE1:

LSE1#sh ip route

Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
C       1.0.0.0 is directly connected, FastEthernet0/0
     2.0.0.0/24 is subnetted, 1 subnets
O       2.0.0.0 [110/202] via 10.0.12.2, 00:34:44, Serial1/0
     10.0.0.0/24 is subnetted, 3 subnets
C       10.0.12.0 is directly connected, Serial1/0
O       10.0.23.0 [110/128] via 10.0.12.2, 00:34:44, Serial1/0
O       10.0.34.0 [110/192] via 10.0.12.2, 00:34:44, Serial1/0
     192.168.255.0/32 is subnetted, 4 subnets
O       192.168.255.4 [110/193] via 10.0.12.2, 00:34:44, Serial1/0
O       192.168.255.3 [110/129] via 10.0.12.2, 00:34:44, Serial1/0
O       192.168.255.2 [110/65] via 10.0.12.2, 00:34:44, Serial1/0
C       192.168.255.1 is directly connected, Loopback0
optionally we should do connectivity test among LANs, which should be successfull
LSE1#ping 2.0.0.4 source 1.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.0.0.4, timeout is 2 seconds:
Packet sent with a source address of 1.0.0.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/20 ms
In a case of problems we have to verify the OSPF operation,  at least with following commands
show ip protocols
show ip ospf neighbor

 

Configuring MPLS

To run MPLS several conditions have to be fullfilled:

  • running the IP CEF
    • ip cef
  • starting MPLS globally
    • mpls ip
  • starting label distribution protocol (LDP)
    • mpls label protocol ldp
  • on each interface which will transmit MPLS packet we have to activate the MPLS support
    • mpls ip
  • on each interface we have to correct MTU size
    • mtu 1512
      mpls mtu 1512

Summary of configuration commands for LSE1:

ip cef
!enable MPLS globally for the platfrom
mpls ip
mpls label protocol ldp
int serial1/0
mpls ip
mtu 1512
mpls mtu 1512
end
wr mem

And for the LDP stability we well use the Loopback IP address as the LDP Router ID

mpls ldp router-id Loopback0 force

For beggining we activate MPLS just on LSE1 and LSR1 routers.

Verifying MPLS operation

To verify the MPLS operation we should:

  • check interfaces for MPLS support
  • check control plane
    • Label Distribution Protocol (LDP)
      • LDP neighbors for tag distribution
    • LIB
  • check forward plane
    • FIB, Local FIB

Check interfaces for MPLS support

First we have to verify if router interfaces have enabled and running MPLS:

LSE1

LSE1#sh mpls interface
Interface              IP            Tunnel   Operational
Serial1/0              Yes (ldp)     No       Yes
or the detail version of the same command

LSE1# show mpls interfaces detail
Interface Serial1/0:
        IP labeling enabled (ldp):
          Interface config
        LSP Tunnel labeling not enabled
        BGP tagging not enabled
        Tagging operational
        Fast Switching Vectors:
          IP to MPLS Fast Switching Vector
          MPLS Turbo Vector
        MTU = 1512
 
We should see, that MPLS is operational on required inerefaces of the LSE1 router.
 

Checking the MPLS control plane (LDP, LIB)

LDP protocol operates in three steps :

  • Neighbor Discovery
    • show mpls ldp discovery
    • show mpls ldp discovery detail
  • Establishing session with LDP neighbor
    • show mpls ldp neighbor
    • show mpls ldp neighbor detail
  • Distribution/exchange of labels

Once labels are exchanged, LIB is built. LIB and IP CEF FIB together helps to build LFIB.


LDP Neighbor Discovery - LDP Hello

LDP Neighbors are discovered via LDP Hellos, which are sent to 224.0.0.2 multicast address, destination port 646/UDP. Sending of LDP hellos are started only after both “mpls ip” and “mpls label protocol ldp” are configured on an MPLS interface.

LSE1# show mpls ldp discovery
 Local LDP Identifier:
    192.168.255.1:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            LDP Id: 192.168.255.2:0

where we may see the router local LDP ID, which is the Loop 0 IP address of LSE1 (green) and the neighbor on a serial line with neighbor ID (blue), which is the LSR1 router. The command must show that LDP is transmitted and received (Yellow).

Alternativelly we should issue the same command with detail option:

LSE1# show mpls ldp discovery detail
 Local LDP Identifier:
    192.168.255.1:0
    Discovery Sources:
    Interfaces:
        Serial1/0 (ldp): xmit/recv
            Enabled: Interface config
            Hello interval: 5000 ms; Transport IP addr: 192.168.255.1
            LDP Id: 192.168.255.2:0
              Src IP addr: 10.0.12.2; Transport IP addr: 192.168.255.2
              Hold time: 15 sec; Proposed local/peer: 15/15 sec
              Reachable via 192.168.255.2/32

Note: The LDP IDs have to be in the routing table.

In a case of problem try debug command

debug mpls ldp transport connections

to see if Hellos are exchanged.

LDP sessions

After succesfull LDP discovery MPLS rotuers will establish a LDP session. LDP session is a TCP session (port = 646)

LSE1# sh mpls ldp neighbor
    Peer LDP Ident: 192.168.255.2:0; Local LDP Ident 192.168.255.1:0
        TCP connection: 192.168.255.2.12286 - 192.168.255.1.646
        State: Oper; Msgs sent/rcvd: 85/85; Downstream
        Up time: 01:03:55
        LDP discovery sources:
          Serial1/0, Src IP addr: 10.0.12.2
        Addresses bound to peer LDP Ident:
          10.0.12.2       10.0.23.2       192.168.255.2

listing shows that LSE1 neighbor is LSR1 with 192.168.255.2

Detail option of the same command provides:

LSE1#sh mpls ldp neighbor detail
    Peer LDP Ident: 192.168.255.2:0; Local LDP Ident 192.168.255.1:0
        TCP connection: 192.168.255.2.12286 - 192.168.255.1.646
        State: Oper; Msgs sent/rcvd: 85/85; Downstream; Last TIB rev sent 18
        Up time: 01:04:11; UID: 1; Peer Id 0;
        LDP discovery sources:
          Serial1/0; Src IP addr: 10.0.12.2
            holdtime: 15000 ms, hello interval: 5000 ms
        Addresses bound to peer LDP Ident:
          10.0.12.2       10.0.23.2       192.168.255.2
        Peer holdtime: 180000 ms; KA interval: 60000 ms; Peer state: estab
and we may alsoo see open tcp session from LSE1:
LSE1#sh tcp brief | i 646
6577686C  192.168.255.1.646       192.168.255.2.12286    ESTAB

Debugging

In a case of problem with LDP issue debug commands:

Debug if the session will come up

Debug mpls ldp session state
Shows all the LDP messages sent or received
Debug mpls ldp messages sent|receive

Label Information Base

Now when the LDP session is established, MPLS rotuers will exchenge LDP binding (label+prefix), which is stored in the Label Information Base (LIB). The content of LIB we may dispaly with 

sh mpls ip binding detail

sh mpls ip binding <prefix> <mask> detail

So let observe:

LSE1#sh mpls ip binding
  1.0.0.0/24
        in label:     imp-null
        out label:    16        lsr: 192.168.255.2:0
  2.0.0.0/24
        in label:     16
        out label:    17        lsr: 192.168.255.2:0  inuse
  10.0.12.0/24
        in label:     imp-null
        out label:    imp-null  lsr: 192.168.255.2:0
  10.0.23.0/24
        in label:     17
        out label:    imp-null  lsr: 192.168.255.2:0  inuse
  10.0.34.0/24
        in label:     18
        out label:    18        lsr: 192.168.255.2:0  inuse
...
...
where we may see assigned MPLS labels for each network locally, by LSE1 router (yellow), and labels assigned by remote neighbor (green). if the LIB item is used however depends on the best route to the destination network, which is decided from Routing table. In our case it is very simple, as we does not have many alternative paths. As we are interesting on LAN networks, we my see detail LIB info for 2.0.0.0/24 network as
LSE1#sh mpls ip binding 2.0.0.0 24
  2.0.0.0/24
        in label:     16
        out label:    17        lsr: 192.168.255.2:0  inuse
Locally assigned MPLS label is 16 (distributed by LSE1 to its neighbor using LDP protocol), and from the LSE1 point of view label assigned by the LSR1 neighbor is 17 (mean, if you have packet to 2.0.0.0/24 and you will route them through me label them with MPLSl abel 17).
On the LSR1, which is the nieighbor of LSE1 we may see the same in an opposite meaning:
LSR1#sh mpls ip binding 2.0.0.0 24
  2.0.0.0/24
        in label:     17
        out label:    16        lsr: 192.168.255.1:0

Debugging

In a case of problem with LDP binidings issue debug commands:

 

To see binding advertised
debug mpls ldp advertisements
to see bindings received
debug mpls ldp binding
 

Checking the MPLS forwarding plane (FIB, LFIB)

Focus on checking LFIB and FIB

Label FIB (LFIB)

LSE1#sho mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     17          2.0.0.0/24        0          Se1/0      point2point
17     Pop tag     10.0.23.0/24      0          Se1/0      point2point
18     18          10.0.34.0/24      0          Se1/0      point2point
19     19          192.168.255.4/32  0          Se1/0      point2point
20     20          192.168.255.3/32  0          Se1/0      point2point
21     Pop tag     192.168.255.2/32  0          Se1/0      point2point
Where column Outgoing may include:
  • Pop —Pops the topmost label (remove tag and forward as an MPLS packet)
  • Untagged —Untag the incoming MPLS packet and forward as an IP packet
  • Aggregate —Untag and then do a FIB lookup
  • 0 —Nullify the top label (first 20bits)

Which for LSE1 means:

  • for network 2.0.0.0/24 three routers away...
LSE1#sho mpls forwarding-table 2.0.0.0
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     17          2.0.0.0/24        0          Se1/0      point2point
label the IP packet to the 2.0.0.0 network with label 17 and forward it as an MPLS packet to neighbor over s1/0 line.
  • For network 10.0.23.0/24, which is one router away
LSE1#sho mpls forwarding-table 10.0.23.0
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
17     Pop tag     10.0.23.0/24      0          Se1/0      point2point
remove the mpls label and forward it as an MPLS packet over s1/0 line.
 

Forwarding Information Base (FIB)

 
Similarly, we may see inside of the IP CEF rewriting instructions, for example for mentioned network 2.0.0.0 we may see preprepared MPLS labels
LSE1#sh ip cef 2.0.0.0
2.0.0.0/24, version 18, epoch 0, cached adjacency to Serial1/0
0 packets, 0 bytes
  tag information set
    local tag: 16
    fast tag rewrite with Se1/0, point2point, tags imposed: {17}
  via 10.0.12.2, Serial1/0, 0 dependencies
    next hop 10.0.12.2, Serial1/0
    valid cached adjacency
    tag rewrite with Se1/0, point2point, tags imposed: {17}
Alternative commands
sh mpls forwarding <prefix>
sh mpls forwarding label <label>
show mpls forwarding-table <prefix> detail
 
 

Continue...

So let finish and configure MPLS in the rest of topo

 

ip cef
!enable MPLS globally for the platfrom
mpls ip
mpls label protocol ldp
int serial1/0
mpls ip
mtu 1512
mpls mtu 1512

 

Now we will track FIB and LFIB from LSE1 to fastEthernet network of LSE2
So LFIB and FIB on the LSE1 router look like
LSE1
LSE1#sh mpls forwarding-table 2.0.0.0 24
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
18     18          2.0.0.0/24        0          Se1/0      point2point
LSE1#sh ip cef 2.0.0.2
2.0.0.0/24, version 14, epoch 0, cached adjacency to Serial1/0
0 packets, 0 bytes
  tag information set
    local tag: 18
    fast tag rewrite with Se1/0, point2point, tags imposed: {18}
  via 10.0.12.2, Serial1/0, 0 dependencies
    next hop 10.0.12.2, Serial1/0
    valid cached adjacency
    tag rewrite with Se1/0, point2point, tags imposed: {18}
Tables are saying, that if LSE1 has an packet to 2.0.0.0 network, it has to label them with label 18 and forward through s1/0 interface to the neighbor 10.0.12.2 (LSR1).
LSR1
LSR1#sh mpls forwarding-table 2.0.0.0 24
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
18     16          2.0.0.0/24        0          Se1/1      point2point
LSR1#sh ip cef 2.0.0.0
2.0.0.0/24, version 14, epoch 0, cached adjacency to Serial1/1
0 packets, 0 bytes
  tag information set
    local tag: 18
    fast tag rewrite with Se1/1, point2point, tags imposed: {16}
  via 10.0.23.3, Serial1/1, 0 dependencies
    next hop 10.0.23.3, Serial1/1
    valid cached adjacency
    tag rewrite with Se1/1, point2point, tags imposed: {16}
Tables are saying, that if an packet destined to 2.0.0.0 network will arrive on the LSR1, it have to be labeled with label 18, and the label will be rewritten with the label 16 and forwarded through s1/1 interface to the neighbor 10.0.23.3 (LSR2).
 
LSR2
LSR2#sh mpls forwarding-table 2.0.0.0 24
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     2.0.0.0/24        0          Se1/0      point2point
LSR2#sh ip cef 2.0.0.0
2.0.0.0/24, version 12, epoch 0, cached adjacency to Serial1/0
0 packets, 0 bytes
  tag information set
    local tag: 16
  via 10.0.34.4, Serial1/0, 0 dependencies
    next hop 10.0.34.4, Serial1/0
    valid cached adjacency
    tag rewrite with Se1/0, point2point, tags imposed: {}
Tables are saying, that if an packet destined to 2.0.0.0 network will arrive on the LSR2, it have to be labeled with label 16, and the label will be removed (pop) and will be forwarded as an MPLS packet through s1/0 interface to the neighbor 10.0.34.4 (LSR2).
 
LSE2
LSE2#sh mpls forwarding-table 2.0.0.0 24
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
LSE2#sh ip cef 2.0.0.1
2.0.0.0/24, version 8, epoch 0, attached, connected
0 packets, 0 bytes
  tag information set
    local tag: implicit-null
  via FastEthernet0/0, 0 dependencies
    valid glean adjacency
Tables are saying, that if an packet destined to 2.0.0.0 network (we have there just one ip address of the LSE2 fastEthernet interface) will arrive on the LSE2, it will not be  labeled with any label, and the router will remove MPLS header and forward the packet as an IP packet through fa0/0 interface, e.g. as the target interface is its own, the rotuer will process the packet (CEF is saying thet the IP is directly connected and attached).
 
 
Groups: