How do I Run an Ns2 Script

Let’s get into this article to know about process of running network simulator 2 script along with all the required steps.

Create Ns2 Script

As the first process, we have to create the Ns2 tcl script file in the workspace location with the file extension .tcl, then the script file code declare the values about the parameters of node configuration.

-topoInstance $topo \

-routerTrace ON \

-energyModel “EnergyModel” \

-rxPower 1.0 \

-txPower 2.0 \

-initialEnergy 10 \

-sleepPower 0.5 \

-transitionPower 0.2 \

-transitionTime 0.001 \

-idlePower 0.05

Run Ns2 Script

Then, we have to run the Ns2 script file through changing the workspace location in the terminal window over the utilization of below mentioned command.

cd /home/research/Desktop/Script_WorkSpace

Changing the Workspace Location

Following that, we have to execute the commands in terminal to run the Ns2 script file.

sudo ./ns TCL_Script.tcl

Running Ns2 Script

As the final note, we have pinned the result which acquired through executing the Ns2 script file.

Result of Running Ns2 Script File

You guys can definitely reach us to clarify all your doubts and our research professionals will provide the complete research support.

Opening Time


Lunch Time


Break Time


Closing Time


  • award1
  • award2