Step by Step Install Ns2
Step by Step Install Ns2
Step by Step Install Ns2
Content:
I.
II.
III.
IV.
V.
I.
Install Linux
Install NS2
Set Environmental variables
Validation
Run the First nam example
1. First of all, get the Linux OS image or CD. You can get it for free from Linux website
http://www.ubuntu.com/GetUbuntu/download
Or, if you are looking for old versions, you can find it in:
http://mirrors.isu.net.sa/
2. If you are a windows user, then you have to download Linux in a separate partition, or use a virtual
machine. My advice to you is to use a virtual machine. One of the best virtual machine SW is
Vmware. You can buy it or Install trial Vmware Workstaion SW from:
http://www.vmware.com/support/product-support/workstation/
There are bunch of alternative Free SW to create Virtual machines, one of them is Virtual Box. You
can download it from:
http://www.virtualbox.org/wiki/Downloads
3. In this manual, I will be using Vmware to create my virtual machine. To create a virtual machine:
Open the Vmware workstation -> Click "New Virtual Machine"
5. Then browse to the directory where you saved the Ubuntu iso image, or choose install it from a dis if
you Ubuntu is placed in a CD and click "Next".
6. Enter a user name and password to log in to Ubuntu after you install it, and click "Next"
7. Give your virtual machine a name, and choose its location, and click "Next"
8. Choose the size for the hard disk for the virtual machine, I will leave this as default, and then click
"Next"
10. After that, the installation will continue, and after that you finish installing ubuntu
II.
INSTALL NS2
4. Set the appropriate permissions for the ns-allinone-2.34 to allow executing the files inside it. To do
that: Right click the folder -> Properties -> Permissions , and choose the appropriate group with the
appropriate file access, then click "Allow executing file as program" and then click "Apply
permissions to enclosed files"
7. You need to be in the directory where you placed the ns-allinone-2.34 folder
8. If you are not in the /home/e , then move to it by using the command cd
9. Now, supposing you are in the directory /home/e (e can be any other user) type the following
command to move inside the ns-allinone-2.34 using the command cd
$ cd ns-allinone-2.34
10. Then, type the following command (you will be asked to enter the system password to process. Also,
you will be asked if you want to continue, type: y to continue):
$ sudo apt-get install build-essential autoconf automake libxmu-dev
III.
# LD_LIBRARY_PATH
OTCL_LIB=/your/path/ns-allinone-2.34/otcl-1.13
NS2_LIB=/your/path/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/your/path/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/your/path/ns-allinone-2.34/bin:/your/path/ns-allinone2.34/tcl8.4.18/unix:/your/path/ns-allinone-2.34/tk8.4.18/unix
NS=/your/path/ns-allinone-2.34/ns-2.34/
NAM=/your/path/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM
3. Save the file changes after your edit
4. Ensure that it immediately takes effect:
$ source ~/.bashrc
Note: the previous step is important; else you cannot successfully run ns-2.
5. Now, the installation has been completed. Try:
$ ns
6. The "%" symbol appears on the screen. Type "exit" to quit.
IV.
Validation
V.
References :
Dr. Basem Alkazemi pag:
http://uqu.edu.sa/page/ar/4519