Skip to contentSkip to conversation

question about function igmp_stop_timer() in net/ipv4/igmp.c

DISCUSSION Dongpo Li 2 participants 6 messages Oct 24, 2016 – Oct 25, 2016

Subsystems (2)
lore
Share & tools
lore

Dongpo Li

author
#0 lore raw

Hello

We encountered a multicast problem when two set-top box(STB) join the same multicast group and leave. The two boxes can join the same multicast group
but only one box can send the IGMP leave group message when leave,
the other box does not send the IGMP leave message.
Our boxes use the IGMP version 2.

I added some debug info and found the whole procedure is like this:
(1) Box A joins the multicast group 225.1.101.145 and send the IGMP v2 membership report(join group).
(2) Box B joins the same multicast group 225.1.101.145 and also send the IGMP v2 membership report(join group).
(3) Box A receives the IGMP membership report from Box B and kernel calls igmp_heard_report(). This function will call igmp_stop_timer(im).
In function igmp_stop_timer(im), it tries to delete IGMP timer and does the following:
im->tm_running = 0;
im->reporter = 0;
(4) Box A leaves the multicast group 225.1.101.145 and kernel calls

    ip_mc_leave_group -> ip_mc_dec_group -> igmp_group_dropped.
    But in function igmp_group_dropped(), the im->reporter is 0, so the kernel does not send the IGMP leave message.

I think there may be some problem in step (3).
The function igmp_stop_timer(im) should not set im->reporter to 0 if the IGMP timer has expired. It should only work if the IGMP timer is running and does not send the IGMP join message. I'm not sure whether it's a problem and hope any advice.

Thanks!

Regards,
Dongpo

.

#1 lore raw
Quoted 17 lines · Dongpo Li

Hello

We encountered a multicast problem when two set-top box(STB) join the same multicast group and leave. The two boxes can join the same multicast group
but only one box can send the IGMP leave group message when leave,
the other box does not send the IGMP leave message.
Our boxes use the IGMP version 2.

I added some debug info and found the whole procedure is like this:
(1) Box A joins the multicast group 225.1.101.145 and send the IGMP v2 membership report(join group).
(2) Box B joins the same multicast group 225.1.101.145 and also send the IGMP v2 membership report(join group).
(3) Box A receives the IGMP membership report from Box B and kernel calls igmp_heard_report(). This function will call igmp_stop_timer(im).
In function igmp_stop_timer(im), it tries to delete IGMP timer and does the following:
im->tm_running = 0;
im->reporter = 0;
(4) Box A leaves the multicast group 225.1.101.145 and kernel calls

Quoted 2 lines
    ip_mc_leave_group -> ip_mc_dec_group -> igmp_group_dropped.
    But in function igmp_group_dropped(), the im->reporter is 0, so the kernel does not send the IGMP leave message.

RFC 2236 says:

2. Introduction

The Internet Group Management Protocol (IGMP) is used by IP hosts to report their multicast group memberships to any immediately- neighboring multicast routers.

Are Box A or B multicast routers?

Andrew

author
#2 lore raw

Hi Andrew,

Quoted 23 lines · Andrew Lunn
Quoted 17 lines · Dongpo Li

Hello

We encountered a multicast problem when two set-top box(STB) join the same multicast group and leave. The two boxes can join the same multicast group
but only one box can send the IGMP leave group message when leave,
the other box does not send the IGMP leave message.
Our boxes use the IGMP version 2.

I added some debug info and found the whole procedure is like this:
(1) Box A joins the multicast group 225.1.101.145 and send the IGMP v2 membership report(join group).
(2) Box B joins the same multicast group 225.1.101.145 and also send the IGMP v2 membership report(join group).
(3) Box A receives the IGMP membership report from Box B and kernel calls igmp_heard_report(). This function will call igmp_stop_timer(im).
In function igmp_stop_timer(im), it tries to delete IGMP timer and does the following:
im->tm_running = 0;
im->reporter = 0;
(4) Box A leaves the multicast group 225.1.101.145 and kernel calls

Quoted 2 lines
    ip_mc_leave_group -> ip_mc_dec_group -> igmp_group_dropped.
    But in function igmp_group_dropped(), the im->reporter is 0, so the kernel does not send the IGMP leave message.

RFC 2236 says:

Quoted 7 lines

2. Introduction

The Internet Group Management Protocol (IGMP) is used by IP hosts to report their multicast group memberships to any immediately- neighboring multicast routers.

Are Box A or B multicast routers?

Thank you for your comments.
Both Box A and B are IP hosts, not multicast routers.
And the RFC says: IGMP is used by "IP hosts" to report their multicast group membership.

Quoted 5 lines

Andrew

.

Regards,
Dongpo

.

#3 lore raw
Quoted 28 lines · Dongpo Li

Hi Andrew,

Quoted 25 lines · Andrew Lunn
Quoted 17 lines · Dongpo Li

Hello

