diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index f7d545b8a..7b63d8d68 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -27,6 +27,7 @@ #include "wifi-mac-queue.h" #include "mac-tx-middle.h" #include "qos-utils.h" +#include "wifi-tx-vector.h" namespace ns3 { @@ -460,9 +461,9 @@ BlockAckManager::NotifyMissedAck (Ptr mpdu) } void -BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) +BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, WifiTxVector dataTxVector) { - NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth); + NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataTxVector); if (!blockAck->IsMultiTid ()) { uint8_t tid = blockAck->GetTidInfo (); @@ -546,7 +547,7 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4 queueIt = it->second.second.erase (queueIt); } } - m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth); + m_stationManager->ReportAmpduTxStatus (recipient, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataTxVector); } } else diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 48762b478..f3287ae01 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -187,7 +187,7 @@ 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 + * \param dataTxVector the TXVECTOR 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 @@ -195,7 +195,7 @@ public: * An acknowledged MPDU is removed from the buffer, retransmitted otherwise. */ void NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + double rxSnr, double dataSnr, WifiTxVector dataTxVector); /** * \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 355b5aeb1..60f42128c 100644 --- a/src/wifi/model/ideal-wifi-manager.cc +++ b/src/wifi/model/ideal-wifi-manager.cc @@ -282,9 +282,9 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st, double ackSnr, WifiMode void IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth) + double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) { - NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss); 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 d800f747a..e46d3ac34 100644 --- a/src/wifi/model/ideal-wifi-manager.h +++ b/src/wifi/model/ideal-wifi-manager.h @@ -69,9 +69,8 @@ private: double ctsSnr, WifiMode ctsMode, double rtsSnr); void DoReportDataOk (WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss); - void DoReportAmpduTxStatus (WifiRemoteStation *station, - uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss); 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 e76de0b3d..dfb4cfd95 100644 --- a/src/wifi/model/mac-low.cc +++ b/src/wifi/model/mac-low.cc @@ -955,7 +955,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_currentTxVector.GetChannelWidth ()); + m_currentTxop->GotBlockAck (&blockAck, hdr.GetAddr2 (), rxSnr, tag.Get (), m_currentTxVector); // 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 4fbbc1811..6964654f0 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc @@ -628,9 +628,9 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) void MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth) + double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) { - NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); + NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss); 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 fed8ac760..9b4a54bbf 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/minstrel-ht-wifi-manager.h @@ -235,9 +235,8 @@ private: void DoReportFinalDataFailed (WifiRemoteStation *station); WifiTxVector DoGetDataTxVector (WifiRemoteStation *station); WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station); - void DoReportAmpduTxStatus (WifiRemoteStation *station, - uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, + double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss); 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 675102bd9..d1d0fcbed 100644 --- a/src/wifi/model/qos-txop.cc +++ b/src/wifi/model/qos-txop.cc @@ -936,7 +936,7 @@ QosTxop::MissedBlockAck (uint8_t nMpdus) { if (GetAmpduExist (m_currentHdr.GetAddr1 ())) { - m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0, 0); + m_stationManager->ReportAmpduTxStatus (m_currentHdr.GetAddr1 (), 0, nMpdus, 0, 0, WifiTxVector ()); } // implicit BAR and do not use BAR after missed BlockAck, hence try to retransmit data frames if (!NeedDataRetransmission (m_currentPacket, m_currentHdr)) @@ -1485,11 +1485,11 @@ QosTxop::GotDelBaFrame (const MgtDelBaHeader *delBaHdr, Mac48Address recipient) } void -QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) +QosTxop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, WifiTxVector dataTxVector) { - NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataChannelWidth); + NS_LOG_FUNCTION (this << blockAck << recipient << rxSnr << dataSnr << dataTxVector); NS_LOG_DEBUG ("got block ack from=" << recipient); - m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr, dataChannelWidth); + m_baManager->NotifyGotBlockAck (blockAck, recipient, rxSnr, dataSnr, dataTxVector); 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 9e633ea56..797cf9a69 100644 --- a/src/wifi/model/qos-txop.h +++ b/src/wifi/model/qos-txop.h @@ -118,7 +118,7 @@ public: void NotifyInternalCollision (void); void GotAck (void); void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + double rxSnr, double dataSnr, WifiTxVector dataTxVector); 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 1ed7202ba..7f7223a3f 100644 --- a/src/wifi/model/txop.cc +++ b/src/wifi/model/txop.cc @@ -870,7 +870,7 @@ Txop::StartNextPacket (void) } void -Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, uint16_t dataChannelWidth) +Txop::GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, double rxSnr, double dataSnr, WifiTxVector dataTxVector) { 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 eee556782..74c593b82 100644 --- a/src/wifi/model/txop.h +++ b/src/wifi/model/txop.h @@ -37,6 +37,7 @@ class WifiMacQueueItem; class UniformRandomVariable; class CtrlBAckResponseHeader; class WifiRemoteStationManager; +class WifiTxVector; /** * \brief Handle packet fragmentation and retransmissions @@ -275,10 +276,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. + * \param dataTxVector TXVECTOR used to send the Data. */ virtual void GotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac48Address recipient, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + double rxSnr, double dataSnr, WifiTxVector dataTxVector); /** * 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 53245059f..1c38f2856 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -728,15 +728,15 @@ WifiRemoteStationManager::ReportRxOk (Mac48Address address, double rxSnr, WifiMo void WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth) + double rxSnr, double dataSnr, WifiTxVector dataTxVector) { - NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth); + NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataTxVector); NS_ASSERT (!address.IsGroup ()); for (uint8_t i = 0; i < nFailedMpdus; i++) { m_macTxDataFailed (address); } - DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataChannelWidth); + DoReportAmpduTxStatus (Lookup (address), nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr, dataTxVector.GetChannelWidth (), dataTxVector.GetNss ()); } bool @@ -1406,7 +1406,7 @@ WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, } void -WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth) +WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) { 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 a1981e2ad..b0cb0ccf0 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -750,10 +750,10 @@ public: * \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 + * \param dataTxVector the TXVECTOR of the MPDUs we sent */ void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + double rxSnr, double dataSnr, WifiTxVector dataTxVector); /** * \param address remote address @@ -1196,9 +1196,10 @@ private: * \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 + * \param dataNss the number of spatial streams used to send the A-MPDU */ virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, - double rxSnr, double dataSnr, uint16_t dataChannelWidth); + double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss); /** * Return the state of the station associated with the given address.