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