A Discrete-Event Network Simulator
API
he-configuration.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 University of Washington
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 
20 #include "ns3/log.h"
21 #include "ns3/nstime.h"
22 #include "ns3/uinteger.h"
23 #include "he-configuration.h"
24 
25 namespace ns3 {
26 
27 NS_LOG_COMPONENT_DEFINE ("HeConfiguration");
28 NS_OBJECT_ENSURE_REGISTERED (HeConfiguration);
29 
31 {
32  NS_LOG_FUNCTION (this);
33 }
34 
35 TypeId
37 {
38  static ns3::TypeId tid = ns3::TypeId ("ns3::HeConfiguration")
39  .SetParent<Object> ()
40  .SetGroupName ("Wifi")
41  .AddConstructor<HeConfiguration> ()
42  .AddAttribute ("GuardInterval",
43  "Specify the shortest guard interval duration that can be used for HE transmissions."
44  "Possible values are 800ns, 1600ns or 3200ns.",
45  TimeValue (NanoSeconds (3200)),
48  MakeTimeChecker (NanoSeconds (800), NanoSeconds (3200)))
49  .AddAttribute ("BssColor",
50  "The BSS color",
51  UintegerValue (0),
54  MakeUintegerChecker<uint8_t> ())
55  .AddAttribute ("MpduBufferSize",
56  "The MPDU buffer size for receiving A-MPDUs",
57  UintegerValue (64),
60  MakeUintegerChecker<uint16_t> (64, 256))
61  .AddAttribute ("MuBeAifsn",
62  "AIFSN used by BE EDCA when the MU EDCA Timer is running. "
63  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
64  UintegerValue (0),
66  MakeUintegerChecker<uint8_t> (0, 15))
67  .AddAttribute ("MuBkAifsn",
68  "AIFSN used by BK EDCA when the MU EDCA Timer is running. "
69  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
70  UintegerValue (0),
72  MakeUintegerChecker<uint8_t> (0, 15))
73  .AddAttribute ("MuViAifsn",
74  "AIFSN used by VI EDCA when the MU EDCA Timer is running. "
75  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
76  UintegerValue (0),
78  MakeUintegerChecker<uint8_t> (0, 15))
79  .AddAttribute ("MuVoAifsn",
80  "AIFSN used by VO EDCA when the MU EDCA Timer is running. "
81  "It must be either zero (EDCA disabled) or a value from 2 to 15.",
82  UintegerValue (0),
84  MakeUintegerChecker<uint8_t> (0, 15))
85  .AddAttribute ("MuBeCwMin",
86  "CWmin used by BE EDCA when the MU EDCA Timer is running. "
87  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
88  UintegerValue (15),
90  MakeUintegerChecker<uint16_t> (0, 32767))
91  .AddAttribute ("MuBkCwMin",
92  "CWmin used by BK EDCA when the MU EDCA Timer is running. "
93  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
94  UintegerValue (15),
96  MakeUintegerChecker<uint16_t> (0, 32767))
97  .AddAttribute ("MuViCwMin",
98  "CWmin used by VI EDCA when the MU EDCA Timer is running. "
99  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
100  UintegerValue (15),
102  MakeUintegerChecker<uint16_t> (0, 32767))
103  .AddAttribute ("MuVoCwMin",
104  "CWmin used by VO EDCA when the MU EDCA Timer is running. "
105  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
106  UintegerValue (15),
108  MakeUintegerChecker<uint16_t> (0, 32767))
109  .AddAttribute ("MuBeCwMax",
110  "CWmax used by BE EDCA when the MU EDCA Timer is running. "
111  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
112  UintegerValue (1023),
114  MakeUintegerChecker<uint16_t> (0, 32767))
115  .AddAttribute ("MuBkCwMax",
116  "CWmax used by BK EDCA when the MU EDCA Timer is running. "
117  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
118  UintegerValue (1023),
120  MakeUintegerChecker<uint16_t> (0, 32767))
121  .AddAttribute ("MuViCwMax",
122  "CWmax used by VI EDCA when the MU EDCA Timer is running. "
123  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
124  UintegerValue (1023),
126  MakeUintegerChecker<uint16_t> (0, 32767))
127  .AddAttribute ("MuVoCwMax",
128  "CWmax used by VO EDCA when the MU EDCA Timer is running. "
129  "It must be a power of 2 minus 1 in the range from 0 to 32767.",
130  UintegerValue (1023),
132  MakeUintegerChecker<uint16_t> (0, 32767))
133  .AddAttribute ("BeMuEdcaTimer",
134  "The MU EDCA Timer used by BE EDCA. It must be a multiple of "
135  "8192 us and must be in the range from 8.192 ms to 2088.96 ms. "
136  "0 is a reserved value, but we allow to use this value to indicate "
137  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
138  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
139  TimeValue (MicroSeconds (0)),
141  MakeTimeChecker (MicroSeconds (0), MicroSeconds (2088960)))
142  .AddAttribute ("BkMuEdcaTimer",
143  "The MU EDCA Timer used by BK EDCA. It must be a multiple of "
144  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
145  "0 is a reserved value, but we allow to use this value to indicate "
146  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
147  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
148  TimeValue (MicroSeconds (0)),
150  MakeTimeChecker (MicroSeconds (0), MicroSeconds (2088960)))
151  .AddAttribute ("ViMuEdcaTimer",
152  "The MU EDCA Timer used by VI EDCA. It must be a multiple of "
153  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
154  "0 is a reserved value, but we allow to use this value to indicate "
155  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
156  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
157  TimeValue (MicroSeconds (0)),
159  MakeTimeChecker (MicroSeconds (0), MicroSeconds (2088960)))
160  .AddAttribute ("VoMuEdcaTimer",
161  "The MU EDCA Timer used by VO EDCA. It must be a multiple of "
162  "8192 us and must be in the range from 8.192 ms to 2088.96 ms."
163  "0 is a reserved value, but we allow to use this value to indicate "
164  "that an MU EDCA Parameter Set element must not be sent. Therefore, "
165  "0 can only be used if the MU EDCA Timer for all ACs is set to 0.",
166  TimeValue (MicroSeconds (0)),
168  MakeTimeChecker (MicroSeconds (0), MicroSeconds (2088960)))
169  ;
170  return tid;
171 }
172 
173 void
175 {
176  NS_LOG_FUNCTION (this << guardInterval);
177  NS_ASSERT (guardInterval == NanoSeconds (800) || guardInterval == NanoSeconds (1600) || guardInterval == NanoSeconds (3200));
178  m_guardInterval = guardInterval;
179 }
180 
181 Time
183 {
184  return m_guardInterval;
185 }
186 
187 void
189 {
190  NS_LOG_FUNCTION (this << +bssColor);
191  m_bssColor = bssColor;
192 }
193 
194 uint8_t
196 {
197  return m_bssColor;
198 }
199 
200 void
202 {
203  NS_LOG_FUNCTION (this << size);
204  m_mpduBufferSize = size;
205 }
206 
207 uint16_t
209 {
210  return m_mpduBufferSize;
211 }
212 
213 } //namespace ns3
HE configuration.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t m_muBkCwMin
CWmin for BK in MU EDCA Parameter Set.
uint16_t m_muBkCwMax
CWmax for BK in MU EDCA Parameter Set.
uint8_t GetBssColor(void) const
uint16_t m_muVoCwMin
CWmin for VO in MU EDCA Parameter Set.
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 GetGuardInterval(void) const
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.
uint16_t GetMpduBufferSize(void) const
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.
A base class which provides memory management and object aggregation.
Definition: object.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
AttributeValue implementation for Time.
Definition: nstime.h:1308
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Hold an unsigned integer type.
Definition: uinteger.h:44
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
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:1309
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:45
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#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:45
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1260
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1268
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:522