Tuesday, March 20, 2012

Cisco IOS IGMP Timers and Fine Tuning

Cisco IGMP Timers and Fine Tuning

ip igmp immediate-leave: Multicast router will not send IGMP group-specific host queries when an IGMP leave  message is received.Then the multicast router removes the interface from multicast routing table outgoing interface list(OIL).
ip igmp last-member-query-interval: The multicast router removes the interface from multicast routing table outgoing interface list(OIL) when there is no group specific reply to the query messages.These query messages occur after a IGMP leave message is received by the router.
ip igmp last-member-query-count: Count of the group specific query messages of the multicast router after it receives IGMP Leave message.
ip igmp limit: Limit for the IGMP group membership for the interfaces of the multicast router.
ip igmp querier-timeout: The timeout period before the router recalculates IGMP querier selection for the interface.By default the router which has the lowest IP address on the subnet is selected as IGMP Querier.
ip igmp query-interval: The time interval at which the IGMP querier sends IGMP host-query messages.
ip igmp query-max-response-time: the time interval that the client can respond to an IGMP query message before the router deletes the group
Here is default values:
Router#show ip igmp interface F0/0
FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.123.2/24
  IGMP is enabled on interface
  Current IGMP host version is 2
  Current IGMP router version is 2
  IGMP query interval is 60 seconds
  IGMP querier timeout is 120 seconds
  IGMP max query response time is 10 seconds
  Last member query count is 2
  Last member query response interval is 1000 ms
  Inbound IGMP access group is not set
  IGMP activity: 1 joins, 0 leaves
  Multicast routing is enabled on interface
  Multicast TTL threshold is 0
  Multicast designated router (DR) is 192.168.123.3 
  IGMP querying router is 192.168.123.2 (this system)
  Multicast groups joined by this system (number of users):

Cisco IGMP Filtering

Cisco IGMP Filtering
IGMP report messages include the group addresses of the multicast receivers want to join. IGMP enabled routers can filter the groups based on the information in the report messages.
For example lets permit only for the groups in the 224.10.10.0/24 range.
In this scenario, we have two routers(R2 and R3) and a client.R1 simulates the client.These three routers are connected through a Layer2 switch.
R1:
interface FastEthernet0/0
 ip address 192.168.123.1 255.255.255.0

R2
access-list 1 permit 224.10.10.0 0.0.0.255
interface FastEthernet0/0
 ip address 192.168.123.2 255.255.255.0
 ip igmp access-group 1
 ip pim sparse-mode

R3
access-list 1 permit 224.10.10.0 0.0.0.255
interface FastEthernet0/0
 ip address 192.168.123.3 255.255.255.0
 ip igmp access-group 1
 ip pim sparse-mode


We added “ip igmp-join group 224.10.10.1” and “ip igmp-join group 224.1.1.1”  on R1:

R2#debug ip igmp
IGMP debugging is on
*Mar  1 01:02:11.087: IGMP(0): Received v2 Report on FastEthernet0/0 from 192.168.123.1 for 224.10.10.1
*Mar  1 01:02:11.091: IGMP(0): Received Group record for group 224.10.10.1, mode 2 from 192.168.123.1 for 0 sources
*Mar  1 01:02:11.091: IGMP(0): Updating EXCLUDE group timer for 224.10.10.1
*Mar  1 01:02:11.091: IGMP(0): MRT Add/Update FastEthernet0/0 for (*,224.10.10.1) by 0
*Mar  1 01:02:11.659: IGMP(0): Received v2 Report on FastEthernet0/0 from 192.168.123.1 for 224.1.1.1
*Mar  1 01:02:11.659: IGMP(*): Group 224.1.1.1 access denied on FastEthernet0/0

We see that 224.1.1.1 is denied by the multicast routers:
R2# show ip igmp membership
Flags: A  - aggregate, T - tracked
       L  - Local, S - static, V - virtual, R - Reported through v3
       I - v3lite, U - Urd, M - SSM (S,G) channel
       1,2,3 - The version of IGMP the group is in
Channel/Group-Flags:
       / - Filtering entry (Exclude mode (S,G), Include mode (*,G))
Reporter:
       <mac-or-ip-address> - last reporter if group is not explicitly tracked
       <n>/<m>      - <n> reporter in include mode, <m> reporter in exclude

 Channel/Group                  Reporter        Uptime   Exp.  Flags  Interface
 *,224.10.10.1                  192.168.123.1   00:08:08 02:12 2A     Fa0/0
 *,224.0.1.40                   192.168.24.4    00:56:13 02:16 2A     Fa1/0
 *,224.0.1.40                   192.168.123.2   01:04:35 stop  2LA    Fa0/0

Enabling IGMP on a Cisco router

