A Discrete-Event Network Simulator
API
wifi-acknowledgment.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef WIFI_ACKNOWLEDGMENT_H
22 #define WIFI_ACKNOWLEDGMENT_H
23 
24 #include "ns3/nstime.h"
25 #include "wifi-tx-vector.h"
26 #include "block-ack-type.h"
27 #include "wifi-mac-header.h"
28 #include "ctrl-headers.h"
29 #include <map>
30 
31 
32 namespace ns3 {
33 
34 class Mac48Address;
35 
44 {
49  enum Method
50  {
51  NONE = 0,
58  };
59 
65  virtual ~WifiAcknowledgment ();
66 
75  WifiMacHeader::QosAckPolicy GetQosAckPolicy (Mac48Address receiver, uint8_t tid) const;
76 
86  void SetQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy);
87 
92  virtual void Print (std::ostream &os) const = 0;
93 
94  const Method method;
96 
97 private:
107  virtual bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid,
108  WifiMacHeader::QosAckPolicy ackPolicy) const = 0;
109 
111  std::map<std::pair<Mac48Address, uint8_t>, WifiMacHeader::QosAckPolicy> m_ackPolicy;
112 };
113 
114 
121 {
122  WifiNoAck ();
123 
124  // Overridden from WifiAcknowledgment
125  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override;
126  void Print (std::ostream &os) const override;
127 };
128 
129 
136 {
137  WifiNormalAck ();
138 
139  // Overridden from WifiAcknowledgment
140  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override;
141  void Print (std::ostream &os) const override;
142 
144 };
145 
146 
153 {
154  WifiBlockAck ();
155 
156  // Overridden from WifiAcknowledgment
157  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const;
158  void Print (std::ostream &os) const;
159 
162 };
163 
164 
171 {
172  WifiBarBlockAck ();
173 
174  // Overridden from WifiAcknowledgment
175  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const;
176  void Print (std::ostream &os) const;
177 
182 };
183 
184 
193 {
195 
196  // Overridden from WifiAcknowledgment
197  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override;
198  void Print (std::ostream &os) const override;
199 
201  struct AckInfo
202  {
204  };
207  {
210  };
213  {
218  };
219 
221  std::map<Mac48Address, AckInfo> stationsReplyingWithNormalAck;
223  std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
225  std::map<Mac48Address, BlockAckReqInfo> stationsSendBlockAckReqTo;
226 };
227 
228 
237 {
238  WifiDlMuTfMuBar ();
239 
240  // Overridden from WifiAcknowledgment
241  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override;
242  void Print (std::ostream &os) const override;
243 
246  {
250  };
251 
253  std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
254  std::list<BlockAckReqType> barTypes;
255  uint16_t ulLength;
257 };
258 
259 
268 {
270 
271  // Overridden from WifiAcknowledgment
272  bool CheckQosAckPolicy (Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override;
273  void Print (std::ostream &os) const override;
274 
277  {
278  uint32_t muBarSize;
282  };
283 
285  std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
286  uint16_t ulLength;
287 };
288 
289 
297 std::ostream& operator<< (std::ostream& os, const WifiAcknowledgment* acknowledgment);
298 
299 } //namespace ns3
300 
301 #endif /* WIFI_ACKNOWLEDGMENT_H */
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
WifiAcknowledgment(Method m)
Constructor.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
information related to a BlockAckReq frame sent to a station Set of stations replying with an Ack fra...
virtual void Print(std::ostream &os) const =0
Print the object contents.
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
Time acknowledgmentTime
time required by the acknowledgment method
WifiAcknowledgment is an abstract base struct.
WifiDlMuBarBaSequence specifies that a DL MU PPDU is acknowledged through a sequence of BlockAckReq a...
void Print(std::ostream &os) const override
Print the object contents.
uint16_t ulLength
the UL Length field of the MU-BAR Trigger Frames
WifiTxVector ackTxVector
Ack TXVECTOR.
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
std::map< std::pair< Mac48Address, uint8_t >, WifiMacHeader::QosAckPolicy > m_ackPolicy
Qos Ack Policy to set for MPDUs addressed to a given receiver and having a given TID.
void Print(std::ostream &os) const
Print the object contents.
virtual bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const =0
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
WifiMacHeader::QosAckPolicy GetQosAckPolicy(Mac48Address receiver, uint8_t tid) const
Get the QoS Ack policy to use for the MPDUs addressed to the given receiver and belonging to the give...
The different BlockAckRequest variants.
WifiTxVector blockAckReqTxVector
BlockAckReq TXVECTOR.
void Print(std::ostream &os) const override
Print the object contents.
const Method method
acknowledgment method
WifiTxVector muBarTxVector
TXVECTOR used to transmit the MU-BAR Trigger Frame.
BlockAckType baType
BlockAck type.
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
information related to a BlockAck frame sent by a station Set of stations replying with a BlockAck fr...
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
information related to a BlockAck frame sent by a station
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
CtrlBAckRequestHeader barHeader
BlockAckReq header.
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
Set of stations receiving a BlockAckReq frame and replying with a BlockAck frame. ...
Method
Available acknowledgment methods.
void Print(std::ostream &os) const
Print the object contents.
std::list< BlockAckReqType > barTypes
BAR types.
WifiTxVector blockAckTxVector
BlockAck TXVECTOR.
WifiNoAck specifies that no acknowledgment is required.
void Print(std::ostream &os) const override
Print the object contents.
void Print(std::ostream &os) const override
Print the object contents.
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
void Print(std::ostream &os) const override
Print the object contents.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
WifiTxVector blockAckTxVector
BlockAck TXVECTOR.
WifiBarBlockAck specifies that a BlockAckReq is sent to solicit a Block Ack response.
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
an EUI-48 address
Definition: mac48-address.h:43
WifiBlockAck specifies that acknowledgment via Block Ack is required.
uint32_t muBarSize
size in bytes of a MU-BAR Trigger Frame
QosAckPolicy
Ack policy for QoS frames.
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const override
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
bool CheckQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy) const
Check whether the given QoS Ack policy can be used for the MPDUs addressed to the given receiver and ...
The different BlockAck variants.
WifiTxVector blockAckReqTxVector
TXVECTOR for the BlockAckReq frame.
information related to a BlockAck frame sent by a station Set of stations replying with a BlockAck fr...
BlockAckType baType
BlockAck type.
void SetQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy)
Set the QoS Ack policy to use for the MPDUs addressed to the given receiver and belonging to the give...
uint16_t ulLength
the UL Length field of the MU-BAR Trigger Frame
WifiTxVector ackTxVector
TXVECTOR for the Ack frame.
BlockAckType baType
BlockAck type.
BlockAckReqType barType
BlockAckReq type.
WifiDlMuAggregateTf specifies that a DL MU PPDU made of PSDUs including each a MU-BAR Trigger Frame i...
information related to an Ack frame sent by a station
CtrlBAckRequestHeader barHeader
BlockAckReq header.
BlockAckReqType barType
BlockAckReq type.
Headers for BlockAckRequest.
Definition: ctrl-headers.h:47
WifiNormalAck specifies that acknowledgment via Normal Ack is required.
WifiDlMuTfMuBar specifies that a DL MU PPDU is followed after a SIFS duration by a MU-BAR Trigger Fra...
std::map< Mac48Address, BlockAckReqInfo > stationsSendBlockAckReqTo
std::map< Mac48Address, AckInfo > stationsReplyingWithNormalAck
Set of stations replying with a BlockAck frame (no more than one)