A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Stefano Avallone <stavallo@unina.it>
7
*/
8
9
#include "ns3/he-6ghz-band-capabilities.h"
10
#include "ns3/he-operation.h"
11
#include "ns3/header-serialization-test.h"
12
#include "ns3/log.h"
13
#include "ns3/simulator.h"
14
15
using namespace
ns3
;
16
17
NS_LOG_COMPONENT_DEFINE
(
"WifiHeInfoElemsTest"
);
18
19
/**
20
* @ingroup wifi-test
21
* @ingroup tests
22
*
23
* @brief Test HE Operation information element serialization and deserialization
24
*/
25
class
HeOperationElementTest
:
public
HeaderSerializationTestCase
26
{
27
public
:
28
HeOperationElementTest
();
29
30
private
:
31
void
DoRun
()
override
;
32
};
33
34
HeOperationElementTest::HeOperationElementTest
()
35
:
HeaderSerializationTestCase
(
36
"Check serialization and deserialization of HE Operation elements"
)
37
{
38
}
39
40
void
41
HeOperationElementTest::DoRun
()
42
{
43
HeOperation
heOperation;
44
45
heOperation.
m_heOpParams
.
m_defaultPeDuration
= 6;
46
heOperation.
m_heOpParams
.
m_twtRequired
= 1;
47
heOperation.
m_heOpParams
.
m_txopDurRtsThresh
= 1000;
48
heOperation.
m_heOpParams
.
m_erSuDisable
= 1;
49
50
heOperation.
m_bssColorInfo
.
m_bssColor
= 44;
51
heOperation.
m_bssColorInfo
.
m_bssColorDisabled
= 1;
52
53
heOperation.
SetMaxHeMcsPerNss
(8, 7);
54
heOperation.
SetMaxHeMcsPerNss
(6, 8);
55
heOperation.
SetMaxHeMcsPerNss
(4, 9);
56
heOperation.
SetMaxHeMcsPerNss
(2, 10);
57
heOperation.
SetMaxHeMcsPerNss
(1, 11);
58
59
TestHeaderSerialization
(heOperation);
60
61
heOperation.
m_6GHzOpInfo
=
HeOperation::OpInfo6GHz
{};
62
heOperation.
m_6GHzOpInfo
->m_primCh = 191;
63
heOperation.
m_6GHzOpInfo
->m_chWid = 2;
64
heOperation.
m_6GHzOpInfo
->m_dupBeacon = 1;
65
heOperation.
m_6GHzOpInfo
->m_regInfo = 6;
66
heOperation.
m_6GHzOpInfo
->m_chCntrFreqSeg0 = 157;
67
heOperation.
m_6GHzOpInfo
->m_chCntrFreqSeg1 = 201;
68
heOperation.
m_6GHzOpInfo
->m_minRate = 211;
69
70
TestHeaderSerialization
(heOperation);
71
}
72
73
/**
74
* @ingroup wifi-test
75
* @ingroup tests
76
*
77
* @brief Test HE 6 GHz Band Capabilities information element serialization and deserialization
78
*/
79
class
He6GhzBandCapabilitiesTest
:
public
HeaderSerializationTestCase
80
{
81
public
:
82
He6GhzBandCapabilitiesTest
();
83
84
private
:
85
void
DoRun
()
override
;
86
};
87
88
He6GhzBandCapabilitiesTest::He6GhzBandCapabilitiesTest
()
89
:
HeaderSerializationTestCase
(
90
"Check serialization and deserialization of HE 6 GHz Band Capabilities elements"
)
91
{
92
}
93
94
void
95
He6GhzBandCapabilitiesTest::DoRun
()
96
{
97
He6GhzBandCapabilities
he6GhzBandCapabilities;
98
99
he6GhzBandCapabilities.
m_capabilitiesInfo
.
m_minMpduStartSpacing
= 5;
100
he6GhzBandCapabilities.
SetMaxAmpduLength
((
static_cast<
uint32_t
>
(1) << 18) - 1);
101
he6GhzBandCapabilities.
SetMaxMpduLength
(11454);
102
he6GhzBandCapabilities.
m_capabilitiesInfo
.
m_smPowerSave
= 3;
103
he6GhzBandCapabilities.
m_capabilitiesInfo
.
m_rdResponder
= 1;
104
he6GhzBandCapabilities.
m_capabilitiesInfo
.
m_rxAntennaPatternConsistency
= 1;
105
he6GhzBandCapabilities.
m_capabilitiesInfo
.
m_txAntennaPatternConsistency
= 1;
106
107
TestHeaderSerialization
(he6GhzBandCapabilities);
108
}
109
110
/**
111
* @ingroup wifi-test
112
* @ingroup tests
113
*
114
* @brief wifi HE Information Elements Test Suite
115
*/
116
class
WifiHeInfoElemsTestSuite
:
public
TestSuite
117
{
118
public
:
119
WifiHeInfoElemsTestSuite
();
120
};
121
122
WifiHeInfoElemsTestSuite::WifiHeInfoElemsTestSuite
()
123
:
TestSuite
(
"wifi-he-info-elems"
,
Type
::UNIT)
124
{
125
AddTestCase
(
new
HeOperationElementTest
, TestCase::Duration::QUICK);
126
AddTestCase
(
new
He6GhzBandCapabilitiesTest
, TestCase::Duration::QUICK);
127
}
128
129
static
WifiHeInfoElemsTestSuite
g_wifiHeInfoElemsTestSuite
;
///< the test suite
He6GhzBandCapabilitiesTest
Test HE 6 GHz Band Capabilities information element serialization and deserialization.
Definition
wifi-he-info-elems-test.cc:80
He6GhzBandCapabilitiesTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
wifi-he-info-elems-test.cc:95
He6GhzBandCapabilitiesTest::He6GhzBandCapabilitiesTest
He6GhzBandCapabilitiesTest()
Definition
wifi-he-info-elems-test.cc:88
HeOperationElementTest
Test HE Operation information element serialization and deserialization.
Definition
wifi-he-info-elems-test.cc:26
HeOperationElementTest::DoRun
void DoRun() override
Implementation to actually run this TestCase.
Definition
wifi-he-info-elems-test.cc:41
HeOperationElementTest::HeOperationElementTest
HeOperationElementTest()
Definition
wifi-he-info-elems-test.cc:34
WifiHeInfoElemsTestSuite
wifi HE Information Elements Test Suite
Definition
wifi-he-info-elems-test.cc:117
WifiHeInfoElemsTestSuite::WifiHeInfoElemsTestSuite
WifiHeInfoElemsTestSuite()
Definition
wifi-he-info-elems-test.cc:122
ns3::He6GhzBandCapabilities
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263)
Definition
he-6ghz-band-capabilities.h:23
ns3::He6GhzBandCapabilities::SetMaxAmpduLength
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
Definition
he-6ghz-band-capabilities.cc:40
ns3::He6GhzBandCapabilities::m_capabilitiesInfo
CapabilitiesInfo m_capabilitiesInfo
capabilities field
Definition
he-6ghz-band-capabilities.h:47
ns3::He6GhzBandCapabilities::SetMaxMpduLength
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
Definition
he-6ghz-band-capabilities.cc:60
ns3::HeOperation
The HE Operation Information Element.
Definition
he-operation.h:27
ns3::HeOperation::m_6GHzOpInfo
OptFieldWithPresenceInd< OpInfo6GHz > m_6GHzOpInfo
6 GHz Operation Information field
Definition
he-operation.h:164
ns3::HeOperation::SetMaxHeMcsPerNss
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...
Definition
he-operation.cc:149
ns3::HeOperation::m_heOpParams
HeOperationParams m_heOpParams
HE Operation Parameters field.
Definition
he-operation.h:161
ns3::HeOperation::m_bssColorInfo
BssColorInfo m_bssColorInfo
BSS Color Information field.
Definition
he-operation.h:162
ns3::HeaderSerializationTestCase
Subclass of TestCase class adding the ability to test the serialization and deserialization of a Head...
Definition
header-serialization-test.h:24
ns3::HeaderSerializationTestCase::TestHeaderSerialization
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...
Definition
header-serialization-test.h:62
ns3::TestCase::AddTestCase
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition
test.cc:292
ns3::TestSuite
A suite of tests to run.
Definition
test.h:1267
ns3::TestSuite::Type
Type
Type of test.
Definition
test.h:1274
uint32_t
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::He6GhzBandCapabilities::CapabilitiesInfo::m_smPowerSave
uint8_t m_smPowerSave
SM Power Save.
Definition
he-6ghz-band-capabilities.h:40
ns3::He6GhzBandCapabilities::CapabilitiesInfo::m_minMpduStartSpacing
uint8_t m_minMpduStartSpacing
Minimum MPDU Start Spacing.
Definition
he-6ghz-band-capabilities.h:34
ns3::He6GhzBandCapabilities::CapabilitiesInfo::m_rdResponder
uint8_t m_rdResponder
RD Responder.
Definition
he-6ghz-band-capabilities.h:41
ns3::He6GhzBandCapabilities::CapabilitiesInfo::m_rxAntennaPatternConsistency
uint8_t m_rxAntennaPatternConsistency
Receive Antenna Pattern Consistency.
Definition
he-6ghz-band-capabilities.h:42
ns3::He6GhzBandCapabilities::CapabilitiesInfo::m_txAntennaPatternConsistency
uint8_t m_txAntennaPatternConsistency
Transmit Antenna Pattern Consistency.
Definition
he-6ghz-band-capabilities.h:43
ns3::HeOperation::BssColorInfo::m_bssColorDisabled
uint8_t m_bssColorDisabled
BSS Color Disabled.
Definition
he-operation.h:81
ns3::HeOperation::BssColorInfo::m_bssColor
uint8_t m_bssColor
BSS Color.
Definition
he-operation.h:79
ns3::HeOperation::HeOperationParams::m_erSuDisable
uint8_t m_erSuDisable
ER SU Disable.
Definition
he-operation.h:44
ns3::HeOperation::HeOperationParams::m_defaultPeDuration
uint8_t m_defaultPeDuration
Default PE Duration.
Definition
he-operation.h:39
ns3::HeOperation::HeOperationParams::m_twtRequired
uint8_t m_twtRequired
TWT Required.
Definition
he-operation.h:40
ns3::HeOperation::HeOperationParams::m_txopDurRtsThresh
uint16_t m_txopDurRtsThresh
TXOP Duration RTS Threshold.
Definition
he-operation.h:41
ns3::HeOperation::OpInfo6GHz
6 GHz Operation Information field
Definition
he-operation.h:113
g_wifiHeInfoElemsTestSuite
static WifiHeInfoElemsTestSuite g_wifiHeInfoElemsTestSuite
the test suite
Definition
wifi-he-info-elems-test.cc:129
src
wifi
test
wifi-he-info-elems-test.cc
Generated on Wed Dec 11 2024 09:21:00 for ns-3 by
1.11.0