Difference between revisions of "The Network Simulator - NS 2"

From Web
Jump to navigation Jump to search
(Nuova pagina: From [http://www.isi.edu/nsnam/ns/], Ns is a discrete event simulator targeted at networking research. Ns provides substantial support for simulation of TCP, routing, and multicast pro...)
 
m
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
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.
 
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 ==
+
* Home page: [http://www.isi.edu/nsnam/ns/ http://www.isi.edu/nsnam/ns/]
* [http://nsnam.isi.edu/nsnam/index.php/Main_Page home page]
+
* Wiki page: [http://nsnam.isi.edu/nsnam/index.php/Main_Page http://nsnam.isi.edu/nsnam/index.php/Main_Page]
* [http://nsnam.isi.edu/nsnam/index.php/Main_Page wiki page]
 
  
  
Line 16: Line 15:
 
In the following are described these steps.
 
In the following are described these steps.
  
=== Ubuntu Linux installation ===
+
 
 +
=== Ubuntu linux installation ===
  
 
As root the commands are the following.
 
As root the commands are the following.
Line 53: Line 53:
 
=== Environment setup ===
 
=== Environment setup ===
 
these command should be executed before running the ns.
 
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
+
  NS_HOME=/home/ns/ns-allinone-2.30
  PATH=$PATH:/home/ns/ns-allinone-2.30/tk8.4.13/unix
+
  export NS_HOME
  PATH=$PATH:/home/ns/ns-allinone-2.30/xgraph-12.1
+
  PATH=$PATH:$NS_HOME/bin
PATH=$PATH:/home/ns/ns-allinone-2.30/nam-1.12
 
 
  export PATH
 
  export PATH
 +
 
For example, you can put them into the file
 
For example, you can put them into the file
 
  .bashrc
 
  .bashrc
  
 +
 +
== Patch WiMax for ns 2.30 ==
 +
 +
The WiMax patch is from ndsl.csie.cgu.edu.tw/wimax_ns2.php, this was for the 2.29 version, and we ported it to the 2.30 version.
 +
 +
Download the patch here: [[Media:ns2.30_wimax.tgz]]
 +
 +
==== patch installation instructions ====
 +
 +
* uncompress the zipped file into the the ns2.30 directory
 +
  cd ..../ns2.30
 +
  tar xzvf ns2.30_wimax.tgz
 +
 +
* Makefile changes:
 +
    after the line containing
 +
        mac/mac-802_3.o
 +
    add these ones:
 +
        mac/802_16/packet-802_16.o \
 +
        mac/802_16/timer-802_16.o \
 +
        mac/802_16/mac-802_16.o \
 +
        mac/802_16/traffic/UGS_traffic.o \
 +
        mac/802_16/traffic/ertPS_traffic.o \
 +
        mac/802_16/traffic/rtPS_traffic.o \
 +
        mac/802_16/traffic/nrtPS_traffic.o \
 +
        mac/802_16/traffic/BE_traffic.o \
 +
 +
* recompile the package with make
  
  

Latest revision as of 14:10, 27 November 2012

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.


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.


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.

NS_HOME=/home/ns/ns-allinone-2.30
export NS_HOME
PATH=$PATH:$NS_HOME/bin
export PATH

For example, you can put them into the file

.bashrc


Patch WiMax for ns 2.30

The WiMax patch is from ndsl.csie.cgu.edu.tw/wimax_ns2.php, this was for the 2.29 version, and we ported it to the 2.30 version.

Download the patch here: Media:ns2.30_wimax.tgz

patch installation instructions

  • uncompress the zipped file into the the ns2.30 directory
  cd ..../ns2.30
  tar xzvf ns2.30_wimax.tgz
  • Makefile changes:
    after the line containing
       mac/mac-802_3.o 
    add these ones:
       mac/802_16/packet-802_16.o \
       mac/802_16/timer-802_16.o \
       mac/802_16/mac-802_16.o \
       mac/802_16/traffic/UGS_traffic.o \
       mac/802_16/traffic/ertPS_traffic.o \
       mac/802_16/traffic/rtPS_traffic.o \
       mac/802_16/traffic/nrtPS_traffic.o \
       mac/802_16/traffic/BE_traffic.o \
  • recompile the package with make