A Discrete-Event Network Simulator
API
ideal-wifi-manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #ifndef IDEAL_WIFI_MANAGER_H
21 #define IDEAL_WIFI_MANAGER_H
22 
23 #include "ns3/traced-value.h"
24 #include "ns3/wifi-remote-station-manager.h"
25 
26 namespace ns3
27 {
28 
29 struct IdealWifiRemoteStation;
30 
47 {
48  public:
53  static TypeId GetTypeId();
55  ~IdealWifiManager() override;
56 
57  void SetupPhy(const Ptr<WifiPhy> phy) override;
58 
59  private:
60  void DoInitialize() override;
61  WifiRemoteStation* DoCreateStation() const override;
62  void DoReportRxOk(WifiRemoteStation* station, double rxSnr, WifiMode txMode) override;
63  void DoReportRtsFailed(WifiRemoteStation* station) override;
64  void DoReportDataFailed(WifiRemoteStation* station) override;
65  void DoReportRtsOk(WifiRemoteStation* station,
66  double ctsSnr,
67  WifiMode ctsMode,
68  double rtsSnr) override;
69  void DoReportDataOk(WifiRemoteStation* station,
70  double ackSnr,
71  WifiMode ackMode,
72  double dataSnr,
73  uint16_t dataChannelWidth,
74  uint8_t dataNss) override;
76  uint16_t nSuccessfulMpdus,
77  uint16_t nFailedMpdus,
78  double rxSnr,
79  double dataSnr,
80  uint16_t dataChannelWidth,
81  uint8_t dataNss) override;
82  void DoReportFinalRtsFailed(WifiRemoteStation* station) override;
83  void DoReportFinalDataFailed(WifiRemoteStation* station) override;
84  WifiTxVector DoGetDataTxVector(WifiRemoteStation* station, uint16_t allowedWidth) override;
86 
92  void Reset(WifiRemoteStation* station) const;
93 
99  void BuildSnrThresholds();
100 
109  double GetSnrThreshold(WifiTxVector txVector);
117  void AddSnrThreshold(WifiTxVector txVector, double snr);
118 
124  uint16_t GetChannelWidthForNonHtMode(WifiMode mode) const;
125 
138  uint16_t channelWidth,
139  uint8_t nss) const;
140 
148 
157 
162  typedef std::vector<std::pair<double, WifiTxVector>> Thresholds;
163 
164  double m_ber;
166 
168 };
169 
170 } // namespace ns3
171 
172 #endif /* IDEAL_WIFI_MANAGER_H */
Ideal rate control algorithm.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.
void BuildSnrThresholds()
Construct the vector of minimum SNRs needed to successfully transmit for all possible combinations (r...
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint16_t allowedWidth) override
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
void DoInitialize() override
Initialize() implementation.
uint16_t GetChannelWidthForNonHtMode(WifiMode mode) const
Convenience function for selecting a channel width for non-HT mode.
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
WifiRemoteStation * DoCreateStation() const override
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId()
Get the type ID.
bool IsModulationClassSupported(WifiModulationClass mc, IdealWifiRemoteStation *station)
Check whether a given modulation class is supported by both the node and the peer.
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.
bool IsCandidateModulationClass(WifiModulationClass mc, IdealWifiRemoteStation *station)
Check whether a given modulation class is supported and that there are no higher modulation classes t...
void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
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...
TracedValue< uint64_t > m_currentRate
Trace rate changes.
double GetLastObservedSnr(IdealWifiRemoteStation *station, uint16_t channelWidth, uint8_t nss) const
Convenience function to get the last observed SNR from a given station for a given channel width and ...
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.
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
std::vector< std::pair< double, WifiTxVector > > Thresholds
A vector of <snr, WifiTxVector> pair holding the minimum SNR for the WifiTxVector.
double GetSnrThreshold(WifiTxVector txVector)
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportFinalDataFailed(WifiRemoteStation *station) override
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:59
represent a single transmission mode
Definition: wifi-mode.h:51
hold a list of per-remote-station state.
void Reset()
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
phy
Definition: third.py:89
hold per-remote-station state for Ideal Wifi manager.
hold per-remote-station state.