Bug 2055

Summary: TxBuffer and RxBuffer traces don't work
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: tcpAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Option2 fix

Description Tommaso Pecorella 2015-01-31 04:56:19 UTC
TxBuffer and Rx buffer have both a TraceSource, but:
1) they don't work, and
2) they can not be hooked properly.

Point 1 is because they are derived from Object, but they are missing a CreateObject (they are used as normal member variables).
Point 2 is because they're private, not aggregated and not accessible (no public method to them).

We have 2 possible solutions:

Solution 1:
Change them to be derived from ObjectBase. However the problem of accessing their TracedValues remains. One may promote them to be public and move the TraceSource to TcpSocketBase. Dunno about other options.

Solution 2:
Change them to be Ptr<> and add a pointer-accessor in TcpSocketBase. In this way the Config store will be able to find them.
Comment 1 Tommaso Pecorella 2015-01-31 05:31:14 UTC
Created attachment 1964 [details]
Option2 fix

This is the patch according to option 2.

The trace sources can be accessed by something like:
  Config::ConnectWithoutContext ("/NodeList/1/$ns3::TcpL4Protocol/SocketList/0/TxBuffer/UnackSequence", MakeCallback (&UnackSequenceTracer));
Comment 2 Tom Henderson 2015-01-31 18:51:34 UTC
pushed the patch in changeset 11195:0c5e9bfa1b48