Overview of MPLS:

Traditional IP routing has many limitations, from the scalability problem to the traffic management and integrated Layer 2 networks that already exist in the network of major service providers. But with the rapid development of Internet and most of the environment are selected IP is the protocol layer 3 IP, the traditional disadvantages of more clearly revealed. MPLS was born to link the advantages of connectionless layer 3 routing and forwarding of Layer 2 connection-oriented. In the MPLS architecture is divided into two separate planes:

Control plane (control plane): here the layer 3 routing protocols established paths used for forwarding packets. Control plane to meet for the creation and maintenance of information transfer between routers running MPLS label (also known as binding).

Plane data (data plane) database using the transition labels are maintained by the router running MPLS to perform the packet forwarding based on label information. Each MPLS node running one or more IP routing protocols (or can use static routing) to exchange routing information with other nodes in the MPLS network. Each MPLS node (including ATM switch) is an IP router running the control plane. In MPLS, IP routing table is used to determine the exchange of label, in which adjacent nodes to exchange MPLS labels to each other according to each separate subnet in the routing table. The exchange of labels is done by two protocol is TDP and LDP. TDP (tag distribution protocol) is a Cisco product, LDP (label distribution protocol) is a version of the TDP, but created by the IETF. Process control IP routing using MPLS label exchange with MPLS node to build a label forwarding table (Label Forwarding Table). This table is a database of data plane is used to forward labeled packets through the MPLS network.

The term used in MPLS:
LSR: Label Switching Router: router or switch is made the label distribution procedures and can forward packets based on label information. The basic function of the distribution procedure is to allow an LSR label distribution label it to other LSR in the MPLS network.
Edge - LSR is a router to perform or is labeled (push) or the label is removed (this is called pop act) at the edge of the MPLS network.
The LSR neighbors that are not MPLS node is considered as the Edge-LSR. If LSR has no connection via any interface to an ATM-MPLS LSR, it is called ATM edge-LSR. Edge-LSR using traditional IP forwarding table, plus information label to label to the IP packet or to remove labels from labeled packets before sending them to the node is not running MPLS.

ATM-LSR: run the protocol in MPLS control plane to set up ATM virtual channels, perform forward labeled packets as ATM cells.

ATM edge-LSR: a router may receive packets labeled or not labeled, segments packets into cells and transitional cells next to the ATM-LSR. May receive ATM cells from the neighboring ATM-LSR, a collection of cells into the original packets and forward packets.

LSP: label-switched path: Each packet entering the network at ingress MPLS LSR and go out in the egress MPLS LSR. This mechanism creates LSP, LSR, which is a collection of labeled packets must go through to destination. LSP is a path in one direction, that is a different LSP for going against the flow.

Each LSR keeps two tables provide information related to the MPLS forwarding component. Firstly, as Tag Information Base (TiB) is produced by Cisco (or Label information base (LIB) is the standard terms of MPLS), which holds all the labels are registered and mapped by this LSR the label into the labels are received by the neighbors. The mapping of label is distributed through the use of the label distribution protocol. Second table is the Tag Forwarding Information Base (TFIB - a product of Cisco) is used during packet forwarding and just keep the label is being used by elements of the MPLS label forwarding. Thus, packets from the router into customers' network service provider packages are not labeled.Edge-LSR will impose a label and forwards the new packets (packets after labeling) to the next LSR along the LSP. Each LSR along the LSP will switch packets based on label information. The next router in the path will eventually remove the labels through a mechanism called puniltimate hop popping, the packet after removing the label to be forwarded to the customer's router based on routing tables.

Configuration

Configuring a basic MPLS labs, was clearly labeled with the operation of the packet when traversing a network of service providers.
Network model: This is a general model of the network service provider

Routers CE1 and CE2 is the customer's router, the router PE1, P1, P2, PE2 router is running in the network of service providers. PE1, PE2 is the edge-LSR, P1 and P2 is the LSR. Routers running MPLS required to use Cisco IOS Release 12.1 Enterprise Plus (the IOS have the js) or the service provider version of IOS.

Address of the interface:

