A Discrete-Event Network Simulator
API
aparf-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) 2014 Universidad de la República - Uruguay
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: Matias Richart <mrichart@fing.edu.uy>
19  */
20 #ifndef APARF_WIFI_MANAGER_H
21 #define APARF_WIFI_MANAGER_H
22 
24 
25 namespace ns3 {
26 
27 struct AparfWifiRemoteStation;
28 
42 {
43 public:
48  static TypeId GetTypeId (void);
50  virtual ~AparfWifiManager ();
51 
52  virtual void SetupPhy (Ptr<WifiPhy> phy);
53 
57  enum State
58  {
60  Low,
62  };
63 
70  typedef void (*PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress);
71 
78  typedef void (*RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress);
79 
80 private:
81  // overriden from base class
82  virtual WifiRemoteStation * DoCreateStation (void) const;
83  virtual void DoReportRxOk (WifiRemoteStation *station,
84  double rxSnr, WifiMode txMode);
85  virtual void DoReportRtsFailed (WifiRemoteStation *station);
86  virtual void DoReportDataFailed (WifiRemoteStation *station);
87  virtual void DoReportRtsOk (WifiRemoteStation *station,
88  double ctsSnr, WifiMode ctsMode, double rtsSnr);
89  virtual void DoReportDataOk (WifiRemoteStation *station,
90  double ackSnr, WifiMode ackMode, double dataSnr);
91  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
92  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
93  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint32_t size);
95  virtual bool IsLowLatency (void) const;
96 
101  void CheckInit (AparfWifiRemoteStation *station);
102 
103  uint32_t m_succesMax1;
104  uint32_t m_succesMax2;
105  uint32_t m_failMax;
106  uint32_t m_powerMax;
107  uint32_t m_powerInc;
108  uint32_t m_powerDec;
109  uint32_t m_rateInc;
110  uint32_t m_rateDec;
111 
116  uint32_t m_nPower;
117 
126 
127 };
128 
129 } // namespace ns3
130 
131 #endif /* APARF_WIFI_MANAGER_H */
uint32_t m_succesMax2
The minimum number of successful transmissions in "Low" state to try a new power or rate...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
APARF Power and rate control algorithm.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_rateInc
Step size for increment the rate.
static TypeId GetTypeId(void)
Register this type.
Forward calls to a chain of Callback.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:93
uint32_t m_powerDec
Step size for decrement the power.
uint32_t m_rateDec
Step size for decrement the rate.
uint32_t m_powerInc
Step size for increment the power.
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.
TracedCallback< uint32_t, Mac48Address > m_rateChange
The trace source fired when the transmission rate change.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
void CheckInit(AparfWifiRemoteStation *station)
Check for initializations.
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.
virtual WifiRemoteStation * DoCreateStation(void) const
hold a list of per-remote-station state.
virtual bool IsLowLatency(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
Hold per-remote-station state for APARF Wifi manager.
uint32_t m_failMax
The minimum number of failed transmissions to try a new power or rate.
an EUI-48 address
Definition: mac48-address.h:43
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
State
Enumeration of the possible states of the channel.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
void(* RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress)
TracedCallback signature for rate change events.
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_nPower
Number of power levels.
uint32_t m_succesMax1
The minimum number of successful transmissions in "High" state to try a new power or rate...
uint32_t m_powerMax
The maximum number of power changes.
TracedCallback< uint8_t, Mac48Address > m_powerChange
The trace source fired when the transmission power change.
void(* PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress)
TracedCallback signature for power change events.
a unique identifier for an interface.
Definition: type-id.h:57
hold per-remote-station state.