A simple and easy port of the popular Network Simulator NS2 for the windows platform (no cygwin/virtualbox needed)
Download .zip
or use git
git clone https://github.com/nimishbongale/NS2-for-Windows.git
Unzip the zipped file in your preferred directory.
- Install chocolatey
Chocolatey takes care of your environment variables and all the nuances when it comes to installing new software which require some specific paths to executables to be present as home variables.
This step may take a couple of minutes.
- Run CMD prompt as administrator (system/32) once the installation is complete. Run the following command to install gawk (GNU awk).
choco install gawk
This step may take a few moments.
- Navigate(
cd
) to the necessary directory where you have this repository cloned/unzipped.
Run
ns helloworld.tcl
If all your setup has been done perfectly, you should get the following output:
NS2-for-Windows>ns helloworld.tcl
Hello World - TCL
Hello World - AWK
The NSWireless animator window should also pop up.
-
Write your tcl and awk files in the same directory where you have your
ns.exe
file. Alternatively, you could set an environment variable with the path to thens.exe
file. -
Run ns command with the your tcl file as parameter.
Sample Output:
NS2-for-Windows>ns sample.tcl
No. of packets dropped=6
If you are writing into a nam file,and the namtrace-all command has been levied in the tcl file, then you will also generate the nam file.
- In the NS-Wireless window that pops up, select the tcl file by clicking on the ellipsis (
...
). Click on load. - In the bottom tab navigation, click on Simulation.
- Select the tr file by clicking on the ellipsis (
...
). Click on load.
After some buffering, the animation should start playing. For adavnced features of NSWireless, visit https://www.scribd.com/document/216718904/Ns2-Visual-Trace-Analyzer-Manual
Graphs showing network health and other activites can also be plotted using this software.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.