# Multicast

#### Lab file

{% file src="<https://1203572585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgAMH3CMtmYTBkob03NUj%2Fuploads%2FSRVaWgwHZKbnmAuRvtw6%2FChallenge%20-%20Multicast.yaml?alt=media&token=12ec425d-bca7-42d4-9e1e-7301f1bbcd68>" %}

#### Startup configs

{% file src="<https://1203572585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgAMH3CMtmYTBkob03NUj%2Fuploads%2Fh0GPodgQXIyZ3iKvTf4j%2Fmulticast_initial_configs.zip?alt=media&token=af077762-da84-4596-a117-1be2d61fbc0f>" %}

IP addressing, IGP, and the L2 switch have all been pre-configured. The receivers run IOSv. IGMP is already enabled on the receivers and they have joined the groups denoted below. The switch is IOSvL2. The sources and routers are CSR1000v, and the XR routers are XRv. Note the OSPF cost on the R3-XR5 interface.

<figure><img src="https://1203572585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgAMH3CMtmYTBkob03NUj%2Fuploads%2F9duefD2lmhproC5uqwiD%2FUntitled.png?alt=media&#x26;token=2ad743b2-85a5-4b00-8620-697b435743b9" alt=""><figcaption></figcaption></figure>

1. Configure PIM-SM on all routers<br>
2. Configure the topology to achieve this output:

```
R3#show ip pim rp mapping
PIM Group-to-RP Mappings

Group(s) 239.0.0.0/8
  RP 5.5.5.5 (?), v2
    Info source: 5.5.5.5 (?), via bootstrap, priority 192, holdtime 150
         Uptime: 00:00:09, expires: 00:02:15
R3#
```

&#x20;3\.  Disable SPT-switchover on R3.

From Source1 and Source2 ping 239.1.1.1 and ensure you see replies from Receiver1 and Receiver3

```
Source1#ping 239.1.1.1
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 239.1.1.1, timeout is 2 seconds:

Reply to request 0 from 10.10.20.103, 13 ms
Reply to request 0 from 10.10.10.101, 13 ms

Source2#ping 239.1.1.1
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 239.1.1.1, timeout is 2 seconds:

Reply to request 0 from 10.10.20.103, 13 ms
Reply to request 0 from 10.10.10.101, 14 ms
```

What path is traffic from Source1 to Receiver1 taking?

#### PIM-SSM

&#x20;4\.  Currently Receiver3 responds to a ping from Source2 to 232.1.1.1. Why is that?

```
Source2#ping 232.1.1.1
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 232.1.1.1, timeout is 2 seconds:

Reply to request 0 from 10.10.20.103, 9 ms
```

&#x20;5\.  Make the minimum amount of config changes so that Receiver2 replies as well.

```
Source2#ping 232.1.1.1
Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 232.1.1.1, timeout is 2 seconds:

Reply to request 0 from 10.10.20.103, 9 ms
Reply to request 0 from 10.10.10.102, 11 ms
```

#### PIM-BiDir

&#x20;6\.  Configure BiDir on all routers and advertise XR5 as bidir via BSR.

On Source1 Gi1 join 239.1.1.1. Note that it will not respond to multicast pings like the IOSv router.

Make a “snip” of the diagram and draw the stream of traffic when Source2 pings 239.1.1.1. Also mark every interface in the diagram as **U** for Upstream Interface, **X** for did not win DF election, and check mark for won DF election.

### Answers <a href="#id-1d0f7193-551e-4d2a-aeb6-3759f73ff7f3" id="id-1d0f7193-551e-4d2a-aeb6-3759f73ff7f3"></a>

1. Enable multicast routing on the CSR1000v routers using **ip multicast-routing distributed**. Enable multicast routing on the XR routers using **multicast-routing address-family ipv4 interface \<num> enable**. Enable multicast on each interface that faces a receiver, senders, or PIM neighbor.

   \
   Enable PIM on the CSR1000v routers on every interface (including interfaces facing senders and receivers) using **ip pim sparse-mode**. Enable PIM on all XR routers using **router pim add ipv4 interface \<num>**. On IOS-XR, because PIM is separate from enabling multicast on an interface, you only need to enable PIM on interfaces facing other PIM neighbors (other routers).
2. You must configure XR5 to be a candidate-bsr and candidate-rp. On IOS-XR you reference the IP address of the local interface. On IOS-XE you reference the interface itself.

```
router pim
 address-family ipv4
  bsr candidate-bsr 5.5.5.5 hash-mask-len 30 priority 1
  bsr candidate-rp 5.5.5.5 group-list PRIVATE_GROUP priority 192 interval 60
!
ipv4 access-list PRIVATE_GROUP
 10 permit ipv4 239.0.0.0/8 any
```

If you were to configure an IOS-XE router you could use this configuration:

```
ip pim bsr-candidate lo0
ip pim rp-candidate lo0 group-list <ACL_NAME>
```

&#x20;3\.  Traffic takes the path Source1 - R1 - R2 - XR6 - XR5 - R3. This is because the cost of the R3-XR5 link is high.

#### PIM-SSM

&#x20;4\.  By default IOS-XR enables PIM-SSM when PIM is configured. PIM-SM and PIM-SSM are both enabled by default when using PIM. IOS-XR does not support PIM-DM. IOS-XR also implicitly uses the default 232/8 range for PIM-SSM. IOS-XR additionally enables IGMPv3 on all multicast interfaces by default. Receiver2 and Receiver3 already have IGMPv3 explicitly enabled on the interface, which was pre-configured. Remember that IGMPv3 is backwards compatible with IGMPv2, so you can also have IGMPv3 enabled on the router and IGMPv2 enabled on the hosts.

&#x20;5\.  You need to make two changes to R3: configure ssm with the default range, and configure IGMPv3 on Gi1. You may have to wait a minute before the router and host switch over to IGMPv3 and the router receives an IGMP Join for (10.10.2.10,232.1.1.1).

#### PIM BiDir

<figure><img src="https://1203572585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgAMH3CMtmYTBkob03NUj%2Fuploads%2F4m6q7rs8ywluqfmAvkiu%2FUntitled%201.png?alt=media&#x26;token=97b60673-afca-4b66-a7ce-d6677bb18312" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1203572585-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgAMH3CMtmYTBkob03NUj%2Fuploads%2Fk4IgvQfWFyVWIoV3daGB%2FUntitled%202.png?alt=media&#x26;token=db8fabf0-1b38-44ad-a249-01c6cdd3097d" alt=""><figcaption></figcaption></figure>

&#x20;6\.  Configure all IOS-XE routers with **ip pim bidir-enable**. IOS-XR already has BiDir enabled by default. On XR5 remove the **candidate-rp** statement and re-add it with the keyword **bidir** appended to the command.

#### DF Election

The router with the lowest metric to the RP, or the highest IP address wins the DF election on that segment. A router that receives multicast traffic on a non-DF interface must drop the traffic and not forward it up to the RP. This ensures a loopfree topology. However, the DF interfaces do not change normal PIM downstream behaviour. The DF only is used for forwarding upstream traffic towards the RP.

A router that receives a multicast packet on the upstream interface preforms normal PIM forwarding, only forwarding the traffic out interfaces for which it received a PIM Join or IGMP Join. A router that receives a multicast packet on a non-upstream interface only forwards it out the upstream interface if the interface the packet was received on is the DF.

Notice that once traffic is received at XR5 on Gi0/0/0/0 in the diagram above, every step after that follows normal PIM-SM forwarding, which is based on PIM/IGMP Joins.
