I came across the kernel driver code implementing some sort of IGMP snooping
backend and as part of its functionalilty it creates a new socket address
family, AF_IGMPSNOOP, but actually implements just a few operations for this
type of socket:
I'm wondering what is the rationale for adding a new family, while in fact a
raw socket is being used to access the stack for IGMP packets? Would not it
be the same to just create AF_INET raw socket and do the things?
> I came across the kernel driver code implementing some sort of IGMP snooping
> backend and as part of its functionalilty it creates a new socket address
> family, AF_IGMPSNOOP, but actually implements just a few operations for this
> type of socket:
> I'm wondering what is the rationale for adding a new family, while in fact a
> raw socket is being used to access the stack for IGMP packets? Would not it
> be the same to just create AF_INET raw socket and do the things?
Possibly.
I'm pretty sure IGMP snooping is really a "bridge" thing.
I don't know why you'd need a socket for bridge-based IGMP snooping
at all. Bridges don't need no steenking sockets. This being said, this
is another one of those things...
( text from RFC 4541 ):
" In recent years, a number of commercial vendors have introduced
products described as "IGMP snooping switches" to the market. These
devices do not adhere to the conceptual model that provides the
strict separation of functionality between different communications
layers in the ISO model, and instead utilize information in the upper
level protocol headers as factors to be considered in processing at
the lower levels. This is analogous to the manner in which a router
can act as a firewall by looking into the transport protocol's header
before allowing a packet to be forwarded to its destination address."
>> I'm wondering what is the rationale for adding a new family, while in >> fact a
>> raw socket is being used to access the stack for IGMP packets? Would not >> it
>> be the same to just create AF_INET raw socket and do the things?
> Possibly.
> I'm pretty sure IGMP snooping is really a "bridge" thing.
> I don't know why you'd need a socket for bridge-based IGMP snooping
> at all. Bridges don't need no steenking sockets. This being said, this
> is another one of those things...
Thanks for the response.
Another thing that comes to my mind is that perhaps the implementor of AF_IGMPSNOOP family wanted to have just a small subset of socket operations, not a full-blown socket, basically only the 'release', 'poll', setsockopt, sendmsg and recvmsg are implemented for this new family. May be they wanted to have a light-weight mechanism.
>>> I'm wondering what is the rationale for adding a new family, while in
>>> fact a
>>> raw socket is being used to access the stack for IGMP packets? Would not
>>> it
>>> be the same to just create AF_INET raw socket and do the things?
>> Possibly.
>> I'm pretty sure IGMP snooping is really a "bridge" thing.
>> I don't know why you'd need a socket for bridge-based IGMP snooping
>> at all. Bridges don't need no steenking sockets. This being said, this
>> is another one of those things...
> Thanks for the response.
> Another thing that comes to my mind is that perhaps the implementor of
> AF_IGMPSNOOP family wanted to have just a small subset of socket operations,
> not a full-blown socket, basically only the 'release', 'poll', setsockopt,
> sendmsg and recvmsg are implemented for this new family. May be they wanted
> to have a light-weight mechanism.
> Mark
Dunno - find the appropriate mailing list and ask them. But yes - it looks like only those callbacks are allowed.