You are on page 1of 21

NS-2 Installation

Over Microsoft Widows...Using Cygwin

Prof. Dr. Mahamod Ismail PhD Candidate Ghassan A. Abed

FACULTY OF ENGINEERING AND BUILT ENVIRONMENT UNIVERSITI KEBANGSAAN MALAYSIA Course Code: KKKT6274 Course Name: Modeling and Simulation of Communication and Computer Network 2012

1.Preface This paper, illustrates the experimental procedures to installing NS-2 network simulator over MS-Windows operating system. This installation has the same steps and same procedures for the following Microsoft Windows generations:
Windows 2000, Windows XP Windows Server 2003 Windows Vista Windows Server 2008 Windows 7

All steps and procedures applied for all windows generations and the differences will explain in each step later.

2.Computer Requirements
Free disk space of 5GB required. Minimum 512MB RAM suggested. Windows installed in Drive partition C. The name of computer and username should not have space or other abnormal symbols.

3.Downloading
For each download, open the download page and click Download Now then download link will appear after 90 sec.

Go to this link to download Cygwin:


http://www.4shared.com/file/r_dQEzUn/cygwin.html

The size of Cygwin program about 83 MB.

If you interested to installing NS-2.32, you can download it from this link:
http://www.4shared.com/file/UI7ztz6k/ns-allinone-232tar.html http://www.4shared.com/file/UI7ztz6k/ns-allinone-

The size of ns-allinone-2.32.tar is about 51 MB. If you interested to installing NS-2.34 (its the last Version of Ns-2, released in March 2009), you can download it from this link:
http://www.4shared.com/file/3rbCd862/ns-allinonehttp://www.4shared.com/file/3rbCd862/ns-allinone-234tar.html

The size of ns-allinone-2.34.tar is about 56 MB. Lastly, you need to test your installation, then you can use the script in Example.rar in the link:
http://www.4shared.com/file/KmAk8wfL/Example.html

This folder contain tcl script as an example to test the full NS-2 ability after installing.

Note: For beginners, its enough to start by


installing NS-2.32, and later when you need to add other patches you can develop your version and install NS-2.34.

4.Installation
Open new folder on your computer Desktop (with any name , like NS-2) and add the downloaded softwares: 1. Cygwin. 2. ns-allinone-2.32.tar or ns-allinone.2.34.ta Extract Cygwin inside the folder NS-2.

Click on Cygwin icon and start installation.

Choose Install from Local Directory and Next.

Choose as shown in picture below and Next.

Click on View to get Not Installed then change each Skip to get number.

You must be sure to change each Skip to number, and then press Next.

Next to continue

Wait to complete Cygwin setup.

After Cygwin installation finished, you will see two choices, keep it signed and press Finish.

Click OK to finish Cygwin setup.

Go to Drive C:

Enter to Drive C and open Cygwin folder.

Click on Cygwin icon to run Cygwin for first time

You will see Cygwin panel screen with extension of username and computer name.

Go to Ns-2 folder and Copy ns-allinone-2.32.tar (or ns-allinone-2.34.tar).

10

Paste the copied file into your username folder inside home folder, inside Cygwin folder. In this case the username is ghassan.

After $ sign, write the command: tar xvf ns-allinone-2.32.tar.gz or tar xvf ns-allinone-2.34.tar.gz (for NS-2.34) and then Enter

11

Wait for extraction.

Write the command: cd ns-allinone-2.32 Or: cd ns-allinone-2.34

12

Write the command: ./install Then press Enter

Now you need to wait for 30-40 min to complete NS2 installation.

13

Change the directory by writing: cd ns-2.32

After you see the root changed, write the command: ./validate-full (if use NS-2.32) Or ./validate (if use NS-2.34)

14

Now, Ns-2 validation. This step need for 30-40 min to finish.

Go to your computer Desktop and click on Cygwin icon.

15

Write the command: startxwin.bat to start NS-2 platform.

In this step, you will see NS-2 panel for first time.

16

Change the root by write: cd ns-allinone-2.32/ns-2.32/

and then press Enter

Now, you are in the main folder ns-2.32

17

Search using Windows search in Cygwin folder to find: nam.exe and xgraph.exe Then, Copy these two files and Paste it in ns-2.32 folder. Lastly, you must have 3 main files as shown below:

Extract Example file which downloaded and copy the 3 files: out.nam , test.tcl , and trace.tr

18

Paste the copied 3 files in ns-2.32 folder.

To test if the installation performed successfully, you must try to run simple test script and see how NS-2 draw traces and networks animation. Write the command: ns test.tcl then press Enter

19

If your installation success, you must see these two panels, one for sample trace plot and the second represents network animation of simple topology with 8 nodes. You can Run the animator to see how NS-2 represents the packets transferring between nodes and so you can see some drop packets.

If you can see these two panels, that mean you have fully successful copy of NS-2 on your computer. This is the first step for the students, users, and developers to start with NS-2 network simulator and I hope it will be useful for them.

For questions and suggestions, please contact me within my Email: ghass@ieee.org

20