From owner-freebsd-net@FreeBSD.ORG Tue Nov 18 17:20:50 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0E8016A4D3 for ; Tue, 18 Nov 2003 17:20:50 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1365543F3F for ; Tue, 18 Nov 2003 17:20:48 -0800 (PST) (envelope-from freebsd-net@m.gmane.org) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AMH1S-0006y9-00 for ; Wed, 19 Nov 2003 02:20:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-net@freebsd.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AMGoU-0006tT-00 for ; Wed, 19 Nov 2003 02:07:22 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AMGoU-00084g-00 for ; Wed, 19 Nov 2003 02:07:22 +0100 From: "William A. Carrel" Date: Tue, 18 Nov 2003 17:07:22 -0800 Lines: 54 Message-ID: References: <20031118130200.GA87978@saboteur.dek.spc.org> <20031118171900.GA28864@pit.databus.com> <20031118213659.GE89189@saboteur.dek.spc.org> X-Complaints-To: usenet@sea.gmane.org Posted-And-Mailed: yes User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X) Sender: news Subject: Re: Straw poll - All-interface broadcast/multicast X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2003 01:20:50 -0000 In article <20031118213659.GE89189@saboteur.dek.spc.org>, Bruce M Simpson 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 out" purpose. (Pardon me ignoring the broadcast case here...) -- William A. Carrel