#

Monday, November 11, 2019

PIM Dense Mode Operation & Behavior of Multicast Routing Table

PIM (Protocol Independent Multicast) is a Multicast Routing Protocol which has 3 modes of operation. PIM is the only fully supported Multicast Routing Protocol in Cisco IOS.

1. Dense
2. Sparse
3. Sparse-Dense

Dense mode is flooding the traffic while Sparse mode is only forwarding the traffic to the requesting host. Sparse Mode requires a Rendezvous Point to achieve this. Sparse-Dense is a mode which combine the both functionalities so that the traffic will be flooded (Dense mode operation) when there is no Rendezvous Point.

In this post, I am enabling the PIM Dense Mode and see how it is changing it's Multicast Routing Tables and forwards traffic.
IP addresses are configured according to the diagram and OSPF is enabled in routers to advertise all the networks.

First of all, let's globally enable Multicast routing on IOS.

R1(config)#ip multicast-routing 

R2(config)#ip multicast-routing 

R3(config)#ip multicast-routing 

To configure PIM, interface level mode selection is the only requirement. 
Traffic from the server will be entered to R1 from e0/0 interface and all PIM Dense mode enabled interfaces will be flooded and this will go on until R3 floods it's e0/1 interface which connects to PC.

Following are the PIM Dense mode related configuration.

R1(config)#int range e0/0-1
R1(config-if-range)#ip pim dense-mode

R1(config)#int range e0/0-1
R1(config-if-range)#ip pim dense-mode

R1(config)#int range e0/0-1
R1(config-if-range)#ip pim dense-mode


As soon as the above commands entered, PIM Hello packets will be sent which will initiate PIM neighbor relationships.

show ip pim interface & show ip pim neighbor will display the PIM enabled interfaces and the neighbor relationships formed.



After issuing these commands, the multicast routing tables will look like the following..
Command to see the Multicast Routing table is show ip mroute













All the 3 routers will have the same entry in the routing table. As we can see, there is already an entry for a multicast group. The group address is 224.0.1.40 which is a well known address used in Cisco Auto-RP protocol to listen RP-Discovery messages from RP Mapping Agent. This is really used in PIM Sparse mode. But even in Dense mode we can see it but has no use. Since this entry does not relate to Dense mode, let's ignore this entry for now.

Pruning & Unpruning Mechanism

When R1 receives this traffic on it's e0/0 interface, it floods its e0/1 interface with it. When it hits the R2 and since there are no listeners downstream, R2 sends a Prune message to R1 saying to stop sending.

In PIMv1 interface is pruned for 3 minutes. After 3 minutes, the traffic will be sent again until another prune message is received.
In PIMv2 periodic prune messages are sent so that flooding never occurs until there is a listener.

When an IGMP join is spotted downstream, the router sends it's upstream router a special message called "PIM Graft Message" to inform the neighbor to unprune the pruned interface..

Scenario 1 - Feed is available, No Listeners

Ok, now let's send a multicast feed from IPTV_Svr. Let's initiate a ping to multicast address 239.1.1.1 to simulate the feed.


Ping is not being successful as there are no listeners yet. Let's see the behavior of routing tables.
First we will take the routing table of R1.


Now we can see there are 2 more entries added. 1 is for the source group of (*, 239.1.1.1) and another one for (192.168.1.10, 239.1.1.1).

Note:-
Routing Entries in Multicast Routing table show as (Source, Group) notation. * means the source can be any..

Let's consider the (192.168.1.10, 239.1.1.1) entry and some important parts of it.
It has T flag set which means R1 is using the Shortest Path Tree to the source.
The routing entry is in the table since 19 minutes and 14 seconds and it will be removed if R1 does't receive the feed after 1 minute and 33 seconds. If the feed is available when this timer becomes zero it will start the count down again from 3 minutes.
R1 has pruned this traffic on Ethernet 0/1 interface since 1 minute and 11 seconds. (Last Prune message is received on this interface 1 minute and 11 seconds ago)

Scenario 2 - Feed is not available, Have Listeners

Now let's stop the feed and clear ip mroute tables and send an IGMP join from the PC and see the behavior of routing tables..

PC(config)#int e0/0
PC(config-if)#ip igmp join-group 239.1.1.1


















As you can see, (*, 239.1.1.1) entry is created on the directly connected router connected to PC. Since there is no feed coming, the upstream neighbor will not be asked to unprune it's interface.














So there won't be any entry in other routers.

Scenario 2 - Feed is available, Have Listeners

Let's start giving the feed again from IPTV_Svr,






Now the replies coming through as there is an active listener.

Now let's see the routing tables..

The Ethernet 0/1 interface shows a "stopped" for a timer. That is a good sign that we are actively forwarding traffic from that interface. Also you can see the interface shows as Forward/Dense instead of Prune/Dense.

Other 2 routers will have tables of similar kind like the following..



No comments:

Post a Comment