A Discrete-Event Network Simulator
API
ideal-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) 2006 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #ifndef IDEAL_WIFI_MANAGER_H
22 #define IDEAL_WIFI_MANAGER_H
23 
24 #include <stdint.h>
25 #include <vector>
26 #include "ns3/traced-value.h"
27 #include "wifi-mode.h"
29 
30 namespace ns3 {
31 
48 {
49 public:
50  static TypeId GetTypeId (void);
52  virtual ~IdealWifiManager ();
53 
54  virtual void SetupPhy (Ptr<WifiPhy> phy);
55 
56 
57 private:
58  //overriden from base class
59  virtual void DoInitialize (void);
60  virtual WifiRemoteStation* DoCreateStation (void) const;
61  virtual void DoReportRxOk (WifiRemoteStation *station,
62  double rxSnr, WifiMode txMode);
63  virtual void DoReportRtsFailed (WifiRemoteStation *station);
64  virtual void DoReportDataFailed (WifiRemoteStation *station);
65  virtual void DoReportRtsOk (WifiRemoteStation *station,
66  double ctsSnr, WifiMode ctsMode, double rtsSnr);
67  virtual void DoReportDataOk (WifiRemoteStation *station,
68  double ackSnr, WifiMode ackMode, double dataSnr);
69  virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr);
70  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
71  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
74  virtual bool IsLowLatency (void) const;
75 
84  double GetSnrThreshold (WifiTxVector txVector) const;
92  void AddSnrThreshold (WifiTxVector txVector, double snr);
93 
99  uint32_t GetChannelWidthForMode (WifiMode mode) const;
100 
105  typedef std::vector<std::pair<double, WifiTxVector> > Thresholds;
106 
107  double m_ber;
108  Thresholds m_thresholds;
109 
111 };
112 
113 } //namespace ns3
114 
115 #endif /* IDEAL_WIFI_MANAGER_H */
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual bool IsLowLatency(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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...
std::vector< std::pair< double, WifiTxVector > > Thresholds
A vector of pair holding the minimum SNR for the WifiTxVector.
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.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
virtual void DoInitialize(void)
Initialize() implementation.
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
double GetSnrThreshold(WifiTxVector txVector) const
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
static TypeId GetTypeId(void)
tuple phy
Definition: third.py:86
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
hold a list of per-remote-station state.
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
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
uint32_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
Ideal rate control algorithmThis class implements an 'ideal' rate control algorithm similar to RBAR i...
virtual void DoReportDataFailed(WifiRemoteStation *station)
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:58
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state.
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.