A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  "This attribute is obsolete. Use the WifiMac::MpduBufferSize attribute "
71  "instead.",
72  UintegerValue(64),
74  MakeUintegerChecker<uint16_t>(64, 256),
76  .AddAttribute("MuBeAifsn",
77  "AIFSN used by BE EDCA when the MU EDCA Timer is running. "
78  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
79  UintegerValue(0),
81  MakeUintegerChecker<uint8_t>(0, 15))
82  .AddAttribute("MuBkAifsn",
83  "AIFSN used by BK EDCA when the MU EDCA Timer is running. "
84  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
85  UintegerValue(0),
87  MakeUintegerChecker<uint8_t>(0, 15))
88  .AddAttribute("MuViAifsn",
89  "AIFSN used by VI EDCA when the MU EDCA Timer is running. "
90  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
91  UintegerValue(0),
93  MakeUintegerChecker<uint8_t>(0, 15))
94  .AddAttribute("MuVoAifsn",
95  "AIFSN used by VO EDCA when the MU EDCA Timer is running. "
96  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
97  UintegerValue(0),
99  MakeUintegerChecker<uint8_t>(0, 15))
100  .AddAttribute("MuBeCwMin",
101  "CWmin used by BE EDCA when the MU EDCA Timer is running. "
102  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
103  UintegerValue(15),
105  MakeUintegerChecker<uint16_t>(0, 32767))
106  .AddAttribute("MuBkCwMin",
107  "CWmin used by BK EDCA when the MU EDCA Timer is running. "
108  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
109  UintegerValue(15),
111  MakeUintegerChecker<uint16_t>(0, 32767))
112  .AddAttribute("MuViCwMin",
113  "CWmin used by VI EDCA when the MU EDCA Timer is running. "
114  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
115  UintegerValue(15),
117  MakeUintegerChecker<uint16_t>(0, 32767))
118  .AddAttribute("MuVoCwMin",
119  "CWmin used by VO EDCA when the MU EDCA Timer is running. "
120  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
121  UintegerValue(15),
123  MakeUintegerChecker<uint16_t>(0, 32767))
124  .AddAttribute("MuBeCwMax",
125  "CWmax used by BE EDCA when the MU EDCA Timer is running. "
126  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
127  UintegerValue(1023),
129  MakeUintegerChecker<uint16_t>(0, 32767))
130  .AddAttribute("MuBkCwMax",
131  "CWmax used by BK EDCA when the MU EDCA Timer is running. "
132  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
133  UintegerValue(1023),
135  MakeUintegerChecker<uint16_t>(0, 32767))
136  .AddAttribute("MuViCwMax",
137  "CWmax used by VI EDCA when the MU EDCA Timer is running. "
138  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
139  UintegerValue(1023),
141  MakeUintegerChecker<uint16_t>(0, 32767))
142  .AddAttribute("MuVoCwMax",
143  "CWmax used by VO EDCA when the MU EDCA Timer is running. "
144  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
145  UintegerValue(1023),
147  MakeUintegerChecker<uint16_t>(0, 32767))
148  .AddAttribute("BeMuEdcaTimer",
149  "The MU EDCA Timer used by BE EDCA. It must be a multiple of "
150  "8192 us and must be in the range from 8.192 ms to 2088.96 ms. "
151  "0 is a reserved value, but we allow to use this value to indicate "
152  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
153  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
157  .AddAttribute("BkMuEdcaTimer",
158  "The MU EDCA Timer used by BK EDCA. It must be a multiple of "
159  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
160  "0 is a reserved value, but we allow to use this value to indicate "
161  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
162  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
166  .AddAttribute("ViMuEdcaTimer",
167  "The MU EDCA Timer used by VI EDCA. It must be a multiple of "
168  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
169  "0 is a reserved value, but we allow to use this value to indicate "
170  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
171  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
175  .AddAttribute("VoMuEdcaTimer",
176  "The MU EDCA Timer used by VO EDCA. It must be a multiple of "
177  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
178  "0 is a reserved value, but we allow to use this value to indicate "
179  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
180  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
184  return tid;
185 }
186 
187 void
189 {
190  NS_LOG_FUNCTION(this << guardInterval);
191  NS_ASSERT(guardInterval == NanoSeconds(800) || guardInterval == NanoSeconds(1600) ||
192  guardInterval == NanoSeconds(3200));
193  m_guardInterval = guardInterval;
194 }
195 
196 Time
198 {
199  return m_guardInterval;
200 }
201 
202 void
204 {
205  NS_LOG_FUNCTION(this << +bssColor);
206  m_bssColor = bssColor;
207 }
208 
209 uint8_t
211 {
212  return m_bssColor;
213 }
214 
215 Time
217 {
218  return m_maxTbPpduDelay;
219 }
220 
221 void
223 {
224  m_maxTbPpduDelay = maxTbPpduDelay;
225 }
226 
227 } // 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.
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.
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
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:931
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
Definition: type-id.h:76
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
#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:1350
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1362
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Definition: nstime.h:1414
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:533
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition: uinteger.h:46