View | Details | Raw Unified | Return to bug 2577
Collapse All | Expand All

(-)a/src/wifi/model/edca-txop-n.cc (-1 / +1 lines)
 Lines 754-761    Link Here 
754
        }
754
        }
755
      if (GetAmpduExist (m_currentHdr.GetAddr1 ()) || m_currentHdr.IsQosData ())
755
      if (GetAmpduExist (m_currentHdr.GetAddr1 ()) || m_currentHdr.IsQosData ())
756
        {
756
        {
757
          m_low->FlushAggregateQueue ();
758
          uint8_t tid = GetTid (m_currentPacket, m_currentHdr);
757
          uint8_t tid = GetTid (m_currentPacket, m_currentHdr);
758
          m_low->FlushAggregateQueue (tid);
759
759
760
          if (GetBaAgreementExists (m_currentHdr.GetAddr1 (), tid))
760
          if (GetBaAgreementExists (m_currentHdr.GetAddr1 (), tid))
761
            {
761
            {
(-)a/src/wifi/model/mac-low.cc (-58 / +79 lines)
 Lines 366-372    Link Here 
366
    m_ctsToSelfSupported (false)
366
    m_ctsToSelfSupported (false)
367
{
367
{
368
  NS_LOG_FUNCTION (this);
368
  NS_LOG_FUNCTION (this);
369
  m_aggregateQueue = CreateObject<WifiMacQueue> ();
369
  for (uint8_t i = 0; i < 8; i++)
370
    {
371
      m_aggregateQueue[i] = CreateObject<WifiMacQueue> ();
372
    }
370
}
373
}
371
374
372
MacLow::~MacLow ()
375
MacLow::~MacLow ()
 Lines 427-433    Link Here 
427
      delete m_phyMacLowListener;
430
      delete m_phyMacLowListener;
428
      m_phyMacLowListener = 0;
431
      m_phyMacLowListener = 0;
429
    }
432
    }
430
  m_aggregateQueue = 0;
433
  for (uint8_t i = 0; i < 8; i++)
434
    {
435
      m_aggregateQueue[i] = 0;
436
    }
431
  m_ampdu = false;
437
  m_ampdu = false;
432
}
438
}
433
439
 Lines 729-760    Link Here 
729
   * QapScheduler has taken access to the channel from
735
   * QapScheduler has taken access to the channel from
730
   * one of the Edca of the QAP.
736
   * one of the Edca of the QAP.
731
   */
737
   */
732
  Ptr<Packet> newPacket = packet->Copy ();
738
  m_currentPacket = packet->Copy ();
733
  // remove the priority tag attached, if any
739
  // remove the priority tag attached, if any
734
  SocketPriorityTag priorityTag;
740
  SocketPriorityTag priorityTag;
735
  newPacket->RemovePacketTag (priorityTag);
741
  m_currentPacket->RemovePacketTag (priorityTag);
736
  WifiMacHeader newHdr = *hdr;
742
  m_currentHdr = *hdr;
737
  CancelAllEvents ();
743
  CancelAllEvents ();
738
  m_listener = listener;
744
  m_listener = listener;
739
  m_txParams = params;
745
  m_txParams = params;
746
  m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
747
  
748
  if (NeedRts ())
749
    {
750
      m_txParams.EnableRts ();
751
    }
752
  else
753
    {
754
      m_txParams.DisableRts ();
755
    }
740
756
741
  if (newHdr.IsMgt ()
757
  if (m_currentHdr.IsMgt ()
742
     || (!newHdr.IsQosData ()
758
     || (!m_currentHdr.IsQosData ()
743
     && !newHdr.IsBlockAck ()
759
     && !m_currentHdr.IsBlockAck ()
744
     && !newHdr.IsBlockAckReq ()))
760
     && !m_currentHdr.IsBlockAckReq ()))
745
    {
761
    {
746
      //This is mainly encountered when a higher priority control or management frame is
762
      //This is mainly encountered when a higher priority control or management frame is
747
      //sent between A-MPDU transmissions. It avoids to unexpectedly flush the aggregate
763
      //sent between A-MPDU transmissions. It avoids to unexpectedly flush the aggregate
748
      //queue when previous RTS request has failed.
764
      //queue when previous RTS request has failed.
749
      m_ampdu = false;
765
      m_ampdu = false;
750
      m_currentPacket = newPacket;
751
      m_currentHdr = newHdr;
752
    }
766
    }
