A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
aparf-wifi-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Universidad de la República - Uruguay
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Matias Richart <mrichart@fing.edu.uy>
18 */
19
20#ifndef APARF_WIFI_MANAGER_H
21#define APARF_WIFI_MANAGER_H
22
23#include "ns3/wifi-remote-station-manager.h"
24
25namespace ns3
26{
27
28struct AparfWifiRemoteStation;
29
30/**
31 * \ingroup wifi
32 * APARF Power and rate control algorithm
33 *
34 * This class implements the High Performance power and rate control algorithm
35 * described in <i>Dynamic data rate and transmit power adjustment
36 * in IEEE 802.11 wireless LANs</i> by Chevillat, P.; Jelitto, J.
37 * and Truong, H. L. in International Journal of Wireless Information
38 * Networks, Springer, 2005, 12, 123-145.
39 * https://web.archive.org/web/20170810111231/http://www.cs.mun.ca/~yzchen/papers/papers/rate_adaptation/80211_dynamic_rate_power_adjustment_chevillat_j2005.pdf
40 *
41 * This RAA does not support HT modes and will error
42 * exit if the user tries to configure this RAA with a Wi-Fi MAC
43 * that supports 802.11n or higher.
44 */
46{
47 public:
48 /**
49 * Register this type.
50 * \return The object TypeId.
51 */
52 static TypeId GetTypeId();
54 ~AparfWifiManager() override;
55
56 void SetupPhy(const Ptr<WifiPhy> phy) override;
57
58 /**
59 * Enumeration of the possible states of the channel.
60 */
61 enum State
62 {
65 Spread
66 };
67
68 private:
69 void DoInitialize() override;
70 WifiRemoteStation* DoCreateStation() const override;
71 void DoReportRxOk(WifiRemoteStation* station, double rxSnr, WifiMode txMode) override;
72 void DoReportRtsFailed(WifiRemoteStation* station) override;
73 void DoReportDataFailed(WifiRemoteStation* station) override;
74 void DoReportRtsOk(WifiRemoteStation* station,
75 double ctsSnr,
76 WifiMode ctsMode,
77 double rtsSnr) override;
79 double ackSnr,
80 WifiMode ackMode,
81 double dataSnr,
82 uint16_t dataChannelWidth,
83 uint8_t dataNss) override;
84 void DoReportFinalRtsFailed(WifiRemoteStation* station) override;
85 void DoReportFinalDataFailed(WifiRemoteStation* station) override;
86 WifiTxVector DoGetDataTxVector(WifiRemoteStation* station, uint16_t allowedWidth) override;
88
89 /** Check for initializations.
90 *
91 * \param station The remote station.
92 */
93 void CheckInit(AparfWifiRemoteStation* station);
94
95 uint32_t m_successMax1; //!< The minimum number of successful transmissions in \"High\" state to
96 //!< try a new power or rate.
97 uint32_t m_successMax2; //!< The minimum number of successful transmissions in \"Low\" state to
98 //!< try a new power or rate.
99 uint32_t m_failMax; //!< The minimum number of failed transmissions to try a new power or rate.
100 uint32_t m_powerMax; //!< The maximum number of power changes.
101 uint8_t m_powerInc; //!< Step size for increment the power.
102 uint8_t m_powerDec; //!< Step size for decrement the power.
103 uint8_t m_rateInc; //!< Step size for increment the rate.
104 uint8_t m_rateDec; //!< Step size for decrement the rate.
105
106 /**
107 * Minimal power level.
108 * Differently form rate, power levels do not depend on the remote station.
109 * The levels depend only on the physical layer of the device.
110 */
111 uint8_t m_minPower;
112
113 /**
114 * Maximal power level.
115 */
116 uint8_t m_maxPower;
117
118 /**
119 * The trace source fired when the transmission power changes.
120 */
122 /**
123 * The trace source fired when the transmission rate changes.
124 */
126};
127
128} // namespace ns3
129
130#endif /* APARF_WIFI_MANAGER_H */
APARF Power and rate control algorithm.
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_failMax
The minimum number of failed transmissions to try a new power or rate.
uint8_t m_minPower
Minimal power level.
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.
void DoInitialize() override
Initialize() implementation.
WifiRemoteStation * DoCreateStation() const override
uint32_t m_successMax2
The minimum number of successful transmissions in "Low" state to try a new power or rate.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
uint8_t m_maxPower
Maximal power level.
uint32_t m_powerMax
The maximum number of power changes.
uint8_t m_powerDec
Step size for decrement the power.
State
Enumeration of the possible states of the channel.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
uint8_t m_rateDec
Step size for decrement the rate.
uint32_t m_successMax1
The minimum number of successful transmissions in "High" state to try a new power or rate.
uint8_t m_powerInc
Step size for increment the power.
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.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void CheckInit(AparfWifiRemoteStation *station)
Check for initializations.
TracedCallback< double, double, Mac48Address > m_powerChange
The trace source fired when the transmission power changes.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint16_t allowedWidth) override
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
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...
uint8_t m_rateInc
Step size for increment the rate.
TracedCallback< DataRate, DataRate, Mac48Address > m_rateChange
The trace source fired when the transmission rate changes.
static TypeId GetTypeId()
Register this type.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
represent a single transmission mode
Definition: wifi-mode.h:51
hold a list of per-remote-station state.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold per-remote-station state for APARF Wifi manager.
hold per-remote-station state.