Hi everybody,
i'm working on a VANET simulation with ns-3.17 and i recently decided to use NetAnim to better debug my code and get some visual feedback. I went for the simplest approach and i just call AnimationInterface anim ("test.xml") right before Simulator::Run().
My script is an adaptation of the example "wifi-simple-adhoc" under examples/wireless folder. If i add the aforementioned instruction on that script i can get a correct netanim animation while i can't on my simulation. Looking at my output .xml it seems that no packet has been traced by Animationinterface despite having sent and received plenty of broadcast udp packets, as my log testifies.
I'm trying to investigate and solve this problem and probably i'm just missing something silly, but i went and looked at AnimationInterface.cc code and discovered some strange behaviour: the component registers itself for a lot of trace sources like "NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxBegin" and "NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxBegin".
I placed a breakpoint in both callbacks (WifiPhyTxBeginTrace and WifiPhyRxBeginTrace) and run my script. It came out that while the first one is being called as expected (still, i get no packet trace), the second one (WifiPhyRxBeginTrace) is not. I even placed a breakpoint in wifi-phy.cc (line 324) NotifyRxBegin method and the funny thing is that the trace source correctly notifies its subscribers, but the callback is AnimationInterface is not called and i get 0 packets in my xml.
If i execute the example script, everything works normally. I just can't understand what is wrong with my code.
I'm attaching the two scripts: the working one is a simple zztest.cc file that can be put on the scratch folder, the other one is a package containing a folder that's also meant to be put in scratch dir, it's a stripped-down version of my much more sophisticated script.
Any help would be really appreciated, thanks in advance!
Enrico