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 ());
322 state->m_shortPreamble = isShortPreambleSupported;
331 state->m_shortSlotTime = isShortSlotTimeSupported;
340 for (
WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
350 state->m_dsssSupported =
true;
354 state->m_erpOfdmSupported =
true;
358 state->m_ofdmSupported =
true;
360 state->m_operationalRateSet.push_back (mode);
369 state->m_operationalRateSet.clear ();
372 state->m_operationalRateSet.push_back (mode);
373 if (mode.IsMandatory ())
386 state->m_operationalMcsSet.clear ();
389 state->m_operationalMcsSet.push_back (mcs);
399 state->m_operationalMcsSet.clear ();
408 for (
WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
416 state->m_operationalMcsSet.push_back (mcs);
502 if (txVector.
IsMu ())
569 txVector.
SetBssColor (heConfiguration->GetBssColor ());
655 v.SetGuardInterval (ackTxGuardInterval);
671 v.SetGuardInterval (blockAckTxGuardInterval);
736 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
768 if (thismode.IsMandatory ()
769 && (!found || thismode.IsHigherDataRate (mode))
770 && (!thismode.IsHigherDataRate (reqMode))
784 if (thismode.IsMandatory ()
785 && (!found || thismode.IsHigherDataRate (mode))
786 && (!thismode.IsHigherCodeRate (reqMode))
812 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
831 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
848 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
854 station->m_state->m_info.NotifyTxSuccess (
m_ssrc[ac]);
863 NS_LOG_FUNCTION (
this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
871 station->m_state->m_info.NotifyTxSuccess (
m_slrc[ac]);
876 station->m_state->m_info.NotifyTxSuccess (
m_ssrc[ac]);
890 station->m_state->m_info.NotifyTxFailed ();
900 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
903 station->m_state->m_info.NotifyTxFailed ();
932 uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
933 double rxSnr,
double dataSnr,
WifiTxVector dataTxVector)
935 NS_LOG_FUNCTION (
this <<
address << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
937 for (uint8_t i = 0; i < nFailedMpdus; i++)
962 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
971 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
990 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
999 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
1009 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1020 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1025 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true");
1061 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1064 uint32_t retryCount, maxRetryCount;
1075 bool normally = retryCount < maxRetryCount;
1076 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRetransmission count: " << retryCount <<
" result: " << std::boolalpha << normally);
1084 if (mpdu->GetHeader ().GetAddr1 ().IsGroup ())
1089 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1097 if (threshold < 256)
1102 NS_LOG_WARN (
"Fragmentation threshold should be larger than 256. Setting to 256.");
1111 if (threshold % 2 != 0)
1113 NS_LOG_WARN (
"Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1141 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
1149 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1151 if (fragmentNumber >= nFragment)
1153 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning 0");
1157 if (fragmentNumber == nFragment - 1)
1160 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1161 return lastFragmentSize;
1167 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1168 return fragmentSize;
1176 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1179 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1180 return fragmentOffset;
1187 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
1189 NS_LOG_DEBUG (
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1213 if (station->m_state->m_address ==
address)
1215 if (station->m_rssiAndUpdateTimePair.second >= mostRecentUpdateTime)
1217 rssi = station->m_rssiAndUpdateTimePair.first;
1218 mostRecentUpdateTime = station->m_rssiAndUpdateTimePair.second;
1230 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1232 if ((*i)->m_address ==
address)
1234 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1255 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1265 if ((*i)->m_state->m_address ==
address)
1429 bool supported =
false;
1432 supported |= htCapabilities->GetLdpc ();
1434 if (vhtCapabilities)
1436 supported |= vhtCapabilities->GetRxLdpc ();
1440 supported |= heCapabilities->GetLdpcCodingInPayload ();
1461 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1483 NS_FATAL_ERROR (
"It is not allowed to add a HT rate in the BSSBasicRateSet!");
1597 uint32_t size,
bool normally)
1619 NS_LOG_DEBUG (
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1681 if (!htCapabilities)
1685 return htCapabilities->GetShortGuardInterval20 ();
1705 if (!htCapabilities)
1709 return htCapabilities->GetRxHighestSupportedAntennas ();
1792 if (!htCapabilities)
1796 return htCapabilities->GetShortGuardInterval20 ();
1804 if (!htCapabilities)
1808 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...
bool m_erpOfdmSupported
Flag if ERP OFDM is supported by the remote station.
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
enum ns3::WifiRemoteStationState::@77 m_state
State of the station.
#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
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the 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.
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 ...
bool m_ofdmSupported
Flag if OFDM is supported by the remote station.
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.
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
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.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
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.
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.
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)
Ptr< const HeCapabilities > GetStationHeCapabilities(Mac48Address from)
Return the HE capabilities sent by the remote station.
bool GetErpOfdmSupported(const Mac48Address &address) const
Return whether the station supports ERP OFDM or not.
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.
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
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...
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.
bool GetDsssSupported(const Mac48Address &address) const
Return whether the station supports DSSS or not.
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 GetOfdmSupported(const Mac48Address &address) const
Return whether the station supports OFDM or not.
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
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...
bool UseLdpcForDestination(Mac48Address dest) const
uint16_t GetAssociationId(void) const
Return the association ID.
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.
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...
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)
void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
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.
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.
bool m_dsssSupported
Flag if DSSS is supported by the remote station.
bool IsAssociated(void) const
Return whether we are associated with an AP.
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.