[Ns-developers] finalizing the ns-3 object model (configuration)
Tom Henderson
tomh at tomh.org
Mon Jan 14 23:04:31 PST 2008
craigdo at ee.washington.edu wrote:
>
> So, my first comment is, that when I saw:
>
> Parameters params;
> params.Set ("PointToPoint::ChannelDataRate", "5000000");
> params.Set ("PointToPoint::ChannelDelay", "2");
>
> Ptr<PointToPointChannel> channel0 =
> PointToPointTopology::AddPointToPointLink ( n0, n2, params);
>
> I was astonished. This code snippet seems to violate pretty much every
> usability guideline for interface design I've mentioned. It's completely
> new and unique. It makes a simple and common thing like passing 5000000 to
> a function painful. This pain will last forever. I can see this kind of
> stuff appearing all over our codebase. It does make rare things possible,
> though, and strikes me as way to clever. It may work and it may enable some
> really hairy reconfiguration down at the low levels of the code, but I'll
> have a really, really hard time signing off on something like this.
Craig,
I see this as one solution that has a few features that the conventional
way of doing this (read in a flat configuration file, store global
variables) doesn't.
- it provides a way to plumb in, and scope the applicability of
configuration parameters, when the object being configured may be a few
layers down in the API.
- it also would localize the declaration of these values to the class
(TypeId) using them, easing the automated documentation of them
I think though that your comment was directed more at the usability than
functionality of the proposal, so do you have some other ideas about how
one might achieve the same scoping goals?
>
> I was thinking about this last Friday and it occurred to me that the
> namespace in our tracing system gets us almost there. I have methods like
> the following scribbled on my whiteboard:
>
> Set ("/nodes/*/tcp/reno/ssthresh", "16000");
> Set ("/nodes/1/tcp/rajno/cwnd". "4000");
This is an interesting idea and looks like Linux proc too. It might be
nice to reuse the tracing namespace if possible rather than define a new
configuration one.
It doesn't seem to me to address one of the other issues that Parameter
deals with, which was the ability to locally override these settings.
Tom
More information about the Ns-developers
mailing list