Bug 2985 - PhyTxEnd tracecallback not implemented
PhyTxEnd tracecallback not implemented
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
unspecified
All All
: P3 minor
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-03 04:44 EDT by Kiran Mathews
Modified: 2020-04-12 08:09 EDT (History)
3 users (show)

See Also:


Attachments
patch for file src/wifi/model/wifi-phy.cc (568 bytes, text/plain)
2018-09-03 04:44 EDT, Kiran Mathews
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kiran Mathews 2018-09-03 04:44:48 EDT
Created attachment 3174 [details]
patch for file src/wifi/model/wifi-phy.cc

Since 2010 (http://code.nsnam.org/ns-3-dev/rev/8f7571fea7cf), PhyTxEnd trace callback for WiFi is not implemented. As per the documentation, "PhyTxEnd" callback is supposed to call after the transmission of the Wifi packet is finished. I made a patch for this bug. I scheduled a callback (inside the WifiPhy::SendPacket method) after txDuration time, which will fire the trace after the transmission is done. 
But may I know, whether there are some other logical reasons why this feature not been implemented for a long time?.
Comment 1 Tom Henderson 2018-09-03 09:48:15 EDT
Kiran, I do not remember the specific details, but I believe that this trace was suppressed for performance reasons (wanting to avoid the additional Simulator::Schedule() event for every frame).  I believe that the original author of yans-wifi-phy.cc (Mathieu Lacage) made this decision.  I seem to recall that there may have been some other discussion of this many years ago in the tracker on another issue.

However, I do not know whether this suppression was based on some empirical profiling or whether it was just designed this way proactively.

I'll check with Mathieu whether he remembers the details of this.
Comment 2 Mathieu Lacage 2018-09-04 03:10:20 EDT
There was a (not good ?) reason for that. In the yans Paper, in section 6.2:

While implementing the DCF would have been particularly easy if we had used a recurring timer that expired every slot, we chose to use the method described in [17] where the backoff timer duration is lazily calculated whenever needed, since it is claimed to have much better performance than the simpler recurring timer solution. In the bagrodia paper from [17], the reference is to section 5.1+5.2

Retrospectively, it would have been much simpler to schedule an end-of-tx event at the PHY layer and DIFS timers at the MAC layer to track the backoff. I personally would support such a change which would get rid of a lot of complexity at the MAC layer at the cost of a potentially slower simulation.
Comment 3 Kiran Mathews 2018-09-04 04:00:14 EDT
(In reply to Mathieu Lacage from comment #2)
> There was a (not good ?) reason for that. In the yans Paper, in section 6.2:
> 
> While implementing the DCF would have been particularly easy if we had used
> a recurring timer that expired every slot, we chose to use the method
> described in [17] where the backoff timer duration is lazily calculated
> whenever needed, since it is claimed to have much better performance than
> the simpler recurring timer solution. In the bagrodia paper from [17], the
> reference is to section 5.1+5.2
> 

> Retrospectively, it would have been much simpler to schedule an end-of-tx
> event at the PHY layer and DIFS timers at the MAC layer to track the
> backoff. I personally would support such a change which would get rid of a
> lot of complexity at the MAC layer at the cost of a potentially slower
> simulation.

Mathieu, so you believe its a good move to implement a PhyTxEnd trace? or the other way around(Higher priority for simulator performance)?
Comment 4 Mathieu Lacage 2018-09-04 04:14:33 EDT
(In reply to Kiran Mathews from comment #3)

> Mathieu, so you believe its a good move to implement a PhyTxEnd trace?

Yes
Comment 5 sebastien.deronne 2018-09-04 04:32:00 EDT
We already suffer from slow simulation when a large amount of nodes are involved, so we should see how much this is affected.

Kiran, do you plan to try reworking the code as suggested by Mathieu so that we can eventually benchmark and evaluate impact on simulation speed? I do not think any other of us will have time to help on this. 

I am also scared we introduce regression here, since this code is quite stable and validated over the years.
Comment 6 Kiran Mathews 2018-09-04 04:58:22 EDT
Sebastien, currently I planned nothing, but I will give a try during my free time and incorporate the suggestions by Mathieu. Also, I cannot guarantee a deadline, is that okay?
Comment 7 sebastien.deronne 2018-09-04 04:59:38 EDT
(In reply to Kiran Mathews from comment #6)
> Sebastien, currently I planned nothing, but I will give a try during my free
> time and incorporate the suggestions by Mathieu. Also, I cannot guarantee a
> deadline, is that okay?

Of course, just post a patch when you have something that can be tested. I guess that if someone wants to help, he will comment here.
Comment 8 sebastien.deronne 2020-04-12 08:09:25 EDT
Fixed in changeset 948e9395269fb119ee4a916cb3a10aed0693397f