Bug 805 - WifiPhy PhyTxEnd trace not working
WifiPhy PhyTxEnd trace not working
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-04 09:27 UTC by jvilela
Modified: 2010-04-16 14:05 UTC (History)
3 users (show)

See Also:


Attachments
Simulation based on wifi-simple-adhoc-grid.cc where the callback method PhyTxEnd never gets activated. (8.83 KB, text/x-c++src)
2010-02-04 09:27 UTC, jvilela
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jvilela 2010-02-04 09:27:40 UTC
Created attachment 751 [details]
Simulation based on wifi-simple-adhoc-grid.cc where the callback method PhyTxEnd never gets activated.

The callback for the trace PhyTxEnd is never activated, therefore not producing any result when a transmission ends.

Example simulation (based on wifi-simple-adhoc-grid.cc) where such happens is attached.
Comment 1 Craig Dowell 2010-02-20 14:10:58 UTC
This is as designed.

Not all of the standard trace sources are required to have implementations that work.  They are standard trace names that a model author can choose to implement.

For example, see csma-net-device.cc:

#if 0
    // Not currently implemented in this device
    .AddTraceSource ("PhyRxBegin",
                     "Trace source indicating a packet has begun being received by the device",
                     MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxBeginTrace))
#endif

However, if the device does not implement a source, it should probably remove the code or do the same as the csma device and ifdef them out with a comment.  That way the trace sources don't misleadingly end up in the documentation.
Comment 2 Nicola Baldo 2010-04-09 13:53:17 UTC
Craig is right. Furthermore, with wifi there is a base class for the PHY (WifiPhy). The trace sources are defined by this base class, to preserve naming compatibility among implementations. Unfortunately, the only official implementation to date is YansWifiPhy, which by design does not generate a "TxEnd" event. I do not think that it is practical to modify YansWifiPhy so that it generates the requested trace.

However, we should do something to avoid disappointing users like it happened to jvilela. Possible solutions IMHO:

1) we do as Craig says, and we #ifdef the trace declaration, until somebody comes up with a new device that uses it

2) we add a comment to the trace declaration (in WifiPhy) saying that this trace is unused by the only WifiPhy implementation currently available (YansWifiPhy)

any comments? I would go for 2).
Comment 3 Nicola Baldo 2010-04-16 14:05:50 UTC
changeset 6217	8f7571fea7cf