In a network where you have a layer two switch connected to multicast routers, all multicast traffic is flooded to all multicast router ports, even if there are no multicast receivers behind a router.
When you enable PIM snooping, the switch will learn which multicast router ports should receive traffic by looking at PIM hello, join, prune, and designated forward election messages.
Let’s look at some examples:
Above we have a small network where SW1 is connected to three multicast routers, R1, R2, and R3. R1 is our RP. Behind R2, we have a receiver that is interested in a multicast group so it sends an IGMP join.
This IGMP join should only be forwarded to the RP (R1) but in reality, it also ends up at R3 since our switch floods all multicast traffic.
What about data traffic?
Once our source starts sending multicast traffic, the switch will flood it everywhere so it ends up at R2 (which needs it) but also at R3 that doesn’t have any receivers.
Once we enable PIM snooping, our switch will no longer flood unnecessary PIM join/prune messages nor will it forward multicast traffic to routers that don’t need it.
Some things to keep in mind about PIM snooping:
- PIM dense mode traffic is dropped once you enable PIM snooping.
- Traffic to Auto RP groups (126.96.36.199 and 188.8.131.52) are always flooded.
- PIM snooping and IGMP snooping can be enabled at the same time.
- Multicast router port and router information is timed out based on the hold time that the switch sees in PIM hello, join, and prune packets.
Let’s take a look at this in action. I’ll use the topology I showed you before, but added some interface numbers:
R1, R2, and R3 are multicast routers running PIM sparse mode. R1 is the RP in this network. S1 is our source, H1 is a receiver.
Want to take a look for yourself? Here you will find the startup configuration of each device.
hostname H1 ! no ip routing ! no ip cef ! interface GigabitEthernet0/0 ip address 10.255.0.94 255.255.0.0 ! interface GigabitEthernet0/1 ip address 192.168.2.102 255.255.255.0 ip igmp join-group 184.108.40.206 ! ip default-gateway 192.168.2.254 ! end
hostname R1 ! ip multicast-routing ip cef ! interface Loopback0 ip address 220.127.116.11 255.255.255.255 ip pim sparse-mode ! interface GigabitEthernet0/1 ip address 192.168.123.1 255.255.255.0 ip pim sparse-mode ! interface GigabitEthernet0/2 ip address 192.168.1.254 255.255.255.0 ip pim sparse-mode ! router ospf 1 network 18.104.22.168 0.0.0.0 area 0 network 192.168.1.0 0.0.0.255 area 0 network 192.168.123.0 0.0.0.255 area 0 ! ip pim rp-address 22.214.171.124 ! end
hostname R2 ! ip multicast-routing ip cef ! interface GigabitEthernet0/1 ip address 192.168.123.2 255.255.255.0 ip pim sparse-mode ! interface GigabitEthernet0/2 ip address 192.168.2.254 255.255.255.0 ip pim sparse-mode ! router ospf 1 router-id 126.96.36.199 network 192.168.2.0 0.0.0.255 area 0 network 192.168.123.0 0.0.0.255 area 0 ! ip pim rp-address 188.8.131.52 ! end
hostname R3 ! ip multicast-routing ip cef ! interface GigabitEthernet0/1 ip address 192.168.123.3 255.255.255.0 ip access-group MULTICAST_TRAFFIC in ip pim sparse-mode ! router ospf 1 router-id 184.108.40.206 network 192.168.123.0 0.0.0.255 area 0 ! ip pim rp-address 220.127.116.11 ! ip access-list extended MULTICAST_TRAFFIC permit ip any host 18.104.22.168 permit ip any any ! end
hostname S1 ! no ip routing ! no ip cef ! interface GigabitEthernet0/1 ip address 192.168.1.101 255.255.255.0 ! ip default-gateway 192.168.1.254 ! end
PIM Snooping Disabled
PIM snooping is disabled by default. Let’s enable PIM debugging on all routers so we can see what happens behind the scenes:
R1#debug ip pim PIM debugging is on
Let’s configure H1 to join a multicast group:
H1(config)#interface GigabitEthernet 0/1 H1(config-if)#ip igmp join-group 22.214.171.124
This will trigger some PIM join messages. We can see them here: