Wednesday 13 March 2013

MPLS: Can we configure LDP and TDP in the same router?


MPLS: Can we configure LDP and TDP in the same router?

 

·         In MPLS, can we configure LDP and TDP in the same router, the answer is YES!

 

·         For the latest IOS releases, LDP is the default label distribution protocol.

·         If we want to change the protocol, we can change it by using the following command: mpls label protocol ldp or mpls label protocol tdp

·         This label distribution protocol always local to the interface; we can use LDP for one interface and TDP for another interface.

 

Let me take a small topology to configure this one:

 

R2---Ser1/1-----------------Ser1/1---R1---Ser1/0---------------Ser1/0---R3

 

 

R1#show run int ser1/1

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/1

 ip address 10.1.12.1 255.255.255.0

 mpls label protocol ldp

 mpls ip

 serial restart-delay 0

end

 

R1#show run int ser1/0

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/0

 ip address 10.1.13.1 255.255.255.0

 mpls label protocol tdp

 mpls ip

 serial restart-delay 0

end

 

R1#show run int loop0

Building configuration...

 

Current configuration : 63 bytes

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

end

 

R1#show run | sec router ospf

router ospf 1

 router-id 1.1.1.1

 log-adjacency-changes

 network 1.1.1.1 0.0.0.0 area 0

 network 10.1.12.1 0.0.0.0 area 0

 network 10.1.13.1 0.0.0.0 area 0

R1#

 

 

R2#show run int ser1/1

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/1

 ip address 10.1.12.2 255.255.255.0

 mpls label protocol ldp

 mpls ip

 serial restart-delay 0

end

 

R2#show run int loop0

Building configuration...

 

Current configuration : 63 bytes

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

end

 

R2#show run | s r o

router ospf 1

 router-id 2.2.2.2

 log-adjacency-changes

 network 2.2.2.2 0.0.0.0 area 0

 network 10.1.12.2 0.0.0.0 area 0

R2#

 

R3#show run int ser1/0

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/0

 ip address 10.1.13.3 255.255.255.0

 mpls label protocol tdp

 mpls ip

 serial restart-delay 0

end

 

R3#show run int loop0

Building configuration...

 

Current configuration : 63 bytes

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.255

end

 

R3#show run | s r o

router ospf 1

 router-id 3.3.3.3

 log-adjacency-changes

 network 3.3.3.3 0.0.0.0 area 0

 network 10.1.13.3 0.0.0.0 area 0

R3#

 

R1(config-router)#int ser1/0

R1(config-if)#mpls label protocol tdp

R1(config-if)#mpls ip

R1(config-if)#

*Mar 13 11:08:05.339: %LDP-5-NBRCHG: TDP Neighbor 3.3.3.3:0 (1) is UP

 

R3(config-router)#int ser1/0

R3(config-if)#mpls label protocol tdp

R3(config-if)#mpls ip

R3(config-if)#

*Mar 13 11:08:06.143: %LDP-5-NBRCHG: TDP Neighbor 1.1.1.1:0 (1) is UP

R3(config-if)#

 

 

R1(config-if)#int ser1/1

R1(config-if)#mpls label protocol ldp

R1(config-if)#mpls ip

R1(config-if)#

*Mar 13 11:08:34.655: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (2) is UP

R1(config-if)#

 

 

R2(config-router)#int ser1/1

R2(config-if)#mpls label protocol ldp

R2(config-if)#mpls ip

R2(config-if)#

*Mar 13 11:08:34.815: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:0 (1) is UP

R2(config-if)#

 

 

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.27550

        State: Oper; Msgs sent/rcvd: 37/37; Downstream

        Up time: 00:25:39

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.1

        Addresses bound to peer LDP Ident:

          10.1.13.1       10.1.12.1       1.1.1.1

R2#

 

R1#show mpls ldp neighbor

    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0

        TCP connection: 2.2.2.2.27550 - 1.1.1.1.646

        State: Oper; Msgs sent/rcvd: 38/38; Downstream

        Up time: 00:26:43

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.2

        Addresses bound to peer LDP Ident:

          10.1.12.2       2.2.2.2

    Peer TDP Ident: 3.3.3.3:0; Local TDP Ident 1.1.1.1:0

        TCP connection: 3.3.3.3.31470 - 1.1.1.1.711

        State: Oper; PIEs sent/rcvd: 0/5; Downstream

        Up time: 00:01:39

        TDP discovery sources:

          Serial1/0, Src IP addr: 10.1.13.3

        Addresses bound to peer TDP Ident:

          10.1.13.3       3.3.3.3

