[Ns-developers] helper APIs, and planning for ns-3.1 release

Tom Henderson tomh at tomh.org
Mon Apr 7 23:06:01 PDT 2008


Below is an update on how some of Craig's comments have been handled so far.

craigdo at ee.washington.edu wrote:

1. I think that small changes from
> 
>   InternetStackHelper internet;
>   internet.Build (c);
> 
> to
> 
>   InternetStackHelper stack;
>   stack.Install (c);
> 
> including the variable name change, make it much clearer what is actually
> happening.  

Done.

2.
>   ipv4.Allocate (nd0);
> 

"Allocate" changed to "Assign"


3.

> Next, some of the application helpers use Attributes to do some things and
> regular methods to do others.  For example,
> 
>   OnOffHelper onoff;
>   onoff.SetUdpRemote (Ipv4Address ("10.1.1.2"), port);
>   onoff.SetAppAttribute ("OnTime", ConstantVariable (1));
>   onoff.SetAppAttribute ("OffTime", ConstantVariable (0));
> 
> I'm not sure what rule determines which is which.  Do I just need to
> memorize or lookup which one to use?  Why do I need to do both kinds of
> call?  Why do I need to call SetAppAttribute?  Don't I already know it's an
> OnOff Application underneath?  Isn't there one destination for the Attribute
> setter?

Mathieu commented that some of these functions had special names to call 
out that they are mandatory setters.  Craig suggested to put such 
setters into the constructors as parameters, which he did today.  So, 
mandatory attributes are now set through the constructor call, while 
"SetAttribute" can be used for passing through additional attribute values.


4.

> 
> I think there could be another method added to the device helpers to "help"
> people who just have one kind of device they want to trace.  For example
> 
>   CsmaHelper::EnableAscii ("csma-one-subnet.tr");
> 
> instead of having to write out
> 
>   std::ofstream ascii;
>   ascii.open ("csma-one-subnet.tr");
>   CsmaHelper::EnableAscii (ascii);
> 
> every time, even though you might not be interested in sharing the stream
> with other device types.  This is a lot of stuff to type for the simple
> (common?) case.

this tracing item is not yet handled

5.

> 
> Finally, I noticed that the idiom,  
> 
>   NodeContainer c;
>   c.Create (3);
>   NodeContainer c0 = NodeContainer (c.Get (0), c.Get (1));
> 
> is fairly common.  

No change (yet, if any) to the implicit conversions in these containers.

Tom




More information about the Ns-developers mailing list