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"
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  // Inherited from WifiRemoteStationManager
71  virtual void SetupPhy (const Ptr<WifiPhy> phy);
72  virtual void SetupMac (const Ptr<WifiMac> mac);
73  void SetHtSupported (bool enable);
74  void SetVhtSupported (bool enable);
75  void SetHeSupported (bool enable);
76 
77 
78 private:
79  //overriden from base class
80  WifiRemoteStation * DoCreateStation (void) const;
81  void DoReportRxOk (WifiRemoteStation *station,
82  double rxSnr, WifiMode txMode);
83  void DoReportRtsFailed (WifiRemoteStation *station);
84  void DoReportDataFailed (WifiRemoteStation *station);
85  void DoReportRtsOk (WifiRemoteStation *station,
86  double ctsSnr, WifiMode ctsMode, double rtsSnr);
87  void DoReportDataOk (WifiRemoteStation *station,
88  double ackSnr, WifiMode ackMode, double dataSnr);
93  bool DoNeedRts (WifiRemoteStation *st,
94  Ptr<const Packet> packet, bool normally);
95  bool IsLowLatency (void) const;
96 
101  void CheckInit (RraaWifiRemoteStation *station);
110  uint32_t GetMaxRate (RraaWifiRemoteStation *station);
119  uint32_t GetMinRate (RraaWifiRemoteStation *station);
125  void CheckTimeout (RraaWifiRemoteStation *station);
138  void ARts (RraaWifiRemoteStation *station);
150  void InitThresholds (RraaWifiRemoteStation *station);
168  WifiRraaThresholds GetThresholds (RraaWifiRemoteStation *station, uint32_t rate) const;
176  Time GetCalcTxTime (WifiMode mode) const;
183  void AddCalcTxTime (WifiMode mode, Time t);
189  typedef std::vector<std::pair<Time,WifiMode> > TxTime;
190 
191  TxTime m_calcTxTime;
194 
195  uint32_t m_frameLength;
196  uint32_t m_ackLength;
197 
198  bool m_basic;
200  double m_alpha;
201  double m_beta;
202  double m_tau;
203 
205 };
206 
207 } //namespace ns3
208 
209 #endif /* RRAA_WIFI_MANAGER_H */
std::vector< std::pair< Time, WifiMode > > TxTime
typedef for a vector of a pair of Time, WifiMode.
virtual void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
uint32_t GetMaxRate(RraaWifiRemoteStation *station)
Return the index for the maximum transmission rate for the given station.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
double m_tau
Tau value for RRAA (value for calculating EWND size).
static TypeId GetTypeId(void)
Get the type ID.
void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)
This method is a pure virtual method that must be implemented by the sub-class.
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
Find an appropriate rate for the given station, using a basic algorithm.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint32_t m_ewnd
Evaluation Window.
bool DoNeedRts(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
bool IsLowLatency(void) const
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void ResetCountersBasic(RraaWifiRemoteStation *station)
Reset the counters of the given station.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
WifiRemoteStation * DoCreateStation(void) const
void CheckInit(RraaWifiRemoteStation *station)
Check for initializations.
tuple phy
Definition: third.py:86
uint32_t m_frameLength
Data frame length used for calculate mode TxTime.
void CheckTimeout(RraaWifiRemoteStation *station)
Check if the counter should be resetted.
double m_beta
Beta value for RRAA (value for calculating ORI threshold).
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
void SetHtSupported(bool enable)
Enable or disable HT capability support.
std::vector< std::pair< WifiRraaThresholds, WifiMode > > RraaThresholdsTable
List of thresholds for each mode.
tuple mac
Definition: third.py:92
hold a list of per-remote-station state.
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
Time GetCalcTxTime(WifiMode mode) const
Get the estimated TxTime of a packet with a given mode.
double m_alpha
Alpha value for RRAA (value for calculating MTL threshold)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TxTime m_calcTxTime
To hold all the calculated TxTime for all modes.
uint32_t m_ackLength
Ack frame length used for calculate mode TxTime.
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
double m_ori
Opportunistic Rate Increase threshold.
void ARts(RraaWifiRemoteStation *station)
Activate the use of RTS for the given station if the conditions are met.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
This method is a pure virtual method that must be implemented by the sub-class.
Time m_sifs
Value of SIFS configured in the device.
Time m_difs
Value of DIFS configured in the device.
WifiRraaThresholds structure.
void AddCalcTxTime(WifiMode mode, Time t)
Add transmission time for the given mode to an internal list.
void InitThresholds(RraaWifiRemoteStation *station)
Initialize the thresholds internal list for the given station.
void SetHeSupported(bool enable)
Enable or disable HE capability support.
hold per-remote-station state for RRAA Wifi manager.
WifiRraaThresholds GetThresholds(RraaWifiRemoteStation *station, WifiMode mode) const
Get the thresholds for the given station and mode.
uint32_t GetMinRate(RraaWifiRemoteStation *station)
Return the index for the minimum transmission rate for the given station.
double m_mtl
Maximum Tolerable Loss threshold.
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
a unique identifier for an interface.
Definition: type-id.h:58
hold per-remote-station state.
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...