It's better to simply copy the text from the console and paste it here instead of screenshots, because that makes it searchable. You can use click on the { } icon and paste code or console output.
You also want to use a debugger like gdb. You can do this:
- sudo apt-get install gdb
- ./waf --run ProgramName --command-template"gdb --args %s"
- You're now in the debugger (gdb) run <arguments> in my case I tried:
run --traceFile=src/mobility/examples/default.ns_movements --nodeNum=2 --duration=100.0 --logFile=ns2-mob.log
- then you can type "bt" to backtrack and see if the debugger points you to your error line.
It seems that you have a few issues. I usually initialize my wifi with default settings and then set the attributes I need.
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default();
wifiChannel.SetPropagationDelay("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss("ns3::FriisPropagationLossModel","MinLoss",DoubleValue(250));
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();;
wifiPhy.SetChannel(wifiChannel.Create());
Also ,you have a potential problem with your TypeId, I'd do something like this to have a UDP socket, for example.
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
and for the target address, don't put the IP string, the IP string might be off. A more reliable way to do this is
//InetSocketAddress remote=InetSocketAddress(("10.1.1.72"),Port);
InetSocketAddress remote=InetSocketAddress( i.GetAddress(sink_index) ,Port);
I hope this help.
You gave me a hint to how to determine the node's position! I'll need that for my own work and I was looking for it and missed this example in NS3.