Bug 1412

Summary: Make RttEstimator available to other modules
Product: ns-3 Reporter: Alex Afanasyev <alexander.afanasyev>
Component: internetAssignee: Brian Swenson <bswenson3>
Status: PATCH WANTED ---    
Severity: normal CC: daniel.camara, natale.patriciello, ns-bugs, tomh, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Bug Depends on: 1405    
Bug Blocks:    
Attachments: Patch fixing the bug

Description Alex Afanasyev 2012-04-18 15:35:50 EDT
RttEstimator is a pretty independent and useful piece that can be reused by other modules and application (e.g., I'm need it in my custom NS-3 module).  

I think it make sense either to put rtt-estimator.h into 'internet' module's wscript or (which is even better) to move rtt-estimator.h/cc into 'network' module and put  rtt-estimator.h into 'network' module's wscript.
Comment 1 Tommaso Pecorella 2012-05-06 07:43:18 EDT
I'm neutral with this change. Meaning the pros and cons are balanced.

Pros: you're right, it's a nice piece of code and *could* be useful.

Cons: the original algorithm was proposed for TCP and (to my best knowledge) is not used in any other protocol.

If you can provide a practical example of where it could be reused, I'm more than keen to give a +1

T.
Comment 2 Tom Henderson 2012-05-06 12:16:25 EDT
(In reply to comment #1)
> I'm neutral with this change. Meaning the pros and cons are balanced.
> 
> Pros: you're right, it's a nice piece of code and *could* be useful.
> 
> Cons: the original algorithm was proposed for TCP and (to my best knowledge) is
> not used in any other protocol.
> 
> If you can provide a practical example of where it could be reused, I'm more
> than keen to give a +1
> 
> T.

I would support moving it to network/utils/ just based on Alex's stated need.
Comment 3 Tommaso Pecorella 2012-05-06 12:45:02 EDT
Fine by me.

+1
Comment 4 Tommaso Pecorella 2013-03-13 06:23:27 EDT
Created attachment 1531 [details]
Patch fixing the bug

Ok, the bug is this.

The ObjectBase::ConstructSelf (AttributeConstructionList ()) function will call GetInstanceTypeId, which usually is a virtual function, inherited from Object. The function should call GetTypeId, which is static to the class.

On the other hand, inside the constructor the object is still not fully created, hence its virtual inherited stuff is kinda... strange.

To make a long story short. This will work *only* if the object is actually implementing a GetInstanceTypeId function.

The patch does this and it clarifies the manual about this point.

T.
Comment 5 Tommaso Pecorella 2013-03-13 06:25:26 EDT
(In reply to comment #4)
> Created attachment 1531 [details]
> Patch fixing the bug
> 
> Ok, the bug is this.
> 
> The ObjectBase::ConstructSelf (AttributeConstructionList ()) function will call
> GetInstanceTypeId, which usually is a virtual function, inherited from Object.
> The function should call GetTypeId, which is static to the class.
> 
> On the other hand, inside the constructor the object is still not fully
> created, hence its virtual inherited stuff is kinda... strange.
> 
> To make a long story short. This will work *only* if the object is actually
> implementing a GetInstanceTypeId function.
> 
> The patch does this and it clarifies the manual about this point.
> 
> T.

Opps, added to the wrong bug... :(
Comment 6 natale.patriciello 2015-02-24 16:11:29 EST
Can this bug be closed with the RTT patches provided by Tommaso some times ago?
Comment 7 Brian Swenson 2015-02-24 16:25:52 EST
I'm not sure which patch you are referring to.  The patch attached to this bug is marked obsolete since it was attached to the wrong bug.  

Rtt-Estimator.h is in wscript for internet, I believe that got changed when the RttTestCase was created.  Prior it was not accessible.

The request was to move it to the network module, which has not been done.  Its more of a feature suggestion than a bug and the feature hasn't been implemented.
Comment 8 Tom Henderson 2015-02-24 16:30:56 EST
I think that the current ns-3-dev version of this could be moved to src/network/utils and that would satisfy the original request.