Вы находитесь на странице: 1из 12

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

eXperiences and eXpressions Mind shares the TECHiE and Heart the TOUCHiE

Type text to search here...


Home About Me Home About Me

Installing NS2 in simple 5 steps


Posted on August 23 2009 by Venkatanathan Step 1: Download the source for NS2 all in one (I used this version ns-allinone2.34.tar.gz ) from the link http://sourceforge.net/projects/nsnam/files/ Step 2: Extract the tar.gz file downloaded into your home folder by rightclicking the tag.gz file Step 3: Open terminal (Applications>Accessories>Terminal) and change the directory (using cd command) to the extracted folder and execute the following:

sudo apt-get install build-essential autoconf automake libxmu-dev


This will install the dependencies required to compile NS2 from the source. The following command is used to compile the source.

./install
It will take long time to compile all the required packages for ns to work Step 4: Setting Environmental Variables Type in terminal:

gedit ~/.bashrc
and append the following text to the opened file (Please note that the path contains the path in my system, replace venkat in path with your username)

# LD_LIBRARY_PATH OTCL_LIB=/home/venkat/ns-allinone-2.34/otcl-1.13 NS2_LIB=/home/venkat/ns-allinone-2.34/lib X11_LIB=/usr/X11R6/lib


1 of 12 06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

USR_LOCAL_LIB=/usr/local/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$US # TCL_LIBRARY TCL_LIB=/home/venkat/ns-allinone-2.34/tcl8.4.18/library USR_LIB=/usr/lib export TCL_LIBRARY=$TCL_LIB:$USR_LIB # PATH XGRAPH=/home/venkat/ns-allinone-2.34/bin:/home/venkat/ns-allinone2.34/tcl8.4.18/unix:/home/venkat/ns-allinone-2.34/tk8.4.18/unix NS=/home/venkat/ns-allinone-2.34/ns-2.34/ NAM=/home/venkat/ns-allinone-2.34/nam-1.14/ PATH=$PATH:$XGRAPH:$NS:$NAM
Step 5: Now, after editing the file, save and close it. Then in terminal type:

source ~/.bashrc
Try ns command, it shud go to the % prompt then it just means the installation was successful! Enjoy Note: These steps have been tested and worked like breeze in Ubuntu and is expected work in all the debian based linux. Reference: 1.) http://nsnam.isi.edu/nsnam/index.php/Installing_ns2.31_on_Ubuntu7.04 2.) http://alkautsarpens.wordpress.com/2008/02/05/install-ns231-for-ubuntugutsy-710/ 3.) http://www.isi.edu/nsnam/ns/ns-build.html (Might not be needing this, but just in case)

33 Responses to Installing NS2 in simple 5 steps


1.

Vivek Raghunathan says: September 9, 2009 at 12:33 am


Dude, Continue your service. Expecting more and more information regarding Linux. Also, I know that you work in Linux environment now. Is there any specific

2 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

architecture you are concentrating on, like x86, Power PC or something. Coz , Im currently working on integrating ubuntu on ARM based processors, specically Cortex 9 series. Doing lot of research on that and came to a conclusion that not a lot of resource available on porting a full fledged OS with all necessary applications on ARM. Experiencing lot of bottle necks and stuff. Hope to have your help in few things. Good luck Vivek 2.

Venkatanathan says: October 16, 2009 at 2:57 am


Oh, thats COOL I dont know much about Cortex 9 series of processors, but this, https://wiki.ubuntu.com/ARM might give you some directions. It gives info ubuntu support for various ARM based processor. (it is possible you might have come across it already, but just in case)

3.

Ramy says: October 30, 2009 at 4:04 pm


Hello I did all the above and it worked great but when I write ( ns ) in step 5 it says command not found. Can you please help ! I am using ns-2.34 on ubuntu 9.10

4.

Venkatanathan says: October 30, 2009 at 4:52 pm


Check if you replaced the path in .bashrc file with the exact path to the ns2 source, (for me it was: /home/venkat/ns-allinone-2.34/ ) Your ubuntu version shouldnt be a problem

5.

Ramy says: November 1, 2009 at 6:27 pm

3 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

hello again I am sorry I just discovered the error when installing the allinone 2.34 it goes normally then during the otcl phase it says ( otcl-1.13 make failed! Exiting ) what does that mean ? how do I solve it! Thanks alot for your help 6.

Venkatanathan says: November 2, 2009 at 12:35 am


Did you complete step 3, sudo apt-get install build-essential autoconf automake libxmu-dev ? Make sure you are connected to the Internet when executing the above command in terminal.

7.