753
  else if (m_aggregateQueue->GetSize () > 0)
767
  else if (m_currentHdr.IsQosData () && m_aggregateQueue[GetTid(packet, *hdr)]->GetSize () > 0)
754
    {
768
    {
755
      //m_aggregateQueue > 0 occurs when a RTS/CTS exchange failed before an A-MPDU transmission.
769
      //m_aggregateQueue > 0 occurs when a RTS/CTS exchange failed before an A-MPDU transmission.
756
      //In that case, we transmit the same A-MPDU as previously.
770
      //In that case, we transmit the same A-MPDU as previously.
757
      uint32_t sentMpdus = m_aggregateQueue->GetSize ();
771
      uint32_t sentMpdus = m_aggregateQueue[GetTid(packet, *hdr)]->GetSize ();
758
      m_ampdu = true;
772
      m_ampdu = true;
759
      if (sentMpdus > 1)
773
      if (sentMpdus > 1)
760
        {
774
        {
 Lines 765-776    Link Here 
765
          //VHT single MPDUs are followed by normal ACKs
779
          //VHT single MPDUs are followed by normal ACKs
766
          m_txParams.EnableAck ();
780
          m_txParams.EnableAck ();
767
        }
781
        }
782
      AcIndex ac = QosUtilsMapTidToAc (GetTid(packet, *hdr));
783
      std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
784
      Ptr<Packet> aggregatedPacket = Create<Packet> ();
785
      for (uint32_t i = 0; i < sentMpdus; i++)
786
        {
787
          Ptr<Packet> newPacket = (m_txPackets[GetTid(packet, *hdr)].at (i).packet)->Copy ();
788
          newPacket->AddHeader (m_txPackets[GetTid(packet, *hdr)].at (i).hdr);
789
          WifiMacTrailer fcs;
790
          newPacket->AddTrailer (fcs);
791
          listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, aggregatedPacket);
792
        }
793
      m_currentPacket = aggregatedPacket;
794
      m_currentHdr = (m_txPackets[GetTid(packet, *hdr)].at (0).hdr);
795
      m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
768
    }
796
    }
769
  else
797
  else
770
    {
798
    {
771
      //Perform MPDU aggregation if possible
799
      //Perform MPDU aggregation if possible
772
      m_currentPacket = newPacket;
773
      m_currentHdr = newHdr;
774
      m_ampdu = IsAmpdu (m_currentPacket, m_currentHdr);
800
      m_ampdu = IsAmpdu (m_currentPacket, m_currentHdr);
775
      if (m_ampdu)
801
      if (m_ampdu)
776
        {
802
        {
 Lines 787-802    Link Here 
787
            }
813
            }
788
        }
814
        }
789
    }
815
    }
790
  m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
791
    
792
  if (NeedRts ())
793
    {
794
      m_txParams.EnableRts ();
795
    }
796
  else
797
    {
798
      m_txParams.DisableRts ();
799
    }
800
816
801
  NS_LOG_DEBUG ("startTx size=" << GetSize (m_currentPacket, &m_currentHdr) <<
817
  NS_LOG_DEBUG ("startTx size=" << GetSize (m_currentPacket, &m_currentHdr) <<
802
                ", to=" << m_currentHdr.GetAddr1 () << ", listener=" << m_listener);
818
                ", to=" << m_currentHdr.GetAddr1 () << ", listener=" << m_listener);
 Lines 1003-1011    Link Here 
1003
          m_waitSifsEvent = Simulator::Schedule (GetSifs (),
1019
          m_waitSifsEvent = Simulator::Schedule (GetSifs (),
1004
                                                 &MacLow::WaitSifsAfterEndTx, this);
1020
                                                 &MacLow::WaitSifsAfterEndTx, this);
1005
        }
1021
        }
1006
1007
      FlushAggregateQueue ();
1008
      m_ampdu = false;
1022
      m_ampdu = false;
1023
      if (m_currentHdr.IsQosData ())
1024
        {
1025
          FlushAggregateQueue (m_currentHdr.GetQosTid ());
1026
        }
