hi!
As you know that ubuntu 9.10 is having lots of cool features and it's worth giving a try. But installing ns2 (The Network Simuator) through ns-allinone-2.3x package isn't easy on 9.10. While trying to install ns-allinone-2.3x, Firstly otcl doesn't compile with the latest gcc-4.4 (available with ubuntu 9.10). You need to compile it with gcc -4.3. If you get through this then also your problem is not solved, the ns-allinone-2.3x skips installing nam & xgraph as ubuntu 9.10 is not friendly with these packages available in ns-allinone-2.3x package.
I spent lots of time to fix this problem as one of my friend was doing his simulation on ns2 and finally ended up with an interesting lauchpad ppa for installing ns2 on Ubuntu.
Since Ubuntu 9.10 is already being shipped with tcl,otcl,tk... you need not to install these packages, Only ns, nam & xgraph are needed to install.
If you are behind a proxy, make sure you have $http_proxy variable configured in ~/.bashrc. [?]
If you are behind a proxy, make sure you have $http_proxy variable configured in ~/.bashrc. [?]
Following are the simple steps to install ns2 on Ubuntu 9.10 through launchpad ppa.
1> Firstly remove all ns-allinone-2.3x directory (if you put it anywhere to install ns2) and revert back all the path changes you made in ~/.bashrc related to ns2.
2> Now export the Wouter Horré's ppa repository key by typing the following command on terminal and enter:
2> Now export the Wouter Horré's ppa repository key by typing the following command on terminal and enter:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B3F3334F
3> Now add the following ppa repository to source list [?]
deb http://ppa.launchpad.net/wouterh/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/wouterh/ppa/ubuntu karmic main
Reload repository information when prompted by "The information about available software is out-of-date" notification or reload it manually by following command on terminal:
sudo apt-get update
4> Now type the following command on terminal to install ns from the launchpad ppa repository:
sudo apt-get install ns nam xgraphThat's all. There is no need to set-up any path, environment variables or make any changes in ~/.bashrc .
Type ns to check:
you should see % at the command prompt (indicating successful installation)
Type exit if you get stuck with the %
you should see % at the command prompt (indicating successful installation)
Type exit if you get stuck with the %
Now Try to run any example tcl file [You can get it here]
To run a tcl file type the following command:
ns example-tcl-file.tcl
Hope this method would work for you. Just comment below whether you were successful in installation or if you face any problem.
[Added on Jan 15, 2010] I have received so many queries regarding the files that are available with ns-allinone-2.3x package. Actually ns-allinone-2.3x package has two main things; 1) ns & supporting libraries to RUN IT & 2) Sample files, examples & support for various scenario such as wireless etc... to HELP YOU IN YOUR SIMULATION.
At this point only first one is done, For second one you need to refer to the all in one package.
For that:
[Added on Jan 15, 2010] I have received so many queries regarding the files that are available with ns-allinone-2.3x package. Actually ns-allinone-2.3x package has two main things; 1) ns & supporting libraries to RUN IT & 2) Sample files, examples & support for various scenario such as wireless etc... to HELP YOU IN YOUR SIMULATION.
At this point only first one is done, For second one you need to refer to the all in one package.
For that:
- Extract the ns-allinone-2.3x directory from the archive
- "DON'T RUN ./install" as ns2 is already installed on your system
- Now you are ready to use the files present in "ns-allinone-2.3x/ns-2.3x/" directory. e.g.: to run example scripts available with the package goto "/ns-allinone-2.3x/ns-2.3x/tcl/ex/" and run respective tcl file.

