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