R1#

 

R3#show mpls ldp neighbor

    Peer TDP Ident: 1.1.1.1:0; Local TDP Ident 3.3.3.3:0

        TCP connection: 1.1.1.1.711 - 3.3.3.3.31470

        State: Oper; PIEs sent/rcvd: 0/6; Downstream

        Up time: 00:02:28

        TDP discovery sources:

          Serial1/0, Src IP addr: 10.1.13.1

        Addresses bound to peer TDP Ident:

          10.1.13.1       10.1.12.1       1.1.1.1

R3#

 

Observation:

·         LDP is configured between R1 and R2, Ser1/1

·         TDP is configured between R1 and R3, Ser1/0

MPLS: LDP and TDP


MPLS: LDP and TDP

 

·         I often see people getting confused between LDP and TDP.

 

·         In simple terms, both do the same thing, i.e. distributing labels

·         But, TDP is Cisco proprietary and LDP is industry standard.

 

·         TDP:

o    Uses UDP broadcast on port 711 to discover the neighbors.

o    Once the neighbor is discovered, it brings up TCP connection on port 711

 

·         LDP:

o    Uses UDP multicast to 224.0.0.2 (AllRouters) on port 646 to discover the neighbors.

o    Once the neighbor is discovered, it brings up TCP connection on port 646

 

·         One main difference is Router-ID reachability.

 

OSPF Router-ID:

  • Router-ID simply means the name of this router in the OSPF domain.
  • Before an OSPF router can send any OSPF messages, it must choose a unique 32-bit identifier called the router identifier.
  • Cisco routers choose the following sequence to choose their Router-ID.

1. If you configure Router-ID manually, it will be the Router-ID

2. If the router-ID is not configured manually and the loopback interface exists, highest active Loopback address will be the Router-ID

3. If Loopback interface doesn’t exists, then the highest active physical interface address.

 

Some important points to be noted about Router ID:

  • The Cisco OSPF will continue to use a RID learned from a physical interface even if the interface subsequently fails or deleted.
  • The RID does not have to reachable
  • The interface from which the RID is taken does not have to be matched by an OSPF network command
  • Routers consider changing the OSPF RID when the OSPF process is restarted or when the RID changed via the configuration.
  • If a RID changes, the rest of the routers in the same area need to perform a new SPF calculation.
  • If the RID is configured via Router-id command and the command remains unchanged, RID will never change for that router.

BGP Router-ID:

·         Router-ID selection is same as in OSPF

·         When BGP sources its connection, it will always source from the outgoing interface address; hence update-source command is needed when we are sourcing from other than the outgoing interface.

 

LDP or TDP Router-ID:

·         Router-ID selection is same as in OSPF

·         But, when LDP or TDP initiates its connection, it is sourced from the Router-ID.

·         That means Router-ID must be reachable

·         That means, IGP must have been completed before enabling LDP or TDP.

·         If you want to change the sourcing address to outgoing interface, you could use “mpls ldp discovery transport-address interface”

 

 

 

·         Let me take a small topology to try out this:

 

R1----Ser1/1--------------Ser1/1-----R2

 

R1#show run int ser1/1

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/0

 ip address 10.1.12.1 255.255.255.0

  serial restart-delay 0

end

 

R1#show run int loop0

Building configuration...

 

Current configuration : 63 bytes

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

end

 

R1#

 

 

R2#show run int ser1/1

Building configuration...

 

Current configuration : 121 bytes

!

interface Serial1/1

 ip address 10.1.12.2 255.255.255.0

serial restart-delay 0

end

 

R2#show run int loop0

Building configuration...

 

Current configuration : 63 bytes

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

end

 

R2#

 

R1(config-if)#do ping 10.1.12.2

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.1.12.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 4/18/44 ms

R1(config-if)#

 

R2(config-if)#do ping 10.1.12.1

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.1.12.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 4/28/92 ms

R2(config-if)#

R2(config-if)#do ping 1.1.1.1

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

R2(config-if)#

 

R1(config-if)#do ping 2.2.2.2

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

