How to install 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.

xgraph utility in Network Simulator 2

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)
“NEAODV”
200 100
400 350
600 800
800 1200

“AODV”
200 500
400 1600
600 2300
800 3700

“DSR”
200 100
400 320
600 400
800 600

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

Installing NS2 under Ubuntu 9.10

  1. Download NS2 from the following Website, I tried version ns-allinone-2.34.tar.gz.
  2. Put the file under /home/pradeep/ (my user login is pradeep, you may try with your username)
  3. go the folder in the shell prompt by issuing the following command cd /home/pradeep/
  4. Since installation of NS2 simulator needs some autoconfigurationfiles which will need to be installed. To download those packages, justexecute the following commands $ sudo apt-get install build-essentialautoconf automake libxmu-dev
  5. it will take some time to download and install.
  6. Now execute the following steps so that NS2 will be installed $ tarzxvf ns-allinone-2.34.tar.gz $ cd ns-allinone-2.34 $ ./install
  7. You may get an error like libotcl.o error, to correct that execute, sudo apt-get install g++-4.3, once done, open the file otcl-1.13/Makefile.in, in line number 7 change 
  8. CC= @CC@ to CC= gcc-4.3, then again goto step 6
  9. After the above steps, NS2 will give the path information which needs to be set in the PATH variable
  10. Open the file .bashrc which is available under the folder/home/pradeep/ (if you try to install in root user /root/.bashrc). Usethe following command to open the .bashrc file $ gedit/home/pradeep/.bashrc
  11. edit the above file and set the following paths over there exportPATH=$PATH:/home/pradeep/ns-allinone-2.34/bin:/home/pradeep/ns-allinone-2.34/tcl8.4.18/unix:/home/pradeep/ns-allinone-2.34/tk8.4.18/unixexport LD_LIBRARY_PATH= /home/pradeep/ns-allinone-2.34/otcl-1.13,/home/pradeep/ns-allinone-2.34/lib
  12. Thats it!!! save the file, logout and login with the username.
  13. open the shell prompt and type $ ns (you will get a % indicatingthat the installation is working correctly) $ nam ( a window will beopened showing the network animator)

How to Recompile Network Simulator 2

Assumptions:

  • I have installed my ns-allinone-2.33 under /home/pradeep/ns-allinone-2.33
  • 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.33/ns-2.33/ 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 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.33/ns-2.33/ 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.33/ns-2.33/). 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.33/ns-2.33/

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 new 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.

Installing NS2 under Ubuntu 8.04.1, 8.10, 9.04

  1. Download NS2 from the following Website, I tried version ns-allinone-2.33.tar.gz.
  2. Put the file under /home/pradeep/ (my user login is pradeep, you may try with your username)
  3. go the folder in the shell prompt by issuing the following command cd /home/pradeep/
  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
  5. it will take some time to download and install.
  6. Now execute the following steps so that NS2 will be installed $ tar zxvf ns-allinone-2.33.tar.gz $ cd ns-allinone-2.33 $ ./install
  7. After the above three steps, NS2 will give the path information which needs to be set in the PATH variable
  8. 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
  9. 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
  10. Thats it!!! save the file, logout and login with the username.
  11. 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)
  12. For running examples in TCL, click here

How to install Tracegraph in Linux (Fedora 9)

To Install Tracegraph in Fedora Linux (I used Fedora Core 9)

  1. Step download the Tracegraph software from http://www.tracegraph.com
  2. Select Linux Version and 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 in the above said folder using the following command cp /home/pradeep/mglinstaller.gz /home/pradeep/tracegraph202
  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
  9. the above command will create a folder within the bin folder and set the following lines to the LD_LIBRARY_PATH variable
  10. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/pradeep/tracegraph202/bin/glnx86
  11. 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).
  12. 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.
  13. Save the file, close and logout and login and go to the tracegraph202 folder and run ./trgraph (thats it!!!!)
  14. 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.

(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 More Doubts, ping me to tspembedded@gmail.com or just give me a comment

How to Correct the NS / NAM Problem in Fedora 10

Step 1: download the NS allinone Package from the following link. I Used (ns-allinone2.33).
Step 2: extract it in a folder (Eg: I used /opt/), but you need to be a root to extract in that folder (better extract it under /home/#username#)

NAM wont work because of the compatibility issues with tk8.4.18, so download a patch given in the following link.

Step 3: http://bugs.gentoo.org/show_bug.cgi?id=225999
Step 4: There are two patch files, the second file worked in my case as i tried only the second file (tk-8.4-lastevent.patch)
Step 5: Save the file as .patch and store it in ./ns-allinone-2.33/tk8.4.18/

Step 6: Patch the file by executing the following commands

[rootamiitesh tk8.4.18]$ patch -p1 < /opt/ns-allinone-2.33/tk8.4.18/tk-8.4-lastevent.patch

(you may get the following lines of information…)

can’t find file to patch at input line 3
Perhaps you used the wrong -p or –strip option?
The text leading up to this was:
————————–
|— generic/tk.h.orig 2008-02-06 16:31:40.000000000 +0100
|+++ generic/tk.h 2008-07-24 08:21:46.000000000 +0200
————————–
File to patch: generic/tk.h

Step 7: Enter the file to patch as generic/tk.h

Thats it!!!!!

Step 8: then go for the Installing the Network Simulator 2
click here to see the installation instructions