Eric Ayienga says: November 2, 2009 at 9:51 am


Hi, I have followed all the steps but still get the error: ld: libotcl.so: hidden symbol `__stack_chk_fail_local isnt dened ld: final link failed: Nonrepresentable section on output make: *** [libotcl.so] Error 1 otcl-1.13 make failed! Exiting Ive installed ns2 before but this time I am getting this error. Please help. Thanks

8.

Eric Ayienga says: November 2, 2009 at 10:55 am


Hi. I am connected to the Internet and have done all the steps but I am still experiencing the problem in number 5. I am trying to install ns 2.34 on Ubuntu 9.10. Will appreciate your help.

9.

Venkatanathan says: November 3, 2009 at 4:32 pm


There seems to be a similar problem .. http://www.linuxquestions.org /questions/linux-networking-3/ns-installation-wont-let-me-do-it-on-ubuntu9.10-766193/ It seems that ns2 isnt working well with the newer gcc and g++

4 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

I am using gcc and g++ version: 4.3.2 and its working fine for me. See the forum link, it worked for people having this problem. Venki 10.

Eric Ayienga says: November 6, 2009 at 9:41 am


Hi, Thanks. That is the problem. I did it and it worked.

11.

Yasir Imteyaz says: November 6, 2009 at 4:54 pm


hey! is nam is working properly with you guys on 9.10??. in my case it got installed successfully but nam is not working any idea??.. :-/

12.

Ramy says: November 6, 2009 at 8:23 pm


Alright I finally solved the problem ( otcl-1.13 make failed! Exiting ) there is a line missing in the file config.in in the otcl folder provided with allinone. It can be found on ns-2 troubleshooting page on wiki. just google it.

13.

Ramy says: November 6, 2009 at 8:30 pm


Hello venkat I am working on a simulation of routing in mesh wireless LANs. I read somewhere you were asking about ( HWMP ) are you working on it now ? may be you can help get started. I need some sort of a model for 802.11s networks on ns-2. Thanks immensely

14.

Venkatanathan says: November 7, 2009 at 6:31 pm

5 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

Hi Ramy, I am not that much into NS2 . Just a beginner.. learning.. @Yasir Imteyaz Hi, I tried only with 8.10, but I have seen it work well with 9.10 too. 15.

Ankur says: November 16, 2009 at 2:59 pm


Hello , I am very happy that i could refer to this forum and get things done. And my special thanks to Venkat. I also thank others who participated in this thread, coz they have asked all the doubts i got during the time of installation. . Thanks :)

16.

vinod says: December 15, 2009 at 5:03 pm


Can you please help me how to insert energy in to my node in NS2.If i follow the manual am getting a syntax error

17.

Venkatanathan says: December 20, 2009 at 2:09 pm


I cant understand your question energy?? sorryif it is naive question, I am still a novice with NS2.

18.

Hina says: December 24, 2009 at 2:51 pm


i cant find the solution for otcl-1.13 make failed! Exiting ) could u plz tell me what line it was

19.

Sharief says: January 5, 2010 at 10:40 am


What a man you are i got success in installing a unknown package for the

6 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

rst time thanks yaar thanks again.. 20.

QFDaniel says: January 11, 2010 at 5:23 pm


Actually,good post. thx

21.

Anurag says: January 14, 2010 at 4:32 pm


Go to your otcl-1.13 folder, open the Makefile.in and make the following changes in the 7th line: From : CC= @CC@ to : CC= gcc-4.3

22.

Niket says: January 15, 2010 at 4:08 am


Hi , Can you please explain the steps to install of NS 2.27 onto Ubuntu 9.10. I have gcc version 4.4.1.

23.

Lordwin says: January 17, 2010 at 8:26 am


Hi friends, Im new to ns2 can any one help me links to run the programs

24.

dwi prayoga says: January 28, 2010 at 7:53 am


hi guys, im a newbie in linux and ns2 now, i am trying to install ns2 in linux im following your instructions, but when i type ./install this line shows up ================================================= * Build tcl8.4.18

7 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

================================================== cd: 424: cant cd to ./tcl8.4.18/unix autoconf: error: no input file ./install: 432: ./configure: not found tcl8.4.18 configuration failed! Exiting Tcl is not part of the ns project. Please see http://www.Scriptics.com to see if they have a x for your platform. can you help me guys?? i really appreciates your help 25.

Venkatanathan says: January 30, 2010 at 9:57 am


Hi Niket, The steps should remain same, except you require to download the appropriate Ns2 all-in-one version and while setting the environment variables (that is the content to be put in .bashrc le) you should use the correct paths. Thats all! (I havent tried with ns2.27 on 9.10 , but it should work) Hi Lordwin, There is an various tutorials to learn NS2 online, here is one that might help you: http://nile.wpi.edu/NS/ Hi, dwi prayoga While extracting the source, you might have extracted in root user mode. You should change the permission of the folder. cd to directory where you have ns-allinone-2.34 directory and execute this command sudo chmod -R 777 ns-allinone-2.34. Now you shouldnt havethat problem.

26.

PBhanu says: January 30, 2010 at 4:26 pm


Thanks a lot.You solved a lot of my burden.

27.

wamiq says: January 31, 2010 at 1:20 pm


Hello , I have install cygwin in windows vista , and now i am trying to install NS-2 allinone-2.34 but there is an error coming and it is, make: ***[tclUnixTime.o] error 1 tcl8.4.18 make failed ! exiting for more problem with tk/tcl see, http://www.Scriptics.com

8 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

its urgent i need it for my thesis 28.

Venkatanathan says: February 4, 2010 at 2:07 am


Hi Wamiq, Another guy has written an HowTo for installing in Windows (using Cygwin) Check it out: http://paulson.in/?p=49 Hope it helped!

29.

Roy Antony Arnold says: February 5, 2010 at 5:58 am


Thank you very much for providing this information

30.

varsha says: February 14, 2010 at 1:36 pm


i have 2 do my final year project in NS2.. i ve successfully installed it acc 2 ur 5 steps.. can u pls temme how 2 proceed!! pls..

31.

Venkatanathan says: February 15, 2010 at 3:10 am


You have to write the simulation script (TCL script) and save the file. You can then execute the script using the command: ns There are many tutorials on how to write the scripts, one of them is : NS by example (http://nile.wpi.edu/NS/) Hope that was helpful!

32.

varsha says: February 15, 2010 at 12:45 pm


yea!! tat was helpful.. but i have already finished coding in C++.. is ter any way 2 integrate my C++ code with NS2 to simulate the output..??? cos i dunno tcl script, so i thought coding in C++ will be easier..

33.

Renu says: March 11, 2010 at 3:59 pm

9 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

Hi I am currently doing a project in ns2 The problem is after successful installation and even after using ns properly Today it gave an error on executing ns le.tcl the error is Nameserver not responding After updating the packges and restarting ubuntu, when i executed the same command the error given is file.tcl not found I have checked bascrc for path and have updated the packages too Can u help me how to correct this error and get my ns working properly again waiting for a reply

Leave a Reply
Name (required)

Mail (will not be published) (required)

Website

Submit Comment
Use the snake, to solve a problem My way of How to Crack GRE recent entries recent comments archives Visit to HPCA-PPoPP 2010 at IISc Some simple questions with complex answers...

10 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

The strong intangible bonding... My way of How to Crack GRE Installing NS2 in simple 5 steps Use the snake, to solve a problem Reason, Purpose and Me Venkatanathan: @Ashoke: Hee hee :) except for the ... Arun: The IISc student whom we met, his ... Ashoke: Good job... :) You got one hell of ... Renu: Hi I am currently doing a project... jagadish: Really nice post :) Too good to kin... jagadish: Oh that is nice :) i stumbled upon ... varsha: really positive n encouraging!! kee... March 2010 October 2009 August 2009 Tag Cloud
Conference GRE HowTo IISc Installation love Network Simulator NS2 Programming Python Spiritual Tutorial

About Me (1) Miscellany (1) TECHiE (3) TOUCHiE (2)


Ubuntu

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better. Categories About Me (1) Miscellany (1) TECHiE (3) TOUCHiE (2) Recent Comments Venkatanathan on Visit to HPCA-PPoPP 2010 at IISc Arun on Visit to HPCA-PPoPP 2010 at IISc Ashoke on Visit to HPCA-PPoPP 2010 at IISc Renu on Installing NS2 in simple 5 steps jagadish on Visit to HPCA-PPoPP 2010 at IISc Calendar

11 of 12

06/06/10 01:25

Installing NS2 in simple 5 steps | eXperiences and ...

http://blog.ceglug.org/venkat/?p=26

April 2010 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Mar Recent Posts Visit to HPCA-PPoPP 2010 at IISc Some simple questions with complex answers The strong intangible bonding My way of How to Crack GRE Installing NS2 in simple 5 steps Who's Online 0 Members 1 Guests Archives March 2010 (1) October 2009 (3) August 2009 (3) Copyrighted 2010 eXperiences and eXpressions. Wordpress Theme developed by Web Hosting Fan

12 of 12

06/06/10 01:25

Вам также может понравиться