1009
    }
1027
    }
1010
  else if (hdr.IsBlockAck () && hdr.GetAddr1 () == m_self
1028
  else if (hdr.IsBlockAck () && hdr.GetAddr1 () == m_self
1011
           && (m_txParams.MustWaitBasicBlockAck () || m_txParams.MustWaitCompressedBlockAck ())
1029
           && (m_txParams.MustWaitBasicBlockAck () || m_txParams.MustWaitCompressedBlockAck ())
 Lines 1014-1026    Link Here 
1014
      NS_LOG_DEBUG ("got block ack from " << hdr.GetAddr2 ());
1032
      NS_LOG_DEBUG ("got block ack from " << hdr.GetAddr2 ());
1015
      SnrTag tag;
1033
      SnrTag tag;
1016
      packet->RemovePacketTag (tag);
1034
      packet->RemovePacketTag (tag);
1035
      FlushAggregateQueue (GetTid(packet, hdr));
1017
      CtrlBAckResponseHeader blockAck;
1036
      CtrlBAckResponseHeader blockAck;
1018
      packet->RemoveHeader (blockAck);
1037
      packet->RemoveHeader (blockAck);
1019
      m_blockAckTimeoutEvent.Cancel ();
1038
      m_blockAckTimeoutEvent.Cancel ();
1020
      NotifyAckTimeoutResetNow ();
1039
      NotifyAckTimeoutResetNow ();
1021
      m_listener->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, txVector.GetMode (), tag.Get ());
1040
      m_listener->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, txVector.GetMode (), tag.Get ());
1022
      m_ampdu = false;
1041
      m_ampdu = false;
1023
      FlushAggregateQueue ();
1024
    }
1042
    }
1025
  else if (hdr.IsBlockAckReq () && hdr.GetAddr1 () == m_self)
1043
  else if (hdr.IsBlockAckReq () && hdr.GetAddr1 () == m_self)
1026
    {
1044
    {
 Lines 1530-1536    Link Here 
1530
      Ptr <const Packet> dequeuedPacket;
1548
      Ptr <const Packet> dequeuedPacket;
1531
      WifiMacHeader newHdr;
1549
      WifiMacHeader newHdr;
1532
      WifiMacTrailer fcs;
1550
      WifiMacTrailer fcs;
1533
      uint32_t queueSize = m_aggregateQueue->GetSize ();
1551
      uint32_t queueSize = m_aggregateQueue[GetTid(packet, *hdr)]->GetSize ();
1534
      bool vhtSingleMpdu = false;
1552
      bool vhtSingleMpdu = false;
1535
      bool last = false;
1553
      bool last = false;
1536
      MpduType mpdutype = NORMAL_MPDU;
1554
      MpduType mpdutype = NORMAL_MPDU;
 Lines 1555-1561    Link Here 
1555
        }
1573
        }
1556
      for (; queueSize > 0; queueSize--)
1574
      for (; queueSize > 0; queueSize--)
1557
        {
1575
        {
1558
          dequeuedPacket = m_aggregateQueue->Dequeue (&newHdr);
1576
          dequeuedPacket = m_aggregateQueue[GetTid(packet, *hdr)]->Dequeue (&newHdr);
1559
          newPacket = dequeuedPacket->Copy ();
1577
          newPacket = dequeuedPacket->Copy ();
1560
          newHdr.SetDuration (hdr->GetDuration ());
1578
          newHdr.SetDuration (hdr->GetDuration ());
1561
          newPacket->AddHeader (newHdr);
1579
          newPacket->AddHeader (newHdr);
 Lines 1648-1654    Link Here 
1648
  MacLowTransmissionListener *listener = m_listener;
1666
  MacLowTransmissionListener *listener = m_listener;
1649
  m_listener = 0;
1667
  m_listener = 0;
1650
  m_ampdu = false;
1668
  m_ampdu = false;
1651
  FlushAggregateQueue ();
1669
  if (m_currentHdr.IsQosData ())
1670
    {
1671
      FlushAggregateQueue (GetTid(m_currentPacket, m_currentHdr));
1672
    }
1652
  listener->MissedAck ();
1673
  listener->MissedAck ();
1653
}
1674
}
1654
1675
 Lines 1678-1685    Link Here 
