A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #ifndef RRAA_WIFI_MANAGER_H
21 #define RRAA_WIFI_MANAGER_H
22 
23 #include "ns3/nstime.h"
25 
26 namespace ns3 {
27 
28 struct RraaWifiRemoteStation;
29 
40 {
41 public:
42  static TypeId GetTypeId (void);
43 
44  RraaWifiManager ();
45  virtual ~RraaWifiManager ();
46 
47 private:
49  {
50  uint32_t datarate;
51  double pori;
52  double pmtl;
53  uint32_t ewnd;
54  };
55 
56  // overriden from base class
57  virtual WifiRemoteStation * DoCreateStation (void) const;
58  virtual void DoReportRxOk (WifiRemoteStation *station,
59  double rxSnr, WifiMode txMode);
60  virtual void DoReportRtsFailed (WifiRemoteStation *station);
61  virtual void DoReportDataFailed (WifiRemoteStation *station);
62  virtual void DoReportRtsOk (WifiRemoteStation *station,
63  double ctsSnr, WifiMode ctsMode, double rtsSnr);
64  virtual void DoReportDataOk (WifiRemoteStation *station,
65  double ackSnr, WifiMode ackMode, double dataSnr);
66  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
67  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
68  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint32_t size);
70  virtual bool DoNeedRts (WifiRemoteStation *st,
71  Ptr<const Packet> packet, bool normally);
72  virtual bool IsLowLatency (void) const;
73 
81  uint32_t GetMaxRate (RraaWifiRemoteStation *station);
89  uint32_t GetMinRate (RraaWifiRemoteStation *station);
95  void CheckTimeout (RraaWifiRemoteStation *station);
108  void ARts (RraaWifiRemoteStation *station);
121  struct ThresholdsItem GetThresholds (WifiMode mode) const;
129  struct ThresholdsItem GetThresholds (RraaWifiRemoteStation *station, uint32_t rate) const;
130 
131  bool m_basic;
133  uint32_t m_ewndfor54;
134  uint32_t m_ewndfor48;
135  uint32_t m_ewndfor36;
136  uint32_t m_ewndfor24;
137  uint32_t m_ewndfor18;
138  uint32_t m_ewndfor12;
139  uint32_t m_ewndfor9;
140  uint32_t m_ewndfor6;
141  double m_porifor48;
142  double m_porifor36;
143  double m_porifor24;
144  double m_porifor18;
145  double m_porifor12;
146  double m_porifor9;
147  double m_porifor6;
148  double m_pmtlfor54;
149  double m_pmtlfor48;
150  double m_pmtlfor36;
151  double m_pmtlfor24;
152  double m_pmtlfor18;
153  double m_pmtlfor12;
154  double m_pmtlfor9;
155 };
156 
157 } // namespace ns3
158 
159 #endif /* RRAA_WIFI_MANAGER_H */
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:79
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId(void)
virtual 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.
struct ThresholdsItem GetThresholds(WifiMode mode) const
Get a threshold for the given mode.
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
Find an appropriate rate for the given station, using a basic algorithm.
virtual bool DoNeedRts(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
virtual bool IsLowLatency(void) const
virtual 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:91
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual WifiRemoteStation * DoCreateStation(void) const
void CheckTimeout(RraaWifiRemoteStation *station)
Check if the counter should be resetted.
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold a list of per-remote-station state.
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
void ARts(RraaWifiRemoteStation *station)
Activate the use of RTS for the given station if the conditions are met.
virtual 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.
hold per-remote-station state for RRAA Wifi manager.
uint32_t GetMinRate(RraaWifiRemoteStation *station)
Return the index for the minimum transmission rate for the given station.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual 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:49
hold per-remote-station state.