Attached you can find my testacase for Wifi and Multicast routing. It is
a simplified version of examples/third.cc, basically a multicast
datagram is supposed to flow from a p2p node to the other (which is also
the AP), and then from it to a wireless station which joined the group.
From the generated traces, what happens is:
* the multicast datagram is correctly generated;
* and correctly routed through the p2p channel, i.e. it arrives to node 0.
What does NOT happen is:
* I could not convince node 0 to forward the packet on the wireless
interface (ap-0-1.pcap only has 802.11 stuff, no UDP traffic);
* I could not verify whether the station is able to correctly handle (I
mean, using Socket) the reception of a multicast UDP frame.
Maybe I am missing something very basic...
Francesco
P.S.: I tested this with today's ns-3-dev version. It seems that the
patch posted by Mathieu Lacage is already applied.
Francesco,
Sorry it took me a long time to address your question.
Here are changes I made to your testcase to make it work.
//intermediate node
- ip=wifiApNode.Get(1)->GetObject<Ipv4>();
- ip->SetDefaultMulticastRoute(2); //0 loopback, 1 p2p, 2 wifi
+ StaticMulticastRouteHelper multicast;
+ Ptr<Node> multicastRouter = wifiApNode.Get(0);
+ Ptr<NetDevice> inputIf = multicastRouter->GetDevice (0); // The input
NetDevice
+ NetDeviceContainer outputDevices; // A container of output NetDevices
+ outputDevices.Add (multicastRouter->GetDevice (1));
+ multicast.AddMulticastRoute (multicastRouter, Ipv4Address
("10.1.1.2"), mcast_addr, inputIf, outputDevices);
Basically, SetDefaultMulticastRoute() is used for locally originated
packets; to add a multicast route to the intermediate node, use
AddMulticastRoute()
The API for the StaticMulticastRouteHelper and static multicast routing
will be improved with the IPv4 rework.