1678
  MacLowTransmissionListener *listener = m_listener;
1699
  MacLowTransmissionListener *listener = m_listener;
1679
  m_listener = 0;
1700
  m_listener = 0;
1680
  m_ampdu = false;
1701
  m_ampdu = false;
1681
  uint32_t nTxMpdus = m_aggregateQueue->GetSize ();
1702
  uint8_t tid= GetTid(m_currentPacket, m_currentHdr);
1682
  FlushAggregateQueue ();
1703
  uint32_t nTxMpdus = m_aggregateQueue[tid]->GetSize ();
1704
  FlushAggregateQueue (tid);
1683
  listener->MissedBlockAck (nTxMpdus);
1705
  listener->MissedBlockAck (nTxMpdus);
1684
}
1706
}
1685
1707
 Lines 2024-2040    Link Here 
2024
   */
2046
   */
2025
  NS_ASSERT (m_currentPacket != 0);
2047
  NS_ASSERT (m_currentPacket != 0);
2026
2048
2027
  if (m_aggregateQueue->GetSize () != 0)
2049
  if (m_currentHdr.IsQosData())
2028
    {
2050
    {
2029
      for (std::vector<Item>::size_type i = 0; i != m_txPackets.size (); i++)
2051
      uint8_t tid = GetTid(m_currentPacket, m_currentHdr);
2052
      if (m_aggregateQueue[GetTid(m_currentPacket, m_currentHdr)]->GetSize () != 0)
2030
        {
2053
        {
2031
          uint8_t tid = GetTid (m_txPackets.at (i).packet, m_txPackets.at (i).hdr);
2054
          for (std::vector<Item>::size_type i = 0; i != m_txPackets[tid].size (); i++)
2032
          AcIndex ac = QosUtilsMapTidToAc (tid);
2055
            {
2033
          std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
2056
              AcIndex ac = QosUtilsMapTidToAc (tid);
2034
2057
              std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
2035
          listenerIt->second->CompleteMpduTx (m_txPackets.at (i).packet, m_txPackets.at (i).hdr, m_txPackets.at (i).timestamp);
2058
              listenerIt->second->CompleteMpduTx (m_txPackets[tid].at (i).packet, m_txPackets[tid].at (i).hdr, m_txPackets[tid].at (i).timestamp);
2059
            }
2036
        }
2060
        }
2037
      m_txPackets.clear ();
2038
    }
2061
    }
2039
2062
2040
  StartDataTxTimers (m_currentTxVector);
2063
  StartDataTxTimers (m_currentTxVector);
 Lines 2690-2696    Link Here 
2690
Ptr<Packet>
2713
Ptr<Packet>
2691
MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr)
2714
MacLow::AggregateToAmpdu (Ptr<const Packet> packet, const WifiMacHeader hdr)
2692
{
2715
{
2693
  NS_ASSERT (m_aggregateQueue->GetSize () == 0);
2694
  bool isAmpdu = false;
2716
  bool isAmpdu = false;
2695
  Ptr<Packet> newPacket, tempPacket;
2717
  Ptr<Packet> newPacket, tempPacket;
2696
  WifiMacHeader peekedHdr;
2718
  WifiMacHeader peekedHdr;
 Lines 2755-2761    Link Here 
2755
                    {
2777
                    {
2756
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << currentSequenceNumber << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
2778
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << currentSequenceNumber << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
2757
                      i++;
2779
                      i++;
2758
                      m_aggregateQueue->Enqueue (aggPacket, peekedHdr);
2780
                      m_aggregateQueue[tid]->Enqueue (aggPacket, peekedHdr);
2759
                    }
2781
                    }
2760
                }
2782
                }
2761
              else if (hdr.IsBlockAckReq ())
2783
              else if (hdr.IsBlockAckReq ())
 Lines 2822-2828    Link Here 
2822
                  aggregated = listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2844
                  aggregated = listenerIt->second->GetMpduAggregator ()->Aggregate (newPacket, currentAggregatedPacket);
2823
                  if (aggregated)
2845
                  if (aggregated)
