Tuesday, August 16, 2011

// // Leave a Comment

Fedora 12 Installation

This post will show you the installation of Fedora along with Windows 7.

This Post is mainly for

  • Beginners of Linux
  • those who entered the college just now
  • who don’t have prior working knowledge on Linux

Here we go….

I have taken DVD Version of Fedora 12 (32 Bit OS)

Step 1: Create a Partition on windows to give space for Fedora, Just 20GB space is enough.. You can store all your files under windows and use it in linux whenever you need. So no extra space needed for Linux. (see the image below)


Step 2:  Insert the DVD and boot from the DVD and select the first option (as shown below) “Install or Upgrade an existing System”


Once selected, the system asks you to check the correctness of the media (DVD ROM). if you have doubt with your DVD, please click OK else SKIP it. (see below)


Once done, start proceeding with the installation as given in the following images

Step 4: Select the language (as given below, If you have doubt, leave with the default and click next)


Step 5: Select the Keyboard layout (If you have doubt, leave with the default and click next)


Step 6: Give a name for your Linux OS.


Step 7: Select your locale, I have Selected Asia/Kolkata which is GMT +5 30


Step 8: Select a root (Super User) password (minimum 6 chars)


Step 9:  Now select “Use Free Space” or “Replace Existing Linux system” (See Step 1, we have created a partition in Windows for 20GB which will be used for Linux)

Step 10: Since it is dual OS, then select which OS you like to be the default boot, I made windows 7 as Default OS.


Step 11: Now click “Customize Now” which shows the screen for additional softwares to be installed along with the OS, If you don’t select “customize now”, then only default set of packages will be installed, Later you can install the other package. If you are a developer, then select “Customise Now” and install all the packages that you need. (Please the next couple of images)


Put a “Tick” wherever possible (if you have doubt, select all the software and install the OS).  Once the Components in the left side is selected, in the right hand side a set of softwares will be listed and put a tick to install that software.


Step 12: Depending on the size of RAM and other parameters, the installation will vary from 15 minutes to 45 minutes.



Once done, you will get the following screen and hence Fedora is installed successfully, reboot and take out the DVD and that’s it..


Read More

Linux for NS2 (Network Simulator 2)

At many places, I happen to see researchers and students wanted to use Windows for NS2 rather than Linux. The reason may be,
  • Linux is tough
  • It occupies more space and more memory in my Computer
  • Linux uses lot of commands and i am not aware of it
  • Tough to handle dual boot OS (windows and Linux)
  • always wanted to be in the cakewalk. (never try a new thing)
  • etc
But here are some basic tips for using NS2 under a Linux Machine.
  • It is enough to know some basic Linux commands to work with NS2 (hardly not more than 20 commands)
  • One should have a basic knowledge of how tree structure in Linux/Unix look like
  • Finally, where to set the PATH information in Linux
