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"
26 
27 namespace ns3 {
28 
29 struct RraaWifiRemoteStation;
30 
41 {
42 public:
43  static TypeId GetTypeId (void);
44 
45  RraaWifiManager ();
46  virtual ~RraaWifiManager ();
47 
48 
49 private:
51  {
52  uint32_t datarate;
53  double pori;
54  double pmtl;
55  uint32_t ewnd;
56  };
57 
58  //overriden from base class
59  virtual WifiRemoteStation * DoCreateStation (void) const;
60  virtual void DoReportRxOk (WifiRemoteStation *station,
61  double rxSnr, WifiMode txMode);
62  virtual void DoReportRtsFailed (WifiRemoteStation *station);
63  virtual void DoReportDataFailed (WifiRemoteStation *station);
64  virtual void DoReportRtsOk (WifiRemoteStation *station,
65  double ctsSnr, WifiMode ctsMode, double rtsSnr);
66  virtual void DoReportDataOk (WifiRemoteStation *station,
67  double ackSnr, WifiMode ackMode, double dataSnr);
68  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
69  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
72  virtual bool DoNeedRts (WifiRemoteStation *st,
73  Ptr<const Packet> packet, bool normally);
74  virtual bool IsLowLatency (void) const;
75 
84  uint32_t GetMaxRate (RraaWifiRemoteStation *station);
93  uint32_t GetMinRate (RraaWifiRemoteStation *station);
99  void CheckTimeout (RraaWifiRemoteStation *station);
112  void ARts (RraaWifiRemoteStation *station);
127  struct ThresholdsItem GetThresholds (WifiMode mode, RraaWifiRemoteStation *station) const;
136  struct ThresholdsItem GetThresholds (RraaWifiRemoteStation *station, uint32_t rate) const;
137 
138  bool m_basic;
140  uint32_t m_ewndfor54;
141  uint32_t m_ewndfor48;
142  uint32_t m_ewndfor36;
143  uint32_t m_ewndfor24;
144  uint32_t m_ewndfor18;
145  uint32_t m_ewndfor12;
146  uint32_t m_ewndfor9;
147  uint32_t m_ewndfor6;
148  double m_porifor48;
149  double m_porifor36;
150  double m_porifor24;
151  double m_porifor18;
152  double m_porifor12;
153  double m_porifor9;
154  double m_porifor6;
155  double m_pmtlfor54;
156  double m_pmtlfor48;
157  double m_pmtlfor36;
158  double m_pmtlfor24;
159  double m_pmtlfor18;
160  double m_pmtlfor12;
161  double m_pmtlfor9;
162 };
163 
164 } //namespace ns3
165 
166 #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:102
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.
void RunBasicAlgorithm(RraaWifiRemoteStation *station)
Find an appropriate rate for the given station, using a basic algorithm.
struct ThresholdsItem GetThresholds(WifiMode mode, RraaWifiRemoteStation *station) const
Get a threshold for the given mode.
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:99
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.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
hold a list of per-remote-station state.
Robust Rate Adaptation AlgorithmThis is an implementation of RRAA as described in "Robust rate adapta...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:58
hold per-remote-station state.