Device Interface Address
CE1 E0
204.138.83.1/24 S0
128.107.10.1/30
PE1 E0 / 0
S0 / 0
Lo0 192.168.1.10/30
128.107.10.2/30
192.168.1.1/32
P1 F0 / 0
S0 / 0
Lo0 192.168.1.9/30
192.168.1.14/30
192.168.1.2/32
P2 S0 / 0
E0 / 0
Lo0 192.168.1.13/30
192.168.1.18/30
192.168.1.3/32
PE2 E0 / 0
S0 / 0
Lo0 192.168.1.17/30
128.107.10.5/30
192.168.1.4/32
CE2 E0
209.100.164.1/24 S0
128.107.10.6/30

The entire configuration:

Router CE1:
CE1 # sh run
Building configuration ...
Current configuration:
!
Version 1.12
!
hostname CE1
!
ip subnet-zero
!
interface Ethernet0
ip address 204.134.83.1 255.255.255.0
no keepalive
!
interface Serial0
ip address 128.107.10.1 255 255 255 252
no fair-queue
!
ip classless
ip route 0.0.0.0 0.0.0.0 128.107.10.2
!
end

Router PE1:

PE1
!
hostname PE1
!
logging queue-limit 100
enable secret $ 5 $ 1 $ D5xF G/ShevShmI1sTqKoJGytO.
enable password vnpro
!
CEF ip
MPLS LDP logging neighbor-changes
!
interface Loopback0
ip address 192.168.1.1 255 255 255 255
!
interface Ethernet0 / 0
ip address 192.168.1.10 255 255 255 252
half-duplex
tag-switching ip
!
interface Serial0 / 0
ip address 128.107.10.2 255 255 255 252
clockrate 64000
no fair-queue
!
router ospf 1
log-adjacency-changes
255 255 255 255 area 0 network 0.0.0.0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 192.168.1.1 mask 255,255,255,255
redistribute static
neighbor 192.168.1.4 remote-as 1
neighbor 192.168.1.4 update-source Loopback0
no auto-summary
!
ip http server
ip classless
ip route 204.134.83.0 255.255.255.0 128.107.10.1
!
end

Router P1:

P1
!
hostname P1
!
enable password vnpro
!
CEF ip
MPLS LDP logging neighbor-changes
!
interface Loopback0
ip address 192.168.1.2 255 255 255 255
!
interface FastEthernet0 / 0
ip address 192.168.1.9 255 255 255 252
duplex auto
speed auto
tag-switching ip
!
interface Serial0 / 0
ip address 192.168.1.14 255 255 255 252
no ip mroute-cache
tag-switching ip
no fair-queue
!
router ospf 1
log-adjacency-changes
network 192.168.1.2 0.0.0.0 area 0
network 192.168.1.8 0.0.0.3 area 0
network 192.168.1.12 0.0.0.3 area 0
255 255 255 255 area 0 network 0.0.0.0
!
end

Router P2:

P2
!
version 12.2
!
hostname P2
!
enable password vnpro
!
CEF ip
MPLS LDP logging neighbor-changes
!
interface Loopback0
ip address 192.168.1.3 255 255 255 255
!
interface Ethernet0 / 0
ip address 192.168.1.18 255 255 255 252
half-duplex
tag-switching ip
!
interface Serial0 / 0
ip address 192.168.1.13 255 255 255 252
tag-switching ip
clockrate 64000
no fair-queue
!
router ospf 1
log-adjacency-changes
network 192.168.1.3 0.0.0.0 area 0
network 192.168.1.12 0.0.0.3 area 0
network 192.168.1.16 0.0.0.3 area 0
255 255 255 255 area 0 network 0.0.0.0
!
end

Router PE2:

PE2
!
version 12.2
!
hostname PE2
!
logging queue-limit 100
enable secret $ 5 $ 1 $ S6aw fD8Rw3fMw9uoXf2DY68rN1
enable password vnpro
!
CEF ip
MPLS LDP logging neighbor-changes
!
interface Loopback0
ip address 192.168.1.4 255 255 255 255
!
interface Ethernet0 / 0
ip address 192.168.1.17 255 255 255 252
half-duplex
tag-switching ip
!
interface Serial0 / 0
ip address 128.107.10.5 255 255 255 252
clockrate 64000
no fair-queue
!
router ospf 1
log-adjacency-changes
255 255 255 255 area 0 network 0.0.0.0
!
router bgp 1
no synchronization
bgp log-neighbor-changes
network 192.168.1.4 mask 255,255,255,255
redistribute static
neighbor 192.168.1.1 remote-as 1
neighbor 192.168.1.1 update-source Loopback0
no auto-summary
!
ip route 209.100.164.0 255.255.255.0 128.107.10.6
!
end

