troglobit / pimd

PIM-SM/SSM multicast routing for UNIX and Linux
http://troglobit.com/projects/pimd/
BSD 3-Clause "New" or "Revised" License
197 stars 87 forks source link

Add support for configurable IGMP query interval #31

Closed timeos closed 9 years ago

timeos commented 10 years ago

hello just wanted to ask. can be somehow the igmp query changed? currently igmp query (v2) was sent out every ~2 minutes. it is possible to change it somehow? is there any configuration directive - global or per phyint to change this behavior? thank you

troglobit commented 10 years ago

Hi,

that's a TODO. The code in igmpv2.h needs to be parametrizizizied:

/*
 * Constants for IGMP Version 2.  Several of these, especially the
 * robustness variable, should be variables and not constants.
 */
#define IGMP_ROBUSTNESS_VARIABLE        2
#define IGMP_QUERY_INTERVAL         125
#define IGMP_QUERY_RESPONSE_INTERVAL        10

At least the query interval I'd like to see a global option for. I'll try to make it into the 2.2.0 release, but I'm quite busy with figuring out some RP issues and fragmentation support in register tunnel messages on Linux.

timeos commented 10 years ago

Hi troglobit thank you very much for your response. now it is much more clear to me. and thanks also for activity to parametrize it.

troglobit commented 10 years ago

Reopening for my own book keeping, and for referencing GIT commits to :)

troglobit commented 9 years ago

Pending audit and test before being merged to master.

pchri03 commented 9 years ago

IGMPv2 and IGMPv3 mandates that Other Querier Present Interval MUST be:

"((the Robustness Variable) times (the Query Interval)) plus (one half of one Query Response Interval)."

The idea is that you adjust robustness according to the expected packet loss in the network, and the Query Interval is adjusted according to desired level of IGMP traffic. Allowing users to adjust the interval directly, allow users to create configurations which violates spec and would result in loss of multicast traffic.

So ideally, default_igmp_querier_timeout is replaced by a default_igmp_robustness configuration parameter. Judging from the code, this would require quite a few changes to the code, though, so perhaps default_igmp_querier_timeout should just be removed and internally default to IGMP_ROBUSTNESS_VARIABLE * default_igmp_query_timeout() + IGMP_QUERY_RESPONSE_INTERVAL / 2.

Also, Query Response Interval is required to be less than the Query Interval, so it should probably warn if the default_igmp_query_interval is less than or equal to IGMP_QUERY_RESPONSE_INTERVAL.

troglobit commented 9 years ago

Why yeah, I'm aware of the standard ... but I'd rather look more to what the de-facto market leader does. The IGMP standard itself was also originally written with hubbed networks in mind ...

Looking at Cisco, as far as I can see they have the robustness value hard-coded and do not rely on it for the querier timeout. Instead query interval and querier timeout can be set more freely -- which in many cases is a lot better since you often probably don't want to wait for as long as the standard says -- if that happens you might already heave a serious network error on your hands.

However, Juniper does things more along the standard lines. With the net effect being that you must tweak the robustness variable and therefore will also affect the leave latency at the same time.

For me, being able to manually tweak the querier-timeout, like Cisco, and keeping the robustness variable hard-coded is a good middle ground for now. I'd like to make the robustness variable configurable, but as you noticed it's a lot of work.

I don't know if you noticed but if the querier-timeout is not given, only query-interval, then the querier-timeout is already today calculated as per standard. This is a good enough solution to me, for now. I.e., possible to configure but with fallback to standard.

troglobit commented 9 years ago

Added two sanity checks to IGMP querier timeout setting:

  1. ensure querier timeout is NOT <= query interval, if so, enforce recommended querier timeout
  2. warn if querier timeout is < recommended querier interval, but allow

For both cases the recommended setting is logged, along with the algorithm. I hope this is acceptable to you @pchri03 ... ?

Regards /Joachim

troglobit commented 9 years ago

Merged to master, closing.