22 #include "ns3/boolean.h" 23 #include "ns3/uinteger.h" 25 #include "ns3/packet.h" 26 #include "ns3/simulator.h" 73 virtual void Print (std::ostream &os)
const;
84 : m_dataTxVector (dataTxVector)
97 static TypeId tid =
TypeId (
"ns3::HighLatencyDataTxVectorTag")
99 .SetGroupName (
"Wifi")
163 virtual void Print (std::ostream &os)
const;
174 : m_rtsTxVector (rtsTxVector)
187 static TypeId tid =
TypeId (
"ns3::HighLatencyRtsTxVectorTag")
189 .SetGroupName (
"Wifi")
252 virtual void Print (std::ostream &os)
const;
263 : m_ctsToSelfTxVector (ctsToSelfTxVector)
276 static TypeId tid =
TypeId (
"ns3::HighLatencyCtsToSelfTxVectorTag")
278 .SetGroupName (
"Wifi")
323 static TypeId tid =
TypeId (
"ns3::WifiRemoteStationManager")
325 .SetGroupName (
"Wifi")
326 .AddAttribute (
"IsLowLatency",
327 "If true, we attempt to modelize a so-called low-latency device: " 328 "a device where decisions about tx parameters can be made on a per-packet basis and " 329 "feedback about the transmission of each packet is obtained before sending the next. " 330 "Otherwise, we modelize a high-latency device, that is a device where we cannot update " 331 "our decision about tx parameters after every packet transmission.",
336 .AddAttribute (
"MaxSsrc",
337 "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. " 338 "This value will not have any effect on some rate control algorithms.",
341 MakeUintegerChecker<uint32_t> ())
342 .AddAttribute (
"MaxSlrc",
343 "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. " 344 "This value will not have any effect on some rate control algorithms.",
347 MakeUintegerChecker<uint32_t> ())
348 .AddAttribute (
"RtsCtsThreshold",
349 "If the size of the PSDU is bigger than this value, we use an RTS/CTS handshake before sending the data frame." 350 "This value will not have any effect on some rate control algorithms.",
353 MakeUintegerChecker<uint32_t> ())
354 .AddAttribute (
"FragmentationThreshold",
355 "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. " 356 "This value does not apply when it is carried in an A-MPDU. " 357 "This value will not have any effect on some rate control algorithms.",
361 MakeUintegerChecker<uint32_t> ())
362 .AddAttribute (
"NonUnicastMode",
363 "Wifi mode used for non-unicast transmissions.",
367 .AddAttribute (
"DefaultTxPowerLevel",
368 "Default power level to be used for transmissions. " 369 "This is the power level that is used by all those WifiManagers that do not implement TX power control.",
372 MakeUintegerChecker<uint8_t> ())
373 .AddAttribute (
"ErpProtectionMode",
374 "Protection mode used when non-ERP STAs are connected to an ERP AP: Rts-Cts or Cts-To-Self",
379 .AddAttribute (
"HtProtectionMode",
380 "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts or Cts-To-Self",
385 .AddTraceSource (
"MacTxRtsFailed",
386 "The transmission of a RTS by the MAC layer has failed",
388 "ns3::Mac48Address::TracedCallback")
389 .AddTraceSource (
"MacTxDataFailed",
390 "The transmission of a data packet by the MAC layer has failed",
392 "ns3::Mac48Address::TracedCallback")
393 .AddTraceSource (
"MacTxFinalRtsFailed",
394 "The transmission of a RTS has exceeded the maximum number of attempts",
396 "ns3::Mac48Address::TracedCallback")
397 .AddTraceSource (
"MacTxFinalDataFailed",
398 "The transmission of a data packet has exceeded the maximum number of attempts",
400 "ns3::Mac48Address::TracedCallback")
406 : m_htSupported (false),
407 m_vhtSupported (false),
408 m_heSupported (false),
409 m_pcfSupported (false),
410 m_useNonErpProtection (false),
411 m_useNonHtProtection (false),
412 m_useGreenfieldProtection (false),
413 m_shortPreambleEnabled (false),
414 m_shortSlotTimeEnabled (false),
415 m_rifsPermitted (false)
589 state->m_shortPreamble = isShortPreambleSupported;
598 state->m_shortSlotTime = isShortSlotTimeSupported;
607 for (
WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
615 state->m_operationalRateSet.push_back (mode);
624 state->m_operationalRateSet.clear ();
641 state->m_operationalMcsSet.clear ();
654 state->m_operationalMcsSet.clear ();
663 for (
WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
671 state->m_operationalMcsSet.push_back (mcs);
766 ConstCast<Packet> (packet)->RemovePacketTag (datatag);
767 ConstCast<Packet> (packet)->RemovePacketTag (rtstag);
768 ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag);
783 if (maxSupportedChannelWidth > 20
796 return maxSupportedChannelWidth;
822 found = ConstCast<Packet> (packet)->PeekPacketTag (datatag);
830 if (header->
IsMgt ())
859 found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag);
913 found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag);
956 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
961 station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
968 double ackSnr,
WifiMode ackMode,
double dataSnr,
977 station->m_state->m_info.NotifyTxSuccess (station->m_slrc);
982 station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
994 station->m_state->m_info.NotifyTxFailed ();
1007 station->m_state->m_info.NotifyTxFailed ();
1011 station->m_slrc = 0;
1015 station->m_ssrc = 0;
1036 uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
1037 double rxSnr,
double dataSnr)
1042 for (uint8_t i = 0; i < nFailedMpdus; i++)
1066 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
1075 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
1094 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
1103 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
1113 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1124 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1129 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true");
1182 uint32_t retryCount, maxRetryCount;
1185 retryCount = station->m_slrc;
1190 retryCount = station->m_ssrc;
1193 bool normally = retryCount < maxRetryCount;
1194 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedRetransmission count: " << retryCount <<
" result: " << std::boolalpha << normally);
1209 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
1217 if (threshold < 256)
1222 NS_LOG_WARN (
"Fragmentation threshold should be larger than 256. Setting to 256.");
1231 if (threshold % 2 != 0)
1233 NS_LOG_WARN (
"Fragmentation threshold should be an even number. Setting to " << threshold - 1);
1267 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
1278 if (fragmentNumber >= nFragment)
1280 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning 0");
1284 if (fragmentNumber == nFragment - 1)
1287 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1288 return lastFragmentSize;
1294 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1295 return fragmentSize;
1307 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1308 return fragmentOffset;
1317 bool isLast = fragmentNumber == (
GetNFragments (header, packet) - 1);
1318 NS_LOG_DEBUG (
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1325 switch (modClassReq)
1368 if ((!found || i->IsHigherDataRate (mode))
1369 && (!i->IsHigherDataRate (reqMode))
1386 if ((!found || i->IsHigherDataRate (mode))
1387 && (!i->IsHigherDataRate (reqMode))
1403 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1482 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1644 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1646 if ((*i)->m_address ==
address)
1648 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1671 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1696 if ((*i)->m_tid == tid
1697 && (*i)->m_state->m_address ==
address)
1706 station->
m_tid = tid;
1870 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1890 NS_FATAL_ERROR (
"It is not allowed to add a (V)HT rate in the BSSBasicRateSet!");
2026 NS_LOG_DEBUG (
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
2276 : m_memoryTime (
Seconds (1.0)),
2295 m_failAvg =
static_cast<double> (retryCounter) / (1 + retryCounter) * (1 - coefficient) + coefficient *
m_failAvg;
enum ns3::WifiRemoteStationState::@76 m_state
State of the station.
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
uint8_t GetGreenfield(void) const
Return the green field.
virtual void Deserialize(TagBuffer i)
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
virtual void Print(std::ostream &os) const
virtual uint8_t DoGetAckTxNss(Mac48Address address, WifiMode ackMode)
bool m_useNonHtProtection
flag if protection for non-HT stations against HT transmissions is enabled
uint32_t m_ssrc
STA short retry count.
bool GetRifsPermitted(void) const
Return whether the device can use RIFS.
bool m_shortPreamble
Flag if short PLCP preamble is supported by the remote station.
void Write(const uint8_t *buffer, uint32_t size)
uint8_t GetChannelWidthSet(void) const
Get channel width set.
bool m_vhtSupported
Flag if VHT capability is supported.
virtual uint8_t DoGetAckTxNess(Mac48Address address, WifiMode ackMode)
HighLatencyDataTxVectorTag class.
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
uint32_t GetNFragments(const WifiMacHeader *header, Ptr< const Packet > packet)
Return the number of fragments needed for the given packet.
Ptr< WifiMac > GetMac(void) const
Return the WifiMac.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
#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.
AttributeValue implementation for Boolean.
bool m_shortGuardInterval
Flag if HT/VHT short guard interval is supported by the remote station.
virtual uint16_t DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode)
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
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
#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 PLCP preamble or not.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked after calling ReportDataFailed if NeedRetransmission returns false.
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
bool m_vhtSupported
Flag if VHT is supported by the station.
bool GetShortGuardInterval(void) const
Return whether short guard interval is supported.
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
virtual void DoReportRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast DATA frames.
bool GetGreenfield(void) const
Return whether Greenfield is supported.
virtual uint8_t DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode)
uint8_t GetMaxNumberOfTransmitStreams(void)
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
Convert the guard interval to nanoseconds based on the wifimode.
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 > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
uint32_t m_nextFragmentationThreshold
Threshold for fragmentation that will be used for the next transmission.
bool Is2_4Ghz(double frequency)
void ReportDataOk(Mac48Address address, const WifiMacHeader *header, double ackSnr, WifiMode ackMode, double dataSnr, uint32_t packetSize)
Should be invoked whenever we receive the Ack associated to a data packet we just sent...
uint8_t GetTxStbc() const
Get the transmit STBC.
WifiTxVector GetCtsTxVector(Mac48Address address, WifiMode rtsMode)
virtual uint8_t DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode)
uint8_t m_streams
Number of supported streams by the remote station.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
virtual void Serialize(TagBuffer i) const
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.
WifiTxVector m_rtsTxVector
TXVECTOR for data frames.
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
uint8_t m_defaultTxPowerLevel
Default tranmission power level.
void SetStbc(bool stbc)
Sets if STBC is being used.
HighLatencyRtsTxVectorTag()
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.
HighLatencyDataTxVectorTag()
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
bool NeedRts(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, WifiTxVector txVector)
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
bool Is5Ghz(double frequency)
Time m_memoryTime
averaging coefficient depends on the memory time
virtual void SetPcfSupported(bool enable)
Enable or disable PCF capability support.
bool GetUseNonHtProtection(void) const
Return whether the device supports protection of non-HT stations.
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts...
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
bool GetUseGreenfieldProtection(void) const
Return whether protection for stations that do not support HT greenfield format is enabled...
WifiTxVector m_ctsToSelfTxVector
TXVECTOR for CTS-to-self frames.
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer) const
Return whether the modulation class of the selected mode for the control answer frame is allowed...
uint8_t GetNBasicMcs(void) const
Return the number of basic MCS index.
uint32_t GetNNonErpSupported(const WifiRemoteStation *station) const
Return the number of non-ERP modes supported by the given station.
bool GetGreenfieldSupported(Mac48Address address) const
Return whether the station supports Greenfield or not.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool m_shortPreambleEnabled
flag if short PLCP preamble is enabled
uint8_t GetSupportedChannelWidth(void) const
Return the supported channel width.
WifiTxVector GetRtsTxVector(void) const
virtual bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
bool GetStbc(void) const
Return whether STBC is supported.
Tid independent remote station statistics.
WifiRemoteStationState * m_state
Remote station state.
double m_failAvg
moving percentage of failed frames
WifiTxVector GetCtsToSelfTxVector(const WifiMacHeader *header, Ptr< const Packet > packet)
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.
uint8_t GetRxStbc() const
Get the receive STBC.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
uint16_t GetChannelWidth(void) const
The attribute can be read.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
WifiRemoteStationManager()
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
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 PLCP preambles.
static TypeId GetTypeId(void)
Get the type ID.
virtual void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
bool GetGreenfield(const WifiRemoteStation *station) const
Return whether the station supports Greenfield or not.
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
uint8_t GetRxHighestSupportedAntennas(void) const
Return the receive highest supported antennas.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
WifiTxVector GetDataTxVector(void) const
Time m_lastUpdate
when last update has occurred
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
bool m_qosSupported
Flag if HT 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...
double CalculateAveragingCoefficient()
Calculate averaging coefficient for frame error rate.
double GetFrameErrorRate() const
Return frame error rate (probability that frame is corrupted due to transmission error).
uint8_t GetNumberOfAntennas(void)
virtual uint16_t DoGetAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
WifiTxVector m_dataTxVector
TXVECTOR for data frames.
HighLatencyCtsToSelfTxVectorTag()
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)=0
This method is a pure virtual method that must be implemented by the sub-class.
void ReportRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
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)
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.
bool m_stbc
Flag if STBC is supported by the remote station.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htcapabilities)
Records HT capabilities of the remote station.
WifiRemoteStationInfo GetInfo(Mac48Address address)
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
WifiMode GetMode(void) const
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
bool m_pcfSupported
Flag if PCF capability is supported.
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
bool NeedRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
uint32_t GetNNonErpBasicModes(void) const
Return the number of non-ERP basic modes we support.
WifiMode GetNonErpBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes that is not an ERP mode.
void AddStationHeCapabilities(Mac48Address from, HeCapabilities hecapabilities)
Records HE capabilities of the remote station.
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
WifiMode GetControlAnswerMode(Mac48Address address, WifiMode reqMode)
Get control answer mode function.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
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 refer to IEEE 802.11n Table 20-28 for explanation and range.
virtual uint8_t DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode)
bool m_ldpc
Flag if LDPC is supported by the remote station.
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
virtual void SetHtSupported(bool enable)
Enable or disable HT capability support.
virtual uint8_t DoGetAckTxPowerLevel(Mac48Address address, WifiMode ackMode)
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
tag a set of bytes in a packet
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool GetShortSlotTimeEnabled(void) const
Return whether the device uses short slot time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
WifiTxVector DoGetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifiremote statio...
uint16_t GetFrequency(void) const
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...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
uint32_t GetFragmentSize(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool HasPcfSupported(void) const
Return whether the device has PCF capability support enabled.
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold...
bool IsHigherCodeRate(WifiMode mode) const
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
bool m_htSupported
Flag if HT capability is supported.
void SetUseNonErpProtection(bool enable)
Enable or disable protection for non-ERP stations.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
bool m_useGreenfieldProtection
flag if protection for stations that do not support HT greenfield format is enabled ...
virtual uint32_t GetSerializedSize(void) const
virtual ~WifiRemoteStation()
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 uint16_t DoGetBlockAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
virtual bool IsLowLatency(void) const =0
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...
uint8_t GetRxLdpc() const
Get the receive LDPC.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
Stations m_stations
Information for each known stations.
static Time Now(void)
Return the current simulation virtual time.
void ReportRtsOk(Mac48Address address, const WifiMacHeader *header, double ctsSnr, WifiMode ctsMode, double rtsSnr)
Should be invoked whenever we receive the Cts associated to an RTS we just sent.
bool m_heSupported
Flag if HE capability is supported.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
static TypeId GetTypeId(void)
Get the type ID.
virtual uint16_t DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode)
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.
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
virtual bool DoNeedRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint8_t GetHighestMcsSupported(void) const
Get highest MCS supported.
virtual void Print(std::ostream &os) const
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
void AddSupportedPlcpPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PLCP preamble is supported by the station.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual bool DoNeedFragmentation(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
bool NeedCtsToSelf(WifiTxVector txVector)
Return if we need to do Cts-to-self before sending a DATA.
virtual void Serialize(TagBuffer i) const
HighLatencyCtsToSelfTxVectorTag class.
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.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
static TypeId GetTypeId(void)
Get the type ID.
void SetUseNonHtProtection(bool enable)
Enable or disable protection for non-HT stations.
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
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...
virtual void Deserialize(TagBuffer i)
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
bool m_htSupported
Flag if HT is supported by the station.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
void ReportDataFailed(Mac48Address address, const WifiMacHeader *header, uint32_t packetSize)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
WifiTxVector GetDataTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
bool GetHtSupported(Mac48Address address) const
Return whether the station supports HT or not.
A struct that holds information about each remote station.
WifiModeList m_operationalMcsSet
operational MCS set
static TypeId GetTypeId(void)
Get the type ID.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
virtual uint32_t GetSerializedSize(void) const
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)
#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.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint8_t GetDefaultTxPowerLevel(void) const
uint8_t GetShortGuardInterval20(void) const
Return the short guard interval 20 value.
void ReportRxOk(Mac48Address address, const WifiMacHeader *header, double rxSnr, WifiMode txMode)
void SetUseGreenfieldProtection(bool enable)
Enable or disable protection for stations that do not support HT greenfield format.
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
virtual void Serialize(TagBuffer i) const
void SetNess(uint8_t ness)
Sets the Ness number refer to IEEE 802.11n Table 20-6 for explanation.
virtual uint16_t DoGetCtsTxChannelWidth(Mac48Address address, WifiMode ctsMode)
WifiRemoteStation * Lookup(Mac48Address address, uint8_t tid) const
Return the station associated with the given address and TID.
void Read(uint8_t *buffer, uint32_t size)
WifiTxVector GetCtsToSelfTxVector(void) const
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
virtual void SetHeSupported(bool enable)
Enable or disable HE capability support.
uint8_t m_ness
Number of streams in beamforming of the remote station.
static const uint32_t packetSize
bool m_shortSlotTime
Flag if short ERP slot time is supported by the remote station.
virtual uint8_t DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode)
void ReportAmpduTxStatus(Mac48Address address, uint8_t tid, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
WifiTxVector GetRtsTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
A base class which provides memory management and object aggregation.
AttributeValue implementation for WifiMode.
virtual void Deserialize(TagBuffer i)
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
virtual void DoReportAmpduTxStatus(WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
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 PLCP preambles.
bool IsSupportedMcs(uint8_t mcs, uint8_t Nss) const
Get the is MCS supported.
static 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 ...
WifiTxVector GetBlockAckTxVector(Mac48Address address, WifiMode dataMode)
virtual uint8_t DoGetCtsTxPowerLevel(Mac48Address address, WifiMode ctsMode)
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.
uint32_t m_slrc
STA long retry count.
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)=0
The IEEE 802.11ax HE Capabilities.
uint8_t GetMcsValue(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...
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 m_rifsPermitted
flag if RIFS is enabled
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRetransmission returns false.
bool IsHigherDataRate(WifiMode mode) const
WifiTxVector GetAckTxVector(Mac48Address address, WifiMode dataMode)
bool m_greenfield
Flag if greenfield is supported by the remote station.
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.
HighLatencyRtsTxVectorTag class.
virtual uint16_t DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode)
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.
bool m_heSupported
Flag if HE is supported by the station.
hold per-remote-station state.
void SetRifsPermitted(bool allow)
Permit or prohibit RIFS.
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.
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
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.
virtual uint8_t DoGetBlockAckTxPowerLevel(Mac48Address address, WifiMode blockAckMode)
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)=0
This method is a pure virtual method that must be implemented by the sub-class.
virtual uint32_t GetSerializedSize(void) const
virtual void Print(std::ostream &os) const
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.
Time GetGuardInterval(void) const