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

RE: [ns] how to specify the byte rate of tcp sender





> -----Original Message-----
> From:	Lloyd Wood [SMTP:[email protected]]
> Sent:	Wednesday, July 25, 2001 2:29 PM
> To:	Neundorf Alexander
> Cc:	'[email protected]'
> Subject:	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.
> 
	[Neundorf Alexander]  

	Well, now I added "set $source packetSize_ 800" (whereas $source is a Agent/TCP), and now I get the   expected 64k bitrate, but I still wonder why. Is in TCPAgent::sendmsg(int nbytes,...); nbytes simply ignored ? Or what is it good for ?  If I call sendmsg() 10 times per second with each time nbytes==800, it should also give 64k, what's wrong with this assumption ? 

	Bye
	Alex