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 <vector>
25 #include <utility>
26 #include "ns3/mac48-address.h"
27 #include "ns3/traced-callback.h"
28 #include "ns3/packet.h"
29 #include "ns3/object.h"
30 #include "ns3/nstime.h"
31 #include "wifi-mode.h"
32 #include "wifi-tx-vector.h"
33 #include "ht-capabilities.h"
34 #include "vht-capabilities.h"
35 
36 namespace ns3 {
37 
38 struct WifiRemoteStation;
39 struct WifiRemoteStationState;
40 class WifiPhy;
41 class WifiMac;
42 class WifiMacHeader;
43 
51 {
52 public:
59  void NotifyTxSuccess (uint32_t retryCounter);
61  void NotifyTxFailed ();
63  double GetFrameErrorRate () const;
64 private:
79  double m_failAvg;
80 };
81 
89 {
90 public:
91  static TypeId GetTypeId (void);
92 
94  virtual ~WifiRemoteStationManager ();
95 
97  {
100  };
101 
108  virtual void SetupPhy (Ptr<WifiPhy> phy);
115  virtual void SetupMac (Ptr<WifiMac> mac);
116 
122  uint32_t GetMaxSsrc (void) const;
128  uint32_t GetMaxSlrc (void) const;
134  uint32_t GetRtsCtsThreshold (void) const;
140  uint32_t GetFragmentationThreshold (void) const;
146  void SetMaxSsrc (uint32_t maxSsrc);
152  void SetMaxSlrc (uint32_t maxSlrc);
158  void SetRtsCtsThreshold (uint32_t threshold);
165  void SetFragmentationThreshold (uint32_t threshold);
170  void UpdateFragmentationThreshold (void);
177  void AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities);
184  void AddStationVhtCapabilities (Mac48Address from,VhtCapabilities vhtcapabilities);
190  virtual void SetHtSupported (bool enable);
196  bool HasHtSupported (void) const;
202  virtual void SetVhtSupported (bool enable);
208  bool HasVhtSupported (void) const;
214  void SetProtectionMode (ProtectionMode mode);
220  ProtectionMode GetProtectionMode (void) const;
226  void SetUseNonErpProtection (bool enable);
233  bool GetUseNonErpProtection (void) const;
239  void SetShortPreambleEnabled (bool enable);
246  bool GetShortPreambleEnabled (void) const;
252  void SetShortSlotTimeEnabled (bool enable);
259  bool GetShortSlotTimeEnabled (void) const;
260 
264  void Reset (void);
265 
273  void AddBasicMode (WifiMode mode);
279  WifiMode GetDefaultMode (void) const;
285  uint32_t GetNBasicModes (void) const;
293  WifiMode GetBasicMode (uint32_t i) const;
299  uint32_t GetNNonErpBasicModes (void) const;
307  WifiMode GetNonErpBasicMode (uint32_t i) const;
341  void AddBasicMcs (WifiMode mcs);
347  WifiMode GetDefaultMcs (void) const;
353  uint32_t GetNBasicMcs (void) const;
361  WifiMode GetBasicMcs (uint32_t i) const;
369 
375  WifiMode GetNonUnicastMode (void) const;
376 
383  void Reset (Mac48Address address);
384 
417  void AddSupportedPlcpPreamble (Mac48Address address, bool isShortPreambleSupported);
424  void AddSupportedErpSlotTime (Mac48Address address, bool isShortSlotTimeSupported);
433  bool IsBrandNew (Mac48Address address) const;
442  bool IsAssociated (Mac48Address address) const;
452  bool IsWaitAssocTxOk (Mac48Address address) const;
480 
491  void PrepareForQueue (Mac48Address address, const WifiMacHeader *header,
492  Ptr<const Packet> packet);
493 
502  Ptr<const Packet> packet);
512  Ptr<const Packet> packet);
521  Ptr<const Packet> packet);
530 
538  void ReportRtsFailed (Mac48Address address, const WifiMacHeader *header);
546  void ReportDataFailed (Mac48Address address, const WifiMacHeader *header);
558  void ReportRtsOk (Mac48Address address, const WifiMacHeader *header,
559  double ctsSnr, WifiMode ctsMode, double rtsSnr);
570  void ReportDataOk (Mac48Address address, const WifiMacHeader *header,
571  double ackSnr, WifiMode ackMode, double dataSnr);
600  void ReportAmpduTxStatus (Mac48Address address, uint8_t tid, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr);
601 
610  void ReportRxOk (Mac48Address address, const WifiMacHeader *header,
611  double rxSnr, WifiMode txMode);
612 
622  bool NeedRts (Mac48Address address, const WifiMacHeader *header,
623  Ptr<const Packet> packet, WifiTxVector txVector);
632  bool NeedCtsToSelf (WifiTxVector txVector);
633 
643  Ptr<const Packet> packet);
653  Ptr<const Packet> packet);
663  Ptr<const Packet> packet);
672  uint32_t GetFragmentSize (Mac48Address address, const WifiMacHeader *header,
673  Ptr<const Packet> packet, uint32_t fragmentNumber);
682  uint32_t GetFragmentOffset (Mac48Address address, const WifiMacHeader *header,
683  Ptr<const Packet> packet, uint32_t fragmentNumber);
692  bool IsLastFragment (Mac48Address address, const WifiMacHeader *header,
693  Ptr<const Packet> packet, uint32_t fragmentNumber);
694 
719  uint8_t GetDefaultTxPowerLevel (void) const;
731  void SetDefaultTxPowerLevel (uint8_t txPower);
735  uint32_t GetNumberOfTransmitAntennas (void);
736 
743  typedef void (*PowerChangeTracedCallback)(uint8_t power, Mac48Address remoteAddress);
744 
751  typedef void (*RateChangeTracedCallback)(uint32_t rate, Mac48Address remoteAddress);
752 
753 
754 
755 protected:
756  virtual void DoDispose (void);
765  WifiMode GetSupported (const WifiRemoteStation *station, uint32_t i) const;
773  uint32_t GetNSupported (const WifiRemoteStation *station) const;
782  bool GetHtSupported (const WifiRemoteStation *station) const;
791  bool GetVhtSupported (const WifiRemoteStation *station) const;
801  WifiMode GetMcsSupported (const WifiRemoteStation *station, uint32_t i) const;
809  uint32_t GetNMcsSupported (const WifiRemoteStation *station) const;
818  WifiMode GetNonErpSupported (const WifiRemoteStation *station, uint32_t i) const;
826  uint32_t GetNNonErpSupported (const WifiRemoteStation *station) const;
834  uint32_t GetChannelWidth (const WifiRemoteStation *station) const;
843  bool GetShortGuardInterval (const WifiRemoteStation *station) const;
852  bool GetAggregation (const WifiRemoteStation *station) const;
861  bool GetStbc (const WifiRemoteStation *station) const;
870  bool GetGreenfield (const WifiRemoteStation *station) const;
871 
879  uint8_t GetNumberOfSupportedRxAntennas (const WifiRemoteStation *station) const;
887  uint32_t GetNess (const WifiRemoteStation *station) const;
895  uint32_t GetLongRetryCount (const WifiRemoteStation *station) const;
903  uint32_t GetShortRetryCount (const WifiRemoteStation *station) const;
904 
910  Ptr<WifiPhy> GetPhy (void) const;
916  Ptr<WifiMac> GetMac (void) const;
917 
918 
919 private:
931  virtual bool DoNeedRts (WifiRemoteStation *station,
932  Ptr<const Packet> packet, bool normally);
945  virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station,
946  Ptr<const Packet> packet, bool normally);
958  virtual bool DoNeedDataRetransmission (WifiRemoteStation *station,
959  Ptr<const Packet> packet, bool normally);
971  virtual bool DoNeedFragmentation (WifiRemoteStation *station,
972  Ptr<const Packet> packet, bool normally);
979  virtual bool IsLowLatency (void) const = 0;
983  virtual WifiRemoteStation* DoCreateStation (void) const = 0;
992  virtual WifiTxVector DoGetDataTxVector (WifiRemoteStation *station) = 0;
1001  virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) = 0;
1008  virtual uint8_t DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode);
1015  virtual uint8_t DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode);
1022  virtual uint8_t DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode);
1023 
1024  virtual uint32_t DoGetCtsTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1025  virtual bool DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode);
1026  virtual uint8_t DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode);
1027  virtual uint8_t DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode);
1028  virtual bool DoGetCtsTxStbc (Mac48Address address, WifiMode ctsMode);
1029  virtual uint32_t DoGetAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1030  virtual bool DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode);
1031  virtual uint8_t DoGetAckTxNss (Mac48Address address, WifiMode ackMode);
1032  virtual uint8_t DoGetAckTxNess (Mac48Address address, WifiMode ackMode);
1033  virtual bool DoGetAckTxStbc (Mac48Address address, WifiMode ackMode);
1034  virtual uint32_t DoGetBlockAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1035  virtual bool DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode);
1036  virtual uint8_t DoGetBlockAckTxNss (Mac48Address address, WifiMode blockAckMode);
1037  virtual uint8_t DoGetBlockAckTxNess (Mac48Address address, WifiMode blockAckMode);
1038  virtual bool DoGetBlockAckTxStbc (Mac48Address address, WifiMode blockAckMode);
1039 
1046  virtual void DoReportRtsFailed (WifiRemoteStation *station) = 0;
1053  virtual void DoReportDataFailed (WifiRemoteStation *station) = 0;
1063  virtual void DoReportRtsOk (WifiRemoteStation *station,
1064  double ctsSnr, WifiMode ctsMode, double rtsSnr) = 0;
1074  virtual void DoReportDataOk (WifiRemoteStation *station,
1075  double ackSnr, WifiMode ackMode, double dataSnr) = 0;
1082  virtual void DoReportFinalRtsFailed (WifiRemoteStation *station) = 0;
1089  virtual void DoReportFinalDataFailed (WifiRemoteStation *station) = 0;
1098  virtual void DoReportRxOk (WifiRemoteStation *station,
1099  double rxSnr, WifiMode txMode) = 0;
1113  virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint32_t nSuccessfulMpdus, uint32_t nFailedMpdus, double rxSnr, double dataSnr);
1114 
1130  WifiRemoteStation* Lookup (Mac48Address address, uint8_t tid) const;
1132 
1141  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1142 
1153  bool IsAllowedControlAnswerModulationClass (enum WifiModulationClass modClassReq, enum WifiModulationClass modClassAnswer) const;
1154 
1156 
1163  void DoSetFragmentationThreshold (uint32_t threshold);
1169  uint32_t DoGetFragmentationThreshold (void) const;
1178  uint32_t GetNFragments (const WifiMacHeader *header, Ptr<const Packet> packet);
1179 
1183  typedef std::vector <WifiRemoteStation *> Stations;
1187  typedef std::vector <WifiRemoteStationState *> StationStates;
1188 
1206 
1217 
1218  StationStates m_states;
1219  Stations m_stations;
1220 
1223 
1226  uint32_t m_maxSsrc;
1227  uint32_t m_maxSlrc;
1237 
1256 };
1257 
1262 {
1266  enum
1267  {
1272  } m_state;
1273 
1287 
1288  uint32_t m_channelWidth;
1290  uint8_t m_rx;
1291  uint32_t m_ness;
1292  bool m_stbc;
1299 };
1300 
1313 {
1314  virtual ~WifiRemoteStation ();
1316  uint32_t m_ssrc;
1317  uint32_t m_slrc;
1318  uint8_t m_tid;
1319 };
1320 
1321 } //namespace ns3
1322 
1323 #endif /* WIFI_REMOTE_STATION_MANAGER_H */
virtual uint8_t DoGetAckTxNss(Mac48Address address, WifiMode ackMode)
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
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
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 short guard interval is supported by the remote station.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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...
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.
uint32_t GetMaxSsrc(void) const
Return the maximum STA short retry count (SSRC).
virtual bool DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode)
WifiTxVector GetCtsTxVector(Mac48Address address, WifiMode rtsMode)
virtual uint8_t DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode)
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
void(* RateChangeTracedCallback)(uint32_t rate, Mac48Address remoteAddress)
TracedCallback signature for rate change events.
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.
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, 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...
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)
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint32_t i) const
Return the WifiMode supported by the specified station at the specified index.
bool IsAllowedControlAnswerModulationClass(enum WifiModulationClass modClassReq, enum WifiModulationClass modClassAnswer) const
Return whether the modulation class of the selected mode for the control answer frame is allowed...
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.
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...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
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.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
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...
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
bool GetStbc(const WifiRemoteStation *station) const
Return whether the given station supports space-time block coding (STBC).
virtual bool DoNeedDataRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
virtual bool DoGetAckTxStbc(Mac48Address address, WifiMode ackMode)
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...
uint8_t m_rx
Number of supported RX streams by the remote station.
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
tuple phy
Definition: third.py:86
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
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 bool DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode)
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.
enum ns3::WifiRemoteStationState::@87 m_state
State of the station.
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
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
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.
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htcapabilities)
Records HT capabilities of the remote station.
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.
uint32_t m_channelWidth
Channel width (in MHz) supported by the remote station.
tuple mac
Definition: third.py:92
hold a list of per-remote-station state.
WifiMode GetControlAnswerMode(Mac48Address address, WifiMode reqMode)
uint32_t GetNBasicMcs(void) const
Return the number of basic MCS index.
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 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...
virtual uint8_t DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode)
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.
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.
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...
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_aggregation
Flag if MPDU aggregation is used by the remote station.
an EUI-48 address
Definition: mac48-address.h:43
WifiMode GetBasicMcs(uint32_t i) const
Return the MCS at the given list index.
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
ProtectionMode m_protectionMode
Protection mode for ERP stations when non-ERP stations are detected.
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:226
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports short guard interval.
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.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
virtual void SetupMac(Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
WifiMode GetNonErpBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
double GetFrameErrorRate() const
Return frame error rate (probability that frame is corrupted due to transmission error).
virtual uint32_t DoGetBlockAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
uint8_t GetNumberOfSupportedRxAntennas(const WifiRemoteStation *station) const
Return the number of receive antennas the station has.
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.
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.
virtual uint32_t DoGetCtsTxChannelWidth(Mac48Address address, WifiMode ctsMode)
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
bool m_htSupported
Flag if HT is supported by the station.
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
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.
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:40
A struct that holds information about each remote station.
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
virtual bool DoGetCtsTxStbc(Mac48Address address, WifiMode ctsMode)
uint32_t GetNMcsSupported(const WifiRemoteStation *station) const
Return the number of MCS supported by the given station.
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.
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
bool GetVhtSupported(const WifiRemoteStation *station) const
Return whether the given station is VHT capable.
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)
virtual bool DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode)
virtual void DoDispose(void)
Destructor implementation.
void(* PowerChangeTracedCallback)(uint8_t power, Mac48Address remoteAddress)
TracedCallback signature for power change events.
void ReportRxOk(Mac48Address address, const WifiMacHeader *header, double rxSnr, WifiMode txMode)
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
virtual bool DoGetBlockAckTxStbc(Mac48Address address, WifiMode blockAckMode)
bool NeedRtsRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
virtual uint8_t DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode)
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
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)
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 uint32_t DoGetAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
void SetProtectionMode(ProtectionMode mode)
Sets the protection mode.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
a unique identifier for an interface.
Definition: type-id.h:58
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.
uint32_t m_ness
Number of streams in beamforming of the remote station.
ProtectionMode GetProtectionMode(void) const
Return the protection mode.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state.
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.
bool GetHtSupported(const WifiRemoteStation *station) const
Return whether the given station is HT capable.
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.
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PLCP preamble or not.
std::vector< WifiRemoteStation * > Stations
A vector of WifiRemoteStations.