Wednesday, January 30, 2013

Installing Network Simulator (NS2) on Ubuntu 10.04

This is my blog after quite a long time on how to install NS on Ubuntu 10.04
This works on Ubuntu 10.04. You can experiment for later versions.


I have provided a script which will help you perform all the steps automatically. Simply download the script from here and execute it with root privilege as below. Execute it at your own risk :P
  • sudo su 
  • chmod +x script.sh
  • . script.sh (find a dot and a space before the file name)

(or) 

Do execute the commands one by one manually to perform the installation.

  1. sudo apt-get update
  2. sudo apt-get build-essential autoconf automake libxmu-dev
  3. Download Net Sim from here
  4. tar -xvf ns-allinone-2.35.tar.gz
  5. for simplicity I am moving the extracted directory to directory named ns2 under home directory
  6. mv ns-allinone-2.35 ~/ns2 
  7. cd ns2/
  8. ./install
  9. Once the installation is done, you will be provided with the following path information
    • LD_LIBRARY_PATH
    • TCL_LIBRARY_PATH
    • PATH
    • TCL_LIBRARY
  10. Copy paste the above path information into your .bashrc (find a preceding dot) file as below
    • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/xyz/ns2/otcl-1.14
    • export TCL_LIBRARY_PATH=$TCL_LIBRARY_PATH:/home/xyz/ns2/tcl8.5.10/library
    • export PATH=$PATH:/home/xyz/ns2/bin:/home/xyz/ns2/tcl8.5.10/unix:/home/xyz/ns2/tk8.5.10/unix
    • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/xyz/ns2/otcl-1.14:/home/xyz/ns2/lib
    • export TCL_LIBRARY=$TCL_LIBRARY:/home/xyz/ns2/tcl8.5.10/library
  11. Save the .bashrc file and source the file using command below
    •  . .bashrc   (or)   source .bashrc
  12. All done and now test your installation with command below (This is optional. You can skip this step. This step will take some time and performs various tests on your installation and give you results.)
    • /ns2/ns-2.35/validate 
  13. now type ns or nam to start your Net Sim...



2 comments:

Unknown said...

hey when I do First step
"sudo apt-get update"
then it appears
"E: Unable to lock directory /var/lib/apt/lists/"

help me please..:$:$:$

Unknown said...

hey
when I do First step
"sudo apt-get update"
then it appears
"E: Unable to lock directory /var/lib/apt/lists/"

help me please..:$:$:$