[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] how to specify the byte rate of tcp sender
On Wed, 25 Jul 2001, Neundorf Alexander wrote:
> I wanted to do something like a cbr tcp source, I took the Telnet class as example. I did the following:
>
> mainly I changed this function:
>
> void MyTestApp::timeout()
> {
> if (running_)
> {
> int sendNow=bitrate_/80;
> agent_->sendmsg(sendNow);
> timer_.resched(0.1);
> };
>
> Now my tcp source generates packets 10 times per second, but their
> size is *always* 1000 bytes. If I set bitrate_=64000, it should
> send 800 bytes at once. So my received bitrate is 80.000 bit per
> second (10 x 1000 bytes per second, x 8 bit per byte) instead of
> the expected 64000.
>
> I already found that TCPAgent::output() uses hdr_cmn->size, which
> is 1000. What am I doing wrong ?
not setting packetSize_ to something other than the default 1000 in
your script?
(Nagle's algorithm kicks in with FullTcp as well.)
L.
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>