Friday, November 18, 2011

Cisco PIM Dense Mode Configuration Example

PIM Dense Mode

The basic assumption for PIM dense-mode is that the multicast flow has receivers at most locations. Dense mode is ideal for groups where many of the nodes will want to receive the multicast flows.

In dense-mode, the source initially multicasts the flow to every router. Then each router that does not want to receive flows destined for that group will send a prune message to the neighbor which is at the path to the multicast source. After receiving a prune message, the router will modify its state so that it will not forward those packets out that interface. If every interface on a router is pruned, the router will also be pruned.

In this blog we will provide a pim dense mode configuration example on Cisco routers:

Here is the topology for this example:


In this example R4 router`s loopback0 ip address(4.4.4.4) will be the multicast source for group 224.1.1.1, R1 router will be the multicast client for the same group.

Here is the configurations:

R1(Simulates a Client):
!
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 ip igmp join-group 224.1.1.1
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0

Configuration of R2

ip multicast-routing
!        
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 192.168.23.2 255.255.255.0
 ip pim dense-mode
 no ip mroute-cache
!
interface FastEthernet0/1
 ip address 192.168.12.2 255.255.255.0
 ip pim dense-mode
 no ip mroute-cache
!
interface FastEthernet1/0
 ip address 192.168.24.2 255.255.255.0
 ip pim dense-mode
 no ip mroute-cache
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0

Configuration of R3

ip multicast-routing
!     
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 192.168.23.3 255.255.255.0
 ip pim dense-mode
!
interface FastEthernet0/1
 ip address 192.168.34.3 255.255.255.0
 ip pim dense-mode
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0

Configuration of R4

ip multicast-routing
!      
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip ospf 1 area 0
!
interface FastEthernet0/0
 ip address 192.168.34.4 255.255.255.0
 ip pim dense-mode
!
interface FastEthernet1/0
 ip address 192.168.24.4 255.255.255.0
 ip pim dense-mode
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0

When a multicast client wants to subscribe to a multicast group, it sends igmp join message:
In this example R1 is multicast client.There is "ip igmp join-group 224.1.1.1" command in R1`s F0/0 interface.This command is used for testing purposes to simulate the client.

Lets debug these messages on R2:

R2#debug ip igmp
IGMP debugging is on
R2#
*Mar  1 00:14:55.647: IGMP(0): Received v2 Report on FastEthernet0/1 from 192.168.12.1 for 224.1.1.1
*Mar  1 00:14:55.647: IGMP(0): Received Group record for group 224.1.1.1, mode 2 from 192.168.12.1 for 0 sources
*Mar  1 00:14:55.651: IGMP(0): WAVL Insert group: 224.1.1.1 interface: FastEthernet0/1Successful
*Mar  1 00:14:55.651: IGMP(0): Switching to EXCLUDE mode for 224.1.1.1 on FastEthernet0/1
*Mar  1 00:14:55.651: IGMP(0): Updating EXCLUDE group timer for 224.1.1.1
*Mar  1 00:14:55.651: IGMP(0): MRT Add/Update FastEthernet0/1 for (*,224.1.1.1) by 0

Lets start traffic from R4:

R4# ping
Protocol [ip]:
Target IP address: 224.1.1.1     
Repeat count [1]: 10000
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: yes
Interface [All]: FastEthernet1/0
Time to live [255]:
Source address: 4.4.4.4
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 10000, 100-byte ICMP Echos to 224.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 4.4.4.4
Reply to request 0 from 192.168.12.1, 156 ms
Reply to request 1 from 192.168.12.1, 120 ms
Reply to request 2 from 192.168.12.1, 104 ms
Reply to request 3 from 192.168.12.1, 132 ms
Reply to request 4 from 192.168.12.1, 140 ms

We see that the multicast traffic flows from R4 to R1 through R2.

Lets debug the multicast packets on R2(to debug these packet we have configured no ip mroute-cache command on R2)

R2#
*Mar  1 00:22:39.115: IP(0): s=4.4.4.4 (FastEthernet1/0) d=224.1.1.1 (FastEthernet0/0) id=82, ttl=254, prot=1, len=100(100), mforward
*Mar  1 00:22:39.123: IP(0): s=4.4.4.4 (FastEthernet1/0) d=224.1.1.1 (FastEthernet0/1) id=82, ttl=254, prot=1, len=100(100), mforward

Lets check the mroute table on R2:

R2#show ip mroute
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F - Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDP created entry,
       X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U - URD, I - Received Source Specific Host Report,
       Z - Multicast Tunnel, z - MDT-data group sender,
       Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched, A - Assert winner
 Timers: Uptime/Expires
 Interface state: Interface, Next-Hop or VCD, State/Mode
(*, 224.1.1.1), 01:03:42/stopped, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet1/0, Forward/Dense, 00:59:31/00:00:00
    FastEthernet0/0, Forward/Dense, 01:03:42/00:00:00
    FastEthernet0/1, Forward/Dense, 00:13:32/00:00:00
(4.4.4.4, 224.1.1.1), 00:06:26/00:02:55, flags: T
  Incoming interface: FastEthernet1/0, RPF nbr 192.168.24.4
  Outgoing interface list:
    FastEthernet0/0, Forward/Dense, 00:06:28/00:00:00
    FastEthernet0/1, Forward/Dense, 00:06:28/00:00:00
(*, 224.0.1.40), 01:10:36/00:02:29, RP 0.0.0.0, flags: DCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet1/0, Forward/Dense, 00:59:33/00:00:00
    FastEthernet0/0, Forward/Dense, 01:10:36/00:00:00

No comments:

Post a Comment