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

(-)a/src/wifi/model/block-ack-manager.cc (-12 / +24 lines)
 Lines 41-52    Link Here 
41
  NS_LOG_FUNCTION (this);
41
  NS_LOG_FUNCTION (this);
42
}
42
}
43
43
44
BlockAckManager::Item::Item (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp)
44
BlockAckManager::Item::Item (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint32_t nRetries)
45
  : packet (packet),
45
  : packet (packet),
46
    hdr (hdr),
46
    hdr (hdr),
47
    timestamp (tStamp)
47
    timestamp (tStamp),
48
    nRetries (nRetries)
48
{
49
{
49
  NS_LOG_FUNCTION (this << packet << hdr << tStamp);
50
  NS_LOG_FUNCTION (this << packet << hdr << tStamp << nRetries);
50
}
51
}
51
52
52
Bar::Bar ()
53
Bar::Bar ()
 Lines 206-212    Link Here 
206
}
207
}
207
208
208
void
209
void
209
BlockAckManager::StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp)
210
BlockAckManager::StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint32_t nRetries)
210
{
211
{
211
  NS_LOG_FUNCTION (this << packet << hdr << tStamp);
212
  NS_LOG_FUNCTION (this << packet << hdr << tStamp);
212
  NS_ASSERT (hdr.IsQosData ());
213
  NS_ASSERT (hdr.IsQosData ());
 Lines 214-220    Link Here 
214
  uint8_t tid = hdr.GetQosTid ();
215
  uint8_t tid = hdr.GetQosTid ();
215
  Mac48Address recipient = hdr.GetAddr1 ();
216
  Mac48Address recipient = hdr.GetAddr1 ();
216
217
217
  Item item (packet, hdr, tStamp);
218
  Item item (packet, hdr, tStamp, nRetries);
218
  AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
219
  AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
219
  NS_ASSERT (it != m_agreements.end ());
220
  NS_ASSERT (it != m_agreements.end ());
220
  PacketQueueI queueIt = it->second.second.begin ();
221
  PacketQueueI queueIt = it->second.second.begin ();
 Lines 285-291    Link Here 
285
          packet = (*it)->packet->Copy ();
286
          packet = (*it)->packet->Copy ();
286
          hdr = (*it)->hdr;
287
          hdr = (*it)->hdr;
287
          hdr.SetRetry ();
288
          hdr.SetRetry ();
288
          NS_LOG_INFO ("Retry packet seq = " << hdr.GetSequenceNumber ());
289
          NS_LOG_INFO ("Retry packet seq = " << hdr.GetSequenceNumber () << " nRetries = " << (*it)->nRetries);
289
          if (hdr.IsQosData ())
290
          if (hdr.IsQosData ())
290
            {
291
            {
291
              tid = hdr.GetQosTid ();
292
              tid = hdr.GetQosTid ();
 Lines 324-330    Link Here 
324
325
325
326
326
Ptr<const Packet>
327
Ptr<const Packet>
327
BlockAckManager::PeekNextPacket (WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *tstamp)
328
BlockAckManager::PeekNextPacket (WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *tstamp, uint32_t *nRetries)
328
{
329
{
329
  NS_LOG_FUNCTION (this);
330
  NS_LOG_FUNCTION (this);
330
  Ptr<const Packet> packet = 0;
331
  Ptr<const Packet> packet = 0;
 Lines 357-363    Link Here 
357
          hdr = (*it)->hdr;
358
          hdr = (*it)->hdr;
358
          hdr.SetRetry ();
359
          hdr.SetRetry ();
359
          *tstamp = (*it)->timestamp;
360
          *tstamp = (*it)->timestamp;
360
          NS_LOG_INFO ("Retry packet seq = " << hdr.GetSequenceNumber ());
361
          *nRetries = (*it)->nRetries;
362
          NS_LOG_INFO ("Retry packet seq = " << hdr.GetSequenceNumber () << " nRetries = " << (*it)->nRetries);
361
          Mac48Address recipient = hdr.GetAddr1 ();
363
          Mac48Address recipient = hdr.GetAddr1 ();
362
          if (!agreement->second.first.IsHtSupported ()
364
          if (!agreement->second.first.IsHtSupported ()
363
              && (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)
365
              && (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)
 Lines 569-575    Link Here 
569
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
571
                          (*it).second.first.SetStartingSequence (sequenceFirstLost);
570
                        }
572
                        }
571
573
572
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (),recipient,tid))
574
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (), recipient, tid))
573
                        {
575
                        {
574
                          InsertInRetryQueue (queueIt);
576
                          InsertInRetryQueue (queueIt);
575
                        }
577
                        }
 Lines 611-621    Link Here 
611
                        {
613
                        {
612
                          m_txFailedCallback ((*queueIt).hdr);
614
                          m_txFailedCallback ((*queueIt).hdr);
613
                        }
615
                        }
614
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (),recipient,tid))
616
                      if (!AlreadyExists ((*queueIt).hdr.GetSequenceNumber (), recipient, tid))
