A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-default-ack-manager.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_DEFAULT_ACK_MANAGER_H
21#define WIFI_DEFAULT_ACK_MANAGER_H
22
23#include "wifi-ack-manager.h"
24
25namespace ns3
26{
27
28class WifiTxParameters;
29class WifiMpdu;
30
31/**
32 * \ingroup wifi
33 *
34 * WifiDefaultAckManager is the default ack manager.
35 */
37{
38 public:
39 /**
40 * \brief Get the type ID.
41 * \return the object TypeId
42 */
43 static TypeId GetTypeId();
44
46 ~WifiDefaultAckManager() override;
47
48 std::unique_ptr<WifiAcknowledgment> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
49 const WifiTxParameters& txParams) override;
50 std::unique_ptr<WifiAcknowledgment> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
51 const WifiTxParameters& txParams) override;
52
53 /**
54 * Get the maximum distance between the starting sequence number of the Block
55 * Ack agreement which the given MPDU belongs to and each of the sequence numbers
56 * of the given MPDU and of all the QoS data frames included in the given TX
57 * parameters.
58 *
59 * \param mpdu the given MPDU
60 * \param txParams the given TX parameters
61 * \return the maximum distance between the starting sequence number of the Block
62 * Ack agreement which the given MPDU belongs to and each of the sequence
63 * numbers of the given MPDU and of all the QoS data frames included in
64 * the given TX parameters
65 */
67 const WifiTxParameters& txParams) const;
68
69 protected:
70 /**
71 * Determine whether the (A-)MPDU containing the given MPDU and the MPDUs (if any)
72 * included in the given TX parameters requires an immediate response (Normal Ack,
73 * Block Ack or Block Ack Request followed by Block Ack).
74 *
75 * \param mpdu the given MPDU.
76 * \param txParams the given TX parameters.
77 * \return true if the given PSDU requires an immediate response
78 */
79 bool IsResponseNeeded(Ptr<const WifiMpdu> mpdu, const WifiTxParameters& txParams) const;
80
81 /**
82 * \param mpdu the given MPDU
83 * \return whether there exist MPDUs with lower sequence number than the given MPDU that are
84 * inflight on the same link as the given MPDU
85 */
87
88 private:
89 /**
90 * Compute the information about the acknowledgment of the current multi-user frame
91 * (as described by the given TX parameters) if the given MPDU is added. If the
92 * computed information is the same as the current one, a null pointer is returned.
93 * Otherwise, the computed information is returned.
94 * This method can only be called if the selected acknowledgment method for DL
95 * multi-user frames consists of a sequence of BlockAckReq and BlockAck frames.
96 *
97 * \param mpdu the given MPDU
98 * \param txParams the TX parameters describing the current multi-user frame
99 * \return the new acknowledgment method or a null pointer if the acknowledgment method
100 * is unchanged
101 */
102 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfBarBaSequence(
104 const WifiTxParameters& txParams);
105 /**
106 * Compute the information about the acknowledgment of the current multi-user frame
107 * (as described by the given TX parameters) if the given MPDU is added. If the
108 * computed information is the same as the current one, a null pointer is returned.
109 * Otherwise, the computed information is returned.
110 * This method can only be called if the selected acknowledgment method for DL
111 * multi-user frames consists of a MU-BAR Trigger Frame sent as single-user frame.
112 *
113 * \param mpdu the given MPDU
114 * \param txParams the TX parameters describing the current multi-user frame
115 * \return the new acknowledgment method or a null pointer if the acknowledgment method
116 * is unchanged
117 */
118 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfTfMuBar(
120 const WifiTxParameters& txParams);
121 /**
122 * Compute the information about the acknowledgment of the current multi-user frame
123 * (as described by the given TX parameters) if the given MPDU is added. If the
124 * computed information is the same as the current one, a null pointer is returned.
125 * Otherwise, the computed information is returned.
126 * This method can only be called if the selected acknowledgment method for DL
127 * multi-user frames consists of MU-BAR Trigger Frames aggregated to the PSDUs of
128 * the MU PPDU.
129 *
130 * \param mpdu the given MPDU
131 * \param txParams the TX parameters describing the current multi-user frame
132 * \return the new acknowledgment method or a null pointer if the acknowledgment method
133 * is unchanged
134 */
135 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfAggregatedMuBar(
137 const WifiTxParameters& txParams);
138
139 /**
140 * Calculate the acknowledgment method for the TB PPDUs solicited by the given
141 * Trigger Frame.
142 *
143 * \param mpdu the given Trigger Frame
144 * \param txParams the current TX parameters (just the TXVECTOR needs to be set)
145 * \return the acknowledgment method for the TB PPDUs solicited by the given Trigger Frame
146 */
147 virtual std::unique_ptr<WifiAcknowledgment> TryUlMuTransmission(
149 const WifiTxParameters& txParams);
150
151 bool m_useExplicitBar; //!< true for sending BARs, false for using Implicit BAR policy
152 double m_baThreshold; //!< Threshold to determine when a BlockAck must be requested
153 WifiAcknowledgment::Method m_dlMuAckType; //!< Type of the ack sequence for DL MU PPDUs
154 uint8_t m_maxMcsForBlockAckInTbPpdu; //!< Max MCS used to send a BlockAck in a TB PPDU
155};
156
157} // namespace ns3
158
159#endif /* WIFI_DEFAULT_ACK_MANAGER_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
WifiAckManager is an abstract base class.
WifiDefaultAckManager is the default ack manager.
bool IsResponseNeeded(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams) const
Determine whether the (A-)MPDU containing the given MPDU and the MPDUs (if any) included in the given...
static TypeId GetTypeId()
Get the type ID.
virtual std::unique_ptr< WifiAcknowledgment > GetAckInfoIfBarBaSequence(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Compute the information about the acknowledgment of the current multi-user frame (as described by the...
bool m_useExplicitBar
true for sending BARs, false for using Implicit BAR policy
uint8_t m_maxMcsForBlockAckInTbPpdu
Max MCS used to send a BlockAck in a TB PPDU.
double m_baThreshold
Threshold to determine when a BlockAck must be requested.
virtual std::unique_ptr< WifiAcknowledgment > GetAckInfoIfTfMuBar(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Compute the information about the acknowledgment of the current multi-user frame (as described by the...
WifiAcknowledgment::Method m_dlMuAckType
Type of the ack sequence for DL MU PPDUs.
std::unique_ptr< WifiAcknowledgment > TryAggregateMsdu(Ptr< const WifiMpdu > msdu, const WifiTxParameters &txParams) override
Determine the acknowledgment method to use if the given MSDU is aggregated to the current frame.
uint16_t GetMaxDistFromStartingSeq(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams) const
Get the maximum distance between the starting sequence number of the Block Ack agreement which the gi...
bool ExistInflightOnSameLink(Ptr< const WifiMpdu > mpdu) const
std::unique_ptr< WifiAcknowledgment > TryAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams) override
Determine the acknowledgment method to use if the given MPDU is added to the current frame.
virtual std::unique_ptr< WifiAcknowledgment > GetAckInfoIfAggregatedMuBar(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Compute the information about the acknowledgment of the current multi-user frame (as described by the...
virtual std::unique_ptr< WifiAcknowledgment > TryUlMuTransmission(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Calculate the acknowledgment method for the TB PPDUs solicited by the given Trigger Frame.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Method
Available acknowledgment methods.