# Tunneling LDP inside RSVP

Load **mpls.te.ldp.tunneling.init.cfg**

```
#IOS-XE
config replace flash:mpls.te.ldp.tunneling.init.cfg

#IOS-XR
configure
load bootflash:mpls.te.ldp.tunneling.init.cfg
commit replace
y
```

The basic IP addresses, L3VPN between XRv14 and XRv13, ISIS, RSVP, and MPLS-TE has been pre-configured.

There is currently a TE tunnel between CSR9 and CSR10 that goes via CSR2. This is bidirectional. CSR8 and XRv11 have been modified via ISIS metric to use CSR9 and CSR10 as the bestpath to CSR8/XRv11.

Make the necessary configuration changes so that XRv14 and XRv13 can ping each other in their L3VPN. Do not add any additional TE tunnels.

## Answer <a href="#a9b18bd0-feaa-48fb-a221-4f4264a95286" id="a9b18bd0-feaa-48fb-a221-4f4264a95286"></a>

First we must enable LDP between CSR8↔CSR9 and CSR10↔XRv11:

```
#CSR8, CSR9
int gi2.589
 mpls ip

#CSR10
int gi2.501
 mpls ip

#XRv11
mpls ldp
 interface GigabitEthernet0/0/0/0.501
```

You may think we have an end-to-end LSP between CSR8 and XRv11 at this point, however the L3VPN traffic is not working. Here’s what happens:

* CSR8 pushes a label stack of { < CSR9’s label for XRv11> < VPN label> }
* CSR9 pops the top label and pushes the TE label: { < TE label to CSR10 > < VPN label > }
* CSR2 pops the top label and delivers to CSR10 with just { \<VPN label> }
* CSR10 drops the traffic

To solve this, we must run LDP within the TE tunnel, between CSR9 and CSR10. Then CSR9 will need to push two labels: the TE tunnel label and the LDP label for XRv11 learned from CSR10. Both functions are enabled simply by enabling LDP on the tunnel interface.

```
#CSR9, CSR10
int tun0
 mpls ip
```

An LDP adjacency between CSR9 and CSR10 will come up. This is a targetted session. LDP is not actually running over the tunnel. Instead think of this as enabling LDP functionality on the tunnel. A targetted session is established, and the router will push the TE tunnel endpoint’s LDP label onto traffic forwarded down the tunnel.

Now the label stack outgoing from CSR9 looks like this: { \<TE label> \<CSR10’s LDP label for XRv11> \<VPN label> }

Traffic between XRv13 and XRv14 is working:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FwSOL6s6J8xXRoF1UNV0Z%2Fimage.png?alt=media&#x26;token=1123dcfe-d635-4983-a3c6-65b9bd5198f7" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FynshXWqNi0w5PoFE7yXt%2Fimage.png?alt=media&#x26;token=e6167195-0279-4473-b506-114b1ed8c2ac" alt=""><figcaption></figcaption></figure></div>

The **mpls ip** command on a TE tunnel instructs the router to form a targetted LDP session with the tunnel destination, and to push the tunnel destination’s LDP label as a second label when forwarding traffic through the RSVP tunnel. (The top label is the RSVP label learned from the downstream RSVP peer as usual).

## Conclusion <a href="#id-11fa9dfe-9e54-405a-82e3-8e356e016ad4" id="id-11fa9dfe-9e54-405a-82e3-8e356e016ad4"></a>

TE tunnels might be isolated to only the core between P routers. This could be done to provide FRR within the core, and help with scalability, because now you are not forming a full mesh of tunnels between all PE routers. However, you need to tunnel LDP within the TE tunnels so that the label is not prematurely popped, exposing the VPN label too early, which blackholes traffic.

## Further Reading <a href="#id-380da2e6-e0b7-49b7-ab18-81236cb6540a" id="id-380da2e6-e0b7-49b7-ab18-81236cb6540a"></a>

<https://www.cisco.com/c/en/us/support/docs/multiprotocol-label-switching-mpls/mpls/29828-mplsvpnte.html>
