[ECOS] Re: Why does sending multicast UDP require a gateway?

Grant Edwards grant.b.edwards@gmail.com
Thu Mar 31 12:30:00 GMT 2011

On 2011-03-30, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> On 2011-03-30, Andrew Lunn <andrew@lunn.ch> wrote:
>>> It's being sent via a socket that's bound to a specific interface, so
>>> I wouldn't think that would be a problem.
>> Ah, O.K. 
>> Maybe try it anyway?
>>> I can see that if you're sending from an unbound socket, you might
>>> want a way to specify which interface to use for sending multicast
>>> packets.  But without such a route, the only thing that makes sense to
>>> me is "send it out all of them".
>> And on a multi homed machine that might result in the group receiving
>> two copies of the packet when both multicast routers pick it up and
>> send to the RP.
> True.
> According to RFC1112, you only send a multicast packet on one
> interface. If the application doesn't specify an interface, a default
> interface is used.  IOW, discarding the packet is not correct:
>    Second, for hosts that may be attached to more than one network,
>    the service interface should provide a way for the upper-layer
>    protocol to identify which network interface is be used for the
>    multicast transmission.  Only one interface is used for the initial
>    transmission; multicast routers are responsible for forwarding to
>    any other networks, if necessary.  If the upper-layer protocol
>    chooses not to identify an outgoing interface, a default interface
>    should be used, preferably under the control of system management.
> It turns out this was fixed in the FreeBSD sources in 2001:
>   http://svn.freebsd.org/viewvc/base?view=revision&revision=79830   
>   http://svn.freebsd.org/viewvc/base?view=revision&revision=79836
> I'll work up a patch...

It turns out that doesn't fix the problem.  That only handles the case
where you've explicitly asked the multicast packets to go out a
specific interface.  Binding a socket to an interface and sending
multicast packets still doesn't work unless there's a route to the

One would think that binding the socket to a particular interface
would cause sent packets to go out that interface, but I guess not...

Grant Edwards               grant.b.edwards        Yow! Here I am in 53
                                  at               B.C. and all I want is a
                              gmail.com            dill pickle!!

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list