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(
42 "BssColor",
43 "The BSS color",
47 .AddAttribute("MaxTbPpduDelay",
48 "If positive, the value of this attribute specifies the maximum "
49 "delay with which a TB PPDU can be received after the reception of "
50 "the first TB PPDU. If the delay is higher than this value, the "
51 "TB PPDU is dropped and considered interference. The maximum delay "
52 "is anyway capped at the duration of the training fields in the PPDU. "
53 "This attribute is only valid for APs.",
58 .AddAttribute("MpduBufferSize",
59 "This attribute is obsolete. Use the WifiMac::MpduBufferSize attribute "
60 "instead.",
61 UintegerValue(64),
65 .AddAttribute("MuBeAifsn",
66 "AIFSN used by BE EDCA when the MU EDCA Timer is running. "
67 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
71 .AddAttribute("MuBkAifsn",
72 "AIFSN used by BK EDCA when the MU EDCA Timer is running. "
73 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
77 .AddAttribute("MuViAifsn",
78 "AIFSN used by VI EDCA when the MU EDCA Timer is running. "
79 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
83 .AddAttribute("MuVoAifsn",
84 "AIFSN used by VO EDCA when the MU EDCA Timer is running. "
85 "It must be either zero (EDCA disabled) or a value from 2 to 15.",
89 .AddAttribute("MuBeCwMin",
90 "CWmin used by BE EDCA when the MU EDCA Timer is running. "
91 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
92 UintegerValue(15),
95 .AddAttribute("MuBkCwMin",
96 "CWmin used by BK EDCA when the MU EDCA Timer is running. "
97 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
98 UintegerValue(15),
101 .AddAttribute("MuViCwMin",
102 "CWmin used by VI EDCA when the MU EDCA Timer is running. "
103 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
104 UintegerValue(15),
107 .AddAttribute("MuVoCwMin",
108 "CWmin used by VO EDCA when the MU EDCA Timer is running. "
109 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
110 UintegerValue(15),
113 .AddAttribute("MuBeCwMax",
114 "CWmax used by BE EDCA when the MU EDCA Timer is running. "
115 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
116 UintegerValue(1023),
119 .AddAttribute("MuBkCwMax",
120 "CWmax used by BK EDCA when the MU EDCA Timer is running. "
121 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
122 UintegerValue(1023),
125 .AddAttribute("MuViCwMax",
126 "CWmax used by VI EDCA when the MU EDCA Timer is running. "
127 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
128 UintegerValue(1023),
131 .AddAttribute("MuVoCwMax",
132 "CWmax used by VO EDCA when the MU EDCA Timer is running. "
133 "It must be a power of 2 minus 1 in the range from 0 to 32767.",
134 UintegerValue(1023),
137 .AddAttribute("BeMuEdcaTimer",
138 "The MU EDCA Timer used by BE 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("BkMuEdcaTimer",
147 "The MU EDCA Timer used by BK 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("ViMuEdcaTimer",
156 "The MU EDCA Timer used by VI 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 .AddAttribute("VoMuEdcaTimer",
165 "The MU EDCA Timer used by VO EDCA. It must be a multiple of "
166 "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
167 "0 is a reserved value, but we allow to use this value to indicate "
168 "that an MU EDCA Parameter Set element must not be sent. Therefore, "
169 "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
173 return tid;
174}
175
176void
178{
179 NS_LOG_FUNCTION(this << guardInterval);
180 [[maybe_unused]] const auto gi = guardInterval.GetNanoSeconds();
181 NS_ASSERT((gi == 800) || (gi == 1600) || (gi == 3200));
182 m_guardInterval = guardInterval;
183}
184
185Time
190
191void
193{
194 NS_LOG_FUNCTION(this << +bssColor);
195 m_bssColor = bssColor;
196}
197
198uint8_t
200{
201 return m_bssColor;
202}
203
204Time
209
210void
212{
213 m_maxTbPpduDelay = maxTbPpduDelay;
214}
215
216} // 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.
uint16_t m_mpduBufferSize
MPDU buffer size.
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
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
Definition type-id.h:65
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
#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:1332
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition nstime.h:1396
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1416