# Profile 1 w/ Redundant Roots

Load **basic.startup.config.with.cpim.cfg**

```
#IOS-XE
config replace flash:basic.startup.config.with.cpim.cfg
Y

#IOS-XR
configure
load bootflash:basic.startup.config.with.cpim.cfg
commit replace
y
```



The basic IP addresses, L3VPN, and C-PIM between the PEs and CEs is pre-configured.

* Configure multicast VPN using MP2MP mLDP in the core.
* You cannot use PIM in the core.
* C3 should be able to ping 239.1.2.3, with C2 responding.
* CE1 is configured as the RP using BSR.
* PEs should form C-PIM adjacencies directly between themselves.
* Use root rundancy by configuring PEs to use either P1 or P2 as the root (whichever is closer) and failover to the other root upon failure of the primary root.



See answer below (scroll down).





























## Answer <a href="#f8b11738-db49-4bb5-a4bf-26c8a1231c75" id="f8b11738-db49-4bb5-a4bf-26c8a1231c75"></a>

```
#P1, P2
mpls ldp mldp add ipv4 enable

#PE1, PE2
vrf definition CUSTOMER
 vpn id 100:1
 !
 address-family ipv4
  mdt default mpls mldp 10.10.10.10
  mdt default mpls mldp 20.20.20.20

#PE3
vrf CUSTOMER
 vpn id 100:1
!
multicast-routing
 address-family ipv4
  interface Loopback0
   enable
  !
 !
 vrf CUSTOMER
  address-family ipv4
   mdt source Loopback0
   mdt default mldp ipv4 10.10.10.10
   mdt default mldp ipv4 20.20.20.20
!
route-policy USE_MLDP
  set core-tree mldp-default
end-policy
!
router pim
 vrf CUSTOMER
  address-family ipv4
   rpf topology route-policy USE_MLDP
```



## Explanation <a href="#id-1ee1cb53-58e6-4874-a5a2-5bf0f84c63bc" id="id-1ee1cb53-58e6-4874-a5a2-5bf0f84c63bc"></a>

In the previous lab, we statically configured P2 as the root for the default MDT, which uses a MP2MP tree. Just like with PIM-BiDir, the root of a MP2MP tree plays an important role. If P2 fails, the default MDT will be broken, C-PIM adjacencies will time out, and the customer’s Multicast L3VPN will be broken.



To provide redundancy we have two options:

1. Configure multiple core routers with the same Anycast IP, but use a longer match on the one we want to be primary.
   1. Only one mLDP MP2MP tree is setup at a time. During failover, a new tree is rebuilt.
2. Define multiple roots for the default MDT. The primary MDT will be the one with the root that has the lowest IGP metric.
   1. Both mLDP MP2MP trees are built, but PEs only send traffic down one tree at a time.



Using the second method produces two default MDTs, but only one will be used at any given time. To configure this, you simply define a second default MDT on each PE:

```
#PE1, PE2
vrf definition CUSTOMER
 address-family ipv4
  mdt default mpls mldp 10.10.10.10
  mdt default mpls mldp 20.20.20.20

#PE3
multicast-routing
 vrf CUSTOMER
  address-family ipv4
   mdt source Loopback0
   mdt default mldp ipv4 10.10.10.10
   mdt default mldp ipv4 20.20.20.20
```



Note that all PEs must define both default MDTs. This is because different PEs will use different MDTs as the primary MDT, depending on which root is closer. So all PEs must join both MDTs to ensure they can receive all traffic on either default MDT.



On IOS-XE, we can verify which root is used as the primary. Traffic is only sent down this tree as long as the primary root is up. PE1 is closest to 10.10.10.10, and PE2 is closest to 20.20.20.20.

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FoCjWOUKNuTqtpTna5Xnj%2Fimage.png?alt=media&#x26;token=f7c430ec-d2d5-4bcb-8a6e-d4470e54edc4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2F2NxNS6F0HeRYo6v3ZH4W%2Fimage.png?alt=media&#x26;token=8e39db93-a6c1-4f09-b457-e147be5c8d00" alt=""><figcaption></figcaption></figure>



(As a side note, the VPN ID is entered in hex, not decimal. This explains why the opaque value has 100 in it instead of 0x64.)



PE3 is also closest to P2 in terms of IGP metrics:

<figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FqmSQN9CLbhZlbuGqsvS2%2Fimage.png?alt=media&#x26;token=a9e14af8-02de-43b5-8139-709c2b93fd36" alt=""><figcaption></figcaption></figure>



If the IGP metrics tie, then the MP2MP tree with the highest root IP address is used.



If P2 fails, all PEs will detect this via the RIB and use P1. This can’t be easily demonstrated right now because the loopback we are using for the root is also tied to LDP. Let’s reconfigure the root to use new loopbacks. We can shut this loopback down to observe failover.

```
#P1
interface Loopback1
 ipv4 address 1.0.0.1 255.255.255.255
!
router isis 1
 interface Loopback1
  address-family ipv4 unicast

#P2
interface Loopback1
 ipv4 address 1.0.0.2 255.255.255.255
!
router isis 1
 interface Loopback1
  address-family ipv4 unicast

#PE1, PE2
vrf definition CUSTOMER
 address-family ipv4
  no mdt default mpls mldp 10.10.10.10
  no mdt default mpls mldp 20.20.20.20
  mdt default mpls mldp 1.0.0.1
  mdt default mpls mldp 1.0.0.2

#PE3
multicast-routing
 vrf CUSTOMER
  address-family ipv4
   no mdt default mldp ipv4 10.10.10.10
   no mdt default mldp ipv4 20.20.20.20
   mdt default mldp ipv4 1.0.0.1
   mdt default mldp ipv4 1.0.0.2
```



Currently we are not using data MDTs, so we can start a multicast ping on one host, shutdown a loopback, and observe how long it takes for the multicast traffic to reconverge. We’ll use C1 as the sender, because PE1 uses P1 as the MP2MP root. C3 as the receiver uses P2 as the MP2MP root.

```
#C3
int gi0/0
 ip igmp join-group 239.3.3.3

#C1
ping 239.3.3.3 repeat 1000 time 1
```



We’ll shutdown Lo1 on P1. This will force PE1 to detect the change and switchover to using P2 as the root for the active MP2MP MDT.

```
#P1
int lo1
 shut
```



Only one ping is lost:

<div align="left"><figure><img src="https://3072390383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkUz2C3GqnZcWhoVL6jfk%2Fuploads%2FDaf8XU2kowVqOQEzl43y%2Fimage.png?alt=media&#x26;token=79262db2-dc44-4c44-b61a-0b060ceff0dc" alt=""><figcaption></figcaption></figure></div>



The downside to this method is that there are twice as many default MDTs pre-built and signaled in the core. However, the redundancy may be worth the trade off.
