A Discrete-Event Network Simulator
API
rraa-wifi-manager.h
Go to the documentation of this file.
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
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Federico Maguolo <maguolof@dei.unipd.it>
19  */
20 
21 #ifndef RRAA_WIFI_MANAGER_H
22 #define RRAA_WIFI_MANAGER_H
23 
24 #include "ns3/nstime.h"
25 #include "ns3/traced-value.h"
26 #include "ns3/wifi-remote-station-manager.h"
27 
28 namespace ns3 {
29 
30 struct RraaWifiRemoteStation;
31 
34  {
35  double m_ori;
36  double m_mtl;
37  uint32_t m_ewnd;
38  };
39 
43 typedef std::vector<std::pair<WifiRraaThresholds, WifiMode> > RraaThresholdsTable;
44 
59 {
60 public:
65  static TypeId GetTypeId (void);
66 
67  RraaWifiManager ();
68  virtual ~RraaWifiManager ();
69 
70  void SetupPhy (const Ptr<WifiPhy> phy) override;
71  void SetupMac (const Ptr<WifiMac> mac) override;
72 
73 
74 private:
75  void DoInitialize (void) override;
76  WifiRemoteStation * DoCreateStation (void) const override;
77  void DoReportRxOk (WifiRemoteStation *station,
78  double rxSnr, WifiMode txMode) override;
79  void DoReportRtsFailed (WifiRemoteStation *station) override;
80  void DoReportDataFailed (WifiRemoteStation *station) override;
81  void DoReportRtsOk (WifiRemoteStation *station,
82  double ctsSnr, WifiMode ctsMode, double rtsSnr) override;
83  void DoReportDataOk (WifiRemoteStation *station, double ackSnr, WifiMode ackMode,
84  double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override;
85  void DoReportFinalRtsFailed (WifiRemoteStation *station) override;
86  void DoReportFinalDataFailed (WifiRemoteStation *station) override;
89  bool DoNeedRts (WifiRemoteStation *st,
90  uint32_t size, bool normally) override;
91 
96  void CheckInit (RraaWifiRemoteStation *station);
105  uint8_t GetMaxRate (RraaWifiRemoteStation *station) const;
111  void CheckTimeout (RraaWifiRemoteStation *station);
124  void ARts (RraaWifiRemoteStation *station);
136  void InitThresholds (RraaWifiRemoteStation *station);
154  WifiRraaThresholds GetThresholds (RraaWifiRemoteStation *station, uint8_t index) const;
162  Time GetCalcTxTime (WifiMode mode) const;
169  void AddCalcTxTime (WifiMode mode, Time t);
175  typedef std::vector<std::pair<Time,WifiMode> > TxTime;
176 
180 
181  uint32_t m_frameLength;
182  uint32_t m_ackLength;
183 
184  bool m_basic;
186  double m_alpha;
187  double m_beta;
188  double m_tau;
189 
191 };
192 
193 } //namespace ns3
194 
195 #endif /* RRAA_WIFI_MANAGER_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::RraaWifiManager::m_difs
Time m_difs
Value of DIFS configured in the device.
Definition: rraa-wifi-manager.h:179
ns3::RraaWifiManager::DoReportFinalDataFailed
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:342
ns3::RraaWifiManager::ARts
void ARts(RraaWifiRemoteStation *station)
Activate the use of RTS for the given station if the conditions are met.
Definition: rraa-wifi-manager.cc:439
ns3::WifiRraaThresholds::m_mtl
double m_mtl
Maximum Tolerable Loss threshold.
Definition: rraa-wifi-manager.h:36
ns3::WifiRraaThresholds::m_ewnd
uint32_t m_ewnd
Evaluation Window.
Definition: rraa-wifi-manager.h:37
ns3::RraaWifiManager::DoInitialize
void DoInitialize(void) override
Initialize() implementation.
Definition: rraa-wifi-manager.cc:148
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RraaThresholdsTable
std::vector< std::pair< WifiRraaThresholds, WifiMode > > RraaThresholdsTable
List of thresholds for each mode.
Definition: rraa-wifi-manager.h:43
ns3::RraaWifiManager
Robust Rate Adaptation Algorithm.
Definition: rraa-wifi-manager.h:59
ns3::RraaWifiManager::GetMaxRate
uint8_t GetMaxRate(RraaWifiRemoteStation *station) const
Return the index for the maximum transmission rate for the given station.
Definition: rraa-wifi-manager.cc:286
ns3::RraaWifiManager::DoGetRtsTxVector
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
Definition: rraa-wifi-manager.cc:369
ns3::RraaWifiManager::GetThresholds
WifiRraaThresholds GetThresholds(RraaWifiRemoteStation *station, WifiMode mode) const
Get the thresholds for the given station and mode.
Definition: rraa-wifi-manager.cc:188
ns3::RraaWifiManager::DoReportDataFailed
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:298
ns3::WifiRemoteStationManager
hold a list of per-remote-station state.
Definition: wifi-remote-station-manager.h:121
ns3::RraaWifiManager::TxTime
std::vector< std::pair< Time, WifiMode > > TxTime
typedef for a vector of a pair of Time, WifiMode.
Definition: rraa-wifi-manager.h:175
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
third.mac
mac
Definition: third.py:99
ns3::RraaWifiManager::CheckInit
void CheckInit(RraaWifiRemoteStation *station)
Check for initializations.
Definition: rraa-wifi-manager.cc:216
ns3::RraaWifiManager::m_frameLength
uint32_t m_frameLength
Data frame length used for calculate mode TxTime.
Definition: rraa-wifi-manager.h:181
ns3::RraaWifiManager::SetupPhy
void SetupPhy(const Ptr< WifiPhy > phy) override
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
Definition: rraa-wifi-manager.cc:121
ns3::RraaWifiManager::SetupMac
void SetupMac(const Ptr< WifiMac > mac) override
Set up MAC associated with this device since it is the object that knows the full set of timing param...
Definition: rraa-wifi-manager.cc:141
ns3::RraaWifiManager::m_sifs
Time m_sifs
Value of SIFS configured in the device.
Definition: rraa-wifi-manager.h:178
ns3::Ptr< WifiPhy >
ns3::RraaWifiManager::m_calcTxTime
TxTime m_calcTxTime
To hold all the calculated TxTime for all modes.
Definition: rraa-wifi-manager.h:177
ns3::WifiRraaThresholds
WifiRraaThresholds structure.
Definition: rraa-wifi-manager.h:34
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::RraaWifiManager::DoGetDataTxVector
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
Definition: rraa-wifi-manager.cc:348
ns3::RraaWifiManager::RunBasicAlgorithm
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
Find an appropriate rate for the given station, using a basic algorithm.
Definition: rraa-wifi-manager.cc:417
ns3::RraaWifiManager::m_alpha
double m_alpha
Alpha value for RRAA (value for calculating MTL threshold)
Definition: rraa-wifi-manager.h:186
ns3::RraaWifiManager::DoReportDataOk
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:324
ns3::RraaWifiManager::m_ackLength
uint32_t m_ackLength
Ack frame length used for calculate mode TxTime.
Definition: rraa-wifi-manager.h:182
ns3::WifiRraaThresholds::m_ori
double m_ori
Opportunistic Rate Increase threshold.
Definition: rraa-wifi-manager.h:35
ns3::RraaWifiManager::~RraaWifiManager
virtual ~RraaWifiManager()
Definition: rraa-wifi-manager.cc:115
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::RraaWifiManager::m_timeout
Time m_timeout
timeout
Definition: rraa-wifi-manager.h:185
ns3::RraaWifiManager::DoReportRtsFailed
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:292
ns3::RraaWifiManager::DoNeedRts
bool DoNeedRts(WifiRemoteStation *st, uint32_t size, bool normally) override
Definition: rraa-wifi-manager.cc:391
ns3::RraaWifiManager::GetCalcTxTime
Time GetCalcTxTime(WifiMode mode) const
Get the estimated TxTime of a packet with a given mode.
Definition: rraa-wifi-manager.cc:166
ns3::RraaWifiManager::m_basic
bool m_basic
basic
Definition: rraa-wifi-manager.h:184
ns3::RraaWifiManager::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: rraa-wifi-manager.cc:59
ns3::RraaWifiManager::RraaWifiManager
RraaWifiManager()
Definition: rraa-wifi-manager.cc:108
ns3::WifiRemoteStation
hold per-remote-station state.
Definition: wifi-remote-station-manager.h:62
ns3::RraaWifiRemoteStation
hold per-remote-station state for RRAA Wifi manager.
Definition: rraa-wifi-manager.cc:41
ns3::RraaWifiManager::m_tau
double m_tau
Tau value for RRAA (value for calculating EWND size).
Definition: rraa-wifi-manager.h:188
ns3::RraaWifiManager::m_currentRate
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Definition: rraa-wifi-manager.h:190
ns3::RraaWifiManager::AddCalcTxTime
void AddCalcTxTime(WifiMode mode, Time t)
Add transmission time for the given mode to an internal list.
Definition: rraa-wifi-manager.cc:181
ns3::TracedValue< uint64_t >
ns3::RraaWifiManager::DoReportRxOk
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:310
ns3::RraaWifiManager::CheckTimeout
void CheckTimeout(RraaWifiRemoteStation *station)
Check if the counter should be reset.
Definition: rraa-wifi-manager.cc:406
ns3::RraaWifiManager::DoCreateStation
WifiRemoteStation * DoCreateStation(void) const override
Definition: rraa-wifi-manager.cc:204
ns3::RraaWifiManager::DoReportFinalRtsFailed
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:336
ns3::RraaWifiManager::m_beta
double m_beta
Beta value for RRAA (value for calculating ORI threshold).
Definition: rraa-wifi-manager.h:187
ns3::RraaWifiManager::InitThresholds
void InitThresholds(RraaWifiRemoteStation *station)
Initialize the thresholds internal list for the given station.
Definition: rraa-wifi-manager.cc:237
ns3::RraaWifiManager::ResetCountersBasic
void ResetCountersBasic(RraaWifiRemoteStation *station)
Reset the counters of the given station.
Definition: rraa-wifi-manager.cc:277
ns3::RraaWifiManager::DoReportRtsOk
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: rraa-wifi-manager.cc:317
third.phy
phy
Definition: third.py:93