A Discrete-Event Network Simulator
API
parf-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 PARF_WIFI_MANAGER_H
22 #define PARF_WIFI_MANAGER_H
23 
25 
26 namespace ns3 {
27 
28 struct ParfWifiRemoteStation;
41 {
42 public:
47  static TypeId GetTypeId (void);
48  ParfWifiManager ();
49  virtual ~ParfWifiManager ();
50 
51  virtual void SetupPhy (Ptr<WifiPhy> phy);
52 
59  typedef void (*PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress);
60 
67  typedef void (*RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress);
68 
69 private:
70  // overriden from base class
71  virtual WifiRemoteStation * DoCreateStation (void) const;
72  virtual void DoReportRxOk (WifiRemoteStation *station,
73  double rxSnr, WifiMode txMode);
74  virtual void DoReportRtsFailed (WifiRemoteStation *station);
75  virtual void DoReportDataFailed (WifiRemoteStation *station);
76  virtual void DoReportRtsOk (WifiRemoteStation *station,
77  double ctsSnr, WifiMode ctsMode, double rtsSnr);
78  virtual void DoReportDataOk (WifiRemoteStation *station,
79  double ackSnr, WifiMode ackMode, double dataSnr);
80  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station);
81  virtual void DoReportFinalDataFailed (WifiRemoteStation *station);
82  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station, uint32_t size);
84  virtual bool IsLowLatency (void) const;
85 
90  void CheckInit (ParfWifiRemoteStation *station);
91 
92 
93  uint32_t m_attemptThreshold;
94  uint32_t m_successThreshold;
95 
100  uint32_t m_nPower;
101 
110 
111 };
112 
113 } // namespace ns3
114 
115 #endif /* PARF_WIFI_MANAGER_H */
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
Hold per-remote-station state for PARF Wifi manager.
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...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Forward calls to a chain of Callback.
void CheckInit(ParfWifiRemoteStation *station)
Check for initializations.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:93
virtual void DoReportDataFailed(WifiRemoteStation *station)
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 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 void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t m_successThreshold
The minimum number of successful transmissions to try a new power or rate.
virtual WifiRemoteStation * DoCreateStation(void) const
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold a list of per-remote-station state.
void(* PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress)
TracedCallback signature for power change events.
TracedCallback< uint8_t, Mac48Address > m_powerChange
The trace source fired when the transmission power changes....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PARF Rate control algorithm.
an EUI-48 address
Definition: mac48-address.h:43
TracedCallback< uint32_t, Mac48Address > m_rateChange
The trace source fired when the transmission rate changes.
static TypeId GetTypeId(void)
Register this type.
uint32_t m_nPower
Number of power levels.
virtual bool IsLowLatency(void) const
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
virtual void DoReportFinalRtsFailed(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:51
hold per-remote-station state.
uint32_t m_attemptThreshold
The minimum number of transmission attempts to try a new power or rate.
void(* RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress)
TracedCallback signature for rate change events.