34 comments:
yeahh!!
Tks well done!
thank you so much for you support.But if i install NS-2 by
download pack-age and change the enviroment variable,i can see the directory that contain the folder ns-allinon.
following your way,i don't know where i istalled.
Can you tell me to know more.
Thank you so much !
By this method no ns-allinone package is created on your system.. packages are installed separately .
the ns is located in "/usr/bin/"
while tcl8.4 & tk8.4 can be found in:
"/usr/share/tcltk/"
If you are looking for some example/docs in ns-allinone package, you can refer to ns-allinone package.
thank u so much dude!!
was waiting for a post from anyone on installin ns2 on ubuntu 9.10,since the day koala was released.
thank u so much
thanks man!
where do we find 802.11.{cc,h} files? could you please help me find that? Thanks
thank u so much yaar.. its a nice..
Hi, thanks for this tutorial. My question is , now how can i patch some protocol like umts?? This is my first time with ns2 and understood that i need to copy some file in the ns2 dir for apply patch but how i do if i don't know where is the file ??
@peppe & madakasira
buddy i am not using ns2 for my project, i got to know abt the wouterh's ppa while trying to install ns2 for one of my friend for his simulation work. Thought this info may help others also in installing ns2 and I posted it.
If you know the exact file name that is to be patched, you can easily find its location by the "locate filename" command... and if you don't find it, you can refer to the ns-allinone package also as ns-allinone is having lots of sample files and much more.
Hi,
This does not work for me, and I have added the sources.... Running 9.10
tomehb@tomehb-desktop:~$ sudo apt-get install ns nam
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ns
@tomehb
follow steps 1-4 carefully....
If u miss any step, It won't work...
In ur case it seems that u didn't reload the repository information mentioned in Step 3.
I am having the same problem as tomehb... I reloaded the sources and I followed the steps too.
The installation is done, but which folder do i put my tcl files to run and where will my nam and tr files be outputed to
I get the same problem. It says that the signatures couldn't be verified because the key is not valid...
Any help with that?
W: GPG error: http://ppa.launchpad.net jaunty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7D2C7A23BF810CD5
It's a great and fantastic solution! Tanx alot for it!
AMAZING! VERY VERY GOOD and fast!
WE ARE STUDENTS FROME GREECE, GOT REALLY HELPED!
PLEASE SPREAD THE TRICK!
BRAVO!
Hello !
I am a B.Tech student at NIT Kurukshetra, I have a project to analyse video transmission over UDP and then compare the performance over TCP transmission.
Can anybody help me out ??
I am not able to use codecs in NS-2 to convert the video file to packets and then transmit them to be re-coded and played as a video.
Please help me out...
thanx a lot
it worked !!!
heyy !! By the way I'm from MNNIT as well; 3rd yr CS actually & i was wondering if u were free to help me out with a simulation project ?
hey I tried installing on fresh installation of ubuntu 9.10
Even then it says E:Couldn't find package ns
I hav followed every step that u hav specified above..
plz help me..!!
@Athreya
To install ns2 on ur system, u need to follow above mentioned steps in order.
Make sure you have exported the repository key, added the source and then have updated it.
In your case, It looks like you haven't updated it (see step 3).
@ALL
welcome... :-)
hope you all end up with a good simulation work.
i followed all ur instruction and got the % sign also..really thanks for that..
bt as u mentioned tht we ll need to extract allinone for the sample files n all..can u pls xplain me how i can do tht..
sorry!!! just started using linux.. :(
@bornagain
Since ns-allinone-2.3x comes in a .tar.gz compressed archive, firstly u need to extract(decompress) it to use.
If you already have an allinone package, you may extract it by following command:
"tar -xzvf ns-allinone-2.xx.tar.gz" (replace x with the version of your allinone).
Hope you got it!!...
how to implement MAODV with your step by step easiest way to install ns2 in ubuntu 9.10?? i been confused about it... please help me...
thank you .. it was of great help
Awesome...This one worked. I tried so many methods to install NS2. None of them worked. Thanks a lot.
Hello! This is very useful! Can I copy it to my MSN space? I will mark the original link to here. Thank U!!
If do not allow me to republish your blog, plz tell me by email: xmucaiwei@gmail.com . In case of that, I will delete it.
Thank you!
Thanks Yasir!!!!!!!!!
It works.....
THanks Yasir!!....Your article was very helpful...
Hi
thanx for the tutorial..
i am able to successfully install ns from the above method and the files of ns, xgraph & nam are present in usr/bin
now i am unable to run the example and receive following error:
% ns examplename.tcl
error when calling class Oldsim: example2.tcl
@Moeed
Hey! Looks like firstly you are entering into ns (typing ns & hitting enter) and then trying to run example2.tcl over there, DON'T DO THAT.
instead direct the operation of cd installation path /......./ examples, and then run "ns example2.tcl" by the terminal itself...
$ ns
% ns examplename.tcl <~~~~ DON'T
$ ns examplename.tcl <~~~~ DO
Post a Comment