22 #include "ns3/boolean.h" 23 #include "ns3/uinteger.h" 25 #include "ns3/simulator.h" 32 #include "ns3/ht-configuration.h" 33 #include "ns3/ht-phy.h" 34 #include "ns3/vht-configuration.h" 35 #include "ns3/he-configuration.h" 47 static TypeId tid =
TypeId (
"ns3::WifiRemoteStationManager")
49 .SetGroupName (
"Wifi")
50 .AddAttribute (
"MaxSsrc",
51 "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. " 52 "This value will not have any effect on some rate control algorithms.",
55 MakeUintegerChecker<uint32_t> ())
56 .AddAttribute (
"MaxSlrc",
57 "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. " 58 "This value will not have any effect on some rate control algorithms.",
61 MakeUintegerChecker<uint32_t> ())
62 .AddAttribute (
"RtsCtsThreshold",
63 "If the size of the PSDU is bigger than this value, we use an RTS/CTS handshake before sending the data frame." 64 "This value will not have any effect on some rate control algorithms.",
67 MakeUintegerChecker<uint32_t> ())
68 .AddAttribute (
"FragmentationThreshold",
69 "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. " 70 "This value does not apply when it is carried in an A-MPDU. " 71 "This value will not have any effect on some rate control algorithms.",
75 MakeUintegerChecker<uint32_t> ())
76 .AddAttribute (
"NonUnicastMode",
77 "Wifi mode used for non-unicast transmissions.",
81 .AddAttribute (
"DefaultTxPowerLevel",
82 "Default power level to be used for transmissions. " 83 "This is the power level that is used by all those WifiManagers that do not implement TX power control.",
86 MakeUintegerChecker<uint8_t> ())
87 .AddAttribute (
"ErpProtectionMode",
88 "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",
93 .AddAttribute (
"HtProtectionMode",
94 "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts or Cts-To-Self",
99 .AddTraceSource (
"MacTxRtsFailed",
100 "The transmission of a RTS by the MAC layer has failed",
102 "ns3::Mac48Address::TracedCallback")
103 .AddTraceSource (
"MacTxDataFailed",
104 "The transmission of a data packet by the MAC layer has failed",
106 "ns3::Mac48Address::TracedCallback")
107 .AddTraceSource (
"MacTxFinalRtsFailed",
108 "The transmission of a RTS has exceeded the maximum number of attempts",
110 "ns3::Mac48Address::TracedCallback")
111 .AddTraceSource (
"MacTxFinalDataFailed",
112 "The transmission of a data packet has exceeded the maximum number of attempts",
114 "ns3::Mac48Address::TracedCallback")
120 : m_pcfSupported (false),
121 m_useNonErpProtection (false),
122 m_useNonHtProtection (false),
123 m_shortPreambleEnabled (false),
124 m_shortSlotTimeEnabled (false)
241 if (vhtConfiguration)
280 return htConfiguration->GetLdpcSupported ();
293 if (htConfiguration->GetShortGuardIntervalSupported ())
310 gi =
static_cast<uint16_t
>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
327 state->m_shortPreamble = isShortPreambleSupported;
336 state->m_shortSlotTime = isShortSlotTimeSupported;
345 for (
WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
353 state->m_operationalRateSet.push_back (mode);
362 state->m_operationalRateSet.clear ();
365 state->m_operationalRateSet.push_back (mode);
366 if (mode.IsMandatory ())
379 state->m_operationalMcsSet.clear ();
382 state->m_operationalMcsSet.push_back (mcs);
392 state->m_operationalMcsSet.clear ();
401 for (
WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
409 state->m_operationalMcsSet.push_back (mcs);
536 heConfiguration->GetAttribute (
"BssColor", bssColor);
704 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
736 if (thismode.IsMandatory ()
737 && (!found || thismode.IsHigherDataRate (mode))
738 && (!thismode.IsHigherDataRate (reqMode))
752 if (thismode.IsMandatory ()
753 && (!found || thismode.IsHigherDataRate (mode))
754 && (!thismode.IsHigherCodeRate (reqMode))
780 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
799 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
816 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
822 station->m_state->m_info.NotifyTxSuccess (
m_ssrc[ac]);
831 NS_LOG_FUNCTION (
this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
839 station->m_state->m_info.NotifyTxSuccess (
m_slrc[ac]);
844 station->m_state->m_info.NotifyTxSuccess (
m_ssrc[ac]);
857 station->m_state->m_info.NotifyTxFailed ();
867 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
870 station->m_state->m_info.NotifyTxFailed ();
899 uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
900 double rxSnr,
double dataSnr,
WifiTxVector dataTxVector)
902 NS_LOG_FUNCTION (
this <<
address << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
904 for (uint8_t i = 0; i < nFailedMpdus; i++)
929 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
938 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
957 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
966 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
976 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
987 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
992 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true");
1028 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1031 uint32_t retryCount, maxRetryCount;
1042 bool normally = retryCount < maxRetryCount;
1043 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRetransmission count: " << retryCount <<
" result: " << std::boolalpha << normally);
1051 if (mpdu->GetHeader ().GetAddr1 ().IsGroup ())
1056 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1064 if (threshold < 256)
1069 NS_LOG_WARN (
"Fragmentation threshold should be larger than 256. Setting to 256.");
1078 if (threshold % 2 != 0)
1080 NS_LOG_WARN (
"Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1108 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
1116 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1118 if (fragmentNumber >= nFragment)
1120 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning 0");
1124 if (fragmentNumber == nFragment - 1)
1127 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1128 return lastFragmentSize;
1134 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1135 return fragmentSize;
1143 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1146 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1147 return fragmentOffset;
1154 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1156 NS_LOG_DEBUG (
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1180 if (station->m_state->m_address ==
address)
1182 if (station->m_rssiAndUpdateTimePair.second >= mostRecentUpdateTime)
1184 rssi = station->m_rssiAndUpdateTimePair.first;
1185 mostRecentUpdateTime = station->m_rssiAndUpdateTimePair.second;
1197 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1199 if ((*i)->m_address ==
address)
1201 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1219 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1229 if ((*i)->m_state->m_address ==
address)
1393 bool supported =
false;
1396 supported |= htCapabilities->GetLdpc ();
1398 if (vhtCapabilities)
1400 supported |= vhtCapabilities->GetRxLdpc ();
1404 supported |= heCapabilities->GetLdpcCodingInPayload ();
1425 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1447 NS_FATAL_ERROR (
"It is not allowed to add a HT rate in the BSSBasicRateSet!");
1561 uint32_t size,
bool normally)
1583 NS_LOG_DEBUG (
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1645 if (!htCapabilities)
1649 return htCapabilities->GetShortGuardInterval20 ();
1669 if (!htCapabilities)
1673 return htCapabilities->GetRxHighestSupportedAntennas ();
1756 if (!htCapabilities)
1760 return htCapabilities->GetShortGuardInterval20 ();
1768 if (!htCapabilities)
1772 return htCapabilities->GetRxHighestSupportedAntennas ();
std::array< uint32_t, AC_BE_NQOS > m_ssrc
short retry count per AC
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
bool m_shortPreamble
Flag if short PHY preamble is supported by the remote station.
uint8_t GetChannelWidthSet(void) const
Get channel width set.
Simulation virtual time values and global simulation resolution.
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
Ptr< WifiMac > GetMac(void) const
Return the WifiMac.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
Ptr< HeConfiguration > GetHeConfiguration(void) const
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
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
uint8_t GetNumberOfAntennas(void) const
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...
std::array< uint32_t, AC_BE_NQOS > m_slrc
long retry count per AC
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
uint8_t GetMaxNumberOfTransmitStreams(void) const
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 SetBssColor(uint8_t color)
Set the BSS color.
WifiTxVector GetBlockAckTxVector(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the BlockAck frame given the destination and the mode of the Data used by the s...
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtCapabilities)
Records VHT capabilities of the remote station.
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
void ReportFinalDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
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...
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
uint8_t m_defaultTxPowerLevel
Default transmission power level.
void ReportDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
Mac48Address m_address
Mac48Address of the remote station.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
bool IsStrictlyPositive(void) const
Exactly equivalent to t > 0.
void SetPcfSupported(bool enable)
Enable or disable PCF capability support.
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
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.
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 GetFragmentationThreshold(void) const
Return the fragmentation threshold.
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
void ReportRtsFailed(const WifiMacHeader &header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
uint32_t GetNNonErpSupported(const WifiRemoteStation *station) const
Return the number of non-ERP modes supported by the given station.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
bool NeedFragmentation(Ptr< const WifiMacQueueItem > mpdu)
TID independent remote station statistics.
bool NeedRetransmission(Ptr< const WifiMacQueueItem > mpdu)
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.
WifiRemoteStationState * m_state
Remote station state.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
bool IsMandatory(void) const
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...
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...
uint16_t GetChannelWidth(void) const
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
enum ns3::WifiRemoteStationState::@74 m_state
State of the station.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
WifiRemoteStationManager()
WifiTxVector GetDataTxVector(const WifiMacHeader &header)
std::pair< double, Time > m_rssiAndUpdateTimePair
RSSI (in dBm) of the most recent packet received from the remote station along with update time...
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
RxSignalInfo structure containing info on the received signal.
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
bool GetLdpcSupported(void) const
Return whether the device has LDPC support enabled.
bool m_qosSupported
Flag if QoS is supported by the station.
Hold variables of type enum.
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
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.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
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.
bool GetPcfSupported(void) const
Return whether the device has PCF capability support enabled.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
The IEEE 802.11ac VHT Capabilities.
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
Hold an unsigned integer type.
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
WifiRemoteStationInfo GetInfo(Mac48Address address)
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
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...
void AddStationHeCapabilities(Mac48Address from, HeCapabilities heCapabilities)
Records HE capabilities of the remote station.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
bool m_pcfSupported
Flag if PCF capability is supported.
Ptr< const HeCapabilities > GetStationHeCapabilities(Mac48Address from)
Return the HE capabilities sent by the remote station.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
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...
uint32_t GetNNonErpBasicModes(void) const
Return the number of non-ERP basic modes we support.
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...
WifiTxVector GetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifi remote stati...
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
bool IsSupportedMcs(uint8_t mcs, uint8_t nss) const
Get the is MCS supported.
WifiMode GetNonErpBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
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.
WifiModulationClass GetModulationClass() const
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
Ptr< const HtCapabilities > GetStationHtCapabilities(Mac48Address from)
Return the HT capabilities sent by the remote station.
bool NeedRts(const WifiMacHeader &header, uint32_t size)
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
void SetQosSupport(Mac48Address from, bool qosSupported)
Records QoS support of the remote station.
WifiMode m_defaultTxMode
The default transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, WifiMode txMode)
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
WifiTxVector GetAckTxVector(Mac48Address to, WifiMode dataTxMode) const
Return a TXVECTOR for the Ack frame given the destination and the mode of the Data used by the sender...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsLastFragment(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
uint8_t GetNumberOfAntennas(void) const
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...
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold...
double GetMostRecentRssi(Mac48Address address) const
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
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 SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
uint32_t GetFragmentOffset(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
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.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of 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...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed...
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
Stations m_stations
Information for each known stations.
static Time Now(void)
Return the current simulation virtual time.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
void ReportFinalRtsFailed(const WifiMacHeader &header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do CTS-to-self before sending a DATA.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
uint8_t GetHeLtfAndGiForHePpdus(void) const
Get HE LTF and GI for HE PDPUs.
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).
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
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.
virtual ~WifiRemoteStationManager()
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
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. ...
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
double snr
SNR in linear scale.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
virtual void DoDispose(void)
Destructor implementation.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const VhtCapabilities > GetStationVhtCapabilities(Mac48Address from)
Return the VHT capabilities sent by the remote station.
uint8_t GetDefaultTxPowerLevel(void) const
WifiTxVector GetRtsTxVector(Mac48Address address)
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
void SetNess(uint8_t ness)
Sets the Ness number.
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
uint8_t m_ness
Number of extended spatial streams of the remote station.
uint16_t GetChannelWidth(void) const
bool UseLdpcForDestination(Mac48Address dest) const
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
A base class which provides memory management and object aggregation.
AttributeValue implementation for WifiMode.
StationStates m_states
States of known stations.
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
virtual bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally)
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
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
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
The IEEE 802.11ax HE Capabilities.
uint8_t GetMcsValue(void) const
Ptr< HtConfiguration > GetHtConfiguration(void) const
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t GetFragmentSize(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
a unique identifier for an interface.
bool IsHigherDataRate(WifiMode mode) const
WifiRemoteStation * Lookup(Mac48Address address) const
Return the station associated with the given address.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
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.
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.
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
uint16_t GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint8_t GetNess(const WifiRemoteStation *station) const
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.