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 500x500
if there are more xgraph files then,
exec xgraph filename1.xg -geometry 500x500 &
exec xgraph filename2.xg -geometry 500x500 &
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



Comments

  1. hello
    I am doing project in ns2 for wireless sensor network. it is very new to me... i have done some code and got output in nam . i want to get a Xgraph output also but i dont know about Xgraph....please help me....

    ReplyDelete
  2. I have a small pdf file reagarding that. I think it can be helpful and by the way,me too doing a project in ns2.

    ReplyDelete
  3. hello
    my problem is comment trace utilization in ns2
    or trace throughput vs number please help me

    ReplyDelete
  4. Hi i am working in ns2 for performance comparison of manet routing protocol like aodv and dsr ,I get the result in nam ,but don't know how to plot routing overhead ,pdf,end to end delay etc using xgraph ,please guide me

    ReplyDelete
  5. hello i m minakshi. i m doing my project in sensor networks with ns-2.34 simulater while running my tcl script i m getting an error i.e.
    num_node is 27
    wrong node routing agent
    i m very thankful if u guide me please.

    ReplyDelete
  6. hello i m winsy. i m doing my project in sensor networks with ns-2.34 simulater while running my tcl script i m getting an error i.e.
    num_node is 27
    wrong node routing agent
    i m very thankful if u guide me please.

    ReplyDelete
  7. send me the coding, iwll look into it.,

    ReplyDelete

Post a Comment

Popular Posts