This post is still part of my learning journey towards my CCIE Routing and Switching…I will be going through a basic configurations of MPLS and dig deeper into how MPLS labels were switched between routers…MPLS is using LDP or Label Distribution Protocol which used a label to switched packets across Label Edge Routers and Label Switch Routers…..
So what are the components of a MPLS?
CE: Customer Edge Router
PE: Provider Edge Router also known as LER or Label Edge Router
P: Label Switch Routers (LSR) or Transit Router..
Moreover, there are three actions that happens as labels are switched between the PE to P routers:
Label Push: This means that labels are being added to a prefix
Label Swap: This means that labels were swap or replace with another labels as it passes from PE to
P
Label Pop: This means that the label are being remove. This happens before the PE router on the
destinations side.
I will be using the diagram below to show how MPLS works:
CE1 Configurations:
|
CE1#sh run | sec bgp
router bgp 1000 bgp log-neighbor-changes network 1.1.1.0 mask 255.255.255.0 neighbor 172.16.12.2 remote-as 65512 |
CE2 Configurations:
|
CE2#sh run | sec bgp
router bgp 5000 bgp log-neighbor-changes network 5.5.5.0 mask 255.255.255.0 neighbor 172.16.45.4 remote-as 65512 |
PE1 Configurations
|
PE1#sh run | sec ospf
router ospf 1 network 2.2.2.2 0.0.0.0 area 0 network 172.16.23.0 0.0.0.255 area 0 PE1#sh run | sec bgp
router bgp 65512 bgp log-neighbor-changes neighbor 4.4.4.4 remote-as 65512 neighbor 4.4.4.4 update-source Loopback2 neighbor 4.4.4.4 next-hop-self neighbor 172.16.12.1 remote-as 1000 |
ISP or Provider Router Configuration
|
ISP#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 |
PE2 Configurations:
| PE2#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 PE2#sh run | sec bgp |
So here’s the BGP Status of each of the routers…
CE1#sh ip bgp summary
!
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.12.2 4 65512 81 78 3 0 0 01:06:58 1
CE1#
PE1#show ip bgp summary
!
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
4.4.4.4 4 65512 129 124 9 0 0 01:48:25 1
172.16.12.1 4 1000 78 82 9 0 0 01:10:36 1
PE1#
So for ISP, I never set up BGP on this router but rather, it’s running an IGP between PE1 and PE2..
ISP#show ip bgp summary
% BGP not active
PE2#show ip bgp summary
!
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 65512 126 130 9 0 0 01:49:34 1
172.16.45.5 4 5000 80 82 9 0 0 01:11:32 1
PE2#
CE2#sh ip bgp summary
!
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.45.4 4 65512 73 71 3 0 0 01:00:19 1
Now, let me show how to enable Label Distribution Protocol on the PE1, ISP or P and PE2 router…
|
PE1#sh run int s2/1
Building configuration… Current configuration : 98 bytes ISP#sh run int s2/1 Building configuration… Current configuration : 89 bytes mpls ip
serial restart-delay 0 end ISP#sh run int s2/2 Current configuration : 98 bytes PE2#sh run int s2/2
Building configuration… Current configuration : 98 bytes |
So the moment that I have enabled the Label Distribution Protocol using the command “mpls ip”
under the interface between PE1 to P/ISP to PE2.., the LDP neighbors were formed…
|
PE1#
*Oct 18 00:34:54.114: %LDP-5-NBRCHG: LDP Neighbor 3.3.3.3:0 (1) is UP ISP#
*Oct 18 00:35:53.846: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (2) is UP ISP(config-if)#
*Oct 18 00:15:40.854: %LDP-5-NBRCHG: LDP Neighbor 4.4.4.4:0 (1) is UP PE2(config-if)# *Oct 18 00:13:42.166: %LDP-5-NBRCHG: LDP Neighbor 3.3.3.3:0 (1) is UP |
As we can see from my configs, I have advertised 1.1.1.1/24 in CE1 and 5.5.5.5/24 in CE2…This is
something we can check on the PE1, P and PE2…
Ping from CE1 to CE2 loopback and vice-versa is working fine…
|
CE1#ping 5.5.5.5 source 1.1.1.1
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 5.5.5.5, 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 = 72/78/84 ms CE1# CE2#ping 1.1.1.1 source 5.5.5.5
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: Packet sent with a source address of 5.5.5.5 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 112/136/152 ms CE2# |
Now, let’s check how the traffic from R1 reached R5..
From CE1 BGP database, in order to reach 5.5.5.5, it has to go through PE1..
|
CE1#show ip bgp
BGP table version is 3, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i – internal, r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, x best-external, a additional-path, c RIB-compressed, Origin codes: i – IGP, e – EGP, ? – incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path CE1#show ip route bgp
Codes: L – local, C – connected, S – static, R – RIP, M – mobile, B – BGP D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2 E1 – OSPF external type 1, E2 – OSPF external type 2 i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2 ia – IS-IS inter area, * – candidate default, U – per-user static route o – ODR, P – periodic downloaded static route, H – NHRP, l – LISP + – replicated route, % – next hop override Gateway of last resort is not set 5.0.0.0/24 is subnetted, 1 subnets |
Now, let’s check PE1 …As observed, in order to reach 5.5.5.5, it has to go through with PE2…
|
PE1#show ip route 5.5.5.5
Routing entry for 5.5.5.0/24 Known via “bgp 65512“, distance 200, metric 0 Tag 5000, type internal Last update from 4.4.4.4 00:13:17 ago Routing Descriptor Blocks: * 4.4.4.4, from 4.4.4.4, 00:13:17 ago Route metric is 0, traffic share count is 1 AS Hops 1 Route tag 5000 MPLS label: none |
But since I have enabled LDP, let’s check the MPLS forwarding table instead on PE1 ( This is
analogous to BGP database table) with the command “show mpls forwarding-table”
|
PE1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or Tunnel Id Switched interface 16 No Label 3.3.3.3/32 0 Se2/1 point2point 17 17 4.4.4.4/32 0 Se2/1 point2point 18 Pop Label 172.16.34.0/24 0 Se2/1 point2point PE1# |
|
So what can we see from the output of the MPLS forwarding table above…
1. LDP have assigned a Local Label and Outgoing Label to a Prefix or Tunnel ID…
2. The Label always start with a value of 16…
3. It does shows a Pop Label is having the Prefix 172.16.34.0/24…as we know this is the prefix for the
link between P router (ISP) and the PE2..
4. We can see the Outgoing Label which is “Pop Label”… This means that PE1 will removed the label
before passing the traffic to CE1…
IMPORTANT: There’s a concept known as PHP or Penultimate Hop Popping in which the label
were removed (POP) before passing the traffic to the destination PE so avoid lookups
of Label on the that router..
|
There are three types of packet switching in which by default Cisco routers are using IP CEF. This
is used by LDP to switched packets. The other two types include process switching and route
caching or fast forwarding.
Now, let me check the specific CEF table towards the destination loopback of R5 using the
command “show ip cef”
PE1#show ip cef 5.5.5.5
5.5.5.0/24
nexthop 172.16.23.3 Serial2/1 label 17
PE1#
So what does the output of “show ip cef 5.5.5.5” on PE1 indicates…
But what does P or ISP router or Transit router is telling us? So it shows below that there is no route towards 5.5.5.5..This is true because, I never set up IBGP between ISP and PE1 and PE2…
ISP#show ip cef 5.5.5.5
0.0.0.0/0
no route
IMPORTANT: Take note that labels are only local to the Router…When it pass the label to the next router, it will be change (LABEL SWAP) by the router and stores it in its LDP table…The Label might be the same number though as the labels by default always starts with 16 and increments by 1…
Now, let me check the P or ISP router Forwarding Table ( LDP Table):
ISP#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 9236 Se2/1 point2point
17 No Label 4.4.4.4/32 7276 Se2/2 point2point
So here is what happens:
1. When ISP received a label tag with 17, then it has to forward that to 4.4.4.4 (PE2)..
2. Similarly, when it received a label with tag of 16, it has to forward to 2.2.2.2 (PE1)..
As expected, there should no CEF table for 5.5.5.5 from the P router..
ISP#show ip cef 5.5.5.5
0.0.0.0/0
no route
Now, let’s take a look on the LDP forwarding table of PE2..
PE2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 16 2.2.2.2/32 0 Se2/2 point2point
17 No Label 3.3.3.3/32 0 Se2/2 point2point
18 Pop Label 172.16.23.0/24 0 Se2/2 point2point
As observed, the Outgoing Label Tag as Pop Label for the prefix 172.16.23.0/24…
By this time, let’s check the CEF table on PE2..
PE2#show ip cef 5.5.5.5
5.5.5.0/24
nexthop 172.16.45.5 Serial2/0
PE2#
>>> So the above results is showing that the label were already removed. As we have seen on the previous configurations of the LDP, it’s only enabled on Serial 2/2 of the PE2 but not on the interface facing CE2…
On the other hand, the IP CEF results towards 1.1.1.1 shows that it’s label has a value of 16 and the next hop is the P or ISP router..
PE2#show ip cef 1.1.1.1
1.1.1.0/24
nexthop 172.16.34.3 Serial2/2 label 16
Finally, we can check from PE2 that 5.5.5.5 is advertise via BGP…
PE2#show ip route bgp
!
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [200/0] via 2.2.2.2, 01:47:46
5.0.0.0/24 is subnetted, 1 subnets
B 5.5.5.0 [20/0] via 172.16.45.5, 01:47:49
In summary, here are the important terms/configurations to set up MPLS:
A. MPLS device components:
– CE Router
– PE Router or Label Edge Router (LER)
– P or ISP router also known as Label Switch Router (LSR) or Transit router…
B. Label switching happens with three important steps:
– Label Push
– Label Swap
– Label Pop
C. LDP or Label Distribution Protocol is the industry standard to enable MPLS…Cisco’s
proprietary protocol which performs the same functionality is called TDP or Tag Distribution
Protocol..
Now, in order to enable LDP neighbors, we can used the following two commands:
1. On all participating interface to established LDP neighbors, we can configured
mpls ip
2. Alternative options is to enable LDP is to apply ” mpls ldp autoconfig “ under any IGP routing
protocol such as OSPF..
D. To verify the LDP Table or MPLS Forwarding table, we can used the command:
show mpls forwarding-table
E. To verify specific label on a destination address, we can used the command below:
show ip cef “x.x.x.x”
**************************END OF LAB***************************************

Leave a comment