Adding a new module to NS3

979 views
Skip to first unread message

Christixn Criollo

unread,
Dec 11, 2015, 4:24:41 PM12/11/15
to ns-3-users
Hi, i was trying to add a module to ns3, i downloaded the protocol "Shortest-Path" from the next source: http://www2.engr.arizona.edu/~junseok/shortest_path.html

I create the path according the step 1 in: https://www.nsnam.org/docs/release/3.24/manual/html/new-modules.html

I did some changes in wscript according the next steps but not many, then i just copied the files from my "download folder" to my src/sp-routing (new protocol) and finally did the step 8, but it didnt works

Now i delete the "new protocol" from src/ and when i try to run the example "first" to check if ns3 still works i got the next problem Could not find a task generator for the name 'ns3-shortest-path'

Now ns3 is unusable, can anybody help me to rebuid ns3 because I tried to do "./waf" "./waf clean" "./waf configure" and nothing works i still have the problem Could not find a task generator for the name 'ns3-shortest-path'

Can anybody help me with the two topics? rebuid and add a new protocol

Konstantinos

unread,
Dec 11, 2015, 4:49:03 PM12/11/15
to ns-3-users
Hi Christixn,

The Shortest-Path module you downloaded was designed for ns-3.12 back in 2011 (4yr old release). 
It is expected not to work right away. You could try to port-forward it but it would take some effort.
If you tell us the errors you are getting, it could be easier to help you port it. 
Follow the steps explained in the manual. 
The wscript file can be automatically generated from the python script provided with ns-3.
Add the source and header files from the module you found.

Now, after you deleted the folder, you need to call "./waf distclean", which basically removes the 'build' folder.
Then you will need to reconfigure and rebuild ns-3. 

Hope that helps,

Regards,
K.

Tom Henderson

unread,
Dec 11, 2015, 4:52:20 PM12/11/15
to ns-3-...@googlegroups.com
On 12/11/2015 01:24 PM, Christixn Criollo wrote:
> Hi, i was trying to add a module to ns3, i downloaded the protocol
> "Shortest-Path" from the next source:
> http://www2.engr.arizona.edu/~junseok/shortest_path.html
>
> I create the path according the step 1
> in:https://www.nsnam.org/docs/release/3.24/manual/html/new-modules.html
>
> I did some changes in wscript according the next steps but not many,
> then i just copied the files from my "download folder" to my
> src/sp-routing (new protocol) and finally did the step 8, but it didnt works
>
> Now i delete the "new protocol" from src/ and when i try to run the
> example "first" to check if ns3 still works i got the next problem Could
> not find a task generator for the name 'ns3-shortest-path'

Christixn,
This error typically arises when you have a mismatch between the wscript
and the name of your module.

If you want a module named 'shortest-path', make sure that you name the
directory 'src/shortest-path' and that in the wscript found in
'src/shortest-path/wscript', that you have a line declaring the module
with the same name:

module = bld.create_ns3_module('shortest-path', ['network'])

If you have something else in the above statement, like 'sp-routing', it
will cause the error that you cite.

The other thing to look out for when moving from ns-3.12 to ns-3.24, is
that where it used to say in the wscript:

headers = bld.new_task_gen('ns3header')

it should now say

headers = bld(features='ns3header')

but this will raise a different error if you neglect to make this change.

- Tom

Tommaso Pecorella

unread,
Dec 11, 2015, 5:00:29 PM12/11/15
to ns-3-users
Hi,

the attached one will compile.
Mind that I have not run anything in it, it just does not give any compilation error.
A lot of things have changed since 3.12, and I'm ready to bet that this module will NOT work as intended without modifications. use it at your own risk. if you find problems, please post a warning for the future readers. If you fix the module, post it.

As a side note, in the module website it is stated that "Currently, NS3 provides only AODV routing protocol for wireless systems." This is not anymore true. You can use AODV, DSR, DSDV and OLSR.

Cheers,

T.
sp-routing.tgz

Christixn Criollo

unread,
Dec 11, 2015, 6:15:23 PM12/11/15
to ns-3-users
Thansk to everyone

Konstantinos i rebuilt ns3 and it works againg, i was rebuilding in the wrong folder

Tom I did those steps and changes and as you said there where several errors after doing that

Tommaso thanks for the attachment, it actually compiles but i got an error "boost/lexical_cast.hpp", that library doesnt exist, I tried to install using "sudo apt-get install libboost-signals-dev libboost-filesystem-devs" but i cant, but its not a problem, my approach was to know the changes that i have to do in order to add a new protocol and whit the attachent i think i will get that information.

If anyone have documentation(models .cc .h, examples, etc) about any pŕotocol for VANETs, such as VIRTUS, QOALITE, HIVE or other it will be usefull for me because im trying to replicate those protocols, and the papers about the protocolos doestn give me a clear way to follow.

All the information was helpfull to me, thanks for the kindness


Reply all
Reply to author
Forward
0 new messages