The Network Simulator - NS 2

From Web
Revision as of 17:55, 13 February 2007 by Acorni (talk | contribs)
Jump to navigation Jump to search

From [1], Ns is a discrete event simulator targeted at networking research. Ns provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.

Links


Configuration hints

To get the software running you must

  • setup your system to compile the NS
  • download the NS source
  • compile the sources
  • set up the user environment to run the NS

In the following are described these steps.

Patches

Ubuntu Linux installation

As root the commands are the following. To setup the linux machine:

   name=ns
   useradd -c "ns, NS network simulator user, " \
       -d /home/$name  \
       -g users \
       -m -k /etc/skel \
       -s /bin/bash \
       $name
   passwd $name
   apt-get update; apt-get update
   apt-get dist-upgrade --show-upgraded
   apt-get install  g++ gcc tk8.4 tcl8.4 libc6-dev \
                    libx11-dev libx11-dev xlibs-dev make

To install the software,

Logout and login as ns user, download the source code from http://sourceforge.net/projects/nsnam/.

You need the file ns-allinone-2.30.tgz or newer. Here are example steps:

cd
mkdir ns
cd ns
wget http:/..../ns-allinone-2.30.tgz
tar xzvf ns-allinone-2.30.tgz
cd ns-allinone-2.30
#  compile the software
./install.sh

At the end of this step the software should be compiled with no errors.

Environment setup

these command should be executed before running the ns.

PATH=$PATH:/home/ns/ns-allinone-2.30/ns-2.30
PATH=$PATH:/home/ns/ns-allinone-2.30/tcl8.4.13/unix
PATH=$PATH:/home/ns/ns-allinone-2.30/tk8.4.13/unix
PATH=$PATH:/home/ns/ns-allinone-2.30/xgraph-12.1
PATH=$PATH:/home/ns/ns-allinone-2.30/nam-1.12
export PATH

For example, you can put them into the file

.bashrc