With all the above three, one can confidentally work on Linux. As for as windows is concerned, upto NS2.27 version is tested under windows and recent versions there is no hope (however it will work fine, but "Use at your Own Risk")
Please see this post to install Fedora 12 in your Computer
Now we will see some basic Linux commands that are needed for NS2.
  1. ls => listing the file contents
  2. ls -l => listing the file in long format, it tells you about the ownership and permissions
  3. chmod => Changing the mode of the file (syntax is chmod 755 <filename>
  4. echo => it echo the value to the screen 
    1. Example: echo name 
    2. echo $SHELL (it will print the name of the shell)
    3. echo $USER (it will print the name of the user)
    4. echo $PATH (it display the values contained in the PATH variable)
    5. echo $HOME (it displays the home folder of the user) (Now you can understood that the variable names are denoted using a $ symbol)
  5. pwd => it is just present working directory
  6. make => (it executes the instructions given in the Makefile which is available under that directory)
  7. gcc filename.cxx => A command to run the gcc compiler (This is not necessarily needed for NS2, but as a developer, you should know)
  8. ./install  => (See a dot in the beginning, it is just executing the install file which is available under a folder, any executable can be executed with the help of this ./)
  9. passwd => changing the password of the current user
  10. cd => change the directory
  11. mkdir => make a directory
  12. gedit => it is similar like a notepad editor in windows(syntax is gedit filename)
  13. vi => it is vi editor
Path setting
The path can be set in a file which is available for each user of the Linux OS.  For example, a user called  "pradeep" will have the home folder as /home/pradeep and another user "kumar" has home folder as /home/kumar
Each user "pradeep" and "kumar" will have a file called .bash_profile (in case of redhat and fedora) and .bashrc (Ubuntu, etc) in their home folder. This file is a hidden file which can be opened using a vi or gedit editor
The command being
vi /home/pradeep/.bash_profile
vi /home/pradeep/.bashrc

gedit /home/pradeep/.bash_profile
gedit /home/pradeep/.bashrc
Similarly the same for user "kumar" (if you set the path for "pradeep" and running under "kumar", it will not work, for that to work, there is a separate customisation is available), for beginners, these steps are enough.

Read More

Monday, August 15, 2011

// // 1 comment

Tracegraph installation in Windows 7

How to install tracegraph in windows . here are the steps

Step 1: Unzip the tracegraph202.tar file to C: or D:  (in my case I extracted to D:/tracegraph202)

Step 2: copy the path (DLL files) to the environmental variables (in my case the path is D:\tracegraph202\bin\win32)

Step 3: that’s it run the trgraph.exe file which is available under the tracegraph202/ folder.

Read More

Saturday, August 13, 2011


NS2.34 installation in Ubuntu 11.04

Already this blog posts various titles on installing NS2 in Linux distros. Here is the step for installing in Ubuntu 11.04.

1. Version taken is NS2.34

2. Since ubuntu 11.04 uses GCC-4.5.2, there should be some minor tweeks.

3. Two files should be edited ~ns-2.34/tools/ranvar.cc and ~ns-2.34/mobile/nakagami.cc  as given in the following post


4. Install the following things in Ubuntu

sudo apt-get install build-essential autoconf automake libxmu-dev

sudo apt-get install gcc-4.4

5. open the file ~ns-2.34/otcl-1.13/configure and change the line number 6304 to SHLIB_LD="gcc -shared" instead of SHLIB_LD="ld -shared"

6. open the file ~ns-2.34/otcl-1.13/Makefile.in and change the line CC    @CC@ to CC    gcc-4.4

7. Set the path in /home/<name>/ .bashrc as in http://pradeepkumar.org/2009/11/installing-ns2-under-ubuntu-910.html

8. After setting the path, sometimes overflow error may come when running ns and nam, so open the file ~ns-2.34/tcl8.X.x/unix/Makefile.in and in line number 270 change @CC@ to @CC@ –V 4.4

Thats it!!! NS2 Installed.

(Thanks to: http://erl1.wordpress.com/2011/05/12/installing-ns-2-34-on-ubuntu-11-04/)

Read More
// // 1 comment

Installing Omnet++ in Windows 7

Installing Omnet++ in windows is a very easy task

Step 1:

Click the following link and download Omnet++ along with MinGW (Minimalist GNU for Windows – this gives the look and feel of Linux inside windows, it is similar like cygwin)


Step 2:

Unzip the file to C:/

(Now your folder looks like this C:\omnetpp-4.1)

Step 3:

Open Command prompt and go to C:\omnetpp-4.1 (The command is cd \ and cd omnetpp-4.1)

Now type the command mingwenv.cmd and press enter (Please type the commands as given in the following pic)


Step 4 :

A new window will be opening which looks like a Linux Shell (as shown in the following pic)


Step 5 :

Type the command configure (this command will check all the modules and set the path)

Type the command make (This will run for at least 10 minutes, but may vary machine to machine)

Once everything is done, you will get a successful message and type omnetpp to open the IDE

(Please Install JDK before all these steps, as Omnet++ IDE is based on Eclipse which needs JDK to be installed)

Read More
// // Leave a Comment

Manual tracing–tracefile

Assume you created a tcl file for a wireless simulation and it generates a trace file (usually .tr as extension). If any tracing softwares are not available, how to interpret manually, here is the step

ACTION: [s|r|D]: s -- sent, r -- received, D – dropped

WHEN: the time when the action happened

WHERE: the node where the action happened

LAYER: AGT -- application,

RTR -- routing, LL -- link layer (ARP is done here) IFQ -- outgoing packet queue (between link and mac layer) MAC -- mac, PHY – physical


SEQNO: the sequence number of the packet

TYPE: the packet type cbr -- CBR data stream packet DSR -- DSR routing packet (control packet generated by routing) RTS -- RTS packet generated by MAC 802.11 ARP -- link layer ARP packet

SIZE: the size of packet at current layer, when packet goes down, size increases, goes up size decreases[a b c d]: a -- the packet duration in mac layer header b -- the mac address of destination c -- the mac address of source d -- the mac type of the packet body


[......]: [ source node ip : port_number destination node ip (-1 means broadcast) : port_number ip header ttl ip of next hop (0 means node 0 or broadcast) ]

So we can interpret the below trace 

s 0.0297823400 _1_ RTR --- 2012 cbr 32 [0 0 0 0] ------- [1:0 0:0 32 0]

as Application 0 (port number) on node 1 sent a CBR packet whose ID is 2012 and size is 32 bytes, at time 0.029 second, to application 0 on node 0 with TTL is 32 hops. The next hop is not decided yet.

And we can also interpret the below trace

r 0.010176954 _9_ RTR  --- 1 gpsr 29 [0 ffffffff 8 800] ------- [8:255 -1:255 32 0]

in the same way, as The routing agent on node 9 received a GPSR broadcast (mac address 0xff, and ip address is -1, either of them means broadcast) routing packet whose ID is 1 and size is 19 bytes, at time 0.010176954 second, from node 8 (both mac and ip addresses are 8), port 255 (routing agent).

Read More

xgraph Error (dialog.c)

If you are installing ns2 allinone package in fedora or ubuntu or any other linux, all the packages will be installed successfully. Occasionally the recent distributions of Linux flavors failed to install xgraph.


The possible error you may get is [dialog.o] error,


  1. Open the file dialog.c which is available under the folder xgraph-12.1/ (this is in my case)
  2. Find out the function getline() (will be at two places), usually line number 780 and 891 or 889, replace getline() function to newgetline() (at the both the places)
  3. save the file and at the prompt give ./configure
  4. give the command make
  5. If there are no errors, xgraph will work now..
Read More
// // Leave a Comment

Installing Omnet++ in Ubuntu 9.04

  1. Unzip the omnetpp-xxx.zip file in to any folder possibly (/home/pradeepkumar/)
  2. Open the shell prompt and then go to the corresponding folder by issuing the command cd /home/pradeepkumar/omnetpp-4.0
  3. Run the command (./configure)
  4. If you get any errors, please download the concerned files and again go to step 3.
  5. You may get errors like this and execute the command (sudo apt-get install bison flex byacc swig build-essential tcl8.5 tk8.5 tcl8.5-dev tk8.5-dev) after installing all the packages, go to step 3
  6. If path information is being asked, then set the path in the /home/pradeepkumar/.bashrc (export PATH=$PATH:/home/pradeepkumar/omnetpp-4.0/bin)
  7. Add the following line to your .profile or .bash_profile (provided you use bash): export TCL_LIBRARY=/usr/share/tcltk/tcl8.5
  8. After that logout and login and then go to step 2 and then 3.
  9. Execute make command and thats it!!!!
  10. After installing this, for running the IDE, you need to install java run time environment.
Read More


Xgraph is an X-Windows application that includes:

  • interactive plotting and graphing
  • animation and deritives
  • portability and bug fixes

So to plot the characteristics of NS2 parameters like throughput, end to end delay, packets information, etc can be plotted using xgraph
The successful installation of NS2 will install xgraph also along with it.
To run xgraph from a shell prompt: # xgraph filename.xg

inside TCL scripts, xgraph can be written like this
exec xgraph filename.xg -geometry 500×500
if there are more xgraph files then,
exec xgraph filename1.xg -geometry 500×500 &
exec xgraph filename2.xg -geometry 500×500 &
The ambersand is mandatory to popup all the graph windows, if & (ambersand) is not there, then only the last xgraph window will be popped up.

Sample xgraph file and its contents
/*** The xgraph file shows the information about the overhead with size of the network,
Overhead is compared with four routing protocols like AODV, DSR, DSDV and NEAODV (my own algorithm)
the values are taken from various trace files.
To execute the following xgraph file, copy the following contents and save it as “example.xg” possibly (other formats also supported) and in the shell prompt # xgraph example.xg
TitleText: Overhead (Kbits/s) Vs Network Size
YUnitText: OverHead
XUnitText: Network Size (nodes)
200 100
400 350
600 800
800 1200

200 500
400 1600
600 2300
800 3700

200 100
400 320
600 400
800 600

200 500
400 3700
600 6400
800 11600
Output window will be looking like this

Read More

Recompiling NS2 (Network Simulator 2)


I have installed my ns-allinone-2.34 under /home/pradeep/ns-allinone-2.34
Path is been set in the .bash_profile (which are located at /home/pradeep/) in fedora and .bashrc in ubuntu

There are two ways in which the NS2 can be recompiled

1. You modify the existing algorithm (use the same header and the C++ source files)

2. Adding new files (adding new header and C++ source files)

In first method,

Step 1: open the shell prompt and go to the ns-allinone-2.34/ns-2.34/ folder(there are 3 makefiles, Makefile.vc, Makefile, Makefile.in, for adding any new file should be done at the Makefile.in file)

Step 2: Once the existing algorithm is changed (after modifying the existing header and the C++ source file), go to step 1

Step 3: execute the command, make (the make command executes the instructions given in the Makefile.in) and press enter, If you have no errors in your modified code, then the compilation will be success, else you may get errors, which needs to be corrected

Step 4: Test your tcl script for the new algorithm

In the second Method,

Step 1: open the shell prompt and go to the /home/pradeep/ns-allinone-2.34/ns-2.34/ folder(there are 3 makefiles namely Makefile.vc, Makefile, Makefile.in, for adding any new file should be done at the Makefile.in file)

Step 2: You may create new header and C++ source files for your new proposed algorithm and hence you need to tell that information to the Makefile.in (which is available in /home/pradeep/ns-allinone-2.34/ns-2.34/). For example, assume i created two files tcpnew.h and tcpnew.cc

Step 3: Put all your files inside a folder (for Example create a new folder tcpnew) and put the tcpnew folder under the folder /home/pradeep/ns-allinone-2.34/ns-2.34/

Step 4: Now open the Makefile.in using any editor (usually vi or gedit) and add the folder information to the OBJ_CC variable)

Step 5: anywhere inside the OBJ_CC variable, put the tcpnew folder information like this  tcpnew/tcpnew.o  \

Step 6: after editing the file entry, go to step 1 and execute the command make and press enter. If you have no errors in your modified code, then the compilation will be success, else you may get errors, which needs to be corrected.

Step 7: Test your tcl script for the new Algorithm.

Read More
// // Leave a Comment

NS2.34 installation in Fedora 14

To install Network Simulator Version 2.34 in Fedora 14 has the following limitations.

1. Fedora 14 comes with GCC version 3.5 which has major changes like it accept X() rather than X::X(), So ns also has to modify accordingly.

2. You may get an error for GammaRandomVariable, so that has to be corrected in the following two files

~ns-allinone-2.34/ns-2.34/mobile/nakagami.cc  and



(Above pic: The file nakagami.cc has to be opened and there will a change in two line numbers 183 and 185 as given below)


(The file ranvar.cc has to be opened and change in line number 219 as given below)



Once the above steps done,

Go to terminal and install NS2 (http://pradeepkumar.org/2008/11/installation-instructions-for-network.html)

and refer the video for installing NS2. http://pradeepkumar.org/2011/02/installation-of-network-simulator-2-ns2video.html

Read More
// // Leave a Comment

Installing NS2 in Ubuntu 8.04 8.10 and 9.04

Step 1: Download NS2 from the following Website, I tried version ns-allinone-2.33.tar.gz.

Step 2: Put the file under /home/pradeep/ (my user login is pradeep, you may try with your username)

Step 3: go the folder in the shell prompt by issuing the following command cd /home/pradeep/

Step 4: Since installation of NS2 simulator needs some autoconfiguration files which will need to be installed. To download those packages, just execute the following commands $ sudo apt-get install build-essential autoconf automake libxmu-dev

it will take some time to download and install.

Step 5: Now execute the following steps so that NS2 will be installed

    tar zxvf ns-allinone-2.33.tar.gz 
    cd ns-allinone-2.33

After the above three steps, NS2 will give the path information which needs to be set in the PATH variable

Step 6: Open the file .bashrc which is available under the folder /home/pradeep/ (if you try to install in root user /root/.bashrc). Use the following command to open the .bashrc file $ gedit /home/pradeep/.bashrc

Step 7: edit the above file and set the following paths over there

export PATH=$PATH:/home/pradeep/ns-allinone-2.33/bin:/home/pradeep/ns-allinone-2.33/tcl8.4.18/unix:/home/pradeep/ns-allinone-2.33/tk8.4.18/unix

export LD_LIBRARY_PATH= /home/pradeep/ns-allinone-2.33/otcl-1.13, /home/pradeep/ns-allinone-2.33/lib

Step 8: Thats it!!! save the file, logout and login with the username.

Step 9: open the shell prompt and type $ ns (you will get a % indicating that the installation is working correctly) $ nam ( a window will be opened showing the network animator)

Read More
// // Leave a Comment

Tracegraph installation in Fedora 12

To Install Tracegraph in Fedora Linux (I used Fedora 12)

  1. Step download the Tracegraph software from this link
  2. You need to download two files, mglinstaller.gz and tracegraph202.tar.gz
  3. Copy the files under /home/pradeep/ (in my case it is /home/pradeep/)
  4. Untar the tracegraph202.tar.gz using the command tar zxvf tracegraph202.tar.gz
  5. A Folder tracegraph202/ will be created and go to the folder using the command cd tracegraph202 or cd /home/pradeep/tracegraph202
  6. copy the mglinstaller.gz file inside the tracegraph202/ folder
  7. now execute the command to unzip the mglinstaller.gz using the following command gzip -d mglinstaller.gz
  8. Run the mglinstaller by executing the command ./mglinstaller (see the . in the beginning)
  9. The above command will create a folder within the bin folder and set the following lines to the LD_LIBRARY_PATH variable export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/pradeep/tracegraph202/bin/glnx86
  10. The above path will be set to the LD_LIBRARY_PATH Variable in the following file .bashrc which will be available at /home/pradeep (each username will have such a file in the corresponding folder, if you are using more number of users, each user should be set with the LD_LIBRARY_PATH, root will be having the .bash_profile at /root/.bashrc).
  11. To open this file type either vi /home/pradeep/.bashrc or gedit /home/pradeep/.bashrc and include the line of code given in step 10.
  12. Save the file, close and logout and login and go to the tracegraph202 folder and run ./trgraph (thats it!!!!)
  13. After step 13, some Linux versions will get an error called libXp.so.6 error, to overcome that give this command by connecting your machine to internet yum install libXp.so.6 or else download the package XFree86-libs-4.1.0-50.i386.rpm from the website http://rpm2html.osmirror.nl/redhat-archive/updates/7.1/en/os/i386/XFree86-libs-4.1.0-50.i386.html   and then install the package by giving rpm -ivh  XFree86-libs-4.1.0-50.i386.rpm and thats it.
  14. (NB: My username in my System is /home/pradeep/, so all the above steps will be working for me, if your system contains other usernames, then please updated that and add to the paths) all the Best!!!!!!!!!
    (For better results, see the Video given below)

Tracegraph Installation in Fedora 12

Read More
// // Leave a Comment

Installation of NS2 in Fedora 12

The ns2 version taken here is 2.34, if you downloaded any other version, please modify your version during installation

1)Uncompress the ns2

tar zxvf ns-allinone-2.34.tar.gz
gzip -d ns-allinone-2.34.tar.gz
tar xvf ns-allinone-2.34.tar

2) cd /opt/ns-allinone-2.34 (since /opt is the folder which is unused, so i have selected that folder to install, however you can install that in any folder)

3) ./install (execute the command)

4) If the installation fails in the middle, then try to install the linux packages that are necessary to run NS2. (In any linux (ubuntu or fedora or redhat or suse), install the TCL/TK, Perl packages during the installation of linux…)

5) Once the installation succeeded, then the path information will be provided by the NS2

6) Set the path in the /root/.bash_profile
(vi /root/.bash_profile)

If you are a user home/pradeep/.bash_profile (for example, if your the username is pradeep, then execute this command vi /home/pradeep/.bash_profile)
7) set the PATH and the LD_LIBRARY_PATH as per the output screen by NS2. (See the Video given below)

8. logout and login.

9) go to the terminal and try ns  (you will get a % symbol indicating that the installation is Successful)

10) for running the examples comes along with the distribution of NS2
cd /opt/ns-allinone-2.34/ns-2.34/tcl/ex

11. This is how you will see once the ns2 installation is success, from this information, you can put the PATH and LD_LIBRARY_PATH variable..

NS2 installation in Fedora 12
Read More