CE2 router:

CE2
!
version 12.0
!
hostname CE2
!
enable password vnpro
!
interface Ethernet0
ip address 209.100.164.1 255.255.255.0
no ip directed-broadcast
no keepalive
!
interface Serial0
ip address 128.107.10.6 255 255 255 252
no ip directed-broadcast
no ip mroute-cache
no fair-queue
!
ip classless
ip route 0.0.0.0 0.0.0.0 128.107.10.5
!
end
Configuration details:
Step 1: configure the address for the router:
CE1 (config) # interface S0
CE1 (config-if) # ip address 128.107.10.1 255 255 255 252
CE1 (config-if) # clock rate 64000
CE1 (config-if) # no shutdown
CE1 (config-if) # exit
CE1 (config) # interface E0
CE1 (config-if) # ip address 204.134.83.1 255.255.255.0
CE1 (config-if) # no keepalive
CE1 (config-if) # no shutdown

PE1 (config) # interface S0 / 0
PE1 (config-if) # ip address 128.107.10.2 255 255 255 252
PE1 (config-if) # clock rate 64000
PE1 (config-if) # no shutdown
PE1 (config-if) # exit
PE1 (config) # interface E0 / 0
PE1 (config-if) # ip address 192.168.1.10 255 255 255 252
PE1 (config-if) # no shutdown
PE1 (config) # interface lo0
PE1 (config-if) # ip address 192.168.1.1 255 255 255 255

P1 (config) # interface S0 / 0
P1 (config-if) # ip address 192.168.1.14 255 255 255 252
P1 (config-if) # clock rate 64000
P1 (config-if) # no shutdown
P1 (config-if) # exit
P1 (config) # interface f0 / 0
P1 (config-if) # ip address 192.168.1.9 255 255 255 252
P1 (config-if) # clock rate 64000
P1 (config-if) # no shutdown
P1 (config) # interface lo0
P1 (config-if) # ip address 192.168.1.2 255 255 255 255

P2 (config) # interface S0 / 0
P2 (config-if) # ip address 192.168.1.13 255 255 255 252
P2 (config-if) # clock rate 64000
P2 (config-if) # no shutdown
P2 (config-if) # exit
P2 (config) # interface E0 / 0
P2 (config-if) # ip address 192.168.1.18 255 255 255 252
P2 (config-if) # clock rate 64000
P2 (config-if) # no shutdown
P2 (config) # interface lo0
P2 (config-if) # ip address 192.168.1.3 255 255 255 255

PE2 (config) # interface S0 / 0
PE2 (config-if) # ip address 128.107.10.5 255 255 255 252
PE2 (config-if) # clock rate 64000
PE2 (config-if) # no shutdown
PE2 (config-if) # exit
PE2 (config) # interface E0 / 0
PE2 (config-if) # ip address 192.168.1.17 255 255 255 252
PE2 (config-if) # no shutdown
PE2 (config) # interface lo0
PE2 (config-if) # ip address 192.168.1.4 255 255 255 255

CE2 (config-if) # interface S0
CE2 (config-if) # ip address 128.107.10.6 255 255 255 252
CE2 (config-if) # clock rate 64000
CE2 (config-if) # no shutdown
CE2 (config-if) # exit
CE2 (config-if) # interface E0
CE2 (config-if) # ip address 209.100.164.1 255.255.255.0
CE2 (config-if) # no keepalive
CE2 (config-if) # no shutdown

Step 2: configure the router to router. Router CE1, CE2 only use static routing to reach the ISP network. Router PE1, PE2 run BGP protocol, router P1, P2 running OSPF protocol.
CE1 (config) # ip route 0.0.0.0 0.0.0.0 128.107.10.2

