Bug 2055 - TxBuffer and RxBuffer traces don't work
TxBuffer and RxBuffer traces don't work
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: tcp
ns-3-dev
All All
: P5 normal
Assigned To: Tommaso Pecorella
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-31 04:56 UTC by Tommaso Pecorella
Modified: 2015-01-31 18:51 UTC (History)
2 users (show)

See Also:


Attachments
Option2 fix (33.38 KB, patch)
2015-01-31 05:31 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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