[Ns-developers] ns-3.5 planning / mac multicast

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Thu Apr 16 04:42:02 PDT 2009


On Wed, 2009-04-15 at 10:03 +0200, Fabian Mauchle wrote:

> I recently worked on multicasting in Wifi networks. The current
> implementation of MAC multicast in Wifi and Csma networks do basically their
> thing, but they do not correctly represent reality.
> 
> 1. The NetDevice is currently responsible for creating the multicast MAC
> address [NetDevice::GetMulticast(Ipv4Address)]. I don't know of any real API
> which would do this.

It is merely responsible for creating a MAC-level multicast address
which matches the higher-layer multicast address. The reason this is
done is to encapsulate the MAC address format from the higher layers. If
you don't do this, you will have to move knowledge of the MAC-level
address format to the ip layer. Linux does this, BSD too, but it's not
very pretty.

> 2. Most NetDevices accept all (or most) multicast frames without any
> selection or configuration. After I have seen some hints in several RFC's
> that a L3 protocol MUST register the multicast addresses (MAC) it wants to
> listen to, I searched for an API for this and found one in Linux [see
> manpage netdevice (7)]

Well, in the real world, there is device-level multicast frame filtering
to avoid transfering too many uneeded frames from the device to the
host. However, in every real device/driver I looked at, there is no
guarantee that this actually works (real device filters usually use a
small local hash cache with 16 entries to accept incoming packets which
means that incoming packets with a matching multicast address but which
are not listened to by the host will be forwarded to the host anyway. To
summarize, this kind of API is merely an optimization: it does not
change the logic which needs to be present in the ip stack to eliminate
multicast packets received which we are not listening to.

> 
> 3. The netdevice API in Linux also allows to enable or disable promiscuous
> mode. The NetDevice API in ns-3 only allows the registration of a
> promiscuous or non-promiscuous receive callback.

Yes: I already argued against the current ns-3 API and for the linux API
but I lost that argument a long time ago so, if you want to put this
back on the table, I would suggest you look in the mailing-list
archives.

> 
> My current plans are as follows:
> - I will try to adapt the NetDevice API to the linux API
> - Any implementation of the NetDeivce is still free how they treat multicast
> frames
> - Revert the creation and control over multicast addresses to the
> Ipv4L3Protocol*
> - I will try to figure out which other components are affected
> - I will try to come up with a patch within 2-3 weeks from now.
> 
> *The use of multicast in IPv4 is relatively rare. This prepares basically
> for IPv6 since it often makes use of multicast.
> 
> What are your feelings about this?

I think that using a promiscuous mode instead of a promiscuous callback
would simplify a lot the reception code in devices and would make sense
but I feel that this change will be an uphill battle. I don't really
understand the purpose of the other changes you mentioned but, I would
be happy to keep discussing these here.

Mathieu



More information about the Ns-developers mailing list