AODV routing protocol implementation

123 views
Skip to first unread message

Marcin Dorecki

unread,
May 29, 2015, 5:41:46 PM5/29/15
to ns-3-...@googlegroups.com
Hello,

I am trying to add AODV routing to my script. I am using the structure like this:

 MobilityHelper mobility;
  mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (0.0),
                                 "MinY", DoubleValue (0.0),
                                 "DeltaX", DoubleValue (grid),
                                 "DeltaY", DoubleValue (0),
                                 "GridWidth", UintegerValue (10),
                                 "LayoutType", StringValue ("RowFirst"));

  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  mobility.Install (sta);
 

/* ===== Internet stack ===== */
AodvHelper aodv;
InternetStackHelper stack;
stack.SetRoutingHelper (aodv);
stack.Install (sta);

  Ipv4AddressHelper address;

  address.SetBase ("192.168.1.0", "255.255.255.0");
  Ipv4InterfaceContainer staIf;
  staIf = address.Assign (staDevices);

But I get the error like this
' Build failed -> task in 'wifi_qos' failed (exit status 1):
    {task 139665919679760: cxx wifi_qos.cc ->wifi_qos.cc.1.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-fno-strict-aliasing', '-fwrapv', '-fstack-protector', '-fno-strict-aliasing', '-I.', '-I..', '-I/usr/include/gtk-2.0', '-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/freetype2', '-I/usr/include/glib-2.0', '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/libpng12', '-I/usr/include/harfbuzz', '-I/usr/include/libxml2', '-I/usr/include/python2.7', '-I/usr/include/x86_64-linux-gnu/python2.7', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_PACKET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DHAVE_GSL=1', '-DNDE

Without AODV routing the program runs without any problems. Thanks in advance for your help.

Marcin

Tommaso Pecorella

unread,
May 29, 2015, 5:56:10 PM5/29/15
to ns-3-...@googlegroups.com
Hi,

too few compilation error lines shown. Please attach the offending script or more terminal lines.

Cheers,

T.

Marcin Dorecki

unread,
May 29, 2015, 6:05:25 PM5/29/15
to ns-3-...@googlegroups.com
Hi,

I attach the script. The error:
'mdorecki@ubuntu:~/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17$ ./waf --run "wifi-qos --nSTA=3"
Waf: Entering directory `/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/build'
[ 753/1601] cxx: scratch/wifi-qos.cc -> build/scratch/wifi-qos.cc.4.o
[1552/1601] cxxprogram: build/scratch/wifi-qos.cc.4.o -> build/scratch/wifi-qos
Waf: Leaving directory `/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/build'
'build' finished successfully (11.805s)
Command ['/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/build/scratch/wifi-qos', '--nSTA=3'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>"). '
wifi-qos.cc

Tommaso Pecorella

unread,
May 30, 2015, 2:09:54 AM5/30/15
to ns-3-...@googlegroups.com
Hi,

the two errors you posted seems to be different. One is a compilation error, and should leave you with no executable binaries. The second is a segmentation fault, caused by a bug in a compiled script. If you really had the first one, you couldn't even ran the program in the second.

Beside these errors, you have the following issues.

- First, it seems that you are using ns-3.17, i.e., a version dating more than 2 years ago. Please move to the latest version (we are at 3.23 right now). We can not provide help on outdated ns-3 versions.

- Second, you are using a even OLDER script. The line #include "ns3/simulator-module.h" clearly shows that the script was made for an extremely old ns-3 version. Please use the examples shipped in the current ns-3.
You can use the old script as a guideline to modify the examples, but expect different results. Bugs closed and features added are leading to more precision and different results.

Moreover, please take your time to read the tutorial and manual.

Have fun,

T.

Marcin Dorecki

unread,
May 30, 2015, 6:20:46 AM5/30/15
to ns-3-...@googlegroups.com
Hi Tommaso,

thanks for your help. Unfortunately due to the implementation of 802.11aa in my distribution of ns-3.17 I have to work on it and cannot change to any newer version as for now.
The first error I posted is not valid any more- old header files were causing it most probably. now I have the second error- 'Command ['/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/build/scratch/wifi-qos', '--nSTA=3'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").'
Once I run it with debugging I get following output : ' Traceback (most recent call last):
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 97, in waf_entry_point
    run_commands()
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 153, in run_commands
    ctx=run_command(cmd_name)
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 146, in run_command
    ctx.execute()
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Scripting.py", line 351, in execute
    return execute_method(self)
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Build.py", line 106, in execute
    self.execute_build()
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Build.py", line 109, in execute_build
    self.recurse([self.run_dir])
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/.waf-1.7.10-4f6df1d839dc35640834d81573053140/waflib/Context.py", line 128, in recurse
    user_function(self)
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/wscript", line 825, in build
    program_name, dummy_program_argv = wutils.get_run_program(Options.options.run, wutils.get_command_template(env))
  File "/home/mdorecki/Repos/ns-allinone-3.17_wifi-patches_simple-dot11aa/ns-3.17/wutils.py", line 195, in get_run_program
    tmpl = command_template % (program_node.abspath(),)
TypeError: not all arguments converted during string formatting
'

As i mentioned before, without AODV script works as expected and I implemented AODV according to the examples found, any help will be appreciated

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/JyXTv43pN14/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
May 30, 2015, 12:12:47 PM5/30/15
to ns-3-...@googlegroups.com
Hi,

as stated before, we can not provide any help on outdated ns-3 versions, and this statement is even more valid for an ns-3 version patched with unknown (to us) code.
It's not that we don't want to help, it's just that we really can't. How could we find a bug in something we don't know ? Logic, please.

The only suggestion I can give is: double check what you wrote and your "error" when you run the debugger. You're trying to use gdb and the command to launch it failed miserably (it's a python error). Triple check to have gdb installed properly and to have used the right command template.

T.
Reply all
Reply to author
Forward
0 new messages