ns-2.35 installation

15
Installing NS 2 Installing NS 2 by Teerawat Issariyakul http://www.ns2ultimate.com March 2010 (last updated September 2010) http://www.ns2ultimate.com 1

Upload: teerawat-issariyakul

Post on 16-Dec-2014

42.560 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Ns-2.35 Installation

Installing NS 2Installing NS 2

by Teerawat Issariyakul

http://www.ns2ultimate.com

March 2010

(last updated September 2010)

http://www.ns2ultimate.com 1

Page 2: Ns-2.35 Installation

OutlineOutlineKnown Issues as of March 2010Working SolutionStep-by-Step Installation

◦ Ubuntu◦ Windows

Acknowledgement

http://www.ns2ultimate.com 2

Page 3: Ns-2.35 Installation

NS2 DOES NOT work under the following environment.

Possible cause: gcc version!

Known Issues as of March Known Issues as of March 20102010

Window platform:oversion XP and 7oNS2 version: 2.33 and 2.34oCygwin 1.5.25 and 1.7.1ogcc version 3.4.4-999

Ubuntu platform:oversion 9.10ogcc version 4.4.1

http://www.ns2ultimate.com 3

Page 4: Ns-2.35 Installation

These two solutions are tested. They DO WORK!!

Note: ns-2.35 checks for gcc4 and gcc4-g++ rather than gcc and gcc-g++

Working SolutionWorking Solution

Window platform:oversion XP and 7oNS2 version: 2.35oCygwin1.7.1ogcc version 4.3.4

Ubuntu platform:oversion 8.04oNS2 version 2.33 and 2.34ogcc version 4.2.4

http://www.ns2ultimate.com 4

Page 5: Ns-2.35 Installation

Ubuntu: please see my previous post

http://

www.ns2ultimate.com/post/439346614/working-combination-ns-2-34-ubuntu-8-04-and-perhaps

Windows Use cygwin

◦ Required package:

gcc4, gcc4-g++, gawk, tar, gzip, make, patch,

perl, w32api

◦ Graphic package:

xorg-server, xinit, libX11-devel, libXmu-devel

◦ Graphic package if required if you would like to run

graphical things like nam or Xgraph. I find them

unnecessary.

Step-by-Step InstallationStep-by-Step Installation

http://www.ns2ultimate.com 5

Page 6: Ns-2.35 Installation

1. Go to cygwin.com

Installing Cygwin 1.7.1Installing Cygwin 1.7.1

click here to get file“setup.ex

e”

2. Run the file “setup.exe”

http://www.ns2ultimate.com 6

Page 7: Ns-2.35 Installation

2. Run the file “setup.exe”

Installing Cygwin 1.7.1Installing Cygwin 1.7.1

Keep hitting next and provide

directory information

http://www.ns2ultimate.com 7

Page 8: Ns-2.35 Installation

3. When you hit this page, choose the required (e.g., gcc4) and optional packages

Installing Cygwin 1.7.1Installing Cygwin 1.7.1

Search the package

name here

Expand package category

by clicking ‘+’

Click here to install all the

optional package

When you are done, hit ‘next’

http://www.ns2ultimate.com 8

Page 9: Ns-2.35 Installation

Installing NS2Installing NS24. Open Cygwin5. Download and extract ns2allinone2.35-RC3 package6. Go to your home directory by typing

» cdHere, you can type pwd to see the full path of your home directory.7. Extract the package by calling

»tar -xvf ns-allinone-2.35-RC3.tar.gz

http://www.ns2ultimate.com 9

Page 10: Ns-2.35 Installation

8. When done, call

»cd ns-allinone-2.35-RC3

»./install

9. When the installation completes adds the followings into the file “.bashrc” located in your home directoryNSHOME=~/ns-allinone-2.35-RC3

OTCL_LIB=${NSHOME}/otcl-1.14

NS2_LIB=${NSHOME}/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB

export TCL_LIBRARY=${NSHOME}/tcl8.5.8/library

PATH=$PATH:${NSHOME}/ns-2.35:${NSHOME}/nam-1.15

Note: Look carefully at the directory you might have to change something

Installing NS2Installing NS2

http://www.ns2ultimate.com 10

Page 11: Ns-2.35 Installation

1. Test whether the NS2 directory should be added to the $PATH variableTest by executing

>> echo $PATH

Your NS2 path should be shown above.You can now execute NS2 from any directory

Verifying the InstallationVerifying the Installation

http://www.ns2ultimate.com 11

Page 12: Ns-2.35 Installation

2. Now type ns

An NS command prompt % should appear on the screen, and you are done!

Verifying the InstallationVerifying the Installation

http://www.ns2ultimate.com 12

Page 13: Ns-2.35 Installation

If it’s not working, you may create a link to ns2 executable

>>cd /usr/local/bin

>>ln –s /home/T_Bear/ns-allinone-2.35-RC3/ns-

2.35/ns.exe

And, now you should be able to run ns2

Troubleshooting Troubleshooting

http://www.ns2ultimate.com 13

Page 14: Ns-2.35 Installation

AcknowledgementAcknowledgement I would like to acknowledge

tumblr.com, slideshare.net

Lupe Krops for useful discussion.

Aslinda Hassan for confirming the problem with gcc

version.

Tom Handerson and Sidney Doria for his suggestion on

ns-2.35

Chaiyut Jandang for his blog (

http://jacaranda-jandaeng.blogspot.com/2009/12/ns2-ns-234-ubuntu-904.html

) in Thai language

Sucha Supittayapornpong for introducing

Slideshare.com (http://suchaxplore.blogspot.com/).http://www.ns2ultimate.com 14

Page 15: Ns-2.35 Installation

For more information For more information about NS 2about NS 2

Please see this book from Springer

T. Issaraiyakul and E. Hossain, “Introduction to Network Simulator NS2”, Springer 2009

http://www.ns2ultimate.com 15