diff --git a/src/mesh/model/dot11s/airtime-metric.cc b/src/mesh/model/dot11s/airtime-metric.cc index 26a72186f..b21695818 100644 --- a/src/mesh/model/dot11s/airtime-metric.cc +++ b/src/mesh/model/dot11s/airtime-metric.cc @@ -80,7 +80,7 @@ AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, PtrGetWifiRemoteStationManager ()->GetDataTxVector (m_testHeader).GetMode(); + WifiMode mode = mac->GetWifiRemoteStationManager ()->GetDataTxVector (m_testHeader, mac->GetWifiPhy ()->GetChannelWidth ()).GetMode(); //obtain frame error rate: double failAvg = mac->GetWifiRemoteStationManager ()->GetInfo (peerAddress).GetFrameErrorRate (); if (failAvg == 1) diff --git a/src/wave/model/wave-frame-exchange-manager.cc b/src/wave/model/wave-frame-exchange-manager.cc index 96c80819a..5852490fc 100644 --- a/src/wave/model/wave-frame-exchange-manager.cc +++ b/src/wave/model/wave-frame-exchange-manager.cc @@ -72,7 +72,7 @@ WaveFrameExchangeManager::GetDataTxVector (Ptr item) con // will be determined by MAC layer itself. if (!found) { - return m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ()); + return m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader (), m_allowedWidth); } // if high layer has set the transmit parameters with non-adaption mode, @@ -85,7 +85,7 @@ WaveFrameExchangeManager::GetDataTxVector (Ptr item) con // if high layer has set the transmit parameters with non-adaption mode, // the real transmit parameters are determined by both high layer and MAC layer. WifiTxVector txHigher = datatag.GetTxVector (); - WifiTxVector txMac = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader ()); + WifiTxVector txMac = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (item->GetHeader (), m_allowedWidth); WifiTxVector txAdapter; txAdapter.SetChannelWidth (10); // the DataRate set by higher layer is the minimum data rate diff --git a/src/wifi/model/frame-exchange-manager.cc b/src/wifi/model/frame-exchange-manager.cc index fd58d2c8e..224d5930d 100644 --- a/src/wifi/model/frame-exchange-manager.cc +++ b/src/wifi/model/frame-exchange-manager.cc @@ -322,7 +322,7 @@ FrameExchangeManager::StartTransmission (Ptr dcf, uint16_t allowedWidth) NS_ASSERT (m_protectionManager != 0); NS_ASSERT (m_ackManager != 0); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth); txParams.m_protection = m_protectionManager->TryAddMpdu (mpdu, txParams); txParams.m_acknowledgment = m_ackManager->TryAddMpdu (mpdu, txParams); txParams.AddMpdu (mpdu); diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index f1cc90037..e8025762b 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -233,7 +233,7 @@ RrMultiUserScheduler::GetTxVectorForUlMu (Func canbeSolicited) WifiMacHeader hdr (WIFI_MAC_QOSDATA); hdr.SetAddr1 (staIt->address); hdr.SetAddr2 (m_apMac->GetAddress ()); - WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (hdr); + WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (hdr, m_allowedWidth); txVector.SetHeMuUserInfo (staIt->aid, {HeRu::RuSpec (), // assigned later by FinalizeTxVector suTxVector.GetMode (), @@ -609,7 +609,7 @@ RrMultiUserScheduler::TrySendingDlMuPpdu (void) // candidate station to check if the MPDU meets the size and time limits. // An RU of the computed size is tentatively assigned to the candidate // station, so that the TX duration can be correctly computed. - WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader ()), + WifiTxVector suTxVector = GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth), txVectorCopy = m_txParams.m_txVector; m_txParams.m_txVector.SetHeMuUserInfo (staIt->aid, diff --git a/src/wifi/model/ht/ht-frame-exchange-manager.cc b/src/wifi/model/ht/ht-frame-exchange-manager.cc index 80328500d..570ea594f 100644 --- a/src/wifi/model/ht/ht-frame-exchange-manager.cc +++ b/src/wifi/model/ht/ht-frame-exchange-manager.cc @@ -180,7 +180,7 @@ HtFrameExchangeManager::SendAddBaRequest (Mac48Address dest, uint8_t tid, uint16 mpdu->GetHeader ().SetSequenceNumber (sequence); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth); txParams.m_protection = std::unique_ptr (new WifiNoProtection); txParams.m_acknowledgment = GetAckManager ()->TryAddMpdu (mpdu, txParams); @@ -408,7 +408,7 @@ HtFrameExchangeManager::SendMpduFromBaManager (Ptr edca, Time available // The m_txVector field of the TX parameters is set to the BlockAckReq TxVector // a few lines below. WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peekedItem->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peekedItem->GetHeader (), m_allowedWidth); txParams.m_protection = std::unique_ptr (new WifiNoProtection); txParams.m_acknowledgment = GetAckManager ()->TryAddMpdu (peekedItem, txParams); @@ -450,7 +450,7 @@ HtFrameExchangeManager::SendDataFrame (Ptr peekedItem, Ptr edca = m_mac->GetQosTxop (peekedItem->GetHeader ().GetQosTid ()); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peekedItem->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peekedItem->GetHeader (), m_allowedWidth); Ptr mpdu = edca->GetNextMpdu (peekedItem, txParams, availableTime, initialFrame); if (mpdu == nullptr) diff --git a/src/wifi/model/qos-frame-exchange-manager.cc b/src/wifi/model/qos-frame-exchange-manager.cc index 02b882c9e..cb22205c2 100644 --- a/src/wifi/model/qos-frame-exchange-manager.cc +++ b/src/wifi/model/qos-frame-exchange-manager.cc @@ -276,7 +276,7 @@ QosFrameExchangeManager::StartFrameExchange (Ptr edca, Time availableTi } WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (mpdu->GetHeader (), m_allowedWidth); Ptr item = edca->GetNextMpdu (mpdu, txParams, availableTime, initialFrame); diff --git a/src/wifi/model/rate-control/aarf-wifi-manager.cc b/src/wifi/model/rate-control/aarf-wifi-manager.cc index 3e74340d9..8cb9888c6 100644 --- a/src/wifi/model/rate-control/aarf-wifi-manager.cc +++ b/src/wifi/model/rate-control/aarf-wifi-manager.cc @@ -247,9 +247,9 @@ AarfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -AarfWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +AarfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); AarfWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/aarf-wifi-manager.h b/src/wifi/model/rate-control/aarf-wifi-manager.h index 3ba1799e9..09efd1bc8 100644 --- a/src/wifi/model/rate-control/aarf-wifi-manager.h +++ b/src/wifi/model/rate-control/aarf-wifi-manager.h @@ -64,7 +64,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; uint32_t m_minTimerThreshold; ///< minimum timer threshold diff --git a/src/wifi/model/rate-control/aarfcd-wifi-manager.cc b/src/wifi/model/rate-control/aarfcd-wifi-manager.cc index c04fcd6f5..9d4027ab8 100644 --- a/src/wifi/model/rate-control/aarfcd-wifi-manager.cc +++ b/src/wifi/model/rate-control/aarfcd-wifi-manager.cc @@ -315,9 +315,9 @@ AarfcdWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -AarfcdWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +AarfcdWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); AarfcdWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/aarfcd-wifi-manager.h b/src/wifi/model/rate-control/aarfcd-wifi-manager.h index fe9f08971..2a3429f17 100644 --- a/src/wifi/model/rate-control/aarfcd-wifi-manager.h +++ b/src/wifi/model/rate-control/aarfcd-wifi-manager.h @@ -78,7 +78,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; bool DoNeedRts (WifiRemoteStation *station, uint32_t size, bool normally) override; diff --git a/src/wifi/model/rate-control/amrr-wifi-manager.cc b/src/wifi/model/rate-control/amrr-wifi-manager.cc index 6161c6164..cdae2faeb 100644 --- a/src/wifi/model/rate-control/amrr-wifi-manager.cc +++ b/src/wifi/model/rate-control/amrr-wifi-manager.cc @@ -319,9 +319,9 @@ AmrrWifiManager::UpdateMode (AmrrWifiRemoteStation *station) } WifiTxVector -AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +AmrrWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); AmrrWifiRemoteStation *station = static_cast (st); UpdateMode (station); NS_ASSERT (station->m_txrate < GetNSupported (station)); diff --git a/src/wifi/model/rate-control/amrr-wifi-manager.h b/src/wifi/model/rate-control/amrr-wifi-manager.h index 78fc6b632..b41628b27 100644 --- a/src/wifi/model/rate-control/amrr-wifi-manager.h +++ b/src/wifi/model/rate-control/amrr-wifi-manager.h @@ -67,7 +67,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** diff --git a/src/wifi/model/rate-control/aparf-wifi-manager.cc b/src/wifi/model/rate-control/aparf-wifi-manager.cc index 62f7550c9..05ea32e70 100644 --- a/src/wifi/model/rate-control/aparf-wifi-manager.cc +++ b/src/wifi/model/rate-control/aparf-wifi-manager.cc @@ -336,9 +336,9 @@ AparfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -AparfWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +AparfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); AparfWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/aparf-wifi-manager.h b/src/wifi/model/rate-control/aparf-wifi-manager.h index f6993fdf8..6f9da3bae 100644 --- a/src/wifi/model/rate-control/aparf-wifi-manager.h +++ b/src/wifi/model/rate-control/aparf-wifi-manager.h @@ -79,7 +79,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** Check for initializations. diff --git a/src/wifi/model/rate-control/arf-wifi-manager.cc b/src/wifi/model/rate-control/arf-wifi-manager.cc index 5574c9b83..6c8d6249e 100644 --- a/src/wifi/model/rate-control/arf-wifi-manager.cc +++ b/src/wifi/model/rate-control/arf-wifi-manager.cc @@ -224,9 +224,9 @@ ArfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -ArfWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +ArfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); ArfWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/arf-wifi-manager.h b/src/wifi/model/rate-control/arf-wifi-manager.h index 03afcb213..c0b2564d7 100644 --- a/src/wifi/model/rate-control/arf-wifi-manager.h +++ b/src/wifi/model/rate-control/arf-wifi-manager.h @@ -70,7 +70,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; uint32_t m_timerThreshold; ///< timer threshold diff --git a/src/wifi/model/rate-control/cara-wifi-manager.cc b/src/wifi/model/rate-control/cara-wifi-manager.cc index 0ce0af863..9885186bf 100644 --- a/src/wifi/model/rate-control/cara-wifi-manager.cc +++ b/src/wifi/model/rate-control/cara-wifi-manager.cc @@ -197,9 +197,9 @@ CaraWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) } WifiTxVector -CaraWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +CaraWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); CaraWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/cara-wifi-manager.h b/src/wifi/model/rate-control/cara-wifi-manager.h index 34b82982f..d17182682 100644 --- a/src/wifi/model/rate-control/cara-wifi-manager.h +++ b/src/wifi/model/rate-control/cara-wifi-manager.h @@ -66,7 +66,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; bool DoNeedRts (WifiRemoteStation *station, uint32_t size, bool normally) override; diff --git a/src/wifi/model/rate-control/constant-rate-wifi-manager.cc b/src/wifi/model/rate-control/constant-rate-wifi-manager.cc index 91901006a..d1920e2cf 100644 --- a/src/wifi/model/rate-control/constant-rate-wifi-manager.cc +++ b/src/wifi/model/rate-control/constant-rate-wifi-manager.cc @@ -116,15 +116,15 @@ ConstantRateWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +ConstantRateWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); uint8_t nss = Min (GetMaxNumberOfTransmitStreams (), GetNumberOfSupportedStreams (st)); if (m_dataMode.GetModulationClass () == WIFI_MOD_CLASS_HT) { nss = 1 + (m_dataMode.GetMcsValue () / 8); } - return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_dataMode.GetModulationClass (), GetShortPreambleEnabled ()), ConvertGuardIntervalToNanoSeconds (m_dataMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), GetNumberOfAntennas (), nss, 0, GetChannelWidthForTransmission (m_dataMode, GetPhy ()->GetChannelWidth (), GetChannelWidth (st)), GetAggregation (st)); + return WifiTxVector (m_dataMode, GetDefaultTxPowerLevel (), GetPreambleForTransmission (m_dataMode.GetModulationClass (), GetShortPreambleEnabled ()), ConvertGuardIntervalToNanoSeconds (m_dataMode, GetShortGuardIntervalSupported (st), NanoSeconds (GetGuardInterval (st))), GetNumberOfAntennas (), nss, 0, GetChannelWidthForTransmission (m_dataMode, allowedWidth, GetChannelWidth (st)), GetAggregation (st)); } WifiTxVector diff --git a/src/wifi/model/rate-control/constant-rate-wifi-manager.h b/src/wifi/model/rate-control/constant-rate-wifi-manager.h index b74ccde45..dabfab7fa 100644 --- a/src/wifi/model/rate-control/constant-rate-wifi-manager.h +++ b/src/wifi/model/rate-control/constant-rate-wifi-manager.h @@ -56,7 +56,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; WifiMode m_dataMode; //!< Wifi mode for unicast Data frames diff --git a/src/wifi/model/rate-control/ideal-wifi-manager.cc b/src/wifi/model/rate-control/ideal-wifi-manager.cc index d1289f289..19c4a35f0 100644 --- a/src/wifi/model/rate-control/ideal-wifi-manager.cc +++ b/src/wifi/model/rate-control/ideal-wifi-manager.cc @@ -312,9 +312,9 @@ IdealWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); IdealWifiRemoteStation *station = static_cast (st); //We search within the Supported rate set the mode with the //highest data rate for which the SNR threshold is smaller than m_lastSnr @@ -325,7 +325,7 @@ IdealWifiManager::DoGetDataTxVector (WifiRemoteStation *st) uint64_t bestRate = 0; uint8_t selectedNss = 1; uint16_t guardInterval; - uint16_t channelWidth = std::min (GetChannelWidth (station), GetPhy ()->GetChannelWidth ()); + uint16_t channelWidth = std::min (GetChannelWidth (station), allowedWidth); txVector.SetChannelWidth (channelWidth); if ((station->m_lastSnrCached != CACHE_INITIAL_VALUE) && (station->m_lastSnrObserved == station->m_lastSnrCached) && (channelWidth == station->m_lastChannelWidth)) { diff --git a/src/wifi/model/rate-control/ideal-wifi-manager.h b/src/wifi/model/rate-control/ideal-wifi-manager.h index 5e74913e9..474c3aff5 100644 --- a/src/wifi/model/rate-control/ideal-wifi-manager.h +++ b/src/wifi/model/rate-control/ideal-wifi-manager.h @@ -72,7 +72,7 @@ private: double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** diff --git a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc index d5b1f0e02..4cd40bae5 100644 --- a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.cc @@ -861,10 +861,68 @@ MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *statio } } -WifiTxVector -MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +uint16_t +MinstrelHtWifiManager::UpdateRateAfterAllowedWidth (uint16_t txRate, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << txRate << allowedWidth); + + auto groupId = GetGroupId (txRate); + McsGroup group = m_minstrelGroups[groupId]; + + if (group.chWidth <= allowedWidth) + { + NS_LOG_DEBUG ("Channel width is not greater than allowed width, nothing to do"); + return txRate; + } + + NS_ASSERT (GetHtSupported ()); + NS_ASSERT (group.chWidth % 20 == 0); + // try halving the channel width and check if the group with the same number of + // streams and same GI is supported, until either a supported group is found or + // the width becomes lower than 20 MHz + uint16_t width = group.chWidth / 2; + + while (width >= 20) + { + if (width > allowedWidth) + { + width /= 2; + continue; + } + + switch (group.type) + { + case GROUP_HT: + groupId = GetHtGroupId (group.streams, group.gi, width); + break; + case GROUP_VHT: + groupId = GetVhtGroupId (group.streams, group.gi, width); + break; + case GROUP_HE: + groupId = GetHeGroupId (group.streams, group.gi, width); + break; + default: + NS_ABORT_MSG ("Unknown group type: " << group.type); + } + + group = m_minstrelGroups[groupId]; + if (group.isSupported) + { + break; + } + + width /= 2; + } + + NS_ABORT_MSG_IF (width < 20, "No rate compatible with the allowed width found"); + + return GetIndex (groupId, GetRateId (txRate)); +} + +WifiTxVector +MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) +{ + NS_LOG_FUNCTION (this << st << allowedWidth); MinstrelHtWifiRemoteStation *station = static_cast (st); if (!station->m_initialized) @@ -885,6 +943,7 @@ MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) } else { + station->m_txrate = UpdateRateAfterAllowedWidth (station->m_txrate, allowedWidth); NS_LOG_DEBUG ("DoGetDataMode m_txrate= " << station->m_txrate); uint8_t rateId = GetRateId (station->m_txrate); diff --git a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h index d072e1072..6cd48dd21 100644 --- a/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h +++ b/src/wifi/model/rate-control/minstrel-ht-wifi-manager.h @@ -256,7 +256,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; void DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; @@ -599,6 +599,22 @@ private: */ WifiModeList GetHtDeviceMcsList (void) const; + /** + * Given the index of the current TX rate, check whether the channel width is + * not greater than the given allowed width. If so, the index of the current TX + * rate is returned. Otherwise, try halving the channel width and check if the + * MCS group with the same number of streams and same GI is supported. If a + * supported MCS group is found, return the index of the TX rate within such a + * group with the same MCS as the given TX rate. If no supported MCS group is + * found, the simulation aborts. + * + * \param txRate the index of the current TX rate + * \param allowedWidth the allowed width in MHz + * \return the index of a TX rate whose channel width is not greater than the + * allowed width, if found (otherwise, the simulation aborts) + */ + uint16_t UpdateRateAfterAllowedWidth (uint16_t txRate, uint16_t allowedWidth); + Time m_updateStats; //!< How frequent do we calculate the stats. Time m_legacyUpdateStats; //!< How frequent do we calculate the stats for legacy MinstrelWifiManager. uint8_t m_lookAroundRate; //!< The % to try other rates than our current rate. diff --git a/src/wifi/model/rate-control/minstrel-wifi-manager.cc b/src/wifi/model/rate-control/minstrel-wifi-manager.cc index 8e130084a..330eb66b0 100644 --- a/src/wifi/model/rate-control/minstrel-wifi-manager.cc +++ b/src/wifi/model/rate-control/minstrel-wifi-manager.cc @@ -849,9 +849,9 @@ MinstrelWifiManager::UpdateRetry (MinstrelWifiRemoteStation *station) } WifiTxVector -MinstrelWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +MinstrelWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); MinstrelWifiRemoteStation *station = static_cast (st); return GetDataTxVector (station); } diff --git a/src/wifi/model/rate-control/minstrel-wifi-manager.h b/src/wifi/model/rate-control/minstrel-wifi-manager.h index a0c3cf735..a7a675996 100644 --- a/src/wifi/model/rate-control/minstrel-wifi-manager.h +++ b/src/wifi/model/rate-control/minstrel-wifi-manager.h @@ -256,7 +256,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; bool DoNeedRetransmission (WifiRemoteStation *st, diff --git a/src/wifi/model/rate-control/onoe-wifi-manager.cc b/src/wifi/model/rate-control/onoe-wifi-manager.cc index e5f026fd6..7b8c27d69 100644 --- a/src/wifi/model/rate-control/onoe-wifi-manager.cc +++ b/src/wifi/model/rate-control/onoe-wifi-manager.cc @@ -281,9 +281,9 @@ OnoeWifiManager::UpdateMode (OnoeWifiRemoteStation *station) } WifiTxVector -OnoeWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +OnoeWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); OnoeWifiRemoteStation *station = static_cast (st); UpdateMode (station); NS_ASSERT (station->m_txrate < GetNSupported (station)); diff --git a/src/wifi/model/rate-control/onoe-wifi-manager.h b/src/wifi/model/rate-control/onoe-wifi-manager.h index 92da97323..bf1da3897 100644 --- a/src/wifi/model/rate-control/onoe-wifi-manager.h +++ b/src/wifi/model/rate-control/onoe-wifi-manager.h @@ -68,7 +68,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** diff --git a/src/wifi/model/rate-control/parf-wifi-manager.cc b/src/wifi/model/rate-control/parf-wifi-manager.cc index 266fff85b..b06caef0d 100644 --- a/src/wifi/model/rate-control/parf-wifi-manager.cc +++ b/src/wifi/model/rate-control/parf-wifi-manager.cc @@ -308,9 +308,9 @@ ParfWifiManager::DoReportFinalDataFailed (WifiRemoteStation *station) } WifiTxVector -ParfWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +ParfWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); ParfWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/parf-wifi-manager.h b/src/wifi/model/rate-control/parf-wifi-manager.h index 09f57a5d5..ca31a0f1d 100644 --- a/src/wifi/model/rate-control/parf-wifi-manager.h +++ b/src/wifi/model/rate-control/parf-wifi-manager.h @@ -67,7 +67,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** Check for initializations. diff --git a/src/wifi/model/rate-control/rraa-wifi-manager.cc b/src/wifi/model/rate-control/rraa-wifi-manager.cc index 77f728723..7663eb255 100644 --- a/src/wifi/model/rate-control/rraa-wifi-manager.cc +++ b/src/wifi/model/rate-control/rraa-wifi-manager.cc @@ -345,9 +345,9 @@ RraaWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) } WifiTxVector -RraaWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +RraaWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); RraaWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/rraa-wifi-manager.h b/src/wifi/model/rate-control/rraa-wifi-manager.h index eb9b9e061..56eba525c 100644 --- a/src/wifi/model/rate-control/rraa-wifi-manager.h +++ b/src/wifi/model/rate-control/rraa-wifi-manager.h @@ -84,7 +84,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; bool DoNeedRts (WifiRemoteStation *st, uint32_t size, bool normally) override; diff --git a/src/wifi/model/rate-control/rrpaa-wifi-manager.cc b/src/wifi/model/rate-control/rrpaa-wifi-manager.cc index 3b8535634..3d36355ad 100644 --- a/src/wifi/model/rate-control/rrpaa-wifi-manager.cc +++ b/src/wifi/model/rate-control/rrpaa-wifi-manager.cc @@ -387,9 +387,9 @@ RrpaaWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st) } WifiTxVector -RrpaaWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +RrpaaWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); RrpaaWifiRemoteStation *station = static_cast (st); uint16_t channelWidth = GetChannelWidth (station); if (channelWidth > 20 && channelWidth != 22) diff --git a/src/wifi/model/rate-control/rrpaa-wifi-manager.h b/src/wifi/model/rate-control/rrpaa-wifi-manager.h index c73e7e816..1b7ae3921 100644 --- a/src/wifi/model/rate-control/rrpaa-wifi-manager.h +++ b/src/wifi/model/rate-control/rrpaa-wifi-manager.h @@ -109,7 +109,7 @@ private: double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; bool DoNeedRts (WifiRemoteStation *st, uint32_t size, bool normally) override; diff --git a/src/wifi/model/rate-control/thompson-sampling-wifi-manager.cc b/src/wifi/model/rate-control/thompson-sampling-wifi-manager.cc index 35061f436..d98932acf 100644 --- a/src/wifi/model/rate-control/thompson-sampling-wifi-manager.cc +++ b/src/wifi/model/rate-control/thompson-sampling-wifi-manager.cc @@ -307,15 +307,15 @@ ThompsonSamplingWifiManager::GetModeGuardInterval (WifiRemoteStation *st, WifiMo } WifiTxVector -ThompsonSamplingWifiManager::DoGetDataTxVector (WifiRemoteStation *st) +ThompsonSamplingWifiManager::DoGetDataTxVector (WifiRemoteStation *st, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << st); + NS_LOG_FUNCTION (this << st << allowedWidth); InitializeStation (st); auto station = static_cast (st); auto &stats = station->m_mcsStats.at (station->m_nextMode); WifiMode mode = stats.mode; - uint16_t channelWidth = std::min (stats.channelWidth, GetPhy ()->GetChannelWidth ()); + uint16_t channelWidth = std::min (stats.channelWidth, allowedWidth); uint8_t nss = stats.nss; uint16_t guardInterval = GetModeGuardInterval (st, mode); diff --git a/src/wifi/model/rate-control/thompson-sampling-wifi-manager.h b/src/wifi/model/rate-control/thompson-sampling-wifi-manager.h index 9babd2eb1..b988358dc 100644 --- a/src/wifi/model/rate-control/thompson-sampling-wifi-manager.h +++ b/src/wifi/model/rate-control/thompson-sampling-wifi-manager.h @@ -65,7 +65,7 @@ private: double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override; void DoReportFinalRtsFailed (WifiRemoteStation *station) override; void DoReportFinalDataFailed (WifiRemoteStation *station) override; - WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) override; + WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) override; WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) override; /** diff --git a/src/wifi/model/wifi-remote-station-manager.cc b/src/wifi/model/wifi-remote-station-manager.cc index 5d4b5c0b7..d7a7b36c9 100644 --- a/src/wifi/model/wifi-remote-station-manager.cc +++ b/src/wifi/model/wifi-remote-station-manager.cc @@ -518,9 +518,9 @@ WifiRemoteStationManager::GetStaId (Mac48Address address, const WifiTxVector& tx } WifiTxVector -WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header) +WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header, uint16_t allowedWidth) { - NS_LOG_FUNCTION (this << header); + NS_LOG_FUNCTION (this << header << allowedWidth); Mac48Address address = header.GetAddr1 (); if (!header.IsMgt () && address.IsGroup ()) { @@ -529,7 +529,7 @@ WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header) v.SetMode (mode); v.SetPreambleType (GetPreambleForTransmission (mode.GetModulationClass (), GetShortPreambleEnabled ())); v.SetTxPowerLevel (m_defaultTxPowerLevel); - v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetChannelWidth ())); + v.SetChannelWidth (GetChannelWidthForTransmission (mode, allowedWidth)); v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, m_wifiPhy->GetDevice ())); v.SetNTx (GetNumberOfAntennas ()); v.SetNss (1); @@ -552,7 +552,7 @@ WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header) txVector.SetMode (mgtMode); txVector.SetPreambleType (GetPreambleForTransmission (mgtMode.GetModulationClass (), GetShortPreambleEnabled ())); txVector.SetTxPowerLevel (m_defaultTxPowerLevel); - uint16_t channelWidth = m_wifiPhy->GetChannelWidth (); + uint16_t channelWidth = allowedWidth; if (!header.GetAddr1 ().IsGroup ()) { if (uint16_t rxWidth = GetChannelWidthSupported (header.GetAddr1 ()); @@ -567,7 +567,7 @@ WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header) } else { - txVector = DoGetDataTxVector (Lookup (address)); + txVector = DoGetDataTxVector (Lookup (address), allowedWidth); txVector.SetLdpc (txVector.GetMode ().GetModulationClass () < WIFI_MOD_CLASS_HT ? 0 : UseLdpcForDestination (address)); } Ptr heConfiguration = m_wifiPhy->GetDevice ()->GetHeConfiguration (); @@ -575,6 +575,12 @@ WifiRemoteStationManager::GetDataTxVector (const WifiMacHeader &header) { txVector.SetBssColor (heConfiguration->GetBssColor ()); } + // If both the allowed width and the TXVECTOR channel width are integer multiple + // of 20 MHz, then the TXVECTOR channel width must not exceed the allowed width + NS_ASSERT_MSG ((txVector.GetChannelWidth () % 20 != 0) || (allowedWidth % 20 != 0) + || (txVector.GetChannelWidth () <= allowedWidth), + "TXVECTOR channel width (" << txVector.GetChannelWidth () + << " MHz) exceeds allowed width (" << allowedWidth << " MHz)"); return txVector; } @@ -957,7 +963,7 @@ WifiRemoteStationManager::NeedRts (const WifiMacHeader &header, uint32_t size) { NS_LOG_FUNCTION (this << header << size); Mac48Address address = header.GetAddr1 (); - WifiTxVector txVector = GetDataTxVector (header); + WifiTxVector txVector = GetDataTxVector (header, m_wifiPhy->GetChannelWidth ()); WifiMode mode = txVector.GetMode (); if (address.IsGroup ()) { diff --git a/src/wifi/model/wifi-remote-station-manager.h b/src/wifi/model/wifi-remote-station-manager.h index 06011fa29..3e948828b 100644 --- a/src/wifi/model/wifi-remote-station-manager.h +++ b/src/wifi/model/wifi-remote-station-manager.h @@ -710,10 +710,10 @@ public: /** * \param header MAC header - * + * \param allowedWidth the allowed width in MHz to send this packet * \return the TXVECTOR to use to send this packet */ - WifiTxVector GetDataTxVector (const WifiMacHeader &header); + WifiTxVector GetDataTxVector (const WifiMacHeader &header, uint16_t allowedWidth); /** * \param address remote address * @@ -1186,13 +1186,13 @@ private: virtual WifiRemoteStation* DoCreateStation (void) const = 0; /** * \param station the station that we need to communicate - * + * \param allowedWidth the allowed width in MHz to send a packet to the station * \return the TXVECTOR to use to send a packet to the station * * Note: This method is called before sending a unicast packet or a fragment * of a unicast packet to decide which transmission mode to use. */ - virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) = 0; + virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint16_t allowedWidth) = 0; /** * \param station the station that we need to communicate * diff --git a/src/wifi/test/power-rate-adaptation-test.cc b/src/wifi/test/power-rate-adaptation-test.cc index 709c3ff67..db2d66ed4 100644 --- a/src/wifi/test/power-rate-adaptation-test.cc +++ b/src/wifi/test/power-rate-adaptation-test.cc @@ -169,7 +169,7 @@ PowerRateAdaptationTest::TestParf () /* * Parf initiates with maximal rate and power. */ - WifiTxVector txVector = manager->GetDataTxVector (packetHeader); + WifiTxVector txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); WifiMode mode = txVector.GetMode (); int power = (int) txVector.GetTxPowerLevel (); @@ -187,7 +187,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -202,7 +202,7 @@ PowerRateAdaptationTest::TestParf () */ manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -222,7 +222,7 @@ PowerRateAdaptationTest::TestParf () } manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -237,7 +237,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -253,7 +253,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataFailed (mpdu); manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -271,7 +271,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -286,7 +286,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -304,7 +304,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -322,7 +322,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -342,7 +342,7 @@ PowerRateAdaptationTest::TestParf () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -391,7 +391,7 @@ PowerRateAdaptationTest::TestAparf () /* * Aparf initiates with maximal rate and power. */ - WifiTxVector txVector = manager->GetDataTxVector (packetHeader); + WifiTxVector txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); WifiMode mode = txVector.GetMode (); int power = (int) txVector.GetTxPowerLevel (); @@ -410,7 +410,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -425,7 +425,7 @@ PowerRateAdaptationTest::TestAparf () */ manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -444,7 +444,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -463,7 +463,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -481,7 +481,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -496,7 +496,7 @@ PowerRateAdaptationTest::TestAparf () */ manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -514,7 +514,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -530,7 +530,7 @@ PowerRateAdaptationTest::TestAparf () */ manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -548,7 +548,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -568,7 +568,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -580,7 +580,7 @@ PowerRateAdaptationTest::TestAparf () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -661,7 +661,7 @@ PowerRateAdaptationTest::TestRrpaa () /* * RRPAA initiates with minimal rate and maximal power. */ - WifiTxVector txVector = manager->GetDataTxVector (packetHeader); + WifiTxVector txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); WifiMode mode = txVector.GetMode (); int power = (int) txVector.GetTxPowerLevel (); @@ -683,7 +683,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -695,7 +695,7 @@ PowerRateAdaptationTest::TestRrpaa () */ manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -713,7 +713,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -722,7 +722,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -740,7 +740,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -752,7 +752,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -764,7 +764,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -776,7 +776,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -788,7 +788,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -800,7 +800,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -812,7 +812,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -832,7 +832,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -841,7 +841,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -860,7 +860,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -878,7 +878,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -896,7 +896,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -914,7 +914,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -930,7 +930,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -950,7 +950,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -962,7 +962,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -974,7 +974,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataFailed (mpdu); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -986,7 +986,7 @@ PowerRateAdaptationTest::TestRrpaa () manager->ReportDataOk (mpdu, 0, ackMode, 0, txVector); } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); @@ -1012,7 +1012,7 @@ PowerRateAdaptationTest::TestRrpaa () } } - txVector = manager->GetDataTxVector (packetHeader); + txVector = manager->GetDataTxVector (packetHeader, dev->GetPhy ()->GetChannelWidth ()); mode = txVector.GetMode (); power = (int) txVector.GetTxPowerLevel (); diff --git a/src/wifi/test/wifi-aggregation-test.cc b/src/wifi/test/wifi-aggregation-test.cc index 5f8b5d970..125870383 100644 --- a/src/wifi/test/wifi-aggregation-test.cc +++ b/src/wifi/test/wifi-aggregation-test.cc @@ -196,7 +196,7 @@ AmpduAggregationTest::DoRun (void) Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); Ptr item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); auto mpduList = mpduAggregator->GetNextAmpdu (item, txParams, Time::Min ()); @@ -278,7 +278,7 @@ AmpduAggregationTest::DoRun (void) peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); txParams.Clear (); - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); mpduList = mpduAggregator->GetNextAmpdu (item, txParams, Time::Min ()); @@ -289,7 +289,7 @@ AmpduAggregationTest::DoRun (void) peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); txParams.Clear (); - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); mpduList = mpduAggregator->GetNextAmpdu (item, txParams, Time::Min ()); @@ -427,7 +427,7 @@ TwoLevelAggregationTest::DoRun (void) Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); htFem->TryAddMpdu (peeked, txParams, Time::Min ()); Ptr item = msduAggregator->GetNextAmsdu (peeked, txParams, Time::Min ()); @@ -449,7 +449,7 @@ TwoLevelAggregationTest::DoRun (void) peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); txParams.Clear (); - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); htFem->TryAddMpdu (peeked, txParams, Time::Min ()); item = msduAggregator->GetNextAmsdu (peeked, txParams, Time::Min ()); @@ -503,7 +503,7 @@ TwoLevelAggregationTest::DoRun (void) peeked = m_mac->GetVIQueue ()->PeekNextMpdu (); txParams.Clear (); - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); Time txopLimit = m_mac->GetVIQueue ()->GetTxopLimit (); // 3.008 ms // Compute the first MPDU to be aggregated in an A-MPDU. It must contain an A-MSDU @@ -691,7 +691,7 @@ HeAggregationTest::DoRunSubTest (uint16_t bufferSize) Ptr peeked = m_mac->GetBEQueue ()->PeekNextMpdu (); WifiTxParameters txParams; - txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader ()); + txParams.m_txVector = m_mac->GetWifiRemoteStationManager ()->GetDataTxVector (peeked->GetHeader (), m_phy->GetChannelWidth ()); Ptr item = m_mac->GetBEQueue ()->GetNextMpdu (peeked, txParams, Time::Min (), true); auto mpduList = mpduAggregator->GetNextAmpdu (item, txParams, Time::Min ());