Bug 95

Summary: where data rate is set for PointToPoint NetDevice/Channel
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: devicesAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   
Attachments: a more modest bug fix, plus DataRate operators

Description Tom Henderson 2007-10-26 18:01:43 UTC
Presently, both the PointToPointNetDevice and PointToPointChannel have public API allowing user to pass the DataRate object for use on the link.  The one on the channel is supposed to be a maximum rate, according to the Doxygen, while the one on the NetDevice is the actual.

However, when PointToPointNetDevice::Attach() is called, the channel DataRate overwrites the NetDevice DataRate object.  And the maximum is never enforced.

I propose to remove the so-called maximum data rate (DataRate) in the channel, and just let users set the DataRate in the NetDevice.
Comment 1 Tom Henderson 2007-11-09 02:14:25 UTC
Created attachment 88 [details]
a more modest bug fix, plus DataRate operators

I ended up not trying to change the DataRate assignment being driven by the channel, for this time around, since it would require then changing the examples and topology code.  I will leave that for a future cleanup.

This patch instead just enforces that a user cannot SetDataRate() on a NetDevice to a DataRate that exceeds the channel maximum.

And along the way, some const versions of the DataRate operators were missing so I added them too.
Comment 2 Mathieu Lacage 2007-11-09 02:45:17 UTC
I think that you could just get rid of the non-const versions of the member methods.
Comment 3 Tom Henderson 2007-11-15 00:18:56 UTC
got rid of non-const operators; patches applied as changesets 1825 and 1826