Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

LDP Basics

The below network will be used for demonstrating the LDP basics.

OSPF is running, each router has loopback interface that takes it's name e.g. for R1 it is 1.1.1.1 and
so on. No MPLS or LDP has been enabled yet.

we show the below command to show that OSPF is running fine.

R5#show ip route ospf


1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/3] via 192.168.45.1, 00:06:45, GigabitEthernet3/0
[110/3] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/3] via 192.168.45.1, 00:06:45, GigabitEthernet3/0
[110/3] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 192.168.45.1, 00:06:45, GigabitEthernet3/0
192.168.1.0/30 is subnetted, 1 subnets
O 192.168.1.0 [110/3] via 192.168.45.1, 00:06:45, GigabitEthernet3/0
[110/3] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
192.168.2.0/30 is subnetted, 1 subnets
O 192.168.2.0 [110/2] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
192.168.3.0/30 is subnetted, 1 subnets
O 192.168.3.0 [110/2] via 192.168.45.1, 00:06:45, GigabitEthernet3/0
192.168.23.0/30 is subnetted, 1 subnets
O 192.168.23.0 [110/2] via 192.168.25.1, 00:06:35, GigabitEthernet0/0
192.168.34.0/30 is subnetted, 1 subnets
O 192.168.34.0 [110/2] via 192.168.45.1, 00:06:45, GigabitEthernet3/0

As can be seen that nothing related to MPLS is configured.

R5#show mpls interfaces

no MPLS apps enabled or MPLS not enabled on any interfaces

R5#show mpls ldp neighbor

R5#

CONFIGURATION OF LDP
Basic Commands

R1(config)#ip cef % enabling cef


R1(config)#mpls ip % enabling mpls
R1(config)#mpls label protocol ldp % choosing ldp
enabling on interfaces
R1(config)#interface GigabitEthernet0/0
R1(config-if)#mpls ip
R1(config-if)#int GigabitEthernet1/0
R1(config-if)#mpls ip
R1(config-if)#int GigabitEthernet2/0
R1(config-if)#mpls ip
Forcing a certain label range (optional)
R1(config)#mpls label range 100 199
SHOW COMMANDS
R1#show mpls interfaces
Interface IP Tunnel BGP Static Operational
GigabitEthernet0/0 Yes (ldp) No No No Yes
GigabitEthernet1/0 Yes (ldp) No No No Yes
GigabitEthernet2/0 Yes (ldp) No No No Yes

As can be seen that mpls is configured on the interfaces, against the interface we have Yes(ldp)

R1#show mpls ldp discovery


Local LDP Identifier:
1.1.1.1:0 (source of the ldp tcp connection)
Discovery Sources:
Interfaces:
GigabitEthernet0/0 (ldp): xmit (currently just transmitting since no peer yet)
GigabitEthernet1/0 (ldp): xmit
GigabitEthernet2/0 (ldp): xmit

As can be seen that R1 is sending the LDP hello packets (xmit) but has no RX is there is no configured
peer on the other end

R2: Configuration
Same configuration steps as R1

R2#show mpls ldp discovery


Local LDP Identifier:
2.2.2.2:0
Discovery Sources:
Interfaces:
GigabitEthernet0/0 (ldp): xmit (connected peer not active yet)
GigabitEthernet1/0 (ldp): xmit/recv (this IF is both TX/RX since R1 is active, compare
the same command above with R1 and see that there is no recv)
LDP Id: 1.1.1.1:0 (remote LDP id is loopback IP of R1)
GigabitEthernet3/0 (ldp): xmit (connected peer not active yet thus no recv)
Thus, we can see that due to R1-R2 peering, R2 is receiving hello LDP packets from R1. We have both
RX/TX which shows the two-way hello communication, we can also see the loopback address of the
R1, which is the other end of the TCP connection that is needed for the LDP protocol. (R1-----R2; TCP
connection).

FURTHER INVESTIGATION
Further investigation of the R1 and R2

Since the R1 and R2 peering is established, lets dig some more details

Compare the tables for R1 and R2 for show mpls ldp neighbour command. Comments are provided.

COMMENTS
R1#show mpls ldp neighbor from the perspective of R1
Peer LDP Ident: 2.2.2.2:0; Local LDP Ident Peer is R2 (correct), local Identity is own
1.1.1.1:0 loopback address
TCP connection: 2.2.2.2.40508 -
1.1.1.1.646 TCP Connection between FE_NE; IP and Port
State: Oper; Msgs sent/rcvd: 61/60;
Downstream State: Operational, also no of messages
Up time: 00:40:31
LDP discovery sources:
GigabitEthernet1/0, Src IP addr:
192.168.2.2 discovered on far-end with IF and IP
Addresses bound to peer LDP Ident:
192.168.25.1 192.168.2.2
192.168.23.1 2.2.2.2 Interfaces configured on the R2 (Peer)

