A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-configuration.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 University of Washington
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#include "he-configuration.h"
9
10#include "ns3/log.h"
11#include "ns3/nstime.h"
12#include "ns3/uinteger.h"
13
14namespace ns3
15{
16
17NS_LOG_COMPONENT_DEFINE("HeConfiguration");
18NS_OBJECT_ENSURE_REGISTERED(HeConfiguration);
19
24
27{
28 static ns3::TypeId tid =
29 ns3::TypeId("ns3::HeConfiguration")
31 .SetGroupName("Wifi")
32 .AddConstructor<HeConfiguration>()
33 .AddAttribute("GuardInterval",
34 "Specify the shortest guard interval duration that can be used for HE "
35 "transmissions."
36 "Possible values are 800ns, 1600ns or 3200ns.",
41 .AddAttribute("BssColor",
42 "The BSS color",
46 .AddAttribute("MaxTbPpduDelay",
47 "If positive, the value of this attribute specifies the maximum "
48 "delay with which a TB PPDU can be received after the reception of "
49 "the first TB PPDU. If the delay is higher than this value, the "
50 "TB PPDU is dropped and considered interference. The maximum delay "
51 "is anyway capped at the duration of the training fields in the PPDU. "
52 "This attribute is only valid for APs.",
56 .AddAttribute("MuBeAifsn",
57 "AIFSN used by BE EDCA when the MU EDCA Timer is running. "
58 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
62 .AddAttribute("MuBkAifsn",
63 "AIFSN used by BK EDCA when the MU EDCA Timer is running. "
64 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
68 .AddAttribute("MuViAifsn",
69 "AIFSN used by VI EDCA when the MU EDCA Timer is running. "
70 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
74 .AddAttribute("MuVoAifsn",
75 "AIFSN used by VO EDCA when the MU EDCA Timer is running. "
76 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
80 .AddAttribute("MuBeCwMin",
81 "CWmin used by BE EDCA when the MU EDCA Timer is running. "
82 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
83 UintegerValue(15),
86 .AddAttribute("MuBkCwMin",
87 "CWmin used by BK EDCA when the MU EDCA Timer is running. "
88 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
89 UintegerValue(15),
92 .AddAttribute("MuViCwMin",
93 "CWmin used by VI EDCA when the MU EDCA Timer is running. "
94 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
95 UintegerValue(15),
98 .AddAttribute("MuVoCwMin",
99 "CWmin used by VO EDCA when the MU EDCA Timer is running. "
100 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
101 UintegerValue(15),
104 .AddAttribute("MuBeCwMax",
105 "CWmax used by BE EDCA when the MU EDCA Timer is running. "
106 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
107 UintegerValue(1023),
110 .AddAttribute("MuBkCwMax",
111 "CWmax used by BK EDCA when the MU EDCA Timer is running. "
112 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
113 UintegerValue(1023),
116 .AddAttribute("MuViCwMax",
117 "CWmax used by VI EDCA when the MU EDCA Timer is running. "
118 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
119 UintegerValue(1023),
122 .AddAttribute("MuVoCwMax",
123 "CWmax used by VO EDCA when the MU EDCA Timer is running. "
124 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
125 UintegerValue(1023),
128 .AddAttribute("BeMuEdcaTimer",
129 "The MU EDCA Timer used by BE EDCA. It must be a multiple of "
130 "8192 us and must be in the range from 8.192 ms to 2088.96 ms. "
131 "0 is a reserved value, but we allow to use this value to indicate "
132 "that an MU EDCA Parameter Set element must not be sent. Therefore, "
133 "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
137 .AddAttribute("BkMuEdcaTimer",
138 "The MU EDCA Timer used by BK EDCA. It must be a multiple of "
139 "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
140 "0 is a reserved value, but we allow to use this value to indicate "
141 "that an MU EDCA Parameter Set element must not be sent. Therefore, "
142 "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
146 .AddAttribute("ViMuEdcaTimer",
147 "The MU EDCA Timer used by VI EDCA. It must be a multiple of "
148 "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
149 "0 is a reserved value, but we allow to use this value to indicate "
150 "that an MU EDCA Parameter Set element must not be sent. Therefore, "
151 "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
155 .AddAttribute("VoMuEdcaTimer",
156 "The MU EDCA Timer used by VO EDCA. It must be a multiple of "
157 "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
158 "0 is a reserved value, but we allow to use this value to indicate "
159 "that an MU EDCA Parameter Set element must not be sent. Therefore, "
160 "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
164 return tid;
165}
166
167void
169{
170 NS_LOG_FUNCTION(this << guardInterval);
171 [[maybe_unused]] const auto gi = guardInterval.GetNanoSeconds();
172 NS_ASSERT((gi == 800) || (gi == 1600) || (gi == 3200));
173 m_guardInterval = guardInterval;
174}
175
176Time
181
182void
184{
185 NS_LOG_FUNCTION(this << +bssColor);
186 m_bssColor = bssColor;
187}
188
189uint8_t
191{
192 return m_bssColor;
193}
194
195Time
200
201void
203{
204 m_maxTbPpduDelay = maxTbPpduDelay;
205}
206
207} // namespace ns3
HE configuration.
uint16_t m_muBkCwMin
CWmin for BK in MU EDCA Parameter Set.
uint16_t m_muBkCwMax
CWmax for BK in MU EDCA Parameter Set.
uint16_t m_muVoCwMin
CWmin for VO in MU EDCA Parameter Set.
static TypeId GetTypeId()
Get the type ID.
uint16_t m_muViCwMin
CWmin for VI in MU EDCA Parameter Set.
uint8_t m_muBeAifsn
AIFSN for BE in MU EDCA Parameter Set.
uint16_t m_muViCwMax
CWmax for VI in MU EDCA Parameter Set.
uint8_t m_muViAifsn
AIFSN for VI in MU EDCA Parameter Set.
uint16_t m_muBeCwMin
CWmin for BE in MU EDCA Parameter Set.
uint8_t m_muVoAifsn
AIFSN for VO in MU EDCA Parameter Set.
Time m_bkMuEdcaTimer
Timer for BK in MU EDCA Parameter Set.
Time m_viMuEdcaTimer
Timer for VI in MU EDCA Parameter Set.
void SetBssColor(uint8_t bssColor)
uint16_t m_muBeCwMax
CWmax for BE in MU EDCA Parameter Set.
void SetMaxTbPpduDelay(Time maxTbPpduDelay)
uint16_t m_muVoCwMax
CWmax for VO in MU EDCA Parameter Set.
Time m_beMuEdcaTimer
Timer for BE in MU EDCA Parameter Set.
Time m_guardInterval
Supported HE guard interval.
void SetGuardInterval(Time guardInterval)
uint8_t m_bssColor
BSS color.
Time m_voMuEdcaTimer
Timer for VO in MU EDCA Parameter Set.
uint8_t m_muBkAifsn
AIFSN for BK in MU EDCA Parameter Set.
Time m_maxTbPpduDelay
Max TB PPDU delay.
uint8_t GetBssColor() const
A base class which provides memory management and object aggregation.
Definition object.h:78
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition nstime.h:407
AttributeValue implementation for Time.
Definition nstime.h:1431
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1432
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1452
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition uinteger.h:35
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1368
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1380
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Every class exported by the ns3 library is enclosed in the ns3 namespace.