Install

12
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-allinone- 2.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 right- clicking 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 Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26 1 of 12 06/06/10 01:25

Transcript of Install

Page 1: Install

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-allinone-

2.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 right-

clicking 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 pathcontains the path in my system, replace “venkat” in path with your username)

# LD_LIBRARY_PATHOTCL_LIB=/home/venkat/ns-allinone-2.34/otcl-1.13NS2_LIB=/home/venkat/ns-allinone-2.34/libX11_LIB=/usr/X11R6/lib

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

1 of 12 06/06/10 01:25

Page 2: Install

USR_LOCAL_LIB=/usr/local/libexportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$US

# TCL_LIBRARYTCL_LIB=/home/venkat/ns-allinone-2.34/tcl8.4.18/libraryUSR_LIB=/usr/libexport TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATHXGRAPH=/home/venkat/ns-allinone-2.34/bin:/home/venkat/ns-allinone-2.34/tcl8.4.18/unix:/home/venkat/ns-allinone-2.34/tk8.4.18/unixNS=/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-ubuntu-

gutsy-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”

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

1.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

2 of 12 06/06/10 01:25

Page 3: Install

architecture you are concentrating on, like x86, Power PC or something.

Coz , I’m currently working on integrating ubuntu on ARM based

processors, specifically 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

Venkatanathan says:

October 16, 2009 at 2:57 am

Oh, thats COOL I don’t 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)

2.

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

3.

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 shouldn’t be a problem…

4.

Ramy says:

November 1, 2009 at 6:27 pm

5.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

3 of 12 06/06/10 01:25

Page 4: Install

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

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.

6.

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’ isn’t defined

ld: final link failed: Nonrepresentable section on output

make: *** [libotcl.so] Error 1

otcl-1.13 make failed! Exiting …

I’ve installed ns2 before but this time I am getting this error. Please help.

Thanks

7.

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.

8.

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-ubuntu-

9.10-766193/

It seems that ns2 isn’t working well with the newer gcc and g++ …

9.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

4 of 12 06/06/10 01:25

Page 5: Install

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

Eric Ayienga says:

November 6, 2009 at 9:41 am

Hi,

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

10.

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??.. :-/

11.

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.

12.

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

13.

Venkatanathan says:

November 7, 2009 at 6:31 pm

14.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

5 of 12 06/06/10 01:25

Page 6: Install

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.

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

:)

15.

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

16.

Venkatanathan says:

December 20, 2009 at 2:09 pm

I can’t understand your question… energy?? sorryif it is naive question, I

am still a novice with NS2.

17.

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

18.

Sharief says:

January 5, 2010 at 10:40 am

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

19.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

6 of 12 06/06/10 01:25

Page 7: Install

first time thanks yaar thanks again…………………..

QFDaniel says:

January 11, 2010 at 5:23 pm

Actually,good post. thx

20.

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

21.

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….

22.

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

23.

dwi prayoga says:

January 28, 2010 at 7:53 am

hi guys, i’m a newbie in linux and ns2… now, i am trying to install ns2 in

linux…

i’m following your instructions, but when i type ./install

this line shows up

“=================================================

* Build tcl8.4.18

24.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

7 of 12 06/06/10 01:25

Page 8: Install

==================================================

cd: 424: can’t 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 fix for your platform.”

can you help me guys?? i really appreciates your help…

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 file) you should use the

correct paths. Thats all! (I haven’t 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 shouldn’t havethat problem.

25.

PBhanu says:

January 30, 2010 at 4:26 pm

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

26.

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

27.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

8 of 12 06/06/10 01:25

Page 9: Install

its urgent i need it for my thesis

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!

28.

Roy Antony Arnold says:

February 5, 2010 at 5:58 am

Thank you very much for providing this information……

29.

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..

30.

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!

31.

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..

32.

Renu says:

March 11, 2010 at 3:59 pm

33.

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

9 of 12 06/06/10 01:25

Page 10: Install

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 file.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...

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

10 of 12 06/06/10 01:25

Page 11: Install

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

Ubuntu About Me (1)

Miscellany (1)

TECHiE (3)

TOUCHiE (2)

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

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

11 of 12 06/06/10 01:25

Page 12: Install

April 2010

M T W T F S S

« Mar

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

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

Installing NS2 in simple 5 steps | eXperiences and ... http://blog.ceglug.org/venkat/?p=26

12 of 12 06/06/10 01:25