A Discrete-Event Network Simulator
API
he-configuration.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 University of Washington
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  */
18 
19 #include "he-configuration.h"
20 
21 #include "ns3/log.h"
22 #include "ns3/nstime.h"
23 #include "ns3/uinteger.h"
24 
25 namespace ns3
26 {
27 
28 NS_LOG_COMPONENT_DEFINE("HeConfiguration");
29 NS_OBJECT_ENSURE_REGISTERED(HeConfiguration);
30 
32 {
33  NS_LOG_FUNCTION(this);
34 }
35 
36 TypeId
38 {
39  static ns3::TypeId tid =
40  ns3::TypeId("ns3::HeConfiguration")
41  .SetParent<Object>()
42  .SetGroupName("Wifi")
43  .AddConstructor<HeConfiguration>()
44  .AddAttribute("GuardInterval",
45  "Specify the shortest guard interval duration that can be used for HE "
46  "transmissions."
47  "Possible values are 800ns, 1600ns or 3200ns.",
48  TimeValue(NanoSeconds(3200)),
52  .AddAttribute(
53  "BssColor",
54  "The BSS color",
55  UintegerValue(0),
57  MakeUintegerChecker<uint8_t>())
58  .AddAttribute("MaxTbPpduDelay",
59  "If positive, the value of this attribute specifies the maximum "
60  "delay with which a TB PPDU can be received after the reception of "
61  "the first TB PPDU. If the delay is higher than this value, the "
62  "TB PPDU is dropped and considered interference. The maximum delay "
63  "is anyway capped at the duration of the training fields in the PPDU. "
64  "This attribute is only valid for APs.",
65  TimeValue(Seconds(0)),
69  .AddAttribute("MpduBufferSize",
70  "The MPDU buffer size for receiving A-MPDUs",
71  UintegerValue(64),
74  MakeUintegerChecker<uint16_t>(64, 256))
75  .AddAttribute("MuBeAifsn",
76  "AIFSN used by BE EDCA when the MU EDCA Timer is running. "
77  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
78  UintegerValue(0),
80  MakeUintegerChecker<uint8_t>(0, 15))
81  .AddAttribute("MuBkAifsn",
82  "AIFSN used by BK EDCA when the MU EDCA Timer is running. "
83  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
84  UintegerValue(0),
86  MakeUintegerChecker<uint8_t>(0, 15))
87  .AddAttribute("MuViAifsn",
88  "AIFSN used by VI EDCA when the MU EDCA Timer is running. "
89  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
90  UintegerValue(0),
92  MakeUintegerChecker<uint8_t>(0, 15))
93  .AddAttribute("MuVoAifsn",
94  "AIFSN used by VO EDCA when the MU EDCA Timer is running. "
95  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
96  UintegerValue(0),
98  MakeUintegerChecker<uint8_t>(0, 15))
99  .AddAttribute("MuBeCwMin",
100  "CWmin used by BE EDCA when the MU EDCA Timer is running. "
101  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
102  UintegerValue(15),
104  MakeUintegerChecker<uint16_t>(0, 32767))
105  .AddAttribute("MuBkCwMin",
106  "CWmin used by BK EDCA when the MU EDCA Timer is running. "
107  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
108  UintegerValue(15),
110  MakeUintegerChecker<uint16_t>(0, 32767))
111  .AddAttribute("MuViCwMin",
112  "CWmin used by VI EDCA when the MU EDCA Timer is running. "
113  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
114  UintegerValue(15),
116  MakeUintegerChecker<uint16_t>(0, 32767))
117  .AddAttribute("MuVoCwMin",
118  "CWmin used by VO EDCA when the MU EDCA Timer is running. "
119  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
120  UintegerValue(15),
122  MakeUintegerChecker<uint16_t>(0, 32767))
123  .AddAttribute("MuBeCwMax",
124  "CWmax used by BE EDCA when the MU EDCA Timer is running. "
125  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
126  UintegerValue(1023),
128  MakeUintegerChecker<uint16_t>(0, 32767))
129  .AddAttribute("MuBkCwMax",
130  "CWmax used by BK EDCA when the MU EDCA Timer is running. "
131  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
132  UintegerValue(1023),
134  MakeUintegerChecker<uint16_t>(0, 32767))
135  .AddAttribute("MuViCwMax",
136  "CWmax used by VI EDCA when the MU EDCA Timer is running. "
137  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
138  UintegerValue(1023),
140  MakeUintegerChecker<uint16_t>(0, 32767))
141  .AddAttribute("MuVoCwMax",
142  "CWmax used by VO EDCA when the MU EDCA Timer is running. "
143  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
144  UintegerValue(1023),
146  MakeUintegerChecker<uint16_t>(0, 32767))
147  .AddAttribute("BeMuEdcaTimer",
148  "The MU EDCA Timer used by BE EDCA. It must be a multiple of "
149  "8192 us and must be in the range from 8.192 ms to 2088.96 ms. "
150  "0 is a reserved value, but we allow to use this value to indicate "
151  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
152  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
156  .AddAttribute("BkMuEdcaTimer",
157  "The MU EDCA Timer used by BK EDCA. It must be a multiple of "
158  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
159  "0 is a reserved value, but we allow to use this value to indicate "
160  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
161  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
165  .AddAttribute("ViMuEdcaTimer",
166  "The MU EDCA Timer used by VI EDCA. It must be a multiple of "
167  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
168  "0 is a reserved value, but we allow to use this value to indicate "
169  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
170  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
174  .AddAttribute("VoMuEdcaTimer",
175  "The MU EDCA Timer used by VO EDCA. It must be a multiple of "
176  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
177  "0 is a reserved value, but we allow to use this value to indicate "
178  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
179  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
183  return tid;
184 }
185 
186 void
188 {
189  NS_LOG_FUNCTION(this << guardInterval);
190  NS_ASSERT(guardInterval == NanoSeconds(800) || guardInterval == NanoSeconds(1600) ||
191  guardInterval == NanoSeconds(3200));
192  m_guardInterval = guardInterval;
193 }
194 
195 Time
197 {
198  return m_guardInterval;
199 }
200 
201 void
203 {
204  NS_LOG_FUNCTION(this << +bssColor);
205  m_bssColor = bssColor;
206 }
207 
208 uint8_t
210 {
211  return m_bssColor;
212 }
213 
214 Time
216 {
217  return m_maxTbPpduDelay;
218 }
219 
220 void
222 {
223  m_maxTbPpduDelay = maxTbPpduDelay;
224 }
225 
226 void
228 {
229  NS_LOG_FUNCTION(this << size);
230  m_mpduBufferSize = size;
231 }
232 
233 uint16_t
235 {
236  return m_mpduBufferSize;
237 }
238 
239 } // 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 GetMpduBufferSize() const
Time GetGuardInterval() const
Time GetMaxTbPpduDelay() const
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.
void SetMpduBufferSize(uint16_t size)
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:89
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
AttributeValue implementation for Time.
Definition: nstime.h:1423
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
Hold an unsigned integer type.
Definition: uinteger.h:45
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
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:1424
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:46
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#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:46
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1360
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1372
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1336
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:535