16#include "ns3/wifi-phy-operating-channel.h"
17#include "ns3/wifi-phy.h"
18#include "ns3/wifi-psdu.h"
19#include "ns3/wifi-utils.h"
35 return (os <<
"PSD_NON_HE_PORTION");
37 return (os <<
"PSD_HE_PORTION");
40 return (os <<
"INVALID");
57 NS_LOG_FUNCTION(
this << psdus << txVector << channel << ppduDuration << uid << flag);
60 m_psdus.begin()->second =
nullptr;
76 m_txPsdFlag(PSD_NON_HE_PORTION)
78 NS_LOG_FUNCTION(
this << psdu << txVector << channel << ppduDuration << uid);
94 uint8_t sigExtension = 0;
100 uint8_t m =
IsDlMu() ? 1 : 2;
101 uint16_t length = ((ceil((
static_cast<double>(ppduDuration.
GetNanoSeconds() - (20 * 1000) -
102 (sigExtension * 1000)) /
124 const uint8_t noMuMimoUsers{0};
137 .m_center26ToneRuIndication =
172 auto heSigHeader = std::get_if<HeSuSigHeader>(&
m_heSig);
173 NS_ASSERT(heSigHeader && (heSigHeader->m_format == 1));
182 auto heSigHeader = std::get_if<HeTbSigHeader>(&
m_heSig);
183 NS_ASSERT(heSigHeader && (heSigHeader->m_format == 0));
189 auto heSigHeader = std::get_if<HeMuSigHeader>(&
m_heSig);
196 heSigHeader->m_center26ToneRuIndication,
197 heSigHeader->m_contentChannels,
198 heSigHeader->m_sigBCompression,
203 if (heSigHeader->m_center26ToneRuIndication.has_value())
207 if (heSigHeader->m_sigBCompression)
217 const std::vector<WifiRu::RuSpec>& ruSpecs,
225 const std::size_t ruIndexOffset =
226 (ruBw <
MHz_u{20}) ? (numRus * ruAllocIndex) : (ruAllocIndex / num20MhzSubchannelsInRu);
228 auto isPrimary80 =
true;
231 const auto isLow80 = ruAllocIndex < 4;
233 const auto primary80IsLower80 = (p20Index < bw /
MHz_u{40});
239 isPrimary80 = ((primary80IsLower80 && isLow80) || (!primary80IsLower80 && !isLow80));
251 std::optional<Center26ToneRuIndication> center26ToneRuIndication,
253 bool sigBcompression,
254 uint8_t numMuMimoUsers)
const
257 std::vector<uint8_t> remainingRuAllocIndices(ruAllocation.size());
258 std::iota(remainingRuAllocIndices.begin(), remainingRuAllocIndices.end(), 0);
259 std::size_t contentChannelIndex = 0;
260 std::size_t ruAllocIndex = 0;
261 for (
const auto& contentChannel : contentChannels)
263 std::size_t numRusLeft = 0;
264 std::size_t numUsersLeft = 0;
265 ruAllocIndex = remainingRuAllocIndices.front();
266 std::size_t numUsersLeftInCc = contentChannel.size();
267 if (contentChannel.empty())
269 const auto pos = std::find(remainingRuAllocIndices.cbegin(),
270 remainingRuAllocIndices.cend(),
272 remainingRuAllocIndices.erase(pos);
273 ++contentChannelIndex;
276 for (
const auto& userInfo : contentChannel)
278 if (center26ToneRuIndication && (numUsersLeftInCc == 1))
281 if ((contentChannelIndex == 0) &&
282 ((*center26ToneRuIndication ==
284 (*center26ToneRuIndication ==
292 else if ((contentChannelIndex == 1) &&
293 ((*center26ToneRuIndication ==
295 (*center26ToneRuIndication ==
305 NS_ASSERT(ruAllocIndex < ruAllocation.size());
306 const auto mc{WIFI_MOD_CLASS_HE};
307 auto ruSpecs = WifiRu::GetRuSpecs(ruAllocation.at(ruAllocIndex), mc);
308 while (ruSpecs.empty() && (ruAllocIndex < ruAllocation.size()))
310 const auto pos = std::find(remainingRuAllocIndices.cbegin(),
311 remainingRuAllocIndices.cend(),
313 remainingRuAllocIndices.erase(pos);
315 NS_ASSERT(ruAllocIndex < ruAllocation.size());
316 ruSpecs = WifiRu::GetRuSpecs(ruAllocation.at(ruAllocIndex), mc);
320 numRusLeft = ruSpecs.size();
322 if (numUsersLeft == 0)
326 numUsersLeft = numMuMimoUsers;
334 auto ruIndex = (ruSpecs.size() - numRusLeft);
335 const auto ruSpec = ruSpecs.at(ruIndex);
336 auto ruType = WifiRu::GetRuType(ruSpec);
339 ruType = WifiRu::GetRuType(ruAllocation.size() * MHz_u{20});
341 if (userInfo.staId != NO_USER_STA_ID)
344 GetRuSpec(ruAllocIndex, ruSpecs, ruType, ruIndex, txVector.GetChannelWidth())};
345 txVector.SetHeMuUserInfo(userInfo.staId, {ru, userInfo.mcs, userInfo.nss});
350 if (numRusLeft == 0 && numUsersLeft == 0)
352 const auto ruBw = WifiRu::GetBandwidth(ruType);
353 const uint8_t num20MhzSubchannelsInRu =
355 const auto pos = std::find(remainingRuAllocIndices.cbegin(),
356 remainingRuAllocIndices.cend(),
358 remainingRuAllocIndices.erase(pos);
359 ruAllocIndex += num20MhzSubchannelsInRu;
360 if (ruAllocIndex % 2 != contentChannelIndex)
366 contentChannelIndex++;
371HePpdu::GetTxDuration()
const
374 const auto& txVector = GetTxVector();
375 const auto length = m_lSig.GetLength();
376 const auto tSymbol = HePhy::GetSymbolDuration(txVector.GetGuardInterval());
377 const auto preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration(txVector);
380 uint8_t m =
IsDlMu() ? 1 : 2;
382 const auto calculatedDuration =
383 MicroSeconds(((ceil(
static_cast<double>(length + 3 + m) / 3)) * 4) + 20 + sigExtension);
384 NS_ASSERT(calculatedDuration > preambleDuration);
386 floor(
static_cast<double>((calculatedDuration - preambleDuration).GetNanoSeconds() -
387 (sigExtension * 1000)) /
388 tSymbol.GetNanoSeconds());
389 return (preambleDuration + (nSymbols * tSymbol) +
MicroSeconds(sigExtension));
399HePpdu::GetType()
const
419HePpdu::IsDlMu()
const
425HePpdu::IsUlMu()
const
431HePpdu::GetPsdu(uint8_t bssColor, uint16_t staId )
const
436 return m_psdus.at(SU_STA_ID);
441 auto heSigHeader = std::get_if<HeTbSigHeader>(&m_heSig);
444 if ((bssColor == 0) || (heSigHeader->m_bssColor == 0) ||
445 (bssColor == heSigHeader->m_bssColor))
447 return m_psdus.cbegin()->second;
452 auto heSigHeader = std::get_if<HeMuSigHeader>(&m_heSig);
454 if ((bssColor == 0) || (heSigHeader->m_bssColor == 0) ||
455 (bssColor == heSigHeader->m_bssColor))
457 const auto it = m_psdus.find(staId);
458 if (it != m_psdus.cend())
468HePpdu::GetStaId()
const
471 return m_psdus.begin()->first;
475HePpdu::GetTxChannelWidth()
const
477 if (
const auto& txVector = GetTxVector();
478 txVector.IsValid() && txVector.IsUlMu() && GetStaId() != SU_STA_ID)
481 const auto ruWidth = WifiRu::GetBandwidth(WifiRu::GetRuType(txVector.GetRu(GetStaId())));
483 (flag == PSD_NON_HE_PORTION && ruWidth <
MHz_u{20}) ?
MHz_u{20} : ruWidth;
484 NS_LOG_INFO(
"Use " << channelWidth <<
" MHz for TB PPDU from " << GetStaId() <<
" for "
490 return OfdmPpdu::GetTxChannelWidth();
495HePpdu::GetTxPsdFlag()
const
508HePpdu::UpdateTxVectorForUlMu(
const std::optional<WifiTxVector>& trigVector)
const
510 if (trigVector.has_value())
518 if (!m_txVector.has_value())
520 m_txVector = GetTxVector();
525 const auto staId = GetStaId();
526 if (trigVector.has_value() && trigVector->IsUlMu() &&
527 (trigVector->GetHeMuUserInfoMap().contains(staId)))
531 m_txVector->SetGuardInterval(trigVector->GetGuardInterval());
532 m_txVector->SetHeMuUserInfo(staId, trigVector->GetHeMuUserInfo(staId));
537 m_txVector->SetHeMuUserInfo(
539 {
HeRu::RuSpec{(WifiRu::GetRuType(m_txVector->GetChannelWidth())), 1,
true}, 0, 1});
543std::pair<std::size_t, std::size_t>
544HePpdu::GetNumRusPerHeSigBContentChannel(
547 std::optional<Center26ToneRuIndication> center26ToneRuIndication,
548 bool sigBCompression,
549 uint8_t numMuMimoUsers)
551 std::pair<std::size_t ,
560 if (channelWidth ==
MHz_u{20})
562 return {numMuMimoUsers, 0};
564 chSize.first = numMuMimoUsers / 2;
565 chSize.second = numMuMimoUsers / 2;
566 if (numMuMimoUsers != (chSize.first + chSize.second))
573 NS_ASSERT_MSG(!ruAllocation.empty(),
"RU allocation is not set");
575 "RU allocation is not consistent with packet bandwidth");
578 switch (
static_cast<uint16_t
>(channelWidth))
581 chSize.second += WifiRu::GetRuSpecs(ruAllocation[1], mc).size();
584 chSize.first += WifiRu::GetRuSpecs(ruAllocation[0], mc).size();
590 const auto ruAlloc = ruAllocation.at(n);
591 std::size_t num20MHz{1};
592 const auto ruSpecs = WifiRu::GetRuSpecs(ruAlloc, mc);
593 const auto nRuSpecs = ruSpecs.size();
596 const auto ruBw = WifiRu::GetBandwidth(WifiRu::GetRuType(ruSpecs.front()));
606 ccIndex = (chSize.first <= chSize.second) ? 0 : 1;
610 ccIndex = (n % 2 == 0) ? 0 : 1;
614 chSize.first += nRuSpecs;
618 chSize.second += nRuSpecs;
622 const auto skipNumIndices = (ccIndex == 0) ? num20MHz : num20MHz - 1;
632 if (center26ToneRuIndication)
634 switch (*center26ToneRuIndication)
636 case Center26ToneRuIndication::CENTER_26_TONE_RU_LOW_80_MHZ_ALLOCATED:
639 case Center26ToneRuIndication::CENTER_26_TONE_RU_HIGH_80_MHZ_ALLOCATED:
642 case Center26ToneRuIndication::CENTER_26_TONE_RU_LOW_AND_HIGH_80_MHZ_ALLOCATED:
646 case Center26ToneRuIndication::CENTER_26_TONE_RU_UNALLOCATED:
655HePpdu::GetHeSigBContentChannels(
const WifiTxVector& txVector, uint8_t p20Index)
660 if (channelWidth >
MHz_u{20})
662 contentChannels.emplace_back();
665 std::optional<HeSigBUserSpecificField> cc1Central26ToneRu;
666 std::optional<HeSigBUserSpecificField> cc2Central26ToneRu;
669 RuType prevRuType{RuType::RU_TYPE_MAX};
670 std::size_t prevRuIndex{0};
671 std::size_t prevCcIndex{0};
672 for (
const auto& [ru, staIds] : orderedMap)
674 const auto ruType = WifiRu::GetRuType(ru);
675 auto ruIdx = WifiRu::GetIndex(ru);
676 if ((ruType == RuType::RU_26_TONE) && (ruIdx == 19))
679 const auto staId = *staIds.cbegin();
681 if (std::get<HeRu::RuSpec>(ru).GetPrimary80MHz())
694 const auto ruIndex = WifiRu::GetPhyIndex(ru, channelWidth, p20Index);
695 if ((prevRuType < RuType::RU_TYPE_MAX) && (prevRuType != ruType))
697 prevRuIndex *= WifiRu::GetBandwidth(prevRuType) / WifiRu::GetBandwidth(ruType);
699 if (ruType >= RuType::RU_484_TONE)
701 for (
auto staId : staIds)
705 (contentChannels.at(0).size() <= contentChannels.at(1).size()) ? 0 : 1;
708 contentChannels[ccIndex].push_back({staId, userInfo.nss, userInfo.mcs});
714 const auto numRus = WifiRu::GetNRus(
MHz_u{20}, ruType, mc);
715 while (prevRuIndex < ruIndex - 1)
717 std::size_t ccIndex{0};
718 if (channelWidth <
MHz_u{40})
726 ccIndex = (contentChannels.at(0).size() <= contentChannels.at(1).size()) ? 0 : 1;
730 ccIndex = ((prevRuIndex / numRus) % 2 == 0) ? 0 : 1;
732 const auto central26TonesRus =
733 WifiRu::GetCentral26TonesRus(channelWidth, prevRuType, mc);
734 const auto isCentral26ToneRu = std::none_of(
735 central26TonesRus.cbegin(),
736 central26TonesRus.cend(),
737 [ruIndex, channelWidth, p20Index](
const auto& ruSpec) {
738 return WifiRu::GetPhyIndex(ruSpec, channelWidth, p20Index) == ruIndex;
740 if (ruType < RuType::RU_242_TONE && prevCcIndex == ccIndex &&
741 (ruType != RuType::RU_26_TONE || isCentral26ToneRu))
743 contentChannels[ccIndex].push_back({NO_USER_STA_ID, 0, 0});
746 prevCcIndex = ccIndex;
748 prevRuIndex = ruIndex;
750 for (
auto staId : staIds)
754 std::size_t ccIndex{0};
755 if (channelWidth <
MHz_u{40})
763 ccIndex = (contentChannels.at(0).size() <= contentChannels.at(1).size()) ? 0 : 1;
767 if (ruType == RuType::RU_26_TONE && ruIdx > 19)
772 ccIndex = (((ruIdx - 1) / numRus) % 2 == 0) ? 0 : 1;
774 contentChannels.at(ccIndex).push_back({staId, userInfo.nss, userInfo.mcs});
775 prevCcIndex = ccIndex;
779 if (cc1Central26ToneRu)
781 contentChannels.at(0).push_back(*cc1Central26ToneRu);
783 if (cc2Central26ToneRu)
785 contentChannels.at(1).push_back(*cc2Central26ToneRu);
789 if (!isSigBCompression)
792 auto numNumRusPerHeSigBContentChannel = GetNumRusPerHeSigBContentChannel(
798 std::size_t contentChannelIndex = 1;
799 for (
auto& contentChannel : contentChannels)
801 const auto totalUsersInContentChannel = (contentChannelIndex == 1)
802 ? numNumRusPerHeSigBContentChannel.first
803 : numNumRusPerHeSigBContentChannel.second;
804 NS_ASSERT(contentChannel.size() <= totalUsersInContentChannel);
805 std::size_t unallocatedRus = totalUsersInContentChannel - contentChannel.size();
806 for (std::size_t i = 0; i < unallocatedRus; i++)
808 contentChannel.push_back({NO_USER_STA_ID, 0, 0});
810 contentChannelIndex++;
814 return contentChannels;
818HePpdu::GetSigBFieldSize(
MHz_u channelWidth,
820 std::optional<Center26ToneRuIndication> center26ToneRuIndication,
821 bool sigBCompression,
822 std::size_t numMuMimoUsers)
826 if (!sigBCompression)
828 commonFieldSize = 4 + 6 ;
829 if (channelWidth <=
MHz_u{40})
831 commonFieldSize += 8;
836 8 * (channelWidth /
MHz_u{40}) +
841 auto numRusPerContentChannel = GetNumRusPerHeSigBContentChannel(channelWidth,
843 center26ToneRuIndication,
846 auto maxNumRusPerContentChannel =
847 std::max(numRusPerContentChannel.first, numRusPerContentChannel.second);
848 auto maxNumUserBlockFields = maxNumRusPerContentChannel /
850 std::size_t userSpecificFieldSize =
851 maxNumUserBlockFields * (2 * 21 + 4 + 6 );
852 if (maxNumRusPerContentChannel % 2 != 0)
854 userSpecificFieldSize += 21 + 4 + 6 ;
857 return commonFieldSize + userSpecificFieldSize;
861HePpdu::PrintPayload()
const
863 std::ostringstream ss;
867 ss <<
", " << m_txPsdFlag;
871 ss <<
"PSDU=" << m_psdus.at(SU_STA_ID) <<
" ";
877HePpdu::GetChannelWidthEncodingFromMhz(
MHz_u channelWidth)
879 if (channelWidth ==
MHz_u{160})
883 else if (channelWidth ==
MHz_u{80})
887 else if (channelWidth ==
MHz_u{40})
898HePpdu::GetChannelWidthMhzFromEncoding(uint8_t bandwidth)
904 else if (bandwidth == 2)
908 else if (bandwidth == 1)
919HePpdu::GetGuardIntervalAndNltfEncoding(
Time guardInterval, uint8_t nltf)
922 if ((gi == 800) && (nltf == 1))
926 else if ((gi == 800) && (nltf == 2))
930 else if ((gi == 1600) && (nltf == 2))
941HePpdu::GetGuardIntervalFromEncoding(uint8_t giAndNltfSize)
943 if (giAndNltfSize == 3)
948 else if (giAndNltfSize == 2)
959HePpdu::GetNstsEncodingFromNss(uint8_t nss)
966HePpdu::GetNssFromNstsEncoding(uint8_t nsts)
972HePpdu::GetMuMimoUsersEncoding(uint8_t nUsers)
979HePpdu::GetMuMimoUsersFromEncoding(uint8_t encoding)
981 return (encoding + 1);
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
HeSigHeader m_heSig
the HE-SIG PHY header
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
virtual void SetTxVectorFromPhyHeaders(WifiTxVector &txVector) const
Fill in the TXVECTOR from PHY headers.
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
@ PSD_HE_PORTION
HE portion of an HE PPDU.
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
virtual bool IsDlMu() const
Return true if the PPDU is a DL MU PPDU.
void SetHeMuUserInfos(WifiTxVector &txVector, const RuAllocation &ruAllocation, std::optional< Center26ToneRuIndication > center26ToneRuIndication, const HeSigBContentChannels &contentChannels, bool sigBCompression, uint8_t numMuMimoUsers) const
Reconstruct HeMuUserInfoMap from HE-SIG-B header.
virtual bool IsUlMu() const
Return true if the PPDU is an UL MU PPDU.
static uint8_t GetNstsEncodingFromNss(uint8_t nss)
Convert number of spatial streams to NSTS field encoding in HE-SIG-A.
virtual WifiRu::RuSpec GetRuSpec(std::size_t ruAllocIndex, const std::vector< WifiRu::RuSpec > &ruSpecs, RuType ruType, std::size_t ruIndex, MHz_u bw) const
Get the RU specification that has been assigned a given user.
void SetHeSigHeader(const WifiTxVector &txVector)
Fill in the HE-SIG header.
static uint8_t GetNssFromNstsEncoding(uint8_t nsts)
Convert number of spatial streams from NSTS field encoding in HE-SIG-A.
static Time GetGuardIntervalFromEncoding(uint8_t giAndNltfSize)
Convert guard interval from its encoding in HE-SIG-A.
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
static HeSigBContentChannels GetHeSigBContentChannels(const WifiTxVector &txVector, uint8_t p20Index)
Get the HE SIG-B content channels for a given PPDU IEEE 802.11ax-2021 27.3.11.8.2 HE-SIG-B content ch...
std::vector< std::vector< HeSigBUserSpecificField > > HeSigBContentChannels
HE SIG-B Content Channels.
static uint8_t GetMuMimoUsersEncoding(uint8_t nUsers)
Convert number of MU-MIMO users to its encoding in HE-SIG-A.
static MHz_u GetChannelWidthMhzFromEncoding(uint8_t bandwidth)
Convert channel width expressed in MHz from bandwidth field encoding in HE-SIG-A.
virtual bool IsMu() const
Return true if the PPDU is a MU PPDU.
static uint8_t GetChannelWidthEncodingFromMhz(MHz_u channelWidth)
Convert channel width expressed in MHz to bandwidth field encoding in HE-SIG-A.
void SetLSigHeader(Time ppduDuration)
Fill in the L-SIG header.
HePpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, const WifiPhyOperatingChannel &channel, Time ppduDuration, uint64_t uid)
Create an SU HE PPDU, storing a PSDU.
static uint8_t GetGuardIntervalAndNltfEncoding(Time guardInterval, uint8_t nltf)
Convert guard interval and NLTF to its encoding in HE-SIG-A.
static uint8_t GetMuMimoUsersFromEncoding(uint8_t encoding)
Convert number of MU-MIMO users from its encoding in HE-SIG-A.
static std::vector< RuSpec > GetRusOfType(MHz_u bw, RuType ruType)
Get the set of distinct RUs of the given type (number of tones) available in a HE PPDU of the given b...
static std::size_t GetNRus(MHz_u bw, RuType ruType)
Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the give...
LSigHeader m_lSig
the L-SIG PHY header
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
static WifiMode GetVhtMcs(uint8_t index)
Return the VHT MCS corresponding to the provided index.
uint8_t GetMcsValue() const
Class that keeps track of all information about the current PHY operating channel.
bool IsSet() const
Return true if a valid channel has been set, false otherwise.
uint8_t GetPrimaryChannelIndex(MHz_u primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
WifiPhyBand GetPhyBand() const
Return the PHY band of the operating channel.
const WifiPhyOperatingChannel & m_operatingChannel
the operating channel of the PHY
WifiPreamble m_preamble
the PHY preamble
WifiConstPsduMap m_psdus
the PSDUs contained in this PPDU
std::variant< HeRu::RuSpec, EhtRu::RuSpec > RuSpec
variant of the RU specification
static MHz_u GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
static std::size_t GetIndex(RuSpec ru)
Get the index of a given RU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetCenter26ToneRuIndication(Center26ToneRuIndication center26ToneRuIndication)
Set CENTER_26_TONE_RU field.
void SetRuAllocation(const RuAllocation &ruAlloc, uint8_t p20Index)
Set RU_ALLOCATION field.
UserInfoMapOrderedByRus GetUserInfoMapOrderedByRus(uint8_t p20Index) const
Get the map of specific user info parameters ordered per increasing frequency RUs.
bool IsSigBCompression() const
Indicate whether the Common field is present in the HE-SIG-B field.
uint8_t GetBssColor() const
Get the BSS color.
const RuAllocation & GetRuAllocation(uint8_t p20Index) const
Get RU_ALLOCATION field.
void SetGuardInterval(Time guardInterval)
Sets the guard interval duration (in nanoseconds)
std::optional< Center26ToneRuIndication > GetCenter26ToneRuIndication() const
Get CENTER_26_TONE_RU field This field is present if format is HE_MU and when channel width is set to...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
RuAllocation m_ruAllocation
RU allocations that are going to be carried in SIG-B common field per Table 27-1 IEEE.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetChannelWidth(MHz_u channelWidth)
Sets the selected channelWidth.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
MHz_u GetChannelWidth() const
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
void SetBssColor(uint8_t color)
Set the BSS color.
Time GetGuardInterval() const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiMode GetSigBMode() const
Get MCS used for SIG-B.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Center26ToneRuIndication
Enum for the different values for CENTER_26_TONE_RU.
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
@ CENTER_26_TONE_RU_LOW_AND_HIGH_80_MHZ_ALLOCATED
@ CENTER_26_TONE_RU_HIGH_80_MHZ_ALLOCATED
@ CENTER_26_TONE_RU_LOW_80_MHZ_ALLOCATED
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Declaration of ns3::HePhy class and ns3::HeSigAParameters struct.
Declaration of ns3::HePpdu class.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
RuType
The different Resource Unit (RU) types.
bool IsMu(WifiPreamble preamble)
Return true if a preamble corresponds to a multi-user transmission.
double MHz_u
MHz weak type.
std::size_t Count20MHzSubchannels(MHz_u channelWidth)
Return the number of 20 MHz subchannels covering the channel width.
bool IsDlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a downlink multi-user transmission.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
bool IsUlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a uplink multi-user transmission.
std::vector< uint16_t > RuAllocation
9 bits RU_ALLOCATION per 20 MHz
User Specific Fields in HE-SIG-Bs.
uint8_t nss
number of spatial streams