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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef WIFI_DEFAULT_ACK_MANAGER_H
10#define WIFI_DEFAULT_ACK_MANAGER_H
11
12#include "wifi-ack-manager.h"
13
14namespace ns3
15{
16
17class WifiTxParameters;
18class WifiMpdu;
19
20/**
21 * \ingroup wifi
22 *
23 * WifiDefaultAckManager is the default ack manager.
24 */
26{
27 public:
28 /**
29 * \brief Get the type ID.
30 * \return the object TypeId
31 */
32 static TypeId GetTypeId();
33
35 ~WifiDefaultAckManager() override;
36
37 std::unique_ptr<WifiAcknowledgment> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
38 const WifiTxParameters& txParams) override;
39 std::unique_ptr<WifiAcknowledgment> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
40 const WifiTxParameters& txParams) override;
41
42 /**
43 * Get the maximum distance between the starting sequence number of the Block
44 * Ack agreement which the given MPDU belongs to and each of the sequence numbers
45 * of the given MPDU and of all the QoS data frames included in the given TX
46 * parameters.
47 *
48 * \param mpdu the given MPDU
49 * \param txParams the given TX parameters
50 * \return the maximum distance between the starting sequence number of the Block
51 * Ack agreement which the given MPDU belongs to and each of the sequence
52 * numbers of the given MPDU and of all the QoS data frames included in
53 * the given TX parameters
54 */
56 const WifiTxParameters& txParams) const;
57
58 protected:
59 /**
60 * Determine whether the (A-)MPDU containing the given MPDU and the MPDUs (if any)
61 * included in the given TX parameters requires an immediate response (Normal Ack,
62 * Block Ack or Block Ack Request followed by Block Ack).
63 *
64 * \param mpdu the given MPDU.
65 * \param txParams the given TX parameters.
66 * \return true if the given PSDU requires an immediate response
67 */
68 bool IsResponseNeeded(Ptr<const WifiMpdu> mpdu, const WifiTxParameters& txParams) const;
69
70 /**
71 * \param mpdu the given MPDU
72 * \return whether there exist MPDUs with lower sequence number than the given MPDU that are
73 * inflight on the same link as the given MPDU
74 */
76
77 private:
78 /**
79 * Compute the information about the acknowledgment of the current multi-user frame
80 * (as described by the given TX parameters) if the given MPDU is added. If the
81 * computed information is the same as the current one, a null pointer is returned.
82 * Otherwise, the computed information is returned.
83 * This method can only be called if the selected acknowledgment method for DL
84 * multi-user frames consists of a sequence of BlockAckReq and BlockAck frames.
85 *
86 * \param mpdu the given MPDU
87 * \param txParams the TX parameters describing the current multi-user frame
88 * \return the new acknowledgment method or a null pointer if the acknowledgment method
89 * is unchanged
90 */
91 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfBarBaSequence(
93 const WifiTxParameters& txParams);
94 /**
95 * Compute the information about the acknowledgment of the current multi-user frame
96 * (as described by the given TX parameters) if the given MPDU is added. If the
97 * computed information is the same as the current one, a null pointer is returned.
98 * Otherwise, the computed information is returned.
99 * This method can only be called if the selected acknowledgment method for DL
100 * multi-user frames consists of a MU-BAR Trigger Frame sent as single-user frame.
101 *
102 * \param mpdu the given MPDU
103 * \param txParams the TX parameters describing the current multi-user frame
104 * \return the new acknowledgment method or a null pointer if the acknowledgment method
105 * is unchanged
106 */
107 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfTfMuBar(
109 const WifiTxParameters& txParams);
110 /**
111 * Compute the information about the acknowledgment of the current multi-user frame
112 * (as described by the given TX parameters) if the given MPDU is added. If the
113 * computed information is the same as the current one, a null pointer is returned.
114 * Otherwise, the computed information is returned.
115 * This method can only be called if the selected acknowledgment method for DL
116 * multi-user frames consists of MU-BAR Trigger Frames aggregated to the PSDUs of
117 * the MU PPDU.
118 *
119 * \param mpdu the given MPDU
120 * \param txParams the TX parameters describing the current multi-user frame
121 * \return the new acknowledgment method or a null pointer if the acknowledgment method
122 * is unchanged
123 */
124 virtual std::unique_ptr<WifiAcknowledgment> GetAckInfoIfAggregatedMuBar(
126 const WifiTxParameters& txParams);
127
128 /**
129 * Calculate the acknowledgment method for the TB PPDUs solicited by the given
130 * Trigger Frame.
131 *
132 * \param mpdu the given Trigger Frame
133 * \param txParams the current TX parameters (just the TXVECTOR needs to be set)
134 * \return the acknowledgment method for the TB PPDUs solicited by the given Trigger Frame
135 */
136 virtual std::unique_ptr<WifiAcknowledgment> TryUlMuTransmission(
138 const WifiTxParameters& txParams);
139
140 bool m_useExplicitBar; //!< true for sending BARs, false for using Implicit BAR policy
141 double m_baThreshold; //!< Threshold to determine when a BlockAck must be requested
142 WifiAcknowledgment::Method m_dlMuAckType; //!< Type of the ack sequence for DL MU PPDUs
143 uint8_t m_maxMcsForBlockAckInTbPpdu; //!< Max MCS used to send a BlockAck in a TB PPDU
144};
145
146} // namespace ns3
147
148#endif /* WIFI_DEFAULT_ACK_MANAGER_H */
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
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.