diff --git a/src/wifi/model/he/he-ru.cc b/src/wifi/model/he/he-ru.cc index b5a18908c..9d6f5edc6 100644 --- a/src/wifi/model/he/he-ru.cc +++ b/src/wifi/model/he/he-ru.cc @@ -411,7 +411,7 @@ HeRu::GetRuSpecs(uint8_t ruAllocation) } uint8_t -HeRu::GetEqualizedRuAllocation(RuType ruType, bool isOdd) +HeRu::GetEqualizedRuAllocation(RuType ruType, bool isOdd, bool hasUsers) { switch (ruType) { @@ -422,11 +422,11 @@ HeRu::GetEqualizedRuAllocation(RuType ruType, bool isOdd) case HeRu::RU_106_TONE: return isOdd ? 128 : 96; case HeRu::RU_242_TONE: - return 192; + return hasUsers ? 192 : 113; case HeRu::RU_484_TONE: - return 200; + return hasUsers ? 200 : 114; default: - return 208; + return hasUsers ? 208 : 115; } } diff --git a/src/wifi/model/he/he-ru.h b/src/wifi/model/he/he-ru.h index d0d7f5982..ddeb738f2 100644 --- a/src/wifi/model/he/he-ru.h +++ b/src/wifi/model/he/he-ru.h @@ -295,8 +295,10 @@ class HeRu /// Get the RU_ALLOCATION value for equal size RUs /// @param ruType equal size RU type (generated by GetEqualSizedRusForStations) /// @param isOdd if number of stations is an odd number + /// @param hasUsers whether it contributes to User field(s) in the content channel this RU + /// Allocation belongs to /// @return RU_ALLOCATION value - static uint8_t GetEqualizedRuAllocation(RuType ruType, bool isOdd); + static uint8_t GetEqualizedRuAllocation(RuType ruType, bool isOdd, bool hasUsers); /// Empty 242-tone RU identifier static constexpr uint8_t EMPTY_242_TONE_RU = 113; diff --git a/src/wifi/model/wifi-tx-vector.cc b/src/wifi/model/wifi-tx-vector.cc index 28aa05b7c..82cc0ba97 100644 --- a/src/wifi/model/wifi-tx-vector.cc +++ b/src/wifi/model/wifi-tx-vector.cc @@ -828,7 +828,7 @@ WifiTxVector::DeriveRuAllocation(uint8_t p20Index) const const auto index = (ruBw < MHz_u{20}) ? ((ruIndex - 1) / rusPerSubchannel.size()) : ((ruIndex - 1) * numSubchannelsForRu); NS_ABORT_IF(index >= Count20MHzSubchannels(m_channelWidth)); - auto ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, false); + auto ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, false, true); if (ruAllocations.at(index) != HeRu::EMPTY_242_TONE_RU) { if (ruType == ruTypes.at(index)) @@ -837,11 +837,11 @@ WifiTxVector::DeriveRuAllocation(uint8_t p20Index) const } if (ruType == HeRu::RU_26_TONE) { - ruAlloc = HeRu::GetEqualizedRuAllocation(ruTypes.at(index), true); + ruAlloc = HeRu::GetEqualizedRuAllocation(ruTypes.at(index), true, true); } else if (ruTypes.at(index) == HeRu::RU_26_TONE) { - ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, true); + ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, true, true); } else {