Straw poll - All-interface broadcast/multicast
William A. Carrel
william.a at carrel.org
Tue Nov 18 17:20:50 PST 2003
In article <20031118213659.GE89189 at saboteur.dek.spc.org>,
Bruce M Simpson <bms at spc.org> wrote:
> On Tue, Nov 18, 2003 at 12:19:00PM -0500, Barney Wolff wrote:
> > Some questions, because I'd like to be an educated voter.
> > 1. How does multicast routing work now? Presumably something takes a
> > mcast packet and sends it out to every interface behind which some host
> > has indicated group membership. Is this kernel or userland? Does it
> > work at all?
> Kernel. Works. Right now, the default multicast route is via the interface
> with the default route; setting a route isn't necessary unless you need to
> force multicast to go via a particular interface by default, this is done
> by longest-prefix matching like all other IPv4 routing activities.
An unprivileged userland application is also able to control where it is
sending its multicast traffic (without mucking with the routing table)
by using the sockopt IP_MULTICAST_IF. It can specify the address (or
interface specifier in the case of IPv6) of any interface on the
machine. Note that this interface isn't necessarily the one that it has
a membership on.
It is possible to send to all interfaces at present by repeatedly
calling setsockopt() and sending the packet for each interface. In
reality, this is a bit of a hassle for the application programmer since
you can only send out on one interface at a time.
Listening and changing forwarding behavior based on the IGMP membership
of other nodes on an interface is handled by mrouted and similar tools.
But this only affects forwarding, not initial transmission direction
which is in the bailiwick of sending application.
> > 2. How is "appropriate" defined - by administrator choice or by some
> > inherent property of the interface hardware type?
> For the multicast case, a membership must exist for the interface in question.
> [I haven't written the multicast hack yet, but mdodd@ requested it.]
This may not jive with above. It is perfectly legitimate at present to
be sending multicast traffic out on an interface that has no memberships
attached to it.
In my own ideal world, sockopt IP_MULTICAST_IF could be set with some
magic value (all-ones?) to cause multicast transmission to go to all
multicast-capable interfaces. As opposed to needing hit another knob
elsewhere, since this one already has the "control where I send stuff
(Pardon me ignoring the broadcast case here...)
William A. Carrel
More information about the freebsd-net