[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] how to specify the byte rate of tcp sender
Hi,
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 ?
Bye
Alex