Sunday 13 November 2011

X-graph in NS2 - xgraph for throughput -xgraph from trace file - xgraph command

Xgraph is easy and very Useful.

Xgraph in NS2
  •  Xgraph draws a graph on a Display device.
  • Display upto 64 Independent data sets using  different colors
  • The input data can be read from either data file or from standard input if no files are specified
  • It annotates the graph with a title, axis labels grid lines or tick marks, grid labels, and  legend.
Windows Interface
  • The interface used to specify the size and location of this window depends on the window manager currently in use.
  • Once the window has been opened, all of the data sets will be displayed graphically with a legend in the upper right corner of the screen.
  • Xgraph also presents three control buttons in the upper left corner of each window.
Xgraph command options       
  • -geometry WxH (Geometry)
  •  Specifies the initial size and location of the Xgraphwindow.
  •  -bar (BarGraph) Specifies that vertical bars should be drawn from the data points to a base point which can be specified with -brb.
  •  -brb <base> (BarBase) 
  •  This specifies the base for a bar graph. By default, the base is zero.
  • -brw <width> (BarWidth)
  •  This specifies the width of bars in a bar graph. The amount is specified in the user’s units. By default, a bar one pixel wide is drawn.
Xgraph Command:Execution
  • xgraph DataFile.txt –geometry 400x400,  Here DataFile.txt can be Replaced with trace file generated from Ns-2.this command will show the graph using X and Y co-ordinates with Geometry of 400X400
  • xgraph DataFile.txt –geometry 400x400 –bar –brb 2 –brw 0.5 –tk –bb –nl –bg white –t “Example_Xgraph” –x “Xaxis” –y “Yaxis” . This command will generate Bar Graph.
  • Xgraph DataFile.txt DataFile2.txt –bg white –tk –bb –m -M –t “Marker” –geometry  800x400.This command used to compare the two Files and generated graph
Awk and Xgraph
  • Awk programming is used to generate the detailed analysis of NS-2 trace file.
  • Metric's like Throughput,end-to-end Delay,Jitter,NRL,Packet Delivery ratio can be calculated using Awk scripts. Generate output's  by changing scenario files.
  • Keep these outputs in a Text file in the Form of X and Y co-ordinates .for example, you can keep No_of _mobile nodes on X-axis and PDF on Y-axis. 
Xgraph of two Trace files in NS2
  • Xgraph can generated using Two files .This graph will show the comparison of two files with different data 
  • command :Xgraph DataFile.txt DataFile2.txt –bg white –tk –bb –m -M –t “Marker” –geometry  800x400
  • Like wise One can compare two Routing Protocols and evaluate the best among them. For example comparison of AODV performance with DSDV in MANET. 
Sample Xgraph Generation ---->Node size vs PDR 

  • Create a text file named  PDRvsNODE.txt and keep the data as like the below format .First column represent node size, (5 ,10,20,30,40,50) and 2 nd column specifies pdr that you got after running pdr.awk scipt for no of nodes set in your tcl file . Location of the text file need to specified clearly while you are running the command.

5  99.5
10 99.7
20 99.0
30 95.6
40 94.8
50 95.9



Once you created text file and kept this data ,Run the command 

Xgraph PDRvsNODE.txt   –bg white –tk –bb –m -M –t “Marker” –geometry  800x400


That's it!!! You arrived your destination successfully.

Saturday 12 November 2011

Installation of NS-2.33 on Cygwin

Installation of Ns-2.33 on Cygwin

  • TO install NS-2.33 on Cygwin ,You need Cygwin 1.5.25 or greater
  • Cygwin 1.7.1 is recommended.
  • NS-2.33 is not automatically installed on Cygwin due to lack of Dynamic loading Library Package.
  •  The Key point  is  "Remove those Dynamic loading libraries from ns-2.33"
  •  Once you remove ,the installation will succeed.
Steps to be Followed

  • Download Ns-2.33 HERE.
  • Use my Previous Post to Extract the files of the ns-allinone-2.33 folder using cygwin.
  • Once extracted ns-allinone-2.33 folder ,switch to ~/ns-allinone-2.33/ns-2.33
  • Here open Configure File,and check for "-ldl" .
  • Replace all "-ldl" in the file with empty
  • Finally Go to ns-allinone-2.33 folder and type ./install
Thats Done,Lets Start Exploration 
 



Thursday 10 November 2011

