0% found this document useful (0 votes)
66 views9 pages

Network Simulator 2 Installation Procedure

This document provides instructions for installing Network Simulator 2 (NS2) within a Windows environment using Cygwin. It describes downloading and installing Cygwin, which provides a Linux-like environment. It then explains downloading and extracting the NS2 files and running the installation. Finally, it details adding environment variables to the Cygwin configuration to complete the NS2 setup.

Uploaded by

manan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views9 pages

Network Simulator 2 Installation Procedure

This document provides instructions for installing Network Simulator 2 (NS2) within a Windows environment using Cygwin. It describes downloading and installing Cygwin, which provides a Linux-like environment. It then explains downloading and extracting the NS2 files and running the installation. Finally, it details adding environment variables to the Cygwin configuration to complete the NS2 setup.

Uploaded by

manan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

takeown /r /d y /f cygwin

icacls cygwin /t /grant Everyone:F


rmdir /s /q cygwin

Network Simulator 2 Installation Procedure


Network Simulator 2 (NS2) is a program designed to enable the simulation of networking
scenarios without having the actual hardware. It can be used to test many aspects of a
networking environment including the development of new protocols.
The program it self is notoriously difficult to install and runs on either windows (using
Cygwin or the native windows version) or Linux. For the purpose and functionality of
NS2, Cygwin is the preferred method of running NS2 within windows.

Cygwin Install
1. Go to http://www.cygwin.com/ and download the latest version (Latest Cygwin DLL
release version is 1.5.22-1)
2. Run setup.exe
3. Select Install from Internet then click next

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

4. Leave the all the default entries including the install directory as this makes things a
little easier when browsing the computer via XWindows.

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

5. Install local package (This is the default install directory where files are stored and
extracted for later use This is not essential as all programs can be retrieved from the
internet so this folder can be deleted to save space but is good to keep)

6. Select the connection method

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

7. Select a mirror (a UK mirror is best for the UK)

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

8. Select packages

Accept all the defaults but you need to add all 9 of these extra packages
Automake
Make
Patch
Perl
X86 libraries
Window Maker
All GCC components
Nano Text editor (Optional If you are not used to VI or other UNIX editors)
Xgraph (optional, but needed for test suites)
Document and content created by Edward Mitchell. This document cannot be
reproduced, copied or distributed without the explicit permission of the Author.

9. Click next and accept any dependencies and next again


Cygwin will now download

This may take a while depending on the speed of your Internet connection and the
speed of your system as this stage will extract and finalize the install.

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

NS2 Install
Firstly run up Cygwin and make sure that all is ok. Run XWindows and some application
that works within, try xclock.
Try running a windows manager, I selected Windows Maker during the install selection
as this I my preferred method.
Now go to http://www.isi.edu/nsnam/dist/ns-allinone-2.29.2.tar.gz and download the file
(Direct link to the file)
Copy this to C:\cygwin\home\%USERNAME%
Then go to Cygwin and go to the directory where you just downloaded the file and type
the command between the parenthesis including the space and hyphen at the end.
( gzip -d -c ns-allinone-2.29.2.tar.gz | tar xvf - )
Once this has finished (can take a long time depending on system speed)
cd in to the directory just created /home/%USERNAME%/ns-allinone-2.29
Now type the command (./install) dot slash install.
Let NS2 run the course, this can also take a while.
Document and content created by Edward Mitchell. This document cannot be
reproduced, copied or distributed without the explicit permission of the Author.

Environmental Variables
The next step is to add the Environmental Variables
To do this you have to go to your home directory and locate the file .bashrc
The .bashrc in this directory is your login script. You can change shells, set bash scripts
and add environmental variables.
I use the UNIX file editor VI if you are not familiar with VI I advises you to use the
NANO editor as this is an easier interface to use.
You can also use a windows editor if you browse to the path c:\cygwin\home\
%USERNAME% and edit the .bashrc files

The add these lines but be sure to change the directories to the same as your systems set
up and be sure to change any version numbers.
export NS_HOME=/home/%USERNAME%/ns-allinone-2.29
export PATH=$NS_HOME/tcl8.4.11/unix:$NS_HOME/tk8.4.11/unix:
$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.11/unix:
$NS_HOME/tk8.4.11/unix:\$NS_HOME/otcl-1.11:$NS_HOME/lib:
$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.11/library

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

Reload Cygwin, and then type which NS and which NAM. If you get
a path shown then you are ok if not you will have to check your
paths again.
Good luck!

Document and content created by Edward Mitchell. This document cannot be


reproduced, copied or distributed without the explicit permission of the Author.

You might also like