A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-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_ACK_MANAGER_H
21#define WIFI_ACK_MANAGER_H
22
23#include "wifi-acknowledgment.h"
24
25#include "ns3/object.h"
26
27#include <memory>
28
29namespace ns3
30{
31
32class WifiTxParameters;
33class WifiMpdu;
34class WifiPsdu;
35class WifiMac;
36class WifiRemoteStationManager;
37
38/**
39 * \ingroup wifi
40 *
41 * WifiAckManager is an abstract base class. Each subclass defines a logic
42 * to select the acknowledgment method for a given frame.
43 */
44class WifiAckManager : public Object
45{
46 public:
47 /**
48 * \brief Get the type ID.
49 * \return the object TypeId
50 */
51 static TypeId GetTypeId();
53 ~WifiAckManager() override;
54
55 /**
56 * Set the MAC which is using this Acknowledgment Manager
57 *
58 * \param mac a pointer to the MAC
59 */
60 void SetWifiMac(Ptr<WifiMac> mac);
61 /**
62 * Set the ID of the link this Acknowledgment Manager is associated with.
63 *
64 * \param linkId the ID of the link this Acknowledgment Manager is associated with
65 */
66 void SetLinkId(uint8_t linkId);
67
68 /**
69 * Set the QoS Ack policy for the given MPDU, which must be a QoS data frame.
70 *
71 * \param item the MPDU
72 * \param acknowledgment the WifiAcknowledgment object storing the QoS Ack policy to set
73 */
74 static void SetQosAckPolicy(Ptr<WifiMpdu> item, const WifiAcknowledgment* acknowledgment);
75
76 /**
77 * Set the QoS Ack policy for the given PSDU, which must include at least a QoS data frame.
78 *
79 * \param psdu the PSDU
80 * \param acknowledgment the WifiAcknowledgment object storing the QoS Ack policy to set
81 */
82 static void SetQosAckPolicy(Ptr<WifiPsdu> psdu, const WifiAcknowledgment* acknowledgment);
83
84 /**
85 * Determine the acknowledgment method to use if the given MPDU is added to the current
86 * frame. Return a null pointer if the acknowledgment method is unchanged or the new
87 * acknowledgment method otherwise.
88 *
89 * \param mpdu the MPDU to be added to the current frame
90 * \param txParams the current TX parameters for the current frame
91 * \return a null pointer if the acknowledgment method is unchanged or the new
92 * acknowledgment method otherwise
93 */
94 virtual std::unique_ptr<WifiAcknowledgment> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
95 const WifiTxParameters& txParams) = 0;
96
97 /**
98 * Determine the acknowledgment method to use if the given MSDU is aggregated to the current
99 * frame. Return a null pointer if the acknowledgment method is unchanged or the new
100 * acknowledgment method otherwise.
101 *
102 * \param msdu the MSDU to be aggregated to the current frame
103 * \param txParams the current TX parameters for the current frame
104 * \return a null pointer if the acknowledgment method is unchanged or the new
105 * acknowledgment method otherwise
106 */
107 virtual std::unique_ptr<WifiAcknowledgment> TryAggregateMsdu(
109 const WifiTxParameters& txParams) = 0;
110
111 protected:
112 void DoDispose() override;
113
114 /**
115 * \return the remote station manager operating on our link
116 */
118
119 Ptr<WifiMac> m_mac; //!< MAC which is using this Acknowledgment Manager
120 uint8_t m_linkId; //!< ID of the link this Acknowledgment Manager is operating on
121};
122
123} // namespace ns3
124
125#endif /* WIFI_ACK_MANAGER_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
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.
virtual std::unique_ptr< WifiAcknowledgment > TryAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)=0
Determine the acknowledgment method to use if the given MPDU is added to the current frame.
uint8_t m_linkId
ID of the link this Acknowledgment Manager is operating on.
static void SetQosAckPolicy(Ptr< WifiMpdu > item, const WifiAcknowledgment *acknowledgment)
Set the QoS Ack policy for the given MPDU, which must be a QoS data frame.
Ptr< WifiMac > m_mac
MAC which is using this Acknowledgment Manager.
virtual std::unique_ptr< WifiAcknowledgment > TryAggregateMsdu(Ptr< const WifiMpdu > msdu, const WifiTxParameters &txParams)=0
Determine the acknowledgment method to use if the given MSDU is aggregated to the current frame.
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
void DoDispose() override
Destructor implementation.
void SetLinkId(uint8_t linkId)
Set the ID of the link this Acknowledgment Manager is associated with.
void SetWifiMac(Ptr< WifiMac > mac)
Set the MAC which is using this Acknowledgment Manager.
static TypeId GetTypeId()
Get the type ID.
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.
WifiAcknowledgment is an abstract base struct.