Update Manager - Ubuntu Hardy Heron

Tutorial: Ns-2.33 (and nam) on Ubuntu 8.04 (Hardy Heron)

 

Since I have been working with ns2 for the last few months in preparation for my thesis I have decided to write a guide on how to install the most recent version of ns2 on the most recent version of ubuntu (at the time of this writing, Monday June 9th, 2008).

I have found many people already who have had difficulty setting it up so maybe this will be of some help to someone. For this tutorial I am assuming you have installed the most recent version of Ubuntu (8.04). (At the time of writing)

Step 1: Update Ubuntu

Since it has already been a month or so since Hardy Heron has been released its probably best, if you haven’t already done so to update Ubuntu. The easiest way I’ve found is to go to System>>Administration>>Update Manager. Alternatively, you can enter this into the terminal:

sudo apt-get update
sudo apt-get upgrade
Update Manager - Ubuntu Hardy Heron

Step 2: Download all of the required pieces to make ns2 work

Here is a list of archives required for ns2 to work properly (you can download them by clicking the links or just enter all of the commands in the code sections below for automatic download and untar). I saved each archive to the desktop so I could find each one easily but you could use anywhere you like.

  1. tcl 8.4.14
  2. tk 8.4.14
  3. otcl 1.13
  4. tclcl 1.19
  5. ns 2.33
  6. nam 1.13

Step 2.5: Install Ubuntu Packages

Before installing everything else, I have found that it is helpful to get a few packages from the ubuntu repositories or else it wont build correctly. Grab a cup of coffee it might take a while since kdebase-dev is somewhat large. I’m sure there is a way to do this with fewer packages however I know this works. If anyone figures out exactly which packages are required let me know so I can update this.

sudo apt-get install libx11-dev kdebase-dev

Step 3: Install tcl

wget http://www.jasonernst.com/wp-content/uploads/2008/06/tcl8.4.19-src.tar.gz
tar xvf tcl8.4.19-src.tar.gz
cd tcl8.4.19/unix
./configure
make
sudo make install

Step 4: Install tk

cd ..
cd ..
wget http://www.jasonernst.com/wp-content/uploads/2008/06/tk8.4.19-src.tar.gz
tar xvf tk8.4.19-src.tar.gz
cd tk8.4.19/unix
./configure
make
sudo make install

Step 5: Install oTcl

Important Note: The ‘./configure –with-tcl=’ portion of the following two code fragments should point to the source files for tcl. If you have been following the guide by copying and pasting the previous commands what we have here will work just fine. Otherwise you will need to change this to point to the correct location of your tcl source files.

cd ..
cd ..
wget http://www.jasonernst.com/wp-content/uploads/2008/06/otcl-src-1.13.tar.gz
tar xvf otcl-src-1.13.tar.gz
cd otcl-1.13
./configure --with-tcl=../tcl*/
make
sudo make install

Step 6: Install tclcl

cd ..
wget http://www.jasonernst.com/wp-content/uploads/2008/06/tclcl-src-1.19.tar.gz
tar xvf tclcl-src-1.19.tar.gz
cd tclcl-1.19
./configure --with-tcl=../tcl*/
make
sudo make install

Step 7: Install ns2

cd ..
wget http://www.jasonernst.com/wp-content/uploads/2008/06/ns-2.33.tar.gz
tar xvf ns-2.33.tar.gz
cd ns-2.33
./configure
make
sudo make install

You will likely get alot of warnings for deprecated conversions. Just ignore these or if you really are concerned about them visit the nsnam troubleshooting page. If you want to make sure your version of ns-2 is working correctly after the install you can run the validation test from within the ns2 source directory. You can do this by entering:

./validate

You should see that the test output agrees with the reference output. Congratulations you have a working version of ns-2 installed.

Step 8: (optional) Install nam

cd ..
wget http://www.jasonernst.com/wp-content/uploads/2008/06/nam-src-1.13.tar.gz
tar xvf nam-src-1.13.tar.gz
cd nam-1.13
./configure
make
sudo make install

Note: if you get this error:

error: X11/Xmu/WinUtil.h: No such file or directory

it may be necesary to do this:

sudo apt-get install libxmu-dev

You are now ready to start working with ns2 and nam. If you are like me and working on a new protocol or something you will want to start modifying the ns-2 source code and recompile again so you might want to keep that folder handy. The rest of the source can be safely removed as far as i know. Keep in mind after you have modified the source you will want to do another make install so that when you type ns in your terminal the version you just compiled is used.

Getting Started with NS2

These are some quick tips to get you started using ns2 if you are a beginner.

All example files are located in ns/tcl/ex. You can run these scenarios on ns2 using ns filename.tcl The best way to start is probably changing things in these files until you understand what is happening more thoroughly.

The output will usually be a trace file with a similar name: ex) filename.tr. Trace files can usually be viewed with a text-editor program. There are also tools to analyze the trace files and pull stats from them. These may require some tweaking however depending on the format of the trace file. Additionally, a nam output file for visualization may be generated as well. This will usually be named filename.nam. To view the visualization use: nam filename.nam

Useful Links

I thought it might be useful to add a section on useful links here since this article has become quite popular. If you would like to suggest a link feel free to contact me.

 

