This post tells you how to enable the TORA (Temporally ordered routing Algorithm) protocol in Network Simulator 2 (ns-2.35)
TORA is a protocol in wireless adhoc networks that works with timing parameters. NS-2.35 comes with the TORA protocol by default but it has to be tweaked manually to make it run.
This post will help you to do that.
You can watch this video for detailed instructions:
Step 1: Generate a Scenario for TORA protoco using NS2 Scenario Generator NSG Software.
We have created a tcl file using NSG2.1.jar
$] java -jar NSG2.1.jar
Three files have to be modified
Step 3:
We need to recompile ns2 using the command make from the folder ns-2.35/
Once the changes are made, Open the Terminal and go to ~ns-2.35 and execute the command
prompt$] make
Step 4: Run the tcl file now
$] ns TORA.tcl
This file is generated in Step 1
I will give all these files to you for your simulation.
Copy the tora.cc and tora.h file in your ns-2.35/tora folder
then copy the imep.cc file in to the ns-2.35/imep folder
and then copy the TORA.tcl file in your home folder or any folder.
Then do the compilation $] make
and then run the TORA.tcl file using $] ns TORA.tcl
Thanks for watching. Please subscribe and click the bell button for further updates.
T S Pradeep Kumar
TORA is a protocol in wireless adhoc networks that works with timing parameters. NS-2.35 comes with the TORA protocol by default but it has to be tweaked manually to make it run.
This post will help you to do that.
You can watch this video for detailed instructions:
Step 1: Generate a Scenario for TORA protoco using NS2 Scenario Generator NSG Software.
We have created a tcl file using NSG2.1.jar
$] java -jar NSG2.1.jar
- ~ns-2.35/tora/tora.cc
- ~ns-2.35/tora/tora.h
- ~ns-2.35/imep/imep.cc
There are various websites that tells you how to configure TORA by making changes to the above three files.
Change 1: tora.h
In the tora.h file, go to the end of the File before the agent completes, include these two lines
#include <classifier/classifier-port.h>
#include <classifier/classifier-port.h>
protected:
PortClassifier *dmux_;
Tora.h Change |
Change 2: tora.cc
Open the tora.cc and include the following lines in the "int toraAgent::command(int argc, const char*const* argv) " function as indicated in the figure below.
else if (strcmp(argv[1], "port-dmux") == 0) {
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
if (dmux_ == 0) {
fprintf (stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1], argv[2]);
return TCL_ERROR;
}
return TCL_OK;
}
Tora.cc Change |
Change 3: imep.cc
In the file imep.cc, change the following line
rexmitTimer.start(rexat - CURRENT_TIME);
to
if (rexat-CURRENT_TIME<0.000001) // Preventing eternal loop.
rexmitTimer.start(0.000001);
else
rexmitTimer.start(rexat - CURRENT_TIME);
IMEP Change |
We need to recompile ns2 using the command make from the folder ns-2.35/
Once the changes are made, Open the Terminal and go to ~ns-2.35 and execute the command
prompt$] make
Step 4: Run the tcl file now
$] ns TORA.tcl
This file is generated in Step 1
I will give all these files to you for your simulation.
Copy the tora.cc and tora.h file in your ns-2.35/tora folder
then copy the imep.cc file in to the ns-2.35/imep folder
and then copy the TORA.tcl file in your home folder or any folder.
Then do the compilation $] make
and then run the TORA.tcl file using $] ns TORA.tcl
Thanks for watching. Please subscribe and click the bell button for further updates.
T S Pradeep Kumar
In file included from tora/tora.cc:46:0:
ReplyDelete./tora/tora.h:179:2: error: ‘PortClassifier’ does not name a type
PortClassifier *dmux_;
^
tora/tora.cc: In member function ‘virtual int toraAgent::command(int, const char* const*)’:
tora/tora.cc:143:18: error: ‘dmux_’ was not declared in this scope
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:27: error: ‘PortClassifier’ was not declared in this scope
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:43: error: expected primary-expression before ‘)’ token
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:44: error: expected ‘;’ before ‘TclObject’
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
make: *** [tora/tora.o] Error 1
am also getting same error...
Deletepradeep kumar sir pls help us...
Hello Sire, could you please make any tutorial on wireless network security with and example of simulation.thanks!!
ReplyDeletei did all the steps whatever you have followed...
ReplyDeletestill is giving error saying that
tora/tora.cc: In member function ‘virtual int toraAgent::command(int, const char* const*)’:
tora/tora.cc:143:18: error: ‘dmux_’ was not declared in this scope
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:27: error: ‘PortClassifier’ was not declared in this scope
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:43: error: expected primary-expression before ‘)’ token
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
tora/tora.cc:143:44: error: expected ‘;’ before ‘TclObject’
dmux_ = (PortClassifier *)TclObject::lookup(argv[2]);
^
make: *** [tora/tora.o] Error 1