Install NS2 (ns-2.35) in Ubuntu 11.10
- Unzip or untar it to any folder (recommended is
/home/loginname) using the following commands one by one
sudo apt-get update
- Using cd command go
into appropriate folder, where the .gz file exists, and then execute
below commands
tar zxvf ns-allinone-2.35.tar.gz
sudo apt-get install build-essential autoconf automake libxmu-dev
cd ns-allinone-2.35
./install
- Once installed the PATH information will be provided to you.
So dont close the terminal after installation complete, because you
dont get path again.)
You will see some configuration in
some last lines of completed installation as shown below.
Please put
/home/Shreeji/Desktop/NS-Installation/ns-allinone- 2.34/bin:/home/Shreeji/Desktop/NS-Installation/ns-allinone- 2.34/tcl8.4.18/unix:/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/otcl-1.13, /home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=
(2) You MUST put /home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.
- Open .bashrc file in new terminal using below
command,
gedit ~/.bashrc
- At the end of file, copy below lines,
export PATH=$PATH:<Place your paths here>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: <place the LD_LIBRARY_PATHS>
So your last 2 lines in .bashrc file will looks like,
export PATH=$PATH:/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/bin:/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/tcl8.4.18/unix:/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/tk8.4.18/unix
export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/otcl-1.13:/home/Shreeji/Desktop/NS-Installation/ns-allinone-2.34/lib
(dont forget to put : in above line)- Once done, save the file and close.
- execute the below command,
- source ~/.bashrc
Now run the ns:
# nsIf the installation is successful, then you will see % at the command prompt:
%To exit, type:
% exit
(If it dont run properly, please check /bashrc file, and check the last two lines inserted)Now your ns2 installation is complete and running.
Optional things to install
1. Xgraph (for plotting graph)
2. gawk (for calculating throughput and jitter etc)
Both softwares you can download directly from ubuntu software center.
NS2 Tutorials
You can find some good tutorials here.
You can download ns2 manual here.
Nice work thanks
ReplyDelete