A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-tx-vector.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 CTTC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Nicola Baldo <nbaldo@cttc.es>
18 * Ghada Badawy <gbadawy@gmail.com>
19 */
20
21#include "wifi-tx-vector.h"
22
23#include "wifi-phy-common.h"
24
25#include "ns3/abort.h"
26#include "ns3/eht-phy.h"
27
28#include <algorithm>
29#include <iterator>
30
31namespace ns3
32{
33
35 : m_txPowerLevel(1),
36 m_preamble(WIFI_PREAMBLE_LONG),
37 m_channelWidth(20),
38 m_guardInterval(800),
39 m_nTx(1),
40 m_nss(1),
41 m_ness(0),
42 m_aggregation(false),
43 m_stbc(false),
44 m_ldpc(false),
45 m_bssColor(0),
46 m_length(0),
47 m_triggerResponding(false),
48 m_modeInitialized(false),
49 m_inactiveSubchannels(),
50 m_ruAllocation(),
51 m_center26ToneRuIndication(std::nullopt),
52 m_ehtPpduType(1) // SU transmission by default
53{
54}
55
57 uint8_t powerLevel,
58 WifiPreamble preamble,
59 uint16_t guardInterval,
60 uint8_t nTx,
61 uint8_t nss,
62 uint8_t ness,
63 uint16_t channelWidth,
64 bool aggregation,
65 bool stbc,
66 bool ldpc,
67 uint8_t bssColor,
68 uint16_t length,
69 bool triggerResponding)
70 : m_mode(mode),
71 m_txPowerLevel(powerLevel),
72 m_preamble(preamble),
73 m_channelWidth(channelWidth),
74 m_guardInterval(guardInterval),
75 m_nTx(nTx),
76 m_nss(nss),
77 m_ness(ness),
78 m_aggregation(aggregation),
79 m_stbc(stbc),
80 m_ldpc(ldpc),
81 m_bssColor(bssColor),
82 m_length(length),
83 m_triggerResponding(triggerResponding),
84 m_modeInitialized(true),
85 m_inactiveSubchannels(),
86 m_ruAllocation(),
87 m_center26ToneRuIndication(std::nullopt),
88 m_ehtPpduType(1) // SU transmission by default
89{
90}
91
93 : m_mode(txVector.m_mode),
94 m_txPowerLevel(txVector.m_txPowerLevel),
95 m_preamble(txVector.m_preamble),
96 m_channelWidth(txVector.m_channelWidth),
97 m_guardInterval(txVector.m_guardInterval),
98 m_nTx(txVector.m_nTx),
99 m_nss(txVector.m_nss),
100 m_ness(txVector.m_ness),
101 m_aggregation(txVector.m_aggregation),
102 m_stbc(txVector.m_stbc),
103 m_ldpc(txVector.m_ldpc),
104 m_bssColor(txVector.m_bssColor),
105 m_length(txVector.m_length),
106 m_triggerResponding(txVector.m_triggerResponding),
107 m_modeInitialized(txVector.m_modeInitialized),
108 m_inactiveSubchannels(txVector.m_inactiveSubchannels),
109 m_sigBMcs(txVector.m_sigBMcs),
110 m_ruAllocation(txVector.m_ruAllocation),
111 m_center26ToneRuIndication(txVector.m_center26ToneRuIndication),
112 m_ehtPpduType(txVector.m_ehtPpduType)
113{
114 m_muUserInfos.clear();
115 if (!txVector.m_muUserInfos.empty()) // avoids crashing for loop
116 {
117 for (auto& info : txVector.m_muUserInfos)
118 {
119 m_muUserInfos.insert(std::make_pair(info.first, info.second));
120 }
121 }
122}
123
125{
126 m_muUserInfos.clear();
127}
128
129bool
131{
132 return m_modeInitialized;
133}
134
136WifiTxVector::GetMode(uint16_t staId) const
137{
139 {
140 NS_FATAL_ERROR("WifiTxVector mode must be set before using");
141 }
142 if (!IsMu())
143 {
144 return m_mode;
145 }
146 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU (" << staId << ")");
147 const auto userInfoIt = m_muUserInfos.find(staId);
148 NS_ASSERT(userInfoIt != m_muUserInfos.cend());
150 {
152 return EhtPhy::GetEhtMcs(userInfoIt->second.mcs);
154 return HePhy::GetHeMcs(userInfoIt->second.mcs);
155 default:
156 NS_ABORT_MSG("Unsupported modulation class: " << GetModulationClassForPreamble(m_preamble));
157 }
158 return WifiMode(); // invalid WifiMode
159}
160
163{
164 NS_ABORT_MSG_IF(!m_modeInitialized, "WifiTxVector mode must be set before using");
165
166 if (IsMu())
167 {
168 NS_ASSERT(!m_muUserInfos.empty());
169 // all the modes belong to the same modulation class
171 }
172 return m_mode.GetModulationClass();
173}
174
175uint8_t
177{
178 return m_txPowerLevel;
179}
180
183{
184 return m_preamble;
185}
186
187uint16_t
189{
190 return m_channelWidth;
191}
192
193uint16_t
195{
196 return m_guardInterval;
197}
198
199uint8_t
201{
202 return m_nTx;
203}
204
205uint8_t
206WifiTxVector::GetNss(uint16_t staId) const
207{
208 if (IsMu())
209 {
210 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU (" << staId << ")");
211 NS_ASSERT(m_muUserInfos.find(staId) != m_muUserInfos.end());
212 return m_muUserInfos.at(staId).nss;
213 }
214 return m_nss;
215}
216
217uint8_t
219{
220 uint8_t nss = 0;
221 if (IsMu())
222 {
223 for (const auto& info : m_muUserInfos)
224 {
225 nss = (nss < info.second.nss) ? info.second.nss : nss;
226 }
227 }
228 else
229 {
230 nss = m_nss;
231 }
232 return nss;
233}
234
235uint8_t
237{
238 return m_ness;
239}
240
241bool
243{
244 return m_aggregation;
245}
246
247bool
249{
250 return m_stbc;
251}
252
253bool
255{
256 return m_ldpc;
257}
258
259bool
261{
262 return ((m_channelWidth >= 40) && !IsMu() &&
264}
265
266void
268{
269 m_mode = mode;
270 m_modeInitialized = true;
271}
272
273void
274WifiTxVector::SetMode(WifiMode mode, uint16_t staId)
275{
276 NS_ABORT_MSG_IF(!IsMu(), "Not a MU transmission");
277 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU");
278 m_muUserInfos[staId].mcs = mode.GetMcsValue();
279 m_modeInitialized = true;
280}
281
282void
284{
285 m_txPowerLevel = powerlevel;
286}
287
288void
290{
291 m_preamble = preamble;
292}
293
294void
295WifiTxVector::SetChannelWidth(uint16_t channelWidth)
296{
297 m_channelWidth = channelWidth;
298}
299
300void
301WifiTxVector::SetGuardInterval(uint16_t guardInterval)
302{
303 m_guardInterval = guardInterval;
304}
305
306void
308{
309 m_nTx = nTx;
310}
311
312void
314{
315 m_nss = nss;
316}
317
318void
319WifiTxVector::SetNss(uint8_t nss, uint16_t staId)
320{
321 NS_ABORT_MSG_IF(!IsMu(), "Not a MU transmission");
322 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU");
323 m_muUserInfos[staId].nss = nss;
324}
325
326void
328{
329 m_ness = ness;
330}
331
332void
334{
335 m_aggregation = aggregation;
336}
337
338void
340{
341 m_stbc = stbc;
342}
343
344void
346{
347 m_ldpc = ldpc;
348}
349
350void
352{
353 m_bssColor = color;
354}
355
356uint8_t
358{
359 return m_bssColor;
360}
361
362void
364{
365 m_length = length;
366}
367
368uint16_t
370{
371 return m_length;
372}
373
374bool
376{
377 return m_triggerResponding;
378}
379
380void
382{
383 m_triggerResponding = triggerResponding;
384}
385
386void
388{
389 m_sigBMcs = mode;
390}
391
394{
395 return m_sigBMcs;
396}
397
398void
399WifiTxVector::SetRuAllocation(const RuAllocation& ruAlloc, uint8_t p20Index)
400{
401 if (ns3::IsDlMu(m_preamble) && !m_muUserInfos.empty())
402 {
403 NS_ASSERT(ruAlloc == DeriveRuAllocation(p20Index));
404 }
405 m_ruAllocation = ruAlloc;
406}
407
408const RuAllocation&
409WifiTxVector::GetRuAllocation(uint8_t p20Index) const
410{
411 if (ns3::IsDlMu(m_preamble) && m_ruAllocation.empty())
412 {
414 }
415 return m_ruAllocation;
416}
417
418void
420{
422 m_ehtPpduType = type;
423}
424
425uint8_t
427{
428 return m_ehtPpduType;
429}
430
431bool
433{
434 if (!GetModeInitialized())
435 {
436 return false;
437 }
438 std::string modeName = m_mode.GetUniqueName();
439 if (m_channelWidth == 20)
440 {
441 if (m_nss != 3 && m_nss != 6)
442 {
443 return (modeName != "VhtMcs9");
444 }
445 }
446 else if (m_channelWidth == 80)
447 {
448 if (m_nss == 3 || m_nss == 7)
449 {
450 return (modeName != "VhtMcs6");
451 }
452 else if (m_nss == 6)
453 {
454 return (modeName != "VhtMcs9");
455 }
456 }
457 else if (m_channelWidth == 160)
458 {
459 if (m_nss == 3)
460 {
461 return (modeName != "VhtMcs9");
462 }
463 }
464 return true;
465}
466
467bool
469{
470 return IsDlMu() || IsUlMu();
471}
472
473bool
475{
476 return ns3::IsDlMu(m_preamble) && !(IsEht(m_preamble) && m_ehtPpduType == 1);
477}
478
479bool
481{
482 return ns3::IsUlMu(m_preamble);
483}
484
485bool
486WifiTxVector::IsAllocated(uint16_t staId) const
487{
488 return m_muUserInfos.count(staId) > 0;
489}
490
492WifiTxVector::GetRu(uint16_t staId) const
493{
494 NS_ABORT_MSG_IF(!IsMu(), "RU only available for MU");
495 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU");
496 return m_muUserInfos.at(staId).ru;
497}
498
499void
501{
502 NS_ABORT_MSG_IF(!IsMu(), "RU only available for MU");
503 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU");
504 m_muUserInfos[staId].ru = ru;
505}
506
508WifiTxVector::GetHeMuUserInfo(uint16_t staId) const
509{
510 NS_ABORT_MSG_IF(!IsMu(), "HE MU user info only available for MU");
511 return m_muUserInfos.at(staId);
512}
513
514void
516{
517 NS_ABORT_MSG_IF(!IsMu(), "HE MU user info only available for MU");
518 NS_ABORT_MSG_IF(staId > 2048, "STA-ID should be correctly set for MU");
519 m_muUserInfos[staId] = userInfo;
520 m_modeInitialized = true;
521 m_ruAllocation.clear();
522}
523
526{
527 NS_ABORT_MSG_IF(!IsMu(), "HE MU user info map only available for MU");
528 return m_muUserInfos;
529}
530
533{
534 NS_ABORT_MSG_IF(!IsMu(), "HE MU user info map only available for MU");
535 m_ruAllocation.clear();
536 return m_muUserInfos;
537}
538
539void
540WifiTxVector::SetInactiveSubchannels(const std::vector<bool>& inactiveSubchannels)
541{
543 "Only HE (or later) authorized for preamble puncturing");
545 m_channelWidth < 80,
546 "Preamble puncturing only possible for transmission bandwidth of 80 MHz or larger");
547 NS_ABORT_MSG_IF(!inactiveSubchannels.empty() &&
548 inactiveSubchannels.size() != (m_channelWidth / 20),
549 "The size of the inactive subchannnels bitmap should be equal to the number of "
550 "20 MHz subchannels");
551 m_inactiveSubchannels = inactiveSubchannels;
552}
553
554const std::vector<bool>&
556{
558}
559
560void
562{
563 if (IsDlMu())
564 {
565 NS_ASSERT(center26ToneRuIndication == DeriveCenter26ToneRuIndication());
566 }
567 m_center26ToneRuIndication = center26ToneRuIndication;
568}
569
570std::optional<Center26ToneRuIndication>
572{
573 if (!IsDlMu() || (m_channelWidth < 80))
574 {
575 return std::nullopt;
576 }
577 if (!m_center26ToneRuIndication.has_value())
578 {
580 }
582}
583
584std::ostream&
585operator<<(std::ostream& os, const WifiTxVector& v)
586{
587 if (!v.IsValid())
588 {
589 os << "TXVECTOR not valid";
590 return os;
591 }
592 os << "txpwrlvl: " << +v.GetTxPowerLevel() << " preamble: " << v.GetPreambleType()
593 << " channel width: " << v.GetChannelWidth() << " GI: " << v.GetGuardInterval()
594 << " NTx: " << +v.GetNTx() << " Ness: " << +v.GetNess()
595 << " MPDU aggregation: " << v.IsAggregation() << " STBC: " << v.IsStbc()
596 << " FEC coding: " << (v.IsLdpc() ? "LDPC" : "BCC");
598 {
599 os << " BSS color: " << +v.GetBssColor();
600 }
601 if (v.IsUlMu())
602 {
603 os << " Length: " << v.GetLength();
604 }
606 {
607 os << " SIG-B mode: " << v.GetSigBMode();
608 }
609 if (v.IsMu())
610 {
612 os << " num User Infos: " << userInfoMap.size();
613 for (auto& ui : userInfoMap)
614 {
615 os << ", {STA-ID: " << ui.first << ", " << ui.second.ru << ", MCS: " << +ui.second.mcs
616 << ", Nss: " << +ui.second.nss << "}";
617 }
618 }
619 else
620 {
621 os << " mode: " << v.GetMode() << " Nss: " << +v.GetNss();
622 }
623 const auto& puncturedSubchannels = v.GetInactiveSubchannels();
624 if (!puncturedSubchannels.empty())
625 {
626 os << " Punctured subchannels: ";
627 std::copy(puncturedSubchannels.cbegin(),
628 puncturedSubchannels.cend(),
629 std::ostream_iterator<bool>(os, ", "));
630 }
631 if (IsEht(v.GetPreambleType()))
632 {
633 os << " EHT PPDU type: " << +v.GetEhtPpduType();
634 }
635 return os;
636}
637
638bool
640{
641 return ru == other.ru && mcs == other.mcs && nss == other.nss;
642}
643
644bool
646{
647 return !(*this == other);
648}
649
652{
653 auto heRuComparator = HeRu::RuSpecCompare(m_channelWidth, p20Index);
654 UserInfoMapOrderedByRus orderedMap{heRuComparator};
655 std::transform(
656 m_muUserInfos.cbegin(),
657 m_muUserInfos.cend(),
658 std::inserter(orderedMap, orderedMap.end()),
659 [](auto&& userInfo) { return std::make_pair(userInfo.second.ru, userInfo.first); });
660 return orderedMap;
661}
662
664WifiTxVector::DeriveRuAllocation(uint8_t p20Index) const
665{
667 std::vector<HeRu::RuType> ruTypes{};
668 ruTypes.resize(ruAllocations.size());
669 const auto& orderedMap = GetUserInfoMapOrderedByRus(p20Index);
670 for (const auto& [ru, staId] : orderedMap)
671 {
672 const auto ruType = ru.GetRuType();
673 const auto ruBw = HeRu::GetBandwidth(ruType);
674 const auto isPrimary80MHz = ru.GetPrimary80MHz();
675 const auto rusPerSubchannel = HeRu::GetRusOfType(ruBw > 20 ? ruBw : 20, ruType);
676 auto ruIndex = ru.GetIndex();
677 if ((m_channelWidth >= 80) && (ruIndex > 19))
678 {
679 // take into account the center 26-tone RU in the primary 80 MHz
680 ruIndex--;
681 }
682 if ((!isPrimary80MHz) && (ruIndex > 19))
683 {
684 // take into account the center 26-tone RU in the secondary 80 MHz
685 ruIndex--;
686 }
687 if (!isPrimary80MHz && (ruType != HeRu::RU_2x996_TONE))
688 {
690 // adjust RU index for the secondary 80 MHz: in that case index is restarting at 1,
691 // hence we need to add an offset corresponding to the number of RUs of the same type in
692 // the primary 80 MHz
693 ruIndex += HeRu::GetRusOfType(80, ruType).size();
694 }
695 const auto index =
696 (ruBw < 20) ? ((ruIndex - 1) / rusPerSubchannel.size()) : ((ruIndex - 1) * (ruBw / 20));
697 const auto numSubchannelsForRu = (ruBw < 20) ? 1 : (ruBw / 20);
698 NS_ABORT_IF(index >= (m_channelWidth / 20));
699 auto ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, false);
700 if (ruAllocations.at(index) != HeRu::EMPTY_242_TONE_RU)
701 {
702 if (ruType == ruTypes.at(index))
703 {
704 continue;
705 }
706 if (ruType == HeRu::RU_26_TONE)
707 {
708 ruAlloc = HeRu::GetEqualizedRuAllocation(ruTypes.at(index), true);
709 }
710 else if (ruTypes.at(index) == HeRu::RU_26_TONE)
711 {
712 ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, true);
713 }
714 else
715 {
716 NS_ASSERT_MSG(false, "unsupported RU combination");
717 }
718 }
719 for (auto i = 0; i < numSubchannelsForRu; ++i)
720 {
721 ruTypes.at(index + i) = ruType;
722 ruAllocations.at(index + i) = ruAlloc;
723 }
724 }
725 return ruAllocations;
726}
727
730{
731 uint8_t center26ToneRuIndication{0};
732 for (const auto& userInfo : m_muUserInfos)
733 {
734 if ((userInfo.second.ru.GetRuType() == HeRu::RU_26_TONE) &&
735 (userInfo.second.ru.GetIndex() == 19))
736 {
737 center26ToneRuIndication |= (userInfo.second.ru.GetPrimary80MHz())
740 }
741 }
742 return static_cast<Center26ToneRuIndication>(center26ToneRuIndication);
743}
744
745} // namespace ns3
static WifiMode GetEhtMcs(uint8_t index)
Return the EHT MCS corresponding to the provided index.
Definition: eht-phy.cc:238
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
Definition: he-phy.cc:1562
RU Specification.
Definition: he-ru.h:66
static uint16_t GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
Definition: he-ru.cc:762
static constexpr uint8_t EMPTY_242_TONE_RU
Empty 242-tone RU identifier.
Definition: he-ru.h:304
static std::vector< HeRu::RuSpec > GetRusOfType(uint16_t bw, HeRu::RuType ruType)
Get the set of distinct RUs of the given type (number of tones) available in a HE PPDU of the given b...
Definition: he-ru.cc:510
static uint8_t GetEqualizedRuAllocation(RuType ruType, bool isOdd)
Get the RU_ALLOCATION value for equal size RUs.
Definition: he-ru.cc:420
@ RU_26_TONE
Definition: he-ru.h:42
@ RU_2x996_TONE
Definition: he-ru.h:48
represent a single transmission mode
Definition: wifi-mode.h:51
std::string GetUniqueName() const
Definition: wifi-mode.cc:148
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:185
uint8_t GetMcsValue() const
Definition: wifi-mode.cc:163
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint16_t m_channelWidth
channel width in MHz
void SetCenter26ToneRuIndication(Center26ToneRuIndication center26ToneRuIndication)
Set CENTER_26_TONE_RU field.
void SetRuAllocation(const RuAllocation &ruAlloc, uint8_t p20Index)
Set RU_ALLOCATION field.
void SetStbc(bool stbc)
Sets if STBC is being used.
void SetNess(uint8_t ness)
Sets the Ness number.
UserInfoMapOrderedByRus GetUserInfoMapOrderedByRus(uint8_t p20Index) const
Get the map of specific user info parameters ordered per increasing frequency RUs.
bool IsTriggerResponding() const
Return true if the Trigger Responding parameter is set to true, false otherwise.
bool m_aggregation
Flag whether the PSDU contains A-MPDU.
void SetEhtPpduType(uint8_t type)
Set the EHT_PPDU_TYPE parameter.
uint16_t GetGuardInterval() const
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
bool IsValid() const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint8_t GetBssColor() const
Get the BSS color.
bool GetModeInitialized() const
const RuAllocation & GetRuAllocation(uint8_t p20Index) const
Get RU_ALLOCATION field.
std::optional< Center26ToneRuIndication > m_center26ToneRuIndication
CENTER_26_TONE_RU field when format is HE_MU and when channel width is set to 80 MHz or larger (Table...
std::vector< bool > m_inactiveSubchannels
Bitmap of inactive subchannels used for preamble puncturing.
WifiMode m_mode
The DATARATE parameter in Table 15-4.
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info parameters indexed by STA-ID
uint8_t GetNTx() const
void SetGuardInterval(uint16_t 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...
void SetTriggerResponding(bool triggerResponding)
Set the Trigger Responding parameter to the given value.
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 SetInactiveSubchannels(const std::vector< bool > &inactiveSubchannels)
Set the 20 MHz subchannels that are punctured.
std::map< HeRu::RuSpec, uint16_t, HeRu::RuSpecCompare > UserInfoMapOrderedByRus
map of specific user info parameters ordered per increasing frequency RUs
bool IsStbc() const
Check if STBC is used or not.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
uint8_t m_nTx
number of TX antennas
bool m_triggerResponding
The Trigger Responding parameter.
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information indexed by station ID (STA-ID) corresponding to the 11 LSBs of th...
uint8_t m_txPowerLevel
The TXPWR_LEVEL parameter in Table 15-4.
bool m_ldpc
LDPC FEC coding if true, BCC otherwise.
uint16_t GetLength() const
Get the LENGTH field of the L-SIG.
uint16_t m_guardInterval
guard interval duration in nanoseconds
bool IsDlMu() const
bool m_stbc
STBC used or not.
uint8_t m_nss
number of spatial streams
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
uint8_t GetEhtPpduType() const
Get the EHT_PPDU_TYPE parameter.
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
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.
uint8_t GetNssMax() const
bool IsUlMu() const
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
uint16_t m_length
LENGTH field of the L-SIG.
uint8_t m_bssColor
BSS color.
WifiMode m_sigBMcs
MCS_SIG_B per Table 27-1 IEEE 802.11ax-2021.
void SetBssColor(uint8_t color)
Set the BSS color.
bool IsLdpc() const
Check if LDPC FEC coding is used or not.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint8_t GetTxPowerLevel() const
bool IsAggregation() const
Checks whether the PSDU contains A-MPDU.
uint8_t m_ehtPpduType
EHT_PPDU_TYPE per Table 36-1 IEEE 802.11be D2.3.
bool IsAllocated(uint16_t staId) const
Check if STA ID is allocated.
uint16_t GetChannelWidth() const
WifiPreamble m_preamble
preamble
Center26ToneRuIndication DeriveCenter26ToneRuIndication() const
Derive the CENTER_26_TONE_RU field from the TXVECTOR for which its CENTER_26_TONE_RU has not been set...
RuAllocation DeriveRuAllocation(uint8_t p20Index) const
Derive the RU_ALLOCATION field from the TXVECTOR for which its RU_ALLOCATION field has not been set y...
bool m_modeInitialized
Internal initialization flag.
uint8_t GetNess() const
uint8_t m_ness
number of spatial streams in beamforming
bool IsNonHtDuplicate() const
Checks whether this TXVECTOR corresponds to a non-HT duplicate.
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.
const std::vector< bool > & GetInactiveSubchannels() const
Get the 20 MHz subchannels that are punctured.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:49
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition: abort.h:76
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Center26ToneRuIndication
Enum for the different values for CENTER_26_TONE_RU.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_HE_SU
@ CENTER_26_TONE_RU_HIGH_80_MHZ_ALLOCATED
@ CENTER_26_TONE_RU_LOW_80_MHZ_ALLOCATED
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsEht(WifiPreamble preamble)
Return true if a preamble corresponds to an EHT transmission.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
WifiModulationClass GetModulationClassForPreamble(WifiPreamble preamble)
Return the modulation class corresponding to the given preamble type.
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
bool IsDlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a downlink multi-user transmission.
bool IsUlMu(WifiPreamble preamble)
Return true if a preamble corresponds to a uplink multi-user transmission.
STL namespace.
HE MU specific user transmission parameters.
uint8_t mcs
MCS index.
HeRu::RuSpec ru
RU specification.
uint8_t nss
number of spatial streams
bool operator!=(const HeMuUserInfo &other) const
Compare this user info to the given user info.
bool operator==(const HeMuUserInfo &other) const
Compare this user info to the given user info.
Struct providing a function call operator to compare two RUs.
Definition: he-ru.h:134
Declaration of the following enums: