22 #include "ns3/pointer.h"
23 #include "ns3/packet.h"
33 #include "ns3/ht-configuration.h"
34 #include "ns3/vht-configuration.h"
35 #include "ns3/he-configuration.h"
36 #include "ns3/he-frame-exchange-manager.h"
46 : m_qosSupported (false),
47 m_erpSupported (false),
48 m_dsssSupported (false)
70 .SetGroupName (
"Wifi")
71 .AddAttribute (
"Ssid",
"The ssid we want to belong to.",
76 .AddAttribute (
"QosSupported",
77 "This Boolean attribute is set to enable 802.11e/WMM-style QoS support at this STA.",
83 .AddAttribute (
"CtsToSelfSupported",
84 "Use CTS to Self when using a rate that is not in the basic rate set.",
88 .AddAttribute (
"ShortSlotTimeSupported",
89 "Whether or not short slot time is supported (only used by ERP APs or STAs).",
94 .AddAttribute (
"Txop",
98 MakePointerChecker<Txop> ())
99 .AddAttribute (
"VO_Txop",
100 "Queue that manages packets belonging to AC_VO access class.",
103 MakePointerChecker<QosTxop> ())
104 .AddAttribute (
"VI_Txop",
105 "Queue that manages packets belonging to AC_VI access class.",
108 MakePointerChecker<QosTxop> ())
109 .AddAttribute (
"BE_Txop",
110 "Queue that manages packets belonging to AC_BE access class.",
113 MakePointerChecker<QosTxop> ())
114 .AddAttribute (
"BK_Txop",
115 "Queue that manages packets belonging to AC_BK access class.",
118 MakePointerChecker<QosTxop> ())
119 .AddAttribute (
"VO_MaxAmsduSize",
120 "Maximum length in bytes of an A-MSDU for AC_VO access class "
121 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
122 "Value 0 means A-MSDU aggregation is disabled for that AC.",
125 MakeUintegerChecker<uint16_t> (0, 11398))
126 .AddAttribute (
"VI_MaxAmsduSize",
127 "Maximum length in bytes of an A-MSDU for AC_VI access class "
128 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
129 "Value 0 means A-MSDU aggregation is disabled for that AC.",
132 MakeUintegerChecker<uint16_t> (0, 11398))
133 .AddAttribute (
"BE_MaxAmsduSize",
134 "Maximum length in bytes of an A-MSDU for AC_BE access class "
135 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
136 "Value 0 means A-MSDU aggregation is disabled for that AC.",
139 MakeUintegerChecker<uint16_t> (0, 11398))
140 .AddAttribute (
"BK_MaxAmsduSize",
141 "Maximum length in bytes of an A-MSDU for AC_BK access class "
142 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE PPDUs). "
143 "Value 0 means A-MSDU aggregation is disabled for that AC.",
146 MakeUintegerChecker<uint16_t> (0, 11398))
147 .AddAttribute (
"VO_MaxAmpduSize",
148 "Maximum length in bytes of an A-MPDU for AC_VO access class "
149 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
150 "Value 0 means A-MPDU aggregation is disabled for that AC.",
153 MakeUintegerChecker<uint32_t> (0, 6500631))
154 .AddAttribute (
"VI_MaxAmpduSize",
155 "Maximum length in bytes of an A-MPDU for AC_VI access class "
156 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
157 "Value 0 means A-MPDU aggregation is disabled for that AC.",
160 MakeUintegerChecker<uint32_t> (0, 6500631))
161 .AddAttribute (
"BE_MaxAmpduSize",
162 "Maximum length in bytes of an A-MPDU for AC_BE access class "
163 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
164 "Value 0 means A-MPDU aggregation is disabled for that AC.",
167 MakeUintegerChecker<uint32_t> (0, 6500631))
168 .AddAttribute (
"BK_MaxAmpduSize",
169 "Maximum length in bytes of an A-MPDU for AC_BK access class "
170 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, and 6500631 for HE PPDUs). "
171 "Value 0 means A-MPDU aggregation is disabled for that AC.",
174 MakeUintegerChecker<uint32_t> (0, 6500631))
175 .AddAttribute (
"VO_BlockAckThreshold",
176 "If number of packets in VO queue reaches this value, "
177 "block ack mechanism is used. If this value is 0, block ack is never used."
178 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
181 MakeUintegerChecker<uint8_t> (0, 64))
182 .AddAttribute (
"VI_BlockAckThreshold",
183 "If number of packets in VI queue reaches this value, "
184 "block ack mechanism is used. If this value is 0, block ack is never used."
185 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
188 MakeUintegerChecker<uint8_t> (0, 64))
189 .AddAttribute (
"BE_BlockAckThreshold",
190 "If number of packets in BE queue reaches this value, "
191 "block ack mechanism is used. If this value is 0, block ack is never used."
192 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
195 MakeUintegerChecker<uint8_t> (0, 64))
196 .AddAttribute (
"BK_BlockAckThreshold",
197 "If number of packets in BK queue reaches this value, "
198 "block ack mechanism is used. If this value is 0, block ack is never used."
199 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
202 MakeUintegerChecker<uint8_t> (0, 64))
203 .AddAttribute (
"VO_BlockAckInactivityTimeout",
204 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
205 "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
206 "block ack setup is completed and will be reset every time that a block ack"
207 "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
210 MakeUintegerChecker<uint16_t> ())
211 .AddAttribute (
"VI_BlockAckInactivityTimeout",
212 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
213 "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
214 "block ack setup is completed and will be reset every time that a block ack"
215 "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
218 MakeUintegerChecker<uint16_t> ())
219 .AddAttribute (
"BE_BlockAckInactivityTimeout",
220 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
221 "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
222 "block ack setup is completed and will be reset every time that a block ack"
223 "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
226 MakeUintegerChecker<uint16_t> ())
227 .AddAttribute (
"BK_BlockAckInactivityTimeout",
228 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
229 "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
230 "block ack setup is completed and will be reset every time that a block ack"
231 "frame is received. If this value is 0, block ack inactivity timeout won't be used.",
234 MakeUintegerChecker<uint16_t> ())
235 .AddTraceSource (
"MacTx",
236 "A packet has been received from higher layers and is being processed in preparation for "
237 "queueing for transmission.",
239 "ns3::Packet::TracedCallback")
240 .AddTraceSource (
"MacTxDrop",
241 "A packet has been dropped in the MAC layer before being queued for transmission. "
242 "This trace source is fired, e.g., when an AP's MAC receives from the upper layer "
243 "a packet destined to a station that is not associated with the AP or a STA's MAC "
244 "receives a packet from the upper layer while it is not associated with any AP.",
246 "ns3::Packet::TracedCallback")
247 .AddTraceSource (
"MacPromiscRx",
248 "A packet has been received by this device, has been passed up from the physical layer "
249 "and is being forwarded up the local protocol stack. This is a promiscuous trace.",
251 "ns3::Packet::TracedCallback")
252 .AddTraceSource (
"MacRx",
253 "A packet has been received by this device, has been passed up from the physical layer "
254 "and is being forwarded up the local protocol stack. This is a non-promiscuous trace.",
256 "ns3::Packet::TracedCallback")
257 .AddTraceSource (
"MacRxDrop",
258 "A packet has been dropped in the MAC layer after it has been passed up from the physical layer.",
260 "ns3::Packet::TracedCallback")
261 .AddTraceSource (
"TxOkHeader",
262 "The header of successfully transmitted packet.",
264 "ns3::WifiMacHeader::TracedCallback",
266 "Use the AckedMpdu trace instead.")
267 .AddTraceSource (
"TxErrHeader",
268 "The header of unsuccessfully transmitted packet.",
270 "ns3::WifiMacHeader::TracedCallback",
272 "Depending on the failure type, use the NAckedMpdu trace, the "
273 "DroppedMpdu trace or one of the traces associated with TX timeouts.")
274 .AddTraceSource (
"AckedMpdu",
275 "An MPDU that was successfully acknowledged, via either a "
276 "Normal Ack or a Block Ack.",
278 "ns3::WifiMacQueueItem::TracedCallback")
279 .AddTraceSource (
"NAckedMpdu",
280 "An MPDU that was negatively acknowledged via a Block Ack.",
282 "ns3::WifiMacQueueItem::TracedCallback")
283 .AddTraceSource (
"DroppedMpdu",
284 "An MPDU that was dropped for the given reason (see WifiMacDropReason).",
286 "ns3::WifiMac::DroppedMpduCallback")
287 .AddTraceSource (
"MpduResponseTimeout",
288 "An MPDU whose response was not received before the timeout, along with "
289 "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
290 "TXVECTOR used to transmit the MPDU. This trace source is fired when a "
291 "CTS is missing after an RTS or a Normal Ack is missing after an MPDU "
292 "or after a DL MU PPDU acknowledged in SU format.",
294 "ns3::WifiMac::MpduResponseTimeoutCallback")
295 .AddTraceSource (
"PsduResponseTimeout",
296 "A PSDU whose response was not received before the timeout, along with "
297 "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
298 "TXVECTOR used to transmit the PSDU. This trace source is fired when a "
299 "BlockAck is missing after an A-MPDU, a BlockAckReq (possibly in the "
300 "context of the acknowledgment of a DL MU PPDU in SU format) or a TB PPDU "
301 "(in the latter case the missing BlockAck is a Multi-STA BlockAck).",
303 "ns3::WifiMac::PsduResponseTimeoutCallback")
304 .AddTraceSource (
"PsduMapResponseTimeout",
305 "A PSDU map for which not all the responses were received before the timeout, "
306 "along with an identifier of the type of timeout (see WifiTxTimer::Reason), "
307 "the set of MAC addresses of the stations that did not respond and the total "
308 "number of stations that had to respond. This trace source is fired when not "
309 "all the addressed stations responded to an MU-BAR Trigger frame (either sent as "
310 "a SU frame or aggregated to PSDUs in the DL MU PPDU), a Basic Trigger Frame or "
311 "a BSRP Trigger Frame.",
313 "ns3::WifiMac::PsduMapResponseTimeoutCallback")
329 for (
auto it =
m_edca.begin (); it !=
m_edca.end (); ++it)
331 it->second->Initialize ();
352 for (
auto it =
m_edca.begin (); it !=
m_edca.end (); ++it)
461 const auto it = std::find_if (
m_edca.cbegin (),
m_edca.cend (),
462 [ac](
const auto& pair){ return pair.first == ac; });
463 return (it ==
m_edca.cend () ?
nullptr : it->second);
568 m_edca.insert (std::make_pair (ac, edca));
583 for (
auto it =
m_edca.begin (); it!=
m_edca.end (); ++it)
585 ConfigureDcf (it->second, cwMin, cwMax, isDsssOnly, it->first);
597 dcf->
SetMinCw ((cwmin + 1) / 4 - 1);
598 dcf->
SetMaxCw ((cwmin + 1) / 2 - 1);
610 dcf->
SetMinCw ((cwmin + 1) / 2 - 1);
699 m_feManager = CreateObject<HeFrameExchangeManager> ();
703 m_feManager = CreateObject<VhtFrameExchangeManager> ();
707 m_feManager = CreateObject<HtFrameExchangeManager> ();
711 m_feManager = CreateObject<QosFrameExchangeManager> ();
715 m_feManager = CreateObject<FrameExchangeManager> ();
723 m_feManager->GetWifiTxTimer ().SetMpduResponseTimeoutCallback (
MakeCallback (&MpduResponseTimeoutTracedCallback::operator(),
725 m_feManager->GetWifiTxTimer ().SetPsduResponseTimeoutCallback (
MakeCallback (&PsduResponseTimeoutTracedCallback::operator(),
727 m_feManager->GetWifiTxTimer ().SetPsduMapResponseTimeoutCallback (
MakeCallback (&PsduMapResponseTimeoutTracedCallback::operator(),
736 for (
const auto& pair :
m_edca)
738 pair.second->SetQosFrameExchangeManager (DynamicCast<QosFrameExchangeManager> (
m_feManager));
768 "PHY operating channel must have been set");
802 m_txop = CreateObject<Txop> ();
912 <<
") does not support Enqueue() with from address");
970 htFem->SendAddBaResponse (&reqHdr, from);
987 auto htFem = DynamicCast<HtFrameExchangeManager> (
m_feManager);
1010 htFem->DestroyBlockAckAgreement (from, delBaHdr.
GetTid ());
1024 NS_FATAL_ERROR (
"Unsupported Action field in Block Ack Action frame");
1041 ForwardUp (msduPair.first, msduPair.second.GetSourceAddr (),
1042 msduPair.second.GetDestinationAddr ());
1182 return capabilities;
1193 bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
1195 capabilities.
SetLdpc (htConfiguration->GetLdpcSupported ());
1202 if (maxAmsduSize <= 3839)
1213 maxAmpduLength = (1ul <<
static_cast<uint32_t
> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
1218 uint64_t maxSupportedRate = 0;
1222 uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
1224 uint64_t dataRate = mcs.GetDataRate (
GetWifiPhy ()->GetChannelWidth (), sgiSupported ? 400 : 800, nss);
1225 if (dataRate > maxSupportedRate)
1227 maxSupportedRate = dataRate;
1228 NS_LOG_DEBUG (
"Updating maxSupportedRate to " << maxSupportedRate);
1238 return capabilities;
1250 bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported ();
1252 if (
GetWifiPhy ()->GetChannelWidth () == 160)
1263 if (maxAmsduSize <= 3839)
1267 else if (maxAmsduSize <= 7935)
1278 maxAmpduLength = (1ul <<
static_cast<uint32_t
> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
1282 capabilities.
SetRxLdpc (htConfiguration->GetLdpcSupported ());
1288 if (mcs.GetMcsValue () > maxMcs)
1290 maxMcs = mcs.GetMcsValue ();
1302 uint64_t maxSupportedRateLGI = 0;
1305 if (!mcs.IsAllowed (
GetWifiPhy ()->GetChannelWidth (), 1))
1309 if (mcs.GetDataRate (
GetWifiPhy ()->GetChannelWidth ()) > maxSupportedRateLGI)
1312 NS_LOG_DEBUG (
"Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
1321 return capabilities;
1334 uint8_t channelWidthSet = 0;
1337 channelWidthSet |= 0x01;
1341 channelWidthSet |= 0x02;
1345 channelWidthSet |= 0x04;
1349 if (heConfiguration->GetGuardInterval () ==
NanoSeconds (800))
1360 maxAmpduLength = (1ul <<
static_cast<uint32_t
> (std::ceil (std::log2 (maxAmpduLength + 1)))) - 1;
1367 if (mcs.GetMcsValue () > maxMcs)
1369 maxMcs = mcs.GetMcsValue ();
1375 return capabilities;
1381 uint32_t maxSize = 0;
1406 uint16_t maxSize = 0;
AttributeValue implementation for Boolean.
The Extended Capabilities Information Element.
void SetHtSupported(uint8_t htSupported)
Set the HT Supported flag.
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT Supported flag.
The IEEE 802.11ax HE Capabilities.
void SetHeSuPpdu1xHeLtf800nsGi(bool heSuPpdu1xHeLtf800nsGi)
Set 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
void SetHePpdu4xHeLtf800nsGi(bool heSuPpdu4xHeLtf800nsGi)
Set 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
void SetHeSupported(uint8_t heSupported)
Set HE supported.
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
The HT Capabilities Information Element.
void SetLdpc(uint8_t ldpc)
Set the LDPC field.
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
void SetLSigProtectionSupport(uint8_t lSigProtection)
Set the LSIG protection support.
void SetMaxAmsduLength(uint16_t maxAmsduLength)
Set the maximum AMSDU length.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum N spatial streams.
void SetShortGuardInterval20(uint8_t shortGuardInterval)
Set the short guard interval 20 field.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
void SetHtSupported(uint8_t htSupported)
Set the HT supported field.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
void SetSupportedChannelWidth(uint8_t supportedChannelWidth)
Set the supported channel width field.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetShortGuardInterval40(uint8_t shortGuardInterval)
Set the short guard interval 40 field.
void SendDelbaFrame(Mac48Address addr, uint8_t tid, bool byOriginator)
Sends DELBA frame to cancel a block ack agreement with STA addressed by addr for TID tid.
A base class which provides memory management and object aggregation.
bool IsInitialized(void) const
Check if the object has been initialized.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
void Dispose(void)
Dispose of this Object.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
Hold objects of type Ptr<T>.
void SetDroppedMpduCallback(DroppedMpdu callback) override
Ptr< BlockAckManager > GetBaManager(void)
Get the Block Ack Manager associated with this QosTxop.
void GotAddBaResponse(const MgtAddBaResponseHeader *respHdr, Mac48Address recipient)
Event handler when an ADDBA response is received.
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ack mechanism.
void GotDelBaFrame(const MgtDelBaHeader *delBaHdr, Mac48Address recipient)
Event handler when a DELBA frame is received.
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
void SetTxopLimit(Time txopLimit)
Set the TXOP limit.
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
void SetChannelAccessManager(const Ptr< ChannelAccessManager > manager)
Set ChannelAccessManager this Txop is associated to.
a unique identifier for an interface.
@ ATTR_GET
The attribute can be read.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
Hold an unsigned integer type.
The IEEE 802.11ac VHT Capabilities.
void SetRxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the receive highest supported LGI data rate.
void SetSupportedChannelWidthSet(uint8_t channelWidthSet)
Set the supported channel width set.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
void SetRxLdpc(uint8_t rxLdpc)
Set the receive LDPC.
void SetTxStbc(uint8_t txStbc)
Set the transmit STBC.
void SetTxMcsMap(uint8_t mcs, uint8_t nss)
void SetShortGuardIntervalFor80Mhz(uint8_t shortGuardInterval)
Set the short guard interval 80 MHz.
void SetTxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the transmit highest supported LGI data rate.
void SetShortGuardIntervalFor160Mhz(uint8_t shortGuardInterval)
Set the short guard interval 160 MHz.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetRxMcsMap(uint8_t mcs, uint8_t nss)
void SetRxStbc(uint8_t rxStbc)
Set the receive STBC.
void SetVhtSupported(uint8_t vhtSupported)
Set the VHT supported field.
uint16_t GetMaxAmsduSize(AcIndex ac) const
Return the maximum A-MSDU size of the given Access Category.
Ptr< HtConfiguration > GetHtConfiguration(void) const
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
bool m_shortSlotTimeSupported
flag whether short slot time is supported
ExtendedCapabilities GetExtendedCapabilities(void) const
Return the extended capabilities of the device.
Ptr< FrameExchangeManager > GetFrameExchangeManager(void) const
Get the Frame Exchange Manager.
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
void SetErpSupported(bool enable)
Enable or disable ERP support for the device.
bool GetShortSlotTimeSupported(void) const
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service.
Ptr< HeConfiguration > GetHeConfiguration(void) const
bool m_dsssSupported
This Boolean is set true iff this WifiMac is to model 802.11b.
bool m_erpSupported
This Boolean is set true iff this WifiMac is to model 802.11g.
Ptr< QosTxop > GetBKQueue(void) const
Accessor for the AC_BK channel access function.
Callback< void > m_linkDown
Callback when a link is down.
bool GetVhtSupported() const
Return whether the device supports VHT.
bool GetQosSupported() const
Return whether the device supports QoS.
virtual void SetAddress(Mac48Address address)
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Mac48Address m_address
MAC address of this station.
HeCapabilities GetHeCapabilities(void) const
Return the HE capabilities of the device.
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
void DoInitialize() override
Initialize() implementation.
void ResetWifiPhy(void)
Remove currently attached WifiPhy device from this MAC.
TypeOfStation m_typeOfStation
the type of station
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
virtual void ConfigureStandard(WifiStandard standard)
void SetupFrameExchangeManager(WifiStandard standard)
Create a Frame Exchange Manager depending on the supported version of the standard.
Mac48Address GetAddress(void) const
void SetDsssSupported(bool enable)
Enable or disable DSSS support for the device.
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
void SetPromisc(void)
Sets the interface in promiscuous mode.
Ptr< QosTxop > GetBEQueue(void) const
Accessor for the AC_BE channel access function.
bool GetHtSupported() const
Return whether the device supports HT.
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, bool isDsss, AcIndex ac)
void ConfigurePhyDependentParameters(void)
Configure PHY dependent parameters such as CWmin and CWmax.
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
Ptr< WifiNetDevice > m_device
Pointer to the device.
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
MpduTracedCallback m_ackedMpduCallback
ack'ed MPDU callback
Ptr< QosTxop > GetVOQueue(void) const
Accessor for the AC_VO channel access function.
MpduTracedCallback m_nackedMpduCallback
nack'ed MPDU callback
Ptr< ChannelAccessManager > m_channelAccessManager
channel access manager
Mac48Address GetBssid(void) const
bool GetHeSupported() const
Return whether the device supports HE.
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
TracedCallback< const WifiMacHeader & > m_txErrCallback
transmit error callback
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
Ptr< QosTxop > GetVIQueue(void) const
Accessor for the AC_VI channel access function.
virtual void Receive(Ptr< WifiMacQueueItem > mpdu)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
void NotifyPromiscRx(Ptr< const Packet > packet)
virtual void NotifyChannelSwitching(void)
Notify that channel has been switched.
static TypeId GetTypeId(void)
Get the type ID.
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
void NotifyTx(Ptr< const Packet > packet)
uint32_t GetMaxAmpduSize(AcIndex ac) const
Return the maximum A-MPDU size of the given Access Category.
Ssid m_ssid
Service Set ID (SSID)
TypeOfStation GetTypeOfStation(void) const
Return the type of station.
Ptr< WifiPhy > GetWifiPhy(void) const
Mac48Address m_bssid
the BSSID
virtual void SetWifiPhy(Ptr< WifiPhy > phy)
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from)
void NotifyRx(Ptr< const Packet > packet)
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
void SetForwardUpCallback(ForwardUpCallback upCallback)
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
Ptr< VhtConfiguration > GetVhtConfiguration(void) const
virtual void DeaggregateAmsduAndForward(Ptr< WifiMacQueueItem > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
virtual Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed,...
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
void SetupEdcaQueue(AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...
Ptr< FrameExchangeManager > m_feManager
Frame Exchange Manager.
void SetLinkDownCallback(Callback< void > linkDown)
void NotifyRxDrop(Ptr< const Packet > packet)
virtual void SetLinkUpCallback(Callback< void > linkUp)
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
Ptr< WifiNetDevice > GetDevice(void) const
Return the device this PHY is associated with.
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
VhtCapabilities GetVhtCapabilities(void) const
Return the VHT capabilities of the device.
bool GetErpSupported() const
Return whether the device supports ERP.
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
TracedCallback< const WifiMacHeader & > m_txOkCallback
transmit OK callback
Callback< void > m_linkUp
Callback when a link is up.
bool GetDsssSupported() const
Return whether the device supports DSSS.
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities of the device.
virtual bool SupportsSendFrom(void) const
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
void NotifyTxDrop(Ptr< const Packet > packet)
void DoDispose() override
Destructor implementation.
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
Ptr< WifiPhy > m_phy
Wifi PHY.
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
void SetBssid(Mac48Address bssid)
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
Ptr< Txop > GetTxop(void) const
Accessor for the Txop object.
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
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...
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
WifiStandard GetStandard(void) const
Get the configured Wi-Fi standard.
uint8_t GetMaxSupportedRxSpatialStreams(void) const
uint8_t GetMaxSupportedTxSpatialStreams(void) const
uint16_t GetChannelWidth(void) const
bool IsSet(void) const
Return true if a valid channel has been set, false otherwise.
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...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeSsidChecker(void)
Ptr< const AttributeAccessor > MakeSsidAccessor(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.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#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_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t 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.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
WifiPhyBand
Identifies the PHY band.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
@ WIFI_STANDARD_UNSPECIFIED
@ 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_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ AC_UNDEF
Total number of ACs.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TypeOfStation
Enumeration for type of station.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
U * PeekPointer(const Ptr< U > &p)