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