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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Matias Richart <mrichart@fing.edu.uy>
7 */
8
9#ifndef APARF_WIFI_MANAGER_H
10#define APARF_WIFI_MANAGER_H
11
12#include "ns3/wifi-remote-station-manager.h"
13
14namespace ns3
15{
16
17struct AparfWifiRemoteStation;
18
19/**
20 * @ingroup wifi
21 * APARF Power and rate control algorithm
22 *
23 * This class implements the High Performance power and rate control algorithm
24 * described in <i>Dynamic data rate and transmit power adjustment
25 * in IEEE 802.11 wireless LANs</i> by Chevillat, P.; Jelitto, J.
26 * and Truong, H. L. in International Journal of Wireless Information
27 * Networks, Springer, 2005, 12, 123-145.
28 * https://web.archive.org/web/20170810111231/http://www.cs.mun.ca/~yzchen/papers/papers/rate_adaptation/80211_dynamic_rate_power_adjustment_chevillat_j2005.pdf
29 *
30 * This RAA does not support HT modes and will error
31 * exit if the user tries to configure this RAA with a Wi-Fi MAC
32 * that supports 802.11n or higher.
33 */
35{
36 public:
37 /**
38 * Register this type.
39 * @return The object TypeId.
40 */
41 static TypeId GetTypeId();
43 ~AparfWifiManager() override;
44
45 void SetupPhy(const Ptr<WifiPhy> phy) override;
46
47 /**
48 * Enumeration of the possible states of the channel.
49 */
50 enum State
51 {
54 Spread
55 };
56
57 private:
58 void DoInitialize() override;
59 WifiRemoteStation* DoCreateStation() const override;
60 void DoReportRxOk(WifiRemoteStation* station, double rxSnr, WifiMode txMode) override;
64 double ctsSnr,
66 double rtsSnr) override;
68 double ackSnr,
70 double dataSnr,
72 uint8_t dataNss) override;
77
78 /** Check for initializations.
79 *
80 * @param station The remote station.
81 */
83
84 uint32_t m_successMax1; //!< The minimum number of successful transmissions in \"High\" state to
85 //!< try a new power or rate.
86 uint32_t m_successMax2; //!< The minimum number of successful transmissions in \"Low\" state to
87 //!< try a new power or rate.
88 uint32_t m_failMax; //!< The minimum number of failed transmissions to try a new power or rate.
89 uint32_t m_powerMax; //!< The maximum number of power changes.
90 uint8_t m_powerInc; //!< Step size for increment the power.
91 uint8_t m_powerDec; //!< Step size for decrement the power.
92 uint8_t m_rateInc; //!< Step size for increment the rate.
93 uint8_t m_rateDec; //!< Step size for decrement the rate.
94
95 /**
96 * Minimal power level.
97 * Differently form rate, power levels do not depend on the remote station.
98 * The levels depend only on the physical layer of the device.
99 */
100 uint8_t m_minPower;
101
102 /**
103 * Maximal power level.
104 */
105 uint8_t m_maxPower;
106
107 /**
108 * The trace source fired when the transmission power changes.
109 */
111 /**
112 * The trace source fired when the transmission rate changes.
113 */
115};
116
117} // namespace ns3
118
119#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 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.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth) override
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.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
TracedCallback< double, double, Mac48Address > m_powerChange
The trace source fired when the transmission power changes.
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:66
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:49
represent a single transmission mode
Definition wifi-mode.h:40
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...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double MHz_u
MHz weak type.
Definition wifi-units.h:31
Hold per-remote-station state for APARF Wifi manager.
hold per-remote-station state.