INSTALLING CYGWIN IN WINDOWS 7

HI all, soon i will  post  detailed  Installation steps of Cygwin in Windows 7 ,Thus Installation of NS-2 in Windows 7 is Possible

Install NS2 in Cygwin

How to Install NS2?
How to install NS2 in Cygwin?
How to install NS2 in Windows?
NS2 installation Problems ?
Environmental Variables in NS2


Installation Steps


  •   Download your Required NS2 verison HERE
  •  Open Cygwin and type "Startxwin.bat" command which will open cygwin server used for running nam and xgraph files.
  •  Place your ns-allinone file to your desired location and extract the file using the command   tar "xvfz ns-allinone-(version).tar.gz" (ex: xvfz ns-allinone-2.33.tar.gz) .it will extract all files to folder ns-allinone-(version_no)
  • Now specify the folder path in cygwin (ex: cd c:/ns-allinone-2.33/)
  • Type ./install
  • Generally, the compilation process will cost about 2 hours (depended on your computer).
  • You may get Errors like OTcl ,Tcl,Ns-2 build failed due to the problem of cygwin package libraries.,you can solve those by installing Required packages through Internet . the procedure is same as installing cygwin . 
  •  Refer to post"INSTALLATION OF CYGWIN ON WINDOWS"
  • You can get   help regarding your error HERE
Setting  Environmental Variables

  • Edit the file “.bashrc” which is a hidden file in your “home/{username}” folder and insert these sentences:
export NS_HOME=`pwd`/ns-allinone-(ns_version_no)
export PATH=$NS_HOME/tcl(tcl_verison_no)/unix:$NS_HOME/tk(version_no)/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl(version_no)/unix:$NS_HOME/tk(tk_version_no)/unix:$NS_HOME/otcl-(otcl_version_no):$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl(tcl_version_no)/library

     EX: (Setting  Environmental Variables for ns-2.27)
    
export NS_HOME=`pwd`/ns-allinone-2.27
export PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/bin:$PATH
export LD_LIBRARY_PATH=$NS_HOME/tcl8.4.5/unix:$NS_HOME/tk8.4.5/unix:$NS_HOME/otcl-1.8:$NS_HOME/lib:$LD_LIBRARY_PATH
export TCL_LIBRARY=$NS_HOME/tcl8.4.5/library

  Testing Ns-2
  •   In cygwin go to folder  ~/ns-allinone-(ns2-version_no)/ns-(ns2-version_no)/     ex: ~/ns-allinone-2.33/ns-2.33/
  • Type  ns command [ex:  $ ns]
  • If Installation is success with out any Error you will get  symbol  %   
Thats it Installation of ns-2 in your system is successfull. 
                 Let's start your Research now


          


                 




     

Installing Cygwin in Windows for NS2

Hi, Its very easy to install Network simulator(NS2) in Windows , All we need is Windows Xp and Cygwin version 1.5 or greater



How to install Cygwin ?
How to install Cygwin in windows?
Installing Cygwin for NS2
Installing NS2 in cygwin
Cygwin Packages download
Cygwin Packages for NS2

Below address the above mentioned Questions 

Installation steps
          1)  Cygwin Installation
            
       Please Install Cygwin to C drive (C://cygwin)
  •   Get the Cygwin Setup Here
  •   Cygwin can be installed via Internet ,choose download source as "DOWNLOAD FROM INTERNET"
  •   Select "ALL USERS" and "UNIX" Radio box and continue
  •   Select local directory to store the Cygwin lib files and it will be used for later use.
  •   Select Direct Connection and Choose a Mirror to Download Files
  •   Here it will show all library packages needed for cygwin to make NS-2 run ,some     important packages are "XFree86-base, XFree86-bin, XFree86-prog, XFree86-lib, XFree86-etc, make, patch, perl, gcc, gcc-g++, gawk, gnuplot, tar and gzip",.or else u can install all packages by selecting Install all.
  •   Installation of Cygwin is completed ..you can see the cygwin shortcut button on your desktop.
  • Now ,Key point is open the cygwin it will create home folder in to your C://cygwin/  folder. Then checking the root of Cygwin, making sure there are one folder named “home” and there are three hidden files in “home/{username}” which are .bashrc, .bashrc_profile and .inputrc.
  •   Bashfile(.bashrc) which is important in order to set the path to our NS-2 versions....