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 * 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
15using namespace ns3;
16
17NS_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 */
26{
27 public:
29
30 private:
31 void DoRun() override;
32};
33
36 "Check serialization and deserialization of HE Operation elements")
37{
38}
39
40void
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
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 */
80{
81 public:
83
84 private:
85 void DoRun() override;
86};
87
90 "Check serialization and deserialization of HE 6 GHz Band Capabilities elements")
91{
92}
93
94void
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 */
117{
118 public:
120};
121
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
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.
OptFieldWithPresenceInd< OpInfo6GHz > m_6GHzOpInfo
6 GHz Operation Information field
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.
BssColorInfo m_bssColorInfo
BSS Color Information field.
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:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
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.
uint8_t m_erSuDisable
ER SU Disable.
uint8_t m_defaultPeDuration
Default PE Duration.
uint8_t m_twtRequired
TWT Required.
uint16_t m_txopDurRtsThresh
TXOP Duration RTS Threshold.
6 GHz Operation Information field
static WifiHeInfoElemsTestSuite g_wifiHeInfoElemsTestSuite
the test suite