Wednesday, February 8, 2012

Installing NS2.35 on Fedora 15 and 16

NS is a discrete event simulator used primarily for networking research. It provides support for simulation of TCP, routing, and multicast protocols over wired and wireless networks.

ns can be installed on computers that run on Windows and Unix. But most users out there to use the simulation software on a Unix system.

For this short tutorial, I am going to discuss briefly how to install ns2.35 (the latest version of the software at the time of this writing) on Fedora 15 and 16. I am also a beginner at using ns and I have to admit that I also had my shares of frustrations and confusions during the whole process right from when I first started using Fedora (it was my first time to use a Linux machine).

So if you are advanced user, maybe this tutorial is going to be very basic since I prepared it in a way that even beginners (those who have just started using Linux) could understand.

Almost everything in this installation process is done using the terminal. The terminal is Linux's version of the Command Prompt in Windows operating systems. It provides us with a way to type commands to the computer much like the way computer users did about 20 years ago. That may sound strange but it is actually easy to use and you can do more with your PC once you know the basic operations. Here's a good tutorial for you to read just so you can prepare for the next few steps.

Alright! Now, I assume that you already know some basic terminal commands, let's proceed to installing your ns software.

1. Open terminal and become root by typing:
 
    su -
 
2.You will then be prompted to type your root password.
3.Go to the directory where you want to install your ns software by using a series of "dir" and "cd" commands.

    dir
    cd

The command "dir" outputs a list of all the files and directories within the current directory where you are in. The "cd" command when proceeded with the name of a directory(folder) opens that directory.
4.First we need to install all the prerequisites of ns starting with our C++ compiler:

    yum install gcc-c++
    yum install tcl-devel
    yum install libX11-devel (that's one-one)
    yum install libXt-devel

5. Next step is for you to download the all-in-one package of ns2.35 here. Go to the directory where you downloaded the tar file and transfer it to where you want it installed.
6.Going back to the terminal, navigate to the directory where you saved the ns-allinone-2.35.tar file.
7. Execute the following commands:

    tar -zxvf ns-allinone-2.35.tar

8. Finally, navigate into the ns-allinone-2.35 directory and type the following command in the terminal:

    ./install

Tuesday, February 7, 2012

fatal error: pcap.h - Error in Fedora terminal

I am using ns2 for my simulations. Whenever I changed something in the C++ codes of the package, I had to reconfigure everything again. The steps were to:
    make clean
    configure
    make clean
    make depend
    make


But every time I execute the command "make depend", I get this nasty bit of error:
fatal error: pcap.h: No such file or directory compilation terminated.
So one of the solutions I found in the internet was to install libpcap-dev.
"...Usually, the library packages only provide the library files that programs using them need to run. They don't provide the header files that developers use to write programs using the libraries and the "dev" or "devel" packages containing the headers."


So I installed libpcap-devel following this short tutorial.

In the terminal (Fedora), enter the following commands:

$ yum search pcap-devel
libpcap-devel.i686 : Libraries and header files for the libpcap library
Note that you must be the root/administrator to install the package. To install this package in Red Hat/Fedora Linux.
$ yum install libpcap-devel.i686
You can check the details of this package pcap-devel
$ yum info libpcap-devel.i686


And that solves the problem. When I went back to my ns2 installation and executed "make depend", the command didn't encounter any errors.