Los sabores de la vida

sábado 6 de diciembre de 2008

Installation of ns-2 on Ubuntu 8.10

I write this short instructions to install the ns-2 network simulator under a fresh installation of Ubuntu 8.10 (Intrepid Ibex). Of course, it will work also in a non-fresh installation, and might help you to install in older versions of Ubuntu too. Here we go:


  1. Go into System > Administration > Synaptic Package Manager
  2. Install the following packages (and the dependent ones that are suggested by Synaptic):

  3. libxt-dev
    libxmu-dev
    g++
  4. Download ns-allinone-2.33.tar.gz from the official page.
  5. Unpack it in your Home Directory
  6. Go into Applications > Accessories > Terminal
  7. Write:

  8. cd ns-allinone-2.33/
    ./install
  9. Now just wait while it's working. Don't worry about all the warnings, it's ok.
  10. When it's completed, if everything was ok you will see something like this:
  11. ------------------------------
    ----------------------------------------------------

    Please put /home/octubre/ns-allinone-2.
    33/bin:/home/octubre/ns-allinone-2.33/tcl8.4.18/unix:/home/octubre/ns-allinone-2.33/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/octubre/ns-allinone-2.
    33/otcl-1.13, /home/octubre/ns-allinone-2.33/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/octubre/ns-allinone-2.
    33/tcl8.4.18/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.


    After these steps, you can now run the ns validation suite with
    cd ns-2.33; ./validate

    For trouble shooting, please first read ns problems page
    http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
    for related posts.
  12. Now, go into Places > Home Folder, and the file browser will appear.
  13. Inside the file browser, go into File > View and enable "Show Hidden Files".
  14. Then edit the file .bashrc that is in your Home Folder and, at the end of that file, just add the following 3 lines (they are 3 lines starting with export, your web browser probably shows more) and save it (you must replace octubre with your ubuntu username, it's very important!):

  15. export PATH=/home/octubre/ns-allinone-2.33/bin:/home/octubre/ns-allinone-2.33/tcl8.4.18/unix:/home/octubre/ns-allinone-2.33/tk8.4.18/unix:"${PATH}"
    export LD_LIBRARY_PATH=/home/octubre/ns-allinone-2.33/otcl-1.13:/home/octubre/ns-allinone-2.33/lib
    export TCL_LIBRARY=/home/octubre/ns-allinone-2.33/tcl8.4.18/library
  16. Now, go back to the Terminal, and write the following:
  17. source ~/.bashrc

So... if everything was ok now you should be able to run ns-2 without problems. Just write
nam
in a terminal window and enjoy!

1 comentarios:

dri.pnasc dijo...

Excellent! This tutorial is super practical. Helped me a lot!

Thanks.