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#include "ns3/wifi-export.h"
16
17#include <memory>
18
19namespace ns3
20{
21
23class WifiMpdu;
24class WifiPsdu;
25class WifiMac;
27
28/**
29 * @ingroup wifi
30 *
31 * WifiAckManager is an abstract base class. Each subclass defines a logic
32 * to select the acknowledgment method for a given frame.
33 */
34class WIFI_EXPORT WifiAckManager : public Object
35{
36 public:
37 /**
38 * @brief Get the type ID.
39 * @return the object TypeId
40 */
41 static TypeId GetTypeId();
43 ~WifiAckManager() override;
44
45 /**
46 * Set the MAC which is using this Acknowledgment Manager
47 *
48 * @param mac a pointer to the MAC
49 */
50 void SetWifiMac(Ptr<WifiMac> mac);
51 /**
52 * Set the ID of the link this Acknowledgment Manager is associated with.
53 *
54 * @param linkId the ID of the link this Acknowledgment Manager is associated with
55 */
56 void SetLinkId(uint8_t linkId);
57
58 /**
59 * Set the QoS Ack policy for the given MPDU, which must be a QoS data frame.
60 *
61 * @param item the MPDU
62 * @param acknowledgment the WifiAcknowledgment object storing the QoS Ack policy to set
63 */
64 static void SetQosAckPolicy(Ptr<WifiMpdu> item, const WifiAcknowledgment* acknowledgment);
65
66 /**
67 * Set the QoS Ack policy for the given PSDU, which must include at least a QoS data frame.
68 *
69 * @param psdu the PSDU
70 * @param acknowledgment the WifiAcknowledgment object storing the QoS Ack policy to set
71 */
72 static void SetQosAckPolicy(Ptr<WifiPsdu> psdu, const WifiAcknowledgment* acknowledgment);
73
74 /**
75 * Determine the acknowledgment method to use if the given MPDU is added to the current
76 * frame. Return a null pointer if the acknowledgment method is unchanged or the new
77 * acknowledgment method otherwise.
78 *
79 * @param mpdu the MPDU to be added to the current frame
80 * @param txParams the current TX parameters for the current frame
81 * @return a null pointer if the acknowledgment method is unchanged or the new
82 * acknowledgment method otherwise
83 */
84 virtual std::unique_ptr<WifiAcknowledgment> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
85 const WifiTxParameters& txParams) = 0;
86
87 /**
88 * Determine the acknowledgment method to use if the given MSDU is aggregated to the current
89 * frame. Return a null pointer if the acknowledgment method is unchanged or the new
90 * acknowledgment method otherwise.
91 *
92 * @param msdu the MSDU to be aggregated to the current frame
93 * @param txParams the current TX parameters for the current frame
94 * @return a null pointer if the acknowledgment method is unchanged or the new
95 * acknowledgment method otherwise
96 */
97 virtual std::unique_ptr<WifiAcknowledgment> TryAggregateMsdu(
99 const WifiTxParameters& txParams) = 0;
100
101 protected:
102 void DoDispose() override;
103
104 /**
105 * @return the remote station manager operating on our link
106 */
108
109 Ptr<WifiMac> m_mac; //!< MAC which is using this Acknowledgment Manager
110 uint8_t m_linkId; //!< ID of the link this Acknowledgment Manager is operating on
111};
112
113} // namespace ns3
114
115#endif /* WIFI_ACK_MANAGER_H */
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
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.
base class for all MAC-level wifi objects.
Definition wifi-mac.h:117
WifiMpdu stores a (const) packet along with a MAC header.
Definition wifi-mpdu.h:52
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition wifi-psdu.h:34
hold a list of per-remote-station state.
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.