A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-he-info-elems-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Universita' degli Studi di Napoli Federico II
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 * Author: Stefano Avallone <stavallo@unina.it>
18 */
19
20#include "ns3/he-6ghz-band-capabilities.h"
21#include "ns3/he-operation.h"
22#include "ns3/header-serialization-test.h"
23#include "ns3/log.h"
24#include "ns3/simulator.h"
25
26using namespace ns3;
27
28NS_LOG_COMPONENT_DEFINE("WifiHeInfoElemsTest");
29
30/**
31 * \ingroup wifi-test
32 * \ingroup tests
33 *
34 * \brief Test HE Operation information element serialization and deserialization
35 */
37{
38 public:
40
41 private:
42 void DoRun() override;
43};
44
47 "Check serialization and deserialization of HE Operation elements")
48{
49}
50
51void
53{
54 HeOperation heOperation;
55
56 heOperation.m_heOpParams.m_defaultPeDuration = 6;
57 heOperation.m_heOpParams.m_twtRequired = 1;
58 heOperation.m_heOpParams.m_txopDurRtsThresh = 1000;
59 heOperation.m_heOpParams.m_erSuDisable = 1;
60
61 heOperation.m_bssColorInfo.m_bssColor = 44;
62 heOperation.m_bssColorInfo.m_bssColorDisabled = 1;
63
64 heOperation.SetMaxHeMcsPerNss(8, 7);
65 heOperation.SetMaxHeMcsPerNss(6, 8);
66 heOperation.SetMaxHeMcsPerNss(4, 9);
67 heOperation.SetMaxHeMcsPerNss(2, 10);
68 heOperation.SetMaxHeMcsPerNss(1, 11);
69
70 TestHeaderSerialization(heOperation);
71
73 heOperation.m_6GHzOpInfo->m_primCh = 191;
74 heOperation.m_6GHzOpInfo->m_chWid = 2;
75 heOperation.m_6GHzOpInfo->m_dupBeacon = 1;
76 heOperation.m_6GHzOpInfo->m_regInfo = 6;
77 heOperation.m_6GHzOpInfo->m_chCntrFreqSeg0 = 157;
78 heOperation.m_6GHzOpInfo->m_chCntrFreqSeg1 = 201;
79 heOperation.m_6GHzOpInfo->m_minRate = 211;
80
81 TestHeaderSerialization(heOperation);
82}
83
84/**
85 * \ingroup wifi-test
86 * \ingroup tests
87 *
88 * \brief Test HE 6 GHz Band Capabilities information element serialization and deserialization
89 */
91{
92 public:
94
95 private:
96 void DoRun() override;
97};
98
101 "Check serialization and deserialization of HE 6 GHz Band Capabilities elements")
102{
103}
104
105void
107{
108 He6GhzBandCapabilities he6GhzBandCapabilities;
109
110 he6GhzBandCapabilities.m_capabilitiesInfo.m_minMpduStartSpacing = 5;
111 he6GhzBandCapabilities.SetMaxAmpduLength((static_cast<uint32_t>(1) << 18) - 1);
112 he6GhzBandCapabilities.SetMaxMpduLength(11454);
113 he6GhzBandCapabilities.m_capabilitiesInfo.m_smPowerSave = 3;
114 he6GhzBandCapabilities.m_capabilitiesInfo.m_rdResponder = 1;
115 he6GhzBandCapabilities.m_capabilitiesInfo.m_rxAntennaPatternConsistency = 1;
116 he6GhzBandCapabilities.m_capabilitiesInfo.m_txAntennaPatternConsistency = 1;
117
118 TestHeaderSerialization(he6GhzBandCapabilities);
119}
120
121/**
122 * \ingroup wifi-test
123 * \ingroup tests
124 *
125 * \brief wifi HE Information Elements Test Suite
126 */
128{
129 public:
131};
132
134 : TestSuite("wifi-he-info-elems", Type::UNIT)
135{
136 AddTestCase(new HeOperationElementTest, TestCase::Duration::QUICK);
137 AddTestCase(new He6GhzBandCapabilitiesTest, TestCase::Duration::QUICK);
138}
139
Test HE 6 GHz Band Capabilities information element serialization and deserialization.
void DoRun() override
Implementation to actually run this TestCase.
Test HE Operation information element serialization and deserialization.
void DoRun() override
Implementation to actually run this TestCase.
wifi HE Information Elements Test Suite
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263)
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
CapabilitiesInfo m_capabilitiesInfo
capabilities field
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
The HE Operation Information Element.
Definition: he-operation.h:38
OptFieldWithPresenceInd< OpInfo6GHz > m_6GHzOpInfo
6 GHz Operation Information field
Definition: he-operation.h:175
void SetMaxHeMcsPerNss(uint8_t nss, uint8_t maxHeMcs)
Set the Basic HE-MCS and NSS field in the HE Operation information element by specifying the pair (ns...
HeOperationParams m_heOpParams
HE Operation Parameters field.
Definition: he-operation.h:172
BssColorInfo m_bssColorInfo
BSS Color Information field.
Definition: he-operation.h:173
Subclass of TestCase class adding the ability to test the serialization and deserialization of a Head...
void TestHeaderSerialization(const T &hdr, Args &&... args)
Serialize the given header in a buffer, then create a new header by deserializing from the buffer and...
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:302
A suite of tests to run.
Definition: test.h:1273
Type
Type of test.
Definition: test.h:1280
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_minMpduStartSpacing
Minimum MPDU Start Spacing.
uint8_t m_rxAntennaPatternConsistency
Receive Antenna Pattern Consistency.
uint8_t m_txAntennaPatternConsistency
Transmit Antenna Pattern Consistency.
uint8_t m_bssColorDisabled
BSS Color Disabled.
Definition: he-operation.h:92
uint8_t m_bssColor
BSS Color.
Definition: he-operation.h:90
uint8_t m_erSuDisable
ER SU Disable.
Definition: he-operation.h:55
uint8_t m_defaultPeDuration
Default PE Duration.
Definition: he-operation.h:50
uint8_t m_twtRequired
TWT Required.
Definition: he-operation.h:51
uint16_t m_txopDurRtsThresh
TXOP Duration RTS Threshold.
Definition: he-operation.h:52
6 GHz Operation Information field
Definition: he-operation.h:124
static WifiHeInfoElemsTestSuite g_wifiHeInfoElemsTestSuite
the test suite