615
                        {
617
                        {
616
                          InsertInRetryQueue (queueIt);
618
                          if ((*queueIt).nRetries >= m_stationManager->GetMaxSlrc ())
619
                            {
620
                              NS_LOG_INFO ("Remove packet with seq = " << (*queueIt).hdr.GetSequenceNumber ());
621
                              (*it).second.first.SetStartingSequence ((*queueIt).hdr.GetSequenceNumber ());
622
                              queueIt = it->second.second.erase (queueIt);
623
                            }
624
                          else
625
                            {
626
                              InsertInRetryQueue (queueIt);
627
                              queueIt++;
628
                            }
617
                        }
629
                        }
618
                      queueIt++;
619
                    }
630
                    }
620
                }
631
                }
621
            }
632
            }
 Lines 931-936    Link Here 
931
BlockAckManager::InsertInRetryQueue (PacketQueueI item)
942
BlockAckManager::InsertInRetryQueue (PacketQueueI item)
932
{
943
{
933
  NS_LOG_INFO ("Adding to retry queue " << (*item).hdr.GetSequenceNumber ());
944
  NS_LOG_INFO ("Adding to retry queue " << (*item).hdr.GetSequenceNumber ());
945
  (*item).nRetries++;
934
  if (m_retryPackets.size () == 0)
946
  if (m_retryPackets.size () == 0)
935
    {
947
    {
936
      m_retryPackets.push_back (item);
948
      m_retryPackets.push_back (item);
(-)a/src/wifi/model/block-ack-manager.h (-3 / +6 lines)
 Lines 138-148    Link Here 
138
   * \param packet Packet to store.
138
   * \param packet Packet to store.
139
   * \param hdr 802.11 header for packet.
139
   * \param hdr 802.11 header for packet.
140
   * \param tStamp time stamp for packet
140
   * \param tStamp time stamp for packet
141
   * \param nRetries number of retries for packet
141
   *
142
   *
142
   * Stores <i>packet</i> for a possible future retransmission. Retransmission occurs
143
   * Stores <i>packet</i> for a possible future retransmission. Retransmission occurs
143
   * if the packet, in a block ack frame, is indicated by recipient as not received.
144
   * if the packet, in a block ack frame, is indicated by recipient as not received.
144
   */
145
   */
145
  void StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp);
146
  void StorePacket (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint32_t nRetries);
146
  /**
147
  /**
147
   * \param hdr 802.11 header of returned packet (if exists).
148
   * \param hdr 802.11 header of returned packet (if exists).
148
   *
149
   *
 Lines 320-326    Link Here 
320
  /*
321
  /*
321
   * Peek in retransmit queue and get the next packet without removing it from the queue
322
   * Peek in retransmit queue and get the next packet without removing it from the queue
322
   */
323
   */
323
  Ptr<const Packet> PeekNextPacket (WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *timestamp);
324
  Ptr<const Packet> PeekNextPacket (WifiMacHeader &hdr, Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries);
324
  /**
325
  /**
325
   * This function returns true if the lifetime of the packets a BAR refers to didn't expire yet else it returns false.
326
   * This function returns true if the lifetime of the packets a BAR refers to didn't expire yet else it returns false.
326
   * If it return false then the BAR will be discarded (i.e. will not be re-transmitted)
327
   * If it return false then the BAR will be discarded (i.e. will not be re-transmitted)
 Lines 407-416    Link Here 
407
    Item ();
408
    Item ();
408
    Item (Ptr<const Packet> packet,
409
    Item (Ptr<const Packet> packet,
409
          const WifiMacHeader &hdr,
410
          const WifiMacHeader &hdr,
410
          Time tStamp);
411
          Time tStamp,
412
          uint32_t nRetries);
411
    Ptr<const Packet> packet;
413
    Ptr<const Packet> packet;
412
    WifiMacHeader hdr;
414
    WifiMacHeader hdr;
413
    Time timestamp;
415
    Time timestamp;
416
    uint32_t nRetries;
414
  };
417
  };
415
  /**
418
  /**
416
   * \param item
419
   * \param item
(-)a/src/wifi/model/edca-txop-n.cc (-11 / +70 lines)
 Lines 168-176    Link Here 
168
  {
168
  {
169
    return m_txop->SetAmpduExist (ampdu);
169
    return m_txop->SetAmpduExist (ampdu);
170
  }
170
  }
171
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
171
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp, uint32_t nRetries)
172
  {
172
  {
173
    m_txop->CompleteMpduTx (packet, hdr, tstamp);
173
    m_txop->CompleteMpduTx (packet, hdr, tstamp, nRetries);
174
  }
174
  }
175
  virtual uint16_t GetNextSequenceNumberfor (WifiMacHeader *hdr)
175
  virtual uint16_t GetNextSequenceNumberfor (WifiMacHeader *hdr)
176
  {
176
  {
 Lines 180-188    Link Here 
180
  {
180
  {
181
    return m_txop->PeekNextSequenceNumberfor (hdr);
181
    return m_txop->PeekNextSequenceNumberfor (hdr);
182
  }
182
  }
183
  virtual Ptr<const Packet> PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp)
183
  virtual Ptr<const Packet> PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries)
184
  {
184
  {
185
    return m_txop->PeekNextRetransmitPacket (header, recipient, tid, timestamp);
185
    return m_txop->PeekNextRetransmitPacket (header, recipient, tid, timestamp, nRetries);
186
  }
186
  }
187
  virtual void RemoveFromBaQueue (uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
187
  virtual void RemoveFromBaQueue (uint8_t tid, Mac48Address recipient, uint16_t seqnumber)
188
  {
188
  {
 Lines 450-458    Link Here 
450
}
450
}
451
451
452
Ptr<const Packet>
452
Ptr<const Packet>
453
EdcaTxopN::PeekNextRetransmitPacket (WifiMacHeader &header,Mac48Address recipient, uint8_t tid, Time *timestamp)
453
EdcaTxopN::PeekNextRetransmitPacket (WifiMacHeader &header,Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries)
454
{
454
{
455
  return m_baManager->PeekNextPacket (header,recipient,tid, timestamp);
455
  return m_baManager->PeekNextPacket (header,recipient,tid, timestamp, nRetries);
456
}
456
}
457
457
458
void
458
void
 Lines 1227-1234    Link Here 
1227
    {
1227
    {
1228
      m_txOkCallback (m_currentHdr);
1228
      m_txOkCallback (m_currentHdr);
1229
    }
1229
    }
1230
  m_currentPacket = 0;
1230
  if (NeedBarRetransmission ())
1231
  m_dcf->ResetCw ();
1231
    {
1232
      if (!GetAmpduExist ())
1233
        {
1234
          //should i report this to station addressed by ADDR1?
1235
          NS_LOG_DEBUG ("Retransmit block ack request");
1236
          m_currentHdr.SetRetry ();
1237
        }
1238
      else
1239
        {
1240
          //standard says when loosing a BlockAck originator may send a BAR page 139
1241
          NS_LOG_DEBUG ("Transmit Block Ack Request");
1242
          CtrlBAckRequestHeader reqHdr;
1243
          reqHdr.SetType (COMPRESSED_BLOCK_ACK);
1244
          uint8_t tid = 0;
1245
          if (m_currentHdr.IsQosData ())
1246
            {
1247
              tid = m_currentHdr.GetQosTid ();
1248
              reqHdr.SetStartingSequence (m_currentHdr.GetSequenceNumber ());
1249
            }
1250
          else if (m_currentHdr.IsBlockAckReq ())
1251
            {
1252
              CtrlBAckRequestHeader baReqHdr;
1253
              m_currentPacket->PeekHeader (baReqHdr);
1254
              tid = baReqHdr.GetTidInfo ();
1255
              reqHdr.SetStartingSequence (baReqHdr.GetStartingSequence ());
1256
            }
1257
          else if (m_currentHdr.IsBlockAck ())
1258
            {
1259
              CtrlBAckResponseHeader baRespHdr;
1260
              m_currentPacket->PeekHeader (baRespHdr);
1261
              tid = baRespHdr.GetTidInfo ();
1262
              reqHdr.SetStartingSequence (m_currentHdr.GetSequenceNumber ());
1263
            }
1264
          reqHdr.SetTidInfo (tid);
1265
          reqHdr.SetHtImmediateAck (true);
1266
          Ptr<Packet> bar = Create<Packet> ();
1267
          bar->AddHeader (reqHdr);
1268
          Bar request (bar, m_currentHdr.GetAddr1 (), tid, reqHdr.MustSendHtImmediateAck ());
1269
          m_currentBar = request;
1270
          WifiMacHeader hdr;
1271
          hdr.SetType (WIFI_MAC_CTL_BACKREQ);
1272
          hdr.SetAddr1 (request.recipient);
1273
          hdr.SetAddr2 (m_low->GetAddress ());
1274
          hdr.SetAddr3 (m_low->GetBssid ());
1275
          hdr.SetDsNotTo ();
1276
          hdr.SetDsNotFrom ();
1277
          hdr.SetNoRetry ();
1278
          hdr.SetNoMoreFragments ();
1279
1280
          m_currentPacket = request.bar;
1281
          m_currentHdr = hdr;
1282
        }
1283
      m_dcf->UpdateFailedCw ();
1284
    }
1285
  else
1286
    {
1287
      //to reset the dcf.
1288
      m_currentPacket = 0;
1289
      m_dcf->ResetCw ();
1290
    }
1232
  m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
1291
  m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
1233
  RestartAccessIfNeeded ();
1292
  RestartAccessIfNeeded ();
1234
}
1293
}
 Lines 1268-1274    Link Here 
1268
    {
1327
    {
1269
      if (!m_currentHdr.IsRetry ())
1328
      if (!m_currentHdr.IsRetry ())
1270
        {
1329
        {
1271
          m_baManager->StorePacket (m_currentPacket, m_currentHdr, m_currentPacketTimestamp);
1330
          m_baManager->StorePacket (m_currentPacket, m_currentHdr, m_currentPacketTimestamp, 0);
1272
        }
1331
        }
1273
      m_baManager->NotifyMpduTransmission (m_currentHdr.GetAddr1 (), m_currentHdr.GetQosTid (),
1332
      m_baManager->NotifyMpduTransmission (m_currentHdr.GetAddr1 (), m_currentHdr.GetQosTid (),
1274
                                           m_txMiddle->GetNextSeqNumberByTidAndAddress (m_currentHdr.GetQosTid (),
1333
                                           m_txMiddle->GetNextSeqNumberByTidAndAddress (m_currentHdr.GetQosTid (),
 Lines 1277-1286    Link Here 
1277
}
1336
}
1278
1337
1279
void
1338
void
1280
EdcaTxopN::CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
1339
EdcaTxopN::CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp, uint32_t nRetries)
1281
{
1340
{
1282
  NS_ASSERT (hdr.IsQosData ());
1341
  NS_ASSERT (hdr.IsQosData ());
1283
  m_baManager->StorePacket (packet, hdr, tstamp);
1342
  m_baManager->StorePacket (packet, hdr, tstamp, nRetries);
1284
  m_baManager->NotifyMpduTransmission (hdr.GetAddr1 (), hdr.GetQosTid (),
1343
  m_baManager->NotifyMpduTransmission (hdr.GetAddr1 (), hdr.GetQosTid (),
1285
                                       m_txMiddle->GetNextSeqNumberByTidAndAddress (hdr.GetQosTid (),
1344
                                       m_txMiddle->GetNextSeqNumberByTidAndAddress (hdr.GetQosTid (),
1286
                                                                                    hdr.GetAddr1 ()), WifiMacHeader::NORMAL_ACK);
1345
                                                                                    hdr.GetAddr1 ()), WifiMacHeader::NORMAL_ACK);
(-)a/src/wifi/model/edca-txop-n.h (-2 / +2 lines)
 Lines 407-413    Link Here 
407
407
408
  void SetBlockAckInactivityTimeout (uint16_t timeout);
408
  void SetBlockAckInactivityTimeout (uint16_t timeout);
409
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
409
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
410
  void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp);
410
  void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp, uint32_t nRetries);
411
  bool GetAmpduExist (void);
411
  bool GetAmpduExist (void);
412
  void SetAmpduExist (bool ampdu);
412
  void SetAmpduExist (bool ampdu);
413
413
 Lines 434-440    Link Here 
434
  /*
434
  /*
435
   * Peek in retransmit queue and get the next packet without removing it from the queue
435
   * Peek in retransmit queue and get the next packet without removing it from the queue
436
   */
436
   */
437
  Ptr<const Packet> PeekNextRetransmitPacket (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp);
437
  Ptr<const Packet> PeekNextRetransmitPacket (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries);
438
  /**
438
  /**
439
   * The packet we sent was successfully received by the receiver
439
   * The packet we sent was successfully received by the receiver
440
   *
440
   *
(-)a/src/wifi/model/mac-low.cc (-10 / +13 lines)
 Lines 79-85    Link Here 
79
{
79
{
80
}
80
}
81
void
81
void
82
MacLowAggregationCapableTransmissionListener::CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
82
MacLowAggregationCapableTransmissionListener::CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp, uint32_t nRetries)
83
{
83
{
84
}
84
}
85
uint16_t
85
uint16_t
 Lines 93-99    Link Here 
93
  return 0;
93
  return 0;
94
}
94
}
95
Ptr<const Packet>
95
Ptr<const Packet>
96
MacLowAggregationCapableTransmissionListener::PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp)
96
MacLowAggregationCapableTransmissionListener::PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries)
97
{
97
{
98
  return 0;
98
  return 0;
99
}
99
}
 Lines 2230-2236    Link Here 
2230
          AcIndex ac = QosUtilsMapTidToAc (tid);
2230
          AcIndex ac = QosUtilsMapTidToAc (tid);
2231
          std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
2231
          std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac);
2232
2232
2233
          listenerIt->second->CompleteMpduTx (m_txPackets.at (i).packet, m_txPackets.at (i).hdr, m_txPackets.at (i).timestamp);
2233
          listenerIt->second->CompleteMpduTx (m_txPackets.at (i).packet, m_txPackets.at (i).hdr, m_txPackets.at (i).timestamp, m_txPackets.at (i).nRetries);
2234
        }
2234
        }
2235
      m_txPackets.clear ();
2235
      m_txPackets.clear ();
2236
    }
2236
    }
 Lines 2944-2949    Link Here 
2944
  if (hdr.IsQosData () || hdr.IsBlockAck ()|| hdr.IsBlockAckReq ())
2944
  if (hdr.IsQosData () || hdr.IsBlockAck ()|| hdr.IsBlockAckReq ())
2945
    {
2945
    {
2946
      Time tstamp;
2946
      Time tstamp;
2947
      uint32_t nRetries;
2947
      uint8_t tid = GetTid (packet, hdr);
2948
      uint8_t tid = GetTid (packet, hdr);
2948
      Ptr<WifiMacQueue> queue;
2949
      Ptr<WifiMacQueue> queue;
2949
      AcIndex ac = QosUtilsMapTidToAc (tid);
2950
      AcIndex ac = QosUtilsMapTidToAc (tid);
 Lines 3001-3007    Link Here 
3001
              aggregated = false;
3002
              aggregated = false;
3002
              bool retry = false;
3003
              bool retry = false;
3003
              //looks for other packets to the same destination with the same Tid need to extend that to include MSDUs
3004
              //looks for other packets to the same destination with the same Tid need to extend that to include MSDUs
3004
              Ptr<const Packet> peekedPacket = listenerIt->second->PeekNextPacketInBaQueue (peekedHdr, peekedHdr.GetAddr1 (), tid, &tstamp);
3005
              Ptr<const Packet> peekedPacket = listenerIt->second->PeekNextPacketInBaQueue (peekedHdr, peekedHdr.GetAddr1 (), tid, &tstamp, &nRetries);
3005
              if (peekedPacket == 0)
3006
              if (peekedPacket == 0)
3006
                {
3007
                {
3007
                  peekedPacket = queue->PeekByTidAndAddress (&peekedHdr, tid,
3008
                  peekedPacket = queue->PeekByTidAndAddress (&peekedHdr, tid,
 Lines 3035-3040    Link Here 
3035
                      peekedHdr.SetFragmentNumber (0);
3036
                      peekedHdr.SetFragmentNumber (0);
3036
                      peekedHdr.SetNoMoreFragments ();
3037
                      peekedHdr.SetNoMoreFragments ();
3037
                      peekedHdr.SetNoRetry ();
3038
                      peekedHdr.SetNoRetry ();
3039
                      nRetries = 0;
3038
                    }
3040
                    }
3039
                  if (qosPolicy == 0)
3041
                  if (qosPolicy == 0)
3040
                    {
3042
                    {
 Lines 3059-3069    Link Here 
3059
                        {
3061
                        {
3060
                          if (!m_txParams.MustSendRts ())
3062
                          if (!m_txParams.MustSendRts ())
3061
                            {
3063
                            {
3062
                              listenerIt->second->CompleteMpduTx (packet, hdr, tstamp);
3064
                              listenerIt->second->CompleteMpduTx (packet, hdr, tstamp, nRetries);
3063
                            }
3065
                            }
3064
                          else
3066
                          else
3065
                            {
3067
                            {
3066
                              InsertInTxQueue (packet, hdr, tstamp);
3068
                              InsertInTxQueue (packet, hdr, tstamp, nRetries);
3067
                            }
3069
                            }
3068
                        }
3070
                        }
3069
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber () << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
3071
                      NS_LOG_DEBUG ("Adding packet with Sequence number " << peekedHdr.GetSequenceNumber () << " to A-MPDU, packet size = " << newPacket->GetSize () << ", A-MPDU size = " << currentAggregatedPacket->GetSize ());
 Lines 3072-3082    Link Here 
3072
                      m_sentMpdus++;
3074
                      m_sentMpdus++;
3073
                      if (!m_txParams.MustSendRts ())
3075
                      if (!m_txParams.MustSendRts ())
3074
                        {
3076
                        {
3075
                          listenerIt->second->CompleteMpduTx (peekedPacket, peekedHdr, tstamp);
3077
                          listenerIt->second->CompleteMpduTx (peekedPacket, peekedHdr, tstamp, nRetries);
3076
                        }
3078
                        }
3077
                      else
3079
                      else
3078
                        {
3080
                        {
3079
                          InsertInTxQueue (peekedPacket, peekedHdr, tstamp);
3081
                          InsertInTxQueue (peekedPacket, peekedHdr, tstamp, nRetries);
3080
                        }
3082
                        }
3081
                      if (retry)
3083
                      if (retry)
3082
                        {
3084
                        {
 Lines 3094-3100    Link Here 
3094
                    }
3096
                    }
3095
                  if (retry == true)
3097
                  if (retry == true)
3096
                    {
3098
                    {
3097
                      peekedPacket = listenerIt->second->PeekNextPacketInBaQueue (peekedHdr, hdr.GetAddr1 (), tid, &tstamp);
3099
                      peekedPacket = listenerIt->second->PeekNextPacketInBaQueue (peekedHdr, hdr.GetAddr1 (), tid, &tstamp, &nRetries);
3098
                      if (peekedPacket == 0)
3100
                      if (peekedPacket == 0)
3099
                        {
3101
                        {
3100
                          //I reached the first packet that I added to this A-MPDU
3102
                          //I reached the first packet that I added to this A-MPDU
 Lines 3228-3240    Link Here 
3228
}
3230
}
3229
3231
3230
void
3232
void
3231
MacLow::InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp)
3233
MacLow::InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint32_t nRetries)
3232
{
3234
{
3233
  Item item;
3235
  Item item;
3234
3236
3235
  item.packet = packet;
3237
  item.packet = packet;
3236
  item.hdr = hdr;
3238
  item.hdr = hdr;
3237
  item.timestamp = tStamp;
3239
  item.timestamp = tStamp;
3240
  item.nRetries = nRetries;
3238
3241
3239
  m_txPackets.push_back (item);
3242
  m_txPackets.push_back (item);
3240
}
3243
}
(-)a/src/wifi/model/mac-low.h (-3 / +4 lines)
 Lines 227-233    Link Here 
227
   * for a blockack containing the sequence number of this MPDU).
227
   * for a blockack containing the sequence number of this MPDU).
228
   * It also calls NotifyMpdu transmission that updates the status of OriginatorBlockAckAgreement.
228
   * It also calls NotifyMpdu transmission that updates the status of OriginatorBlockAckAgreement.
229
   */
229
   */
230
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp);
230
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp, uint32_t nRetries);
231
  /**
231
  /**
232
   * Return the next sequence number for the given header.
232
   * Return the next sequence number for the given header.
233
   *
233
   *
 Lines 245-251    Link Here 
245
  /*
245
  /*
246
   * Peek in retransmit queue and get the next packet without removing it from the queue
246
   * Peek in retransmit queue and get the next packet without removing it from the queue
247
   */
247
   */
248
  virtual Ptr<const Packet> PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp);
