Bug 1058

Summary: InternetStackHelper pitfall: calling Install before adding routing protocols
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: internetAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: add comment to examples

Description Gustavo J. A. M. Carneiro 2011-02-21 11:03:09 UTC
I have seen more than once people asking me for help in ns-3 because (it turned out) that they called Install() of an InternetStackHelper object, and only after did they configure the routing protocol.

I wonder if it makes sense to prevent  modification of an InternetStackHelper object after the first time it is Install'ed?  It should be simple to implement, and could be helpful to prevent newbie mistakes...
Comment 1 Tom Henderson 2011-02-21 23:47:16 UTC
(In reply to comment #0)
> I have seen more than once people asking me for help in ns-3 because (it turned
> out) that they called Install() of an InternetStackHelper object, and only
> after did they configure the routing protocol.
> 
> I wonder if it makes sense to prevent  modification of an InternetStackHelper
> object after the first time it is Install'ed?  It should be simple to
> implement, and could be helpful to prevent newbie mistakes...

However, I have used the same helper to configure different nodes in different ways (e.g. change routing or change TCP, and install on a different set of nodes), so I would be a bit leery of such a change.  Is there possibly some routing-related example file that is often cloned and modified in the wrong way that we could perhaps add more explicit documentation about Install?
Comment 2 Gustavo J. A. M. Carneiro 2011-02-22 05:39:56 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > I have seen more than once people asking me for help in ns-3 because (it turned
> > out) that they called Install() of an InternetStackHelper object, and only
> > after did they configure the routing protocol.
> > 
> > I wonder if it makes sense to prevent  modification of an InternetStackHelper
> > object after the first time it is Install'ed?  It should be simple to
> > implement, and could be helpful to prevent newbie mistakes...
> 
> However, I have used the same helper to configure different nodes in different
> ways (e.g. change routing or change TCP, and install on a different set of
> nodes), so I would be a bit leery of such a change.

If you used the helper in that way, than there's no way we can fix without breaking lots of existing script.  I honestly thought no one used it that way, but if it is, then it's not worth it IMHO.

>  Is there possibly some
> routing-related example file that is often cloned and modified in the wrong way
> that we could perhaps add more explicit documentation about Install?

Perhaps.  I'll look again later.
Comment 3 Gustavo J. A. M. Carneiro 2011-02-22 14:19:40 UTC
Created attachment 1037 [details]
add comment to examples

I guess adding a simple comment like this might help newbies.

  internet_olsr.SetRoutingHelper (list); // has effect on the next Install()
Comment 4 Tom Henderson 2011-05-13 01:48:55 UTC
changeset: 43d2fb5bfb12