PE1 (config) # router ospf 1
PE1 (config-router) # network 0.0.0.0 0.0.0.0 area 0
PE1 (config) # router bgp 1
PE1 (config-router) # no synchronization
PE1 (config-router) # network 192.168.1.1 mask 255,255,255,255
PE1 (config-router) # neighbor 192.168.1.4 remote-as 1
PE1 (config-router) # neighbor 192.168.1.4 update-source lo0
PE1 (config-router) # redistribute static

P1 (config) # router ospf 1
P1 (config-router) # network 192.168.1.2 0.0.0.0 area 0
P1 (config-router) # network 192.168.1.8 0.0.0.3 area 0
P1 (config-router) # network 192.168.1.12 0.0.0.3 area 0
P1 (config-router) # network 0.0.0.0 area 0 255 255 255 255

P2 (config) # router ospf 1
P2 (config-router) # network 192.168.1.3 0.0.0.0 area 0
P2 (config-router) # network 192.168.1.12 0.0.0.3 area 0
P2 (config-router) # network 192.168.1.16 0.0.0.3 area 0
P2 (config-router) # network 0.0.0.0 area 0 255 255 255 255

PE2 (config) # router ospf 1
PE2 (config-router) # network 0.0.0.0 0.0.0.0 area 0
PE2 (config) # router bgp 1
PE2 (config-router) # no synchronization
PE2 (config-router) # network 192.168.1.4 mask 255,255,255,255
PE2 (config-router) # neighbor 192.168.1.1 remote-as 1
PE2 (config-router) # neighbor 192.168.1.1 update-source lo0
PE2 (config-router) # redistribute static

CE2 (config-if) # ip route 0.0.0.0 0.0.0.0 128.107.10.5

Step 3: Check the routing table:
Tag-switching or MPLS will not work if the network service provider router is not running.

CE1 # sh ip route
Gateway of last resort is 128.107.10.2 to network 0.0.0.0
C 204.134.83.0/24 is directly connected, Ethernet0
128.107.0.0/30 is subnetted, 1 subnets
C 128.107.10.0 is directly connected, Serial0
S * 0.0.0.0 / 0 [1 / 0] via 128.107.10.2

PE1 # sh ip route
Gateway of last resort is not set

S 204.134.83.0/24 [1 / 0] via 128.107.10.1
B 209.100.164.0/24 [200 / 0] via 128.107.10.6, 00:05:35
O 128.107.10.4 [110/148] via 192.168.1.9, 00:05:37, Ethernet0 / 0
128.107.0.0/30 is subnetted, 1 subnets
C 128.107.10.0 is directly connected, Serial0 / 0
192.168.1.0/24 is variably subnetted, 5 subnets, 2 masks
C 192.168.1.8/30 is directly connected, Ethernet0 / 0
O 192.168.1.12/30 [110/74] via 192.168.1.9, 00:05:37, Ethernet0 / 0
C 192.168.1.1/32 is directly connected, Loopback0
O 192.168.1.3/32 [110/75] via 192.168.1.9, 00:05:37, Ethernet0 / 0
O 192.168.1.2/32 [110/11] via 192.168.1.9, 00:05:37, Ethernet0 / 0
O 192.168.1.4/32 [110/11] via 192.168.1.9, 00:05:37, Ethernet0 / 0

P1 # sh ip route
Gateway of last resort is not set
128.107.0.0/30 is subnetted, 2 subnets
O 128.107.10.0 [110/74] via 192.168.1.10, 00:01:02, FastEthernet0 / 0
O 128.107.10.4 [110/138] via 192.168.1.13, 00:01:02, Serial0 / 0
192.168.1.0/24 is variably subnetted, 7 subnets, 2 masks
C 192.168.1.8/30 is directly connected, FastEthernet0 / 0
C 192.168.1.12/30 is directly connected, Serial0 / 0
O 192.168.1.1/32 [110/11] via 192.168.1.10, 00:01:02, FastEthernet0 / 0
O 192.168.1.3/32 [110/65] via 192.168.1.13,
C 192.168.1.2/32 is directly connected, Loopback0
O 192.168.1.4/32 [110/75] via 192.168.1.13, 00:01:03, Serial0 / 0
O 192.168.1.16/30 [110/74] via 192.168.1.13, 00:01:03, Serial0 / 0


