Bugzilla – Bug 494
wifi and multicast routing reportedly wrong
Last modified: 2009-03-01 14:03:45 EST
From ns-3-users on 1/21/09: Hi, 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.
Created attachment 375 [details] testcase
see thread on users ML: http://groups.google.com/group/ns-3-users/browse_thread/thread/7fab0e43aff536f1/86a155fea4ed3374?lnk=gst&q=multicast#86a155fea4ed3374
Sorry, it took a long time for me to look at this one. I am going to mark it as invalid since there is existing API to fix it. The below makes it work for me: //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.