103 Responses to Tutorial: Ns-2.33 (and nam) on Ubuntu 8.04 (Hardy Heron)

 
  1. Paul Barr says:

    Reference NS-2.13. New to Ubuntu and Unix
    Followed all your steps. Steps 5, 6, 7, and 8 had no make files
    Did a ./validate – kept getting ./test-all-template1:149:../../ns:not found
    Since I’m a beginner how do I START NS ?

    Any help would be be great.

  2. Jason Ernst says:

    Hi there, the makefile is generated from the ./configure step. If you do not have one then there likely has been some problem in the configure stage. Try to look for some sort of error during this step because you may be missing a crucial package required for ns2. If you still have trouble getting it install you could email me the results of your ./configure step and I will try to help out. Also I suggest you join the ns2 mailing list which can be found on their website. Often people post on the list about problems getting ns2 to work there.

    To get ns2 to start, after it has successfully built with the instructions above, you should be able to just type ‘ns2 scriptname.tcl’ at the prompt where scriptname.tcl is the simulation file you wish to run.

  3. Milton says:

    Hi Jason
    I am a new user to the ns-2 your steps were very helpfull and were easy to works with step by step. Please can you let me know how can i get some script example on ipv6 mobelity (NEMO) on NS-2 or any of the ip mobelity scrips that work on ns-2? It is for me to be able to know and understnd how it can be implemented or how to do an new script for IPv6 mobelity.

    Thanks very much

  4. Jason Ernst says:

    Hey, I’m sure about the NEMO protocol specifically, but I’m fairly sure that ns2 supports mobile ip (but maybe only ipv4). If you go to Marc Greis’s Tutorial on ns2 here: http://www.isi.edu/nsnam/ns/tutorial/index.html there is a section on mobile IP for wired-cum-wireless topologies and it kinda walks through step by step on how to setup the tcl scripting for that sorta thing. This page lists a whole bunch of modules for ns2 for wireless and mobility: http://nsnam.isi.edu/nsnam/index.php/Contributed_Code#Wireless_and_Mobility

  5. Chris says:

    Hi Jason.The guide is very helpfull.Congratulations for the effort.
    I’m having a problem with the installation and after a reserach i found that it has to do something with gcc.In step 7 after make, when the procedure finishes it gives me this output:

    /usr/bin/ld: ns: hidden symbol `__stack_chk_fail_local’ in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO
    /usr/bin/ld: final link failed: Nonrepresentable section on output
    collect2: ld returned 1 exit status
    make: *** [ns] Error 1

    These are the last lines from the output.The rest output before these lines seem to be ok.Do you have any idea how i can solve this issue?
    Thanks in advance jason.

  6. Jason Ernst says:

    Hi Chris,
    This is actually a known problem with ns-2.30 / ns-2.31 and gcc 4.1. If you go to this page: http://nsnam.isi.edu/nsnam/index.php/Troubleshooting#ns-2.30.2Fns-2.31_do_not_build_with_gcc.2Fg.2B.2B_4.1 and look for the section called ns-2.30/ns-2.31 do not build with gcc/g++ 4.1, there are step-by-step instructions on how to fix it. There are basically two options for how to fix it: 1) Patch the make file or 2) Use gcc 4.0 to compile.

  7. Pingback: Jason’s Computer Science Blog » Blog Archive » ns-3.2 on Ubuntu 8.04 Hardy Heron

  8. joujou says:

    Hi
    Thank you very much for this guide.I followed it but when I executed ./validate, I have this message:validate overall report: some portable tests failed:
    ./test-all-red
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME.
    Do you have an idea to solve this problem.
    Thanks a lot for your help

  9. Jason Ernst says:

    Hey joujou,
    A good starting point would be to try each test individually to try to see if any of the tests validate correctly. I’ve never encountered this problem myself so I likely cannot help much. You could try posting in the ns2 mailing lists: http://www.isi.edu/nsnam/ns/ns-lists.html . Make sure you are very detailed about your computer, your compiler, what version of linux kernel you are using etc if you post there. The more information you give the better they can help.

  10. asmat alam says:

    sir .i have a problem in ns2 all version in fedora6.here is a big problem of nam.every time i installed ns2 .nam exectuable file is missing what should i do plz help me out.
    thanx

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Articles

Creating a Bluetooth Access point (NAP) in Ubuntu 11.10

Creating a Bluetooth Access point (NAP) in Ubuntu 11.10

November 29, 2011

A Bluetooth NAP is similar to a Wi-Fi access point. In this case, we will...

Screenshot at 2011-11-29 08:54:32

Burg / Grub 2 Icons for Meego

November 29, 2011

Only recently I noticed that Moblin (which I sometimes use) has changed...

Aircrack suite + Ubuntu 11.10 problems with monitor mode channel

Aircrack suite + Ubuntu 11.10 problems with monitor mode...

November 4, 2011

Recently I have been playing around with the aircrack suite and in...

 
Upcoming PhD QE Progress

Upcoming PhD QE Progress

July 27, 2011

So I've been doing my PhD for over two years now, and I haven't posted a...

waterloo

Why Blanket Wireless Coverage in Waterloo Failed, and...

July 22, 2011

Today the KW Record ran an article entitled "Blanket Wi-Fi plans unplugged...

sp1

Windows 7 – SP1, Multiple OS – Grub

July 17, 2011

A while ago I bought a Toshiba netbook which of course came with Windows 7...