(URGENT) Unable to receive packet in manet-routing-compare using multiple interfaces

233 views
Skip to first unread message

Hassam Mughal

unread,
May 31, 2020, 12:45:29 PM5/31/20
to ns-3-users
Greetings Everyone!
I have followed the simulation till the Send call in the OnOffApplication used for the sending the data in the resource allocation method. The Tx trace for this packet is triggered and I get the correct values for source and destination. But the packet isn't picked up at the Rx trace. The SetupPacketReceive is already called before the Simulation is started. Kindly find the file attached hereby.
Any help in this regard is highly appreciated.
Thanks
Best Regards,
Hassam

Hassam Mughal

unread,
May 31, 2020, 12:46:26 PM5/31/20
to ns-3-users

Sorry, forgot to attach the file, so here it is. Thanks
manet-routing-compare (1).cc

Tom Henderson

unread,
May 31, 2020, 1:52:59 PM5/31/20
to ns-3-...@googlegroups.com, Hassam Mughal
Hassam, I will share with you a systematic way to debug your programs.
It will require you to read the source code and use NS_LOG and run the
program multiple times to find out what is going on.

You can build ns-3 in debug mode, and start to look step by step at the
log output produced.

NS_LOG="OnOffApplication" ./waf --run program > log.out 2>&1

and inspect the file log.out. If you are convinced that the behavior
looks correct, next look at the next object that your packet will
encounter (in this case, UdpSocketImpl, then UdpL4Protocol, etc.) and
enable that log component, rerun the program, etc. until you find
behavior that is not correct.

If you prefer, you can enable multiple log components at a time, to do
multiple steps at once:

NS_LOG="OnOffApplication:UdpSocketImpl:UdpL4Protocol:Ipv4L3Protocol:Ipv4Interface"
./waf --run program > log.out 2>&1.

Or you can use gdb to step through the operation of your program,
setting breakpoints as necessary:

https://www.nsnam.org/wiki/HOWTO_use_gdb_to_debug_program_errors

- Tom

p.s. please refrain from using URGENT in the subject line of messages in
the forum

Hassam Mughal

unread,
May 31, 2020, 2:01:56 PM5/31/20
to ns-3-users
Hello Tom,
A bundle of thanks for sharing this. I am already following this approach since couple of years. But this time, I am unable to identify it, that's why posted it and required some urgent help or tip for resolving this. I will try to turn on logs of all the associated classes with it also, to get more insights and find out the issue.
Sure, I won't use that next time. Apologies.
Reply all
Reply to author
Forward
0 new messages