diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index c1c9452a8..f7d545b8a 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -460,9 +460,9 @@ BlockAckManager::NotifyMissedAck (Ptr mpdu) } void -BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr) +BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) { - NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth); if (!blockAck->IsMultiTid ()) { uint8_t tid = blockAck->GetTidInfo (); @@ -546,7 +546,7 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4 queueIt = it->second.second.erase (queueIt); } } - m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr); + m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth); } } else diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 887eaae9e..48762b478 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -187,13 +187,15 @@ public: * \param recipient Sender of BlockAck frame. * \param rxSnr received SNR of the BlockAck frame itself * \param dataSnr data SNR reported by remote station + * \param dataChannelWidth channel width (in MHz) used to send the Data * * Invoked upon receipt of a BlockAck 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, were correctly received by the recipient. * An acknowledged MPDU is removed from the buffer, retransmitted otherwise. */ - void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr); + void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, + double rxSnr, double dataSnr, uint16_t dataChannelWidth); /** * \param recipient Sender of the expected BlockAck frame. * \param tid Traffic ID. diff --git a/src/wifi/model/ideal-wifi-manager.cc b/src/wifi/model/ideal-wifi-manager.cc index a78b6fae2..33467d73b 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -273,9 +273,10 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st, } void -IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) +IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth) { - NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); IdealWifiRemoteStation *station = static_cast (st); if (dataSnr == 0) { diff --git a/src/wifi/model/ideal-wifi-manager.h b/src/wifi/model/ideal-wifi-manager.h index bd4c48b88..ecc11a642 100644 --- a/src/wifi/model/ideal-wifi-manager.h +++ b/src/wifi/model/ideal-wifi-manager.h @@ -70,7 +70,7 @@ private: double dataSnr, uint16_t dataChannelWidth); void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr); + double rxSnr, double dataSnr, uint16_t dataChannelWidth); void DoReportFinalRtsFailed (WifiRemoteStation *station); void DoReportFinalDataFailed (WifiRemoteStation *station); WifiTxVector DoGetDataTxVector (WifiRemoteStation *station); diff --git a/src/wifi/model/mac-low.cc b/src/wifi/model/mac-low.cc index 6278c66ad..67c6ef110 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -956,7 +956,7 @@ MacLow::ReceiveOk (Ptr mpdu, double rxSnr, WifiTxVector txVect packet->RemoveHeader (blockAck); m_blockAckTimeoutEvent.Cancel (); NotifyAckTimeoutResetNow (); - m_currentTxop->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, tag.Get ()); + m_currentTxop->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, tag.Get (), m_currentTxVector.GetChannelWidth ()); // start next packet if TXOP remains, otherwise contend for accessing the channel again if (m_currentTxop->IsQosTxop () && m_currentTxop->GetTxopLimit ().IsStrictlyPositive () && m_currentTxop->GetTxopRemaining () > GetSifs ()) diff --git a/src/wifi/model/minstrel-ht-wifi-manager.cc b/src/wifi/model/minstrel-ht-wifi-manager.cc index 857f446c3..a08c76125 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc @@ -628,9 +628,10 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) } void -MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) +MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth) { - NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); MinstrelHtWifiRemoteStation *station = static_cast (st); CheckInit (station); diff --git a/src/wifi/model/minstrel-ht-wifi-manager.h b/src/wifi/model/minstrel-ht-wifi-manager.h index a910c3d8b..2434eb6c7 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/minstrel-ht-wifi-manager.h @@ -238,7 +238,7 @@ private: WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr); + double rxSnr, double dataSnr, uint16_t dataChannelWidth); bool IsLowLatency (void) const; bool DoNeedRetransmission (WifiRemoteStation *st, Ptr packet, bool normally); diff --git a/src/wifi/model/qos-txop.cc b/src/wifi/model/qos-txop.cc index 1b38cf1e1..9ee3c5ae0 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -934,7 +934,7 @@ QosTxop::MissedBlockAck (uint8_t nMpdus) { if (GetAmpduExist (m_currentHdr.GetAddr1 ())) { - m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0); + m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0, 0); } // implicit BAR and do not use BAR after missed BlockAck, hence try to retransmit data frames if (!NeedDataRetransmission (m_currentPacket, m_currentHdr)) @@ -1489,11 +1489,11 @@ QosTxop::GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient) } void -QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr) +QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) { - NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth); NS_LOG_DEBUG ("got block ack from=" << recipient); - m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr); + m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr, dataChannelWidth); if (!m_txOkCallback.IsNull ()) { m_txOkCallback (m_currentHdr); diff --git a/src/wifi/model/qos-txop.h b/src/wifi/model/qos-txop.h index 87b262de5..9e633ea56 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -117,7 +117,8 @@ public: void NotifyAccessGranted (void); void NotifyInternalCollision (void); void GotAck (void); - void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr); + void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, + double rxSnr, double dataSnr, uint16_t dataChannelWidth); void MissedBlockAck (uint8_t nMpdus); void MissedAck (void); void StartNextPacket (void); diff --git a/src/wifi/model/txop.cc b/src/wifi/model/txop.cc index 9f1d82dd5..d5c973874 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -869,7 +869,7 @@ Txop::StartNextPacket (void) } void -Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr) +Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) { NS_LOG_WARN ("GotBlockAck should not be called for non QoS!"); } diff --git a/src/wifi/model/txop.h b/src/wifi/model/txop.h index e9aaa329e..eee556782 100644 --- a/src/wifi/model/txop.h +++ b/src/wifi/model/txop.h @@ -275,8 +275,10 @@ public: * \param recipient address of the recipient. * \param rxSnr SNR of the BlockAck itself in linear scale. * \param dataSnr reported data SNR from the peer in linear scale. + * \param dataChannelWidth channel width (in MHz) used to send the Data. */ - virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr); + virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, + double rxSnr, double dataSnr, uint16_t dataChannelWidth); /** * Event handler when a BlockAck timeout has occurred. * \param nMpdus the number of MPDUs sent in the A-MPDU transmission that results in a BlockAck timeout. diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index e32e49790..ef9f36f0c 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -795,15 +795,15 @@ WifiRemoteStationManager::ReportRxOk (Mac48Address address, double rxSnr, WifiMo void WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr) + double rxSnr, double dataSnr, uint16_t dataChannelWidth) { - NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr); + NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); NS_ASSERT (!address.IsGroup ()); for (uint8_t i = 0; i < nFailedMpdus; i++) { m_macTxDataFailed (address); } - DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr); + DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth); } bool @@ -1473,7 +1473,7 @@ WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, } void -WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) +WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth) { NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!"); } diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index 8f2147784..d0c17e9c3 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -769,18 +769,20 @@ public: * received or when a BlockAckTimeout has elapsed. * * \param address the address of the receiver - * \param nSuccessfulMpdus number of successfully transmitted MPDUs. + * \param nSuccessfulMpdus number of successfully transmitted MPDUs * A value of 0 means that the Block ACK was missed. - * \param nFailedMpdus number of unsuccessfully transmitted MPDUs. + * \param nFailedMpdus number of unsuccessfully transmitted MPDUs * \param rxSnr received SNR of the block ack frame itself * \param dataSnr data SNR reported by remote station + * \param dataChannelWidth the channel width (in MHz) of the A-MPDU initially sent to the remote station */ - void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); + void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth); /** * \param address remote address * \param rxSnr the SNR of the packet received - * \param txMode the transmission mode used for the packet received. + * \param txMode the transmission mode used for the packet received * * Should be invoked whenever a packet is successfully received. */ @@ -1224,8 +1226,10 @@ private: * \param nFailedMpdus number of unsuccessfully transmitted MPDUs. * \param rxSnr received SNR of the block ack frame itself * \param dataSnr data SNR reported by remote station + * \param dataChannelWidth the channel width (in MHz) of the A-MPDU we sent */ - virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr); + virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth); /** * Return the state of the station associated with the given address.