A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-mac.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef WIFI_MAC_H
10#define WIFI_MAC_H
11
12#include "mgt-headers.h"
13#include "qos-utils.h"
14#include "ssid.h"
17#include "wifi-standards.h"
18
19#include "ns3/uniform-random-bit-generator.h"
20
21#include <functional>
22#include <list>
23#include <map>
24#include <memory>
25#include <optional>
26#include <set>
27#include <unordered_map>
28#include <vector>
29
30namespace ns3
31{
32
33class Txop;
34class WifiNetDevice;
35class QosTxop;
36class WifiPsdu;
37class MacRxMiddle;
38class MacTxMiddle;
39class WifiMacQueue;
40class WifiMpdu;
41class HtConfiguration;
43class HeConfiguration;
51enum class WifiIcfDrop : uint8_t; // opaque enum declaration
52
53/**
54 * @ingroup wifi
55 * Enumeration for type of WiFi station
56 */
65
66/**
67 * @ingroup wifi
68 * @brief The reason why an MPDU was dropped
69 */
77
78typedef std::unordered_map<uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
79
80/**
81 * @brief base class for all MAC-level wifi objects.
82 * @ingroup wifi
83 *
84 * This class encapsulates all the low-level MAC functionality
85 * DCA, EDCA, etc) and all the high-level MAC functionality
86 * (association/disassociation state machines).
87 *
88 */
89class WifiMac : public Object
90{
91 public:
93
94 /**
95 * @brief Get the type ID.
96 * @return the object TypeId
97 */
98 static TypeId GetTypeId();
99
100 WifiMac();
101 ~WifiMac() override;
102
103 // Delete copy constructor and assignment operator to avoid misuse
104 WifiMac(const WifiMac&) = delete;
105 WifiMac& operator=(const WifiMac&) = delete;
106
107 /// type of the management frames
109 std::variant<MgtBeaconHeader, MgtProbeResponseHeader, MgtAssocResponseHeader>;
110
111 /**
112 * Assign a fixed random variable stream number to the random variables
113 * used by this model. Return the number of streams (possibly zero) that
114 * have been assigned.
115 *
116 * @param stream first stream index to use
117 *
118 * @return the number of stream indices assigned by this model
119 */
120 virtual int64_t AssignStreams(int64_t stream);
121
122 /**
123 * Sets the device this PHY is associated with.
124 *
125 * @param device the device this PHY is associated with
126 */
127 void SetDevice(const Ptr<WifiNetDevice> device);
128 /**
129 * Return the device this PHY is associated with
130 *
131 * @return the device this PHY is associated with
132 */
134
135 /**
136 * Get the Frame Exchange Manager associated with the given link
137 *
138 * @param linkId the ID of the given link
139 * @return the Frame Exchange Manager
140 */
142
143 /**
144 * @param feManagers the frame exchange managers attached to this MAC.
145 */
146 void SetFrameExchangeManagers(const std::vector<Ptr<FrameExchangeManager>>& feManagers);
147
148 /**
149 * Get the Channel Access Manager associated with the given link
150 *
151 * @param linkId the ID of the given link
152 * @return the Channel Access Manager
153 */
155
156 /**
157 * @param caManagers the channel access managers attached to this MAC.
158 */
159 void SetChannelAccessManagers(const std::vector<Ptr<ChannelAccessManager>>& caManagers);
160
161 /**
162 * Get the number of links (can be greater than 1 for 11be devices only).
163 *
164 * @return the number of links used by this MAC
165 */
166 uint8_t GetNLinks() const;
167
168 /**
169 * @return the set of link IDs in use by this device
170 */
171 const std::set<uint8_t>& GetLinkIds() const;
172
173 /**
174 * Get the ID of the link having the given MAC address, if any.
175 *
176 * @param address the given MAC address
177 * @return the ID of the link having the given MAC address, if any
178 */
179 virtual std::optional<uint8_t> GetLinkIdByAddress(const Mac48Address& address) const;
180
181 /**
182 * Get the ID of the link (if any) on which the given PHY is operating.
183 *
184 * @param phy the given PHY
185 * @return the ID of the link (if any) on which the given PHY is operating
186 */
187 std::optional<uint8_t> GetLinkForPhy(Ptr<const WifiPhy> phy) const;
188
189 /**
190 * Get the ID of the link (if any) on which the given PHY is operating.
191 *
192 * @param phyId the index of the given PHY in the vector of PHYs held by WifiNetDevice
193 * @return the ID of the link (if any) on which the given PHY is operating
194 */
195 std::optional<uint8_t> GetLinkForPhy(std::size_t phyId) const;
196
197 /**
198 * Indicate if a given link is on the 6 GHz band.
199 *
200 * @param linkId the ID of the given link
201 * @return whether the given link is on the 6 GHz band
202 */
203 bool Is6GhzBand(uint8_t linkId) const;
204
205 /**
206 * @param remoteAddr the (MLD or link) address of a remote device
207 * @return the MLD address of the remote device having the given (MLD or link) address, if
208 * the remote device is an MLD.
209 */
210 std::optional<Mac48Address> GetMldAddress(const Mac48Address& remoteAddr) const;
211
212 /**
213 * Get the local MAC address used to communicate with a remote STA. Specifically:
214 * - If the given remote address is the address of a STA affiliated with a remote MLD
215 * and operating on a setup link, the address of the local STA operating on such a link
216 * is returned.
217 * - If the given remote address is the MLD address of a remote MLD (with which some link
218 * has been setup), the MLD address of this device is returned.
219 * - If this is a single link device, the unique MAC address of this device is returned.
220 * - Otherwise, return the MAC address of the affiliated STA (which must exists) that
221 * can be used to communicate with the remote device.
222 *
223 * @param remoteAddr the MAC address of the remote device
224 * @return the local MAC address used to communicate with the remote device
225 */
226 Mac48Address GetLocalAddress(const Mac48Address& remoteAddr) const;
227
228 /**
229 * Accessor for the Txop object
230 *
231 * @return a smart pointer to Txop
232 */
233 Ptr<Txop> GetTxop() const;
234 /**
235 * Accessor for a specified EDCA object
236 *
237 * @param ac the Access Category
238 * @return a smart pointer to a QosTxop
239 */
241 /**
242 * Accessor for a specified EDCA object
243 *
244 * @param tid the Traffic ID
245 * @return a smart pointer to a QosTxop
246 */
247 Ptr<QosTxop> GetQosTxop(uint8_t tid) const;
248 /**
249 * Get the wifi MAC queue of the (Qos)Txop associated with the given AC,
250 * if such (Qos)Txop is installed, or a null pointer, otherwise.
251 *
252 * @param ac the given Access Category
253 * @return the wifi MAC queue of the (Qos)Txop associated with the given AC,
254 * if such (Qos)Txop is installed, or a null pointer, otherwise
255 */
257
258 /**
259 * Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null
260 * pointer, otherwise.
261 *
262 * @param ac the given Access Category
263 * @return the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a
264 * null pointer, otherwise
265 */
266 virtual Ptr<Txop> GetTxopFor(AcIndex ac) const;
267
268 /**
269 * Check if the MAC has frames to transmit over the given link
270 * @param linkId the ID of the given link.
271 * @return whether the MAC has frames to transmit.
272 */
273 virtual bool HasFramesToTransmit(uint8_t linkId);
274
275 /**
276 * Set the wifi MAC queue scheduler
277 *
278 * @param scheduler the wifi MAC queue scheduler
279 */
280 virtual void SetMacQueueScheduler(Ptr<WifiMacQueueScheduler> scheduler);
281 /**
282 * Get the wifi MAC queue scheduler
283 *
284 * @return the wifi MAC queue scheduler
285 */
287
288 /**
289 * This method is invoked by a subclass to specify what type of
290 * station it is implementing. This is something that the channel
291 * access functions need to know.
292 *
293 * @param type the type of station.
294 */
296 /**
297 * Return the type of station.
298 *
299 * @return the type of station.
300 */
302
303 /**
304 * @param ssid the current SSID of this MAC layer.
305 */
306 void SetSsid(Ssid ssid);
307 /**
308 * @brief Sets the interface in promiscuous mode.
309 *
310 * Enables promiscuous mode on the interface. Note that any further
311 * filtering on the incoming frame path may affect the overall
312 * behavior.
313 */
314 void SetPromisc();
315 /**
316 * Enable or disable CTS-to-self feature.
317 *
318 * @param enable true if CTS-to-self is to be supported,
319 * false otherwise
320 */
321 void SetCtsToSelfSupported(bool enable);
322
323 /**
324 * @return the MAC address associated to this MAC layer.
325 */
326 Mac48Address GetAddress() const;
327 /**
328 * @return the SSID which this MAC layer is going to try to stay in.
329 */
330 Ssid GetSsid() const;
331 /**
332 * @param address the current address of this MAC layer.
333 */
334 virtual void SetAddress(Mac48Address address);
335 /**
336 * @return the BSSID of the network the given link belongs to.
337 * @param linkId the ID of the given link
338 */
339 Mac48Address GetBssid(uint8_t linkId) const;
340 /**
341 * @param bssid the BSSID of the network that the given link belongs to.
342 * @param linkId the ID of the given link
343 */
344 void SetBssid(Mac48Address bssid, uint8_t linkId);
345
346 /**
347 * Block the transmission on the given links of all unicast frames addressed to
348 * the station with the given address for the given reason. The given MAC address
349 * must be the MLD address in case the addressed device is multi-link.
350 *
351 * @param reason the reason for blocking transmissions
352 * @param address the MAC address of the given device
353 * @param linkIds the IDs of the links to block
354 */
356 Mac48Address address,
357 const std::set<uint8_t>& linkIds);
358
359 /**
360 * Unblock the transmission on the given links of all unicast frames addressed to
361 * the station with the given address for the given reason. The given MAC address
362 * must be the MLD address in case the addressed device is multi-link.
363 *
364 * @param reason the reason for unblocking transmissions
365 * @param address the MAC address of the given device
366 * @param linkIds the IDs of the links to unblock
367 */
369 Mac48Address address,
370 const std::set<uint8_t>& linkIds);
371
372 /**
373 * Check whether the transmission of the packets in the given container queue of the given
374 * Access Category are blocked on the given link for the given reason (if any).
375 *
376 * @param ac the given Access Category
377 * @param queueId the given container queue
378 * @param linkId the ID of the given link
379 * @param reason the reason to block transmissions (REASONS_COUNT indicate no reason)
380 * @return whether transmission is blocked
381 */
383 AcIndex ac,
384 const WifiContainerQueueId& queueId,
385 uint8_t linkId,
387
388 /**
389 * Return true if packets can be forwarded to the given destination,
390 * false otherwise.
391 *
392 * @param to the address to which the packet should be sent
393 * @return whether packets can be forwarded to the given destination
394 */
395 virtual bool CanForwardPacketsTo(Mac48Address to) const = 0;
396
397 /**
398 * @param packet the packet to send.
399 * @param to the address to which the packet should be sent.
400 *
401 * The packet should be enqueued in a TX queue, and should be
402 * dequeued as soon as the DCF/EDCA function determines that
403 * access is granted to this MAC.
404 */
405 void Enqueue(Ptr<Packet> packet, Mac48Address to);
406
407 /**
408 * @param packet the packet to send.
409 * @param to the address to which the packet should be sent.
410 * @param from the address from which the packet should be sent.
411 *
412 * The packet should be enqueued in a TX queue, and should be
413 * dequeued as soon as the DCF/EDCA function determines that
414 * access is granted to this MAC. The extra parameter "from" allows
415 * this device to operate in a bridged mode, forwarding received
416 * frames without altering the source address.
417 */
418 void Enqueue(Ptr<Packet> packet, Mac48Address to, Mac48Address from);
419
420 /**
421 * @param packet the packet to send.
422 * @param to the address to which the packet should be sent.
423 * @param from the address from which the packet should be sent.
424 * @param tid the TID to use to send this packet
425 *
426 * The packet should be enqueued in a TX queue, and should be
427 * dequeued as soon as the DCF/EDCA function determines that
428 * access is granted to this MAC. The extra parameter "tid" allows
429 * to specify the TID to use in case QoS is supported.
430 */
431 void Enqueue(Ptr<Packet> packet, Mac48Address to, Mac48Address from, uint8_t tid);
432
433 /**
434 * @return if this MAC supports sending from arbitrary address.
435 *
436 * The interface may or may not support sending from arbitrary address.
437 * This function returns true if sending from arbitrary address is supported,
438 * false otherwise.
439 */
440 virtual bool SupportsSendFrom() const;
441
442 /**
443 * @param phys the physical layers attached to this MAC.
444 */
445 virtual void SetWifiPhys(const std::vector<Ptr<WifiPhy>>& phys);
446 /**
447 * @param linkId the index (starting at 0) of the PHY object to retrieve
448 * @return the physical layer attached to this MAC
449 */
450 Ptr<WifiPhy> GetWifiPhy(uint8_t linkId = SINGLE_LINK_OP_ID) const;
451 /**
452 * Remove currently attached WifiPhy objects from this MAC.
453 */
454 void ResetWifiPhys();
455
456 /**
457 * @param stationManager the station manager attached to this MAC.
458 */
460 /**
461 * @param stationManagers the station managers attached to this MAC.
462 */
464 const std::vector<Ptr<WifiRemoteStationManager>>& stationManagers);
465 /**
466 * @param linkId the ID (starting at 0) of the link of the RemoteStationManager object
467 * to retrieve
468 * @return the remote station manager operating on the given link
469 */
471
472 /**
473 * This type defines the callback of a higher layer that a
474 * WifiMac(-derived) object invokes to pass a packet up the stack.
475 *
476 * @param packet the packet that has been received.
477 * @param from the MAC address of the device that sent the packet.
478 * @param to the MAC address of the device that the packet is destined for.
479 */
481
482 /**
483 * @param upCallback the callback to invoke when a packet must be
484 * forwarded up the stack.
485 */
487 /**
488 * @param linkUp the callback to invoke when the link becomes up.
489 */
490 virtual void SetLinkUpCallback(Callback<void> linkUp);
491 /**
492 * @param linkDown the callback to invoke when the link becomes down.
493 */
494 void SetLinkDownCallback(Callback<void> linkDown);
495 /* Next functions are not pure virtual so non QoS WifiMacs are not
496 * forced to implement them.
497 */
498
499 /**
500 * Notify that channel on the given link has been switched.
501 *
502 * @param linkId the ID of the given link
503 */
504 virtual void NotifyChannelSwitching(uint8_t linkId);
505
506 /**
507 * @param packet the packet being enqueued
508 *
509 * Public method used to fire a MacTx trace. Implemented for encapsulation purposes.
510 * Note this trace indicates that the packet was accepted by the device only.
511 * The packet may be dropped later (e.g. if the queue is full).
512 */
513 void NotifyTx(Ptr<const Packet> packet);
514 /**
515 * @param packet the packet being dropped
516 *
517 * Public method used to fire a MacTxDrop trace.
518 * This trace indicates that the packet was dropped before it was queued for
519 * transmission (e.g. when a STA is not associated with an AP).
520 */
521 void NotifyTxDrop(Ptr<const Packet> packet);
522 /**
523 * @param packet the packet we received
524 *
525 * Public method used to fire a MacRx trace. Implemented for encapsulation purposes.
526 */
527 void NotifyRx(Ptr<const Packet> packet);
528 /**
529 * @param packet the packet we received promiscuously
530 *
531 * Public method used to fire a MacPromiscRx trace. Implemented for encapsulation purposes.
532 */
534 /**
535 * @param packet the packet we received but is not destined for us
536 *
537 * Public method used to fire a MacRxDrop trace. Implemented for encapsulation purposes.
538 */
539 void NotifyRxDrop(Ptr<const Packet> packet);
540
541 /**
542 * Notify that the given TXOP is requesting channel access on the given link.
543 *
544 * @param txop the DCF/EDCAF requesting channel access
545 * @param linkId the ID of the given link
546 */
547 virtual void NotifyRequestAccess(Ptr<Txop> txop, uint8_t linkId);
548
549 /**
550 * Notify that the given TXOP has released the channel on the given link.
551 *
552 * @param txop the DCF/EDCAF releasing the channel
553 * @param linkId the ID of the given link
554 */
555 virtual void NotifyChannelReleased(Ptr<Txop> txop, uint8_t linkId);
556
557 /**
558 * @return pointer to HtConfiguration if it exists
559 */
561 /**
562 * @return pointer to VhtConfiguration if it exists
563 */
565 /**
566 * @return pointer to HeConfiguration if it exists
567 */
569 /**
570 * @return pointer to EhtConfiguration if it exists
571 */
573
574 /**
575 * Return the extended capabilities of the device.
576 *
577 * @return the extended capabilities that we support
578 */
580 /**
581 * Return the HT capabilities of the device for the given link.
582 *
583 * @param linkId the ID of the given link
584 * @return the HT capabilities that we support
585 */
586 HtCapabilities GetHtCapabilities(uint8_t linkId) const;
587 /**
588 * Return the VHT capabilities of the device for the given link.
589 *
590 * @param linkId the ID of the given link
591 * @return the VHT capabilities that we support
592 */
593 VhtCapabilities GetVhtCapabilities(uint8_t linkId) const;
594 /**
595 * Return the HE capabilities of the device for the given link.
596 *
597 * @param linkId the ID of the given link
598 * @return the HE capabilities that we support
599 */
600 HeCapabilities GetHeCapabilities(uint8_t linkId) const;
601 /**
602 * Return the HE 6GHz band capabilities of the device for the given 6 GHz link.
603 *
604 * @param linkId the ID of the given 6 GHz link
605 * @return the HE 6GHz band capabilities that we support
606 */
608 /**
609 * Return the EHT capabilities of the device for the given link.
610 *
611 * @param linkId the ID of the given link
612 * @return the EHT capabilities that we support
613 */
614 EhtCapabilities GetEhtCapabilities(uint8_t linkId) const;
615
616 /**
617 * Return whether the device supports QoS.
618 *
619 * @return true if QoS is supported, false otherwise
620 */
621 bool GetQosSupported() const;
622 /**
623 * Return whether the device supports ERP on the given link.
624 *
625 * @param linkId the ID of the given link
626 * @return true if ERP is supported, false otherwise
627 */
628 bool GetErpSupported(uint8_t linkId) const;
629 /**
630 * Return whether the device supports DSSS on the given link.
631 *
632 * @param linkId the ID of the given link
633 * @return true if DSSS is supported, false otherwise
634 */
635 bool GetDsssSupported(uint8_t linkId) const;
636 /**
637 * Return whether the device supports HT on the given link.
638 *
639 * @param linkId the ID of the given link.
640 * @return true if HT is supported, false otherwise
641 */
642 bool GetHtSupported(uint8_t linkId) const;
643 /**
644 * Return whether the device supports VHT on the given link.
645 *
646 * @param linkId the ID of the given link.
647 * @return true if VHT is supported, false otherwise
648 */
649 bool GetVhtSupported(uint8_t linkId) const;
650 /**
651 * Return whether the device supports HE.
652 *
653 * @return true if HE is supported, false otherwise
654 */
655 bool GetHeSupported() const;
656 /**
657 * Return whether the device supports EHT.
658 *
659 * @return true if EHT is supported, false otherwise
660 */
661 bool GetEhtSupported() const;
662
663 /**
664 * @param address the (link or MLD) address of a remote station
665 * @return true if the remote station with the given address supports HT
666 */
667 bool GetHtSupported(const Mac48Address& address) const;
668 /**
669 * @param address the (link or MLD) address of a remote station
670 * @return true if the remote station with the given address supports VHT
671 */
672 bool GetVhtSupported(const Mac48Address& address) const;
673 /**
674 * @param address the (link or MLD) address of a remote station
675 * @return true if the remote station with the given address supports HE
676 */
677 bool GetHeSupported(const Mac48Address& address) const;
678 /**
679 * @param address the (link or MLD) address of a remote station
680 * @return true if the remote station with the given address supports EHT
681 */
682 bool GetEhtSupported(const Mac48Address& address) const;
683
684 /**
685 * Enable or disable Robust AV Streaming support for the device.
686 *
687 * @param enable whether Robust AV Streaming is supported
688 */
689 void SetRobustAVStreamingSupported(bool enable);
690 /**
691 * Return whether the device supports Robust AV Streaming.
692 *
693 * @return true if Robust AV Streaming is supported, false otherwise
694 */
696
697 /**
698 * Return the maximum A-MPDU size of the given Access Category.
699 *
700 * @param ac Access Category index
701 * @return the maximum A-MPDU size
702 */
704 /**
705 * Return the maximum A-MSDU size of the given Access Category.
706 *
707 * @param ac Access Category index
708 * @return the maximum A-MSDU size
709 */
710 uint16_t GetMaxAmsduSize(AcIndex ac) const;
711
712 /// optional const reference to OriginatorBlockAckAgreement
714 std::optional<std::reference_wrapper<const OriginatorBlockAckAgreement>>;
715 /// optional const reference to RecipientBlockAckAgreement
717 std::optional<std::reference_wrapper<const RecipientBlockAckAgreement>>;
718
719 /**
720 * @param recipient (link or device) MAC address of the recipient
721 * @param tid traffic ID
722 * @param gcrGroupAddr the GCR Group Address (only if it is a GCR Block Ack agreement)
723 *
724 * @return the originator block ack agreement, if one has been established
725 *
726 * Checks if an originator block ack agreement is established with station addressed by
727 * <i>recipient</i> for TID <i>tid</i>.
728 */
730 Mac48Address recipient,
731 uint8_t tid,
732 std::optional<Mac48Address> gcrGroupAddr = std::nullopt) const;
733 /**
734 * @param originator (link or device) MAC address of the originator
735 * @param tid traffic ID
736 * @param gcrGroupAddr the GCR Group Address (only if it is a GCR Block Ack agreement)
737 *
738 * @return the recipient block ack agreement, if one has been established
739 *
740 * Checks if a recipient block ack agreement is established with station addressed by
741 * <i>originator</i> for TID <i>tid</i>.
742 */
744 Mac48Address originator,
745 uint8_t tid,
746 std::optional<Mac48Address> gcrGroupAddr = std::nullopt) const;
747
748 /**
749 * @param recipient MAC address
750 * @param tid traffic ID
751 *
752 * @return the type of Block Acks sent by the recipient
753 *
754 * This function returns the type of Block Acks sent by the recipient.
755 */
756 BlockAckType GetBaTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const;
757 /**
758 * @param recipient MAC address of recipient
759 * @param tid traffic ID
760 *
761 * @return the type of Block Ack Requests sent to the recipient
762 *
763 * This function returns the type of Block Ack Requests sent to the recipient.
764 */
765 BlockAckReqType GetBarTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const;
766 /**
767 * @param originator MAC address of originator
768 * @param tid traffic ID
769 *
770 * @return the type of Block Acks sent to the originator
771 *
772 * This function returns the type of Block Acks sent to the originator.
773 */
774 BlockAckType GetBaTypeAsRecipient(Mac48Address originator, uint8_t tid) const;
775 /**
776 * @param originator MAC address of originator
777 * @param tid traffic ID
778 *
779 * @return the type of Block Ack Requests sent by the originator
780 *
781 * This function returns the type of Block Ack Requests sent by the originator.
782 */
783 BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const;
784
785 /**
786 * Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device,
787 * if any, or by this device, otherwise, based on the supported standard.
788 *
789 * @param address the (MLD or link) address of the given device
790 * @return the maximum supported Block Ack buffer size (in number of MPDUs)
791 */
792 uint16_t GetMaxBaBufferSize(std::optional<Mac48Address> address = std::nullopt) const;
793
794 /**
795 * @param size the size (in number of MPDUs) of the buffer used for each BlockAck
796 * agreement in which this node is a recipient
797 */
798 void SetMpduBufferSize(uint16_t size);
799
800 /**
801 * @return the size (in number of MPDUs) of the buffer used for each BlockAck
802 * agreement in which this node is a recipient
803 */
804 uint16_t GetMpduBufferSize() const;
805
806 /**
807 * Set the frame retry limit.
808 *
809 * @param limit the frame retry limit
810 */
811 void SetFrameRetryLimit(uint32_t limit);
812
813 /**
814 * @return the frame retry limit
815 */
817
818 /**
819 * Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction.
820 * An empty mapping indicates the default mapping.
821 *
822 * @param mldAddr the MLD address of the given MLD
823 * @param dir the given direction (DL or UL)
824 * @return the negotiated TID-to-Link Mapping
825 */
826 std::optional<std::reference_wrapper<const WifiTidLinkMapping>> GetTidToLinkMapping(
827 Mac48Address mldAddr,
828 WifiDirection dir) const;
829
830 /**
831 * Check whether the given TID is mapped on the given link in the given direction for the
832 * given MLD.
833 *
834 * @param mldAddr the MLD address of the given MLD
835 * @param dir the given direction (DL or UL)
836 * @param tid the given TID
837 * @param linkId the ID of the given link
838 * @return whether the given TID is mapped on the given link in the given direction for the
839 * given MLD
840 */
841 bool TidMappedOnLink(Mac48Address mldAddr,
843 uint8_t tid,
844 uint8_t linkId) const;
845
846 /// Information reported by ICF drop trace
848 {
849 WifiIcfDrop reason{}; ///< the reason why the ICF was dropped by the EMLSR client
850 uint8_t linkId{}; ///< the ID of the link on which the ICF was dropped
851 Mac48Address sender; ///< the sender of the ICF
852 };
853
854 /**
855 * TracedCallback signature for ICF drop events.
856 *
857 * @param info information reported by ICF drop trace
858 */
859 typedef void (*IcfDropCallback)(const IcfDropInfo& info);
860
861 /// TracedCallback for ICF drop events typedef
863
864 protected:
865 void DoInitialize() override;
866 void DoDispose() override;
867 void NotifyConstructionCompleted() override;
868
869 /**
870 * @param cwMin the minimum contention window size
871 * @param cwMax the maximum contention window size
872 *
873 * This method is called to set the minimum and the maximum
874 * contention window size.
875 */
876 virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax);
877
878 /**
879 * Enable or disable short slot time feature.
880 *
881 * @param enable true if short slot time is to be supported,
882 * false otherwise
883 */
884 void SetShortSlotTimeSupported(bool enable);
885 /**
886 * @return whether the device supports short slot time capability.
887 */
888 bool GetShortSlotTimeSupported() const;
889
890 /**
891 * Accessor for the AC_VO channel access function
892 *
893 * @return a smart pointer to QosTxop
894 */
895 Ptr<QosTxop> GetVOQueue() const;
896 /**
897 * Accessor for the AC_VI channel access function
898 *
899 * @return a smart pointer to QosTxop
900 */
901 Ptr<QosTxop> GetVIQueue() const;
902 /**
903 * Accessor for the AC_BE channel access function
904 *
905 * @return a smart pointer to QosTxop
906 */
907 Ptr<QosTxop> GetBEQueue() const;
908 /**
909 * Accessor for the AC_BK channel access function
910 *
911 * @return a smart pointer to QosTxop
912 */
913 Ptr<QosTxop> GetBKQueue() const;
914
915 /**
916 * This method acts as the MacRxMiddle receive callback and is
917 * invoked to notify us that a frame has been received on the given link.
918 * The implementation is intended to capture logic that is going to be
919 * common to all (or most) derived classes. Specifically, handling
920 * of Block Ack management frames is dealt with here.
921 *
922 * This method will need, however, to be overridden by derived
923 * classes so that they can perform their data handling before
924 * invoking the base version.
925 *
926 * The given link may be undefined in some cases (e.g., in case of
927 * QoS Data frames received in the context of a Block Ack agreement --
928 * because the BlockAckManager does not have to record the link each
929 * buffered MPDU has been received on); in such a cases, the value
930 * of <i>linkId</i> should be WIFI_LINKID_UNDEFINED.
931 *
932 * @param mpdu the MPDU that has been received.
933 * @param linkId the ID of the given link
934 */
935 virtual void Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId);
936 /**
937 * Forward the packet up to the device.
938 *
939 * @param packet the packet that we are forwarding up to the device
940 * @param from the address of the source
941 * @param to the address of the destination
942 */
944
945 /**
946 * This method can be called to de-aggregate an A-MSDU and forward
947 * the constituent packets up the stack.
948 *
949 * @param mpdu the MPDU containing the A-MSDU.
950 */
952
953 /**
954 * Apply the TID-to-Link Mapping negotiated with the given MLD for the given direction
955 * by properly configuring the queue scheduler.
956 *
957 * @param mldAddr the MLD MAC address of the given MLD
958 * @param dir the given direction (DL or UL)
959 */
961
962 /**
963 * Swap the links based on the information included in the given map. This method
964 * is normally called by a non-AP MLD upon completing ML setup to have its link IDs
965 * match AP MLD's link IDs.
966 *
967 * @param links a set of pairs (from, to) each mapping a current link ID to the
968 * link ID it has to become (i.e., link 'from' becomes link 'to')
969 */
970 void SwapLinks(std::map<uint8_t, uint8_t> links);
971
972 /**
973 * Structure holding information specific to a single link. Here, the meaning of
974 * "link" is that of the 11be amendment which introduced multi-link devices. For
975 * previous amendments, only one link can be created. Therefore, "link" has not
976 * to be confused with the general concept of link for a NetDevice (used by the
977 * m_linkUp and m_linkDown callbacks).
978 */
980 {
981 /// Destructor (a virtual method is needed to make this struct polymorphic)
982 virtual ~LinkEntity();
983
984 Ptr<WifiPhy> phy; //!< Wifi PHY object
985 Ptr<ChannelAccessManager> channelAccessManager; //!< channel access manager object
986 Ptr<FrameExchangeManager> feManager; //!< Frame Exchange Manager object
987 Ptr<WifiRemoteStationManager> stationManager; //!< Remote station manager (rate control,
988 //!< RTS/CTS/fragmentation thresholds etc.)
989 bool erpSupported{false}; //!< set to \c true iff this WifiMac is to model 802.11g
990 bool dsssSupported{false}; //!< set to \c true iff this WifiMac is to model 802.11b
991 };
992
993 /**
994 * @return a const reference to the map of link entities
995 */
996 const std::map<uint8_t, std::unique_ptr<LinkEntity>>& GetLinks() const;
997
998 /**
999 * Get a reference to the link associated with the given ID.
1000 *
1001 * @param linkId the given link ID
1002 * @return a reference to the link associated with the given ID
1003 */
1004 LinkEntity& GetLink(uint8_t linkId) const;
1005
1006 /**
1007 * Update the TID-to-Link Mappings for the given MLD in the given direction based on the
1008 * given negotiated mappings. An empty mapping indicates the default mapping.
1009 *
1010 * @param mldAddr the MLD address of the given MLD
1011 * @param dir the given direction (DL or UL)
1012 * @param mapping the negotiated TID-to-Link Mapping
1013 */
1014 void UpdateTidToLinkMapping(const Mac48Address& mldAddr,
1016 const WifiTidLinkMapping& mapping);
1017
1018 /**
1019 * Update capabilities information from the given management frame.
1020 *
1021 * @param frame the body of the given management frame
1022 * @param addr MAC address of the sender
1023 * @param linkId ID of the link the management frame was received over
1024 */
1025 void RecordCapabilities(const MgtFrameType& frame, const Mac48Address& addr, uint8_t linkId);
1026
1027 UniformRandomBitGenerator m_shuffleLinkIdsGen; //!< random number generator to shuffle link IDs
1028
1029 Ptr<MacRxMiddle> m_rxMiddle; //!< RX middle (defragmentation etc.)
1030 Ptr<MacTxMiddle> m_txMiddle; //!< TX middle (aggregation etc.)
1031 Ptr<Txop> m_txop; //!< TXOP used for transmission of frames to non-QoS peers.
1032 Ptr<WifiMacQueueScheduler> m_scheduler; //!< wifi MAC queue scheduler
1033
1034 Callback<void> m_linkUp; //!< Callback when a link is up
1035 Callback<void> m_linkDown; //!< Callback when a link is down
1036
1037 private:
1038 /**
1039 * Complete the configuration of the MAC layer components.
1040 */
1041 void CompleteConfig();
1042
1043 /**
1044 * Allow subclasses to complete the configuration of the MAC layer components.
1045 */
1046 virtual void DoCompleteConfig() = 0;
1047
1048 /**
1049 * @param dcf the DCF to be configured
1050 * @param cwmin the minimum contention window for the DCF
1051 * @param cwmax the maximum contention window for the DCF
1052 * @param isDsss vector of flags to indicate whether PHY is DSSS or HR/DSSS for every link
1053 * @param ac the access category for the DCF
1054 *
1055 * Configure the DCF with appropriate values depending on the given access category.
1056 */
1057 void ConfigureDcf(Ptr<Txop> dcf,
1058 uint32_t cwmin,
1059 uint32_t cwmax,
1060 std::list<bool> isDsss,
1061 AcIndex ac);
1062
1063 /**
1064 * Configure PHY dependent parameters such as CWmin and CWmax on the given link.
1065 *
1066 * @param linkId the ID of the given link
1067 */
1068 void ConfigurePhyDependentParameters(uint8_t linkId);
1069
1070 /**
1071 * Enable or disable QoS support for the device. Construct a Txop object or QosTxop objects
1072 * accordingly. This method is private so that it is only used while constructing this object.
1073 *
1074 * @param enable whether QoS is supported
1075 */
1076 void SetQosSupported(bool enable);
1077
1078 /**
1079 * Set the Txop object.
1080 * This method is private so that it is only used while constructing this object.
1081 *
1082 * @param dcf the Txop object
1083 */
1084 void SetTxop(Ptr<Txop> dcf);
1085
1086 /**
1087 * Set the AC_VO channel access function
1088 * This method is private so that it is only used while constructing this object.
1089 *
1090 * @param edca the QosTxop object for AC_VO
1091 */
1092 void SetVoQueue(Ptr<QosTxop> edca);
1093
1094 /**
1095 * Set the AC_VI channel access function
1096 * This method is private so that it is only used while constructing this object.
1097 *
1098 * @param edca the QosTxop object for AC_VI
1099 */
1100 void SetViQueue(Ptr<QosTxop> edca);
1101
1102 /**
1103 * Set the AC_BE channel access function
1104 * This method is private so that it is only used while constructing this object.
1105 *
1106 * @param edca the QosTxop object for AC_BE
1107 */
1108 void SetBeQueue(Ptr<QosTxop> edca);
1109
1110 /**
1111 * Set the AC_BK channel access function
1112 * This method is private so that it is only used while constructing this object.
1113 *
1114 * @param edca the QosTxop object for AC_BK
1115 */
1116 void SetBkQueue(Ptr<QosTxop> edca);
1117
1118 /**
1119 * This method is a private utility invoked to configure the channel
1120 * access function for devices that do not support QoS.
1121 */
1122 void SetupDcfQueue();
1123
1124 /**
1125 * This method is a private utility invoked to configure the channel
1126 * access function for the specified Access Category.
1127 *
1128 * @param ac the Access Category of the queue to initialise.
1129 */
1130 void SetupEdcaQueue(AcIndex ac);
1131
1132 /**
1133 * If no link has been already created, create the given number links; otherwise, do nothing.
1134 *
1135 * @param nLinks the given number of links
1136 * @return whether the given number of links have been created
1137 */
1138 bool CreateLinksIfNeeded(std::size_t nLinks);
1139
1140 /**
1141 * Create a LinkEntity object.
1142 *
1143 * @return a unique pointer to the created LinkEntity object
1144 */
1145 virtual std::unique_ptr<LinkEntity> CreateLinkEntity() const;
1146
1147 /**
1148 * This method is intended to be called when a link changes ID in order to update the
1149 * link ID stored by the Frame Exchange Manager and the Channel Access Manager operating
1150 * on that link.
1151 *
1152 * @param id the (new) ID of the link that has changed ID
1153 */
1154 void UpdateLinkId(uint8_t id);
1155
1156 /**
1157 * This method is called if this device is an MLD to determine the MAC address of
1158 * the affiliated STA used to communicate with the single link device having the
1159 * given MAC address. This method is overridden because its implementation depends
1160 * on the type of station.
1161 *
1162 * @param remoteAddr the MAC address of the remote single link device
1163 * @return the MAC address of the affiliated STA used to communicate with the remote device
1164 */
1165 virtual Mac48Address DoGetLocalAddress(const Mac48Address& remoteAddr) const;
1166
1167 /**
1168 * Enable or disable ERP support for the given link.
1169 *
1170 * @param enable whether ERP is supported
1171 * @param linkId the ID of the given link
1172 */
1173 void SetErpSupported(bool enable, uint8_t linkId);
1174 /**
1175 * Enable or disable DSSS support for the given link.
1176 *
1177 * @param enable whether DSSS is supported
1178 * @param linkId the ID of the given link
1179 */
1180 void SetDsssSupported(bool enable, uint8_t linkId);
1181
1182 /**
1183 * Set the block ack threshold for AC_VO.
1184 *
1185 * @param threshold the block ack threshold for AC_VO.
1186 */
1187 void SetVoBlockAckThreshold(uint8_t threshold);
1188 /**
1189 * Set the block ack threshold for AC_VI.
1190 *
1191 * @param threshold the block ack threshold for AC_VI.
1192 */
1193 void SetViBlockAckThreshold(uint8_t threshold);
1194 /**
1195 * Set the block ack threshold for AC_BE.
1196 *
1197 * @param threshold the block ack threshold for AC_BE.
1198 */
1199 void SetBeBlockAckThreshold(uint8_t threshold);
1200 /**
1201 * Set the block ack threshold for AC_BK.
1202 *
1203 * @param threshold the block ack threshold for AC_BK.
1204 */
1205 void SetBkBlockAckThreshold(uint8_t threshold);
1206
1207 /**
1208 * Set VO block ack inactivity timeout.
1209 *
1210 * @param timeout the VO block ack inactivity timeout.
1211 */
1213 /**
1214 * Set VI block ack inactivity timeout.
1215 *
1216 * @param timeout the VI block ack inactivity timeout.
1217 */
1219 /**
1220 * Set BE block ack inactivity timeout.
1221 *
1222 * @param timeout the BE block ack inactivity timeout.
1223 */
1225 /**
1226 * Set BK block ack inactivity timeout.
1227 *
1228 * @param timeout the BK block ack inactivity timeout.
1229 */
1231
1232 /**
1233 * @param mpdu the MPDU to send.
1234 * @param to the address to which the packet should be sent.
1235 * @param from the address from which the packet should be sent.
1236 *
1237 * Subclasses need to implement this method to finalize the MAC header of the MPDU
1238 * (MAC addresses and ToDS/FromDS flags) and enqueue the MPDU in a TX queue.
1239 */
1240 virtual void Enqueue(Ptr<WifiMpdu> mpdu, Mac48Address to, Mac48Address from) = 0;
1241
1242 /**
1243 * Allow subclasses to take actions when a packet to enqueue has been dropped.
1244 *
1245 * @param packet the dropped packet
1246 * @param to the address to which the packet should have been sent
1247 */
1248 virtual void NotifyDropPacketToEnqueue(Ptr<Packet> packet, Mac48Address to);
1249
1250 /**
1251 * Notify the remote station manager if the given expired (hence dropped) MPDU is a management
1252 * or data frame (with a unicast receiver address) that has been already transmitted and is not
1253 * in flight (otherwise, it is handled when the ack is received or the TX timeout expires).
1254 *
1255 * @param mpdu the expired MPDU
1256 */
1258
1259 /**
1260 * This Boolean is set \c true iff this WifiMac is to model
1261 * 802.11e/WMM style Quality of Service. It is exposed through the
1262 * attribute system.
1263 *
1264 * At the moment, this flag is the sole selection between QoS and
1265 * non-QoS operation for the STA (whether IBSS, AP, or
1266 * non-AP). Ultimately, we will want a QoS-enabled STA to be able to
1267 * fall back to non-QoS operation with a non-QoS peer. This'll
1268 * require further intelligence - i.e., per-association QoS
1269 * state. Having a big switch seems like a good intermediate stage,
1270 * however.
1271 */
1273
1274 bool m_shortSlotTimeSupported; ///< flag whether short slot time is supported
1275 bool m_ctsToSelfSupported; ///< flag indicating whether CTS-To-Self is supported
1276
1277 TypeOfStation m_typeOfStation; //!< the type of station
1278
1279 Ptr<WifiNetDevice> m_device; //!< Pointer to the device
1280 std::map<uint8_t, std::unique_ptr<LinkEntity>> m_links; //!< ID-indexed map of Link objects
1281 std::set<uint8_t> m_linkIds; //!< IDs of the links in use
1282
1283 Mac48Address m_address; //!< MAC address of this station
1284 Ssid m_ssid; //!< Service Set ID (SSID)
1285
1286 /** This type defines a mapping between an Access Category index,
1287 and a pointer to the corresponding channel access function.
1288 Access Categories are sorted in decreasing order of priority. */
1289 typedef std::map<AcIndex, Ptr<QosTxop>, std::greater<>> EdcaQueues;
1290
1291 /** This is a map from Access Category index to the corresponding
1292 channel access function */
1294
1295 uint16_t m_voMaxAmsduSize; ///< maximum A-MSDU size for AC_VO (in bytes)
1296 uint16_t m_viMaxAmsduSize; ///< maximum A-MSDU size for AC_VI (in bytes)
1297 uint16_t m_beMaxAmsduSize; ///< maximum A-MSDU size for AC_BE (in bytes)
1298 uint16_t m_bkMaxAmsduSize; ///< maximum A-MSDU size for AC_BK (in bytes)
1299
1300 uint32_t m_voMaxAmpduSize; ///< maximum A-MPDU size for AC_VO (in bytes)
1301 uint32_t m_viMaxAmpduSize; ///< maximum A-MPDU size for AC_VI (in bytes)
1302 uint32_t m_beMaxAmpduSize; ///< maximum A-MPDU size for AC_BE (in bytes)
1303 uint32_t m_bkMaxAmpduSize; ///< maximum A-MPDU size for AC_BK (in bytes)
1304
1305 uint16_t m_mpduBufferSize; //!< BlockAck buffer size (in number of MPDUs)
1306 uint32_t m_frameRetryLimit; //!< the frame retry limit
1307
1308 bool m_robustAVStreamingSupported; ///< flag whether robust AV streaming is supported
1309
1310 /// @brief DL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address)
1311 std::unordered_map<Mac48Address, WifiTidLinkMapping, WifiAddressHash> m_dlTidLinkMappings;
1312 /// @brief UL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address)
1313 std::unordered_map<Mac48Address, WifiTidLinkMapping, WifiAddressHash> m_ulTidLinkMappings;
1314
1315 ForwardUpCallback m_forwardUp; //!< Callback to forward packet up the stack
1316
1317 /**
1318 * The trace source fired when packets come into the "top" of the device
1319 * at the L3/L2 transition, before being queued for transmission.
1320 *
1321 * @see class CallBackTraceSource
1322 */
1324 /**
1325 * The trace source fired when packets coming into the "top" of the device
1326 * are dropped at the MAC layer before being queued for transmission.
1327 *
1328 * @see class CallBackTraceSource
1329 */
1331 /**
1332 * The trace source fired for packets successfully received by the device
1333 * immediately before being forwarded up to higher layers (at the L2/L3
1334 * transition). This is a promiscuous trace.
1335 *
1336 * @see class CallBackTraceSource
1337 */
1339 /**
1340 * The trace source fired for packets successfully received by the device
1341 * immediately before being forwarded up to higher layers (at the L2/L3
1342 * transition). This is a non- promiscuous trace.
1343 *
1344 * @see class CallBackTraceSource
1345 */
1347 /**
1348 * The trace source fired when packets coming into the "top" of the device
1349 * are dropped at the MAC layer during reception.
1350 *
1351 * @see class CallBackTraceSource
1352 */
1354
1355 /**
1356 * TracedCallback signature for MPDU drop events.
1357 *
1358 * @param reason the reason why the MPDU was dropped (\see WifiMacDropReason)
1359 * @param mpdu the dropped MPDU
1360 */
1362
1363 /// TracedCallback for MPDU drop events typedef
1365
1366 /**
1367 * This trace indicates that an MPDU was dropped for the given reason.
1368 */
1370
1371 /// TracedCallback for acked/nacked MPDUs typedef
1373
1374 MpduTracedCallback m_ackedMpduCallback; ///< ack'ed MPDU callback
1375 MpduTracedCallback m_nackedMpduCallback; ///< nack'ed MPDU callback
1376
1377 /**
1378 * TracedCallback signature for MPDU response timeout events.
1379 *
1380 * @param reason the reason why the timer was started
1381 * @param mpdu the MPDU whose response was not received before the timeout
1382 * @param txVector the TXVECTOR used to transmit the MPDU
1383 */
1384 typedef void (*MpduResponseTimeoutCallback)(uint8_t reason,
1386 const WifiTxVector& txVector);
1387
1388 /// TracedCallback for MPDU response timeout events typedef
1391
1392 /**
1393 * MPDU response timeout traced callback.
1394 * This trace source is fed by a WifiTxTimer object.
1395 */
1397
1398 /**
1399 * TracedCallback signature for PSDU response timeout events.
1400 *
1401 * @param reason the reason why the timer was started
1402 * @param psdu the PSDU whose response was not received before the timeout
1403 * @param txVector the TXVECTOR used to transmit the PSDU
1404 */
1405 typedef void (*PsduResponseTimeoutCallback)(uint8_t reason,
1407 const WifiTxVector& txVector);
1408
1409 /// TracedCallback for PSDU response timeout events typedef
1412
1413 /**
1414 * PSDU response timeout traced callback.
1415 * This trace source is fed by a WifiTxTimer object.
1416 */
1418
1419 /**
1420 * TracedCallback signature for PSDU map response timeout events.
1421 *
1422 * @param reason the reason why the timer was started
1423 * @param psduMap the PSDU map for which not all responses were received before the timeout
1424 * @param missingStations the MAC addresses of the stations that did not respond
1425 * @param nTotalStations the total number of stations that had to respond
1426 */
1427 typedef void (*PsduMapResponseTimeoutCallback)(uint8_t reason,
1428 WifiPsduMap* psduMap,
1429 const std::set<Mac48Address>* missingStations,
1430 std::size_t nTotalStations);
1431
1432 /// TracedCallback for PSDU map response timeout events typedef
1435
1436 /**
1437 * PSDU map response timeout traced callback.
1438 * This trace source is fed by a WifiTxTimer object.
1439 */
1441
1442 IcfDropTracedCallback m_icfDropCallback; //!< traced callback for ICF drop events
1443};
1444
1445} // namespace ns3
1446
1447#endif /* WIFI_MAC_H */
Callback template class.
Definition callback.h:428
Manage a set of ns3::Txop.
The IEEE 802.11be EHT Capabilities.
EHT configuration.
The Extended Capabilities Information Element.
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263).
The IEEE 802.11ax HE Capabilities.
HE configuration.
The HT Capabilities Information Element.
HT configuration.
an EUI-48 address
This class handles duplicate detection and recomposition of fragments.
Handles sequence numbering of IEEE 802.11 data frames.
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Maintains the state and information about transmitted MPDUs with Ack Policy set to Block Ack for an o...
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
Definition qos-txop.h:52
Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreeme...
The IEEE 802.11 SSID Information Element.
Definition ssid.h:25
Forward calls to a chain of Callback.
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
Definition txop.h:56
a unique identifier for an interface.
Definition type-id.h:50
Wraps a UniformRandomVariable into a class that meets the requirements of a UniformRandomBitGenerator...
The uniform distribution Random Number Generator (RNG).
The IEEE 802.11ac VHT Capabilities.
VHT configuration.
virtual void DoCompleteConfig()=0
Allow subclasses to complete the configuration of the MAC layer components.
RecipientAgreementOptConstRef GetBaAgreementEstablishedAsRecipient(Mac48Address originator, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr=std::nullopt) const
Definition wifi-mac.cc:1942
uint16_t GetMaxAmsduSize(AcIndex ac) const
Return the maximum A-MSDU size of the given Access Category.
Definition wifi-mac.cc:2587
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
Definition wifi-mac.cc:1034
Ptr< QosTxop > GetBEQueue() const
Accessor for the AC_BE channel access function.
Definition wifi-mac.cc:652
virtual void NotifyChannelSwitching(uint8_t linkId)
Notify that channel on the given link has been switched.
Definition wifi-mac.cc:711
std::optional< Mac48Address > GetMldAddress(const Mac48Address &remoteAddr) const
Definition wifi-mac.cc:1878
virtual void SetMacQueueScheduler(Ptr< WifiMacQueueScheduler > scheduler)
Set the wifi MAC queue scheduler.
Definition wifi-mac.cc:698
Mac48Address GetBssid(uint8_t linkId) const
Definition wifi-mac.cc:547
void(* PsduResponseTimeoutCallback)(uint8_t reason, Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
TracedCallback signature for PSDU response timeout events.
Definition wifi-mac.h:1405
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
Definition wifi-mac.h:1296
bool m_shortSlotTimeSupported
flag whether short slot time is supported
Definition wifi-mac.h:1274
virtual void Enqueue(Ptr< WifiMpdu > mpdu, Mac48Address to, Mac48Address from)=0
void ConfigurePhyDependentParameters(uint8_t linkId)
Configure PHY dependent parameters such as CWmin and CWmax on the given link.
Definition wifi-mac.cc:958
Ptr< HeConfiguration > GetHeConfiguration() const
Definition wifi-mac.cc:2000
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
Definition wifi-mac.h:1369
TracedCallback< WifiMacDropReason, Ptr< const WifiMpdu > > DroppedMpduTracedCallback
TracedCallback for MPDU drop events typedef.
Definition wifi-mac.h:1364
TypeOfStation GetTypeOfStation() const
Return the type of station.
Definition wifi-mac.cc:491
uint32_t GetFrameRetryLimit() const
Definition wifi-mac.cc:2128
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service.
Definition wifi-mac.h:1272
void SetBkQueue(Ptr< QosTxop > edca)
Set the AC_BK channel access function This method is private so that it is only used while constructi...
Definition wifi-mac.cc:608
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & GetLinks() const
Definition wifi-mac.cc:1111
Ptr< Txop > GetTxop() const
Accessor for the Txop object.
Definition wifi-mac.cc:572
VhtCapabilities GetVhtCapabilities(uint8_t linkId) const
Return the VHT capabilities of the device for the given link.
Definition wifi-mac.cc:2280
Callback< void > m_linkDown
Callback when a link is down.
Definition wifi-mac.h:1035
bool GetQosSupported() const
Return whether the device supports QoS.
Definition wifi-mac.cc:1429
virtual void SetAddress(Mac48Address address)
Definition wifi-mac.cc:514
void SetFrameExchangeManagers(const std::vector< Ptr< FrameExchangeManager > > &feManagers)
Definition wifi-mac.cc:992
bool CreateLinksIfNeeded(std::size_t nLinks)
If no link has been already created, create the given number links; otherwise, do nothing.
Definition wifi-mac.cc:976
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
Definition wifi-mac.h:1031
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Definition wifi-mac.cc:1421
Mac48Address m_address
MAC address of this station.
Definition wifi-mac.h:1283
std::set< uint8_t > m_linkIds
IDs of the links in use.
Definition wifi-mac.h:1281
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
Definition wifi-mac.cc:705
uint16_t GetMpduBufferSize() const
Definition wifi-mac.cc:2115
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Definition wifi-mac.cc:1126
BlockAckType GetBaTypeAsRecipient(Mac48Address originator, uint8_t tid) const
Definition wifi-mac.cc:1970
void SwapLinks(std::map< uint8_t, uint8_t > links)
Swap the links based on the information included in the given map.
Definition wifi-mac.cc:1192
void Enqueue(Ptr< Packet > packet, Mac48Address to)
Definition wifi-mac.cc:1753
void UnblockUnicastTxOnLinks(WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds)
Unblock the transmission on the given links of all unicast frames addressed to the station with the g...
Definition wifi-mac.cc:1640
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
Definition wifi-mac.h:1295
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.).
Definition wifi-mac.h:1029
Ptr< WifiMacQueueScheduler > m_scheduler
wifi MAC queue scheduler
Definition wifi-mac.h:1032
void DoInitialize() override
Initialize() implementation.
Definition wifi-mac.cc:418
TypeOfStation m_typeOfStation
the type of station
Definition wifi-mac.h:1277
uint16_t m_mpduBufferSize
BlockAck buffer size (in number of MPDUs).
Definition wifi-mac.h:1305
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
Definition wifi-mac.h:1302
void SetChannelAccessManagers(const std::vector< Ptr< ChannelAccessManager > > &caManagers)
Definition wifi-mac.cc:1040
bool TidMappedOnLink(Mac48Address mldAddr, WifiDirection dir, uint8_t tid, uint8_t linkId) const
Check whether the given TID is mapped on the given link in the given direction for the given MLD.
Definition wifi-mac.cc:1339
std::variant< MgtBeaconHeader, MgtProbeResponseHeader, MgtAssocResponseHeader > MgtFrameType
type of the management frames
Definition wifi-mac.h:108
Ssid GetSsid() const
Definition wifi-mac.cc:534
void SetWifiRemoteStationManagers(const std::vector< Ptr< WifiRemoteStationManager > > &stationManagers)
Definition wifi-mac.cc:1075
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
Definition wifi-mac.cc:2154
bool GetErpSupported(uint8_t linkId) const
Return whether the device supports ERP on the given link.
Definition wifi-mac.cc:1435
void ResetWifiPhys()
Remove currently attached WifiPhy objects from this MAC.
Definition wifi-mac.cc:1403
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
Definition wifi-mac.h:1323
void SetErpSupported(bool enable, uint8_t linkId)
Enable or disable ERP support for the given link.
Definition wifi-mac.cc:1441
bool GetTxBlockedOnLink(AcIndex ac, const WifiContainerQueueId &queueId, uint8_t linkId, WifiQueueBlockedReason reason=WifiQueueBlockedReason::REASONS_COUNT) const
Check whether the transmission of the packets in the given container queue of the given Access Catego...
Definition wifi-mac.cc:1703
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
Definition wifi-mac.h:1300
void(* MpduResponseTimeoutCallback)(uint8_t reason, Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector)
TracedCallback signature for MPDU response timeout events.
Definition wifi-mac.h:1384
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, std::list< bool > isDsss, AcIndex ac)
Definition wifi-mac.cc:818
TracedCallback< const IcfDropInfo & > IcfDropTracedCallback
TracedCallback for ICF drop events typedef.
Definition wifi-mac.h:862
WifiMac(const WifiMac &)=delete
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition wifi-mac.h:1279
bool GetRobustAVStreamingSupported() const
Return whether the device supports Robust AV Streaming.
Definition wifi-mac.cc:2619
void SetSsid(Ssid ssid)
Definition wifi-mac.cc:527
virtual void NotifyDropPacketToEnqueue(Ptr< Packet > packet, Mac48Address to)
Allow subclasses to take actions when a packet to enqueue has been dropped.
Definition wifi-mac.cc:1823
void UpdateLinkId(uint8_t id)
This method is intended to be called when a link changes ID in order to update the link ID stored by ...
Definition wifi-mac.cc:1138
IcfDropTracedCallback m_icfDropCallback
traced callback for ICF drop events
Definition wifi-mac.h:1442
Ptr< QosTxop > GetVOQueue() const
Accessor for the AC_VO channel access function.
Definition wifi-mac.cc:640
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Definition wifi-mac.cc:484
MpduTracedCallback m_ackedMpduCallback
ack'ed MPDU callback
Definition wifi-mac.h:1374
void NotifyRsmOfExpiredMpdu(Ptr< const WifiMpdu > mpdu)
Notify the remote station manager if the given expired (hence dropped) MPDU is a management or data f...
Definition wifi-mac.cc:1722
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Definition wifi-mac.cc:1397
void SetMpduBufferSize(uint16_t size)
Definition wifi-mac.cc:2106
void RecordCapabilities(const MgtFrameType &frame, const Mac48Address &addr, uint8_t linkId)
Update capabilities information from the given management frame.
Definition wifi-mac.cc:2627
MpduTracedCallback m_nackedMpduCallback
nack'ed MPDU callback
Definition wifi-mac.h:1375
bool GetEhtSupported() const
Return whether the device supports EHT.
Definition wifi-mac.cc:2033
void SetTxop(Ptr< Txop > dcf)
Set the Txop object.
Definition wifi-mac.cc:562
bool GetHeSupported() const
Return whether the device supports HE.
Definition wifi-mac.cc:2027
HtCapabilities GetHtCapabilities(uint8_t linkId) const
Return the HT capabilities of the device for the given link.
Definition wifi-mac.cc:2222
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
Definition wifi-mac.cc:2164
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
Definition wifi-mac.cc:2134
virtual std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const
Get the ID of the link having the given MAC address, if any.
Definition wifi-mac.cc:1158
void(* IcfDropCallback)(const IcfDropInfo &info)
TracedCallback signature for ICF drop events.
Definition wifi-mac.h:859
std::optional< std::reference_wrapper< const RecipientBlockAckAgreement > > RecipientAgreementOptConstRef
optional const reference to RecipientBlockAckAgreement
Definition wifi-mac.h:716
void NotifyPromiscRx(Ptr< const Packet > packet)
Definition wifi-mac.cc:742
std::unordered_map< Mac48Address, WifiTidLinkMapping, WifiAddressHash > m_dlTidLinkMappings
DL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address).
Definition wifi-mac.h:1311
void SetVoQueue(Ptr< QosTxop > edca)
Set the AC_VO channel access function This method is private so that it is only used while constructi...
Definition wifi-mac.cc:578
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the MAC has frames to transmit over the given link.
Definition wifi-mac.cc:681
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition wifi-mac.cc:1068
UniformRandomBitGenerator m_shuffleLinkIdsGen
random number generator to shuffle link IDs
Definition wifi-mac.h:1027
void ApplyTidLinkMapping(const Mac48Address &mldAddr, WifiDirection dir)
Apply the TID-to-Link Mapping negotiated with the given MLD for the given direction by properly confi...
Definition wifi-mac.cc:1512
void CompleteConfig()
Complete the configuration of the MAC layer components.
Definition wifi-mac.cc:907
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
Definition wifi-mac.cc:2194
virtual void NotifyChannelReleased(Ptr< Txop > txop, uint8_t linkId)
Notify that the given TXOP has released the channel on the given link.
Definition wifi-mac.cc:759
Ptr< EhtConfiguration > GetEhtConfiguration() const
Definition wifi-mac.cc:2006
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
Definition wifi-mac.h:1346
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
Definition wifi-mac.cc:2019
friend class WifiStaticSetupHelper
Definition wifi-mac.h:92
void SetDsssSupported(bool enable, uint8_t linkId)
Enable or disable DSSS support for the given link.
Definition wifi-mac.cc:1452
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 ...
Definition wifi-mac.h:1330
void BlockUnicastTxOnLinks(WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds)
Block the transmission on the given links of all unicast frames addressed to the station with the giv...
Definition wifi-mac.cc:1594
TracedCallback< Ptr< const WifiMpdu > > MpduTracedCallback
TracedCallback for acked/nacked MPDUs typedef.
Definition wifi-mac.h:1372
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.).
Definition wifi-mac.h:1030
void NotifyTx(Ptr< const Packet > packet)
Definition wifi-mac.cc:724
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition wifi-mac.cc:389
static TypeId GetTypeId()
Get the type ID.
Definition wifi-mac.cc:63
Ptr< HtConfiguration > GetHtConfiguration() const
Definition wifi-mac.cc:1988
void SetFrameRetryLimit(uint32_t limit)
Set the frame retry limit.
Definition wifi-mac.cc:2121
std::optional< std::reference_wrapper< const WifiTidLinkMapping > > GetTidToLinkMapping(Mac48Address mldAddr, WifiDirection dir) const
Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction.
Definition wifi-mac.cc:1323
uint32_t GetMaxAmpduSize(AcIndex ac) const
Return the maximum A-MPDU size of the given Access Category.
Definition wifi-mac.cc:2562
BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const
Definition wifi-mac.cc:1979
Ssid m_ssid
Service Set ID (SSID).
Definition wifi-mac.h:1284
std::map< uint8_t, std::unique_ptr< LinkEntity > > m_links
ID-indexed map of Link objects.
Definition wifi-mac.h:1280
virtual void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Definition wifi-mac.cc:1866
Ptr< QosTxop > GetVIQueue() const
Accessor for the AC_VI channel access function.
Definition wifi-mac.cc:646
void SetBssid(Mac48Address bssid, uint8_t linkId)
Definition wifi-mac.cc:540
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition wifi-mac.cc:508
void NotifyRx(Ptr< const Packet > packet)
Definition wifi-mac.cc:736
virtual Ptr< Txop > GetTxopFor(AcIndex ac) const
Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer,...
Definition wifi-mac.cc:671
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 ...
Definition wifi-mac.h:1353
void UpdateTidToLinkMapping(const Mac48Address &mldAddr, WifiDirection dir, const WifiTidLinkMapping &mapping)
Update the TID-to-Link Mappings for the given MLD in the given direction based on the given negotiate...
Definition wifi-mac.cc:1289
BlockAckType GetBaTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
Definition wifi-mac.cc:1952
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
Definition wifi-mac.h:1396
void SetForwardUpCallback(ForwardUpCallback upCallback)
Definition wifi-mac.cc:1491
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
Definition wifi-mac.h:1440
OriginatorAgreementOptConstRef GetBaAgreementEstablishedAsOriginator(Mac48Address recipient, uint8_t tid, std::optional< Mac48Address > gcrGroupAddr=std::nullopt) const
Definition wifi-mac.cc:1925
ExtendedCapabilities GetExtendedCapabilities() const
Return the extended capabilities of the device.
Definition wifi-mac.cc:2214
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
Definition wifi-mac.h:1338
std::map< AcIndex, Ptr< QosTxop >, std::greater<> > EdcaQueues
This type defines a mapping between an Access Category index, and a pointer to the corresponding chan...
Definition wifi-mac.h:1289
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
Definition wifi-mac.h:1298
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
Definition wifi-mac.cc:2204
std::unordered_map< Mac48Address, WifiTidLinkMapping, WifiAddressHash > m_ulTidLinkMappings
UL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address).
Definition wifi-mac.h:1313
virtual bool SupportsSendFrom() const
Definition wifi-mac.cc:1485
He6GhzBandCapabilities GetHe6GhzBandCapabilities(uint8_t linkId) const
Return the HE 6GHz band capabilities of the device for the given 6 GHz link.
Definition wifi-mac.cc:2421
uint16_t GetMaxBaBufferSize(std::optional< Mac48Address > address=std::nullopt) const
Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device,...
Definition wifi-mac.cc:2091
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,...
Definition wifi-mac.cc:664
std::optional< uint8_t > GetLinkForPhy(Ptr< const WifiPhy > phy) const
Get the ID of the link (if any) on which the given PHY is operating.
Definition wifi-mac.cc:1171
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
Definition wifi-mac.cc:2144
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
Definition wifi-mac.cc:2184
bool GetShortSlotTimeSupported() const
Definition wifi-mac.cc:1479
BlockAckReqType GetBarTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
Definition wifi-mac.cc:1961
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
Definition wifi-mac.cc:401
void SetupEdcaQueue(AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...
Definition wifi-mac.cc:775
void SetLinkDownCallback(Callback< void > linkDown)
Definition wifi-mac.cc:1505
bool m_robustAVStreamingSupported
flag whether robust AV streaming is supported
Definition wifi-mac.h:1308
Ptr< QosTxop > GetBKQueue() const
Accessor for the AC_BK channel access function.
Definition wifi-mac.cc:658
~WifiMac() override
Definition wifi-mac.cc:57
void SetPromisc()
Sets the interface in promiscuous mode.
Definition wifi-mac.cc:553
Ptr< VhtConfiguration > GetVhtConfiguration() const
Definition wifi-mac.cc:1994
void NotifyRxDrop(Ptr< const Packet > packet)
Definition wifi-mac.cc:748
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition wifi-mac.cc:1498
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Definition wifi-mac.cc:1099
const std::set< uint8_t > & GetLinkIds() const
Definition wifi-mac.cc:1132
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition wifi-mac.cc:497
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
Definition wifi-mac.cc:1465
Mac48Address GetLocalAddress(const Mac48Address &remoteAddr) const
Get the local MAC address used to communicate with a remote STA.
Definition wifi-mac.cc:1891
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Definition wifi-mac.h:1293
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
Definition wifi-mac.h:1303
virtual void NotifyRequestAccess(Ptr< Txop > txop, uint8_t linkId)
Notify that the given TXOP is requesting channel access on the given link.
Definition wifi-mac.cc:754
bool GetHtSupported(uint8_t linkId) const
Return whether the device supports HT on the given link.
Definition wifi-mac.cc:2012
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
Definition wifi-mac.cc:1829
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
Definition wifi-mac.cc:795
bool Is6GhzBand(uint8_t linkId) const
Indicate if a given link is on the 6 GHz band.
Definition wifi-mac.cc:1281
TracedCallback< uint8_t, Ptr< const WifiPsdu >, const WifiTxVector & > PsduResponseTimeoutTracedCallback
TracedCallback for PSDU response timeout events typedef.
Definition wifi-mac.h:1411
TracedCallback< uint8_t, Ptr< const WifiMpdu >, const WifiTxVector & > MpduResponseTimeoutTracedCallback
TracedCallback for MPDU response timeout events typedef.
Definition wifi-mac.h:1390
virtual void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Definition wifi-mac.cc:1836
std::optional< std::reference_wrapper< const OriginatorBlockAckAgreement > > OriginatorAgreementOptConstRef
optional const reference to OriginatorBlockAckAgreement
Definition wifi-mac.h:713
Mac48Address GetAddress() const
Definition wifi-mac.cc:521
void(* DroppedMpduCallback)(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
TracedCallback signature for MPDU drop events.
Definition wifi-mac.h:1361
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
Definition wifi-mac.h:1315
EhtCapabilities GetEhtCapabilities(uint8_t linkId) const
Return the EHT capabilities of the device for the given link.
Definition wifi-mac.cc:2456
TracedCallback< uint8_t, WifiPsduMap *, const std::set< Mac48Address > *, std::size_t > PsduMapResponseTimeoutTracedCallback
TracedCallback for PSDU map response timeout events typedef.
Definition wifi-mac.h:1434
Callback< void > m_linkUp
Callback when a link is up.
Definition wifi-mac.h:1034
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition wifi-mac.cc:1117
void SetupDcfQueue()
This method is a private utility invoked to configure the channel access function for devices that do...
Definition wifi-mac.cc:764
void SetBeQueue(Ptr< QosTxop > edca)
Set the AC_BE channel access function This method is private so that it is only used while constructi...
Definition wifi-mac.cc:598
HeCapabilities GetHeCapabilities(uint8_t linkId) const
Return the HE capabilities of the device for the given link.
Definition wifi-mac.cc:2357
WifiMac & operator=(const WifiMac &)=delete
virtual bool CanForwardPacketsTo(Mac48Address to) const =0
Return true if packets can be forwarded to the given destination, false otherwise.
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy > > &phys)
Definition wifi-mac.cc:1375
Callback< void, Ptr< const Packet >, Mac48Address, Mac48Address > ForwardUpCallback
This type defines the callback of a higher layer that a WifiMac(-derived) object invokes to pass a pa...
Definition wifi-mac.h:480
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
Definition wifi-mac.h:1417
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Definition wifi-mac.cc:618
void(* PsduMapResponseTimeoutCallback)(uint8_t reason, WifiPsduMap *psduMap, const std::set< Mac48Address > *missingStations, std::size_t nTotalStations)
TracedCallback signature for PSDU map response timeout events.
Definition wifi-mac.h:1427
void NotifyTxDrop(Ptr< const Packet > packet)
Definition wifi-mac.cc:730
void DoDispose() override
Destructor implementation.
Definition wifi-mac.cc:442
void SetRobustAVStreamingSupported(bool enable)
Enable or disable Robust AV Streaming support for the device.
Definition wifi-mac.cc:2612
uint32_t m_frameRetryLimit
the frame retry limit
Definition wifi-mac.h:1306
bool GetDsssSupported(uint8_t linkId) const
Return whether the device supports DSSS on the given link.
Definition wifi-mac.cc:1459
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
Definition wifi-mac.cc:1062
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
Definition wifi-mac.cc:2174
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
Definition wifi-mac.cc:1105
void SetViQueue(Ptr< QosTxop > edca)
Set the AC_VI channel access function This method is private so that it is only used while constructi...
Definition wifi-mac.cc:588
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
Definition wifi-mac.cc:1472
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
Definition wifi-mac.h:1275
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
Definition wifi-mac.h:1297
virtual Mac48Address DoGetLocalAddress(const Mac48Address &remoteAddr) const
This method is called if this device is an MLD to determine the MAC address of the affiliated STA use...
Definition wifi-mac.cc:1919
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
Definition wifi-mac.h:1301
This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" pa...
WifiMpdu stores a (const) packet along with a MAC header.
Definition wifi-mpdu.h:51
Hold together all Wifi-related objects.
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition wifi-psdu.h:33
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiIcfDrop
Reasons for an EMLSR client to drop an ICF.
TypeOfStation
Enumeration for type of WiFi station.
Definition wifi-mac.h:58
WifiMacDropReason
The reason why an MPDU was dropped.
Definition wifi-mac.h:71
WifiQueueBlockedReason
Enumeration of the reasons to block container queues.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition qos-utils.h:64
@ ADHOC_STA
Definition wifi-mac.h:61
@ MESH
Definition wifi-mac.h:62
@ STA
Definition wifi-mac.h:59
@ AP
Definition wifi-mac.h:60
@ OCB
Definition wifi-mac.h:63
@ WIFI_MAC_DROP_QOS_OLD_PACKET
Definition wifi-mac.h:75
@ WIFI_MAC_DROP_FAILED_ENQUEUE
Definition wifi-mac.h:72
@ WIFI_MAC_DROP_EXPIRED_LIFETIME
Definition wifi-mac.h:73
@ WIFI_MAC_DROP_REACHED_RETRY_LIMIT
Definition wifi-mac.h:74
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
Definition wifi-mac.h:78
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
Definition wifi-utils.h:295
WifiDirection
Wifi direction.
Definition wifi-utils.h:40
std::tuple< WifiContainerQueueType, WifiRcvAddr, Mac48Address, std::optional< uint8_t > > WifiContainerQueueId
Tuple (queue type, receiver address type, Address, TID) identifying a container queue.
std::map< tid_t, std::set< linkId_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
Definition wifi-utils.h:77
ns3::Time timeout
The different BlockAckRequest variants.
The different BlockAck variants.
Information reported by ICF drop trace.
Definition wifi-mac.h:848
Mac48Address sender
the sender of the ICF
Definition wifi-mac.h:851
uint8_t linkId
the ID of the link on which the ICF was dropped
Definition wifi-mac.h:850
WifiIcfDrop reason
the reason why the ICF was dropped by the EMLSR client
Definition wifi-mac.h:849
std::string dir