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