Bug 494

Summary: wifi and multicast routing reportedly wrong
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: routingAssignee: Tom Henderson <tomh>
Status: RESOLVED INVALID    
Severity: normal CC: francesco.malandrino, mathieu.lacage
Priority: P1    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: testcase

Description Tom Henderson 2009-02-11 02:51:51 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.
Comment 1 Tom Henderson 2009-02-11 02:52:53 EST
Created attachment 375 [details]
testcase
Comment 3 Tom Henderson 2009-03-01 14:01:48 EST
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.