Bug 2316 - MacLow shall use a single TXVECTOR for all MPDUs belonging to a same A-MPDU
MacLow shall use a single TXVECTOR for all MPDUs belonging to a same A-MPDU
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
pre-release
All All
: P5 enhancement
Assigned To: sebastien.deronne
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-29 16:17 UTC by sebastien.deronne
Modified: 2016-03-09 15:55 UTC (History)
2 users (show)

See Also:


Attachments
proposed fix to solve this bug (13.95 KB, patch)
2016-02-29 16:17 UTC, sebastien.deronne
Details | Diff
proposed fix to solve this bug (15.00 KB, patch)
2016-02-29 17:18 UTC, sebastien.deronne
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sebastien.deronne 2016-02-29 16:17:28 UTC
Created attachment 2312 [details]
proposed fix to solve this bug

GetDataTxVector is called at several places in MacLow while transmitting an A-MPDU.
In case the decision of the rate manager changes within a same A-MPDU, different TXVECTORs will be used for the same A-MPDU, which is not correct.
The attached patch adresses this bug.
Comment 1 sebastien.deronne 2016-02-29 17:18:17 UTC
Created attachment 2313 [details]
proposed fix to solve this bug

Fixes crashed test
Comment 2 Matías Richart 2016-03-01 07:20:27 UTC
The patch looks good.

Couldn't be also removed the call to GetDataTxVector in MacLow::AggregateToAmpdu?
The one below this comment: //VHT single MPDU operation
Comment 3 Matías Richart 2016-03-01 09:04:48 UTC
I found an issue.

When interchanging RTS/CTS before a transmission, the m_currentTxVector is updated with the TxVector of the CTS received.
Then the data is sent with this TxVector.

Perhaps a solution is to maintain different txVectors for send and receive.
Comment 4 sebastien.deronne 2016-03-01 16:05:33 UTC
(In reply to Matías Richart from comment #3)
> I found an issue.
> 
> When interchanging RTS/CTS before a transmission, the m_currentTxVector is
> updated with the TxVector of the CTS received.
> Then the data is sent with this TxVector.
> 
> Perhaps a solution is to maintain different txVectors for send and receive.

Indeed, this fixes the problem.

Another solution that avoids to keep both tx and rx vector is to move the setting of m_currentTxVector only when receive A-MPDUs, as follows:

diff -r 53de1ea14ea5 src/wifi/model/mac-low.cc
--- a/src/wifi/model/mac-low.cc	Tue Mar 01 21:57:36 2016 +0100
+++ b/src/wifi/model/mac-low.cc	Tue Mar 01 22:02:56 2016 +0100
@@ -2793,13 +2793,13 @@
 MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector, WifiPreamble preamble)
 {
   NS_LOG_FUNCTION (this);
-  m_currentTxVector = txVector;
   AmpduTag ampdu;
   bool normalAck = false;
   bool ampduSubframe = false; //flag indicating the packet belongs to an A-MPDU and is not a VHT single MPDU
   if (aggregatedPacket->RemovePacketTag (ampdu))
     {
       ampduSubframe = true;
+      m_currentTxVector = txVector;
       MpduAggregator::DeaggregatedMpdus packets = MpduAggregator::Deaggregate (aggregatedPacket);
       MpduAggregator::DeaggregatedMpdusCI n = packets.begin ();
 
For which solution do we go?
Comment 5 Matías Richart 2016-03-01 17:13:47 UTC
(In reply to sebastien.deronne from comment #4)
> (In reply to Matías Richart from comment #3)
> > I found an issue.
> > 
> > When interchanging RTS/CTS before a transmission, the m_currentTxVector is
> > updated with the TxVector of the CTS received.
> > Then the data is sent with this TxVector.
> > 
> > Perhaps a solution is to maintain different txVectors for send and receive.
> 
> Indeed, this fixes the problem.
> 
> Another solution that avoids to keep both tx and rx vector is to move the
> setting of m_currentTxVector only when receive A-MPDUs, as follows:
> 
> diff -r 53de1ea14ea5 src/wifi/model/mac-low.cc
> --- a/src/wifi/model/mac-low.cc	Tue Mar 01 21:57:36 2016 +0100
> +++ b/src/wifi/model/mac-low.cc	Tue Mar 01 22:02:56 2016 +0100
> @@ -2793,13 +2793,13 @@
>  MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double
> rxSnr, WifiTxVector txVector, WifiPreamble preamble)
>  {
>    NS_LOG_FUNCTION (this);
> -  m_currentTxVector = txVector;
>    AmpduTag ampdu;
>    bool normalAck = false;
>    bool ampduSubframe = false; //flag indicating the packet belongs to an
> A-MPDU and is not a VHT single MPDU
>    if (aggregatedPacket->RemovePacketTag (ampdu))
>      {
>        ampduSubframe = true;
> +      m_currentTxVector = txVector;
>        MpduAggregator::DeaggregatedMpdus packets =
> MpduAggregator::Deaggregate (aggregatedPacket);
>        MpduAggregator::DeaggregatedMpdusCI n = packets.begin ();
>  
> For which solution do we go?

Ok for me with your solution.
Comment 6 sebastien.deronne 2016-03-09 15:55:38 UTC
changeset 11993:ea08bf94248b