diff --git a/src/wifi/model/he/rr-multi-user-scheduler.cc b/src/wifi/model/he/rr-multi-user-scheduler.cc index e851247e5..d7815f91c 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.cc +++ b/src/wifi/model/he/rr-multi-user-scheduler.cc @@ -221,6 +221,15 @@ RrMultiUserScheduler::GetTxVectorForUlMu(Func canbeSolicited) continue; } + if (txVector.GetPreambleType() == WIFI_PREAMBLE_EHT_TB && + !m_apMac->GetEhtSupported(staIt->address)) + { + NS_LOG_DEBUG( + "Skipping non-EHT STA because this Trigger Frame is only soliciting EHT STAs"); + staIt++; + continue; + } + uint8_t tid = 0; while (tid < 8) { @@ -239,6 +248,17 @@ RrMultiUserScheduler::GetTxVectorForUlMu(Func canbeSolicited) continue; } + // if the first candidate STA is an EHT STA, we switch to soliciting EHT TB PPDUs + if (txVector.GetHeMuUserInfoMap().empty()) + { + if (m_apMac->GetEhtSupported() && m_apMac->GetEhtSupported(staIt->address)) + { + txVector.SetPreambleType(WIFI_PREAMBLE_EHT_TB); + txVector.SetEhtPpduType(0); + } + // TODO otherwise, make sure the TX width does not exceed 160 MHz + } + // prepare the MAC header of a frame that would be sent to the candidate station, // just for the purpose of retrieving the TXVECTOR used to transmit to that station WifiMacHeader hdr(WIFI_MAC_QOSDATA); @@ -616,6 +636,14 @@ RrMultiUserScheduler::TrySendingDlMuPpdu() { NS_LOG_DEBUG("Next candidate STA (MAC=" << staIt->address << ", AID=" << staIt->aid << ")"); + if (m_txParams.m_txVector.GetPreambleType() == WIFI_PREAMBLE_EHT_MU && + !m_apMac->GetEhtSupported(staIt->address)) + { + NS_LOG_DEBUG("Skipping non-EHT STA because this DL MU PPDU is sent to EHT STAs only"); + staIt++; + continue; + } + HeRu::RuType currRuType = (m_candidates.size() < count ? ruType : HeRu::RU_26_TONE); // check if the AP has at least one frame to be sent to the current station @@ -670,6 +698,17 @@ RrMultiUserScheduler::TrySendingDlMuPpdu() } } + // the first candidate STA determines the preamble type for the DL MU PPDU + if (m_candidates.size() == 1) + { + if (m_apMac->GetEhtSupported() && m_apMac->GetEhtSupported(staIt->address)) + { + m_txParams.m_txVector.SetPreambleType(WIFI_PREAMBLE_EHT_MU); + m_txParams.m_txVector.SetEhtPpduType(0); // indicates DL OFDMA transmission + } + // TODO otherwise, make sure the TX width does not exceed 160 MHz + } + // move to the next station in the list staIt++; } diff --git a/src/wifi/model/he/rr-multi-user-scheduler.h b/src/wifi/model/he/rr-multi-user-scheduler.h index bba425659..a470f1c35 100644 --- a/src/wifi/model/he/rr-multi-user-scheduler.h +++ b/src/wifi/model/he/rr-multi-user-scheduler.h @@ -34,8 +34,9 @@ namespace ns3 * transmission if the AP has frames to transmit to at least one station. * RrMultiUserScheduler assigns RUs of equal size (in terms of tones) to stations to * which the AP has frames to transmit belonging to the AC who gained access to the - * channel or higher. The maximum number of stations that can be granted an RU - * is configurable. Associated stations are served in a round robin fashion. + * channel or higher. The maximum number of stations that can be granted an RU is + * configurable. Associated stations are served based on their priority. The priority is + * determined by the credits/debits a station gets when it is selected or not for transmission. * * \todo Take the supported channel width of the stations into account while selecting * stations and assigning RUs to them.