![]() |
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
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.
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 installStep 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 directoryit may be necesary to do this:
sudo apt-get install libxmu-devYou 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.
- Ns2 Wiki
- Marc Greis’ Tutorial
- NS Manual
- NS for Beginners (pdf)
- Common NS2 Installation Problems
- NS2 Wireless and Mobility Modules
- NS2 Mailing Lists
- NS2.33 Wireless MAC and PHY improvements
Previous: « Fair Scheduling & Load Balancing in WMN
103 Responses to Tutorial: Ns-2.33 (and nam) on Ubuntu 8.04 (Hardy Heron)
Leave a Reply
Leave a Reply
Recent Articles
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...
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...
November 4, 2011
Recently I have been playing around with the aircrack suite and in...
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...
Why Blanket Wireless Coverage in Waterloo Failed, and...
July 22, 2011
Today the KW Record ran an article entitled "Blanket Wi-Fi plans unplugged...
Windows 7 – SP1, Multiple OS – Grub
July 17, 2011
A while ago I bought a Toshiba netbook which of course came with Windows 7...








June 11, 2008

Categories:
Tags: 










Sitemap
Valid XHTML
Valid CSS
Login
Hi Jason,could you send a message to joujou or see this detail to solve this problem? Cause i have the same poblem with him.
Category: Validation Failure
Package: ns 2.27
OS: Ubuntu 8.04 (Hardy Heron)
Description:
>
> Description of Problem:
>
> When I run validate, it reports like this:
> validate overall report: some tests failed:
> ./test-all-red
> to re-run a specific test, cd tcl/test; ../../ns test-all-TEST-NAME
> Notice that some tests in webcache will fail on freebsd when -O is turned on.
> This is due to some event reordering, which will disappear when -g is turned on.
>
> Then I run “cd tcl/test; ../../ns test-all-red” and it reports:
>
> robin@robin:~/ns-allinone-2.27/ns-2.27/tcl/test$ ./test-all-red
Tests: red1 ecn red2 red_twoway red_twowaybytes flows_unforced flows_forced flows_combined ungentle gentle gentleEcn gentleEcn1 ungentleBadParams gentleBadParams q_weight q_weight_auto
Running test red1:
../../ns test-suite-red.tcl red1
0/cwnd=1.0000/ssthresh=15/ack=-1
5/cwnd=40.7922/ssthresh=15/ack=732
Test output agrees with reference output
next?
unknown event: 4
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:0.0″
after 52682 requests (37711 known processed) with 0 events remaining.
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:0.0″
after 552 requests (442 known processed) with 0 events remaining.
>
Any ideas how to deal with it?
I followed all the steps u mention. But I can’t install NS-2.33.
I can’t type command “make” on that step.
When i type the command “make”, i get the message “No target specified and no makefile found”.
Do u have any idea for that?
Hey, it sounds like you are not within the correct folder since it sounds like there is no ‘Makefile’ where you are trying to type this. For each package you wish to install you need to change into the appropriate folder and type make, if you look at the commands I have listed in the instructions, this should happen.
hello sir,
first thanks for you effort, this guide is very helpful and detailed.
i have some problem with ./configure i obtain this:
No .configure file found in current directory
Continuing with default options…
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
…
config.status: creating indep-utils/webtrace-conv/epa/Makefile
config.status: creating indep-utils/cmu-scen-gen/setdest/Makefile
config.status: creating autoconf.h
config.status: autoconf.h is unchanged
is this normal? and how can i start testing simple instruction with, ns, sorry for my ignorance !
thanks ^^
It looks like it worked fine from what you attached to it. To start testing some simple things you could try changing to the ‘ns/tcl/ex’ directory. In here you will find some example tcl scripts that will have simple scenarios. To run one of these files with ns2 you enter:
ns filename.tclYou can try editing these and seeing the results. The output will usually be in a .tr file which is named similar to the tcl file you have run with ns2. Some tcl files will also generate a .nam file. This allows you to view a visualization of the simulation using the nam tool if you installed this as well. You can then typenam filename.namin order to see the visualization.thank you for your clear and fast response
i have choosing for example shuttle.tcl
ns shuttle.tcl
it’s return me:
Nameserver not responding
shuttle.tcl NS record not found, try again
i have trying with other exemples … it’s return me the same thing!
is this normal? and where can i find the .tr file?
thank you very much
It sounds like you have some other sort of ns program set up on your computer. It looks like it is trying to connect to a server on the internet with the same name as the filename you are specifying for your input file for the ns simulator program.
do you think that is related with PATH variable in LINUX?
like in this http://www.nabble.com/Problem-with-NS2-installation-td20665635.html
Yes, it sounds like the same problem
Pingback: Vehicular Networks: How To Install Ns 2 On Ubuntu
Hello, Thanks for your all time.
I am implementing LEACH protocol using NS2.27 on Fedora.
But I have a error with ./config command.
Config.status: autoconf is unchanged
Do you have a any suggestion for it?
Hi Oogii,
This likely means that nothing changed in your configuration since the last time you ran this tool. This tool will only detect changes in required system components and does not need to be run every time you make a change in your ns2 source. When you make changes in your ns2 source you probably only need to run ‘make clean’, ‘make’ and then ‘make install’
Hi Jason,
I had installed ns2.33 on ubuntu and was able to run the tcl scripts and view the outputs in nam and in trace graph. I added um-olsr patch as suggested in http://masimum.inf.um.es/?Software:UM-OLSR:Installation, and now when I try to run any tcl scripts it displays ..”filename.tcl does not exist, try again”.
Please suggest.
Bandana, the only suggestion I have would be to ensure you are running ns from the same directory as your tcl scripts. You might be able to find more help from the site you referred to in your link.
Thanks Jason,
Yea I wasn’t aware that I was not in the same directory .
It works now !!!
Thanks once again.
No problem, good luck with your simulations!