2824
                    {
2846
                    {
2825
                      m_aggregateQueue->Enqueue (aggPacket, peekedHdr);
2847
                      m_aggregateQueue[tid]->Enqueue (aggPacket, peekedHdr);
2826
                      if (i == 1 && hdr.IsQosData ())
2848
                      if (i == 1 && hdr.IsQosData ())
2827
                        {
2849
                        {
2828
                          if (!m_txParams.MustSendRts ())
2850
                          if (!m_txParams.MustSendRts ())
 Lines 2831-2837    Link Here 
2831
                            }
2853
                            }
2832
                          else
2854
                          else
2833
                            {
2855
                            {
2834
                              InsertInTxQueue (packet, hdr, tstamp);
2856
                              InsertInTxQueue (packet, hdr, tstamp, tid);
2835
                            }
2857
                            }
2836
                        }
2858
                        }
2837
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber () << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
2859
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber () << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
 Lines 2843-2849    Link Here 
2843
                        }
2865
                        }
2844
                      else
2866
                      else
2845
                        {
2867
                        {
2846
                          InsertInTxQueue (peekedPacket, peekedHdr, tstamp);
2868
                          InsertInTxQueue (peekedPacket, peekedHdr, tstamp, tid);
2847
                        }
2869
                        }
2848
                      if (retry)
2870
                      if (retry)
2849
                        {
2871
                        {
 Lines 2916-2922    Link Here 
2916
                      newPacket = packet->Copy ();
2938
                      newPacket = packet->Copy ();
2917
                      peekedHdr = hdr;
2939
                      peekedHdr = hdr;
2918
                      Ptr<Packet> aggPacket = newPacket->Copy ();
2940
                      Ptr<Packet> aggPacket = newPacket->Copy ();
2919
                      m_aggregateQueue->Enqueue (aggPacket, peekedHdr);
2941
                      m_aggregateQueue[tid]->Enqueue (aggPacket, peekedHdr);
2920
                      newPacket->AddHeader (peekedHdr);
2942
                      newPacket->AddHeader (peekedHdr);
2921
                      WifiMacTrailer fcs;
2943
                      WifiMacTrailer fcs;
2922
                      newPacket->AddTrailer (fcs);
2944
                      newPacket->AddTrailer (fcs);
 Lines 2941-2952    Link Here 
2941
                }
2963
                }
2942
              else
2964
              else
2943
                {
2965
                {
2944
                  uint32_t queueSize = m_aggregateQueue->GetSize ();
2966
                  uint32_t queueSize = m_aggregateQueue[tid]->GetSize ();
2945
                  NS_ASSERT (queueSize <= 2); //since it is not an A-MPDU then only 2 packets should have been added to the queue no more
2967
                  NS_ASSERT (queueSize <= 2); //since it is not an A-MPDU then only 2 packets should have been added to the queue no more
2946
                  if (queueSize >= 1)
2968
                  if (queueSize >= 1)
2947
                    {
2969
                    {
2948
                      //remove any packets that we added to the aggregate queue
2970
                      //remove any packets that we added to the aggregate queue
2949
                      FlushAggregateQueue ();
2971
                      FlushAggregateQueue (tid);
2950
                    }
2972
                    }
2951
                }
2973
                }
2952
            }
2974
            }
 Lines 2959-2965    Link Here 
2959
2981
2960
              currentAggregatedPacket = Create<Packet> ();
2982
              currentAggregatedPacket = Create<Packet> ();
2961
              listenerIt->second->GetMpduAggregator ()->AggregateVhtSingleMpdu (packet, currentAggregatedPacket);
2983
              listenerIt->second->GetMpduAggregator ()->AggregateVhtSingleMpdu (packet, currentAggregatedPacket);
2962
              m_aggregateQueue->Enqueue (packet, peekedHdr);
2984
              m_aggregateQueue[tid]->Enqueue (packet, peekedHdr);
2963
2985
2964
              if (listenerIt->second->GetBlockAckAgreementExists (hdr.GetAddr1 (), tid))
2986
              if (listenerIt->second->GetBlockAckAgreementExists (hdr.GetAddr1 (), tid))
