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 "wifi-tx-vector.h"
25 #include "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 ackSnr, WifiMode ackMode, double dataSnr)
101 {
102  NS_LOG_FUNCTION (this << st << ackSnr << ackMode << dataSnr);
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);
122 }
123 
126 {
127  NS_LOG_FUNCTION (this << st);
129 }
130 
131 bool
133 {
134  return true;
135 }
136 
137 } //namespace ns3
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Hold variables of type string.
Definition: string.h:41
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
Convert the guard interval to nanoseconds based on the wifimode.
Definition: wifi-utils.cc:68
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
use constant rates for data and RTS transmissions
WifiRemoteStation * DoCreateStation(void) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
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.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Definition: int64x64.h:197
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1038
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
void DoReportFinalRtsFailed(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.
WifiMode m_ctlMode
Wifi mode for RTS frames.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
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:244
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode m_dataMode
Wifi mode for unicast DATA frames.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Definition: wifi-mode.cc:687
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
static uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY&#39;s default ...
static TypeId GetTypeId(void)
Get the type ID.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
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
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.