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 
21 #ifndef APARF_WIFI_MANAGER_H
22 #define APARF_WIFI_MANAGER_H
23 
24 #include "ns3/wifi-remote-station-manager.h"
25 
26 namespace ns3 {
27 
28 struct AparfWifiRemoteStation;
29 
46 {
47 public:
52  static TypeId GetTypeId (void);
54  virtual ~AparfWifiManager ();
55 
56  void SetupPhy (const Ptr<WifiPhy> phy) override;
57 
61  enum State
62  {
64  Low,
65  Spread
66  };
67 
68 
69 private:
70  void DoInitialize (void) override;
71  WifiRemoteStation * DoCreateStation (void) const override;
72  void DoReportRxOk (WifiRemoteStation *station,
73  double rxSnr, WifiMode txMode) override;
74  void DoReportRtsFailed (WifiRemoteStation *station) override;
75  void DoReportDataFailed (WifiRemoteStation *station) override;
76  void DoReportRtsOk (WifiRemoteStation *station,
77  double ctsSnr, WifiMode ctsMode, double rtsSnr) override;
78  void DoReportDataOk (WifiRemoteStation *station, double ackSnr, WifiMode ackMode,
79  double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override;
80  void DoReportFinalRtsFailed (WifiRemoteStation *station) override;
81  void DoReportFinalDataFailed (WifiRemoteStation *station) override;
84 
89  void CheckInit (AparfWifiRemoteStation *station);
90 
91  uint32_t m_succesMax1;
92  uint32_t m_succesMax2;
93  uint32_t m_failMax;
94  uint32_t m_powerMax;
95  uint8_t m_powerInc;
96  uint8_t m_powerDec;
97  uint8_t m_rateInc;
98  uint8_t m_rateDec;
99 
105  uint8_t m_minPower;
106 
110  uint8_t m_maxPower;
111 
120 };
121 
122 } //namespace ns3
123 
124 #endif /* APARF_WIFI_MANAGER_H */
ns3::AparfWifiManager::DoGetDataTxVector
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
Definition: aparf-wifi-manager.cc:339
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::AparfWifiManager::DoReportDataFailed
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: aparf-wifi-manager.cc:201
ns3::AparfWifiManager::DoGetRtsTxVector
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
Definition: aparf-wifi-manager.cc:368
ns3::AparfWifiRemoteStation
Hold per-remote-station state for APARF Wifi manager.
Definition: aparf-wifi-manager.cc:41
ns3::AparfWifiManager::m_minPower
uint8_t m_minPower
Minimal power level.
Definition: aparf-wifi-manager.h:105
ns3::AparfWifiManager::Low
@ Low
Definition: aparf-wifi-manager.h:64
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::AparfWifiManager::Spread
@ Spread
Definition: aparf-wifi-manager.h:65
ns3::AparfWifiManager::High
@ High
Definition: aparf-wifi-manager.h:63
ns3::AparfWifiManager::m_rateChange
TracedCallback< DataRate, DataRate, Mac48Address > m_rateChange
The trace source fired when the transmission rate changes.
Definition: aparf-wifi-manager.h:119
ns3::WifiRemoteStationManager
hold a list of per-remote-station state.
Definition: wifi-remote-station-manager.h:121
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::AparfWifiManager::~AparfWifiManager
virtual ~AparfWifiManager()
Definition: aparf-wifi-manager.cc:123
ns3::AparfWifiManager::GetTypeId
static TypeId GetTypeId(void)
Register this type.
Definition: aparf-wifi-manager.cc:60
ns3::AparfWifiManager::m_succesMax2
uint32_t m_succesMax2
The minimum number of successful transmissions in "Low" state to try a new power or rate.
Definition: aparf-wifi-manager.h:92
ns3::AparfWifiManager::DoReportRtsFailed
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: aparf-wifi-manager.cc:196
ns3::AparfWifiManager::DoReportFinalDataFailed
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: aparf-wifi-manager.cc:333
ns3::AparfWifiManager::DoReportDataOk
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.
Definition: aparf-wifi-manager.cc:258
ns3::Ptr< WifiPhy >
ns3::AparfWifiManager::m_maxPower
uint8_t m_maxPower
Maximal power level.
Definition: aparf-wifi-manager.h:110
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::AparfWifiManager::m_powerMax
uint32_t m_powerMax
The maximum number of power changes.
Definition: aparf-wifi-manager.h:94
ns3::AparfWifiManager::DoCreateStation
WifiRemoteStation * DoCreateStation(void) const override
Definition: aparf-wifi-manager.cc:156
ns3::AparfWifiManager::State
State
Enumeration of the possible states of the channel.
Definition: aparf-wifi-manager.h:62
ns3::AparfWifiManager::m_rateDec
uint8_t m_rateDec
Step size for decrement the rate.
Definition: aparf-wifi-manager.h:98
ns3::AparfWifiManager::m_powerChange
TracedCallback< double, double, Mac48Address > m_powerChange
The trace source fired when the transmission power changes.
Definition: aparf-wifi-manager.h:115
ns3::WifiRemoteStation
hold per-remote-station state.
Definition: wifi-remote-station-manager.h:62
ns3::AparfWifiManager::m_succesMax1
uint32_t m_succesMax1
The minimum number of successful transmissions in "High" state to try a new power or rate.
Definition: aparf-wifi-manager.h:91
ns3::AparfWifiManager::DoReportFinalRtsFailed
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: aparf-wifi-manager.cc:327
ns3::AparfWifiManager::DoReportRtsOk
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.
Definition: aparf-wifi-manager.cc:251
ns3::AparfWifiManager::m_failMax
uint32_t m_failMax
The minimum number of failed transmissions to try a new power or rate.
Definition: aparf-wifi-manager.h:93
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition: traced-callback.h:53
ns3::AparfWifiManager::DoInitialize
void DoInitialize(void) override
Initialize() implementation.
Definition: aparf-wifi-manager.cc:138
ns3::AparfWifiManager::SetupPhy
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...
Definition: aparf-wifi-manager.cc:129
ns3::AparfWifiManager::m_powerInc
uint8_t m_powerInc
Step size for increment the power.
Definition: aparf-wifi-manager.h:95
ns3::AparfWifiManager::m_rateInc
uint8_t m_rateInc
Step size for increment the rate.
Definition: aparf-wifi-manager.h:97
ns3::AparfWifiManager::AparfWifiManager
AparfWifiManager()
Definition: aparf-wifi-manager.cc:118
ns3::AparfWifiManager::CheckInit
void CheckInit(AparfWifiRemoteStation *station)
Check for initializations.
Definition: aparf-wifi-manager.cc:176
third.phy
phy
Definition: third.py:93
ns3::AparfWifiManager::m_powerDec
uint8_t m_powerDec
Step size for decrement the power.
Definition: aparf-wifi-manager.h:96
ns3::AparfWifiManager
APARF Power and rate control algorithm.
Definition: aparf-wifi-manager.h:46
ns3::AparfWifiManager::DoReportRxOk
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: aparf-wifi-manager.cc:245