A Discrete-Event Network Simulator
API
wifi-mac.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 INRIA
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18  */
19 
20 #ifndef WIFI_MAC_H
21 #define WIFI_MAC_H
22 
23 #include "qos-utils.h"
24 #include "ssid.h"
27 #include "wifi-standards.h"
28 
29 #include <functional>
30 #include <list>
31 #include <map>
32 #include <memory>
33 #include <optional>
34 #include <set>
35 #include <unordered_map>
36 #include <vector>
37 
38 namespace ns3
39 {
40 
41 class Txop;
42 class WifiNetDevice;
43 class QosTxop;
44 class WifiPsdu;
45 class MacRxMiddle;
46 class MacTxMiddle;
47 class WifiMacQueue;
48 class WifiMpdu;
49 class HtConfiguration;
50 class VhtConfiguration;
51 class HeConfiguration;
52 class EhtConfiguration;
53 class FrameExchangeManager;
54 class ChannelAccessManager;
55 class ExtendedCapabilities;
56 class OriginatorBlockAckAgreement;
57 class RecipientBlockAckAgreement;
58 
64 {
65  STA,
66  AP,
69  OCB
70 };
71 
76 enum WifiMacDropReason : uint8_t
77 {
82 };
83 
84 typedef std::unordered_map<uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
85 
95 class WifiMac : public Object
96 {
97  public:
102  static TypeId GetTypeId();
103 
104  WifiMac();
105  ~WifiMac() override;
106 
107  // Delete copy constructor and assignment operator to avoid misuse
108  WifiMac(const WifiMac&) = delete;
109  WifiMac& operator=(const WifiMac&) = delete;
110 
116  void SetDevice(const Ptr<WifiNetDevice> device);
123 
131 
139 
145  uint8_t GetNLinks() const;
146 
150  const std::set<uint8_t>& GetLinkIds() const;
151 
158  virtual std::optional<uint8_t> GetLinkIdByAddress(const Mac48Address& address) const;
159 
166  std::optional<uint8_t> GetLinkForPhy(Ptr<const WifiPhy> phy) const;
167 
174  std::optional<uint8_t> GetLinkForPhy(std::size_t phyId) const;
175 
181  std::optional<Mac48Address> GetMldAddress(const Mac48Address& remoteAddr) const;
182 
197  Mac48Address GetLocalAddress(const Mac48Address& remoteAddr) const;
198 
204  Ptr<Txop> GetTxop() const;
211  Ptr<QosTxop> GetQosTxop(AcIndex ac) const;
218  Ptr<QosTxop> GetQosTxop(uint8_t tid) const;
227  virtual Ptr<WifiMacQueue> GetTxopQueue(AcIndex ac) const;
228 
234  virtual bool HasFramesToTransmit(uint8_t linkId);
235 
241  virtual void SetMacQueueScheduler(Ptr<WifiMacQueueScheduler> scheduler);
248 
263 
267  void SetSsid(Ssid ssid);
275  void SetPromisc();
282  void SetCtsToSelfSupported(bool enable);
283 
287  Mac48Address GetAddress() const;
291  Ssid GetSsid() const;
295  virtual void SetAddress(Mac48Address address);
300  Mac48Address GetBssid(uint8_t linkId) const;
305  void SetBssid(Mac48Address bssid, uint8_t linkId);
306 
317  const Mac48Address& address,
318  const std::set<uint8_t>& linkIds);
319 
330  const Mac48Address& address,
331  const std::set<uint8_t>& linkIds);
332 
340  virtual bool CanForwardPacketsTo(Mac48Address to) const = 0;
352  virtual void Enqueue(Ptr<Packet> packet, Mac48Address to, Mac48Address from);
361  virtual void Enqueue(Ptr<Packet> packet, Mac48Address to) = 0;
369  virtual bool SupportsSendFrom() const;
370 
374  virtual void SetWifiPhys(const std::vector<Ptr<WifiPhy>>& phys);
379  Ptr<WifiPhy> GetWifiPhy(uint8_t linkId = SINGLE_LINK_OP_ID) const;
383  void ResetWifiPhys();
384 
393  const std::vector<Ptr<WifiRemoteStationManager>>& stationManagers);
400 
410 
415  void SetForwardUpCallback(ForwardUpCallback upCallback);
419  virtual void SetLinkUpCallback(Callback<void> linkUp);
423  void SetLinkDownCallback(Callback<void> linkDown);
424  /* Next functions are not pure virtual so non QoS WifiMacs are not
425  * forced to implement them.
426  */
427 
433  virtual void NotifyChannelSwitching(uint8_t linkId);
434 
442  void NotifyTx(Ptr<const Packet> packet);
450  void NotifyTxDrop(Ptr<const Packet> packet);
456  void NotifyRx(Ptr<const Packet> packet);
462  void NotifyPromiscRx(Ptr<const Packet> packet);
468  void NotifyRxDrop(Ptr<const Packet> packet);
469 
478  virtual void ConfigureStandard(WifiStandard standard);
479 
496 
509  HtCapabilities GetHtCapabilities(uint8_t linkId) const;
516  VhtCapabilities GetVhtCapabilities(uint8_t linkId) const;
523  HeCapabilities GetHeCapabilities(uint8_t linkId) const;
530  EhtCapabilities GetEhtCapabilities(uint8_t linkId) const;
531 
537  bool GetQosSupported() const;
544  bool GetErpSupported(uint8_t linkId) const;
551  bool GetDsssSupported(uint8_t linkId) const;
557  bool GetHtSupported() const;
564  bool GetVhtSupported(uint8_t linkId) const;
570  bool GetHeSupported() const;
576  bool GetEhtSupported() const;
577 
582  bool GetHtSupported(const Mac48Address& address) const;
587  bool GetVhtSupported(const Mac48Address& address) const;
592  bool GetHeSupported(const Mac48Address& address) const;
597  bool GetEhtSupported(const Mac48Address& address) const;
598 
605  uint32_t GetMaxAmpduSize(AcIndex ac) const;
612  uint16_t GetMaxAmsduSize(AcIndex ac) const;
613 
616  std::optional<std::reference_wrapper<const OriginatorBlockAckAgreement>>;
619  std::optional<std::reference_wrapper<const RecipientBlockAckAgreement>>;
620 
631  uint8_t tid) const;
642  uint8_t tid) const;
643 
652  BlockAckType GetBaTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const;
661  BlockAckReqType GetBarTypeAsOriginator(const Mac48Address& recipient, uint8_t tid) const;
670  BlockAckType GetBaTypeAsRecipient(Mac48Address originator, uint8_t tid) const;
679  BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const;
680 
688  uint16_t GetMaxBaBufferSize(std::optional<Mac48Address> address = std::nullopt) const;
689 
694  void SetMpduBufferSize(uint16_t size);
695 
700  uint16_t GetMpduBufferSize() const;
701 
710  std::optional<std::reference_wrapper<const WifiTidLinkMapping>> GetTidToLinkMapping(
711  Mac48Address mldAddr,
712  WifiDirection dir) const;
713 
725  bool TidMappedOnLink(Mac48Address mldAddr,
727  uint8_t tid,
728  uint8_t linkId) const;
729 
730  protected:
731  void DoInitialize() override;
732  void DoDispose() override;
733 
741  virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax);
742 
750  void SetQosSupported(bool enable);
751 
758  void SetShortSlotTimeSupported(bool enable);
762  bool GetShortSlotTimeSupported() const;
763 
769  Ptr<QosTxop> GetVOQueue() const;
775  Ptr<QosTxop> GetVIQueue() const;
781  Ptr<QosTxop> GetBEQueue() const;
787  Ptr<QosTxop> GetBKQueue() const;
788 
809  virtual void Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId);
817  void ForwardUp(Ptr<const Packet> packet, Mac48Address from, Mac48Address to);
818 
826 
834  void ApplyTidLinkMapping(const Mac48Address& mldAddr, WifiDirection dir);
835 
844  void SwapLinks(std::map<uint8_t, uint8_t> links);
845 
853  struct LinkEntity
854  {
856  virtual ~LinkEntity();
857 
863  bool erpSupported{false};
864  bool dsssSupported{false};
865  };
866 
870  const std::map<uint8_t, std::unique_ptr<LinkEntity>>& GetLinks() const;
871 
878  LinkEntity& GetLink(uint8_t linkId) const;
879 
888  void UpdateTidToLinkMapping(const Mac48Address& mldAddr,
890  const WifiTidLinkMapping& mapping);
891 
896 
899 
900  private:
910  void ConfigureDcf(Ptr<Txop> dcf,
911  uint32_t cwmin,
912  uint32_t cwmax,
913  std::list<bool> isDsss,
914  AcIndex ac);
915 
921  void ConfigurePhyDependentParameters(uint8_t linkId);
922 
929  void SetupEdcaQueue(AcIndex ac);
930 
939 
945  virtual std::unique_ptr<LinkEntity> CreateLinkEntity() const;
946 
954  void UpdateLinkId(uint8_t id);
955 
965  virtual Mac48Address DoGetLocalAddress(const Mac48Address& remoteAddr) const;
966 
973  void SetErpSupported(bool enable, uint8_t linkId);
980  void SetDsssSupported(bool enable, uint8_t linkId);
981 
987  void SetVoBlockAckThreshold(uint8_t threshold);
993  void SetViBlockAckThreshold(uint8_t threshold);
999  void SetBeBlockAckThreshold(uint8_t threshold);
1005  void SetBkBlockAckThreshold(uint8_t threshold);
1006 
1012  void SetVoBlockAckInactivityTimeout(uint16_t timeout);
1018  void SetViBlockAckInactivityTimeout(uint16_t timeout);
1024  void SetBeBlockAckInactivityTimeout(uint16_t timeout);
1030  void SetBkBlockAckInactivityTimeout(uint16_t timeout);
1031 
1046 
1049 
1051 
1053  std::map<uint8_t, std::unique_ptr<LinkEntity>> m_links;
1054  std::set<uint8_t> m_linkIds;
1055 
1058 
1062  typedef std::map<AcIndex, Ptr<QosTxop>, std::greater<>> EdcaQueues;
1063 
1067 
1068  uint16_t m_voMaxAmsduSize;
1069  uint16_t m_viMaxAmsduSize;
1070  uint16_t m_beMaxAmsduSize;
1071  uint16_t m_bkMaxAmsduSize;
1072 
1073  uint32_t m_voMaxAmpduSize;
1074  uint32_t m_viMaxAmpduSize;
1075  uint32_t m_beMaxAmpduSize;
1076  uint32_t m_bkMaxAmpduSize;
1077 
1078  uint16_t m_mpduBufferSize;
1079 
1081  std::unordered_map<Mac48Address, WifiTidLinkMapping, WifiAddressHash> m_dlTidLinkMappings;
1083  std::unordered_map<Mac48Address, WifiTidLinkMapping, WifiAddressHash> m_ulTidLinkMappings;
1084 
1086 
1124 
1132 
1135 
1140 
1143 
1146 
1154  typedef void (*MpduResponseTimeoutCallback)(uint8_t reason,
1155  Ptr<const WifiMpdu> mpdu,
1156  const WifiTxVector& txVector);
1157 
1161 
1167 
1175  typedef void (*PsduResponseTimeoutCallback)(uint8_t reason,
1176  Ptr<const WifiPsdu> psdu,
1177  const WifiTxVector& txVector);
1178 
1182 
1188 
1197  typedef void (*PsduMapResponseTimeoutCallback)(uint8_t reason,
1198  WifiPsduMap* psduMap,
1199  const std::set<Mac48Address>* missingStations,
1200  std::size_t nTotalStations);
1201 
1205 
1211 };
1212 
1213 } // namespace ns3
1214 
1215 #endif /* WIFI_MAC_H */
Callback template class.
Definition: callback.h:438
The IEEE 802.11be EHT Capabilities.
The Extended Capabilities Information Element.
The IEEE 802.11ax HE Capabilities.
The HT Capabilities Information Element.
an EUI-48 address
Definition: mac48-address.h:46
A base class which provides memory management and object aggregation.
Definition: object.h:89
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
The IEEE 802.11ac VHT Capabilities.
base class for all MAC-level wifi objects.
Definition: wifi-mac.h:96
uint16_t GetMaxAmsduSize(AcIndex ac) const
Return the maximum A-MSDU size of the given Access Category.
Definition: wifi-mac.cc:2276
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:864
Ptr< QosTxop > GetBEQueue() const
Accessor for the AC_BE channel access function.
Definition: wifi-mac.cc:533
virtual void NotifyChannelSwitching(uint8_t linkId)
Notify that channel on the given link has been switched.
Definition: wifi-mac.cc:582
std::optional< Mac48Address > GetMldAddress(const Mac48Address &remoteAddr) const
Definition: wifi-mac.cc:1632
virtual void SetMacQueueScheduler(Ptr< WifiMacQueueScheduler > scheduler)
Set the wifi MAC queue scheduler.
Definition: wifi-mac.cc:569
Mac48Address GetBssid(uint8_t linkId) const
Definition: wifi-mac.cc:478
void(* PsduResponseTimeoutCallback)(uint8_t reason, Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
TracedCallback signature for PSDU response timeout events.
Definition: wifi-mac.h:1175
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
Definition: wifi-mac.h:1069
bool m_shortSlotTimeSupported
flag whether short slot time is supported
Definition: wifi-mac.h:1047
void ConfigurePhyDependentParameters(uint8_t linkId)
Configure PHY dependent parameters such as CWmin and CWmax on the given link.
Definition: wifi-mac.cc:795
Ptr< HeConfiguration > GetHeConfiguration() const
Definition: wifi-mac.cc:1749
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
Definition: wifi-mac.h:1139
TracedCallback< WifiMacDropReason, Ptr< const WifiMpdu > > DroppedMpduTracedCallback
TracedCallback for MPDU drop events typedef.
Definition: wifi-mac.h:1134
TypeOfStation GetTypeOfStation() const
Return the type of station.
Definition: wifi-mac.cc:422
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:1045
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & GetLinks() const
Definition: wifi-mac.cc:918
Ptr< Txop > GetTxop() const
Accessor for the Txop object.
Definition: wifi-mac.cc:493
VhtCapabilities GetVhtCapabilities(uint8_t linkId) const
Return the VHT capabilities of the device for the given link.
Definition: wifi-mac.cc:2018
Callback< void > m_linkDown
Callback when a link is down.
Definition: wifi-mac.h:898
bool GetQosSupported() const
Return whether the device supports QoS.
Definition: wifi-mac.cc:1222
std::optional< std::reference_wrapper< const RecipientBlockAckAgreement > > RecipientAgreementOptConstRef
optional const reference to RecipientBlockAckAgreement
Definition: wifi-mac.h:619
virtual void SetAddress(Mac48Address address)
Definition: wifi-mac.cc:445
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
Definition: wifi-mac.h:894
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Definition: wifi-mac.cc:1195
Mac48Address m_address
MAC address of this station.
Definition: wifi-mac.h:1056
std::set< uint8_t > m_linkIds
IDs of the links in use.
Definition: wifi-mac.h:1054
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
Definition: wifi-mac.cc:576
uint16_t GetMpduBufferSize() const
Definition: wifi-mac.cc:1862
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Definition: wifi-mac.cc:933
BlockAckType GetBaTypeAsRecipient(Mac48Address originator, uint8_t tid) const
Definition: wifi-mac.cc:1719
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:995
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
Definition: wifi-mac.h:1068
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
Definition: wifi-mac.h:892
Ptr< WifiMacQueueScheduler > m_scheduler
wifi MAC queue scheduler
Definition: wifi-mac.h:895
void DoInitialize() override
Initialize() implementation.
Definition: wifi-mac.cc:349
TypeOfStation m_typeOfStation
the type of station
Definition: wifi-mac.h:1050
uint16_t m_mpduBufferSize
BlockAck buffer size (in number of MPDUs)
Definition: wifi-mac.h:1078
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
Definition: wifi-mac.h:1075
virtual void ConfigureStandard(WifiStandard standard)
Definition: wifi-mac.cc:748
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:1116
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:1428
Ssid GetSsid() const
Definition: wifi-mac.cc:465
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
Definition: wifi-mac.cc:1888
bool GetErpSupported(uint8_t linkId) const
Return whether the device supports ERP on the given link.
Definition: wifi-mac.cc:1228
bool GetHtSupported() const
Return whether the device supports HT.
Definition: wifi-mac.cc:1761
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to)=0
void ResetWifiPhys()
Remove currently attached WifiPhy objects from this MAC.
Definition: wifi-mac.cc:1177
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:1093
void SetErpSupported(bool enable, uint8_t linkId)
Enable or disable ERP support for the given link.
Definition: wifi-mac.cc:1234
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
Definition: wifi-mac.h:1073
void(* MpduResponseTimeoutCallback)(uint8_t reason, Ptr< const WifiMpdu > mpdu, const WifiTxVector &txVector)
TracedCallback signature for MPDU response timeout events.
Definition: wifi-mac.h:1154
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, std::list< bool > isDsss, AcIndex ac)
Definition: wifi-mac.cc:669
WifiMac(const WifiMac &)=delete
Ptr< WifiNetDevice > m_device
Pointer to the device.
Definition: wifi-mac.h:1052
void SetSsid(Ssid ssid)
Definition: wifi-mac.cc:458
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:945
Ptr< QosTxop > GetVOQueue() const
Accessor for the AC_VO channel access function.
Definition: wifi-mac.cc:521
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Definition: wifi-mac.cc:415
MpduTracedCallback m_ackedMpduCallback
ack'ed MPDU callback
Definition: wifi-mac.h:1144
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Definition: wifi-mac.cc:1171
WifiMac & operator=(const WifiMac &)=delete
void SetMpduBufferSize(uint16_t size)
Definition: wifi-mac.cc:1853
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:1387
MpduTracedCallback m_nackedMpduCallback
nack'ed MPDU callback
Definition: wifi-mac.h:1145
bool GetEhtSupported() const
Return whether the device supports EHT.
Definition: wifi-mac.cc:1780
bool GetHeSupported() const
Return whether the device supports HE.
Definition: wifi-mac.cc:1774
HtCapabilities GetHtCapabilities(uint8_t linkId) const
Return the HT capabilities of the device for the given link.
Definition: wifi-mac.cc:1959
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
Definition: wifi-mac.cc:1898
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
Definition: wifi-mac.cc:1868
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:961
void NotifyPromiscRx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:613
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:1081
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the MAC has frames to transmit over the given link.
Definition: wifi-mac.cc:552
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy >> &phys)
Definition: wifi-mac.cc:1146
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
Definition: wifi-mac.cc:876
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:1305
RecipientAgreementOptConstRef GetBaAgreementEstablishedAsRecipient(Mac48Address originator, uint8_t tid) const
Definition: wifi-mac.cc:1693
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
Definition: wifi-mac.cc:1928
Ptr< EhtConfiguration > GetEhtConfiguration() const
Definition: wifi-mac.cc:1755
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:1116
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
Definition: wifi-mac.cc:1767
void SetDsssSupported(bool enable, uint8_t linkId)
Enable or disable DSSS support for the given link.
Definition: wifi-mac.cc:1245
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:1100
TracedCallback< Ptr< const WifiMpdu > > MpduTracedCallback
TracedCallback for acked/nacked MPDUs typedef.
Definition: wifi-mac.h:1142
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
Definition: wifi-mac.h:893
void NotifyTx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:595
static TypeId GetTypeId()
Get the type ID.
Definition: wifi-mac.cc:67
Ptr< HtConfiguration > GetHtConfiguration() const
Definition: wifi-mac.cc:1737
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:1100
uint32_t GetMaxAmpduSize(AcIndex ac) const
Return the maximum A-MPDU size of the given Access Category.
Definition: wifi-mac.cc:2251
BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const
Definition: wifi-mac.cc:1728
Ssid m_ssid
Service Set ID (SSID)
Definition: wifi-mac.h:1057
std::map< uint8_t, std::unique_ptr< LinkEntity > > m_links
ID-indexed map of Link objects.
Definition: wifi-mac.h:1053
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:1620
Ptr< QosTxop > GetVIQueue() const
Accessor for the AC_VI channel access function.
Definition: wifi-mac.cc:527
void SetBssid(Mac48Address bssid, uint8_t linkId)
Definition: wifi-mac.cc:471
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
Definition: wifi-mac.cc:439
Ptr< FrameExchangeManager > SetupFrameExchangeManager(WifiStandard standard)
Create a Frame Exchange Manager depending on the supported version of the standard.
Definition: wifi-mac.cc:813
virtual void Enqueue(Ptr< Packet > packet, Mac48Address to, Mac48Address from)
Definition: wifi-mac.cc:1479
void NotifyRx(Ptr< const Packet > packet)
Definition: wifi-mac.cc:607
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:1123
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:1066
BlockAckType GetBaTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
Definition: wifi-mac.cc:1701
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
Definition: wifi-mac.h:1166
void SetForwardUpCallback(ForwardUpCallback upCallback)
Definition: wifi-mac.cc:1284
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
Definition: wifi-mac.h:1210
ExtendedCapabilities GetExtendedCapabilities() const
Return the extended capabilities of the device.
Definition: wifi-mac.cc:1948
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:1108
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:1062
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
Definition: wifi-mac.h:1071
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
Definition: wifi-mac.cc:1938
std::optional< std::reference_wrapper< const OriginatorBlockAckAgreement > > OriginatorAgreementOptConstRef
optional const reference to OriginatorBlockAckAgreement
Definition: wifi-mac.h:616
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:1083
virtual bool SupportsSendFrom() const
Definition: wifi-mac.cc:1278
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:1838
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:545
void SetWifiRemoteStationManagers(const std::vector< Ptr< WifiRemoteStationManager >> &stationManagers)
Definition: wifi-mac.cc:883
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:974
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
Definition: wifi-mac.cc:1878
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
Definition: wifi-mac.cc:1918
bool GetShortSlotTimeSupported() const
Definition: wifi-mac.cc:1272
BlockAckReqType GetBarTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
Definition: wifi-mac.cc:1710
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:625
void SetLinkDownCallback(Callback< void > linkDown)
Definition: wifi-mac.cc:1298
Ptr< QosTxop > GetBKQueue() const
Accessor for the AC_BK channel access function.
Definition: wifi-mac.cc:539
~WifiMac() override
Definition: wifi-mac.cc:61
void SetPromisc()
Sets the interface in promiscuous mode.
Definition: wifi-mac.cc:484
Ptr< VhtConfiguration > GetVhtConfiguration() const
Definition: wifi-mac.cc:1743
void NotifyRxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:619
virtual void SetLinkUpCallback(Callback< void > linkUp)
Definition: wifi-mac.cc:1291
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Definition: wifi-mac.cc:906
const std::set< uint8_t > & GetLinkIds() const
Definition: wifi-mac.cc:939
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-mac.cc:428
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
Definition: wifi-mac.cc:1258
Mac48Address GetLocalAddress(const Mac48Address &remoteAddr) const
Get the local MAC address used to communicate with a remote STA.
Definition: wifi-mac.cc:1645
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
Definition: wifi-mac.h:1066
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
Definition: wifi-mac.h:1076
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
Definition: wifi-mac.cc:1490
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
Definition: wifi-mac.cc:646
TracedCallback< uint8_t, Ptr< const WifiPsdu >, const WifiTxVector & > PsduResponseTimeoutTracedCallback
TracedCallback for PSDU response timeout events typedef.
Definition: wifi-mac.h:1181
TracedCallback< uint8_t, Ptr< const WifiMpdu >, const WifiTxVector & > MpduResponseTimeoutTracedCallback
TracedCallback for MPDU response timeout events typedef.
Definition: wifi-mac.h:1160
OriginatorAgreementOptConstRef GetBaAgreementEstablishedAsOriginator(Mac48Address recipient, uint8_t tid) const
Definition: wifi-mac.cc:1679
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:1497
Mac48Address GetAddress() const
Definition: wifi-mac.cc:452
void(* DroppedMpduCallback)(WifiMacDropReason reason, Ptr< const WifiMpdu > mpdu)
TracedCallback signature for MPDU drop events.
Definition: wifi-mac.h:1131
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
Definition: wifi-mac.h:1085
EhtCapabilities GetEhtCapabilities(uint8_t linkId) const
Return the EHT capabilities of the device for the given link.
Definition: wifi-mac.cc:2158
TracedCallback< uint8_t, WifiPsduMap *, const std::set< Mac48Address > *, std::size_t > PsduMapResponseTimeoutTracedCallback
TracedCallback for PSDU map response timeout events typedef.
Definition: wifi-mac.h:1204
Callback< void > m_linkUp
Callback when a link is up.
Definition: wifi-mac.h:897
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Definition: wifi-mac.cc:924
HeCapabilities GetHeCapabilities(uint8_t linkId) const
Return the HE capabilities of the device for the given link.
Definition: wifi-mac.cc:2100
virtual bool CanForwardPacketsTo(Mac48Address to) const =0
Return true if packets can be forwarded to the given destination, false otherwise.
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:409
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
Definition: wifi-mac.h:1187
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Definition: wifi-mac.cc:499
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:1197
void NotifyTxDrop(Ptr< const Packet > packet)
Definition: wifi-mac.cc:601
void DoDispose() override
Destructor implementation.
Definition: wifi-mac.cc:373
bool GetDsssSupported(uint8_t linkId) const
Return whether the device supports DSSS on the given link.
Definition: wifi-mac.cc:1252
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:870
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
Definition: wifi-mac.cc:1908
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
Definition: wifi-mac.cc:912
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
Definition: wifi-mac.cc:1265
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
Definition: wifi-mac.h:1048
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
Definition: wifi-mac.h:1070
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:1673
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
Definition: wifi-mac.h:1074
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
TypeOfStation
Enumeration for type of WiFi station.
Definition: wifi-mac.h:64
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiMacDropReason
The reason why an MPDU was dropped.
Definition: wifi-mac.h:77
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:73
@ ADHOC_STA
Definition: wifi-mac.h:67
@ MESH
Definition: wifi-mac.h:68
@ STA
Definition: wifi-mac.h:65
@ AP
Definition: wifi-mac.h:66
@ OCB
Definition: wifi-mac.h:69
@ WIFI_MAC_DROP_QOS_OLD_PACKET
Definition: wifi-mac.h:81
@ WIFI_MAC_DROP_FAILED_ENQUEUE
Definition: wifi-mac.h:78
@ WIFI_MAC_DROP_EXPIRED_LIFETIME
Definition: wifi-mac.h:79
@ WIFI_MAC_DROP_REACHED_RETRY_LIMIT
Definition: wifi-mac.h:80
address
Definition: first.py:47
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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:192
WifiDirection
Wifi direction.
Definition: wifi-utils.h:43
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:74
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
ssid
Definition: third.py:93
phy
Definition: third.py:89
ns3::Time timeout
The different BlockAckRequest variants.
The different BlockAck variants.
std::string dir