author | Ghada Badawy <gbadawy@gmail.com> |
Tue, 13 Aug 2013 22:05:25 -0700 | |
changeset 10139 | 17a71cd49da3 |
parent 9818 | cfb12f56257a |
child 10204 | 7a102bb70a36 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7143
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
1889 | 2 |
/* |
3 |
* Copyright (c) 2005,2006 INRIA |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
1889 | 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 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
|
10139 | 19 |
* Author: ghada Badawy <gbadawy@gmail.com> |
1889 | 20 |
*/ |
21 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
22 |
#ifndef YANS_WIFI_PHY_H |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
23 |
#define YANS_WIFI_PHY_H |
1889 | 24 |
|
25 |
#include <stdint.h> |
|
26 |
#include "ns3/callback.h" |
|
27 |
#include "ns3/event-id.h" |
|
28 |
#include "ns3/packet.h" |
|
2054
ba8e810bae4c
derive WifiPhy from Object and manage it with a Ptr<>
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1988
diff
changeset
|
29 |
#include "ns3/object.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
30 |
#include "ns3/traced-callback.h" |
1889 | 31 |
#include "ns3/nstime.h" |
32 |
#include "ns3/ptr.h" |
|
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
33 |
#include "ns3/random-variable-stream.h" |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
34 |
#include "wifi-phy.h" |
1902
26a57487bb49
no need for ns3 prefix
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1892
diff
changeset
|
35 |
#include "wifi-mode.h" |
1920
1d4864775cf8
replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1919
diff
changeset
|
36 |
#include "wifi-preamble.h" |
2166
00b5eb43dba2
Improve the accuracy of 802.11a tx duration calculations.
Federico Maguolo <federico.maguolo@dei.unipd.it>
parents:
2159
diff
changeset
|
37 |
#include "wifi-phy-standard.h" |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
38 |
#include "interference-helper.h" |
1889 | 39 |
|
40 |
||
41 |
namespace ns3 { |
|
42 |
||
10139 | 43 |
#define HT_PHY 127 |
44 |
||
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
45 |
class YansWifiChannel; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
46 |
class WifiPhyStateHelper; |
1889 | 47 |
|
48 |
||
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
49 |
/** |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
50 |
* \brief 802.11 PHY layer model |
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
51 |
* \ingroup wifi |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
52 |
* |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
53 |
* This PHY implements a model of 802.11a. The model |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
54 |
* implemented here is based on the model described |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
55 |
* in "Yet Another Network Simulator", |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
56 |
* (http://cutebugs.net/files/wns2-yans.pdf). |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
57 |
* |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
58 |
* |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
59 |
* This PHY model depends on a channel loss and delay |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
60 |
* model as provided by the ns3::PropagationLossModel |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
61 |
* and ns3::PropagationDelayModel classes, both of which are |
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
62 |
* members of the ns3::YansWifiChannel class. |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
63 |
*/ |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
64 |
class YansWifiPhy : public WifiPhy |
1889 | 65 |
{ |
66 |
public: |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
67 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
68 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
69 |
YansWifiPhy (); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
70 |
virtual ~YansWifiPhy (); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
71 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
72 |
void SetChannel (Ptr<YansWifiChannel> channel); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
73 |
|
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
74 |
/** |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
75 |
* \brief Set channel number. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
76 |
* |
9818
cfb12f56257a
fixed Bug 1677 - The annotation of YansWifiPhy needs correction
Junling Bu <linlinjavaer@gmail.com>
parents:
9142
diff
changeset
|
77 |
* Channel center frequency = Channel starting frequency + 5 MHz * nch |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
78 |
* |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
79 |
* where Starting channel frequency is standard-dependent, see SetStandard() |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
80 |
* as defined in IEEE 802.11-2007 17.3.8.3.2. |
5192 | 81 |
* |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
82 |
* YansWifiPhy can switch among different channels. Basically, YansWifiPhy |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
83 |
* has a private attribute m_channelNumber that identifies the channel the |
5192 | 84 |
* PHY operates on. Channel switching cannot interrupt an ongoing transmission. |
85 |
* When PHY is in TX state, the channel switching is postponed until the end |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
86 |
* of the current transmission. When the PHY is in RX state, the channel |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
87 |
* switching causes the drop of the synchronized packet. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
88 |
*/ |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
89 |
void SetChannelNumber (uint16_t id); |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
90 |
/// Return current channel number, see SetChannelNumber() |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
91 |
uint16_t GetChannelNumber () const; |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5820
diff
changeset
|
92 |
/// Return current center channel frequency in MHz, see SetChannelNumber() |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
93 |
double GetChannelFrequencyMhz () const; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
94 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
95 |
void StartReceivePacket (Ptr<Packet> packet, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
96 |
double rxPowerDbm, |
10139 | 97 |
WifiTxVector txVector, |
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
98 |
WifiPreamble preamble); |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
99 |
|
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
100 |
void SetRxNoiseFigure (double noiseFigureDb); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
101 |
void SetTxPowerStart (double start); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
102 |
void SetTxPowerEnd (double end); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
103 |
void SetNTxPower (uint32_t n); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
104 |
void SetTxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
105 |
void SetRxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
106 |
void SetEdThreshold (double threshold); |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
107 |
void SetCcaMode1Threshold (double threshold); |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
108 |
void SetErrorRateModel (Ptr<ErrorRateModel> rate); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
109 |
void SetDevice (Ptr<Object> device); |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
110 |
void SetMobility (Ptr<Object> mobility); |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
111 |
double GetRxNoiseFigure (void) const; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
112 |
double GetTxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
113 |
double GetRxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
114 |
double GetEdThreshold (void) const; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
115 |
double GetCcaMode1Threshold (void) const; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
116 |
Ptr<ErrorRateModel> GetErrorRateModel (void) const; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
117 |
Ptr<Object> GetDevice (void) const; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
118 |
Ptr<Object> GetMobility (void); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
119 |
|
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
120 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
121 |
|
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
122 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
123 |
virtual double GetTxPowerStart (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
124 |
virtual double GetTxPowerEnd (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
125 |
virtual uint32_t GetNTxPower (void) const; |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
126 |
virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback); |
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
127 |
virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback); |
10139 | 128 |
virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, WifiTxVector txvector); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
129 |
virtual void RegisterListener (WifiPhyListener *listener); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
130 |
virtual bool IsStateCcaBusy (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
131 |
virtual bool IsStateIdle (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
132 |
virtual bool IsStateBusy (void); |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
133 |
virtual bool IsStateRx (void); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
134 |
virtual bool IsStateTx (void); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
135 |
virtual bool IsStateSwitching (void); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
136 |
virtual Time GetStateDuration (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
137 |
virtual Time GetDelayUntilIdle (void); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
138 |
virtual Time GetLastRxStartTime (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
139 |
virtual uint32_t GetNModes (void) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
140 |
virtual WifiMode GetMode (uint32_t mode) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
141 |
virtual double CalculateSnr (WifiMode txMode, double ber) const; |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
142 |
virtual Ptr<WifiChannel> GetChannel (void) const; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4690
diff
changeset
|
143 |
virtual void ConfigureStandard (enum WifiPhyStandard standard); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
144 |
|
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
145 |
/** |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
146 |
* Assign a fixed random variable stream number to the random variables |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
147 |
* used by this model. Return the number of streams (possibly zero) that |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
148 |
* have been assigned. |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
149 |
* |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
150 |
* \param stream first stream index to use |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
151 |
* \return the number of stream indices assigned by this model |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
152 |
*/ |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
153 |
int64_t AssignStreams (int64_t stream); |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
154 |
|
10139 | 155 |
/** |
156 |
* \param the operating frequency on this node (2.4 GHz or 5GHz). |
|
157 |
*/ |
|
158 |
virtual void SetFrequency (uint32_t freq); |
|
159 |
/** |
|
160 |
* \returns the operating frequency on this node |
|
161 |
*/ |
|
162 |
virtual uint32_t GetFrequency (void) const; |
|
163 |
/** |
|
164 |
* \param the number of transmitters on this node. |
|
165 |
*/ |
|
166 |
virtual void SetNumberOfTransmitAntennas (uint32_t tx); |
|
167 |
virtual uint32_t GetNumberOfTransmitAntennas (void) const; |
|
168 |
/** |
|
169 |
* \param the number of recievers on this node. |
|
170 |
*/ |
|
171 |
virtual void SetNumberOfReceiveAntennas (uint32_t rx) ; |
|
172 |
/** |
|
173 |
* \returns the number of recievers on this node. |
|
174 |
*/ |
|
175 |
virtual uint32_t GetNumberOfReceiveAntennas (void) const; |
|
176 |
/** |
|
177 |
* \param set short/long guard interval. |
|
178 |
*/ |
|
179 |
virtual void SetGuardInterval (bool GuardInterval); |
|
180 |
virtual bool GetGuardInterval (void) const; |
|
181 |
/** |
|
182 |
* \param sets LDPC is supported or not |
|
183 |
*/ |
|
184 |
virtual void SetLdpc (bool Ldpc); |
|
185 |
/** |
|
186 |
* \returns if LDPC is supported or not |
|
187 |
*/ |
|
188 |
virtual bool GetLdpc (void) const; |
|
189 |
/** |
|
190 |
* \param sets STBC is supported or not |
|
191 |
*/ |
|
192 |
virtual void SetStbc (bool stbc); |
|
193 |
/** |
|
194 |
* \returns if STBC is supported or not |
|
195 |
*/ |
|
196 |
virtual bool GetStbc (void) const; |
|
197 |
/** |
|
198 |
* \param sets Greenfield is supported or not |
|
199 |
*/ |
|
200 |
virtual void SetGreenfield (bool greenfield); |
|
201 |
/** |
|
202 |
* \returns if Greenfield is supported or not |
|
203 |
*/ |
|
204 |
virtual bool GetGreenfield (void) const; |
|
205 |
/** |
|
206 |
* \param sets channel bonding is supported or not |
|
207 |
*/ |
|
208 |
virtual bool GetChannelBonding (void) const ; |
|
209 |
/** |
|
210 |
* \returns if channel bonding is supported or not |
|
211 |
*/ |
|
212 |
virtual void SetChannelBonding (bool channelbonding) ; |
|
213 |
||
214 |
virtual uint32_t GetNBssMembershipSelectors (void) const; |
|
215 |
virtual uint32_t GetBssMembershipSelector (uint32_t selector) const; |
|
216 |
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector); |
|
217 |
/** |
|
218 |
* \returns the number of MCS supported by this phy |
|
219 |
*/ |
|
220 |
virtual uint8_t GetNMcs (void) const; |
|
221 |
virtual uint8_t GetMcs (uint8_t mcs) const; |
|
222 |
/** |
|
223 |
* For a given WifiMode finds the corresponding MCS value and returns it |
|
224 |
* as defined in the IEEE 802.11n standard |
|
225 |
* |
|
226 |
* \param mode the WifiMode |
|
227 |
* \returns the MCS number that corresponds to the given WifiMode |
|
228 |
*/ |
|
229 |
virtual uint32_t WifiModeToMcs (WifiMode mode); |
|
230 |
/** |
|
231 |
* For a given MCS finds the corresponding WifiMode and returns it |
|
232 |
* as defined in the IEEE 802.11n standard. |
|
233 |
* |
|
234 |
* \param mcs the MCS number |
|
235 |
* \returns the WifiMode that corresponds to the given mcs number |
|
236 |
*/ |
|
237 |
virtual WifiMode McsToWifiMode (uint8_t mcs); |
|
238 |
||
1889 | 239 |
private: |
3906 | 240 |
YansWifiPhy (const YansWifiPhy &o); |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
241 |
virtual void DoDispose (void); |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
242 |
void Configure80211a (void); |
4470 | 243 |
void Configure80211b (void); |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6372
diff
changeset
|
244 |
void Configure80211g (void); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
245 |
void Configure80211_10Mhz (void); |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
246 |
void Configure80211_5Mhz (); |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2071
diff
changeset
|
247 |
void ConfigureHolland (void); |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
248 |
void Configure80211p_CCH (void); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
249 |
void Configure80211p_SCH (void); |
10139 | 250 |
void Configure80211n (void); |
1889 | 251 |
double GetEdThresholdW (void) const; |
252 |
double DbmToW (double dbm) const; |
|
253 |
double DbToRatio (double db) const; |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
254 |
double WToDbm (double w) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
255 |
double RatioToDb (double ratio) const; |
1889 | 256 |
double GetPowerDbm (uint8_t power) const; |
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
257 |
void EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event); |
3897
44645cec42f2
split state management in a helper class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3893
diff
changeset
|
258 |
|
1889 | 259 |
private: |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
260 |
double m_edThresholdW; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
261 |
double m_ccaMode1ThresholdW; |
2071
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
262 |
double m_txGainDb; |
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
263 |
double m_rxGainDb; |
1889 | 264 |
double m_txPowerBaseDbm; |
265 |
double m_txPowerEndDbm; |
|
266 |
uint32_t m_nTxPower; |
|
267 |
||
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
268 |
Ptr<YansWifiChannel> m_channel; |
10139 | 269 |
uint16_t m_channelNumber; |
270 |
Ptr<Object> m_device; |
|
271 |
Ptr<Object> m_mobility; |
|
272 |
||
273 |
// number of transmitters |
|
274 |
uint32_t m_numberOfTransmitters; |
|
275 |
// number of recievers |
|
276 |
uint32_t m_numberOfReceivers; |
|
277 |
//if true use LDPC |
|
278 |
bool m_ldpc; |
|
279 |
// True if STBC is used |
|
280 |
bool m_stbc; |
|
281 |
//True if GreenField format is supported |
|
282 |
bool m_greenfield; |
|
283 |
//True is short guard interval is used |
|
284 |
bool m_guardInterval; |
|
285 |
//True if channel bonding is used |
|
286 |
bool m_channelBonding; |
|
287 |
||
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
288 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
289 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
290 |
* This vector holds the set of transmission modes that this |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
291 |
* WifiPhy(-derived class) can support. In conversation we call this |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
292 |
* the DeviceRateSet (not a term you'll find in the standard), and |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
293 |
* it is a superset of standard-defined parameters such as the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
294 |
* OperationalRateSet, and the BSSBasicRateSet (which, themselves, |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
295 |
* have a superset/subset relationship). |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
296 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
297 |
* Mandatory rates relevant to this WifiPhy can be found by |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
298 |
* iterating over this vector looking for WifiMode objects for which |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
299 |
* WifiMode::IsMandatory() is true. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
300 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
301 |
* A quick note is appropriate here (well, here is as good a place |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
302 |
* as any I can find)... |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
303 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
304 |
* In the standard there is no text that explicitly precludes |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
305 |
* production of a device that does not support some rates that are |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
306 |
* mandatory (according to the standard) for PHYs that the device |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
307 |
* happens to fully or partially support. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
308 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
309 |
* This approach is taken by some devices which choose to only support, |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
310 |
* for example, 6 and 9 Mbps ERP-OFDM rates for cost and power |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
311 |
* consumption reasons (i.e., these devices don't need to be designed |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
312 |
* for and waste current on the increased linearity requirement of |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
313 |
* higher-order constellations when 6 and 9 Mbps more than meet their |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
314 |
* data requirements). The wording of the standard allows such devices |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
315 |
* to have an OperationalRateSet which includes 6 and 9 Mbps ERP-OFDM |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
316 |
* rates, despite 12 and 24 Mbps being "mandatory" rates for the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
317 |
* ERP-OFDM PHY. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
318 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
319 |
* Now this doesn't actually have any impact on code, yet. It is, |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
320 |
* however, something that we need to keep in mind for the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
321 |
* future. Basically, the key point is that we can't be making |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
322 |
* assumptions like "the Operational Rate Set will contain all the |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
323 |
* mandatory rates". |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
324 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
325 |
WifiModeList m_deviceRateSet; |
10139 | 326 |
|
327 |
std::vector<uint32_t> m_bssMembershipSelectorSet; |
|
328 |
std::vector<uint8_t> m_deviceMcsSet; |
|
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
329 |
EventId m_endRxEvent; |
8981
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
330 |
/// Provides uniform random variables. |
7e1c95c4d1a7
Replace src/wifi usage of RandomVariable with RandomVariableStream
Mitch Watrous
parents:
7385
diff
changeset
|
331 |
Ptr<UniformRandomVariable> m_random; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
332 |
/// Standard-dependent center frequency of 0-th channel, MHz |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
333 |
double m_channelStartingFrequency; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
334 |
Ptr<WifiPhyStateHelper> m_state; |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
335 |
InterferenceHelper m_interference; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
336 |
Time m_channelSwitchDelay; |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3912
diff
changeset
|
337 |
|
1889 | 338 |
}; |
339 |
||
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
340 |
} // namespace ns3 |
1889 | 341 |
|
342 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
343 |
#endif /* YANS_WIFI_PHY_H */ |