COMMENTS
R2#show mpls ldp neighbor from the perspective of R2
Peer LDP Ident: 1.1.1.1:0; Local LDP Ident Peer is R1 (correct), local Identity is own
2.2.2.2:0 loopback address
TCP connection: 1.1.1.1.646 -
2.2.2.2.40508 TCP Connection between FE_NE; IP and Port
State: Oper; Msgs sent/rcvd: 105/107;
Downstream State: Operational, also no of messages
Up time: 01:19:48
LDP discovery sources:
GigabitEthernet1/0, Src IP addr:
192.168.2.1 discovered on far-end with IF and IP
Addresses bound to peer LDP Ident:
192.168.1.1 192.168.2.1
192.168.3.1 1.1.1.1 Interfaces configured on the R1 (Peer)
Once the LDP is activated on a Router, then for each route in the route table of that router a label is
assigned. There are two types of local label

- Local Binding
- Remote Binding (labels for the same subnet received by the peer router).
- The below table shows that for each route in the table R1, it assigned a label in addition it
also received a label for these subnets from R2 (since currently there is only 1 peer r2)

ROUTING TABLE R1#show mpls ldp bind


C 1.1.1.1 is directly connected, Loopback0 lib entry: 1.1.1.1/32, rev 2
local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0,
label: 200
O 2.2.2.2 [110/2] via 192.168.2.2, 01:30:19,
GigabitEthernet1/0 lib entry: 2.2.2.2/32, rev 4
local binding: label: 16
remote binding: lsr: 2.2.2.2:0,
label: imp-null
O 3.3.3.3 [110/2] via 192.168.1.2, 01:24:25,
GigabitEthernet0/0 lib entry: 3.3.3.3/32, rev 6
local binding: label: 17
remote binding: lsr: 2.2.2.2:0,
label: 201
O 4.4.4.4 [110/2] via 192.168.3.2, 01:15:52,
GigabitEthernet2/0 lib entry: 4.4.4.4/32, rev 8
local binding: label: 18
O 5.5.5.5 [110/3] via 192.168.3.2, 01:11:46, remote binding: lsr: 2.2.2.2:0,
GigabitEthernet2/0 label: 202
[110/3] via 192.168.2.2, 01:11:36,
GigabitEthernet1/0 lib entry: 5.5.5.5/32, rev 10
local binding: label: 19
remote binding: lsr: 2.2.2.2:0,
label: 203
C 192.168.1.0/30 is directly connected,
GigabitEthernet0/0 lib entry: 192.168.1.0/30, rev 12
L 192.168.1.1/32 is directly connected,
GigabitEthernet0/0 local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0,
label: 204
C 192.168.2.0/30 is directly connected,
GigabitEthernet1/0 lib entry: 192.168.2.0/30, rev 14
L 192.168.2.1/32 is directly connected,
GigabitEthernet1/0 local binding: label: imp-null
192.168.3.0/24 is variably subnetted, 2 subnets, remote binding: lsr: 2.2.2.2:0,
2 masks label: imp-null
C 192.168.3.0/30 is directly connected,
GigabitEthernet2/0 lib entry: 192.168.3.0/30, rev 16
L 192.168.3.1/32 is directly connected,
GigabitEthernet2/0 local binding: label: imp-null
remote binding: lsr: 2.2.2.2:0,
192.168.23.0/30 is subnetted, 1 subnets label: 205
O 192.168.23.0 [110/2] via 192.168.2.2,
01:30:36, GigabitEthernet1/0 lib entry: 192.168.23.0/30, rev 18
[110/2] via 192.168.1.2, 01:24:25,
GigabitEthernet0/0 local binding: label: 20
remote binding: lsr: 2.2.2.2:0,
192.168.25.0/30 is subnetted, 1 subnets label: imp-null
O 192.168.25.0 [110/2] via 192.168.2.2,
01:30:36, GigabitEthernet1/0 lib entry: 192.168.25.0/30, rev 20
192.168.34.0/30 is subnetted, 1 subnets local binding: label: 21
O 192.168.34.0 [110/2] via 192.168.3.2, remote binding: lsr: 2.2.2.2:0,
01:15:52, GigabitEthernet2/0 label: imp-null
[110/2] via 192.168.1.2, 01:24:25,
GigabitEthernet0/0 lib entry: 192.168.34.0/30, rev 22
192.168.45.0/30 is subnetted, 1 subnets local binding: label: 22
O 192.168.45.0 [110/2] via 192.168.3.2, remote binding: lsr: 2.2.2.2:0,
01:15:52, GigabitEthernet2/0 label: 206
lib entry: 192.168.45.0/30, rev 24
local binding: label: 23
remote binding: lsr: 2.2.2.2:0,
label: 207

You might also like