author | Tom Henderson <tomh@tomh.org> |
Mon, 19 Oct 2009 07:54:31 -0700 | |
changeset 5434 | 81a3858041a8 |
parent 4755 | 04a9a7e9a624 |
child 5443 | 0c8d1f5e0ffa |
permissions | -rw-r--r-- |
4024 | 1 |
@node Wifi NetDevice |
2 |
@chapter Wifi NetDevice |
|
3 |
@anchor{chap:wifi} |
|
4 |
||
5 |
ns-3 nodes can contain a collection of NetDevice objects, much like an actual |
|
6 |
computer contains separate interface cards for Ethernet, Wifi, Bluetooth, etc. This chapter describes the ns-3 WifiNetDevice and related models. By |
|
7 |
adding WifiNetDevice objects to ns-3 nodes, one can create models of |
|
8 |
802.11-based infrastructure and ad hoc networks. |
|
9 |
||
10 |
@menu |
|
11 |
* Overview of the model:: |
|
12 |
* Using the WifiNetDevice:: |
|
13 |
* The WifiChannel and WifiPhy models:: |
|
14 |
* The MAC model:: |
|
15 |
* Wifi Attributes:: |
|
16 |
* Wifi Tracing:: |
|
17 |
@end menu |
|
18 |
||
19 |
@node Overview of the model |
|
20 |
@section Overview of the model |
|
21 |
||
4587 | 22 |
The WifiNetDevice models a wireless network interface controller based |
23 |
on the IEEE 802.11 standard. We will go into more detail below but in brief, |
|
24 |
ns-3 provides models for these aspects of 802.11: |
|
25 |
@itemize @bullet |
|
26 |
@item basic 802.11 DCF with @strong{infrastructure} and @strong{adhoc} modes |
|
27 |
@item @strong{802.11a} and @strong{802.11b} physical layers |
|
28 |
@item QoS-based EDCA and queueing extensions of @strong{802.11e} |
|
29 |
@item various propagation loss models including @strong{Nakagami, Rayleigh, Friis, LogDistance, FixedRss, Random} |
|
30 |
@item two propagation delay models, a distance-based and random model |
|
5434 | 31 |
@item various rate control algorithms including @strong{Aarf, Arf, Cara, Onoe, Rraa, ConstantRate, and Minstrel} |
32 |
@item 802.11s (mesh), described in another chapter |
|
4587 | 33 |
@end itemize |
4024 | 34 |
|
35 |
The set of 802.11 models provided in ns-3 attempts to provide |
|
36 |
an accurate MAC-level implementation of the 802.11 specification |
|
37 |
and to provide a not-so-slow PHY-level model of the 802.11a |
|
38 |
specification. |
|
39 |
||
4587 | 40 |
The implementation is modular and provides roughly four levels of models: |
4024 | 41 |
@itemize @bullet |
42 |
@item the @strong{PHY layer models} |
|
4432 | 43 |
@item the so-called @strong{MAC low models}: they implement DCF and EDCAF |
4024 | 44 |
@item the so-called @strong{MAC high models}: they implement the MAC-level |
45 |
beacon generation, probing, and association state machines, and |
|
46 |
@item a set of @strong{Rate control algorithms} used by the MAC low models |
|
47 |
@end itemize |
|
48 |
||
4432 | 49 |
There are presently six @strong{MAC high models}, three for non-QoS MACs and three |
50 |
for QoS MACs. |
|
51 |
@itemize @bullet |
|
52 |
@item @strong{non-QoS MACs:} |
|
4024 | 53 |
@enumerate |
54 |
@item a simple adhoc state machine that does not perform any |
|
55 |
kind of beacon generation, probing, or association. This |
|
4432 | 56 |
state machine is implemented by the @code{ns3::AdhocWifiMac} class. |
4024 | 57 |
@item an active probing and association state machine that handles |
58 |
automatic re-association whenever too many beacons are missed |
|
4432 | 59 |
is implemented by the @code{ns3::NqstaWifiMac} class. |
4024 | 60 |
@item an access point that generates periodic beacons, and that |
61 |
accepts every attempt to associate. This AP state machine |
|
4432 | 62 |
is implemented by the @code{ns3::NqapWifiMac} class. |
63 |
@end enumerate |
|
64 |
@item @strong{QoS MACs:} |
|
65 |
@enumerate |
|
66 |
@item a simple adhoc state machine like above but also able to manage QoS traffic. |
|
67 |
This state machine is implemented by @code{ns3::QadhocWifiMac} class. |
|
68 |
@item a station state machine like above but also able to manage QoS traffic. |
|
69 |
Implemented by @code{ns3::QstaWifiMac}. |
|
70 |
@item a QoS access point state machine like above implemented by @code{ns3::QapWifiMac}. |
|
71 |
@end enumerate |
|
72 |
@end itemize |
|
73 |
||
74 |
With QoS MAC models is possible to work with traffic belonging to |
|
75 |
four different access classes: @strong{AC_VO} for voice traffic, @strong{AC_VI} |
|
76 |
for video traffic, @strong{AC_BE} for best-effort traffic and @strong{AC_BK} |
|
77 |
for background traffic. |
|
78 |
In order to determine MSDU's access class, every packet forwarded down |
|
79 |
to these MAC layers should be marked using @code{ns3::QosTag} in order to set |
|
80 |
a TID (traffic id) for that packet otherwise it will be considered |
|
81 |
belonging to @strong{AC_BE} access class. |
|
4024 | 82 |
|
83 |
The @strong{MAC low layer} is split into three components: |
|
84 |
@enumerate |
|
85 |
@item @code{ns3::MacLow} which takes care of RTS/CTS/DATA/ACK transactions. |
|
4432 | 86 |
@item @code{ns3::DcfManager} and @code{ns3::DcfState} which implements the DCF and EDCAF functions. |
87 |
@item @code{ns3::DcaTxop} or @code{ns3::EdcaTxopN} which handle the packet queue, |
|
88 |
packet fragmentation, and packet retransmissions if they are needed. |
|
89 |
@code{ns3::DcaTxop} object is used by non-QoS high MACs. @code{ns3::EdcaTxopN} is |
|
90 |
used by QoS high MACs and performs also QoS operations like 802.11n MSDU |
|
91 |
aggregation. |
|
4024 | 92 |
@end enumerate |
93 |
||
94 |
There are also several @strong{rate control algorithms} that can be used by the Mac low layer: |
|
95 |
@itemize @bullet |
|
96 |
@item @code{ns3::ArfMacStations} |
|
97 |
@item @code{ns3::AArfMacStations} |
|
98 |
@item @code{ns3::IdealMacStations} |
|
99 |
@item @code{ns3::CrMacStations} |
|
100 |
@item @code{ns3::OnoeMacStations} |
|
101 |
@item @code{ns3::AmrrMacStations} |
|
102 |
@end itemize |
|
103 |
||
104 |
The PHY layer implements a single model in the |
|
105 |
@code{ns3::WifiPhy class}: the |
|
106 |
physical layer model implemented there is described fully in a paper |
|
4587 | 107 |
entitled @uref{http://cutebugs.net/files/wns2-yans.pdf,,"Yet Another Network Simulator"}. Validation results for 802.11b are available in this |
108 |
@uref{http://www.nsnam.org/~pei/80211b.pdf,,technical report}. |
|
4024 | 109 |
|
110 |
In ns-3, nodes can have multiple WifiNetDevices on separate channels, |
|
111 |
and the WifiNetDevice can coexist with other device types; this removes |
|
112 |
an architectural limitation found in ns-2. Presently, however, there |
|
113 |
is no model for cross-channel interference or coupling. |
|
114 |
||
115 |
The source code for the Wifi NetDevice lives in the directory |
|
116 |
@code{src/devices/wifi}. |
|
117 |
||
4127
3c5cb537653f
add wifi-architecture figure to manual
Tom Henderson <tomh@tomh.org>
parents:
4024
diff
changeset
|
118 |
@float Figure,fig:WifiArchitecture |
3c5cb537653f
add wifi-architecture figure to manual
Tom Henderson <tomh@tomh.org>
parents:
4024
diff
changeset
|
119 |
@caption{Wifi NetDevice architecture.} |
3c5cb537653f
add wifi-architecture figure to manual
Tom Henderson <tomh@tomh.org>
parents:
4024
diff
changeset
|
120 |
@image{../WifiArchitecture,5in} |
3c5cb537653f
add wifi-architecture figure to manual
Tom Henderson <tomh@tomh.org>
parents:
4024
diff
changeset
|
121 |
@end float |
3c5cb537653f
add wifi-architecture figure to manual
Tom Henderson <tomh@tomh.org>
parents:
4024
diff
changeset
|
122 |
|
4024 | 123 |
@node Using the WifiNetDevice |
124 |
@section Using the WifiNetDevice |
|
125 |
||
4587 | 126 |
The modularity provided by the implementation makes low-level |
127 |
configuration of the WifiNetDevice powerful but complex. For this reason, |
|
128 |
we provide some helper classes to perform common operations in a simple |
|
129 |
matter, and leverage the ns-3 attribute system to allow users to control |
|
4755
04a9a7e9a624
Manual spelling fixes from Johannes Buchner
Tom Henderson <tomh@tomh.org>
parents:
4587
diff
changeset
|
130 |
the parametrization of the underlying models. |
4587 | 131 |
|
4024 | 132 |
Users who use the low-level ns-3 API and who wish to add a WifiNetDevice |
133 |
to their node must create an instance of a WifiNetDevice, plus |
|
4755
04a9a7e9a624
Manual spelling fixes from Johannes Buchner
Tom Henderson <tomh@tomh.org>
parents:
4587
diff
changeset
|
134 |
a number of constituent objects, and bind them together appropriately |
4024 | 135 |
(the WifiNetDevice is very modular in this regard, for future |
136 |
extensibility). At the low-level API, this can be done |
|
4432 | 137 |
with about 20 lines of code (see @code{ns3::WifiHelper::Install}, and |
4024 | 138 |
@code{ns3::YansWifiPhyHelper::Create}). They also must create, |
139 |
at some point, a WifiChannel, which also contains a number of |
|
140 |
constituent objects (see @code{ns3::YansWifiChannelHelper::Create}). |
|
141 |
||
142 |
However, a few helpers are available for users to add these devices |
|
143 |
and channels with only a few lines of code, if they are willing to |
|
144 |
use defaults, and the helpers provide additional API to allow the |
|
145 |
passing of attribute values to change default values. The scripts |
|
146 |
in @code{src/examples} can be browsed to see how this is done. |
|
147 |
||
148 |
@subsection YansWifiChannelHelper |
|
149 |
||
150 |
The YansWifiChannelHelper has an unusual name. Readers may wonder why |
|
151 |
it is named this way. The reference is to the |
|
152 |
@uref{http://cutebugs.net/files/wns2-yans.pdf,,yans simulator}, |
|
153 |
from which this model is taken. The helper can be used to create |
|
154 |
a WifiChannel with a default PropagationLoss and PropagationDelay model. |
|
155 |
Specifically, the default is a channel model |
|
156 |
with a propagation delay equal to a constant, the speed of light, |
|
157 |
and a propagation loss based on a log distance model with a reference |
|
158 |
loss of 46.6777 dB at reference distance of 1m. |
|
159 |
||
160 |
Users will typically type code such as: |
|
5434 | 161 |
@smallformat |
162 |
@example |
|
4024 | 163 |
YansWifiChannelHelper wifiChannelHelper = YansWifiChannelHelper::Default (); |
164 |
Ptr<WifiChannel> wifiChannel = wifiChannelHelper.Create (); |
|
5434 | 165 |
@end example |
166 |
@end smallformat |
|
4024 | 167 |
to get the defaults. Note the distinction above in creating a helper |
168 |
object vs. an actual simulation object. |
|
169 |
In ns-3, helper objects (used at the helper API only) are created on the |
|
170 |
stack (they could also be created with operator new and later deleted). |
|
171 |
However, the actual ns-3 objects typically inherit from |
|
172 |
@code{class ns3::Object} and are assigned to a smart pointer. See the |
|
173 |
chapter on |
|
174 |
@uref{Object model} for a discussion of the ns-3 object model, if you |
|
175 |
are not familiar with it. |
|
176 |
||
177 |
@emph{Todo: Add notes about how to configure attributes with this helper API} |
|
178 |
||
179 |
@subsection YansWifiPhyHelper |
|
180 |
||
181 |
Physical devices (base class @code{ns3::Phy}) connect to |
|
182 |
@code{ns3::Channel} models in ns-3. We need to create Phy objects appropriate |
|
183 |
for the YansWifiChannel; here the @code{YansWifiPhyHelper} will |
|
184 |
do the work. |
|
185 |
||
186 |
The YansWifiPhyHelper class configures an object factory to create instances |
|
187 |
of a @code{YansWifiPhy} and |
|
188 |
adds some other objects to it, including possibly a supplemental |
|
189 |
ErrorRateModel and a pointer to a MobilityModel. The user code is |
|
190 |
typically: |
|
191 |
@verbatim |
|
192 |
YansWifiPhyHelper wifiPhyHelper = YansWifiPhyHelper::Default (); |
|
193 |
wifiPhyHelper.SetChannel (wifiChannel); |
|
194 |
@end verbatim |
|
195 |
Note that we haven't actually created any WifiPhy objects yet; we've |
|
196 |
just prepared the YansWifiPhyHelper by telling it which channel it is |
|
197 |
connected to. The phy objects are created in the next step. |
|
198 |
||
4432 | 199 |
@subsection NqosWifiMacHelper and QosWifiMacHelper |
200 |
||
201 |
The @code{ns3::NqosWifiMacHelper} and @code{ns3::QosWifiMacHelper} configure an |
|
202 |
object factory to create instances of a @code{ns3::WifiMac}. They are used to |
|
203 |
configure MAC parameters like type of MAC, values of contention windows and so on. |
|
204 |
Setting up a non-QoS MAC layers the object we use is @code{ns3::NqosWifiMacHelper}. |
|
205 |
For example the following user code configures a non-QoS MAC sta and changes its default |
|
206 |
values for contention window and Aifsn: |
|
5434 | 207 |
@smallformat |
208 |
@example |
|
4432 | 209 |
NqosWifiMacHelper wifiMacHelper = NqosWifiMacHelper::Default (); |
210 |
Ssid ssid = Ssid ("ns-3-ssid"); |
|
5434 | 211 |
wifiMacHelper.SetType ("ns3::NqstaWifiMac", "Ssid", SsidValue (ssid), |
212 |
"ActiveProbing", BooleanValue (false)); |
|
213 |
wifiMacHelper.SetDcaParameters ("MinCw", UintegerValue (20), "Aifsn", |
|
214 |
UintegerValue (3)); |
|
215 |
@end example |
|
216 |
@end smallformat |
|
4432 | 217 |
|
218 |
Setting up a QoS MACs we use a @code{ns3::QosWifiMacHelper} instead. |
|
219 |
This object could be also used to change default EDCA parameters, and to set a possible MSDU aggregator |
|
220 |
for a particular access class in order to use 802.11n MSDU aggregation feature. |
|
221 |
A possible user code: |
|
5434 | 222 |
@smallformat |
223 |
@example |
|
4432 | 224 |
QosWifiMacHelper wifiMacHelper = QosWifiMacHelper::Default (); |
5434 | 225 |
wifiMacHelper.SetType ("ns3::QapWifiMac", "Ssid", SsidValue (ssid), |
226 |
"BeaconGeneration", BooleanValue (true), |
|
4432 | 227 |
"BeaconInterval", TimeValue (Seconds (2.5))); |
228 |
wifiMacHelper.SetEdcaParametersForAc (AC_VO, "MinCw", UintegerValue (2)); |
|
5434 | 229 |
wifiMacHelper.SetMsduAggregatorForAc (AC_VO, "ns3::MsduStandardAggregator", |
230 |
"MaxAmsduSize", UintegerValue (3839)); |
|
231 |
@end example |
|
232 |
@end smallformat |
|
4432 | 233 |
|
234 |
Call to QosWifiMacHelper::Default () is needed in order to set default EDCA parameters properly for all |
|
235 |
access classes. Otherwise we should set them one by one: |
|
5434 | 236 |
@smallformat |
237 |
@example |
|
4432 | 238 |
QosWifiMacHelper wifiMacHelper; |
5434 | 239 |
wifiMacHelper.SetEdcaParametersForAc (AC_VO, "MinCw", UintegerValue (2), |
240 |
"MaxCw", UintegerValue (7), "Aifsn", UintegerValue (2)); |
|
241 |
wifiMacHelper.SetEdcaParametersForAc (AC_VI, "MinCw", UintegerValue (7), |
|
242 |
"MaxCw", UintegerValue (15), "Aifsn", UintegerValue (2)); |
|
4432 | 243 |
... |
5434 | 244 |
@end example |
245 |
@end smallformat |
|
4432 | 246 |
|
4024 | 247 |
@subsection WifiHelper |
248 |
||
249 |
We're now ready to create WifiNetDevices. First, let's create |
|
250 |
a WifiHelper with default settings: |
|
251 |
@verbatim |
|
252 |
WifiHelper wifiHelper = WifiHelper::Default (); |
|
253 |
@end verbatim |
|
254 |
What does this do? It sets the RemoteStationManager to |
|
4432 | 255 |
@code{ns3::ArfWifiManager}. |
256 |
Now, let's use the wifiPhyHelper and wifiMacHelper created above to install WifiNetDevices |
|
4024 | 257 |
on a set of nodes in a NodeContainer "c": |
5434 | 258 |
@smallformat |
259 |
@example |
|
4432 | 260 |
NetDeviceContainer wifiContainer = WifiHelper::Install (wifiPhyHelper, wifiMacHelper, c); |
5434 | 261 |
@end example |
262 |
@end smallformat |
|
4024 | 263 |
This creates the WifiNetDevice which includes also a WifiRemoteStationManager, |
264 |
a WifiMac, and a WifiPhy (connected to the matching WifiChannel). |
|
265 |
||
266 |
There are many ns-3 @uref{Attributes} that can be set on the above |
|
267 |
helpers to deviate from the default behavior; the example scripts |
|
268 |
show how to do some of this reconfiguration. |
|
269 |
||
270 |
@subsection AdHoc WifiNetDevice configuration |
|
271 |
This is a typical example of how a user might configure an adhoc network. |
|
272 |
||
5434 | 273 |
@cartouche |
274 |
To be completed |
|
275 |
@end cartouche |
|
4024 | 276 |
|
277 |
@subsection Infrastructure (Access Point and clients) WifiNetDevice configuration |
|
278 |
This is a typical example of how a user might configure an access point and a set of clients. |
|
279 |
||
5434 | 280 |
@cartouche |
281 |
To be completed |
|
282 |
@end cartouche |
|
4024 | 283 |
|
284 |
@node The WifiChannel and WifiPhy models |
|
285 |
@section The WifiChannel and WifiPhy models |
|
286 |
||
287 |
The WifiChannel subclass can be used to connect together a set of |
|
288 |
@code{ns3::WifiNetDevice} network interfaces. The class @code{ns3::WifiPhy} |
|
289 |
is the |
|
290 |
object within the WifiNetDevice that receives bits from the channel. |
|
291 |
A WifiChannel contains |
|
292 |
a @code{ns3::PropagationLossModel} and a @code{ns3::PropagationDelayModel} |
|
293 |
which can |
|
294 |
be overridden by the WifiChannel::SetPropagationLossModel |
|
295 |
and the WifiChannel::SetPropagationDelayModel methods. By default, |
|
296 |
no propagation models are set. |
|
297 |
||
298 |
The WifiPhy models an 802.11a channel, in terms of frequency, modulation, |
|
299 |
and bit rates, and interacts with the PropagationLossModel and |
|
300 |
PropagationDelayModel found in the channel. |
|
301 |
||
302 |
This section summarizes |
|
303 |
the description of the BER calculations found in the yans paper |
|
304 |
taking into account the |
|
305 |
Forward Error Correction present in 802.11a and describes |
|
306 |
the algorithm we implemented to decide whether or not a |
|
307 |
packet can be successfully received. See @uref{http://cutebugs.net/files/wns2-yans.pdf,,"Yet Another Network Simulator"} for more details. |
|
308 |
||
309 |
The PHY layer can be in one of three states: |
|
310 |
@enumerate |
|
311 |
@item TX: the PHY is currently transmitting a signal |
|
312 |
on behalf of its associated MAC |
|
313 |
@item RX: the PHY is synchronized on a signal and |
|
314 |
is waiting until it has received its last bit to forward |
|
315 |
it to the MAC. |
|
316 |
@item IDLE: the PHY is not in the TX or RX states. |
|
317 |
@end enumerate |
|
318 |
||
319 |
When the first bit of a new packet is received while |
|
320 |
the PHY is not IDLE (that is, it is already synchronized |
|
321 |
on the reception of another earlier packet or it is |
|
322 |
sending data itself), the received packet is dropped. |
|
323 |
Otherwise, if the PHY is IDLE, we calculate the received |
|
324 |
energy of the first bit of this new signal and compare it |
|
325 |
against our Energy Detection threshold (as defined |
|
326 |
by the Clear Channel Assessment function mode 1). |
|
327 |
If the energy of the packet k is higher, then the PHY moves |
|
328 |
to RX state and schedules an event when the last bit of |
|
329 |
the packet is expected to be received. Otherwise, the |
|
330 |
PHY stays in IDLE state and drops the packet. |
|
331 |
||
332 |
The energy of the received signal is assumed |
|
333 |
to be zero outside of the reception interval of packet k and |
|
334 |
is calculated from the transmission power with a path-loss |
|
335 |
propagation model in the reception interval. |
|
336 |
where the path loss exponent, @math{n}, is chosen equal to 3, |
|
337 |
the reference distance, @math{d_0} is choosen equal to |
|
338 |
@math{1.0m} and |
|
339 |
the reference energy is based based on a Friis |
|
340 |
propagation model. |
|
341 |
||
342 |
When the last bit of the packet upon which the PHY is |
|
343 |
synchronized is received, we need to calculate the |
|
344 |
probability that the packet is received with any error |
|
345 |
to decide whether or not |
|
346 |
the packet on which we were synchronized could |
|
347 |
be successfully received or not: a random number |
|
348 |
is drawn from a uniform distribution and is compared against |
|
349 |
the probability of error. |
|
350 |
||
351 |
To evaluate the probability of error, we start from the piecewise linear |
|
352 |
functions shown in Figure @ref{fig:snir} and calculate the |
|
353 |
SNIR function. |
|
354 |
||
355 |
@float Figure,fig:snir |
|
356 |
@caption{SNIR function over time} |
|
357 |
@image{figures/snir,,3in} |
|
358 |
@end float |
|
359 |
||
360 |
From the SNIR function we can derive bit error rates for BPSK and QAM |
|
361 |
modulations. Then, for each interval l where BER is |
|
362 |
constant, we define the upper bound of a probability that an error is |
|
363 |
present in the chunk of bits located in the interval l for packet k. |
|
364 |
If we assume an AWGN channel, |
|
365 |
binary convolutional coding (which is the case in 802.11a) |
|
366 |
and hard-decision Viterbi decoding, the error rate is thus derived, |
|
367 |
and the packet error probability for packet k can be computed.. |
|
368 |
||
369 |
@subsection WifiChannel configuration |
|
370 |
||
371 |
WifiChannel models include both a PropagationDelayModel and a |
|
372 |
PropagationLossModel. The following PropagationDelayModels are available: |
|
373 |
@itemize @bullet |
|
374 |
@item ConstantSpeedPropagationDelayModel |
|
375 |
@item RandomPropagationDelayModel |
|
376 |
@end itemize |
|
377 |
||
378 |
The following PropagationLossModels are available: |
|
379 |
@itemize @bullet |
|
380 |
@item RandomPropagationLossModel |
|
381 |
@item FriisPropagationLossModel |
|
382 |
@item LogDistancePropagationLossModel |
|
383 |
@item JakesPropagationLossModel |
|
384 |
@item CompositePropagationLossModel |
|
385 |
@end itemize |
|
386 |
||
387 |
@node The MAC model |
|
388 |
@section The MAC model |
|
389 |
||
390 |
The 802.11 Distributed Coordination Function is used to |
|
391 |
calculate when to grant access to the transmission medium. While |
|
392 |
implementing the DCF would have been particularly easy if we |
|
393 |
had used a recurring timer that expired every slot, we |
|
394 |
chose to use the method described in @emph{(missing reference here from |
|
395 |
Yans paper)} |
|
396 |
where the backoff timer duration is lazily calculated whenever |
|
397 |
needed since it is claimed to have much better performance than |
|
398 |
the simpler recurring timer solution. |
|
399 |
||
400 |
The higher-level MAC functions are implemented in a set of other |
|
401 |
C++ classes and deal with: |
|
402 |
@itemize @bullet |
|
403 |
@item packet fragmentation and defragmentation, |
|
404 |
@item use of the rts/cts protocol, |
|
405 |
@item rate control algorithm, |
|
406 |
@item connection and disconnection to and from an Access Point, |
|
407 |
@item the MAC transmission queue, |
|
408 |
@item beacon generation, |
|
4432 | 409 |
@item msdu aggregation, |
4024 | 410 |
@item etc. |
411 |
@end itemize |
|
412 |
||
413 |
@node Wifi Attributes |
|
414 |
@section Wifi Attributes |
|
415 |
||
416 |
The WifiNetDevice makes heavy use of the ns-3 @ref{Attributes} subsystem for |
|
417 |
configuration and default value management. Presently, approximately |
|
418 |
100 values are stored in this system. |
|
419 |
||
420 |
For instance, class @code{ns-3::WifiMac} exports these attributes: |
|
421 |
@itemize @bullet |
|
422 |
@item CtsTimeout: When this timeout expires, the RTS/CTS handshake has failed. |
|
423 |
@item AckTimeout: When this timeout expires, the DATA/ACK handshake has failed. |
|
424 |
@item Sifs: The value of the SIFS constant. |
|
425 |
@item EifsNoDifs: The value of EIFS-DIFS |
|
426 |
@item Slot: The duration of a Slot. |
|
427 |
@item Pifs: The value of the PIFS constant. |
|
428 |
@item MaxPropagationDelay: The maximum propagation delay. Unused for now. |
|
429 |
@item MaxMsduSize: The maximum size of an MSDU accepted by the MAC layer.This value conforms to the specification. |
|
430 |
@item Ssid: The ssid we want to belong to. |
|
431 |
@end itemize |
|
432 |
||
433 |
@node Wifi Tracing |
|
434 |
@section Wifi Tracing |
|
435 |
||
436 |
@emph{This needs revised/updating based on the latest Doxygen} |
|
437 |
||
438 |
ns-3 has a sophisticated tracing infrastructure that allows users to hook |
|
439 |
into existing trace sources, or to define and export new ones. |
|
440 |
||
441 |
Wifi-related trace sources that are available by default include: |
|
442 |
@itemize @bullet |
|
443 |
@item @code{ns3::WifiNetDevice} |
|
444 |
@itemize @bullet |
|
445 |
@item Rx: Received payload from the MAC layer. |
|
446 |
@item Tx: Send payload to the MAC layer. |
|
447 |
@end itemize |
|
448 |
@item @code{ns3::WifiPhy} |
|
449 |
@itemize @bullet |
|
450 |
@item State: The WifiPhy state |
|
451 |
@item RxOk: A packet has been received successfully. |
|
452 |
@item RxError: A packet has been received unsuccessfully. |
|
453 |
@item Tx: Packet transmission is starting. |
|
454 |
@end itemize |
|
455 |
@end itemize |
|
456 |
Briefly, this means, for example, that a user can hook a processing |
|
457 |
function to the "State" tracing hook above and be notified whenever the |
|
458 |
WifiPhy model changes state. |