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

Re: [ns] Questions on Expoo.cc and UDP Agent (inconsistency "bug" between udp.cc/tcp.cc)



Good morning-

> In the file Expo.cc, in the Constructor (EXPOO_Traffic), the second bind
> uses :
> 
>         bind_time ( "idle_time" , Offtime.avgp() )
> 
> ^----------------------- Why is it the avgp() member functions that is
> used and not the avg(). avgp is supposed to return a pointer ?
Bind is called to give tcl code access to c++ variables, and thus needs a
pointer. avg() returns the current average, which when treated as a pointer
would be A Bad Thing.


> The other question is on UDP Agent, if I choose the default maximum
> segment size to be 1500 bytes, will all the transmitted segments be of
> that size or will the segment adapt to the size of the packet (if
> inferior to 1500) ?
Packets of size 1500 will be sent.

UDP will divide the number of bytes you want to send by size_ (1500 in
this case) and send that many packets, rounding DOWN. The code that does
this is:
	n = nbytes / size_;
('n' packets of size 'size_'=1500) are sent.
For TCP, the same thing is done but the result is rounded UP via:
	curseq_ += (nbytes/size_ + (nbytes%size_ ? 1 : 0));

-Eric

--------------------------------------------
 Eric H. Weigle   CCS-1, RADIANT team
 [email protected]     Los Alamos National Lab
 (505) 665-4937   http://home.lanl.gov/ehw/
--------------------------------------------