P2 # sh ip route
Gateway of last resort is not set
128.107.0.0/30 is subnetted, 2 subnets
O 128.107.10.0 [110/138] via 192.168.1.14, 00:00:53, Serial0 / 0
O 128.107.10.4 [110/74] via 192.168.1.17, 00:00:53, Ethernet0 / 0
192.168.1.0/24 is variably subnetted, 7 subnets, 2 masks
O 192.168.1.8/30 [110/74] via 192.168.1.14, 00:00:53, Serial0 / 0
C 192.168.1.12/30 is directly connected, Serial0 / 0
O 192.168.1.1/32 [110/75] via 192.168.1.14, 00:00:53, Serial0 / 0
C 192.168.1.3/32 is directly connected, Loopback0
O 192.168.1.2/32 [110/65] via 192.168.1.14, 00:00:54, Serial0 / 0
O 192.168.1.4/32 [110/11] via 192.168.1.17, 00:00:54, Ethernet0 / 0
C 192.168.1.16/30 is directly connected, Ethernet0 / 0

PE2 # sh ip route
Gateway of last resort is not set

S 209.100.164.0/24 [1 / 0] via 128.107.10.6
B 204.134.83.0/24 [200 / 0] via 128.107.10.1, 00:00:38
128.107.0.0/30 is subnetted, 2 subnets
O 128.107.10.0 [110/148] via 192.168.1.18, 00:00:40, Ethernet0 / 0
C 128.107.10.4 is directly connected, Serial0 / 0
192.168.1.0/24 is variably subnetted, 7 subnets, 2 masks
O 192.168.1.8/30 [110/84] via 192.168.1.18, 00:00:40, Ethernet0 / 0
O 192.168.1.12/30 [110/74] via 192.168.1.18, 00:00:40, Ethernet0 / 0
O 192.168.1.1/32 [110/85] via 192.168.1.18, 00:00:41, Ethernet0 / 0
O 192.168.1.3/32 [110/11] via 192.168.1.18, 00:00:41, Ethernet0 / 0
O 192.168.1.2/32 [110/75] via 192.168.1.18, 00:00:41, Ethernet0 / 0
C 192.168.1.4/32 is directly connected, Loopback0
C 192.168.1.16/30 is directly connected, Ethernet0 / 0

CE2 # sh ip route
Gateway of last resort is 128.107.10.5 to network 0.0.0.0

C 209.100.164.0/24 is directly connected, Ethernet0
128.107.0.0/30 is subnetted, 1 subnets
C 128.107.10.4 is directly connected, Serial0
S * 0.0.0.0 / 0 [1 / 0] via 128.107.10.5
Now we check to see how the network works by using extended ping from the router's LAN to LAN Router CE1 CE2:
CE1 # ping
Protocol [ip]:
Target IP address: 209.100.164.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 204.134.8. 3.1
Type of service [0]:
Set DF bit in IP header? [No]:
Validate reply data? [No]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose [none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.100.164.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0 / 5)
Ping is not successful due to the router P1 and P2 are not known to the router's LAN 2 CE1 and CE2. So if we make ping from CE1 to CE2, the P1 packet will be rejected. To solve this problem, we use the MPLS network on the ISP's router.
Step 4:
Configure MPLS on the router. As analyzed above. Because packets from CE1 and CE2 routers need not labeled, so I just configured MPLS on the router's ISP network.Configuration using the tag-switching. Tag-switching depends on the tag distribution protocol (TDP) to exchange packets between the tag switching router (TSR). Cisco routers only understand tag-switching. To configure the tag-switching, Cisco Express Forwarding (CEF) must be turned on as well as tag-switching must be enabled on the interface respectively. We can also configure MPLS rather than tag-switching configuration, MPLS born after tag-switching operation and has a similar configuration as the tag-switching.However, MPLS Label Distribution depends on protocol (LDP) to communicate with the neighboring labels. When configuring MPLS, the commands are more like tag-switching, but only differs in that instead of using the tag-switching ip command is used MPLS ip command.
P1 (config) # ip CEF
P1 (config) # tag-switching advertise-tags
P1 (config) # tag-switching ip
P1 (config) # int f0 / 0
P1 (config-if) # tag-switching ip
P1 (config-if) # int S0 / 0
P1 (config-if) # tag-switching ip
P1 (config-if) # exit
PE1 (config) # ip CEF
PE1 (config) # tag-switching advertise-tags
PE1 (config) # tag-switching ip
PE1 (config) # int E0 / 0
PE1 (config-if) # tag-switching ip
PE1 (config-if) # exit
P2 (config) # ip CEF
P2 (config) # tag-switching advertise-tags
P2 (config) # tag-switching ip
P2 (config) # int E0 / 0
P2 (config-if) # tag-switching ip
P2 (config-if) # int S0 / 0
P2 (config-if) # tag-switching ip
P2 (config-if) # exit

