A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ap-wifi-mac.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006, 2009 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Mirko Banchi <mk.banchi@gmail.com>
20 */
21
22#ifndef AP_WIFI_MAC_H
23#define AP_WIFI_MAC_H
24
25#include "wifi-mac-header.h"
26#include "wifi-mac.h"
27
28#include <unordered_map>
29#include <variant>
30
31namespace ns3
32{
33
34struct AllSupportedRates;
35class CapabilityInformation;
36class DsssParameterSet;
37class ErpInformation;
38class EdcaParameterSet;
39class MuEdcaParameterSet;
40class ReducedNeighborReport;
41class MultiLinkElement;
42class HtOperation;
43class VhtOperation;
44class HeOperation;
45class EhtOperation;
46class CfParameterSet;
47class UniformRandomVariable;
48class MgtAssocRequestHeader;
49class MgtReassocRequestHeader;
50class MgtAssocResponseHeader;
51class MgtEmlOmn;
52
53/// variant holding a reference to a (Re)Association Request
54using AssocReqRefVariant = std::variant<std::reference_wrapper<MgtAssocRequestHeader>,
55 std::reference_wrapper<MgtReassocRequestHeader>>;
56
57/**
58 * \brief Wi-Fi AP state machine
59 * \ingroup wifi
60 *
61 * Handle association, dis-association and authentication,
62 * of STAs within an infrastructure BSS.
63 */
64class ApWifiMac : public WifiMac
65{
66 public:
67 /**
68 * \brief Get the type ID.
69 * \return the object TypeId
70 */
71 static TypeId GetTypeId();
72
73 ApWifiMac();
74 ~ApWifiMac() override;
75
76 void SetLinkUpCallback(Callback<void> linkUp) override;
77 bool CanForwardPacketsTo(Mac48Address to) const override;
78 void Enqueue(Ptr<Packet> packet, Mac48Address to) override;
79 void Enqueue(Ptr<Packet> packet, Mac48Address to, Mac48Address from) override;
80 bool SupportsSendFrom() const override;
81 Ptr<WifiMacQueue> GetTxopQueue(AcIndex ac) const override;
82 void ConfigureStandard(WifiStandard standard) override;
83 int64_t AssignStreams(int64_t stream) override;
84
85 /**
86 * \param interval the interval between two beacon transmissions.
87 */
88 void SetBeaconInterval(Time interval);
89 /**
90 * \return the interval between two beacon transmissions.
91 */
92 Time GetBeaconInterval() const;
93
94 /**
95 * Get a const reference to the map of associated stations on the given link.
96 * Each station is specified by an (association ID, MAC address) pair. Make sure
97 * not to use the returned reference after that this object has been deallocated.
98 *
99 * \param linkId the ID of the given link
100 * \return a const reference to the map of associated stations
101 */
102 const std::map<uint16_t, Mac48Address>& GetStaList(uint8_t linkId) const;
103 /**
104 * \param addr the address of the associated station
105 * \param linkId the ID of the link on which the station is associated
106 * \return the Association ID allocated by the AP to the station, SU_STA_ID if unallocated
107 */
108 uint16_t GetAssociationId(Mac48Address addr, uint8_t linkId) const;
109
110 /**
111 * Get the ID of a link (if any) that has been setup with the station having the given MAC
112 * address. The address can be either a link address or an MLD address. In the former case,
113 * the returned ID is the ID of the link connecting the AP to the STA with the given address.
114 *
115 * \param address the given MAC address
116 * \return the ID of a link (if any) that has been setup with the given station
117 */
118 std::optional<uint8_t> IsAssociated(const Mac48Address& address) const;
119
120 /**
121 * \param aid the given AID
122 * \return the MLD address (in case of MLD) or link address (in case of single link device)
123 * of the STA having the given AID, if any
124 */
125 std::optional<Mac48Address> GetMldOrLinkAddressByAid(uint16_t aid) const;
126
127 /**
128 * Return the value of the Queue Size subfield of the last QoS Data or QoS Null
129 * frame received from the station with the given MAC address and belonging to
130 * the given TID.
131 *
132 * The Queue Size value is the total size, rounded up to the nearest multiple
133 * of 256 octets and expressed in units of 256 octets, of all MSDUs and A-MSDUs
134 * buffered at the STA (excluding the MSDU or A-MSDU of the present QoS Data frame).
135 * A queue size value of 254 is used for all sizes greater than 64 768 octets.
136 * A queue size value of 255 is used to indicate an unspecified or unknown size.
137 * See Section 9.2.4.5.6 of 802.11-2016
138 *
139 * \param tid the given TID
140 * \param address the given MAC address
141 * \return the value of the Queue Size subfield
142 */
143 uint8_t GetBufferStatus(uint8_t tid, Mac48Address address) const;
144 /**
145 * Store the value of the Queue Size subfield of the last QoS Data or QoS Null
146 * frame received from the station with the given MAC address and belonging to
147 * the given TID.
148 *
149 * \param tid the given TID
150 * \param address the given MAC address
151 * \param size the value of the Queue Size subfield
152 */
153 void SetBufferStatus(uint8_t tid, Mac48Address address, uint8_t size);
154 /**
155 * Return the maximum among the values of the Queue Size subfield of the last
156 * QoS Data or QoS Null frames received from the station with the given MAC address
157 * and belonging to any TID.
158 *
159 * \param address the given MAC address
160 * \return the maximum among the values of the Queue Size subfields
161 */
162 uint8_t GetMaxBufferStatus(Mac48Address address) const;
163
164 protected:
165 /**
166 * Structure holding information specific to a single link. Here, the meaning of
167 * "link" is that of the 11be amendment which introduced multi-link devices. For
168 * previous amendments, only one link can be created.
169 */
171 {
172 /// Destructor (a virtual method is needed to make this struct polymorphic)
173 ~ApLinkEntity() override;
174
175 EventId beaconEvent; //!< Event to generate one beacon
176 std::map<uint16_t, Mac48Address> staList; //!< Map of all stations currently associated
177 //!< to the AP with their association ID
178 uint16_t numNonHtStations{0}; //!< Number of non-HT stations currently associated to the AP
180 0}; //!< Number of non-ERP stations currently associated to the AP
182 false}; //!< Flag whether short slot time is enabled within the BSS
183 bool shortPreambleEnabled{false}; //!< Flag whether short preamble is enabled in the BSS
184 };
185
186 /**
187 * Get a reference to the link associated with the given ID.
188 *
189 * \param linkId the given link ID
190 * \return a reference to the link associated with the given ID
191 */
192 ApLinkEntity& GetLink(uint8_t linkId) const;
193
194 std::map<uint16_t, Mac48Address>
195 m_aidToMldOrLinkAddress; //!< Maps AIDs to MLD addresses (for MLDs) or link addresses (in
196 //!< case of single link devices)
197
198 private:
199 std::unique_ptr<LinkEntity> CreateLinkEntity() const override;
200 Mac48Address DoGetLocalAddress(const Mac48Address& remoteAddr) const override;
201 void Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId) override;
202
203 /**
204 * Check whether the supported rate set included in the received (Re)Association
205 * Request frame is compatible with our Basic Rate Set. If so, record all the station's
206 * supported modes in its associated WifiRemoteStation and return true.
207 * Otherwise, return false.
208 *
209 * \param assoc the frame body of the received (Re)Association Request
210 * \param from the Transmitter Address field of the frame
211 * \param linkId the ID of the link on which the frame was received
212 * \return true if the (Re)Association request can be accepted, false otherwise
213 */
214 bool ReceiveAssocRequest(const AssocReqRefVariant& assoc,
215 const Mac48Address& from,
216 uint8_t linkId);
217
218 /**
219 * Given a (Re)Association Request frame body containing a Multi-Link Element,
220 * check if a link can be setup with each of the reported stations (STA MAC address
221 * and a (Re)Association Request frame body must be present, the Link ID identifies
222 * a valid link other than the one the frame was received on and the supported
223 * rates are compatible with our basic rate set).
224 *
225 * \param assoc the frame body of the received (Re)Association Request
226 * \param from the Transmitter Address field of the frame
227 * \param linkId the ID of the link on which the frame was received
228 */
229 void ParseReportedStaInfo(const AssocReqRefVariant& assoc, Mac48Address from, uint8_t linkId);
230
231 /**
232 * Take necessary actions upon receiving the given EML Operating Mode Notification frame
233 * from the given station on the given link.
234 *
235 * \param frame the received EML Operating Mode Notification frame
236 * \param sender the MAC address of the sender of the frame
237 * \param linkId the ID of the link over which the frame was received
238 */
239 void ReceiveEmlOmn(MgtEmlOmn& frame, const Mac48Address& sender, uint8_t linkId);
240
241 /**
242 * The packet we sent was successfully received by the receiver
243 * (i.e. we received an Ack from the receiver). If the packet
244 * was an association response to the receiver, we record that
245 * the receiver is now associated with us.
246 *
247 * \param mpdu the MPDU that we successfully sent
248 */
249 void TxOk(Ptr<const WifiMpdu> mpdu);
250 /**
251 * The packet we sent was successfully received by the receiver
252 * (i.e. we did not receive an Ack from the receiver). If the packet
253 * was an association response to the receiver, we record that
254 * the receiver is not associated with us yet.
255 *
256 * \param timeoutReason the reason why the TX timer was started (\see WifiTxTimer::Reason)
257 * \param mpdu the MPDU that we failed to sent
258 */
259 void TxFailed(WifiMacDropReason timeoutReason, Ptr<const WifiMpdu> mpdu);
260
261 /**
262 * This method is called to de-aggregate an A-MSDU and forward the
263 * constituent packets up the stack. We override the WifiMac version
264 * here because, as an AP, we also need to think about redistributing
265 * to other associated STAs.
266 *
267 * \param mpdu the MPDU containing the A-MSDU.
268 */
270 /**
271 * Forward the packet down to DCF/EDCAF (enqueue the packet). This method
272 * is a wrapper for ForwardDown with traffic id.
273 *
274 * \param packet the packet we are forwarding to DCF/EDCAF
275 * \param from the address to be used for Address 3 field in the header
276 * \param to the address to be used for Address 1 field in the header
277 */
278 void ForwardDown(Ptr<Packet> packet, Mac48Address from, Mac48Address to);
279 /**
280 * Forward the packet down to DCF/EDCAF (enqueue the packet).
281 *
282 * \param packet the packet we are forwarding to DCF/EDCAF
283 * \param from the address to be used for Address 3 field in the header
284 * \param to the address to be used for Address 1 field in the header
285 * \param tid the traffic id for the packet
286 */
287 void ForwardDown(Ptr<Packet> packet, Mac48Address from, Mac48Address to, uint8_t tid);
288 /**
289 * Send a Probe Response in response to a Probe Request received from the STA with the
290 * given address on the given link.
291 *
292 * \param to the address of the STA we are sending a probe response to
293 * \param linkId the ID of the given link
294 */
295 void SendProbeResp(Mac48Address to, uint8_t linkId);
296 /**
297 * Get the Association Response frame to send on a given link. The returned frame
298 * never includes a Multi-Link Element.
299 *
300 * \param to the address of the STA we are sending an association response to
301 * \param linkId the ID of the given link
302 * \return the Association Response frame
303 */
305 /// Map of (link ID, remote STA address) of the links to setup
306 using LinkIdStaAddrMap = std::map<uint8_t, Mac48Address>;
307 /**
308 * Set the AID field of the given Association Response frame. In case of
309 * multi-link setup, the selected AID value must be assigned to all the STAs
310 * corresponding to the setup links. The AID value is selected among the AID
311 * values that are possibly already assigned to the STAs affiliated with the
312 * non-AP MLD we are associating with. If no STA has an assigned AID value,
313 * a new AID value is selected.
314 *
315 * \param assoc the given Association Response frame
316 * \param linkIdStaAddrMap a map of (link ID, remote STA address) of the links to setup
317 */
318 void SetAid(MgtAssocResponseHeader& assoc, const LinkIdStaAddrMap& linkIdStaAddrMap);
319 /**
320 * Get a map of (link ID, remote STA address) of the links to setup. Information
321 * is taken from the given Association Response that is sent over the given link
322 * to the given station.
323 *
324 * \param assoc the given Association Response frame
325 * \param to the Receiver Address (RA) of the Association Response frame
326 * \param linkId the ID of the link on which the Association Response frame is sent
327 * \return a map of (link ID, remote STA address) of the links to setup
328 */
330 const Mac48Address& to,
331 uint8_t linkId);
332 /**
333 * Forward an association or a reassociation response packet to the DCF/EDCA.
334 *
335 * \param to the address of the STA we are sending an association response to
336 * \param isReassoc indicates whether it is a reassociation response
337 * \param linkId the ID of the link on which the association response must be sent
338 */
339 void SendAssocResp(Mac48Address to, bool isReassoc, uint8_t linkId);
340 /**
341 * Forward a beacon packet to the beacon special DCF for transmission
342 * on the given link.
343 *
344 * \param linkId the ID of the given link
345 */
346 void SendOneBeacon(uint8_t linkId);
347
348 /**
349 * Process the Power Management bit in the Frame Control field of an MPDU
350 * successfully received on the given link.
351 *
352 * \param mpdu the successfully received MPDU
353 * \param linkId the ID of the given link
354 */
355 void ProcessPowerManagementFlag(Ptr<const WifiMpdu> mpdu, uint8_t linkId);
356 /**
357 * Perform the necessary actions when a given station switches from active mode
358 * to powersave mode.
359 *
360 * \param staAddr the MAC address of the given station
361 * \param linkId the ID of the link on which the given station is operating
362 */
363 void StaSwitchingToPsMode(const Mac48Address& staAddr, uint8_t linkId);
364 /**
365 * Perform the necessary actions when a given station deassociates or switches
366 * from powersave mode to active mode.
367 *
368 * \param staAddr the MAC address of the given station
369 * \param linkId the ID of the link on which the given station is operating
370 */
371 void StaSwitchingToActiveModeOrDeassociated(const Mac48Address& staAddr, uint8_t linkId);
372
373 /**
374 * Return the Capability information of the current AP for the given link.
375 *
376 * \param linkId the ID of the given link
377 * \return the Capability information that we support
378 */
379 CapabilityInformation GetCapabilities(uint8_t linkId) const;
380 /**
381 * Return the ERP information of the current AP for the given link.
382 *
383 * \param linkId the ID of the given link
384 * \return the ERP information that we support for the given link
385 */
386 ErpInformation GetErpInformation(uint8_t linkId) const;
387 /**
388 * Return the EDCA Parameter Set of the current AP for the given link.
389 *
390 * \param linkId the ID of the given link
391 * \return the EDCA Parameter Set that we support for the given link
392 */
393 EdcaParameterSet GetEdcaParameterSet(uint8_t linkId) const;
394 /**
395 * Return the MU EDCA Parameter Set of the current AP, if one needs to be advertised
396 *
397 * \return the MU EDCA Parameter Set that needs to be advertised (if any)
398 */
399 std::optional<MuEdcaParameterSet> GetMuEdcaParameterSet() const;
400 /**
401 * Return the Reduced Neighbor Report (RNR) element that the current AP sends
402 * on the given link, if one needs to be advertised.
403 *
404 * \param linkId the ID of the link to send the RNR element onto
405 * \return the Reduced Neighbor Report element
406 */
407 std::optional<ReducedNeighborReport> GetReducedNeighborReport(uint8_t linkId) const;
408 /**
409 * Return the Multi-Link Element that the current AP includes in the management
410 * frames of the given type it transmits on the given link.
411 *
412 * \param linkId the ID of the link to send the Multi-Link Element onto
413 * \param frameType the type of the frame containing the Multi-Link Element
414 * \param to the Receiver Address of the frame containing the Multi-Link Element
415 * \return the Multi-Link Element
416 */
418 WifiMacType frameType,
420 /**
421 * Return the HT operation of the current AP for the given link.
422 *
423 * \param linkId the ID of the given link
424 * \return the HT operation that we support
425 */
426 HtOperation GetHtOperation(uint8_t linkId) const;
427 /**
428 * Return the VHT operation of the current AP for the given link.
429 *
430 * \param linkId the ID of the given link
431 * \return the VHT operation that we support
432 */
433 VhtOperation GetVhtOperation(uint8_t linkId) const;
434 /**
435 * Return the HE operation of the current AP for the given link.
436 *
437 * \param linkId the ID of the given link
438 * \return the HE operation that we support
439 */
440 HeOperation GetHeOperation(uint8_t linkId) const;
441 /**
442 * Return the EHT operation of the current AP for the given link.
443 *
444 * \param linkId the ID of the given link
445 * \return the EHT operation that we support
446 */
447 EhtOperation GetEhtOperation(uint8_t linkId) const;
448 /**
449 * Return an instance of SupportedRates that contains all rates that we support
450 * for the given link (including HT rates).
451 *
452 * \param linkId the ID of the given link
453 * \return all rates that we support
454 */
455 AllSupportedRates GetSupportedRates(uint8_t linkId) const;
456 /**
457 * Return the DSSS Parameter Set that we support on the given link
458 *
459 * \param linkId the ID of the given link
460 * \return the DSSS Parameter Set that we support on the given link
461 */
462 DsssParameterSet GetDsssParameterSet(uint8_t linkId) const;
463 /**
464 * Enable or disable beacon generation of the AP.
465 *
466 * \param enable enable or disable beacon generation
467 */
468 void SetBeaconGeneration(bool enable);
469
470 /**
471 * Update whether short slot time should be enabled or not in the BSS
472 * corresponding to the given link.
473 * Typically, short slot time is enabled only when there is no non-ERP station
474 * associated to the AP, and that short slot time is supported by the AP and by all
475 * other ERP stations that are associated to the AP. Otherwise, it is disabled.
476 *
477 * \param linkId the ID of the given link
478 */
479 void UpdateShortSlotTimeEnabled(uint8_t linkId);
480 /**
481 * Update whether short preamble should be enabled or not in the BSS
482 * corresponding to the given link.
483 * Typically, short preamble is enabled only when the AP and all associated
484 * stations support short PHY preamble. Otherwise, it is disabled.
485 *
486 * \param linkId the ID of the given link
487 */
488 void UpdateShortPreambleEnabled(uint8_t linkId);
489
490 /**
491 * Return whether protection for non-ERP stations is used in the BSS
492 * corresponding to the given link.
493 *
494 * \param linkId the ID of the given link
495 * \return true if protection for non-ERP stations is used in the BSS,
496 * false otherwise
497 */
498 bool GetUseNonErpProtection(uint8_t linkId) const;
499
500 void DoDispose() override;
501 void DoInitialize() override;
502
503 /**
504 * \param linkIds the IDs of the links for which the next Association ID is requested
505 * \return the next Association ID to be allocated by the AP on the given links
506 */
507 uint16_t GetNextAssociationId(std::list<uint8_t> linkIds);
508
509 Ptr<Txop> m_beaconTxop; //!< Dedicated Txop for beacons
510 bool m_enableBeaconGeneration; //!< Flag whether beacons are being generated
511 Time m_beaconInterval; //!< Beacon interval
513 m_beaconJitter; //!< UniformRandomVariable used to randomize the time of the first beacon
514 bool m_enableBeaconJitter; //!< Flag whether the first beacon should be generated at random time
515 bool m_enableNonErpProtection; //!< Flag whether protection mechanism is used or not when
516 //!< non-ERP STAs are present within the BSS
517 Time m_bsrLifetime; //!< Lifetime of Buffer Status Reports
518 /// transition timeout events running for EMLSR clients
519 std::map<Mac48Address, EventId> m_transitionTimeoutEvents;
520
521 /// store value and timestamp for each Buffer Status Report
522 struct BsrType
523 {
524 uint8_t value; //!< value of BSR
525 Time timestamp; //!< timestamp of BSR
526 };
527
528 /// Per (MAC address, TID) buffer status reports
529 std::unordered_map<WifiAddressTidPair, BsrType, WifiAddressTidHash> m_bufferStatus;
530
531 /**
532 * TracedCallback signature for association/deassociation events.
533 *
534 * \param aid the AID of the station
535 * \param address the MAC address of the station
536 */
537 typedef void (*AssociationCallback)(uint16_t aid, Mac48Address address);
538
539 TracedCallback<uint16_t /* AID */, Mac48Address> m_assocLogger; ///< association logger
540 TracedCallback<uint16_t /* AID */, Mac48Address> m_deAssocLogger; ///< deassociation logger
541};
542
543} // namespace ns3
544
545#endif /* AP_WIFI_MAC_H */
Wi-Fi AP state machine.
Definition: ap-wifi-mac.h:65
void SendAssocResp(Mac48Address to, bool isReassoc, uint8_t linkId)
Forward an association or a reassociation response packet to the DCF/EDCA.
uint16_t GetAssociationId(Mac48Address addr, uint8_t linkId) const
std::unique_ptr< LinkEntity > CreateLinkEntity() const override
Create a LinkEntity object.
Definition: ap-wifi-mac.cc:144
Ptr< Txop > m_beaconTxop
Dedicated Txop for beacons.
Definition: ap-wifi-mac.h:509
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
Definition: ap-wifi-mac.cc:181
void ParseReportedStaInfo(const AssocReqRefVariant &assoc, Mac48Address from, uint8_t linkId)
Given a (Re)Association Request frame body containing a Multi-Link Element, check if a link can be se...
void UpdateShortSlotTimeEnabled(uint8_t linkId)
Update whether short slot time should be enabled or not in the BSS corresponding to the given link.
Definition: ap-wifi-mac.cc:246
const std::map< uint16_t, Mac48Address > & GetStaList(uint8_t linkId) const
Get a const reference to the map of associated stations on the given link.
void DoDispose() override
Destructor implementation.
Definition: ap-wifi-mac.cc:128
void SetBeaconInterval(Time interval)
Definition: ap-wifi-mac.cc:219
bool ReceiveAssocRequest(const AssocReqRefVariant &assoc, const Mac48Address &from, uint8_t linkId)
Check whether the supported rate set included in the received (Re)Association Request frame is compat...
std::map< uint8_t, Mac48Address > LinkIdStaAddrMap
Map of (link ID, remote STA address) of the links to setup.
Definition: ap-wifi-mac.h:306
std::map< Mac48Address, EventId > m_transitionTimeoutEvents
transition timeout events running for EMLSR clients
Definition: ap-wifi-mac.h:519
Mac48Address DoGetLocalAddress(const Mac48Address &remoteAddr) const override
This method is called if this device is an MLD to determine the MAC address of the affiliated STA use...
CapabilityInformation GetCapabilities(uint8_t linkId) const
Return the Capability information of the current AP for the given link.
Definition: ap-wifi-mac.cc:486
Ptr< UniformRandomVariable > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
Definition: ap-wifi-mac.h:513
void(* AssociationCallback)(uint16_t aid, Mac48Address address)
TracedCallback signature for association/deassociation events.
Definition: ap-wifi-mac.h:537
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
Definition: ap-wifi-mac.cc:394
bool m_enableNonErpProtection
Flag whether protection mechanism is used or not when non-ERP STAs are present within the BSS.
Definition: ap-wifi-mac.h:515
EdcaParameterSet GetEdcaParameterSet(uint8_t linkId) const
Return the EDCA Parameter Set of the current AP for the given link.
Definition: ap-wifi-mac.cc:518
void StaSwitchingToActiveModeOrDeassociated(const Mac48Address &staAddr, uint8_t linkId)
Perform the necessary actions when a given station deassociates or switches from powersave mode to ac...
MultiLinkElement GetMultiLinkElement(uint8_t linkId, WifiMacType frameType, const Mac48Address &to=Mac48Address::GetBroadcast())
Return the Multi-Link Element that the current AP includes in the management frames of the given type...
Definition: ap-wifi-mac.cc:664
HtOperation GetHtOperation(uint8_t linkId) const
Return the HT operation of the current AP for the given link.
Definition: ap-wifi-mac.cc:770
std::optional< Mac48Address > GetMldOrLinkAddressByAid(uint16_t aid) const
void UpdateShortPreambleEnabled(uint8_t linkId)
Update whether short preamble should be enabled or not in the BSS corresponding to the given link.
Definition: ap-wifi-mac.cc:269
void TxOk(Ptr< const WifiMpdu > mpdu)
The packet we sent was successfully received by the receiver (i.e.
std::map< uint16_t, Mac48Address > m_aidToMldOrLinkAddress
Maps AIDs to MLD addresses (for MLDs) or link addresses (in case of single link devices)
Definition: ap-wifi-mac.h:195
TracedCallback< uint16_t, Mac48Address > m_deAssocLogger
deassociation logger
Definition: ap-wifi-mac.h:540
LinkIdStaAddrMap GetLinkIdStaAddrMap(MgtAssocResponseHeader &assoc, const Mac48Address &to, uint8_t linkId)
Get a map of (link ID, remote STA address) of the links to setup.
void SetAid(MgtAssocResponseHeader &assoc, const LinkIdStaAddrMap &linkIdStaAddrMap)
Set the AID field of the given Association Response frame.
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Definition: ap-wifi-mac.h:510
Time m_beaconInterval
Beacon interval.
Definition: ap-wifi-mac.h:511
uint16_t GetNextAssociationId(std::list< uint8_t > linkIds)
bool m_enableBeaconJitter
Flag whether the first beacon should be generated at random time.
Definition: ap-wifi-mac.h:514
std::unordered_map< WifiAddressTidPair, BsrType, WifiAddressTidHash > m_bufferStatus
Per (MAC address, TID) buffer status reports.
Definition: ap-wifi-mac.h:529
void SendProbeResp(Mac48Address to, uint8_t linkId)
Send a Probe Response in response to a Probe Request received from the STA with the given address on ...
Definition: ap-wifi-mac.cc:971
DsssParameterSet GetDsssParameterSet(uint8_t linkId) const
Return the DSSS Parameter Set that we support on the given link.
Definition: ap-wifi-mac.cc:476
TracedCallback< uint16_t, Mac48Address > m_assocLogger
association logger
Definition: ap-wifi-mac.h:539
Time GetBeaconInterval() const
Definition: ap-wifi-mac.cc:200
static TypeId GetTypeId()
Get the type ID.
Definition: ap-wifi-mac.cc:58
std::optional< ReducedNeighborReport > GetReducedNeighborReport(uint8_t linkId) const
Return the Reduced Neighbor Report (RNR) element that the current AP sends on the given link,...
Definition: ap-wifi-mac.cc:633
void ReceiveEmlOmn(MgtEmlOmn &frame, const Mac48Address &sender, uint8_t linkId)
Take necessary actions upon receiving the given EML Operating Mode Notification frame from the given ...
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
Definition: ap-wifi-mac.cc:414
uint8_t GetMaxBufferStatus(Mac48Address address) const
Return the maximum among the values of the Queue Size subfield of the last QoS Data or QoS Null frame...
Time m_bsrLifetime
Lifetime of Buffer Status Reports.
Definition: ap-wifi-mac.h:517
ApLinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition: ap-wifi-mac.cc:150
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
uint8_t GetBufferStatus(uint8_t tid, Mac48Address address) const
Return the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the ...
EhtOperation GetEhtOperation(uint8_t linkId) const
Return the EHT operation of the current AP for the given link.
Definition: ap-wifi-mac.cc:947
void ConfigureStandard(WifiStandard standard) override
Definition: ap-wifi-mac.cc:156
ErpInformation GetErpInformation(uint8_t linkId) const
Return the ERP information of the current AP for the given link.
Definition: ap-wifi-mac.cc:497
void SetLinkUpCallback(Callback< void > linkUp) override
Definition: ap-wifi-mac.cc:207
VhtOperation GetVhtOperation(uint8_t linkId) const
Return the VHT operation of the current AP for the given link.
Definition: ap-wifi-mac.cc:868
~ApWifiMac() override
Definition: ap-wifi-mac.cc:122
void TxFailed(WifiMacDropReason timeoutReason, Ptr< const WifiMpdu > mpdu)
The packet we sent was successfully received by the receiver (i.e.
HeOperation GetHeOperation(uint8_t linkId) const
Return the HE operation of the current AP for the given link.
Definition: ap-wifi-mac.cc:917
void SetBufferStatus(uint8_t tid, Mac48Address address, uint8_t size)
Store the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the s...
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition: ap-wifi-mac.cc:236
std::optional< MuEdcaParameterSet > GetMuEdcaParameterSet() const
Return the MU EDCA Parameter Set of the current AP, if one needs to be advertised.
Definition: ap-wifi-mac.cc:565
void ProcessPowerManagementFlag(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
Process the Power Management bit in the Frame Control field of an MPDU successfully received on the g...
void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu) override
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
bool SupportsSendFrom() const override
Definition: ap-wifi-mac.cc:424
MgtAssocResponseHeader GetAssocResp(Mac48Address to, uint8_t linkId)
Get the Association Response frame to send on a given link.
void ForwardDown(Ptr< Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet down to DCF/EDCAF (enqueue the packet).
Definition: ap-wifi-mac.cc:293
void DoInitialize() override
Initialize() implementation.
std::optional< uint8_t > IsAssociated(const Mac48Address &address) const
Get the ID of a link (if any) that has been setup with the station having the given MAC address.
void SendOneBeacon(uint8_t linkId)
Forward a beacon packet to the beacon special DCF for transmission on the given link.
Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const override
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed,...
Definition: ap-wifi-mac.cc:171
bool GetUseNonErpProtection(uint8_t linkId) const
Return whether protection for non-ERP stations is used in the BSS corresponding to the given link.
void StaSwitchingToPsMode(const Mac48Address &staAddr, uint8_t linkId)
Perform the necessary actions when a given station switches from active mode to powersave mode.
AllSupportedRates GetSupportedRates(uint8_t linkId) const
Return an instance of SupportedRates that contains all rates that we support for the given link (incl...
Definition: ap-wifi-mac.cc:431
Callback template class.
Definition: callback.h:438
The DSSS Parameter Set.
The EDCA Parameter Set.
EHT Operation Information Element.
Definition: eht-operation.h:66
The ErpInformation Information Element.
An identifier for simulation events.
Definition: event-id.h:55
The HE Operation Information Element.
Definition: he-operation.h:36
The HT Operation Information Element.
Definition: ht-operation.h:51
an EUI-48 address
Definition: mac48-address.h:46
static Mac48Address GetBroadcast()
Implement the header for management frames of type association and reassociation response.
Definition: mgt-headers.h:334
Implement the header for Action frames of type EML Operating Mode Notification.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
The VHT Operation Information Element.
Definition: vht-operation.h:36
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:99
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiMacDropReason
The reason why an MPDU was dropped.
Definition: wifi-mac.h:80
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:73
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::variant< std::reference_wrapper< MgtAssocRequestHeader >, std::reference_wrapper< MgtReassocRequestHeader > > AssocReqRefVariant
variant holding a reference to a (Re)Association Request
Definition: ap-wifi-mac.h:55
WifiMacType
Combination of valid MAC header type/subtype.
Struct containing all supported rates.
store value and timestamp for each Buffer Status Report
Definition: ap-wifi-mac.h:523
Time timestamp
timestamp of BSR
Definition: ap-wifi-mac.h:525
uint8_t value
value of BSR
Definition: ap-wifi-mac.h:524