A Discrete-Event Network Simulator
API
constant-rate-wifi-manager.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2004,2005 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 #include "ns3/string.h"
22 #include "ns3/log.h"
24 #include "ns3/wifi-tx-vector.h"
25 #include "ns3/wifi-utils.h"
26 
27 #define Min(a,b) ((a < b) ? a : b)
28 
29 namespace ns3 {
30 
31 NS_LOG_COMPONENT_DEFINE ("ConstantRateWifiManager");
32 
33 NS_OBJECT_ENSURE_REGISTERED (ConstantRateWifiManager);
34 
35 TypeId
37 {
38  static TypeId tid = TypeId ("ns3::ConstantRateWifiManager")
40  .SetGroupName ("Wifi")
41  .AddConstructor<ConstantRateWifiManager> ()
42  .AddAttribute ("DataMode", "The transmission mode to use for every data packet transmission",
43  StringValue ("OfdmRate6Mbps"),
46  .AddAttribute ("ControlMode", "The transmission mode to use for every RTS packet transmission.",
47  StringValue ("OfdmRate6Mbps"),
50  ;
51  return tid;
52 }
53 
55 {
56  NS_LOG_FUNCTION (this);
57 }
58 
60 {
61  NS_LOG_FUNCTION (this);
62 }
63 
66 {
67  NS_LOG_FUNCTION (this);
68  WifiRemoteStation *station = new WifiRemoteStation ();
69  return station;
70 }
71 
72 void
74  double rxSnr, WifiMode txMode)
75 {
76  NS_LOG_FUNCTION (this << station << rxSnr << txMode);
77 }
78 
79 void
81 {
82  NS_LOG_FUNCTION (this << station);
83 }
84 
85 void
87 {
88  NS_LOG_FUNCTION (this << station);
89 }
90 
91 void
93  double ctsSnr, WifiMode ctsMode, double rtsSnr)
94 {
95  NS_LOG_FUNCTION (this << st << ctsSnr << ctsMode << rtsSnr);
96 }
97 
98 void
100  double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
101 {
102  NS_LOG_FUNCTION (this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
103 }
104 
105 void
107 {
108  NS_LOG_FUNCTION (this << station);
109 }
110 
111 void
113 {
114  NS_LOG_FUNCTION (this << station);
115 }
116 
119 {
120  NS_LOG_FUNCTION (this << st);
123  {
124  nss = 1 + (m_dataMode.GetMcsValue () / 8);
125  }
127 }
128 
131 {
132  NS_LOG_FUNCTION (this << st);
134 }
135 
136 } //namespace ns3
ns3::ConstantRateWifiManager::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: constant-rate-wifi-manager.cc:36
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::WifiRemoteStationManager::GetDefaultTxPowerLevel
uint8_t GetDefaultTxPowerLevel(void) const
Definition: wifi-remote-station-manager.cc:1206
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::ConstantRateWifiManager::DoReportFinalRtsFailed
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: constant-rate-wifi-manager.cc:106
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ConstantRateWifiManager::DoGetDataTxVector
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
Definition: constant-rate-wifi-manager.cc:118
ns3::ConstantRateWifiManager::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: constant-rate-wifi-manager.cc:73
ns3::WifiRemoteStationManager::GetShortGuardIntervalSupported
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
Definition: wifi-remote-station-manager.cc:281
ns3::WIFI_MOD_CLASS_HT
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Definition: wifi-phy-common.h:130
ns3::ConstantRateWifiManager::DoReportDataFailed
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: constant-rate-wifi-manager.cc:86
ns3::MakeWifiModeChecker
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Definition: wifi-mode.cc:235
ns3::WifiMode::GetModulationClass
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:159
ns3::WifiRemoteStationManager
hold a list of per-remote-station state.
Definition: wifi-remote-station-manager.h:121
ns3::ConstantRateWifiManager::DoCreateStation
WifiRemoteStation * DoCreateStation(void) const override
Definition: constant-rate-wifi-manager.cc:65
ns3::WifiRemoteStationManager::GetGuardInterval
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
Definition: wifi-remote-station-manager.cc:297
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::MakeWifiModeAccessor
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: wifi-mode.h:246
ns3::Min
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Definition: int64x64.h:218
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
ns3::WifiRemoteStationManager::GetShortPreambleEnabled
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
Definition: wifi-remote-station-manager.cc:226
ns3::ConstantRateWifiManager
use constant rates for data and RTS transmissions
Definition: constant-rate-wifi-manager.h:36
ns3::ConstantRateWifiManager::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: constant-rate-wifi-manager.cc:99
ns3::WifiRemoteStationManager::GetNumberOfSupportedStreams
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
Definition: wifi-remote-station-manager.cc:1812
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::ConstantRateWifiManager::m_dataMode
WifiMode m_dataMode
Wifi mode for unicast Data frames.
Definition: constant-rate-wifi-manager.h:62
ns3::NanoSeconds
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1313
ns3::ConvertGuardIntervalToNanoSeconds
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
Definition: wifi-phy-common.cc:30
ns3::GetChannelWidthForTransmission
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
Definition: wifi-phy-common.cc:68
ns3::StringValue
Hold variables of type string.
Definition: string.h:41
ns3::ConstantRateWifiManager::~ConstantRateWifiManager
virtual ~ConstantRateWifiManager()
Definition: constant-rate-wifi-manager.cc:59
ns3::GetPreambleForTransmission
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
Definition: wifi-phy-common.cc:87
constant-rate-wifi-manager.h
ns3::ConstantRateWifiManager::m_ctlMode
WifiMode m_ctlMode
Wifi mode for RTS frames.
Definition: constant-rate-wifi-manager.h:63
ns3::WifiRemoteStation
hold per-remote-station state.
Definition: wifi-remote-station-manager.h:62
ns3::WifiRemoteStationManager::GetAggregation
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
Definition: wifi-remote-station-manager.cc:1707
ns3::WifiRemoteStationManager::GetNumberOfAntennas
uint8_t GetNumberOfAntennas(void) const
Definition: wifi-remote-station-manager.cc:1872
ns3::ConstantRateWifiManager::DoGetRtsTxVector
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
Definition: constant-rate-wifi-manager.cc:130
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::ConstantRateWifiManager::DoReportFinalDataFailed
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: constant-rate-wifi-manager.cc:112
ns3::WifiRemoteStationManager::GetMaxNumberOfTransmitStreams
uint8_t GetMaxNumberOfTransmitStreams(void) const
Definition: wifi-remote-station-manager.cc:1878
ns3::ConstantRateWifiManager::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: constant-rate-wifi-manager.cc:92
ns3::ConstantRateWifiManager::DoReportRtsFailed
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Definition: constant-rate-wifi-manager.cc:80
ns3::ConstantRateWifiManager::ConstantRateWifiManager
ConstantRateWifiManager()
Definition: constant-rate-wifi-manager.cc:54
ns3::WifiRemoteStationManager::GetChannelWidth
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
Definition: wifi-remote-station-manager.cc:1683
ns3::WifiMode::GetMcsValue
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:137