A Discrete-Event Network Simulator
API
wifi-remote-station-manager.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006,2007 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 WIFI_REMOTE_STATION_MANAGER_H
22 #define WIFI_REMOTE_STATION_MANAGER_H
23 
24 #include "ns3/traced-callback.h"
25 #include "ns3/packet.h"
26 #include "ns3/object.h"
27 #include "ns3/nstime.h"
28 #include "ns3/data-rate.h"
29 #include "wifi-tx-vector.h"
30 #include "ht-capabilities.h"
31 #include "vht-capabilities.h"
32 #include "he-capabilities.h"
33 
34 namespace ns3 {
35 
36 struct WifiRemoteStation;
37 struct WifiRemoteStationState;
38 class WifiPhy;
39 class WifiMac;
40 class WifiMacHeader;
41 
49 {
50 public:
57  void NotifyTxSuccess (uint32_t retryCounter);
59  void NotifyTxFailed ();
64  double GetFrameErrorRate () const;
65 private:
80  double m_failAvg;
81 };
82 
90 {
91 public:
96  static TypeId GetTypeId (void);
97 
99  virtual ~WifiRemoteStationManager ();
100 
103  {
106  };
107 
114  virtual void SetupPhy (const Ptr<WifiPhy> phy);
121  virtual void SetupMac (const Ptr<WifiMac> mac);
122 
128  uint32_t GetMaxSsrc (void) const;
134  uint32_t GetMaxSlrc (void) const;
140  uint32_t GetRtsCtsThreshold (void) const;
146  uint32_t GetFragmentationThreshold (void) const;
152  void SetMaxSsrc (uint32_t maxSsrc);
158  void SetMaxSlrc (uint32_t maxSlrc);
164  void SetRtsCtsThreshold (uint32_t threshold);
171  void SetFragmentationThreshold (uint32_t threshold);
176  void UpdateFragmentationThreshold (void);
183  void SetQosSupport (Mac48Address from, bool qosSupported);
190  void AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities);
197  void AddStationVhtCapabilities (Mac48Address from, VhtCapabilities vhtcapabilities);
204  void AddStationHeCapabilities (Mac48Address from, HeCapabilities hecapabilities);
210  virtual void SetQosSupported (bool enable);
216  bool HasQosSupported (void) const;
222  virtual void SetHtSupported (bool enable);
228  bool HasHtSupported (void) const;
234  virtual void SetVhtSupported (bool enable);
240  bool HasVhtSupported (void) const;
246  virtual void SetHeSupported (bool enable);
252  bool HasHeSupported (void) const;
276  ProtectionMode GetHtProtectionMode (void) const;
282  void SetUseNonErpProtection (bool enable);
289  bool GetUseNonErpProtection (void) const;
295  void SetUseNonHtProtection (bool enable);
302  bool GetUseNonHtProtection (void) const;
308  void SetUseGreenfieldProtection (bool enable);
315  bool GetUseGreenfieldProtection (void) const;
321  void SetShortPreambleEnabled (bool enable);
328  bool GetShortPreambleEnabled (void) const;
334  void SetShortSlotTimeEnabled (bool enable);
341  bool GetShortSlotTimeEnabled (void) const;
347  void SetRifsPermitted (bool allow);
354  bool GetRifsPermitted (void) const;
355 
359  void Reset (void);
360 
368  void AddBasicMode (WifiMode mode);
374  WifiMode GetDefaultMode (void) const;
380  uint8_t GetNBasicModes (void) const;
388  WifiMode GetBasicMode (uint8_t i) const;
394  uint32_t GetNNonErpBasicModes (void) const;
402  WifiMode GetNonErpBasicMode (uint8_t i) const;
438  bool GetQosSupported (Mac48Address address) const;
445  void AddBasicMcs (WifiMode mcs);
451  WifiMode GetDefaultMcs (void) const;
457  uint8_t GetNBasicMcs (void) const;
465  WifiMode GetBasicMcs (uint8_t i) const;
505  uint8_t GetNMcsSupported (Mac48Address address) const;
514  bool GetHtSupported (Mac48Address address) const;
523  bool GetVhtSupported (Mac48Address address) const;
524 
530  WifiMode GetNonUnicastMode (void) const;
531 
570  void AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported);
577  void AddSupportedErpSlotTime (Mac48Address address, bool isShortSlotTimeSupported);
586  bool IsBrandNew (Mac48Address address) const;
595  bool IsAssociated (Mac48Address address) const;
605  bool IsWaitAssocTxOk (Mac48Address address) const;
633 
644  void PrepareForQueue (Mac48Address address, const WifiMacHeader *header,
645  Ptr<const Packet> packet);
646 
655  Ptr<const Packet> packet);
665  Ptr<const Packet> packet);
674  Ptr<const Packet> packet);
683 
691  void ReportRtsFailed (Mac48Address address, const WifiMacHeader *header);
699  void ReportDataFailed (Mac48Address address, const WifiMacHeader *header);
711  void ReportRtsOk (Mac48Address address, const WifiMacHeader *header,
712  double ctsSnr, WifiMode ctsMode, double rtsSnr);
723  void ReportDataOk (Mac48Address address, const WifiMacHeader *header,
724  double ackSnr, WifiMode ackMode, double dataSnr);
753  void ReportAmpduTxStatus (Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr);
754 
763  void ReportRxOk (Mac48Address address, const WifiMacHeader *header,
764  double rxSnr, WifiMode txMode);
765 
775  bool NeedRts (Mac48Address address, const WifiMacHeader *header,
776  Ptr<const Packet> packet, WifiTxVector txVector);
785  bool NeedCtsToSelf (WifiTxVector txVector);
786 
796  Ptr<const Packet> packet);
806  Ptr<const Packet> packet);
816  Ptr<const Packet> packet);
825  uint32_t GetFragmentSize (Mac48Address address, const WifiMacHeader *header,
826  Ptr<const Packet> packet, uint32_t fragmentNumber);
835  uint32_t GetFragmentOffset (Mac48Address address, const WifiMacHeader *header,
836  Ptr<const Packet> packet, uint32_t fragmentNumber);
845  bool IsLastFragment (Mac48Address address, const WifiMacHeader *header,
846  Ptr<const Packet> packet, uint32_t fragmentNumber);
847 
872  uint8_t GetDefaultTxPowerLevel (void) const;
884  void SetDefaultTxPowerLevel (uint8_t txPower);
888  uint8_t GetNumberOfAntennas (void);
892  uint8_t GetMaxNumberOfTransmitStreams (void);
893 
901  typedef void (*PowerChangeTracedCallback)(double oldPower, double newPower, Mac48Address remoteAddress);
902 
910  typedef void (*RateChangeTracedCallback)(DataRate oldRate, DataRate newRate, Mac48Address remoteAddress);
911 
912 
913 protected:
914  virtual void DoDispose (void);
923  WifiMode GetSupported (const WifiRemoteStation *station, uint8_t i) const;
931  uint8_t GetNSupported (const WifiRemoteStation *station) const;
940  bool GetQosSupported (const WifiRemoteStation *station) const;
949  bool GetHtSupported (const WifiRemoteStation *station) const;
958  bool GetVhtSupported (const WifiRemoteStation *station) const;
967  bool GetHeSupported (const WifiRemoteStation *station) const;
977  WifiMode GetMcsSupported (const WifiRemoteStation *station, uint8_t i) const;
985  uint8_t GetNMcsSupported (const WifiRemoteStation *station) const;
994  WifiMode GetNonErpSupported (const WifiRemoteStation *station, uint8_t i) const;
1002  uint32_t GetNNonErpSupported (const WifiRemoteStation *station) const;
1010  Mac48Address GetAddress (const WifiRemoteStation *station) const;
1018  uint8_t GetChannelWidth (const WifiRemoteStation *station) const;
1027  bool GetShortGuardInterval (const WifiRemoteStation *station) const;
1035  uint16_t GetGuardInterval (const WifiRemoteStation *station) const;
1044  bool GetAggregation (const WifiRemoteStation *station) const;
1053  bool GetGreenfield (const WifiRemoteStation *station) const;
1054 
1062  uint8_t GetNumberOfSupportedStreams (const WifiRemoteStation *station) const;
1070  uint32_t GetNess (const WifiRemoteStation *station) const;
1089  static uint8_t GetChannelWidthForTransmission (WifiMode mode, uint8_t maxSupportedChannelWidth);
1090 
1096  Ptr<WifiPhy> GetPhy (void) const;
1102  Ptr<WifiMac> GetMac (void) const;
1103 
1104 
1105 private:
1117  virtual bool DoNeedRts (WifiRemoteStation *station,
1118  Ptr<const Packet> packet, bool normally);
1131  virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station,
1132  Ptr<const Packet> packet, bool normally);
1144  virtual bool DoNeedDataRetransmission (WifiRemoteStation *station,
1145  Ptr<const Packet> packet, bool normally);
1157  virtual bool DoNeedFragmentation (WifiRemoteStation *station,
1158  Ptr<const Packet> packet, bool normally);
1165  virtual bool IsLowLatency (void) const = 0;
1169  virtual WifiRemoteStation* DoCreateStation (void) const = 0;
1178  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) = 0;
1187  virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) = 0;
1194  virtual uint8_t DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode);
1201  virtual uint8_t DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode);
1208  virtual uint8_t DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode);
1209 
1216  virtual uint8_t DoGetCtsTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1223  virtual uint16_t DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode);
1230  virtual uint8_t DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode);
1237  virtual uint8_t DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode);
1244  virtual uint8_t DoGetAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1251  virtual uint16_t DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode);
1258  virtual uint8_t DoGetAckTxNss (Mac48Address address, WifiMode ackMode);
1265  virtual uint8_t DoGetAckTxNess (Mac48Address address, WifiMode ackMode);
1272  virtual uint8_t DoGetBlockAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1279  virtual uint16_t DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode);
1286  virtual uint8_t DoGetBlockAckTxNss (Mac48Address address, WifiMode blockAckMode);
1293  virtual uint8_t DoGetBlockAckTxNess (Mac48Address address, WifiMode blockAckMode);
1294 
1301  virtual void DoReportRtsFailed (WifiRemoteStation *station) = 0;
1308  virtual void DoReportDataFailed (WifiRemoteStation *station) = 0;
1318  virtual void DoReportRtsOk (WifiRemoteStation *station,
1319  double ctsSnr, WifiMode ctsMode, double rtsSnr) = 0;
1329  virtual void DoReportDataOk (WifiRemoteStation *station,
1330  double ackSnr, WifiMode ackMode, double dataSnr) = 0;
1337  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station) = 0;
1344  virtual void DoReportFinalDataFailed (WifiRemoteStation *station) = 0;
1353  virtual void DoReportRxOk (WifiRemoteStation *station,
1354  double rxSnr, WifiMode txMode) = 0;
1368  virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr);
1369 
1385  WifiRemoteStation* Lookup (Mac48Address address, uint8_t tid) const;
1387 
1396  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1397 
1408  bool IsAllowedControlAnswerModulationClass (WifiModulationClass modClassReq, WifiModulationClass modClassAnswer) const;
1409 
1419 
1426  void DoSetFragmentationThreshold (uint32_t threshold);
1432  uint32_t DoGetFragmentationThreshold (void) const;
1441  uint32_t GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet);
1442 
1446  typedef std::vector <WifiRemoteStation *> Stations;
1450  typedef std::vector <WifiRemoteStationState *> StationStates;
1451 
1469 
1480 
1481  StationStates m_states;
1482  Stations m_stations;
1483 
1486 
1491  uint32_t m_maxSsrc;
1492  uint32_t m_maxSlrc;
1506 
1525 };
1526 
1531 {
1535  enum
1536  {
1541  } m_state;
1542 
1556 
1557  uint8_t m_channelWidth;
1559  uint16_t m_guardInterval;
1560  uint8_t m_streams;
1561  uint32_t m_ness;
1562  bool m_stbc;
1563  bool m_ldpc;
1572 };
1573 
1586 {
1587  virtual ~WifiRemoteStation ();
1589  uint32_t m_ssrc;
1590  uint32_t m_slrc;
1591  uint8_t m_tid;
1592 };
1593 
1594 } //namespace ns3
1595 
1596 #endif /* WIFI_REMOTE_STATION_MANAGER_H */
enum ns3::WifiRemoteStationState::@76 m_state
State of the station.
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
virtual uint8_t DoGetAckTxNss(Mac48Address address, WifiMode ackMode)
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
uint32_t m_ssrc
STA short retry count.
bool m_shortPreamble
Flag if short PLCP preamble is supported by the remote station.
bool m_vhtSupported
Flag if VHT capability is supported.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
virtual uint8_t DoGetAckTxNess(Mac48Address address, WifiMode ackMode)
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
uint32_t GetNFragments(const WifiMacHeader *header, Ptr< const Packet > packet)
Return the number of fragments needed for the given packet.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
std::vector< WifiRemoteStationState * > StationStates
A vector of WifiRemoteStationStates.
bool GetGreenfieldSupported(Mac48Address address) const
Return whether the station supports Greenfield or not.
bool m_shortGuardInterval
Flag if HT/VHT short guard interval is supported by the remote station.
virtual uint16_t DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void(* PowerChangeTracedCallback)(double oldPower, double newPower, Mac48Address remoteAddress)
TracedCallback signature for power change events.
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
bool NeedDataRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
ProtectionMode GetHtProtectionMode(void) const
Return the HT protection mode.
bool m_vhtSupported
Flag if VHT is supported by the station.
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast DATA frames.
void ReportDataFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
virtual uint8_t DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode)
uint32_t m_nextFragmentationThreshold
Threshold for fragmentation that will be used for the next transmission.
Forward calls to a chain of Callback.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
uint32_t GetMaxSsrc(void) const
Return the maximum STA short retry count (SSRC).
virtual uint8_t DoGetAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
WifiTxVector GetCtsTxVector(Mac48Address address, WifiMode rtsMode)
virtual uint8_t DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode)
uint8_t m_streams
Number of supported streams by the remote station.
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
virtual uint8_t DoGetBlockAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
uint8_t m_defaultTxPowerLevel
Default tranmission power level.
bool GetGreenfield(const WifiRemoteStation *station) const
Return whether the station supports Greenfield or not.
Mac48Address m_address
Mac48Address of the remote station.
bool NeedRts(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, WifiTxVector txVector)
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
Time m_memoryTime
averaging coefficient depends on the memory time
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts...
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
bool m_shortPreambleEnabled
flag if short PLCP preamble is enabled
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
virtual bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
Tid independent remote station statistics.
void SetErpProtectionMode(ProtectionMode mode)
Sets the ERP protection mode.
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
WifiRemoteStationState * m_state
Remote station state.
double m_failAvg
moving percentage of failed frames
WifiTxVector GetCtsToSelfTxVector(const WifiMacHeader *header, Ptr< const Packet > packet)
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
Class for representing data rates.
Definition: data-rate.h:88
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
virtual bool DoNeedDataRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
static uint8_t GetChannelWidthForTransmission(WifiMode mode, uint8_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
Time m_lastUpdate
when last update has occured
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportDataFailed if NeedDataRetransmission returns false...
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
tuple phy
Definition: third.py:86
bool m_qosSupported
Flag if HT is supported by the station.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
virtual uint8_t DoGetCtsTxChannelWidth(Mac48Address address, WifiMode ctsMode)
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiRemoteStation * Lookup(Mac48Address address, uint8_t tid) const
Return the station associated with the given address and TID.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
double CalculateAveragingCoefficient()
Calculate averaging coefficient for frame error rate.
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)=0
This method is a pure virtual method that must be implemented by the sub-class.
void ReportRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
The IEEE 802.11ac VHT Capabilities.
virtual bool DoNeedRtsRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
bool m_stbc
Flag if STBC is supported by the remote station.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htcapabilities)
Records HT capabilities of the remote station.
uint8_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
WifiRemoteStationInfo GetInfo(Mac48Address address)
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
uint32_t GetRtsCtsThreshold(void) const
Return the RTS threshold.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.
uint8_t GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
void AddStationHeCapabilities(Mac48Address from, HeCapabilities hecapabilities)
Records HE capabilities of the remote station.
virtual void SetQosSupported(bool enable)
Enable or disable QoS support.
tuple mac
Definition: third.py:92
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
hold a list of per-remote-station state.
WifiMode GetControlAnswerMode(Mac48Address address, WifiMode reqMode)
Get control answer mode function.
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
WifiMode m_defaultTxMode
The default transmission mode.
uint32_t GetNess(const WifiRemoteStation *station) const
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
virtual uint8_t DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode)
bool m_ldpc
Flag if LDPC is supported by the remote station.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
void ReportDataOk(Mac48Address address, const WifiMacHeader *header, double ackSnr, WifiMode ackMode, double dataSnr)
Should be invoked whenever we receive the Ack associated to a data packet we just sent...
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
bool m_qosSupported
Flag if HT capability is supported.
virtual uint8_t DoGetAckTxPowerLevel(Mac48Address address, WifiMode ackMode)
uint32_t GetNNonErpBasicModes(void) const
Return the number of non-ERP basic modes we support.
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetHtProtectionMode(ProtectionMode mode)
Sets the HT protection mode.
ProtectionMode GetErpProtectionMode(void) const
Return the ERP protection mode.
WifiTxVector DoGetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifiremote statio...
uint32_t GetNNonErpSupported(const WifiRemoteStation *station) const
Return the number of non-ERP modes supported by the given station.
void AddSupportedMode(Mac48Address address, WifiMode mode)
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported l...
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
uint32_t GetFragmentSize(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold...
uint8_t m_channelWidth
Channel width (in MHz) supported by the remote station.
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
bool m_htSupported
Flag if HT capability is supported.
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
bool m_useGreenfieldProtection
flag if protection for stations that do not support HT greenfield format is enabled ...
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
an EUI-48 address
Definition: mac48-address.h:43
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
virtual bool IsLowLatency(void) const =0
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:251
Stations m_stations
Information for each known stations.
void ReportRtsOk(Mac48Address address, const WifiMacHeader *header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the Cts associated to an RTS we just sent.
bool m_heSupported
Flag if HE capability is supported.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
WifiMode GetNonErpBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
virtual uint16_t DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode)
double GetFrameErrorRate() const
Return frame error rate (probability that frame is corrupted due to transmission error).
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
void AddSupportedPlcpPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PLCP preamble is supported by the station.
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do Cts-to-self before sending a DATA.
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
virtual void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
bool m_htSupported
Flag if HT is supported by the station.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
ProtectionMode
ProtectionMode enumeration.
WifiTxVector GetDataTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PLCP preambles.
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:36
A struct that holds information about each remote station.
WifiModeList m_operationalMcsSet
operational MCS set
static TypeId GetTypeId(void)
Get the type ID.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
void Reset(void)
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot. ...
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
bool GetRifsPermitted(void) const
Return whether the device can use RIFS.
virtual void DoDispose(void)
Destructor implementation.
void ReportRxOk(Mac48Address address, const WifiMacHeader *header, double rxSnr, WifiMode txMode)
void SetUseGreenfieldProtection(bool enable)
Enable or disable protection for stations that do not support HT greenfield format.
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
bool HasQosSupported(void) const
Return whether the device has QoS support enabled.
bool NeedRtsRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
virtual void SetHeSupported(bool enable)
Enable or disable HE capability support.
bool GetUseGreenfieldProtection(void) const
Return whether protection for stations that do not support HT greenfield format is enabled...
bool GetHtSupported(Mac48Address address) const
Return whether the station supports HT or not.
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer) const
Return whether the modulation class of the selected mode for the control answer frame is allowed...
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
virtual uint8_t DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode)
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
WifiTxVector GetRtsTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
A base class which provides memory management and object aggregation.
Definition: object.h:87
tuple address
Definition: first.py:37
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
StationStates m_states
States of known stations.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PLCP preambles.
WifiTxVector GetBlockAckTxVector(Mac48Address address, WifiMode dataMode)
virtual uint8_t DoGetCtsTxPowerLevel(Mac48Address address, WifiMode ctsMode)
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
uint32_t GetMaxSlrc(void) const
Return the maximum STA long retry count (SLRC).
uint32_t m_slrc
STA long retry count.
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
The IEEE 802.11ax HE Capabilities.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
void(* RateChangeTracedCallback)(DataRate oldRate, DataRate newRate, Mac48Address remoteAddress)
TracedCallback signature for rate change events.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
a unique identifier for an interface.
Definition: type-id.h:58
bool m_rifsPermitted
flag if RIFS is enabled
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRtsRetransmission returns false.
WifiTxVector GetAckTxVector(Mac48Address address, WifiMode dataMode)
bool m_greenfield
Flag if greenfield is supported by the remote station.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the suppported MCS by a destination.
uint32_t m_ness
Number of streams in beamforming of the remote station.
virtual uint16_t DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode)
WifiRemoteStationInfo m_info
remote station info
WifiModeList m_bssBasicMcsSet
basic MCS set
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
bool m_heSupported
Flag if HE is supported by the station.
hold per-remote-station state.
void SetRifsPermitted(bool allow)
Permit or prohibit RIFS.
virtual WifiRemoteStation * DoCreateStation(void) const =0
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
Implements the IEEE 802.11 MAC header.
virtual uint8_t DoGetBlockAckTxPowerLevel(Mac48Address address, WifiMode blockAckMode)
Ptr< WifiMac > GetMac(void) const
Return the WifiMac.
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PLCP preamble or not.
std::vector< WifiRemoteStation * > Stations
A vector of WifiRemoteStations.