23 #include "ns3/simulator.h"
24 #include "ns3/assert.h"
27 #include "ns3/boolean.h"
28 #include "ns3/double.h"
29 #include "ns3/uinteger.h"
30 #include "ns3/wifi-phy.h"
31 #include "ns3/wifi-mac.h"
32 #include "ns3/trace-source-accessor.h"
59 virtual void Print (std::ostream &os)
const;
69 : m_dataTxVector (dataTxVector)
82 static TypeId tid =
TypeId (
"ns3::HighLatencyDataTxVectorTag")
84 .SetGroupName (
"Wifi")
136 virtual void Print (std::ostream &os)
const;
146 : m_rtsTxVector (rtsTxVector)
159 static TypeId tid =
TypeId (
"ns3::HighLatencyRtsTxVectorTag")
161 .SetGroupName (
"Wifi")
212 virtual void Print (std::ostream &os)
const;
222 : m_ctsToSelfTxVector (ctsToSelfTxVector)
235 static TypeId tid =
TypeId (
"ns3::HighLatencyCtsToSelfTxVectorTag")
237 .SetGroupName (
"Wifi")
282 static TypeId tid =
TypeId (
"ns3::WifiRemoteStationManager")
284 .SetGroupName (
"Wifi")
285 .AddAttribute (
"IsLowLatency",
"If true, we attempt to modelize a so-called low-latency device: a device"
286 " where decisions about tx parameters can be made on a per-packet basis and feedback about the"
287 " transmission of each packet is obtained before sending the next. Otherwise, we modelize a "
288 " high-latency device, that is a device where we cannot update our decision about tx parameters"
289 " after every packet transmission.",
293 .AddAttribute (
"MaxSsrc",
"The maximum number of retransmission attempts for an RTS. This value"
294 " will not have any effect on some rate control algorithms.",
297 MakeUintegerChecker<uint32_t> ())
298 .AddAttribute (
"MaxSlrc",
"The maximum number of retransmission attempts for a DATA packet. This value"
299 " will not have any effect on some rate control algorithms.",
302 MakeUintegerChecker<uint32_t> ())
303 .AddAttribute (
"RtsCtsThreshold",
"If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than "
304 "this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2012, Section 9.3.5. "
305 "This value will not have any effect on some rate control algorithms.",
308 MakeUintegerChecker<uint32_t> ())
309 .AddAttribute (
"FragmentationThreshold",
"If the size of the data packet + LLC header + MAC header + FCS trailer is bigger"
310 "than this value, we fragment it such that the size of the fragments are equal or smaller "
311 "than this value, as per IEEE Std. 802.11-2012, Section 9.5. "
312 "This value will not have any effect on some rate control algorithms.",
316 MakeUintegerChecker<uint32_t> ())
317 .AddAttribute (
"NonUnicastMode",
"Wifi mode used for non-unicast transmissions.",
321 .AddAttribute (
"DefaultTxPowerLevel",
"Default power level to be used for transmissions. "
322 "This is the power level that is used by all those WifiManagers that do not"
323 "implement TX power control.",
326 MakeUintegerChecker<uint8_t> ())
327 .AddTraceSource (
"MacTxRtsFailed",
328 "The transmission of a RTS by the MAC layer has failed",
330 "ns3::Mac48Address::TracedCallback")
331 .AddTraceSource (
"MacTxDataFailed",
332 "The transmission of a data packet by the MAC layer has failed",
334 "ns3::Mac48Address::TracedCallback")
335 .AddTraceSource (
"MacTxFinalRtsFailed",
336 "The transmission of a RTS has exceeded the maximum number of attempts",
338 "ns3::Mac48Address::TracedCallback")
339 .AddTraceSource (
"MacTxFinalDataFailed",
340 "The transmission of a data packet has exceeded the maximum number of attempts",
342 "ns3::Mac48Address::TracedCallback")
348 : m_htSupported (false),
349 m_vhtSupported (false)
360 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
476 state->m_operationalRateSet.clear ();
477 state->m_operationalMcsSet.clear ();
488 for (
WifiModeListIterator i = state->m_operationalRateSet.begin (); i != state->m_operationalRateSet.end (); i++)
496 state->m_operationalRateSet.push_back (mode);
504 state->m_operationalRateSet.clear ();
517 for (
WifiModeListIterator i = state->m_operationalMcsSet.begin (); i != state->m_operationalMcsSet.end (); i++)
525 state->m_operationalMcsSet.push_back (mcs);
590 NS_LOG_FUNCTION (
this << address << *header << packet << fullPacketSize);
603 ConstCast<Packet> (packet)->RemovePacketTag (datatag);
604 ConstCast<Packet> (packet)->RemovePacketTag (rtstag);
605 ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag);
619 NS_LOG_FUNCTION (
this << address << *header << packet << fullPacketSize);
636 found = ConstCast<Packet> (packet)->PeekPacketTag (datatag);
655 found = ConstCast<Packet> (packet)->PeekPacketTag (ctstoselftag);
689 found = ConstCast<Packet> (packet)->PeekPacketTag (rtstag);
723 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
725 NS_LOG_FUNCTION (
this << address << *header << ctsSnr << ctsMode << rtsSnr);
728 station->m_state->m_info.NotifyTxSuccess (station->m_ssrc);
735 double ackSnr,
WifiMode ackMode,
double dataSnr)
737 NS_LOG_FUNCTION (
this << address << *header << ackSnr << ackMode << dataSnr);
740 station->m_state->m_info.NotifyTxSuccess (station->m_slrc);
751 station->m_state->m_info.NotifyTxFailed ();
763 station->m_state->m_info.NotifyTxFailed ();
805 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
816 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning false");
821 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedCtsToSelf returning true");
832 bool normally = station->m_ssrc <
GetMaxSsrc ();
833 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_ssrc <<
" result: " << std::boolalpha << normally);
844 bool normally = station->m_slrc <
GetMaxSlrc ();
845 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_slrc <<
" result: " << std::boolalpha << normally);
860 NS_LOG_DEBUG (
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha << normally);
873 NS_LOG_WARN (
"Fragmentation threshold should be larger than 256. Setting to 256.");
882 if (threshold % 2 != 0)
884 NS_LOG_WARN (
"Fragmentation threshold should be an even number. Setting to " << threshold - 1);
918 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
926 NS_LOG_FUNCTION (
this << address << *header << packet << fragmentNumber);
929 if (fragmentNumber >= nFragment)
931 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning 0");
935 if (fragmentNumber == nFragment - 1)
938 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
939 return lastFragmentSize;
945 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
954 NS_LOG_FUNCTION (
this << address << *header << packet << fragmentNumber);
958 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
959 return fragmentOffset;
966 NS_LOG_FUNCTION (
this << address << *header << packet << fragmentNumber);
968 bool isLast = fragmentNumber == (
GetNFragments (header, packet) - 1);
969 NS_LOG_DEBUG (
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1034 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1118 NS_LOG_DEBUG (
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1292 for (StationStates::const_iterator i =
m_states.begin (); i !=
m_states.end (); i++)
1294 if ((*i)->m_address == address)
1296 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning existing state");
1314 NS_LOG_DEBUG (
"WifiRemoteStationManager::LookupState returning new state");
1330 return Lookup (address, tid);
1339 if ((*i)->m_tid == tid
1340 && (*i)->m_state->m_address == address)
1349 station->
m_tid = tid;
1438 NS_FATAL_ERROR (
"It is not allowed to add a (V)HT rate in the BSSBasicRateSet!");
1642 : m_memoryTime (
Seconds (1.0)),
1661 m_failAvg = (double)retryCounter / (1 + (
double)retryCounter) * (1.0 - coefficient) + coefficient *
m_failAvg;
virtual void Deserialize(TagBuffer i)
virtual uint8_t DoGetAckTxNss(Mac48Address address, WifiMode ackMode)
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
uint32_t m_ssrc
STA short retry count.
virtual uint32_t GetNumberOfTransmitAntennas(void) const =0
void Write(const uint8_t *buffer, uint32_t size)
bool m_vhtSupported
Flag if VHT capability is supported.
virtual uint8_t DoGetAckTxNess(Mac48Address address, WifiMode ackMode)
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.
void SetDefaultTxPowerLevel(uint8_t txPower)
Set the default transmission power level.
void SetShortGuardInterval(bool guardinterval)
Sets if short gurad interval is being used.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual void Print(std::ostream &os) const
WifiTxVector GetRtsTxVector(void) const
bool GetGreenfieldSupported(Mac48Address address) const
Return whether the station supports Greenfield or not.
AttributeValue implementation for Boolean.
bool m_shortGuardInterval
Flag if short guard interval is supported by the remote station.
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 NeedDataRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint8_t GetSupportedChannelWidthSet() const
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.
void ReportDataFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
enum ns3::WifiRemoteStationState::@95 m_state
State of the station.
virtual uint8_t DoGetBlockAckTxNss(Mac48Address address, WifiMode blockAckMode)
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.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
uint32_t GetMaxSsrc(void) const
Return the maximum STA short retry count (SSRC).
enum WifiModulationClass GetModulationClass() const
virtual uint8_t GetNMcs(void) const =0
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
virtual bool DoGetAckTxGuardInterval(Mac48Address address, WifiMode ackMode)
WifiTxVector GetDataTxVector(void) const
WifiTxVector GetCtsTxVector(Mac48Address address, WifiMode rtsMode)
virtual uint8_t DoGetBlockAckTxNess(Mac48Address address, WifiMode blockAckMode)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
WifiMode GetNonUnicastMode(void) const
Return a mode for non-unicast packets.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
#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
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.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
HighLatencyRtsTxVectorTag()
bool GetGreenfield(const WifiRemoteStation *station) const
Return whether the station supports Greenfield or not.
Mac48Address m_address
Mac48Address of the remote station.
HighLatencyDataTxVectorTag()
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
uint8_t GetSupportedChannelWidth(void) const
void UpdateFragmentationThreshold(void)
Typically called to update the fragmentation threshold at the start of a new transmission.
Time m_memoryTime
averaging coefficient depends on the memory time
bool IsLastFragment(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint32_t i) const
Return the WifiMode supported by the specified station at the specified index.
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts...
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
virtual void Serialize(TagBuffer i) const
WifiTxVector m_ctsToSelfTxVector
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool IsMandatory(void) const
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
virtual bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
uint32_t GetNumberOfReceiveAntennas(const WifiRemoteStation *station) const
Return the number of receive antennas the station has.
Tid independent remote station statistics.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
WifiRemoteStationState * LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
WifiRemoteStationState * m_state
Remote station state.
virtual WifiMode GetMcs(uint8_t mcs) const =0
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
void SetChannelWidth(uint32_t channelWidth)
Sets the selected channelWidth (in MHz)
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.
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...
WifiRemoteStationManager()
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
uint64_t GetPhyRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
bool GetStbc(const WifiRemoteStation *station) const
Return whether the given station supports space-time block coding (STBC).
virtual bool DoNeedDataRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
static TypeId GetTypeId(void)
virtual uint32_t GetChannelWidth(void) const =0
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
virtual bool DoGetAckTxStbc(Mac48Address address, WifiMode ackMode)
virtual bool GetStbc(void) const =0
WifiTxVector GetCtsToSelfTxVector(void) const
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)=0
Time m_lastUpdate
when last update has occured
void ReportFinalDataFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportDataFailed if NeedDataRetransmission returns false...
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
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.
WifiRemoteStation * Lookup(Mac48Address address, uint8_t tid) const
Return the station associated with the given address and TID.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
double CalculateAveragingCoefficient()
Calculate averaging coefficient for frame error rate.
virtual bool DoGetCtsTxGuardInterval(Mac48Address address, WifiMode ctsMode)
uint8_t GetGreenfield(void) const
WifiTxVector m_dataTxVector
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.
The IEEE 802.11ac VHT Capabilities.
virtual bool DoNeedRtsRetransmission(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
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.
bool m_stbc
Flag if STBC is used by the remote station.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
uint32_t GetFragmentationThreshold(void) const
Return the fragmentation threshold.
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).
uint32_t GetRtsCtsThreshold(void) const
Return the RTS threshold.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
uint8_t GetMcsValue(void) const
uint8_t GetShortGuardInterval20(void) const
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
uint32_t DoGetFragmentationThreshold(void) const
Return the current fragmentation threshold.
virtual bool GetGuardInterval(void) const =0
uint32_t m_channelWidth
Channel width (in MHz) supported by the remote station.
hold a list of per-remote-station state.
virtual void Print(std::ostream &os) const
WifiMode GetControlAnswerMode(Mac48Address address, WifiMode reqMode)
uint32_t GetNBasicMcs(void) const
Return the number of basic MCS index.
uint32_t m_tx
Number of TX antennas of the remote station.
WifiMode m_defaultTxMode
The default transmission mode.
uint32_t GetNess(const WifiRemoteStation *station) const
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
WifiMode GetDefaultMcs(void) const
Return the default Modulation and Coding Scheme (MCS) index.
virtual uint8_t DoGetCtsTxNss(Mac48Address address, WifiMode ctsMode)
WifiModeList m_bssBasicRateSet
This member is the list of WifiMode objects that comprise the BSSBasicRateSet parameter.
void ReportDataOk(Mac48Address address, const WifiMacHeader *header, double ackSnr, WifiMode ackMode, double dataSnr)
Should be invoked whenever we receive the Ack associated to a data packet we just sent...
void SetHtSupported(bool enable)
Enable or disable HT capability support.
virtual uint8_t DoGetAckTxPowerLevel(Mac48Address address, WifiMode ackMode)
tag a set of bytes in a packet
uint32_t GetFragmentOffset(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fragmentNumber)
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void PrepareForQueue(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fullPacketSize)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiTxVector DoGetCtsToSelfTxVector(void)
Since CTS-to-self parameters are not dependent on the station, it is implemented in wifiremote statio...
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)
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold...
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
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.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
virtual ~WifiRemoteStation()
virtual uint32_t GetSerializedSize(void) const
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
WifiMode GetBasicMcs(uint32_t i) const
Return the MCS at the given list index.
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
virtual bool IsLowLatency(void) const =0
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
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...
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports short guard interval.
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.
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
static TypeId GetTypeId(void)
uint32_t m_rx
Number of RX antennas of the remote station.
virtual void SetupMac(Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
double GetFrameErrorRate() const
Return frame error rate (probability that frame is corrupted due to transmission error).
virtual uint32_t DoGetBlockAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
virtual void Serialize(TagBuffer i) const
void AddBasicMcs(WifiMode mcs)
Add a given Modulation and Coding Scheme (MCS) index to the set of basic MCS.
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
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 uint32_t GetSerializedSize(void) const
static TypeId GetTypeId(void)
uint8_t GetDefaultTxPowerLevel(void) const
virtual uint32_t DoGetCtsTxChannelWidth(Mac48Address address, WifiMode ctsMode)
virtual void Deserialize(TagBuffer i)
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
A struct that holds information about each remote station.
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
WifiModeList m_operationalMcsSet
static TypeId GetTypeId(void)
virtual bool DoGetCtsTxStbc(Mac48Address address, WifiMode ctsMode)
uint32_t GetNMcsSupported(const WifiRemoteStation *station) const
Return the number of MCS supported by the given station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
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. ...
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
virtual bool DoGetBlockAckTxGuardInterval(Mac48Address address, WifiMode blockAckMode)
virtual void Serialize(TagBuffer i) const
#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.
WifiTxVector GetDataTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet, uint32_t fullPacketSize)
void ReportRxOk(Mac48Address address, const WifiMacHeader *header, double rxSnr, WifiMode txMode)
bool NeedFragmentation(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
void SetNess(uint8_t ness)
Sets the Ness number refer to IEEE 802.11n Table 20-6 for explanation.
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
void Read(uint8_t *buffer, uint32_t size)
virtual bool DoGetBlockAckTxStbc(Mac48Address address, WifiMode blockAckMode)
bool NeedRtsRetransmission(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
uint32_t GetNumberOfTransmitAntennas(void)
virtual uint8_t DoGetCtsTxNess(Mac48Address address, WifiMode ctsMode)
WifiTxVector GetRtsTxVector(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
A base class which provides memory management and object aggregation.
virtual uint32_t GetSerializedSize(void) const
AttributeValue implementation for WifiMode.
virtual void Deserialize(TagBuffer i)
StationStates m_states
States of known stations.
WifiMode GetMode(void) const
bool NeedRts(Mac48Address address, const WifiMacHeader *header, Ptr< const Packet > packet)
WifiTxVector GetBlockAckTxVector(Mac48Address address, WifiMode dataMode)
virtual uint8_t DoGetCtsTxPowerLevel(Mac48Address address, WifiMode ctsMode)
virtual void Print(std::ostream &os) const
uint32_t GetMaxSlrc(void) const
Return the maximum STA long retry count (SLRC).
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 uint32_t DoGetAckTxChannelWidth(Mac48Address address, WifiMode ctsMode)
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
a unique identifier for an interface.
void ReportFinalRtsFailed(Mac48Address address, const WifiMacHeader *header)
Should be invoked after calling ReportRtsFailed if NeedRtsRetransmission returns false.
WifiTxVector GetAckTxVector(Mac48Address address, WifiMode dataMode)
bool m_greenfield
Flag if green field is used by the remote station.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint32_t m_ness
Number of streams in beamforming of the remote station.
WifiRemoteStationInfo m_info
WifiModeList m_bssBasicMcsSet
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)=0
This method is a pure virtual method that must be implemented by the sub-class.
virtual bool GetGreenfield(void) const =0
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.
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtcapabilities)
Records VHT capabilities of the remote station.
virtual uint8_t DoGetBlockAckTxPowerLevel(Mac48Address address, WifiMode blockAckMode)
Ptr< WifiMac > GetMac(void) const
Return the WifiMac.
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.