R1(config-if)#

 

Observation:

·         Ser1/1 is up and running between R1 and R2

·         No IGP is configured between R1 and R2, hence they cannot reach other’s loopback.

 

·         Now, let me configure MPLS and see what happens:

 

R2(config)#int ser1/1

R2(config-if)#mpls ip

R2(config-if)#

 

R1(config)#int ser1/1

R1(config-if)#mpls ip

R1(config-if)#

 

R1#show mpls ldp neighbor

 

R1#

 

R2#show mpls ldp neighbor

 

R2#

 

Observation:

·         LDP still didn’t come upL

·         Let’s enable some debugs and see

 

R1#debug mpls ldp transport events

LDP transport events debugging is on  for routing table default

R1#

*Mar 13 12:02:41.623: ldp: Rcvd ldp hello; Serial1/1, from 10.1.12.2 (2.2.2.2:0), intf_id 0, opt 0xC

*Mar 13 12:02:41.627: ldp: ldp Hello from 10.1.12.2 (2.2.2.2:0) to 224.0.0.2, opt 0xC

*Mar 13 12:02:41.631: ldp: local idb = Serial1/1, holdtime = 15000, peer 10.1.12.2 holdtime = 15000

*Mar 13 12:02:41.631: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial1/1

R1#

*Mar 13 12:02:45.779: ldp: Send ldp hello; Serial1/1, src/dst 10.1.12.1/224.0.0.2, inst_id 0

*Mar 13 12:02:46.327: ldp: Rcvd ldp hello; Serial1/1, from 10.1.12.2 (2.2.2.2:0), intf_id 0, opt 0xC

*Mar 13 12:02:46.331: ldp: ldp Hello from 10.1.12.2 (2.2.2.2:0) to 224.0.0.2, opt 0xC

*Mar 13 12:02:46.331: ldp: local idb = Serial1/1, holdtime = 15000, peer 10.1.12.2 holdtime = 15000

*Mar 13 12:02:46.331: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial1/1

R1#

*Mar 13 12:02:50.099: ldp: Rcvd ldp hello; Serial1/1, from 10.1.12.2 (2.2.2.2:0), intf_id 0, opt 0xC

*Mar 13 12:02:50.103: ldp: ldp Hello from 10.1.12.2 (2.2.2.2:0) to 224.0.0.2, opt 0xC

*Mar 13 12:02:50.103: ldp: local idb = Serial1/1, holdtime = 15000, peer 10.1.12.2 holdtime = 15000

*Mar 13 12:02:50.103: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial1/1

*Mar 13 12:02:50.703: ldp: Send ldp hello; Serial1/1, src/dst 10.1.12.1/224.0.0.2, inst_id 0

R1#

 

*Mar 13 12:02:53.987: ldp: Rcvd ldp hello; Serial1/1, from 10.1.12.2 (2.2.2.2:0), intf_id 0, opt 0xC

*Mar 13 12:02:53.991: ldp: ldp Hello from 10.1.12.2 (2.2.2.2:0) to 224.0.0.2, opt 0xC

*Mar 13 12:02:53.995: ldp: local idb = Serial1/1, holdtime = 15000, peer 10.1.12.2 holdtime = 15000

*Mar 13 12:02:53.995: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial1/1

*Mar 13 12:02:54.899: ldp: Send ldp hello; Serial1/1, src/dst 10.1.12.1/224.0.0.2, inst_id 0

*Mar 13 12:02:55.423: ldp: No route to peer 2.2.2.2; set LDP_CTX_HANDLE_ROUTEUP

 

R1#u all

All possible debugging has been turned off

R1#

 

 

 

R2#debug mpls ldp transport events

LDP transport events debugging is on  for routing table default

R2#

*Mar 13 12:02:10.411: ldp: Rcvd ldp hello; Serial1/1, from 10.1.12.1 (1.1.1.1:0), intf_id 0, o                    pt 0xC

*Mar 13 12:02:10.415: ldp: ldp Hello from 10.1.12.1 (1.1.1.1:0) to 224.0.0.2, opt 0xC

*Mar 13 12:02:10.419: ldp: local idb = Serial1/1, holdtime = 15000, peer 10.1.12.1 holdtime =                     15000

*Mar 13 12:02:10.419: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial1/1

