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)
256 return htConfiguration->GetLdpcSupported ();
268 if (htConfiguration->GetShortGuardIntervalSupported ())
284 gi =
static_cast<uint16_t
>(heConfiguration->GetGuardInterval ().GetNanoSeconds ());
352 if (mode.IsMandatory ())
493 if (txVector.
IsMu ())
552 rxWidth < channelWidth)
554 channelWidth = rxWidth;
569 txVector.
SetBssColor (heConfiguration->GetBssColor ());
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)
863 NS_LOG_FUNCTION (
this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
900 NS_ASSERT (!mpdu->GetHeader ().GetAddr1 ().IsGroup ());
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);
1211 auto station = stationIt->second;
1212 auto rssi = station->m_rssiAndUpdateTimePair.first;
1213 auto ts = station->m_rssiAndUpdateTimePair.second;
1226 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1227 return stateIt->second;
1248 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1256 auto stationIt = m_stations.find (
address);
1258 if (stationIt != m_stations.end ())
1260 return stationIt->second;
1273 WifiRemoteStationManager::SetAssociationId (
Mac48Address remoteAddress, uint16_t aid)
1276 LookupState (remoteAddress)->m_aid = aid;
1280 WifiRemoteStationManager::SetQosSupport (
Mac48Address from,
bool qosSupported)
1284 state = LookupState (from);
1294 state = LookupState (from);
1303 SetQosSupport (from,
true);
1308 AddSupportedMcs (from, mcs);
1320 state = LookupState (from);
1335 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1341 AddSupportedMcs (from, mcs);
1354 state = LookupState (from);
1387 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1394 AddSupportedMcs (from, mcs);
1399 SetQosSupport (from,
true);
1405 return LookupState (from)->m_htCapabilities;
1411 return LookupState (from)->m_vhtCapabilities;
1417 return LookupState (from)->m_heCapabilities;
1426 bool supported =
false;
1429 supported |= htCapabilities->GetLdpc ();
1431 if (vhtCapabilities)
1433 supported |= vhtCapabilities->GetRxLdpc ();
1437 supported |= heCapabilities->GetLdpcCodingInPayload ();
1443 WifiRemoteStationManager::GetDefaultMode (
void)
const
1445 return m_defaultTxMode;
1449 WifiRemoteStationManager::GetDefaultMcs (
void)
const
1451 return m_defaultTxMcs;
1459 if (!GetHtSupported () || !GetHtSupported (st))
1461 return GetDefaultMode ();
1466 if (GetHeSupported () && GetHeSupported (st))
1470 else if (GetVhtSupported () && GetVhtSupported (st))
1476 return *m_wifiPhy->GetPhyEntity (modClass)->begin ();
1483 for (
auto& state : m_states)
1485 delete (state.second);
1488 for (
auto& state: m_stations)
1490 delete (state.second);
1492 m_stations.clear ();
1493 m_bssBasicRateSet.clear ();
1494 m_bssBasicMcsSet.clear ();
1505 NS_FATAL_ERROR (
"It is not allowed to add a HT rate in the BSSBasicRateSet!");
1507 for (uint8_t i = 0; i < GetNBasicModes (); i++)
1509 if (GetBasicMode (i) == mode)
1514 m_bssBasicRateSet.push_back (mode);
1518 WifiRemoteStationManager::GetNBasicModes (
void)
const
1520 return static_cast<uint8_t
> (m_bssBasicRateSet.size ());
1524 WifiRemoteStationManager::GetBasicMode (uint8_t i)
const
1527 return m_bssBasicRateSet[i];
1531 WifiRemoteStationManager::GetNNonErpBasicModes (
void)
const
1546 WifiRemoteStationManager::GetNonErpBasicMode (uint8_t i)
const
1548 NS_ASSERT (i < GetNNonErpBasicModes ());
1567 return m_bssBasicRateSet[index];
1574 for (uint8_t i = 0; i < GetNBasicMcs (); i++)
1576 if (GetBasicMcs (i) == mcs)
1581 m_bssBasicMcsSet.push_back (mcs);
1585 WifiRemoteStationManager::GetNBasicMcs (
void)
const
1587 return static_cast<uint8_t
> (m_bssBasicMcsSet.size ());
1591 WifiRemoteStationManager::GetBasicMcs (uint8_t i)
const
1594 return m_bssBasicMcsSet[i];
1598 WifiRemoteStationManager::GetNonUnicastMode (
void)
const
1600 if (m_nonUnicastMode ==
WifiMode ())
1602 if (GetNBasicModes () > 0)
1604 return GetBasicMode (0);
1608 return GetDefaultMode ();
1613 return m_nonUnicastMode;
1619 uint32_t size,
bool normally)
1639 WifiRemoteStationManager::DoReportAmpduTxStatus (
WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr,
double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
1641 NS_LOG_DEBUG (
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1647 NS_ASSERT (i < GetNSupported (station));
1654 NS_ASSERT (i < GetNMcsSupported (station));
1661 NS_ASSERT (i < GetNNonErpSupported (station));
1703 if (!htCapabilities)
1707 return htCapabilities->GetShortGuardInterval20 ();
1727 if (!htCapabilities)
1731 return htCapabilities->GetRxHighestSupportedAntennas ();
1741 WifiRemoteStationManager::GetPhy (
void)
const
1747 WifiRemoteStationManager::GetMac (
void)
const
1806 return LookupState (
address)->m_channelWidth;
1814 if (!htCapabilities)
1818 return htCapabilities->GetShortGuardInterval20 ();
1826 if (!htCapabilities)
1830 return htCapabilities->GetRxHighestSupportedAntennas ();
1836 return static_cast<uint8_t
> (LookupState (
address)->m_operationalMcsSet.size ());
1842 return (LookupState (
address)->m_dsssSupported);
1848 return (LookupState (
address)->m_erpOfdmSupported);
1854 return (LookupState (
address)->m_ofdmSupported);
1860 return (LookupState (
address)->m_htCapabilities != 0);
1866 return (LookupState (
address)->m_vhtCapabilities != 0);
1872 return (LookupState (
address)->m_heCapabilities != 0);
1876 WifiRemoteStationManager::SetDefaultTxPowerLevel (uint8_t txPower)
1878 m_defaultTxPowerLevel = txPower;
1882 WifiRemoteStationManager::GetNumberOfAntennas (
void)
const
1884 return m_wifiPhy->GetNumberOfAntennas ();
1888 WifiRemoteStationManager::GetMaxNumberOfTransmitStreams (
void)
const
1890 return m_wifiPhy->GetMaxSupportedTxSpatialStreams ();
1896 return (GetLdpcSupported () && GetLdpcSupported (dest));
Hold variables of type enum.
The IEEE 802.11ax HE Capabilities.
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
bool GetHeSuPpdu1xHeLtf800nsGi(void) const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t GetChannelWidthSet(void) const
Get channel width set.
uint8_t GetHighestNssSupported(void) const
Get highest NSS supported.
The HT Capabilities Information Element.
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
A base class which provides memory management and object aggregation.
static Time Now(void)
Return the current simulation virtual time.
uint16_t GetAssociationId(void) const
Return the association ID.
bool IsAssociated(void) const
Return whether we are associated with an AP.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
The IEEE 802.11ac VHT Capabilities.
bool IsSupportedMcs(uint8_t mcs, uint8_t nss) const
Get the is MCS supported.
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
represent a single transmission mode
uint8_t GetMcsValue(void) const
bool IsHigherDataRate(WifiMode mode) const
WifiModulationClass GetModulationClass() const
bool IsMandatory(void) const
AttributeValue implementation for WifiMode.
Ptr< HtConfiguration > GetHtConfiguration(void) const
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
Ptr< HeConfiguration > GetHeConfiguration(void) const
std::list< WifiMode > GetMcsList(void) const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
std::list< WifiMode > GetModeList(void) const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
uint16_t GetChannelWidth(void) const
TID independent remote station statistics.
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
hold a list of per-remote-station state.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
bool GetLdpcSupported(void) const
Return whether the device has LDPC support enabled.
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...
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
uint32_t m_fragmentationThreshold
Current threshold for fragmentation.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
bool NeedFragmentation(Ptr< const WifiMacQueueItem > mpdu)
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
std::array< uint32_t, AC_BE_NQOS > m_slrc
long retry count per AC
WifiRemoteStation * Lookup(Mac48Address address) const
Return the station associated with the given address.
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
bool UseLdpcForDestination(Mac48Address dest) const
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
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...
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
virtual bool DoNeedRts(WifiRemoteStation *station, uint32_t size, bool normally)
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold.
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation 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 GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
virtual void DoReportDataFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
bool NeedRts(const WifiMacHeader &header, uint32_t size)
virtual void DoDispose(void)
Destructor implementation.
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
uint32_t GetFragmentSize(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
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...
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.
uint32_t GetFragmentOffset(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
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 GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
WifiModeList m_bssBasicMcsSet
basic MCS set
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts.
void ReportDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
WifiTxVector GetDataTxVector(const WifiMacHeader &header)
void ReportRxOk(Mac48Address address, RxSignalInfo rxSignalInfo, WifiTxVector txVector)
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
uint8_t m_defaultTxPowerLevel
Default transmission power level.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast Data frames.
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
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.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
WifiRemoteStationManager()
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...
double GetMostRecentRssi(Mac48Address address) const
uint32_t GetNFragments(Ptr< const WifiMacQueueItem > mpdu)
Return the number of fragments needed for the given packet.
WifiRemoteStationInfo GetInfo(Mac48Address address)
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
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...
std::array< uint32_t, AC_BE_NQOS > m_ssrc
short retry count per AC
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
void ReportFinalRtsFailed(const WifiMacHeader &header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
StationStates m_states
States of known stations.
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do CTS-to-self before sending a DATA.
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.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetDefaultTxPowerLevel(void) const
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
WifiMode GetBasicMcs(uint8_t i) const
Return the MCS at the given list index.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
void ReportFinalDataFailed(Ptr< const WifiMacQueueItem > mpdu)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
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...
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
WifiTxVector GetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifi remote stati...
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...
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
Stations m_stations
Information for each known stations.
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)=0
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
uint16_t GetChannelWidthSupported(Mac48Address address) const
Return the channel width supported by the station.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
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...
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
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.
void Reset(void)
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
void ReportRtsFailed(const WifiMacHeader &header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
WifiMode m_defaultTxMode
The default transmission mode.
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.
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
virtual ~WifiRemoteStationManager()
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
bool NeedRetransmission(Ptr< const WifiMacQueueItem > mpdu)
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
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...
bool IsLastFragment(Ptr< const WifiMacQueueItem > mpdu, uint32_t fragmentNumber)
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
WifiTxVector GetRtsTxVector(Mac48Address address)
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_useNonErpProtection
flag if protection for non-ERP stations against ERP transmissions is enabled
WifiMode GetControlAnswerMode(WifiMode reqMode) const
Get control answer mode function.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
uint8_t GetNumberOfAntennas(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetNess(uint8_t ness)
Sets the Ness number.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
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.
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.
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
void SetBssColor(uint8_t color)
Set the BSS color.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint16_t GetChannelWidth(void) const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxAllowedChannelWidth)
Return the channel width that is allowed based on the selected mode and the given maximum channel wid...
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
RxSignalInfo structure containing info on the received signal.
double snr
SNR in linear scale.
hold per-remote-station state.
WifiRemoteStationState * m_state
Remote station state.
std::pair< double, Time > m_rssiAndUpdateTimePair
RSSI (in dBm) of the most recent packet received from the remote station along with update time.
A struct that holds information about each remote station.
Mac48Address m_address
Mac48Address of the remote station.
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
bool m_dsssSupported
Flag if DSSS is supported by the remote station.
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
uint16_t m_aid
AID of the remote station (unused if this object is installed on a non-AP station)
bool m_ofdmSupported
Flag if OFDM is supported by the remote station.
enum ns3::WifiRemoteStationState::@78 m_state
State of the station.
uint8_t m_ness
Number of extended spatial streams of the remote station.
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
bool m_qosSupported
Flag if QoS is supported by the station.
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
WifiModeList m_operationalMcsSet
operational MCS set
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
bool m_shortPreamble
Flag if short PHY preamble is supported by the remote station.
bool m_erpOfdmSupported
Flag if ERP OFDM is supported by the remote station.
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
WifiRemoteStationInfo m_info
remote station info
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities