[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Problem with monitoring TCP throughput
On Mon, 6 Mar 2000, Chris Develder wrote:
> Being a novice NS user, I posted a question last week concerning monitoring TCP
> throughput.
goodput. (actual packet/segment throughput is same or more.)
You don't have to modify if (numToDeliver); you can just override
recvBytes() instead, which is slightly neater.
The following patch to 2.1b5 is _really_ crude (but very accurate -
there's no sampling interval error, and if all you want are the
results for an application-level view of goodput...) and just dumps
the output to stdout in a form suitable for drawing in xgraph or
postprocessing for cumulative addition via the awk script at end:
$ more tcp-sink.h.patch
92a93,94
> // added by Lloyd
> void recvBytes(int bytes);
$ more tcp-sink.cc.patch
192a193,199
> // added by Lloyd
> void TcpSink::recvBytes(int bytes)
> {
> double now = Scheduler::instance().clock();
> printf("%f\t%d\n",now,bytes);
> }
>
(I should just be able to use NOW here, of course...)
$ more transfer.awk
BEGIN {
total = 0;
}
{
time = $1;
transfer = $2;
total = total + transfer;
ink = total / 1024;
printf ("%f\t%f\n",time,ink);
}
A better general solution would be to have a default recvBytes with
bound variable in TcpSink in 2.1b7, so that capturing goodput is
commonplace and widely understood. The sink is widely neglected...
L.
bound variables - we've heard of them.
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>