Using NS Simulator
Installations:
- NS is installed in
minix.cs.sunysb.edu at /usr/local/src/nsintall/ns-allinone-2.30/ns-2.30.
You can run ns off from this installation. No need to install it
yourself on your own directory unless required by the project you will be
doing. You can remotely ssh to minix to run NS. You can also install
and run NS from your own laptop. In this case, using Linux or any
Unix-based OS is the best option, though it also should run on windows
using cygwin.
- On minix add
/usr/local/src/nsintall/ns-allinone-2.30/bin to your path. This means
issuing simple commands like
set path = ($path /usr/local/src/nsintall/ns-allinone-2.30/bin);
Assuming that you are using csh, add these lines to your .cshrc file in
your home directory
If you are using bash, then add the following to your .bash_profile or
.bashrc file
export PATH=$PATH: /usr/local/src/nsintall/ns-allinone-2.30/bin;
- NS is run as "ns
my_simulation.tcl" where the my_simulation.tcl is the simulation
script. By default, the trace file is created in your current directory.
- Quite a few scripts are
available in the ns-tutorial/example directory in the NS installation.
Look them up for examples. Copy those example files to your local
directory and run ns "script filename"
- Note that the network
animator NAM
uses X-windows. If you are working remotely, you need to have a remote
display. If you are using a MS windows machine to ssh to minix, you will
need to use a X server on your machine. If you are a CS graduate student,
we have licenses for some X servers. Download from here. Most often you will not need to use NAM.
Manual and tutorials:
- NS
Simulator for Beginners, by Eitan Altman, Tania Jimenez (an excellent
tutorial).
- NS by Example, by Chung and Claypool, RPI (easy
intro, the example script was used in the class, start here).
- Marc Greis's
tutorial (quite popular and easy reading as well)
- NS Manual
(the most definitive manual, though not everything is really documented,
use this on-demand)
- The Network Simulator - ns2 (everything
about ns, including contributed codes, FAQ, debugging tips, mailing lists
etc.)
Materials used in class: