author | Nicola Baldo <nicola@baldo.biz> |
Mon, 09 May 2011 22:03:43 +0200 | |
changeset 7143 | 0146b1916bc0 |
parent 7141 | 072fb225b714 |
child 7385 | 10beb0e53130 |
permissions | -rw-r--r-- |
1889 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
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> |
|
19 |
*/ |
|
20 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
21 |
#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
|
22 |
#define YANS_WIFI_PHY_H |
1889 | 23 |
|
24 |
#include <stdint.h> |
|
25 |
#include "ns3/callback.h" |
|
26 |
#include "ns3/event-id.h" |
|
27 |
#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
|
28 |
#include "ns3/object.h" |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
29 |
#include "ns3/traced-callback.h" |
1889 | 30 |
#include "ns3/nstime.h" |
31 |
#include "ns3/ptr.h" |
|
32 |
#include "ns3/random-variable.h" |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
33 |
#include "wifi-phy.h" |
1902
26a57487bb49
no need for ns3 prefix
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1892
diff
changeset
|
34 |
#include "wifi-mode.h" |
1920
1d4864775cf8
replace header mode with preamble mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1919
diff
changeset
|
35 |
#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
|
36 |
#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
|
37 |
#include "interference-helper.h" |
1889 | 38 |
|
39 |
||
40 |
namespace ns3 { |
|
41 |
||
42 |
class RandomUniform; |
|
43 |
class RxEvent; |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
44 |
class YansWifiChannel; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
45 |
class WifiPhyStateHelper; |
1889 | 46 |
|
47 |
||
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
48 |
/** |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
49 |
* \brief 802.11 PHY layer model |
7139
79dd02ed46ec
doxygen wifi module grouping all wifi classes
Nicola Baldo <nbaldo@cttc.es>
parents:
6852
diff
changeset
|
50 |
* \ingroup wifi |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
51 |
* |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
52 |
* 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
|
53 |
* 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
|
54 |
* in "Yet Another Network Simulator", |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
55 |
* (http://cutebugs.net/files/wns2-yans.pdf). |
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
56 |
* |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
57 |
* |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
58 |
* 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
|
59 |
* model as provided by the ns3::PropagationLossModel |
2684
68c643329c2b
improve doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2659
diff
changeset
|
60 |
* 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
|
61 |
* members of the ns3::YansWifiChannel class. |
2057
73723aad7527
dox for WifiPhy
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2056
diff
changeset
|
62 |
*/ |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
63 |
class YansWifiPhy : public WifiPhy |
1889 | 64 |
{ |
65 |
public: |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
66 |
static TypeId GetTypeId (void); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
67 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
68 |
YansWifiPhy (); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
69 |
virtual ~YansWifiPhy (); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
70 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
71 |
void SetChannel (Ptr<YansWifiChannel> channel); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
72 |
|
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 |
* \brief Set channel number. |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
75 |
* |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
76 |
* Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1) |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
77 |
* |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
78 |
* 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
|
79 |
* as defined in IEEE 802.11-2007 17.3.8.3.2. |
5192 | 80 |
* |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
81 |
* 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
|
82 |
* has a private attribute m_channelNumber that identifies the channel the |
5192 | 83 |
* PHY operates on. Channel switching cannot interrupt an ongoing transmission. |
84 |
* 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
|
85 |
* 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
|
86 |
* 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
|
87 |
*/ |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
88 |
void SetChannelNumber (uint16_t id); |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
89 |
/// Return current channel number, see SetChannelNumber() |
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
90 |
uint16_t GetChannelNumber () const; |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5820
diff
changeset
|
91 |
/// 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
|
92 |
double GetChannelFrequencyMhz () const; |
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
93 |
|
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
94 |
void StartReceivePacket (Ptr<Packet> packet, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
95 |
double rxPowerDbm, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
96 |
WifiMode mode, |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
97 |
WifiPreamble preamble); |
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
98 |
|
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
99 |
void SetRxNoiseFigure (double noiseFigureDb); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
100 |
void SetTxPowerStart (double start); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
101 |
void SetTxPowerEnd (double end); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
102 |
void SetNTxPower (uint32_t n); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
103 |
void SetTxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
104 |
void SetRxGain (double gain); |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
105 |
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
|
106 |
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
|
107 |
void SetErrorRateModel (Ptr<ErrorRateModel> rate); |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
108 |
void SetDevice (Ptr<Object> device); |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
109 |
void SetMobility (Ptr<Object> mobility); |
4315
56a5bf298339
noiseFloor -> noiseFigure (bug 543)
Nicola Baldo <nbaldo@cttc.es>
parents:
4264
diff
changeset
|
110 |
double GetRxNoiseFigure (void) const; |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
111 |
double GetTxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
112 |
double GetRxGain (void) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
113 |
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
|
114 |
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
|
115 |
Ptr<ErrorRateModel> GetErrorRateModel (void) const; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
116 |
Ptr<Object> GetDevice (void) const; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
117 |
Ptr<Object> GetMobility (void); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
118 |
|
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
119 |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
120 |
|
1891
add6fb8761f3
use WifiMode rather than TransmissionMode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1890
diff
changeset
|
121 |
|
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
122 |
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
|
123 |
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
|
124 |
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
|
125 |
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
|
126 |
virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback); |
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
127 |
virtual void SendPacket (Ptr<const Packet> packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel); |
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
128 |
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
|
129 |
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
|
130 |
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
|
131 |
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
|
132 |
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
|
133 |
virtual bool IsStateTx (void); |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
134 |
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
|
135 |
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
|
136 |
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
|
137 |
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
|
138 |
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
|
139 |
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
|
140 |
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
|
141 |
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
|
142 |
virtual void ConfigureStandard (enum WifiPhyStandard standard); |
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
143 |
|
1889 | 144 |
private: |
3906 | 145 |
YansWifiPhy (const YansWifiPhy &o); |
2530
05f9cec44621
avoid memory leaks
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2524
diff
changeset
|
146 |
virtual void DoDispose (void); |
1964
041240a915f8
build and link
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1920
diff
changeset
|
147 |
void Configure80211a (void); |
4470 | 148 |
void Configure80211b (void); |
6597
7fbc895f7361
Bug 852: Support ERP-OFDM rates and thus '802.11g'
Dean Armstrong <deanarm@gmail.com>
parents:
6372
diff
changeset
|
149 |
void Configure80211g (void); |
4680
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
150 |
void Configure80211_10Mhz (void); |
a52c39181dd4
Support for 5 and 10Mhz wifi channels
Ramon Bauza <monbauza@gmail.com>
parents:
4492
diff
changeset
|
151 |
void Configure80211_5Mhz (); |
2083
c7541b84285e
add the holland 802.11a set of modes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2071
diff
changeset
|
152 |
void ConfigureHolland (void); |
5747
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
153 |
void Configure80211p_CCH (void); |
a171e73c4dae
add support for 802.11p PHY and MAC parameters
Michael Nowatkowski <nowatkom@gmail.com>
parents:
5192
diff
changeset
|
154 |
void Configure80211p_SCH (void); |
1889 | 155 |
double GetEdThresholdW (void) const; |
156 |
double DbmToW (double dbm) const; |
|
157 |
double DbToRatio (double db) const; |
|
2524
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
158 |
double WToDbm (double w) const; |
db72c0e7743e
port wifi model to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2166
diff
changeset
|
159 |
double RatioToDb (double ratio) const; |
1889 | 160 |
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
|
161 |
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
|
162 |
|
1889 | 163 |
private: |
3905
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
164 |
double m_edThresholdW; |
99c9346b5d71
split interference calculation from YansWifiPhy. Move them to InterferenceHelper
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3904
diff
changeset
|
165 |
double m_ccaMode1ThresholdW; |
2071
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
166 |
double m_txGainDb; |
122c95ffccdd
use dB instead of dbm where appropriate
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2057
diff
changeset
|
167 |
double m_rxGainDb; |
1889 | 168 |
double m_txPowerBaseDbm; |
169 |
double m_txPowerEndDbm; |
|
170 |
uint32_t m_nTxPower; |
|
171 |
||
3893
94f771c1373a
split WifiChannel in WifiChannel + YansWifiChannel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3888
diff
changeset
|
172 |
Ptr<YansWifiChannel> m_channel; |
5189 | 173 |
uint16_t m_channelNumber; |
3912
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
174 |
Ptr<Object> m_device; |
4d1a61f80745
new wifi API
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3906
diff
changeset
|
175 |
Ptr<Object> m_mobility; |
6372
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
176 |
|
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
177 |
/** |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
178 |
* 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
|
179 |
* 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
|
180 |
* 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
|
181 |
* 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
|
182 |
* 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
|
183 |
* 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
|
184 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
185 |
* 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
|
186 |
* 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
|
187 |
* WifiMode::IsMandatory() is true. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
188 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
189 |
* 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
|
190 |
* 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
|
191 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
192 |
* 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
|
193 |
* 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
|
194 |
* 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
|
195 |
* 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
|
196 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
197 |
* 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
|
198 |
* 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
|
199 |
* 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
|
200 |
* 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
|
201 |
* 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
|
202 |
* 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
|
203 |
* 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
|
204 |
* 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
|
205 |
* ERP-OFDM PHY. |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
206 |
* |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
207 |
* 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
|
208 |
* 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
|
209 |
* 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
|
210 |
* 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
|
211 |
* mandatory rates". |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
212 |
*/ |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
213 |
WifiModeList m_deviceRateSet; |
0fafd9716f44
Bug 853: Consider mandatory rates for Wi-Fi control responses
Dean Armstrong <deanarm@gmail.com>
parents:
6273
diff
changeset
|
214 |
|
5820
1c02054740eb
Renaming WifiPhy state SYNC to RX to avoid confusion with "synchronizing".
Timo Bingmann <tbns@idlebox.net>
parents:
5747
diff
changeset
|
215 |
EventId m_endRxEvent; |
1889 | 216 |
UniformVariable m_random; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
7139
diff
changeset
|
217 |
/// 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
|
218 |
double m_channelStartingFrequency; |
3900
1687492ff059
re-enable tracing of wifi phy state.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3897
diff
changeset
|
219 |
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
|
220 |
InterferenceHelper m_interference; |
4690
86343f7d6bfd
Initial multichannel support in Yans Wifi PHY.
Pavel Boyko <boyko@iitp.ru>
parents:
4680
diff
changeset
|
221 |
Time m_channelSwitchDelay; |
4263
fec2f830d015
trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
3912
diff
changeset
|
222 |
|
1889 | 223 |
}; |
224 |
||
1977
4303409f3d8e
remove uneeded trailing ';'
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1964
diff
changeset
|
225 |
} // namespace ns3 |
1889 | 226 |
|
227 |
||
3888
a15618dcd0eb
rename WifiPhy to YansWifiPhy and add WifiPhy abstract base class.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3887
diff
changeset
|
228 |
#endif /* YANS_WIFI_PHY_H */ |