2965
                {
2987
                {
 Lines 2984-3009    Link Here 
2984
}
3006
}
2985
3007
2986
void
3008
void
2987
MacLow::FlushAggregateQueue (void)
3009
MacLow::FlushAggregateQueue (uint8_t tid)
2988
{
3010
{
2989
  if (m_aggregateQueue->GetSize () > 0)
3011
  if (m_aggregateQueue[tid]->GetSize () > 0)
2990
    {
3012
    {
2991
      NS_LOG_DEBUG ("Flush aggregate queue");
3013
      NS_LOG_DEBUG ("Flush aggregate queue");
2992
      m_aggregateQueue->Flush ();
3014
      m_aggregateQueue[tid]->Flush ();
2993
    }
3015
    }
2994
  m_txPackets.clear ();
3016
  m_txPackets[tid].clear ();
2995
}
3017
}
2996
3018
2997
void
3019
void
2998
MacLow::InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp)
3020
MacLow::InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid)
2999
{
3021
{
3022
  NS_LOG_FUNCTION (this);
3000
  Item item;
3023
  Item item;
3001
3002
  item.packet = packet;
3024
  item.packet = packet;
3003
  item.hdr = hdr;
3025
  item.hdr = hdr;
3004
  item.timestamp = tStamp;
3026
  item.timestamp = tStamp;
3005
3027
  m_txPackets[tid].push_back (item);
3006
  m_txPackets.push_back (item);
3007
}
3028
}
3008
3029
3009
Ptr<Packet>
3030
Ptr<Packet>
(-)a/src/wifi/model/mac-low.h (-6 / +7 lines)
 Lines 811-817    Link Here 
811
   * This function is called to flush the aggregate queue, which is used for A-MPDU
811
   * This function is called to flush the aggregate queue, which is used for A-MPDU
812
   *
812
   *
813
   */
813
   */
814
  void FlushAggregateQueue (void);
814
  void FlushAggregateQueue (uint8_t tid);
815
815
816
  /**
816
  /**
817
   * Return a TXVECTOR for the DATA frame given the destination.
817
   * Return a TXVECTOR for the DATA frame given the destination.
 Lines 1258-1264    Link Here 
1258
   * Insert in a temporary queue.
1258
   * Insert in a temporary queue.
1259
   * It is only used with a RTS/CTS exchange for an A-MPDU transmission.
1259
   * It is only used with a RTS/CTS exchange for an A-MPDU transmission.
1260
   */
1260
   */
1261
  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp);
1261
  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint8_t tid);
