diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 9a6196918..45045e30b 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -429,9 +429,9 @@ BlockAckManager::HandleInFlightMpdu(PacketQueueI mpduIt, } void -BlockAckManager::NotifyGotAck(Ptr mpdu) +BlockAckManager::NotifyGotAck(uint8_t linkId, Ptr mpdu) { - NS_LOG_FUNCTION(this << *mpdu); + NS_LOG_FUNCTION(this << linkId << *mpdu); NS_ASSERT(mpdu->GetHeader().IsQosData()); Mac48Address recipient = mpdu->GetHeader().GetAddr1(); @@ -456,9 +456,9 @@ BlockAckManager::NotifyGotAck(Ptr mpdu) } void -BlockAckManager::NotifyMissedAck(Ptr mpdu) +BlockAckManager::NotifyMissedAck(uint8_t linkId, Ptr mpdu) { - NS_LOG_FUNCTION(this << *mpdu); + NS_LOG_FUNCTION(this << linkId << *mpdu); NS_ASSERT(mpdu->GetHeader().IsQosData()); Mac48Address recipient = mpdu->GetHeader().GetAddr1(); @@ -481,12 +481,13 @@ BlockAckManager::NotifyMissedAck(Ptr mpdu) } std::pair -BlockAckManager::NotifyGotBlockAck(const CtrlBAckResponseHeader& blockAck, +BlockAckManager::NotifyGotBlockAck(uint8_t linkId, + const CtrlBAckResponseHeader& blockAck, Mac48Address recipient, const std::set& tids, size_t index) { - NS_LOG_FUNCTION(this << blockAck << recipient << index); + NS_LOG_FUNCTION(this << linkId << blockAck << recipient << index); uint16_t nSuccessfulMpdus = 0; uint16_t nFailedMpdus = 0; @@ -564,9 +565,9 @@ BlockAckManager::NotifyGotBlockAck(const CtrlBAckResponseHeader& blockAck, } void -BlockAckManager::NotifyMissedBlockAck(Mac48Address recipient, uint8_t tid) +BlockAckManager::NotifyMissedBlockAck(uint8_t linkId, Mac48Address recipient, uint8_t tid) { - NS_LOG_FUNCTION(this << recipient << +tid); + NS_LOG_FUNCTION(this << linkId << recipient << +tid); if (ExistsAgreementInState(recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED)) { AgreementsI it = m_agreements.find(std::make_pair(recipient, tid)); diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index c92f96b7a..44da026b2 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -176,24 +176,27 @@ class BlockAckManager : public Object uint8_t tid = 8, Mac48Address recipient = Mac48Address::GetBroadcast()); /** - * Invoked upon receipt of an Ack frame after the transmission of a QoS data frame - * sent under an established block ack agreement. Remove the acknowledged frame - * from the outstanding packets and update the starting sequence number of the + * Invoked upon receipt of an Ack frame on the given link after the transmission of a + * QoS data frame sent under an established block ack agreement. Remove the acknowledged + * frame from the outstanding packets and update the starting sequence number of the * transmit window, if needed. * + * \param linkId the ID of the given link * \param mpdu The acknowledged MPDU. */ - void NotifyGotAck(Ptr mpdu); + void NotifyGotAck(uint8_t linkId, Ptr mpdu); /** - * Invoked upon missed reception of an Ack frame after the transmission of a - * QoS data frame sent under an established block ack agreement. Remove the - * acknowledged frame from the outstanding packets and insert it in the + * Invoked upon missed reception of an Ack frame on the given link after the + * transmission of a QoS data frame sent under an established block ack agreement. + * Remove the acknowledged frame from the outstanding packets and insert it in the * retransmission queue. * + * \param linkId the ID of the given link * \param mpdu The unacknowledged MPDU. */ - void NotifyMissedAck(Ptr mpdu); + void NotifyMissedAck(uint8_t linkId, Ptr mpdu); /** + * \param linkId the ID of the given link * \param blockAck The received BlockAck frame. * \param recipient Sender of BlockAck frame. * \param tids the set of TIDs the acknowledged MPDUs belong to @@ -202,26 +205,28 @@ class BlockAckManager : public Object * \return a pair of values indicating the number of successfully received MPDUs * and the number of failed MPDUs * - * Invoked upon receipt of a BlockAck frame. Typically, this function, is called - * by ns3::QosTxop object. Performs a check on which MPDUs, previously sent + * Invoked upon receipt of a BlockAck frame on the given link. Typically, this function + * is called by ns3::QosTxop object. Performs a check on which MPDUs, previously sent * with Ack Policy set to Block Ack, were correctly received by the recipient. * An acknowledged MPDU is removed from the buffer, retransmitted otherwise. * Note that tids is only used if blockAck is a Multi-STA Block Ack * using All-ack context. */ - std::pair NotifyGotBlockAck(const CtrlBAckResponseHeader& blockAck, + std::pair NotifyGotBlockAck(uint8_t linkId, + const CtrlBAckResponseHeader& blockAck, Mac48Address recipient, const std::set& tids, size_t index = 0); /** + * \param linkId the ID of the given link * \param recipient Sender of the expected BlockAck frame. * \param tid Traffic ID. * - * Invoked upon missed reception of a block ack frame. Typically, this function, is called - * by ns3::QosTxop object. Performs a check on which MPDUs, previously sent - * with ack policy set to Block Ack, should be placed in the retransmission queue. + * Invoked upon missed reception of a block ack frame on the given link. Typically, this + * function is called by ns3::QosTxop object. Performs a check on which MPDUs, previously + * sent with ack policy set to Block Ack, should be placed in the retransmission queue. */ - void NotifyMissedBlockAck(Mac48Address recipient, uint8_t tid); + void NotifyMissedBlockAck(uint8_t linkId, Mac48Address recipient, uint8_t tid); /** * \param recipient Address of peer station involved in block ack mechanism. * \param tid Traffic ID. diff --git a/src/wifi/model/he/he-frame-exchange-manager.cc b/src/wifi/model/he/he-frame-exchange-manager.cc index 8220985ec..ad31cb2a6 100644 --- a/src/wifi/model/he/he-frame-exchange-manager.cc +++ b/src/wifi/model/he/he-frame-exchange-manager.cc @@ -1756,7 +1756,7 @@ HeFrameExchangeManager::ReceiveMpdu(Ptr mpdu, mpdu->GetPacket()->PeekHeader(blockAck); uint8_t tid = blockAck.GetTidInfo(); std::pair ret = - GetBaManager(tid)->NotifyGotBlockAck(blockAck, hdr.GetAddr2(), {tid}); + GetBaManager(tid)->NotifyGotBlockAck(m_linkId, blockAck, hdr.GetAddr2(), {tid}); GetWifiRemoteStationManager()->ReportAmpduTxStatus(hdr.GetAddr2(), ret.first, ret.second, @@ -1821,7 +1821,7 @@ HeFrameExchangeManager::ReceiveMpdu(Ptr mpdu, { // Acknowledgment context NS_ABORT_IF(m_psduMap.empty() || m_psduMap.begin()->first != staId); - GetBaManager(tid)->NotifyGotAck(*m_psduMap.at(staId)->begin()); + GetBaManager(tid)->NotifyGotAck(m_linkId, *m_psduMap.at(staId)->begin()); } else { @@ -1837,7 +1837,8 @@ HeFrameExchangeManager::ReceiveMpdu(Ptr mpdu, } std::pair ret = - GetBaManager(tid)->NotifyGotBlockAck(blockAck, + GetBaManager(tid)->NotifyGotBlockAck(m_linkId, + blockAck, hdr.GetAddr2(), {tid}, index); diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 8158a24d4..ea5aba0b4 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -595,7 +595,7 @@ HtFrameExchangeManager::NotifyReceivedNormalAck(Ptr mpdu) if (edca->GetBaAgreementEstablished(mpdu->GetHeader().GetAddr1(), tid)) { // notify the BA manager that the MPDU was acknowledged - edca->GetBaManager()->NotifyGotAck(mpdu); + edca->GetBaManager()->NotifyGotAck(m_linkId, mpdu); } } else if (mpdu->GetHeader().IsAction()) @@ -722,7 +722,7 @@ HtFrameExchangeManager::RetransmitMpduAfterMissedAck(Ptr mpdu) const if (edca->GetBaAgreementEstablished(mpdu->GetHeader().GetAddr1(), tid)) { // notify the BA manager that the MPDU was not acknowledged - edca->GetBaManager()->NotifyMissedAck(mpdu); + edca->GetBaManager()->NotifyMissedAck(m_linkId, mpdu); return; } } @@ -1293,7 +1293,7 @@ HtFrameExchangeManager::MissedBlockAck(Ptr psdu, else { NS_LOG_DEBUG("Missed Block Ack, retransmit data frames"); - GetBaManager(tid)->NotifyMissedBlockAck(recipient, tid); + GetBaManager(tid)->NotifyMissedBlockAck(m_linkId, recipient, tid); resetCw = false; } } @@ -1408,7 +1408,7 @@ HtFrameExchangeManager::ReceiveMpdu(Ptr mpdu, mpdu->GetPacket()->PeekHeader(blockAck); uint8_t tid = blockAck.GetTidInfo(); std::pair ret = - GetBaManager(tid)->NotifyGotBlockAck(blockAck, hdr.GetAddr2(), {tid}); + GetBaManager(tid)->NotifyGotBlockAck(m_linkId, blockAck, hdr.GetAddr2(), {tid}); GetWifiRemoteStationManager()->ReportAmpduTxStatus(hdr.GetAddr2(), ret.first, ret.second,