|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/boolean.h"
23 #include "ns3/uinteger.h"
25 #include "ns3/simulator.h"
33 #include "ns3/ht-configuration.h"
34 #include "ns3/ht-phy.h"
35 #include "ns3/vht-configuration.h"
36 #include "ns3/he-configuration.h"
48 static TypeId tid =
TypeId (
"ns3::WifiRemoteStationManager")
50 .SetGroupName (
"Wifi")
51 .AddAttribute (
"MaxSsrc",
52 "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. "
53 "This value will not have any effect on some rate control algorithms.",
56 MakeUintegerChecker<uint32_t> ())
57 .AddAttribute (
"MaxSlrc",
58 "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. "
59 "This value will not have any effect on some rate control algorithms.",
62 MakeUintegerChecker<uint32_t> ())
63 .AddAttribute (
"RtsCtsThreshold",
64 "If the size of the PSDU is bigger than this value, we use an RTS/CTS handshake before sending the data frame."
65 "This value will not have any effect on some rate control algorithms.",
68 MakeUintegerChecker<uint32_t> ())
69 .AddAttribute (
"FragmentationThreshold",
70 "If the size of the PSDU is bigger than this value, we fragment it such that the size of the fragments are equal or smaller. "
71 "This value does not apply when it is carried in an A-MPDU. "
72 "This value will not have any effect on some rate control algorithms.",
76 MakeUintegerChecker<uint32_t> ())
77 .AddAttribute (
"NonUnicastMode",
78 "Wifi mode used for non-unicast transmissions.",
82 .AddAttribute (
"DefaultTxPowerLevel",
83 "Default power level to be used for transmissions. "
84 "This is the power level that is used by all those WifiManagers that do not implement TX power control.",
87 MakeUintegerChecker<uint8_t> ())
88 .AddAttribute (
"ErpProtectionMode",
89 "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",
94 .AddAttribute (
"HtProtectionMode",
95 "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts or Cts-To-Self",
100 .AddTraceSource (
"MacTxRtsFailed",
101 "The transmission of a RTS by the MAC layer has failed",
103 "ns3::Mac48Address::TracedCallback")
104 .AddTraceSource (
"MacTxDataFailed",
105 "The transmission of a data packet by the MAC layer has failed",
107 "ns3::Mac48Address::TracedCallback")
108 .AddTraceSource (
"MacTxFinalRtsFailed",
109 "The transmission of a RTS has exceeded the maximum number of attempts",
111 "ns3::Mac48Address::TracedCallback")
112 .AddTraceSource (
"MacTxFinalDataFailed",
113 "The transmission of a data packet has exceeded the maximum number of attempts",
115 "ns3::Mac48Address::TracedCallback")
121 : m_useNonErpProtection (false),
122 m_useNonHtProtection (false),
123 m_shortPreambleEnabled (false),
124 m_shortSlotTimeEnabled (false)
248 if (vhtConfiguration)
275 return htConfiguration->GetLdpcSupported ();
288 if (htConfiguration->GetShortGuardIntervalSupported ())
305 gi =
static_cast<uint16_t
>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
373 if (mode.IsMandatory ())
514 if (txVector.
IsMu ())
581 txVector.
SetBssColor (heConfiguration->GetBssColor ());
748 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
780 if (thismode.IsMandatory ()
781 && (!found || thismode.IsHigherDataRate (mode))
782 && (!thismode.IsHigherDataRate (reqMode))
796 if (thismode.IsMandatory ()
797 && (!found || thismode.IsHigherDataRate (mode))
798 && (!thismode.IsHigherCodeRate (reqMode))
824 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
843 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
860 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
875 NS_LOG_FUNCTION (
this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
912 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
944 uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
945 double rxSnr,
double dataSnr,
WifiTxVector dataTxVector)
947 NS_LOG_FUNCTION (
this <<
address << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
949 for (uint8_t i = 0; i < nFailedMpdus; i++)
974 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
983 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
1002 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
1011 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
1021 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1032 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1037 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true");
1073 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1076 uint32_t retryCount, maxRetryCount;
1087 bool normally = retryCount < maxRetryCount;
1088 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRetransmission count: " << retryCount <<
" result: " << std::boolalpha << normally);
1096 if (mpdu->GetHeader ().GetAddr1 ().IsGroup ())
1101 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1109 if (threshold < 256)
1114 NS_LOG_WARN (
"Fragmentation threshold should be larger than 256. Setting to 256.");
1123 if (threshold % 2 != 0)
1125 NS_LOG_WARN (
"Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1153 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
1161 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1163 if (fragmentNumber >= nFragment)
1165 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning 0");
1169 if (fragmentNumber == nFragment - 1)
1172 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1173 return lastFragmentSize;
1179 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1180 return fragmentSize;
1188 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1191 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1192 return fragmentOffset;
1199 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1201 NS_LOG_DEBUG (
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1223 auto station = stationIt->second;
1224 auto rssi = station->m_rssiAndUpdateTimePair.first;
1225 auto ts = station->m_rssiAndUpdateTimePair.second;
1238 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1239 return stateIt->second;
1260 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1268 auto stationIt = m_stations.find (
address);
1270 if (stationIt != m_stations.end ())
1272 return stationIt->second;
1285 WifiRemoteStationManager::SetAssociationId (
Mac48Address remoteAddress, uint16_t aid)
1288 LookupState (remoteAddress)->m_aid = aid;
1292 WifiRemoteStationManager::SetQosSupport (
Mac48Address from,
bool qosSupported)
1296 state = LookupState (from);
1306 state = LookupState (from);
1315 SetQosSupport (from,
true);
1320 AddSupportedMcs (from, mcs);
1332 state = LookupState (from);
1347 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1353 AddSupportedMcs (from, mcs);
1366 state = LookupState (from);
1402 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1409 AddSupportedMcs (from, mcs);
1414 SetQosSupport (from,
true);
1420 return LookupState (from)->m_htCapabilities;
1426 return LookupState (from)->m_vhtCapabilities;
1432 return LookupState (from)->m_heCapabilities;
1441 bool supported =
false;
1444 supported |= htCapabilities->GetLdpc ();
1446 if (vhtCapabilities)
1448 supported |= vhtCapabilities->GetRxLdpc ();
1452 supported |= heCapabilities->GetLdpcCodingInPayload ();
1458 WifiRemoteStationManager::GetDefaultMode (
void)
const
1460 return m_defaultTxMode;
1464 WifiRemoteStationManager::GetDefaultMcs (
void)
const
1466 return m_defaultTxMcs;
1473 for (
auto& state : m_states)
1475 delete (state.second);
1478 for (
auto& state: m_stations)
1480 delete (state.second);
1482 m_stations.clear ();
1483 m_bssBasicRateSet.clear ();
1484 m_bssBasicMcsSet.clear ();
1495 NS_FATAL_ERROR (
"It is not allowed to add a HT rate in the BSSBasicRateSet!");
1497 for (uint8_t i = 0; i < GetNBasicModes (); i++)
1499 if (GetBasicMode (i) == mode)
1504 m_bssBasicRateSet.push_back (mode);
1508 WifiRemoteStationManager::GetNBasicModes (
void)
const
1510 return static_cast<uint8_t
> (m_bssBasicRateSet.size ());
1514 WifiRemoteStationManager::GetBasicMode (uint8_t i)
const
1517 return m_bssBasicRateSet[i];
1521 WifiRemoteStationManager::GetNNonErpBasicModes (
void)
const
1536 WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i)
const
1538 NS_ASSERT (i < GetNNonErpBasicModes ());
1557 return m_bssBasicRateSet[index];
1564 for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1566 if (GetBasicMcs (i) == mcs)
1571 m_bssBasicMcsSet.push_back (mcs);
1575 WifiRemoteStationManager::GetNBasicMcs (
void)
const
1577 return static_cast<uint8_t
> (m_bssBasicMcsSet.size ());
1581 WifiRemoteStationManager::GetBasicMcs (uint8_t i)
const
1584 return m_bssBasicMcsSet[i];
1588 WifiRemoteStationManager::GetNonUnicastMode (
void)
const
1590 if (m_nonUnicastMode ==
WifiMode ())
1592 if (GetNBasicModes () > 0)
1594 return GetBasicMode (0);
1598 return GetDefaultMode ();
1603 return m_nonUnicastMode;
1609 uint32_t size,
bool normally)
1629 WifiRemoteStationManager::DoReportAmpduTxStatus (
WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr,
double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
1631 NS_LOG_DEBUG (
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1637 NS_ASSERT (i < GetNSupported (station));
1644 NS_ASSERT (i < GetNMcsSupported (station));
1651 NS_ASSERT (i < GetNNonErpSupported (station));
1693 if (!htCapabilities)
1697 return htCapabilities->GetShortGuardInterval20 ();
1717 if (!htCapabilities)
1721 return htCapabilities->GetRxHighestSupportedAntennas ();
1731 WifiRemoteStationManager::GetPhy (
void)
const
1737 WifiRemoteStationManager::GetMac (
void)
const
1796 return LookupState (
address)->m_channelWidth;
1804 if (!htCapabilities)
1808 return htCapabilities->GetShortGuardInterval20 ();
1816 if (!htCapabilities)
1820 return htCapabilities->GetRxHighestSupportedAntennas ();
1826 return static_cast<uint8_t
> (LookupState (
address)->m_operationalMcsSet.size ());
1832 return (LookupState (
address)->m_dsssSupported);
1838 return (LookupState (
address)->m_erpOfdmSupported);
1844 return (LookupState (
address)->m_ofdmSupported);
1850 return (LookupState (
address)->m_htCapabilities != 0);
1856 return (LookupState (
address)->m_vhtCapabilities != 0);
1862 return (LookupState (
address)->m_heCapabilities != 0);
1866 WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower)
1868 m_defaultTxPowerLevel = txPower;
1872 WifiRemoteStationManager::GetNumberOfAntennas (
void)
const
1874 return m_wifiPhy->GetNumberOfAntennas ();
1878 WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (
void)
const
1880 return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1886 return (GetLdpcSupported () && GetLdpcSupported (dest));
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
a unique identifier for an interface.
uint8_t GetDefaultTxPowerLevel(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
The IEEE 802.11ac VHT Capabilities.
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
Ptr< HtConfiguration > GetHtConfiguration(void) const
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
uint16_t m_aid
AID of the remote station (unused if this object is installed on a non-AP station)
void ReportAmpduTxStatus(Mac48Address address, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, WifiTxVector dataTxVector)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
bool IsMandatory(void) const
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
WifiRemoteStation * Lookup(Mac48Address address) const
Return the station associated with the given address.
bool IsHigherDataRate(WifiMode mode) const
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
bool UseLdpcForDestination(Mac48Address dest) const
WifiTxVector GetBlockAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void ReportRtsFailed(const WifiMacHeader &header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
bool NeedFragmentation(Ptr< const WifiMacQueueItem > mpdu)
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
std::array< uint32_t, AC_BE_NQOS > m_ssrc
short retry count per AC
WifiModulationClass GetModulationClass() const
The IEEE 802.11ax HE Capabilities.
void SetNss(uint8_t nss)
Sets the number of Nss.
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
hold a list of per-remote-station state.
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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 ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
enum ns3::WifiRemoteStationState::@0 m_state
State of the station.
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...
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
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_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
Hold variables of type enum.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Ptr< HeConfiguration > GetHeConfiguration(void) const
uint32_t GetNFragments(Ptr< const WifiMacQueueItem > mpdu)
Return the number of fragments needed for the given packet.
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
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...
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
WifiModeList m_operationalMcsSet
operational MCS set
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold.
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.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
std::array< uint32_t, AC_BE_NQOS > m_slrc
long retry count per AC
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
represent a single transmission mode
void SetNess(uint8_t ness)
Sets the Ness number.
bool NeedRts(const WifiMacHeader &header, uint32_t size)
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
Stations m_stations
Information for each known stations.
WifiMode m_defaultTxMode
The default transmission mode.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
A base class which provides memory management and object aggregation.
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
void Reset(void)
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
The HT Capabilities Information Element.
uint8_t GetChannelWidthSet(void) const
Get channel width set.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
uint8_t m_ness
Number of extended spatial streams of the remote station.
uint8_t m_defaultTxPowerLevel
Default transmission power level.
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
void ReportRtsOk(const WifiMacHeader &header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the CTS associated to an RTS we just sent.
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do CTS-to-self before sending a DATA.
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
bool m_ofdmSupported
Flag if OFDM is supported by the remote station.
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
uint16_t GetStaId(Mac48Address address, const WifiTxVector &txVector) const
If the given TXVECTOR is used for a MU transmission, return the STAID of the station with the given a...
WifiRemoteStationManager()
uint32_t GetFragmentOffset(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
static TypeId GetTypeId(void)
Get the type ID.
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 ...
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
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...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
bool GetLdpcSupported(void) const
Return whether the device has LDPC support enabled.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
uint16_t GetChannelWidth(void) const
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
bool IsLastFragment(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
WifiTxVector GetDataTxVector(const WifiMacHeader &header)
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
bool m_qosSupported
Flag if QoS is supported by the station.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
bool m_shortPreamble
Flag if short PHY preamble is supported by the remote station.
WifiTxVector GetAckTxVector(Mac48Address to, const WifiTxVector &dataTxVector) const
Return a TXVECTOR for the Ack frame given the destination and the mode of the Data used by the sender...
hold per-remote-station state.
void ReportDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
virtual ~WifiRemoteStationManager()
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
double snr
SNR in linear scale.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
WifiRemoteStationInfo m_info
remote station info
bool m_dsssSupported
Flag if DSSS is supported by the remote station.
uint8_t GetNumberOfAntennas(void) const
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
uint32_t GetFragmentSize(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
RxSignalInfo structure containing info on the received signal.
WifiRemoteStationState * m_state
Remote station state.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
bool IsAssociated(void) const
Return whether we are associated with an AP.
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
uint16_t GetChannelWidth(void) const
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
bool IsSupportedMcs(uint8_t mcs, uint8_t nss) const
Get the is MCS supported.
virtual bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally)
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
A struct that holds information about each remote station.
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
bool NeedRetransmission(Ptr< const WifiMacQueueItem > mpdu)
bool m_erpOfdmSupported
Flag if ERP OFDM is supported by the remote station.
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
StationStates m_states
States of known stations.
double GetMostRecentRssi(Mac48Address address) const
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast Data frames.
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiRemoteStationInfo GetInfo(Mac48Address address)
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Hold an unsigned integer type.
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
void ReportDataOk(Ptr< const WifiMacQueueItem > mpdu, double ackSnr, WifiMode ackMode, double dataSnr, WifiTxVector dataTxVector)
Should be invoked whenever we receive the ACK associated to a data packet we just sent.
WifiModeList m_bssBasicMcsSet
basic MCS set
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
Mac48Address m_address
Mac48Address of the remote station.
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
std::pair< double, Time > m_rssiAndUpdateTimePair
RSSI (in dBm) of the most recent packet received from the remote station along with update time.
void ReportFinalRtsFailed(const WifiMacHeader &header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
void SetBssColor(uint8_t color)
Set the BSS color.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
WifiTxVector GetRtsTxVector(Mac48Address address)
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
uint8_t GetHeLtfAndGiForHePpdus(void) const
Get HE LTF and GI for HE PDPUs.
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...
TID independent remote station statistics.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
void ReportFinalDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
uint16_t GetAssociationId(void) const
Return the association ID.
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
WifiTxVector GetCtsTxVector(Mac48Address to, WifiMode rtsTxMode) const
Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS used by the sender.
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
AttributeValue implementation for WifiMode.
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
uint8_t GetMcsValue(void) const
virtual void DoDispose(void)
Destructor implementation.
WifiTxVector GetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifi remote stati...