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

RE: Throughtput!



change tcp-sink.cc :(and tcp-sink.h    int bytes; in the protected part)
TcpSink::TcpSink(Acker* acker) : Agent(PT_ACK), acker_(acker), save_(NULL)
{
	bind("packetSize_", &size_);
	bind("maxSackBlocks_", &max_sack_blocks_); // used only by sack
	bind_bool("ts_echo_bugfix_", &ts_echo_bugfix_);
	bind("bytes_", &bytes_); bytes_=0;
}

in the recv method
if (numToDeliver){
		bytes_+=numToDeliver;		//new
...


add in ns-default.tcl
Agent/TCPSink set bytes_ 0


then in your tcl script you have these lines somewhere :
set dst [new Agent/TCPSink]
proc record {} {
  ....
	set bw0 [$dst set bytes_]
...
 puts $f0 "$now $bw0"   #f0 is the .xg file to use with xgraph
 $ns at [expr $now+$time] "record"
}


Gwendal



> -----Message d'origine-----
> De : [email protected]
> [mailto:[email protected]]De la part de Tom Pavel
> Envoy� : lundi 15 novembre 1999 19:18
> � : Radhakrishna Sampigethaya
> Cc : [email protected]
> Objet : Re: Throughtput!
>
>
>
> >>>>> On Sat, 13 Nov 1999, Radhakrishna Sampigethaya
> >>>>> <[email protected]> writes:
>
> > I am very new to ns. I was interested in plotting
> > thruput (for performance analysis of TCP) Vs different
> > parameters of arrival traffic.
> > For this i need to first capture the BYTE COUNT at the
> > sink node (TCPSink for TCP). How can i go about it?
>
>
> For TCP streams, I have found that using the ndatabytes_ variable of
> the Agent/TCP connection object is the simplest way to look at
> throughput.  Unlike the Agent/LossMonitor class, the Agent/TCPSink
> doesn't seem to keep state on the number of bytes delivered.
>
>
> Hope that helps,
>
> Tom Pavel
>
> [email protected]
>