[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] How to plot the throughput of a link ?



You can do this: 

Do a trace all. Then use a simple awk script to find the bandwidth.
Suppose your trace file is out.tr

you can write bw.awk to say 
----
BEGIN {c=0; print 0, 0; t=0;}
$1=="r" {  
	  if(int(t)!=int($2)){ 
		print int(t), c-1; 
		c=0; t=$2;
	  }
	  c++;
	}
END { print t, c}
----

then use awk -f bw.awk out.tr > plot.dat to get the plot.

Debo

On Mon, 24 Sep 2001, Meow Chiow Chia wrote:

> Hi all ns-users
>     I am learning the ns-2 from the Marc Greis's
> tutorial document.  I am just wondering how can I plot
> the throughput of an aggregate link using xgraph.  For
> example, I want to plot the throughput of the link
> between n2 and n3 as follow, 
>  
>          
>  n0 ------- n2-------n3
>             |
>   n1 -------|
> 
>  I understood from the Marc's tutorial that I need to
> create a traffic sink , but how can I plot the
> throughput of a aggregate link (Marc showed an example
> with 3 separate traffic sinks for 3 sources). I have
> tried to look for the solution in the ns manual but
> apparently the manual is not that useful for a
> beginner like me.
>    Any help on this will be very much appreciated.
> 
> Many Thanks
> Meow
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com
> 
>