*Mar 13 12:02:10.419: ldp: Opening ldp conn; adj 0x659D58CC, 2.2.2.2 <-> 1.1.1.1; with normal                     priority

*Mar 13 12:02:10.423: ldp: No MD5 password protection for peer 1.1.1.1:0

*Mar 13 12:02:10.423: ldp: No route to peer 1.1.1.1; set LDP_CTX_HANDLE_ROUTEUP

R2#

 

Observations:

·         Loopback0 is elected as Router-ID and the TCP connection is sourced from the Router-ID.

·         Since the router-ID is not reachable, LDP session didn’t come up

 

·         Now, let’s change the source address to interface address:

 

 

 

R1(config)#int ser1/1

R1(config-if)#mpls ldp discovery transport-address interface

R1(config-if)#

*Mar 13 12:10:58.947: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (1) is UP

R1(config-if)#

 

 

R2(config)#int ser1/1

R2(config-if)#mpls ldp discovery transport-address interface

R2(config-if)#

*Mar 13 12:10:59.175: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:0 (1) is UP

R2(config-if)#

 

R1#show mpls ldp neighbor

    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0

        TCP connection: 10.1.12.2.19313 - 10.1.12.1.646

        State: Oper; Msgs sent/rcvd: 13/12; Downstream

        Up time: 00:06:19

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.2

        Addresses bound to peer LDP Ident:

          10.1.12.2       2.2.2.2

R1#

 

R2#show mpls ldp neighbor

    Peer LDP Ident: 1.1.1.1:0; Local LDP Ident 2.2.2.2:0

        TCP connection: 10.1.12.1.646 - 10.1.12.2.19313

        State: Oper; Msgs sent/rcvd: 13/14; Downstream

        Up time: 00:07:04

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.1

        Addresses bound to peer LDP Ident:

          10.1.13.1       10.1.12.1       1.1.1.1

R2#

 

Observation:

·         LDP session is UP nowJ

·         Router-ID is still Loopback0

·         TCP connection is sourced using the interface address

 

·         Instead of changing the sourcing address, we can simply advertise Loopback in the IGPJ

 

R1(config)#int ser1/1

R1(config-if)#no mpls ldp discovery transport-address interface

R1(config-if)#

*Mar 13 12:25:51.959: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (1) is DOWN (Discovery Hello Hold Timer expired)

R1(config-if)#router ospf 1

R1(config-router)#network 1.1.1.1 0.0.0.0 area 0

R1(config-router)#network 10.1.12.1 0.0.0.0 area 0

R1(config-router)#

*Mar 13 12:26:38.003: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial1/1 from LOADING to FULL, Loading Done

R1(config-router)#

*Mar 13 12:26:47.463: %LDP-5-NBRCHG: LDP Neighbor 2.2.2.2:0 (1) is UP

R1(config-router)#

 

 

R2(config)#int ser1/1

R2(config-if)#no mpls ldp discovery transport-address interface

R2(config-if)#

*Mar 13 12:25:52.259: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:0 (1) is DOWN (Received error notification from peer: Holddown time expired)

R2(config-if)#router ospf 1

R2(config-router)#network 2.2.2.2 0.0.0.0 area 0

R2(config-router)#network 10.1.12.2 0.0.0.0 area 0

R2(config-router)#

*Mar 13 12:26:38.323: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial1/1 from LOADING to FULL, Loading Done

R2(config-router)#

*Mar 13 12:26:47.707: %LDP-5-NBRCHG: LDP Neighbor 1.1.1.1:0 (1) is UP

R2(config-router)#

 

 

R1#show mpls ldp neighbor

    Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 1.1.1.1:0

        TCP connection: 2.2.2.2.27550 - 1.1.1.1.646

        State: Oper; Msgs sent/rcvd: 9/8; Downstream

        Up time: 00:02:14

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.2

        Addresses bound to peer LDP Ident:

          10.1.12.2       2.2.2.2

R1#

 

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.27550

        State: Oper; Msgs sent/rcvd: 9/9; Downstream

        Up time: 00:02:35

        LDP discovery sources:

          Serial1/1, Src IP addr: 10.1.12.1

        Addresses bound to peer LDP Ident:

          10.1.13.1       10.1.12.1       1.1.1.1

R2#

 

Observation:

·         LDP session is UP nowJ

·         It is sourced from the Router-ID