Sie sind auf Seite 1von 13

Installing NS 2

by Teerawat Issariyakul
http://www.ns2ultimate.com

March 2010

http://www.ns2ultimate.com 1
Outline
Known Issues as of March 2010
Working Solution
Step-by-Step Installation
◦ Ubuntu
◦ Windows
Acknowledgement

http://www.ns2ultimate.com 2
Known Issues as of March 2010
NS2 DOES NOT work under the following
environment.

Window platform: Ubuntu platform:


o version XP and 7 o version 9.10
o NS2 version: 2.33 and o gcc version 4.4.1
2.34
o Cygwin 1.5.25 and 1.7.1
o gcc version 3.4.4-999

Possible cause: gcc version!


http://www.ns2ultimate.com 3
Working Solution
These two solutions are tested. They DO WORK!!

Window platform: Ubuntu platform:


o version XP and 7 o version 8.04
o NS2 version: 2.35 o NS2 version 2.33 and
o Cygwin1.7.1 2.34
o gcc version 4.3.4 o gcc version 4.2.4

Note: ns-2.35 checks for gcc4 and gcc4-g++


rather than gcc and gcc-g++
http://www.ns2ultimate.com 4
Step-by-Step Installation
Ubuntu: please see my previous post
http://
www.ns2ultimate.com/post/439346614/working-co
mbination-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. http://www.ns2ultimate.com 5
Installing Cygwin 1.7.1
1. Go to cygwin.com

click here to
get file
“setup.exe”

2. Run the file


“setup.exe”

http://www.ns2ultimate.com 6
Installing Cygwin 1.7.1
2. Run the file “setup.exe”

Keep hitting
next and
provide
directory
information

http://www.ns2ultimate.com 7
Installing Cygwin 1.7.1
3. When you hit this page, choose the required
(e.g., gcc4) and optional packages
Search the
package
name here

Expand
package Click here to
category by install all the
clicking ‘+’ optional
package

When you are done, hit ‘next’

http://www.ns2ultimate.com 8
Installing Cygwin 1.7.1
4. Open Cygwin
5. Download and extract ns2allinone2.35-RC3 package
5. Extract the package by calling

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

6. When done, call

»cd ns-allinone-2.35-RC3
»./install

http://www.ns2ultimate.com 9
Installing Cygwin 1.7.1
7. When the installation completes adds the followings
into the file “.bashrc” located in your home directory

NSHOME=~/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
http://www.ns2ultimate.com 10
Installing Cygwin 1.7.1
8. Test whether the install is alright by typing ns

An NS command prompt % should appear on the


screen, and you are done!

http://www.ns2ultimate.com 11
Acknowledgement
 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 12
For more information about NS
2

Please see this book from Springer


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

http://www.ns2ultimate.com 13

Das könnte Ihnen auch gefallen