IGMP Unsolicited Report Interval too long for IGMPv3?
Subsystems (3)
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
There was a thread about this on linux-rdma in 2010 in the context of IP over Infiniband but it seems no patches got applied as a result of the discussion:
http://www.mail-archive.com/[email protected]/msg05740.html
Would the right patch reducing the unsolicited report interval for IGMPv3 be acceptable now?
Thanks
Will
Quoted 12 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Quoted 8 lines
There was a thread about this on linux-rdma in 2010 in the context of IP over Infiniband but it seems no patches got applied as a result of the discussion:
http://www.mail-archive.com/[email protected]/msg05740.html
Would the right patch reducing the unsolicited report interval for IGMPv3 be acceptable now?
I suggest you post a patch and find out what people think of it. That usually gets more response than asking in the abstract.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 1/1 net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existant) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_version.
--- net/ipv4/igmp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
net/ipv4/igmp.c +14 -3
@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval ( 1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2
@@ -138,6 +139,15 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V2_SEEN (in_dev)) { +return IGMP_V2_Unsolicited_Report_Interval; + }else {/* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; + } +} +static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);static void igmpv3_del_delrec (struct in_device *in_dev,__be32 multiaddr);static void igmpv3_clear_delrec (struct in_device *in_dev);
@@ -719,7 +729,8 @@ static void igmp_ifc_timer_expire(unsigned long data)igmpv3_send_cr (in_dev);if (in_dev->mr_ifc_count) { in_dev->mr_ifc_count--; -igmp_ifc_start_timer (in_dev, IGMP_Unsolicited_Report_Interval); +igmp_ifc_start_timer (in_dev, +unsolicited_report_interval (in_dev)); }__in_dev_put (in_dev); }
@@ -744,7 +755,7 @@ static void igmp_timer_expire(unsigned long data)if (im->unsolicit_count) { im->unsolicit_count--; -igmp_start_timer (im, IGMP_Unsolicited_Report_Interval); +igmp_start_timer (im,unsolicited_report_interval (in_dev)); } im->reporter =1 ;spin_unlock (&im->lock);
Signature · 1 line
1.7.10.4
Re: [PATCH] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
Quoted 14 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Quoted 6 lines
Tested with Wireshark and a simple program to join a (non-existant) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.--- net/ipv4/igmp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
I'm also working on a patch which builds on this adding a procfs knob similar to force_igmp_version but called "force_igmp_unsolicited_report_interval". This will allow the interval to be overridden from user-space independent of the version of IGMP in use as for our use-case we want the interval to be short even for IGMPv2.
Thanks
Will
Re: [PATCH] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
In reply to William ManleyHello.
Quoted 25 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existant) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.--- net/ipv4/igmp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)net/ipv4/igmp.c +0
-0
[...]
net/ipv4/igmp.c line 148
Quoted 11 lines
net/ipv4/igmp.c +7
-0@@ -138,6 +139,15 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V2_SEEN (in_dev)) { +return IGMP_V2_Unsolicited_Report_Interval; + }else {/* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; + }
{} not needed on either arm of *if*. I guess scripts/checkpatch.pl should
have warned you...
WBR, Sergei
PATCH 1/2 net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
In reply to Ben HutchingsIf an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_version.
--- net/ipv4/igmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
net/ipv4/igmp.c +13 -3
@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2
@@ -138,6 +139,14 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V2_SEEN (in_dev)) +return IGMP_V2_Unsolicited_Report_Interval; +else /* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; +} +static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);static void igmpv3_del_delrec (struct in_device *in_dev,__be32 multiaddr);static void igmpv3_clear_delrec (struct in_device *in_dev);
@@ -719,7 +728,8 @@ static void igmp_ifc_timer_expire(unsigned long data)igmpv3_send_cr (in_dev);if (in_dev->mr_ifc_count) { in_dev->mr_ifc_count--; -igmp_ifc_start_timer (in_dev, IGMP_Unsolicited_Report_Interval); +igmp_ifc_start_timer (in_dev, +unsolicited_report_interval (in_dev)); }__in_dev_put (in_dev); }
@@ -744,7 +754,7 @@ static void igmp_timer_expire(unsigned long data)if (im->unsolicit_count) { im->unsolicit_count--; -igmp_start_timer (im, IGMP_Unsolicited_Report_Interval); +igmp_start_timer (im,unsolicited_report_interval (in_dev)); } im->reporter =1 ;spin_unlock (&im->lock);
Signature · 1 line
1.7.10.4
PATCH 2/2 net: igmp: Allow user-space configuration of igmp unsolicited report interval
Adds a new procfs knob:
/proc/sys/net/ipv4/conf/*/force_igmp_unsolicited_report_interval
Which will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The default is -1 which means use default behaviour (10s for IGMPv3 and 1s for IGMPv2 in accordance with RFC2236 and RFC3376).
Background:
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Prior to this patch this value was hard coded in the kernel to 10s for IGMPv2 and 1s for IGMPv3. 10s is unsuitable for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
This patch allows the value to be overridden from userspace changed for both IGMPv2 and IGMPv3 such that it can be tuned accoding to the network.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_unsolicited_report_interval.
force_igmp_unsolicited_report_interval is intended to follow the pattern established by force_igmp_version, and while a procfs entry has been added a corresponding sysctl knob has not as it is my understanding that sysctl is deprecated[1].
[1]: http://lwn.net/Articles/247243/
--- include/linux/inetdevice.h | 2 ++ net/ipv4/devinet.c | 4 ++++ net/ipv4/igmp.c | 13 ++++++++++++- 3 files changed, 18 insertions(+), 1 deletion(-)
include/linux/inetdevice.h +2 -0
@@ -30,6 +30,7 @@ enumIPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY ,IPV4_DEVCONF_FORCE_IGMP_VERSION , +IPV4_DEVCONF_FORCE_IGMP_UNSOLICITED_REPORT_INTERVAL ,IPV4_DEVCONF_ARP_ANNOUNCE ,IPV4_DEVCONF_ARP_IGNORE , IPV4_DEVCONF_PROMOTE_SECONDARIES,
@@ -62,6 +63,7 @@ struct in_device {unsigned long mr_v1_seen;unsigned long mr_v2_seen;unsigned long mr_maxdelay; +unsigned long mr_unsolicited_report_interval;unsigned char mr_qrv;unsigned char mr_gq_running;unsigned char mr_ifc_count;
net/ipv4/devinet.c +4 -0
@@ -73,6 +73,7 @@ static struct ipv4_devconf ipv4_devconf = { [IPV4_DEVCONF_SEND_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, + [IPV4_DEVCONF_FORCE_IGMP_UNSOLICITED_REPORT_INTERVAL - 1] = -1, }, };
@@ -83,6 +84,7 @@ static struct ipv4_devconf ipv4_devconf_dflt = { [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE - 1] = 1, + [IPV4_DEVCONF_FORCE_IGMP_UNSOLICITED_REPORT_INTERVAL - 1] = -1, }, };
@@ -2099,6 +2101,8 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_UNSOLICITED_REPORT_INTERVAL , +"force_igmp_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,
net/ipv4/igmp.c +12 -1
@@ -141,7 +141,18 @@static int unsolicited_report_interval (struct in_device *in_dev) { -if (IGMP_V2_SEEN (in_dev)) +int interval_ms =IPV4_DEVCONF_ALL ( +dev_net (in_dev->dev), +FORCE_IGMP_UNSOLICITED_REPORT_INTERVAL ); +if (interval_ms >=0 ) { +/* _timer functions can't handle a delay of 0 jiffies so ensure +* we always return a positive value. +*/ +int interval_jiffies =msecs_to_jiffies (interval_ms); +if (interval_jiffies ==0 ) + interval_jiffies =1 ; +return interval_jiffies; + }else if (IGMP_V2_SEEN (in_dev))return IGMP_V2_Unsolicited_Report_Interval;else /* v3 */ return IGMP_V3_Unsolicited_Report_Interval;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
Quoted 8 lines · William Manley
Adds a new procfs knob:
/proc/sys/net/ipv4/conf/*/force_igmp_unsolicited_report_intervalWhich will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The default is -1 which means use default behaviour (10s for IGMPv3 and 1s for IGMPv2 in accordance with RFC2236 and RFC3376).
Hm, would it be easy to split the timers per protocol? It seems a bit hackish to me.
Thanks,
Hannes
PATCH v3 1/2 net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_version.
--- net/ipv4/igmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
net/ipv4/igmp.c +13 -3
@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2
@@ -138,6 +139,14 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) +return IGMP_V2_Unsolicited_Report_Interval; +else /* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; +} +static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);static void igmpv3_del_delrec (struct in_device *in_dev,__be32 multiaddr);static void igmpv3_clear_delrec (struct in_device *in_dev);
@@ -719,7 +728,8 @@ static void igmp_ifc_timer_expire(unsigned long data)igmpv3_send_cr (in_dev);if (in_dev->mr_ifc_count) { in_dev->mr_ifc_count--; -igmp_ifc_start_timer (in_dev, IGMP_Unsolicited_Report_Interval); +igmp_ifc_start_timer (in_dev, +unsolicited_report_interval (in_dev)); }__in_dev_put (in_dev); }
@@ -744,7 +754,7 @@ static void igmp_timer_expire(unsigned long data)if (im->unsolicit_count) { im->unsolicit_count--; -igmp_start_timer (im, IGMP_Unsolicited_Report_Interval); +igmp_start_timer (im,unsolicited_report_interval (in_dev)); } im->reporter =1 ;spin_unlock (&im->lock);
Signature · 1 line
1.7.10.4
PATCH v3 2/2 net: igmp: Allow user-space configuration of igmp unsolicited report interval
Adds the new procfs knobs:
/proc/sys/net/ipv4/conf/*/igmpv2_unsolicited_report_interval /proc/sys/net/ipv4/conf/*/igmpv3_unsolicited_report_interval
Which will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The default 1000ms for IGMPv2 and 10000 for IGMPv3 in accordance with RFC2236 and RFC3376.
Background:
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Prior to this patch this value was hard coded in the kernel to 10s for IGMPv2 and 1s for IGMPv3. 10s is unsuitable for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
This patch allows the value to be overridden from userspace changed for both IGMPv2 and IGMPv3 such that it can be tuned accoding to the network.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_unsolicited_report_interval.
igmpvX_unsolicited_report_interval is intended to follow the pattern established by force_igmp_version, and while a procfs entry has been added a corresponding sysctl knob has not as it is my understanding that sysctl is deprecated[1].
[1]: http://lwn.net/Articles/247243/
--- include/linux/inetdevice.h | 4 ++++ net/ipv4/devinet.c | 8 ++++++++ net/ipv4/igmp.c | 19 +++++++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-)
include/linux/inetdevice.h +4 -0
@@ -30,6 +30,8 @@ enumIPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY ,IPV4_DEVCONF_FORCE_IGMP_VERSION , +IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL , +IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL ,IPV4_DEVCONF_ARP_ANNOUNCE ,IPV4_DEVCONF_ARP_IGNORE , IPV4_DEVCONF_PROMOTE_SECONDARIES,
@@ -62,6 +64,8 @@ struct in_device {unsigned long mr_v1_seen;unsigned long mr_v2_seen;unsigned long mr_maxdelay; +unsigned long mr_v2_unsolicited_report_interval; +unsigned long mr_v3_unsolicited_report_interval;unsigned char mr_qrv;unsigned char mr_gq_running;unsigned char mr_ifc_count;
net/ipv4/devinet.c +8 -0
@@ -73,6 +73,8 @@ static struct ipv4_devconf ipv4_devconf = { [IPV4_DEVCONF_SEND_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };
@@ -83,6 +85,8 @@ static struct ipv4_devconf ipv4_devconf_dflt = { [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };
@@ -2099,6 +2103,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , +"igmpv2_unsolicited_report_interval" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,
net/ipv4/igmp.c +17 -2
@@ -141,10 +141,25 @@static int unsolicited_report_interval (struct in_device *in_dev) { +int interval_ms, interval_jiffies; +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) -return IGMP_V2_Unsolicited_Report_Interval; + interval_ms =IPV4_DEVCONF_ALL ( +dev_net (in_dev->dev), +IGMPV2_UNSOLICITED_REPORT_INTERVAL );else /* v3 */ -return IGMP_V3_Unsolicited_Report_Interval; + interval_ms =IPV4_DEVCONF_ALL ( +dev_net (in_dev->dev), +IGMPV3_UNSOLICITED_REPORT_INTERVAL ); + + interval_jiffies =msecs_to_jiffies (interval_ms); + +/* _timer functions can't handle a delay of 0 jiffies so ensure +* we always return a positive value. +*/ +if (interval_jiffies <=0 ) + interval_jiffies =1 ; +return interval_jiffies; }static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);
Signature · 1 line
1.7.10.4
Re: [PATCH v3 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
Quoted 43 lines · William Manley
include/linux/inetdevice.h +4
-0@@ -30,6 +30,8 @@ enumIPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY ,IPV4_DEVCONF_FORCE_IGMP_VERSION , +IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL , +IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL ,IPV4_DEVCONF_ARP_ANNOUNCE ,IPV4_DEVCONF_ARP_IGNORE , IPV4_DEVCONF_PROMOTE_SECONDARIES,@@ -62,6 +64,8 @@ struct in_device {unsigned long mr_v1_seen;unsigned long mr_v2_seen;unsigned long mr_maxdelay; +unsigned long mr_v2_unsolicited_report_interval; +unsigned long mr_v3_unsolicited_report_interval;unsigned char mr_qrv;unsigned char mr_gq_running;unsigned char mr_ifc_count;net/ipv4/devinet.c +4
-0@@ -73,6 +73,8 @@ static struct ipv4_devconf ipv4_devconf = { [IPV4_DEVCONF_SEND_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };@@ -83,6 +85,8 @@ static struct ipv4_devconf ipv4_devconf_dflt = { [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };
net/ipv4/devinet.c static struct devinet_sysctl_table { · line 2112
Quoted 10 lines
net/ipv4/devinet.c +4
-0@@ -2099,6 +2103,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , +"igmpv2_unsolicited_report_interval" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,
Why did you use DEVINET_SYSCTL_FLUSHING_ENTRY here? Wouldn't DEVINET_SYSCTL_RW_ENTRY be a better choice?
Quoted 5 lines
net/ipv4/igmp.c +0
-0
net/ipv4/igmp.c line 149
Quoted 10 lines
net/ipv4/igmp.c +5
-1@@ -141,10 +141,25 @@static int unsolicited_report_interval (struct in_device *in_dev) { +int interval_ms, interval_jiffies; +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) -return IGMP_V2_Unsolicited_Report_Interval; + interval_ms =IPV4_DEVCONF_ALL ( +dev_net (in_dev->dev), +IGMPV2_UNSOLICITED_REPORT_INTERVAL );
IN_DEV_CONF_GET()?
Or should the igmpv{2,3}_unsolicited_report_interval only be a global setting?
net/ipv4/igmp.c line 153
Quoted 5 lines
net/ipv4/igmp.c +3
-1else /* v3 */ -return IGMP_V3_Unsolicited_Report_Interval; + interval_ms =IPV4_DEVCONF_ALL ( +dev_net (in_dev->dev), +IGMPV3_UNSOLICITED_REPORT_INTERVAL );
Here as well.
net/ipv4/igmp.c line 159
Quoted 6 lines
net/ipv4/igmp.c +6
-0+ + interval_jiffies =msecs_to_jiffies (interval_ms); + +/* _timer functions can't handle a delay of 0 jiffies so ensure +* we always return a positive value. +*/
I am not sure here, but have seen mod_timer with 0 work before. But it is a good idea anyway.
Quoted 4 lines
net/ipv4/igmp.c +3
-0+if (interval_jiffies <=0 ) + interval_jiffies =1 ; +return interval_jiffies; }
David Miller
maintainerRe: [PATCH v3 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
From: Hannes Frederic Sowa <[email protected]>
Date: Tue, 30 Jul 2013 08:14:26 +0200
Quoted 7 lines · William Manley
Quoted 6 lines
net/ipv4/devinet.c +2
-0@@ -2099,6 +2103,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , + "igmpv2_unsolicited_report_interval"),
Quoted 8 lines
net/ipv4/devinet.c static struct devinet_sysctl_table { · line 2112
Quoted 5 lines
net/ipv4/devinet.c +2
-0+DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,Why did you use
DEVINET_SYSCTL_FLUSHING_ENTRYhere? Wouldn'tDEVINET_SYSCTL_RW_ENTRYbe a better choice?
Agreed, there is no reason to flush the routing cache just because the igmp unsolicited report interval changed.
Re: [PATCH v3 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
Quoted 19 lines · David Miller
From: Hannes Frederic Sowa <[email protected]>
Date: Tue, 30 Jul 2013 08:14:26 +0200Quoted 7 lines · William Manley
Quoted 6 lines
net/ipv4/devinet.c +2
-0@@ -2099,6 +2103,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , + "igmpv2_unsolicited_report_interval"),Quoted 8 lines
net/ipv4/devinet.c static struct devinet_sysctl_table { · line 2112
Quoted 5 lines
net/ipv4/devinet.c +2
-0+DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,Why did you use
DEVINET_SYSCTL_FLUSHING_ENTRYhere? Wouldn'tDEVINET_SYSCTL_RW_ENTRYbe a better choice?
Quoted 2 lines
Agreed, there is no reason to flush the routing cache just because the igmp unsolicited report interval changed.
William, could you convert force_igmp_version to DEVINET_SYSCTL_RW_ENTRY as well when you send a new patch?
Thanks,
Hannes
Re: [PATCH v3 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
Quoted 20 lines · Hannes Frederic Sowa
Quoted 19 lines · David Miller
From: Hannes Frederic Sowa<[email protected]>
Date: Tue, 30 Jul 2013 08:14:26 +0200Quoted 15 lines · William Manley
net/ipv4/devinet.c static struct devinet_sysctl_table { · line 2112
Quoted 11 lines
net/ipv4/devinet.c +4
-0@@ -2099,6 +2103,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ),DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , +"igmpv2_unsolicited_report_interval" ), +DEVINET_SYSCTL_FLUSHING_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,Why did you use
DEVINET_SYSCTL_FLUSHING_ENTRYhere? Wouldn'tDEVINET_SYSCTL_RW_ENTRYbe a better choice?
Quoted 5 lines
Quoted 2 lines
Agreed, there is no reason to flush the routing cache just because the igmp unsolicited report interval changed.
William, could you convert
force_igmp_versiontoDEVINET_SYSCTL_RW_ENTRYas well when you send a new patch?
Will do. I have to confess I only made it flushing because I was copying force_igmp_version without understanding.
Will take a couple of days as I have a bunch of other stuff on ATM.
Thanks
Will
IGMP Unsolicited report interval patches
In reply to Hannes Frederic Sowa4th version of the patches.
The significant changes since last review are:
1. there is a new patch (2/3) as requested by Hannes.
2. the third patch now uses IN_DEV_CONF_GET in place of IPV4_DEVCONF_ALL. This means that the unsolicited report interval can now be configured on an interface-by-interface basis as I'd originally intended but messed up in the implementation. One concern I have now is that with this latest patch-set is that while /proc/sys/net/ipv4/conf/eth0/igmp... will now have an effect /proc/sys/net/ipv4/conf/all/igmp... will not. I'm not sure how to resolve this.
One option would be to have a special value of -1 to mean use the default so I could implement fall-back semantics. A down-side of this approach is that it makes the meaning of the knobs less clear for someone browsing through the filesystem. Another option would be to remove the knob from all/ entirely, although I'm not sure how to do this. Suggestions are very much welcome :)
Thanks
Will
PATCH v4 1/3 net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting /proc/sys/net/ipv4/conf/eth0/force_igmp_version.
--- net/ipv4/igmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
net/ipv4/igmp.c +13 -3
@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2
@@ -138,6 +139,14 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) +return IGMP_V2_Unsolicited_Report_Interval; +else /* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; +} +static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);static void igmpv3_del_delrec (struct in_device *in_dev,__be32 multiaddr);static void igmpv3_clear_delrec (struct in_device *in_dev);
@@ -719,7 +728,8 @@ static void igmp_ifc_timer_expire(unsigned long data)igmpv3_send_cr (in_dev);if (in_dev->mr_ifc_count) { in_dev->mr_ifc_count--; -igmp_ifc_start_timer (in_dev, IGMP_Unsolicited_Report_Interval); +igmp_ifc_start_timer (in_dev, +unsolicited_report_interval (in_dev)); }__in_dev_put (in_dev); }
@@ -744,7 +754,7 @@ static void igmp_timer_expire(unsigned long data)if (im->unsolicit_count) { im->unsolicit_count--; -igmp_start_timer (im, IGMP_Unsolicited_Report_Interval); +igmp_start_timer (im,unsolicited_report_interval (in_dev)); } im->reporter =1 ;spin_unlock (&im->lock);
Signature · 1 line
1.7.10.4
Re: [PATCH v4 1/3] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
Quoted 14 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Quoted 5 lines
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.Signed-off-by William Manley <[email protected]>
Re: [PATCH v4 1/3] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
In reply to William ManleyQuoted 14 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Quoted 5 lines
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.Signed-off-by William Manley <[email protected]>
-ben
Quoted 54 lines
--- net/ipv4/igmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)net/ipv4/igmp.c +13
-3@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2@@ -138,6 +139,14 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) +return IGMP_V2_Unsolicited_Report_Interval; +else /* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; +} +static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);static void igmpv3_del_delrec (struct in_device *in_dev,__be32 multiaddr);static void igmpv3_clear_delrec (struct in_device *in_dev);@@ -719,7 +728,8 @@ static void igmp_ifc_timer_expire(unsigned long data)igmpv3_send_cr (in_dev);if (in_dev->mr_ifc_count) { in_dev->mr_ifc_count--; -igmp_ifc_start_timer (in_dev, IGMP_Unsolicited_Report_Interval); +igmp_ifc_start_timer (in_dev, +unsolicited_report_interval (in_dev)); }__in_dev_put (in_dev); }@@ -744,7 +754,7 @@ static void igmp_timer_expire(unsigned long data)if (im->unsolicit_count) { im->unsolicit_count--; -igmp_start_timer (im, IGMP_Unsolicited_Report_Interval); +igmp_start_timer (im,unsolicited_report_interval (in_dev)); } im->reporter =1 ;spin_unlock (&im->lock);Signature · 1 line
1.7.10.4
Signature · 1 line
"Thought is the essence of where you are now."
PATCH v4 2/3 net: igmp: Don't flush routing cache when force_igmp_version is modified
In reply to William ManleyThe procfs knob /proc/sys/net/ipv4/conf/*/force_igmp_version allows the IGMP protocol version to use to be explicitly set. As a side effect this caused the routing cache to be flushed as it was declared as a DEVINET_SYSCTL_FLUSHING_ENTRY. Flushing is unnecessary and this patch makes it so flushing does not occur.
Requested by Hannes Frederic Sowa as he was reviewing other patches adding procfs entries.
--- include/linux/inetdevice.h | 2 +- net/ipv4/devinet.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/inetdevice.h +1 -1
@@ -27,9 +27,9 @@ enumIPV4_DEVCONF_TAG ,IPV4_DEVCONF_ARPFILTER ,IPV4_DEVCONF_MEDIUM_ID , +IPV4_DEVCONF_FORCE_IGMP_VERSION ,IPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY , -IPV4_DEVCONF_FORCE_IGMP_VERSION ,IPV4_DEVCONF_ARP_ANNOUNCE ,IPV4_DEVCONF_ARP_IGNORE , IPV4_DEVCONF_PROMOTE_SECONDARIES,
net/ipv4/devinet.c +2 -2
@@ -2094,11 +2094,11 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_RW_ENTRY (ARP_ACCEPT ,"arp_accept" ),DEVINET_SYSCTL_RW_ENTRY (ARP_NOTIFY ,"arp_notify" ),DEVINET_SYSCTL_RW_ENTRY (PROXY_ARP_PVLAN ,"proxy_arp_pvlan" ), +DEVINET_SYSCTL_RW_ENTRY (FORCE_IGMP_VERSION , +"force_igmp_version" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOXFRM ,"disable_xfrm" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ), -DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION , -"force_igmp_version" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,
Signature · 1 line
1.7.10.4
Re: [PATCH v4 2/3] net: igmp: Don't flush routing cache when force_igmp_version is modified
Quoted 11 lines · William Manley
The procfs knob
/proc/sys/net/ipv4/conf/*/force_igmp_versionallows the IGMP protocol version to use to be explicitly set. As a side effect this caused the routing cache to be flushed as it was declared as aDEVINET_SYSCTL_FLUSHING_ENTRY. Flushing is unnecessary and this patch makes it so flushing does not occur.Requested by Hannes Frederic Sowa as he was reviewing other patches adding procfs entries.
Suggested-by Hannes Frederic Sowa <[email protected]>Signed-off-by William Manley <[email protected]>
Re: [PATCH v4 2/3] net: igmp: Don't flush routing cache when force_igmp_version is modified
In reply to William ManleyQuoted 11 lines · William Manley
The procfs knob
/proc/sys/net/ipv4/conf/*/force_igmp_versionallows the IGMP protocol version to use to be explicitly set. As a side effect this caused the routing cache to be flushed as it was declared as aDEVINET_SYSCTL_FLUSHING_ENTRY. Flushing is unnecessary and this patch makes it so flushing does not occur.Requested by Hannes Frederic Sowa as he was reviewing other patches adding procfs entries.
Suggested-by Hannes Frederic Sowa <[email protected]>Signed-off-by William Manley <[email protected]>
Looks good.
Quoted 40 lines
--- include/linux/inetdevice.h | 2 +- net/ipv4/devinet.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)include/linux/inetdevice.h +1
-1@@ -27,9 +27,9 @@ enumIPV4_DEVCONF_TAG ,IPV4_DEVCONF_ARPFILTER ,IPV4_DEVCONF_MEDIUM_ID , +IPV4_DEVCONF_FORCE_IGMP_VERSION ,IPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY , -IPV4_DEVCONF_FORCE_IGMP_VERSION ,IPV4_DEVCONF_ARP_ANNOUNCE ,IPV4_DEVCONF_ARP_IGNORE , IPV4_DEVCONF_PROMOTE_SECONDARIES,net/ipv4/devinet.c +2
-2@@ -2094,11 +2094,11 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_RW_ENTRY (ARP_ACCEPT ,"arp_accept" ),DEVINET_SYSCTL_RW_ENTRY (ARP_NOTIFY ,"arp_notify" ),DEVINET_SYSCTL_RW_ENTRY (PROXY_ARP_PVLAN ,"proxy_arp_pvlan" ), +DEVINET_SYSCTL_RW_ENTRY (FORCE_IGMP_VERSION , +"force_igmp_version" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOXFRM ,"disable_xfrm" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOPOLICY ,"disable_policy" ), -DEVINET_SYSCTL_FLUSHING_ENTRY (FORCE_IGMP_VERSION , -"force_igmp_version" ),DEVINET_SYSCTL_FLUSHING_ENTRY (PROMOTE_SECONDARIES ,"promote_secondaries" ), DEVINET_SYSCTL_FLUSHING_ENTRY(ROUTE_LOCALNET,Signature · 1 line
1.7.10.4
Signature · 1 line
"Thought is the essence of where you are now."
PATCH v4 3/3 net: igmp: Allow user-space configuration of igmp unsolicited report interval
In reply to William ManleyAdds the new procfs knobs:
/proc/sys/net/ipv4/conf/*/igmpv2_unsolicited_report_interval /proc/sys/net/ipv4/conf/*/igmpv3_unsolicited_report_interval
Which will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The defaults are 10000ms for IGMPv2 and 1000ms for IGMPv3 in accordance with RFC2236 and RFC3376.
Background:
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Prior to this patch this value was hard coded in the kernel to 10s for IGMPv2 and 1s for IGMPv3. 10s is unsuitable for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
This patch allows the value to be overridden from userspace for both IGMPv2 and IGMPv3 such that it can be tuned accoding to the network.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting the procfs knobs.
igmpvX_unsolicited_report_interval is intended to follow the pattern established by force_igmp_version, and while a procfs entry has been added a corresponding sysctl knob has not as it is my understanding that sysctl is deprecated[1].
[1]: http://lwn.net/Articles/247243/
--- include/linux/inetdevice.h | 2 ++ net/ipv4/devinet.c | 8 ++++++++ net/ipv4/igmp.c | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-)
include/linux/inetdevice.h +2 -0
@@ -28,6 +28,8 @@ enumIPV4_DEVCONF_ARPFILTER ,IPV4_DEVCONF_MEDIUM_ID ,IPV4_DEVCONF_FORCE_IGMP_VERSION , +IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL , +IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL ,IPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY , IPV4_DEVCONF_ARP_ANNOUNCE,
net/ipv4/devinet.c +8 -0
@@ -73,6 +73,8 @@ static struct ipv4_devconf ipv4_devconf = { [IPV4_DEVCONF_SEND_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };
@@ -83,6 +85,8 @@ static struct ipv4_devconf ipv4_devconf_dflt = { [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };
@@ -2096,6 +2100,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_RW_ENTRY (PROXY_ARP_PVLAN ,"proxy_arp_pvlan" ),DEVINET_SYSCTL_RW_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_RW_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , +"igmpv2_unsolicited_report_interval" ), +DEVINET_SYSCTL_RW_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOXFRM ,"disable_xfrm" ), DEVINET_SYSCTL_FLUSHING_ENTRY(NOPOLICY, "disable_policy"),
net/ipv4/igmp.c +17 -2
@@ -141,10 +141,25 @@static int unsolicited_report_interval (struct in_device *in_dev) { +int interval_ms, interval_jiffies; +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) -return IGMP_V2_Unsolicited_Report_Interval; + interval_ms =IN_DEV_CONF_GET ( + in_dev, +IGMPV2_UNSOLICITED_REPORT_INTERVAL );else /* v3 */ -return IGMP_V3_Unsolicited_Report_Interval; + interval_ms =IN_DEV_CONF_GET ( + in_dev, +IGMPV3_UNSOLICITED_REPORT_INTERVAL ); + + interval_jiffies =msecs_to_jiffies (interval_ms); + +/* _timer functions can't handle a delay of 0 jiffies so ensure +* we always return a positive value. +*/ +if (interval_jiffies <=0 ) + interval_jiffies =1 ; +return interval_jiffies; }static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);
Signature · 1 line
1.7.10.4
Re: [PATCH v4 3/3] net: igmp: Allow user-space configuration of igmp unsolicited report interval
Quoted 28 lines · William Manley
Adds the new procfs knobs:
/proc/sys/net/ipv4/conf/*/igmpv2_unsolicited_report_interval/proc/sys/net/ipv4/conf/*/igmpv3_unsolicited_report_intervalWhich will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The defaults are 10000ms for IGMPv2 and 1000ms for IGMPv3 in accordance with RFC2236 and RFC3376.
Background:
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Prior to this patch this value was hard coded in the kernel to 10s for IGMPv2 and 1s for IGMPv3. 10s is unsuitable for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
This patch allows the value to be overridden from userspace for both IGMPv2 and IGMPv3 such that it can be tuned accoding to the network.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting the procfs knobs.
Quoted 8 lines
igmpvX_unsolicited_report_intervalis intended to follow the pattern established byforce_igmp_version, and while a procfs entry has been added a corresponding sysctl knob has not as it is my understanding that sysctl is deprecated[1].[1]: http://lwn.net/Articles/247243/
Signed-off-by William Manley <[email protected]>
Re: [PATCH v4 3/3] net: igmp: Allow user-space configuration of igmp unsolicited report interval
In reply to William ManleyQuoted 28 lines · William Manley
Adds the new procfs knobs:
/proc/sys/net/ipv4/conf/*/igmpv2_unsolicited_report_interval/proc/sys/net/ipv4/conf/*/igmpv3_unsolicited_report_intervalWhich will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The defaults are 10000ms for IGMPv2 and 1000ms for IGMPv3 in accordance with RFC2236 and RFC3376.
Background:
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Prior to this patch this value was hard coded in the kernel to 10s for IGMPv2 and 1s for IGMPv3. 10s is unsuitable for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
This patch allows the value to be overridden from userspace for both IGMPv2 and IGMPv3 such that it can be tuned accoding to the network.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting the procfs knobs.
Quoted 8 lines
igmpvX_unsolicited_report_intervalis intended to follow the pattern established byforce_igmp_version, and while a procfs entry has been added a corresponding sysctl knob has not as it is my understanding that sysctl is deprecated[1].[1]: http://lwn.net/Articles/247243/
Signed-off-by William Manley <[email protected]>
Also good. Thanks!
-ben
Quoted 86 lines
--- include/linux/inetdevice.h | 2 ++ net/ipv4/devinet.c | 8 ++++++++ net/ipv4/igmp.c | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-)include/linux/inetdevice.h +2
-0@@ -28,6 +28,8 @@ enumIPV4_DEVCONF_ARPFILTER ,IPV4_DEVCONF_MEDIUM_ID ,IPV4_DEVCONF_FORCE_IGMP_VERSION , +IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL , +IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL ,IPV4_DEVCONF_NOXFRM ,IPV4_DEVCONF_NOPOLICY , IPV4_DEVCONF_ARP_ANNOUNCE,net/ipv4/devinet.c +8
-0@@ -73,6 +73,8 @@ static struct ipv4_devconf ipv4_devconf = { [IPV4_DEVCONF_SEND_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };@@ -83,6 +85,8 @@ static struct ipv4_devconf ipv4_devconf_dflt = { [IPV4_DEVCONF_SECURE_REDIRECTS - 1] = 1, [IPV4_DEVCONF_SHARED_MEDIA - 1] = 1, [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE - 1] = 1, + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL - 1] = 10000 /*ms*/, + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL - 1] = 1000 /*ms*/, }, };@@ -2096,6 +2100,10 @@ static struct devinet_sysctl_table {DEVINET_SYSCTL_RW_ENTRY (PROXY_ARP_PVLAN ,"proxy_arp_pvlan" ),DEVINET_SYSCTL_RW_ENTRY (FORCE_IGMP_VERSION ,"force_igmp_version" ), +DEVINET_SYSCTL_RW_ENTRY (IGMPV2_UNSOLICITED_REPORT_INTERVAL , +"igmpv2_unsolicited_report_interval" ), +DEVINET_SYSCTL_RW_ENTRY (IGMPV3_UNSOLICITED_REPORT_INTERVAL , +"igmpv3_unsolicited_report_interval" ),DEVINET_SYSCTL_FLUSHING_ENTRY (NOXFRM ,"disable_xfrm" ), DEVINET_SYSCTL_FLUSHING_ENTRY(NOPOLICY, "disable_policy"),net/ipv4/igmp.c +17
-2@@ -141,10 +141,25 @@static int unsolicited_report_interval (struct in_device *in_dev) { +int interval_ms, interval_jiffies; +if (IGMP_V1_SEEN (in_dev) ||IGMP_V2_SEEN (in_dev)) -return IGMP_V2_Unsolicited_Report_Interval; + interval_ms =IN_DEV_CONF_GET ( + in_dev, +IGMPV2_UNSOLICITED_REPORT_INTERVAL );else /* v3 */ -return IGMP_V3_Unsolicited_Report_Interval; + interval_ms =IN_DEV_CONF_GET ( + in_dev, +IGMPV3_UNSOLICITED_REPORT_INTERVAL ); + + interval_jiffies =msecs_to_jiffies (interval_ms); + +/* _timer functions can't handle a delay of 0 jiffies so ensure +* we always return a positive value. +*/ +if (interval_jiffies <=0 ) + interval_jiffies =1 ; +return interval_jiffies; }static void igmpv3_add_delrec (struct in_device *in_dev,struct ip_mc_list *im);Signature · 1 line
1.7.10.4
Signature · 1 line
"Thought is the essence of where you are now."
Re: IGMP Unsolicited report interval patches
In reply to William ManleyQuoted 5 lines · William Manley
4th version of the patches.
The significant changes since last review are:
1. there is a new patch (2/3) as requested by Hannes.
Thanks!
Quoted 8 lines
2. the third patch now uses
IN_DEV_CONF_GETin place ofIPV4_DEVCONF_ALL. This means that the unsolicited report interval can now be configured on an interface-by-interface basis as I'd originally intended but messed up in the implementation. One concern I have now is that with this latest patch-set is that while/proc/sys/net/ipv4/conf/eth0/igmp... will now have an effect/proc/sys/net/ipv4/conf/all/igmp... will not. I'm not sure how to resolve this.
Hm, it seems to be come more difficult dealing with ranges.
One way would be, to check the state bit for the devinet entry and chose the all value always but when the state bit for the interface for this entry is set. I'll have a look on how to do this.
Quoted 6 lines
One option would be to have a special value of -1 to mean use the default so I could implement fall-back semantics. A down-side of this approach is that it makes the meaning of the knobs less clear for someone browsing through the filesystem. Another option would be to remove the knob from all/ entirely, although I'm not sure how to do this. Suggestions are very much welcome :)
This seems to be confusing, at least or me. ;)
Thanks for the series! The patches are find IMHO.
Do you plan to make the corresponding changes for ipv6 or should I put that on my todo list?
Thanks,
Hannes
Re: IGMP Unsolicited report interval patches
Quoted 18 lines · Hannes Frederic Sowa
Quoted 5 lines · William Manley
4th version of the patches.
The significant changes since last review are:
1. there is a new patch (2/3) as requested by Hannes.
Thanks!
Quoted 8 lines
2. the third patch now uses
IN_DEV_CONF_GETin place ofIPV4_DEVCONF_ALL. This means that the unsolicited report interval can now be configured on an interface-by-interface basis as I'd originally intended but messed up in the implementation. One concern I have now is that with this latest patch-set is that while/proc/sys/net/ipv4/conf/eth0/igmp... will now have an effect/proc/sys/net/ipv4/conf/all/igmp... will not. I'm not sure how to resolve this.
Quoted 5 lines
Hm, it seems to be come more difficult dealing with ranges.
One way would be, to check the state bit for the devinet entry and chose the all value always but when the state bit for the interface for this entry is set. I'll have a look on how to do this.
We copy ipv4_devconf_dftl over to the per-interface ipv4_devconf as long no address is assigned to the interface.
The copy-over is guarded by by the cnf.state bitmap. It is set to all ones in ipv4_devconf_setall which gets called at the relevant places. Instead of setting all bits we could just apply a bitmask which would still allow a propagation of the default/*igmp* parameters.
The all namespace has special semantics and decision what to apply are done per knob. I wouldn't fiddle with that.
Greetings,
Hannes
David Miller
maintainerRe: IGMP Unsolicited report interval patches
In reply to William ManleyFrom: William Manley <[email protected]>
Date: Tue, 6 Aug 2013 19:03:12 +0100
Quoted 1 line
4th version of the patches.
Series applied, thanks.
Re: [PATCH v3 2/2] net: igmp: Allow user-space configuration of igmp unsolicited report interval
In reply to William ManleyQuoted 8 lines · William Manley
Adds the new procfs knobs:
/proc/sys/net/ipv4/conf/*/igmpv2_unsolicited_report_interval/proc/sys/net/ipv4/conf/*/igmpv3_unsolicited_report_intervalWhich will allow userspace configuration of the IGMP unsolicited report interval (see below) in milliseconds. The default 1000ms for IGMPv2 and 10000 for IGMPv3 in accordance with RFC2236 and RFC3376.
You have the 1000/10000 ms for IGMPv2/IGMPv3 flipped in your commit message above.
-Bill
Re: [PATCH v3 1/2] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
In reply to William ManleyQuoted 14 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Quoted 5 lines
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.Signed-off-by William Manley <[email protected]>
Thanks,
Hannes
Re: [PATCH 1/2] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
In reply to William ManleyQuoted 38 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.Signed-off-by William Manley <[email protected]>--- net/ipv4/igmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)net/ipv4/igmp.c +2
-1@@ -113,7 +113,8 @@#define IGMP_V1_Router_Present_Timeout (400*HZ)#define IGMP_V2_Router_Present_Timeout (400*HZ) -#define IGMP_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V2_Unsolicited_Report_Interval (10*HZ) +#define IGMP_V3_Unsolicited_Report_Interval (1*HZ)#define IGMP_Query_Response_Interval (10*HZ)#define IGMP_Unsolicited_Report_Count 2
net/ipv4/igmp.c line 148
Quoted 10 lines
net/ipv4/igmp.c +7
-0@@ -138,6 +139,14 @@ ((in_dev)->mr_v2_seen && \ time_before(jiffies, (in_dev)->mr_v2_seen))) +static int unsolicited_report_interval (struct in_device *in_dev) +{ +if (IGMP_V2_SEEN (in_dev)) +return IGMP_V2_Unsolicited_Report_Interval; +else /* v3 */ +return IGMP_V3_Unsolicited_Report_Interval; +}
if (IGMP_V1_SEEN(in_dev) || IGMP_V2_SEEN(in_dev))
Otherwise I am fine with it.
Thanks,
Hannes
Re: [PATCH 1/2] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
Quoted 19 lines · Hannes Frederic Sowa
Quoted 18 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.
Quoted 6 lines
Quoted 2 lines
[...]
[...]
Otherwise I am fine with it.
Also, could you have a look at IPv6, too? We currently use a hardcoded IGMP6_UNSOLICITED_IVAL = 10*HZ there.
Thanks,
Hannes
Re: [PATCH 1/2] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
Quoted 23 lines · Hannes Frederic Sowa
Quoted 22 lines · Hannes Frederic Sowa
Quoted 20 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
Previously this value was hard coded to be chosen randomly between 0-10s. This can be too long for some use-cases, such as IPTV as it can cause channel change to be slow in the presence of packet loss.
The value 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376. This patch makes the kernel use the 1s value from the later RFC if we are operating in IGMPv3 mode. IGMPv2 behaviour is unaffected.
Tested with Wireshark and a simple program to join a (non-existent) multicast group. The distribution of timings for the second join differ based upon setting
/proc/sys/net/ipv4/conf/eth0/force_igmp_version.[...]
Quoted 6 lines
Quoted 3 lines
[...]
Otherwise I am fine with it.
Also, could you have a look at IPv6, too? We currently use a hardcoded
IGMP6_UNSOLICITED_IVAL= 10*HZ there.
I'll have a look, but I have to admit my ignorance on how multicast works with IPv6 and I may have difficulty setting up a test environment.
It seems that IGMP has been replaced with "Multicast Listener Discovery" on top of ICMPv6 and much like IGMP there is more than one version:
1. RFC2710 - MLD - Unsolicited Report Interval = 10s
2. RFC3810 - MLDv2 - Unsolicited Report Interval = 1s
There also seems to be a /proc/sys/net/ipv6/conf/all/force_mld_version.
Ok, so maybe it's not so difficult. I'll see if I can come up with
some additional patches but I'd prefer to keep them separate from the IPv4 ones which I hope are now good-to-go.
Thanks
Will
Re: [PATCH 1/2] net: igmp: Reduce Unsolicited report interval to 1s when using IGMPv3
Quoted 8 lines · William Manley
I'll have a look, but I have to admit my ignorance on how multicast works with IPv6 and I may have difficulty setting up a test environment.
It seems that IGMP has been replaced with "Multicast Listener Discovery" on top of ICMPv6 and much like IGMP there is more than one version:
1. RFC2710 - MLD - Unsolicited Report Interval = 10s
2. RFC3810 - MLDv2 - Unsolicited Report Interval = 1s
Correct.
Quoted 4 lines
There also seems to be a
/proc/sys/net/ipv6/conf/all/force_mld_version.
Ok, so maybe it's not so difficult. I'll see if I can come up with
some additional patches but I'd prefer to keep them separate from the IPv4 ones which I hope are now good-to-go.
Of course, separate patches for ipv6 are favorable. The code is actually pretty similar to IPv4. Let me know if you need help.
I'll review your IPv4 patches now.
Thanks,
Hannes
Quoted 11 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay. I've encountered similar issues dealing with LCP Echo request/replies for keepalive messages on PPP sessions. The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue. Sending packets with an 802.1p header might be appropriate in your use-case, or perhaps using higher priority internal queues.
-ben
Quoted 18 lines
There was a thread about this on linux-rdma in 2010 in the context of IP over Infiniband but it seems no patches got applied as a result of the discussion:
http://www.mail-archive.com/[email protected]/msg05740.html
Would the right patch reducing the unsolicited report interval for IGMPv3 be acceptable now?
Thanks
Will
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
"Thought is the essence of where you are now."
Quoted 13 lines · Benjamin LaHaise
Quoted 11 lines · William Manley
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Quoted 8 lines
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay. I've encountered similar issues dealing with LCP Echo request/replies for keepalive messages on PPP sessions. The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue. Sending packets with an 802.1p header might be appropriate in your use-case, or perhaps using higher priority internal queues.
Yes, we can do a little bit better. What do you think?
[PATCH net-next] ipv6: send igmpv3/mld packets with TC_PRIO_CONTROL
--- net/ipv6/mcast.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv6/mcast.c +3 -1
@@ -44,6 +44,7 @@#include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/slab.h> +#include <linux/pkt_sched.h> #include <net/mld.h> #include <linux/netfilter.h>
@@ -1376,6 +1377,7 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, int size)if (!skb)return NULL ; + skb->priority =TC_PRIO_CONTROL ;skb_reserve (skb, hlen);if (__ipv6_get_lladdr (idev, &addr_buf,IFA_F_TENTATIVE )) {
@@ -1769,7 +1771,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)rcu_read_unlock ();return ; } - + skb->priority =TC_PRIO_CONTROL ;skb_reserve (skb, hlen);if (ipv6_get_lladdr (dev, &addr_buf,IFA_F_TENTATIVE )) {
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Hannes Frederic Sowa <[email protected]>
Date: Mon, 22 Jul 2013 23:51:08 +0200
Quoted 23 lines · Benjamin LaHaise
Quoted 13 lines · William Manley
Quoted 11 lines
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Quoted 8 lines
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay. I've encountered similar issues dealing with LCP Echo request/replies for keepalive messages on PPP sessions. The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue. Sending packets with an 802.1p header might be appropriate in your use-case, or perhaps using higher priority internal queues.
Quoted 7 lines
Yes, we can do a little bit better. What do you think?
[PATCH net-next] ipv6: send igmpv3/mld packets with
TC_PRIO_CONTROLReported-by William Manley <[email protected]>Suggested-by Benjamin LaHaise <[email protected]>Signed-off-by Hannes Frederic Sowa <[email protected]>
Ben, please give Hannes the feedback he is asking for.
Thanks.
Benjamin LaHaise
Acked-byQuoted 30 lines · David Miller
From: Hannes Frederic Sowa <[email protected]>
Date: Mon, 22 Jul 2013 23:51:08 +0200Quoted 27 lines · Benjamin LaHaise
Quoted 13 lines · William Manley
Quoted 11 lines
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Quoted 8 lines
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay. I've encountered similar issues dealing with LCP Echo request/replies for keepalive messages on PPP sessions. The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue. Sending packets with an 802.1p header might be appropriate in your use-case, or perhaps using higher priority internal queues.
Yes, we can do a little bit better. What do you think?
[PATCH net-next] ipv6: send igmpv3/mld packets with
TC_PRIO_CONTROL
Quoted 7 lines
Quoted 3 lines
Reported-by William Manley <[email protected]>Suggested-by Benjamin LaHaise <[email protected]>Signed-off-by Hannes Frederic Sowa <[email protected]>Ben, please give Hannes the feedback he is asking for.
Thanks.
I think Hannes' patch is good step in the right direction, so please add:
-ben
Signature · 1 line
"Thought is the essence of where you are now."
Quoted 35 lines · Benjamin LaHaise
Quoted 34 lines · David Miller
From: Hannes Frederic Sowa <[email protected]>
Date: Mon, 22 Jul 2013 23:51:08 +0200Quoted 30 lines · Benjamin LaHaise
Quoted 13 lines · William Manley
Quoted 11 lines
If an IGMP join packet is lost you will not receive data sent to the multicast group so if no data arrives from that multicast group in a period of time after the IGMP join a second IGMP join will be sent. The delay between joins is the "IGMP Unsolicited Report Interval".
In the kernel this seems to be hard coded to be chosen randomly between 0-10s. In our use-case (IPTV) this is too long as it can cause channel change to be slow in the presence of packet loss.
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Quoted 8 lines
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay. I've encountered similar issues dealing with LCP Echo request/replies for keepalive messages on PPP sessions. The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue. Sending packets with an 802.1p header might be appropriate in your use-case, or perhaps using higher priority internal queues.
Yes, we can do a little bit better. What do you think?
[PATCH net-next] ipv6: send igmpv3/mld packets with
TC_PRIO_CONTROLReported-by William Manley <[email protected]>Suggested-by Benjamin LaHaise <[email protected]>Signed-off-by Hannes Frederic Sowa <[email protected]>
Quoted 6 lines
Quoted 3 lines
Ben, please give Hannes the feedback he is asking for.
Thanks.
I think Hannes' patch is good step in the right direction, so please add:
Acked-by Benjamin LaHaise <[email protected]>
I just send a new patch with the priority changes for ipv4 included. I copied your Acked-by, I hope this is ok.
Thanks,
Hannes
Quoted 6 lines · Hannes Frederic Sowa
Quoted 2 lines · Benjamin LaHaise
I think Hannes' patch is good step in the right direction, so please add:
Acked-by Benjamin LaHaise <[email protected]>I just send a new patch with the priority changes for ipv4 included. I copied your Acked-by, I hope this is ok.
Sure, no problem. Thanks for fixing this.
-ben
Signature · 1 line
"Thought is the essence of where you are now."
Quoted 6 lines
Date: Mon, 22 Jul 2013 17:18:55 -0400
Quoted 2 lines
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay.
Packet loss will always result in a delay and I think William is well aware of that.
off-topic: 1 second is not a problem in IPTV, 10 seconds are ([1]).
Quoted 3 lines
The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue.
While this certainly makes sense, congestion is not the only reason for packet loss. There is no way to fix packet loss in lower network layers, like ADSL, satellite links or IPoAC.
Improving retransmission by making it more predictable, bringing it closer to RFC proposals and real life problems makes a lot of sense, imho. This includes setting TC_PRIO_CONTROL, but I'm not sure it will fix Williams use case.
lukas
Quoted 18 lines · Lukas Tribus
Quoted 6 lines
Date: Mon, 22 Jul 2013 17:18:55 -0400
Quoted 2 lines
I would guess that this 10s has come from IGMPv2 RFC2236, which was reduced to 1s in IGMPv3 RFC3376.
Reducing the timeout does not solve the problem you are encountering, as any packet loss will still result in a 1 second delay.
Packet loss will always result in a delay and I think William is well aware of that.
off-topic: 1 second is not a problem in IPTV, 10 seconds are ([1]).
Quoted 3 lines
The correct approach is to queue the IGMP multicast join with a higher priority than other traffic in the system so that the requests are not lost due to congestion of a single queue.
Quoted 8 lines
While this certainly makes sense, congestion is not the only reason for packet loss. There is no way to fix packet loss in lower network layers, like ADSL, satellite links or IPoAC.
Improving retransmission by making it more predictable, bringing it closer to RFC proposals and real life problems makes a lot of sense, imho. This includes setting
TC_PRIO_CONTROL, but I'm not sure it will fix Williams use case.
Yes, it was merely meant as an RFC without the appropriate changes for IPv4 (I somehow missed this in the patch marker :| ).
Regarding the value of the IGMP unsolicited report interval, I would strictly stick to the RFCs. So a change for IGMPv3 would be appropriate IMHO.
I would also suggest that posting patches would be favourable. I don't think it should be too much work.
Thanks,
Hannes