We encountered a multicast problem when two set-top box(STB) join the same multicast group and leave. The two boxes can join the same multicast group
but only one box can send the IGMP leave group message when leave,
the other box does not send the IGMP leave message.
Our boxes use the IGMP version 2.

I added some debug info and found the whole procedure is like this:
(1) Box A joins the multicast group 225.1.101.145 and send the IGMP v2 membership report(join group).
(2) Box B joins the same multicast group 225.1.101.145 and also send the IGMP v2 membership report(join group).
(3) Box A receives the IGMP membership report from Box B and kernel calls igmp_heard_report(). This function will call igmp_stop_timer(im).
In function igmp_stop_timer(im), it tries to delete IGMP timer and does the following:
im->tm_running = 0;
im->reporter = 0;
(4) Box A leaves the multicast group 225.1.101.145 and kernel calls

Quoted 2 lines
    ip_mc_leave_group -> ip_mc_dec_group -> igmp_group_dropped.
    But in function igmp_group_dropped(), the im->reporter is 0, so the kernel does not send the IGMP leave message.

RFC 2236 says:

2. Introduction

Quoted 8 lines
Quoted 5 lines

The Internet Group Management Protocol (IGMP) is used by IP hosts to report their multicast group memberships to any immediately- neighboring multicast routers.

Are Box A or B multicast routers?

Thank you for your comments.
Both Box A and B are IP hosts, not multicast routers.
And the RFC says: IGMP is used by "IP hosts" to report their multicast group membership.

They report their membership to gateways, not to each other. The gateway will then arrange for multicast traffic for the group from other subnets to be forwarded to this subnet. You don't need IGMP to receive local traffic.

Also, this timer is to do with responding to IGMP querier, typically the multicast gateway. The querier keeps track of if a group is in use within a subnet. It listens to group joins and optionally leaves. It also periodically sends out IGMP querier requests, asking who is interested in what groups. The hosts use a random delay before answering, and if some other hosts replies about a group they are a member of, they don't send a response themselves. One is enough.

Read the RFC.

Andrew

author
#4 lore raw
Quoted 43 lines · Andrew Lunn
Quoted 28 lines · Dongpo Li

Hi Andrew,

Quoted 25 lines · Andrew Lunn
Quoted 17 lines · Dongpo Li

Hello

We encountered a multicast problem when two set-top box(STB) join the same multicast group and leave. The two boxes can join the same multicast group
but only one box can send the IGMP leave group message when leave,
the other box does not send the IGMP leave message.
Our boxes use the IGMP version 2.

I added some debug info and found the whole procedure is like this:
(1) Box A joins the multicast group 225.1.101.145 and send the IGMP v2 membership report(join group).
(2) Box B joins the same multicast group 225.1.101.145 and also send the IGMP v2 membership report(join group).
(3) Box A receives the IGMP membership report from Box B and kernel calls igmp_heard_report(). This function will call igmp_stop_timer(im).
In function igmp_stop_timer(im), it tries to delete IGMP timer and does the following:
im->tm_running = 0;
im->reporter = 0;
(4) Box A leaves the multicast group 225.1.101.145 and kernel calls

Quoted 2 lines
    ip_mc_leave_group -> ip_mc_dec_group -> igmp_group_dropped.
    But in function igmp_group_dropped(), the im->reporter is 0, so the kernel does not send the IGMP leave message.

RFC 2236 says:

2. Introduction

Quoted 8 lines
Quoted 5 lines

The Internet Group Management Protocol (IGMP) is used by IP hosts to report their multicast group memberships to any immediately- neighboring multicast routers.

Are Box A or B multicast routers?

Thank you for your comments.
Both Box A and B are IP hosts, not multicast routers.
And the RFC says: IGMP is used by "IP hosts" to report their multicast group membership.

They report their membership to gateways, not to each other. The gateway will then arrange for multicast traffic for the group from other subnets to be forwarded to this subnet. You don't need IGMP to receive local traffic.

Quoted 8 lines

Also, this timer is to do with responding to IGMP querier, typically the multicast gateway. The querier keeps track of if a group is in use within a subnet. It listens to group joins and optionally leaves. It also periodically sends out IGMP querier requests, asking who is interested in what groups. The hosts use a random delay before answering, and if some other hosts replies about a group they are a member of, they don't send a response themselves. One is enough.

Of course, this timer is to do with responding to IGMP querier.
I mean, if the timer has expired, the host must have sent the IGMP responding message, maybe IGMP join group message or responding router's IGMP querier.
So the function igmp_stop_timer() should not set im->reporter to 0 if the timer has expired. Otherwise the host can't send IGMP leave message when it leaves the group because the im->reporter is 0.

Regards,
Dongpo

.

#5 lore raw
Quoted 2 lines

Otherwise the host can't send IGMP leave message when it leaves the group because the im->reporter is 0.

Leave is optional for IGMP v2, so net sending it is fine. And only a querier is going to take any notice of it.

What happens when you have a querier in your network and you are using IGMPv3. That is the use case which matters.

Andrew