Enabling IGMP on a Cisco router

When we enable PIM on a Cisco Router`s Interface, IGMP is automatically enabled.
Example:
In this scenario, we have two routers(R2 and R3) and a client.R1 simulates the client.These three routers are connected through a Layer2 switch.
R1:
interface FastEthernet0/0
 ip address 192.168.123.1 255.255.255.0

R2
interface FastEthernet0/0
 ip address 192.168.123.2 255.255.255.0
 ip pim sparse-mode

R3
interface FastEthernet0/0
 ip address 192.168.123.3 255.255.255.0
 ip pim sparse-mode

We see that IGMP is automatically enabled on R2`s related interface:
R2#show ip igmp interface f0/0
FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.123.2/24
  IGMP is enabled on interface
  Current IGMP host version is 2
  Current IGMP router version is 2
  IGMP query interval is 60 seconds
  IGMP querier timeout is 120 seconds
  IGMP max query response time is 10 seconds
  Last member query count is 2
  Last member query response interval is 1000 ms
  Inbound IGMP access group is not set
  IGMP activity: 1 joins, 0 leaves
  Multicast routing is enabled on interface
  Multicast TTL threshold is 0
  Multicast designated router (DR) is 192.168.123.3 
  IGMP querying router is 192.168.123.2 (this system)
  Multicast groups joined by this system (number of users):
      224.0.1.40(1)
We see that default version is IGMP version2.It can be changed by the interface level  configurations.This output also shows the default timer values of IGMP.
Lets simulate the client:
After we added this command on R1`s F0/0 interface;
ip igmp join-group 239.1.1.1
Client sends IGMP report message to all routers (224.0.0.2)
Its meaning: Client wants the multicast traffic that is destined to 239.1.1.1
R2 and R3 receives this report message:
R2#debug ip igmp
*Mar  1 00:31:27.823: IGMP(0): Received v2 Report on FastEthernet0/0 from 192.168.123.1 for 239.1.1.1
*Mar  1 00:31:27.823: IGMP(0): Received Group record for group 239.1.1.1, mode 2 from 192.168.123.1 for 0 sources
*Mar  1 00:31:27.827: IGMP(0): WAVL Insert group: 239.1.1.1 interface: FastEthernet0/0Successful
*Mar  1 00:31:27.827: IGMP(0): Switching to EXCLUDE mode for 239.1.1.1 on FastEthernet0/0
*Mar  1 00:31:27.827: IGMP(0): Updating EXCLUDE group timer for 239.1.1.1
*Mar  1 00:31:27.831: IGMP(0): MRT Add/Update FastEthernet0/0 for (*,239.1.1.1) by 0
R2#show ip igmp membership
Flags: A  - aggregate, T - tracked
       L  - Local, S - static, V - virtual, R - Reported through v3
       I - v3lite, U - Urd, M - SSM (S,G) channel
       1,2,3 - The version of IGMP the group is in
Channel/Group-Flags:
       / - Filtering entry (Exclude mode (S,G), Include mode (*,G))
Reporter:
       <mac-or-ip-address> - last reporter if group is not explicitly tracked
       <n>/<m>      - <n> reporter in include mode, <m> reporter in exclude

 Channel/Group                  Reporter        Uptime   Exp.  Flags  Interface
 *,239.1.1.1                    192.168.123.1   00:01:01 02:42 2A     Fa0/0
 *,224.0.1.40                   192.168.24.4    00:18:39 02:50 2A     Fa1/0
 *,224.0.1.40                   192.168.123.3   00:27:02 02:35 2LA    Fa0/0
If we remove the “ip igmp join-group 239.1.1.1” command on the client, client sends a leave message:
R2#
*Mar  1 00:35:01.843: IGMP(0): Received Leave from 192.168.123.1 (FastEthernet0/0) for 239.1.1.1
*Mar  1 00:35:01.847: IGMP(0): Received Group record for group 239.1.1.1, mode 3 from 192.168.123.1 for 0 sources
*Mar  1 00:35:01.847: IGMP(0): Lower expiration timer to 2000 msec for 239.1.1.1 on FastEthernet0/0
*Mar  1 00:35:01.847: IGMP(0): Send v2 Query on FastEthernet0/0 for group 239.1.1.1
*Mar  1 00:35:02.851: IGMP(0): Send v2 Query on FastEthernet0/0 for group 239.1.1.1
*Mar  1 00:35:03.851: IGMP(0): Switching to INCLUDE mode for 239.1.1.1 on FastEthernet0/0

Note1:We use IGMP version2.In IGMP version 1, there is no Leave Message.IGMP version1 is not used anymore.

Note2:In this example we have only configured IGMP on the interface.For end-to-end multicast traffic, some other configurations like RP must exists.