1262
  /**
1262
  /**
1263
   * Perform MSDU aggregation for a given MPDU in an A-MPDU
1263
   * Perform MSDU aggregation for a given MPDU in an A-MPDU
1264
   *
1264
   *
 Lines 1354-1363    Link Here 
1354
1354
1355
  typedef std::map<AcIndex, MacLowAggregationCapableTransmissionListener*> QueueListeners;
1355
  typedef std::map<AcIndex, MacLowAggregationCapableTransmissionListener*> QueueListeners;
1356
  QueueListeners m_edcaListeners;
1356
  QueueListeners m_edcaListeners;
1357
  bool m_ctsToSelfSupported;          //!< Flag whether CTS-to-self is supported
1357
1358
  Ptr<WifiMacQueue> m_aggregateQueue; //!< Queue used for MPDU aggregation
1358
  bool m_ctsToSelfSupported;             //!< Flag whether CTS-to-self is supported
1359
  WifiTxVector m_currentTxVector;     //!< TXVECTOR used for the current packet transmission
1359
  Ptr<WifiMacQueue> m_aggregateQueue[8]; //!< Queues per TID used for MPDU aggregation
1360
  std::vector<Item> m_txPackets;      //!< Contain temporary items to be sent with the next A-MPDU transmission, once RTS/CTS exchange has succeeded. It is not used in other cases.
1360
  std::vector<Item> m_txPackets[8];      //!< Contain temporary items to be sent with the next A-MPDU transmission for a given TID, once RTS/CTS exchange has succeeded.
1361
  WifiTxVector m_currentTxVector;        //!< TXVECTOR used for the current packet transmission
1361
};
1362
};
1362
1363
1363
} //namespace ns3
1364
} //namespace ns3
(-)a/src/wifi/test/wifi-aggregation-test.cc (-5 / +5 lines)
 Lines 143-149    Link Here 
143
143
144
  bool isAmpdu = m_low->IsAmpdu (pkt, hdr);
144
  bool isAmpdu = m_low->IsAmpdu (pkt, hdr);
145
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet should not result in an A-MPDU");
145
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet should not result in an A-MPDU");
146
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue->GetSize (), 0, "aggregation queue is not flushed");
146
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetSize (), 0, "aggregation queue is not flushed");
147
147
148
  //-----------------------------------------------------------------------------------------------------
148
  //-----------------------------------------------------------------------------------------------------
149
149
 Lines 168-174    Link Here 
168
  m_edca->GetEdcaQueue ()->Enqueue (pkt2, hdr2);
168
  m_edca->GetEdcaQueue ()->Enqueue (pkt2, hdr2);
169
169
170
  isAmpdu = m_low->IsAmpdu (pkt, hdr);
170
  isAmpdu = m_low->IsAmpdu (pkt, hdr);
171
  uint32_t aggregationQueueSize = m_low->m_aggregateQueue->GetSize ();
171
  uint32_t aggregationQueueSize = m_low->m_aggregateQueue[0]->GetSize ();
172
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, true, "MPDU aggregation failed");
172
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, true, "MPDU aggregation failed");
173
  NS_TEST_EXPECT_MSG_EQ (m_low->m_currentPacket->GetSize (), 4606, "A-MPDU size is not correct");
173
  NS_TEST_EXPECT_MSG_EQ (m_low->m_currentPacket->GetSize (), 4606, "A-MPDU size is not correct");
174
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 3, "aggregation queue should not be empty");
174
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 3, "aggregation queue should not be empty");
 Lines 179-185    Link Here 
179
  uint32_t i = 0;
179
  uint32_t i = 0;
180
  for (; aggregationQueueSize > 0; aggregationQueueSize--, i++)
180
  for (; aggregationQueueSize > 0; aggregationQueueSize--, i++)
181
  {
181
  {
182
    dequeuedPacket = m_low->m_aggregateQueue->Dequeue (&dequeuedHdr);
182
    dequeuedPacket = m_low->m_aggregateQueue[0]->Dequeue (&dequeuedHdr);
183
    NS_TEST_EXPECT_MSG_EQ (dequeuedHdr.GetSequenceNumber (), i, "wrong sequence number");
183
    NS_TEST_EXPECT_MSG_EQ (dequeuedHdr.GetSequenceNumber (), i, "wrong sequence number");
184
  }
184
  }
185
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 0, "aggregation queue should be empty");
185
  NS_TEST_EXPECT_MSG_EQ (aggregationQueueSize, 0, "aggregation queue should be empty");
 Lines 215-227    Link Here 
215
  
215
  
216
  isAmpdu = m_low->IsAmpdu (pkt1, hdr1);
216
  isAmpdu = m_low->IsAmpdu (pkt1, hdr1);
217
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet for this destination should not result in an A-MPDU");
217
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "a single packet for this destination should not result in an A-MPDU");
218
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue->GetSize (), 0, "aggregation queue is not flushed");
218
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetSize (), 0, "aggregation queue is not flushed");
219
  
219
  
220
  m_edca->m_currentHdr = hdr2;
220
  m_edca->m_currentHdr = hdr2;
221
  m_edca->m_currentPacket = pkt2->Copy ();
221
  m_edca->m_currentPacket = pkt2->Copy ();
222
  isAmpdu = m_low->IsAmpdu (pkt2, hdr2);
222
  isAmpdu = m_low->IsAmpdu (pkt2, hdr2);
223
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "no MPDU aggregation should be performed if there is no agreement");
223
  NS_TEST_EXPECT_MSG_EQ (isAmpdu, false, "no MPDU aggregation should be performed if there is no agreement");
224
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue->GetSize (), 0, "aggregation queue is not flushed");
224
  NS_TEST_EXPECT_MSG_EQ (m_low->m_aggregateQueue[0]->GetSize (), 0, "aggregation queue is not flushed");
225
  
225
  
226
  m_manager->SetMaxSlrc (0); //set to 0 in order to fake that the maximum number of retries has been reached
226
  m_manager->SetMaxSlrc (0); //set to 0 in order to fake that the maximum number of retries has been reached
227
  m_edca->MissedAck();
227
  m_edca->MissedAck();

Return to bug 2577