248
  virtual Ptr<const Packet> PeekNextPacketInBaQueue (WifiMacHeader &header, Mac48Address recipient, uint8_t tid, Time *timestamp, uint32_t *nRetries);
249
  /**
249
  /**
250
   * Remove a packet after you peek in the retransmit queue and get it
250
   * Remove a packet after you peek in the retransmit queue and get it
251
   */
251
   */
 Lines 1270-1276    Link Here 
1270
   * Insert in a temporary queue.
1270
   * Insert in a temporary queue.
1271
   * It is only used with a RTS/CTS exchange for an A-MPDU transmission.
1271
   * It is only used with a RTS/CTS exchange for an A-MPDU transmission.
1272
   */
1272
   */
1273
  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp);
1273
  void InsertInTxQueue (Ptr<const Packet> packet, const WifiMacHeader &hdr, Time tStamp, uint32_t nRetries);
1274
  /**
1274
  /**
1275
   * Perform MSDU aggregation for a given MPDU in an A-MPDU
1275
   * Perform MSDU aggregation for a given MPDU in an A-MPDU
1276
   *
1276
   *
 Lines 1296-1301    Link Here 
1296
    Ptr<const Packet> packet;
1296
    Ptr<const Packet> packet;
1297
    WifiMacHeader hdr;
1297
    WifiMacHeader hdr;
1298
    Time timestamp;
1298
    Time timestamp;
1299
    uint32_t nRetries;
1299
  } Item;
1300
  } Item;
1300
1301
1301
  /**
1302
  /**

Return to bug 2305