PE2 (config) # ip CEF
PE2 (config) # tag-switching advertise-tags
PE2 (config) # tag-switching ip
PE2 (config) # int E0 / 0
PE2 (config-if) # tag-switching ip
PE2 (config-if) # exit
Step 5: To check if the tag-switching has been turned on yet, use the command show tag-switching interfaces
PE1 # sh tag-switching interfaces
Interface IP Tunnel Operational
Ethernet0 / 0 Yes (TDP) Yes No
P1 # sh tag-switching interfaces
Interface IP Tunnel Operational
Serial0 / 0 Yes (TDP) Yes No
Ethernet0 / 0 Yes (TDP) Yes No
P2 sh # tag-switching interfaces
Interface IP Tunnel Operational
Serial0 / 0 Yes (TDP) Yes No
Ethernet0 / 0 Yes (TDP) Yes No

PE2 # sh tag-switching interfaces
Interface IP Tunnel Operational
Ethernet0 / 0 Yes (TDP) Yes No
Step 6: The best way to check whether or not we operate MPLS do extended ping from LAN to LAN CE1 CE2
CE1 # ping
Protocol [ip]:
Target IP address: 209.100.164.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 204.134.83.1
Type of service [0]:
Set DF bit in IP header? [No]:
Validate reply data? [No]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose [none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 209.100.164.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5 / 5), round-trip min / avg / max = 92/93/96 ms
Ping success was due to the label switching between routers in the network service provider. Can you explain this process as follows:
Step 1: A host 204.134.83.0 network to send data to the host at 209.100.164.0 network. This host that the destination host is in the first frame and move away from its default gateway to CE1.
Step 2: CE1 received frame, ignoring the information layer 2, layer 3 information check to see if the way to the destination network is 209.100.164.0 or not? No route in the routing table to the network (see routing table CE1) so it passes the packet to PE1 router with a static route.
Step 3: Router PE1 to receive test packets and Layer 3 information, it knows a route to the destination network that it learned via BGP from PE2. Next-hop address of the remote network is 192.168.1.4. Router PE1 on the package label and move it to P1:
PE1 # sh tag-switching forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Untagged 204.134.83.0/24 0 Se0 / 0 point2point
17 Pop tag 192.168.1.2/32 0 Et0 / 0 192.168.1.9
18 16 192.168.1.3/32 0 Et0 / 0 192.168.1.9
19 Pop tag 192.168.1.12/30 0 Et0 / 0 192.168.1.9
20 17 192.168.1.16/30 0 Et0 / 0 192.168.1.9
21 20 128.107.10.4/30 0 Et0 / 0 192.168.1.9
22 21 192.168.1.4/32 0 Et0 / 0 192.168.1.9
By observing the output of the table, we can see that packets are sent as a label, or in this case packets are tag. Because the data must be transferred to 192.168.1.4 should observe the above table shows, labeled PE1 router 22 in this package, we observed that the labels on the table output is 21, is output interface E0 / 0 is address is 192.168.1.9, the router is P1. Packet is sent to P1.
Step 4: At P1 router, observe the routing table of P1 P1 shows no route to the destination network. Without the label, the packet will be dropped in here as I have checked.Therefore instead of routing packets, it performs label switching.
P1 # sh tag-switching forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 192.168.1.3/32 0 Se0 / 0 point2point
17 Pop tag 192.168.1.16/30 0 Se0 / 0 point2point
18 Pop tag 128.107.10.0/30 1140 Fa0 / 0 192.168.1.10
19 Pop tag 192.168.1.1/32 1801 Fa0 / 0 192.168.1.10
20 20 128.107.10.4/30 0 Se0 / 0 point2point
21 21 167 192.168.1.4/32 Se0 / 0 point2point
From PE1 router, the packet is labeled as 21, observing the table above shows, the label output is 21, output interface is S0 / 0 is the next-hop router P2. Packets P1 to P2 label switching.
Step 5: P2 at the router, also occurred action like in router P2.
P2 sh # tag-switching forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 192.168.1.8/30 0 Se0 / 0 point2point
17 Pop tag 192.168.1.2/32 0 Se0 / 0 point2point
128.107.10.0/30 18 18 2160 Se0 / 0 point2point
192.168.1.1/32 19 19 2978 Se0 / 0 point2point
Pop tag 128.107.10.4/30 1140 20 Et0 / 0 192.168.1.17
Pop tag 192.168.1.4/32 1447 21 Et0 / 0 192.168.1.17
At P2 router, the packet with label 21, P2 can not process information layer 3, it does remove the label (this action is called pop, for tag-switching is called the tag pop). P2 does not perform routing, it simply moved untagged packets (packets after removing the label) to the router PE2.
Step 6: PE2 router received the packet and check the information layer 3, PE2 know the destination network (the routing table of observations PE2), next-hop address of the destination network is 128.107.10.6. Router PE2 switch the packet to CE2.
PE2 # sh tag-switching forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Untagged 209.100.164.0/24 0 Se0 / 0 point2point
17 16 192.168.1.8/30 0 Et0 / 0 192.168.1.18
18 18 128.107.10.0/30 0 Et0 / 0 192.168.1.18
19 19 192.168.1.1/32 0 Et0 / 0 192.168.1.18
20 17 192.168.1.2/32 0 Et0 / 0 192.168.1.18
21 Pop tag 192.168.1.3/32 0 Et0 / 0 192.168.1.18
22 Pop tag 192.168.1.12/30 0 Et0 / 0 192.168.1.18
Step 7: Router CE2 receive packets, check the information layer 3. It has an interface directly connected to destination network and simply transfer the packet to the destination.To check if the labels are exchanged between neighbor how, using the show tag-switching command TDP discovery (if you use the command MPLS MPLS LDP discovery show.)
PE2 # sh-tag switching TDP discovery
Local TDP Identifier:
192.168.1.4:0
Discovery Sources:
Interfaces:
Ethernet0 / 0 (TDP): xmit / recv
TDP Id: 192.168.1.3:0
If you want more information than the label in a network, use the show tag-switching command bindings TDP (or show MPLS LDP bindings).
PE2 # sh-tag switching TDP bindings
Tib entry: 128.107.10.0/30, rev 53
local binding: tag: 18
remote binding: tsr: 192.168.1.3:0, tag: 18
Tib entry: 128.107.10.4/30, rev 4
local binding: tag: imp-null
remote binding: tsr: 192.168.1.3:0, tag: 20
Tib entry: 192.168.1.1/32, rev 67
local binding: tag: 19
remote binding: tsr: 192.168.1.3:0, tag: 19
Tib entry: 192.168.1.2/32, rev 56
local binding: tag: 20
remote binding: tsr: 192.168.1.3:0, tag: 17
Tib entry: 192.168.1.3/32, rev 57
local binding: tag: 21
remote binding: tsr: 192.168.1.3:0, tag: imp-null
Tib entry: 192.168.1.4/32, rev 6
local binding: tag: imp-null
remote binding: tsr: 192.168.1.3:0, tag: 21
Tib entry: 192.168.1.8/30, rev 52
local binding: tag: 17
remote binding: tsr: 192.168.1.3:0, tag: 16
Tib entry: 192.168.1.12/30, rev 58
local binding: tag: 22
remote binding: tsr: 192.168.1.3:0, tag: imp-null
Tib entry: 192.168.1.16/30, rev 65
local binding: tag: imp-null
remote binding: tsr: 192.168.1.3:0, tag: imp-null
Tib entry: 209.100.164.0/24, rev 2
local binding: tag: 16