Monday, September 8, 2008

Installing NS2

After having FEDORA (or any Linux) installed successfully on your PC, you can now install NS2. You need to download the copy of NS2 first, which is available at the below site

It is better to download the compressed allinone file as it contains all the files neccessary to install NS2.
I am providing the link to download the recent version of ns-allinone package-ns-2.33 here:

The file size is around 52.8 MB.

After downloading, follow the below steps

1. Copy the file to the directory you wish to install NS2(I have copied it to my home directory)

2. Open the terminal (which can be found at Applications->System Tools->Terminal in FEDORA)

3. Go to the directory where you have copied the ns-allinone compressed file (using cd command)
I have copied the file in my home directory
Now we need to extract the ns-allinone archive which can be done by using the below command
tar xzvf ns-allinone-2.33.tar.gz
Note:For more information on using tar command type man tar on your terminal

4. Go to the extracted directory
cd ns-allinone-2.33

5. Now type the below command
After you type Return (Enter) key the installation starts and will take some time

6. After installation you need to set-up the neccessary environment variables which can be done by using the export command or by editing the .bashrc file(which is the better option as these values remain permanently)

7. To set the environment variables go to your home directory (my home directory is /home/chandra)
cd /home/chandra
and edit the .bashrc file
gedit .bashrc
Now in the text window you need to type the following
HOME= $ HOME:/home/chandra/
PATH = $ PATH: $ HOME/ns-allinone-2.33/bin:
$ HOME/ns-allinone-2.33/tcl8.4.18/unix:
$ HOME/ns-allinone-2.33/tk8.4.18/unix
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:$ HOME/ns-allinone-2.33/otcl-1.13:
$ HOME/ns-allinone-2.33/lib
TCL_LIBRARY=$ TCL_LIBRARY:$ HOME/ns-allinone-2.33/tcl8.4.18/library:
$ HOME/ns-allinone-2.33/nam-1.13
export PATH
In my system I have copied the file in my home directory(/home/chandra), you need to specify your home directory path in the HOME variable.

8. Save the file

9. Go to the ns-2.31 directory
cd ns-2.31
and type the below command
after you type Return(Enter) key the validation takes place. It will consume some time.

10. In order to verify whether NS2 is successfully installed or not type
after typing ns if you get % prompt then ns is successfully installed.

If you are trying to install NS2 under Windows, visit the below link

Hope it helped you...........
Good Luck :)

Saturday, September 6, 2008

Uninstalling FEDORA

I think I messed up with FEDORA. During the first boot of FEDORA there was a power failure. When the power came back I tried to boot in to FEDORA and arrrrr....gggggg.......hhhhhh it showed me some errors which told me that the kernel is corrupted. The worse thing is I could not boot to WindowsXP either because of the GRUB-Linux Boot Loader.

I decided it would be better to uninstall FEDORA and install it on another day. I do not want to format my hard drive, so was trying to figure out a simple way to uninstall FEDORA which does not involve formatting my hard drive.

After searching in Google for a few hours....... I figured out two options
  • The first one was using SuperGrub software which is free. You could download a copy of this software form the link :

as i already told you I was searching for a simple way so I did not used this software as it appeared to me it was rather complex (as it requires you to burn a bootable CD of this software).

  • and the second option, which i followed, involves creating a new MBR(Master Boot Record) for windows, which is quite easier provided you have a bootable Windows XP CD.
To create a new MBR follow the below steps:

1. Boot the system using WindowsXP bootable CD
2. Then enter into Recovery console mode (by pressing R in Welcome to Setup screen)
3. Now you will be displayed with a screen which shows Windows installation to log into
4. Select the correct option(ie., the option which shows where correct windows is installed)
Note:It will be usually the option which shows C:\
5. Type the below command
and press Enter.
6. Now it will ask you whether you want to create a new MBR, press y and press Enter
7. You get a message "The new master boot has been successfully written"
8. Type exit and press Enter.
9. The system will Reboot, remove the CD.
10. Now you will be booted to Windows XP

Now after booting to Windows XP you need to delete the partitions created by Linux to completely remove the Linux from your system for this follow the below steps

1. Right-click on My Computer icon on your Desktop
2. Select Manage option
3. Now select Disk Management option
4. Select the drives which have File System as Unknown (these are EXT file system and cannot be recognized by Windows)
5. Right click on those drives and select Delete Logical Drive option
6. Now the selected drive is shown as un-allocated
7. Now in order to make Windows recognize thes drives, right-click on the drive and select "Create new Logical Drive" and follow the Windows instructions.

Pre-Requisites-Installing FEDORA

he Network Simulator-2 is coded to work on Linux. If you want to run the ns2 softaware on Windows (which is not recommended) you need to have Cygwin installed on your Windows for further information refer the below links:

Note:The Cygwin version of NS2 has a lot of bugs and there is a very little support available for it. It is better to have NS2 installed on Linux.

There are many flavours of Linux avaialble. I am using FEDORA-an open source version of Linux from Red Hat. You can download the new version of FEDORA form the below link

Installing FEDORA is very easy. You can also dual boot FEDORA with your existing Window s Operating Systems.

If you are planning to remove your Windows OS and install FEDORA then follow the step by step instructions in the below link

If you do not want to remove the Windows OS and planning to Dual Boot WinXP and FEDORA (as I have done) you need to follow the below link

If you are having a low capacity hard-disk(<=20 GB) then it is better to use VMware to dual boot Windows and FEDORA. There is a good video tutorial which illustrates how to install VMware o Windows, I have provided a link to that tutorial below

After installing VMware you can install the FEDORA in normal way.

After installing FEDORA we move to the next step-installing the Network Simulator-2 package.

Friday, September 5, 2008


This is just another blog on Network Simulator-2 like many other blogs.
"NS2 or the Network Simulator-2"-A Discrete Event Simulator is used to simulate the various Network Protocols which helps the graduates in Understanding the concepts of Network protocols and the researchers to publish Research papers on their new proposed protocols.In my next post I will cover pre-requisites and other preliminary stuff. Till then Bye.