adding new address families (AF_xxx)

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hello,

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:

static struct proto_ops igmp_snoop_ops = {
   family:       AF_IGMP_SNOOP,
   release:      _igmp_snoop_sock_release,
   bind:         sock_no_bind,
   connect:      sock_no_connect,
   socketpair:   sock_no_socketpair,
   accept:       sock_no_accept,
   getname:      sock_no_getname,
   poll:         datagram_poll,
   ioctl:        sock_no_ioctl,
   listen:       sock_no_listen,
   shutdown:     sock_no_shutdown,
   setsockopt:   _igmp_snoop_setsockopt,
   getsockopt:   sock_no_getsockopt,
   sendmsg:      _igmp_snoop_sock_sendmsg,
   recvmsg:      _igmp_snoop_sock_recvmsg,
   mmap:         sock_no_mmap,
   sendpage:     sock_no_sendpage,
}

However from a user space perspective a socket is created as:

fd = socket (AF_IGMPSNOOP, SOCK_RAW, IPPROTO_IGMP)

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?

Looking forward to hearing form you !
Thanks.

Mark  



Re: adding new address families (AF_xxx)
Mark wrote:
Quoted text here. Click to load it

Possibly.

I'm pretty sure IGMP snooping is really a "bridge" thing.

http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge#Snooping

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."

http://tools.ietf.org/html/rfc4541

So *sigh*.



Quoted text here. Click to load it

--
Les Cargill


Re: adding new address families (AF_xxx)

Quoted text here. Click to load it
http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge#Snooping
Quoted text here. Click to load it

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  



Re: adding new address families (AF_xxx)
Mark wrote:
Quoted text here. Click to load it
http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge#Snooping
Quoted text here. Click to load it


Dunno - find the appropriate mailing list and ask them. But yes - it  
looks like only those callbacks are allowed.

--
Les Cargill

Site Timeline