A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-acknowledgment.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
18 */
19
20#ifndef WIFI_ACKNOWLEDGMENT_H
21#define WIFI_ACKNOWLEDGMENT_H
22
23#include "block-ack-type.h"
24#include "ctrl-headers.h"
25#include "wifi-mac-header.h"
26#include "wifi-tx-vector.h"
27
28#include "ns3/nstime.h"
29
30#include <map>
31#include <memory>
32
33namespace ns3
34{
35
36class Mac48Address;
37
46{
51 enum Method
52 {
53 NONE = 0,
62 };
63
69 virtual ~WifiAcknowledgment();
70
75 virtual std::unique_ptr<WifiAcknowledgment> Copy() const = 0;
76
85 WifiMacHeader::QosAckPolicy GetQosAckPolicy(Mac48Address receiver, uint8_t tid) const;
86
96 void SetQosAckPolicy(Mac48Address receiver, uint8_t tid, WifiMacHeader::QosAckPolicy ackPolicy);
97
102 virtual void Print(std::ostream& os) const = 0;
103
106
107 private:
117 virtual bool CheckQosAckPolicy(Mac48Address receiver,
118 uint8_t tid,
119 WifiMacHeader::QosAckPolicy ackPolicy) const = 0;
120
122 std::map<std::pair<Mac48Address, uint8_t>, WifiMacHeader::QosAckPolicy> m_ackPolicy;
123};
124
131{
132 WifiNoAck();
133
134 std::unique_ptr<WifiAcknowledgment> Copy() const override;
135 bool CheckQosAckPolicy(Mac48Address receiver,
136 uint8_t tid,
137 WifiMacHeader::QosAckPolicy ackPolicy) const override;
138 void Print(std::ostream& os) const override;
139};
140
147{
149
150 std::unique_ptr<WifiAcknowledgment> Copy() const override;
151 bool CheckQosAckPolicy(Mac48Address receiver,
152 uint8_t tid,
153 WifiMacHeader::QosAckPolicy ackPolicy) const override;
154 void Print(std::ostream& os) const override;
155
157};
158
165{
166 WifiBlockAck();
167
168 std::unique_ptr<WifiAcknowledgment> Copy() const override;
169 bool CheckQosAckPolicy(Mac48Address receiver,
170 uint8_t tid,
171 WifiMacHeader::QosAckPolicy ackPolicy) const override;
172 void Print(std::ostream& os) const override;
173
176};
177
184{
186
187 std::unique_ptr<WifiAcknowledgment> Copy() const override;
188 bool CheckQosAckPolicy(Mac48Address receiver,
189 uint8_t tid,
190 WifiMacHeader::QosAckPolicy ackPolicy) const override;
191 void Print(std::ostream& os) const override;
192
197};
198
207{
209
210 std::unique_ptr<WifiAcknowledgment> Copy() const override;
211 bool CheckQosAckPolicy(Mac48Address receiver,
212 uint8_t tid,
213 WifiMacHeader::QosAckPolicy ackPolicy) const override;
214 void Print(std::ostream& os) const override;
215
217 struct AckInfo
218 {
220 };
221
224 {
227 };
228
231 {
236 };
237
239 std::map<Mac48Address, AckInfo> stationsReplyingWithNormalAck;
241 std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
243 std::map<Mac48Address, BlockAckReqInfo> stationsSendBlockAckReqTo;
244};
245
254{
256
257 std::unique_ptr<WifiAcknowledgment> Copy() const override;
258 bool CheckQosAckPolicy(Mac48Address receiver,
259 uint8_t tid,
260 WifiMacHeader::QosAckPolicy ackPolicy) const override;
261 void Print(std::ostream& os) const override;
262
265 {
269 };
270
272 std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
273 std::list<BlockAckReqType> barTypes;
274 uint16_t ulLength;
276};
277
286{
288
289 std::unique_ptr<WifiAcknowledgment> Copy() const override;
290 bool CheckQosAckPolicy(Mac48Address receiver,
291 uint8_t tid,
292 WifiMacHeader::QosAckPolicy ackPolicy) const override;
293 void Print(std::ostream& os) const override;
294
297 {
302 };
303
305 std::map<Mac48Address, BlockAckInfo> stationsReplyingWithBlockAck;
306 uint16_t ulLength;
307};
308
316{
318
319 std::unique_ptr<WifiAcknowledgment> Copy() const override;
320 bool CheckQosAckPolicy(Mac48Address receiver,
321 uint8_t tid,
322 WifiMacHeader::QosAckPolicy ackPolicy) const override;
323 void Print(std::ostream& os) const override;
324
326 std::map<std::pair<Mac48Address, uint8_t>, std::size_t> stationsReceivingMultiStaBa;
330};
331
342{
344
345 std::unique_ptr<WifiAcknowledgment> Copy() const override;
346 bool CheckQosAckPolicy(Mac48Address receiver,
347 uint8_t tid,
348 WifiMacHeader::QosAckPolicy ackPolicy) const override;
349 void Print(std::ostream& os) const override;
350};
351
359std::ostream& operator<<(std::ostream& os, const WifiAcknowledgment* acknowledgment);
360
361} // namespace ns3
362
363#endif /* WIFI_ACKNOWLEDGMENT_H */
Headers for BlockAckRequest.
Definition: ctrl-headers.h:52
an EUI-48 address
Definition: mac48-address.h:46
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
QosAckPolicy
Ack policy for QoS frames.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
The different BlockAckRequest variants.
The different BlockAck variants.
WifiAckAfterTbPpdu is used when a station prepares a TB PPDU to send in response to a Basic Trigger F...
void Print(std::ostream &os) const override
Print the object contents.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
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 ...
WifiAcknowledgment is an abstract base struct.
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.
Time acknowledgmentTime
time required by the acknowledgment method
virtual std::unique_ptr< WifiAcknowledgment > Copy() const =0
Clone this object.
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...
const Method method
acknowledgment method
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...
virtual void Print(std::ostream &os) const =0
Print the object contents.
Method
Available acknowledgment methods.
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 ...
WifiBarBlockAck specifies that a BlockAckReq is sent to solicit a Block Ack response.
void Print(std::ostream &os) const override
Print the object contents.
BlockAckType baType
BlockAck type.
WifiTxVector blockAckTxVector
BlockAck TXVECTOR.
WifiTxVector blockAckReqTxVector
BlockAckReq TXVECTOR.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
BlockAckReqType barType
BlockAckReq type.
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 ...
WifiBlockAck specifies that acknowledgment via Block Ack is required.
WifiTxVector blockAckTxVector
BlockAck TXVECTOR.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
BlockAckType baType
BlockAck type.
void Print(std::ostream &os) const override
Print the object contents.
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 ...
information related to a BlockAck frame sent by a station
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
uint32_t muBarSize
size in bytes of a MU-BAR Trigger Frame
CtrlBAckRequestHeader barHeader
BlockAckReq header.
WifiDlMuAggregateTf specifies that a DL MU PPDU made of PSDUs including each a MU-BAR Trigger Frame i...
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
void Print(std::ostream &os) const override
Print the object contents.
uint16_t ulLength
the UL Length field of the MU-BAR Trigger Frames
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
Set of stations replying with a BlockAck frame.
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 ...
information related to an Ack frame sent by a station
WifiTxVector ackTxVector
TXVECTOR for the Ack frame.
information related to a BlockAck frame sent by a station
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
information related to a BlockAckReq frame sent to a station
WifiTxVector blockAckReqTxVector
TXVECTOR for the BlockAckReq frame.
BlockAckReqType barType
BlockAckReq type.
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
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.
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 ...
std::map< Mac48Address, BlockAckReqInfo > stationsSendBlockAckReqTo
Set of stations receiving a BlockAckReq frame and replying with a BlockAck frame.
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
Set of stations replying with a BlockAck frame (no more than one)
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
std::map< Mac48Address, AckInfo > stationsReplyingWithNormalAck
Set of stations replying with an Ack frame (no more than one)
information related to a BlockAck frame sent by a station
WifiTxVector blockAckTxVector
TXVECTOR for the BlockAck frame.
BlockAckType baType
BlockAck type.
CtrlBAckRequestHeader barHeader
BlockAckReq header.
WifiDlMuTfMuBar specifies that a DL MU PPDU is followed after a SIFS duration by a MU-BAR Trigger Fra...
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 ...
std::list< BlockAckReqType > barTypes
BAR types.
std::map< Mac48Address, BlockAckInfo > stationsReplyingWithBlockAck
Set of stations replying with a BlockAck frame.
uint16_t ulLength
the UL Length field of the MU-BAR Trigger Frame
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
void Print(std::ostream &os) const override
Print the object contents.
WifiTxVector muBarTxVector
TXVECTOR used to transmit the MU-BAR Trigger Frame.
WifiNoAck specifies that no acknowledgment is required.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
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 ...
void Print(std::ostream &os) const override
Print the object contents.
WifiNormalAck specifies that acknowledgment via Normal Ack is required.
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 ackTxVector
Ack TXVECTOR.
void Print(std::ostream &os) const override
Print the object contents.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
WifiUlMuMultiStaBa specifies that a Basic Trigger Frame is being sent to solicit TB PPDUs that will b...
BlockAckType baType
BlockAck type.
std::unique_ptr< WifiAcknowledgment > Copy() const override
Clone this object.
WifiTxVector tbPpduTxVector
TXVECTOR for a TB PPDU.
WifiTxVector multiStaBaTxVector
TXVECTOR for the Multi-STA BlockAck.
std::map< std::pair< Mac48Address, uint8_t >, std::size_t > stationsReceivingMultiStaBa
Map (originator, tid) pairs to the their index in baType.
void Print(std::ostream &os) const override
Print the object contents.
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 ...