A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-protection-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_PROTECTION_MANAGER_H
21#define WIFI_PROTECTION_MANAGER_H
22
23#include "wifi-protection.h"
24
25#include "ns3/object.h"
26
27#include <memory>
28
29namespace ns3
30{
31
32class WifiTxParameters;
33class WifiMpdu;
34class WifiMac;
35class WifiRemoteStationManager;
36
37/**
38 * \ingroup wifi
39 *
40 * WifiProtectionManager is an abstract base class. Each subclass defines a logic
41 * to select the protection method for a given frame.
42 */
44{
45 public:
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
52 ~WifiProtectionManager() override;
53
54 /**
55 * Set the MAC which is using this Protection Manager
56 *
57 * \param mac a pointer to the MAC
58 */
59 void SetWifiMac(Ptr<WifiMac> mac);
60 /**
61 * Set the ID of the link this Protection Manager is associated with.
62 *
63 * \param linkId the ID of the link this Protection Manager is associated with
64 */
65 void SetLinkId(uint8_t linkId);
66
67 /**
68 * Determine the protection method to use if the given MPDU is added to the current
69 * frame. Return a null pointer if the protection method is unchanged or the new
70 * protection method otherwise.
71 *
72 * \param mpdu the MPDU to be added to the current frame
73 * \param txParams the current TX parameters for the current frame
74 * \return a null pointer if the protection method is unchanged or the new
75 * protection method otherwise
76 */
77 virtual std::unique_ptr<WifiProtection> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
78 const WifiTxParameters& txParams) = 0;
79
80 /**
81 * Determine the protection method to use if the given MSDU is aggregated to the
82 * current frame. Return a null pointer if the protection method is unchanged or
83 * the new protection method otherwise.
84 *
85 * \param msdu the MSDU to be aggregated to the current frame
86 * \param txParams the current TX parameters for the current frame
87 * \return a null pointer if the protection method is unchanged or the new
88 * protection method otherwise
89 */
90 virtual std::unique_ptr<WifiProtection> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
91 const WifiTxParameters& txParams) = 0;
92
93 protected:
94 void DoDispose() override;
95
96 /**
97 * \return the remote station manager operating on our link
98 */
100
101 /**
102 * Add a User Info field to the given MU-RTS Trigger Frame to solicit a CTS from
103 * the station with the given MAC address. The MU-RTS is intended to protect a data
104 * frame having the given TX width. The TX width of the solicited CTS is the minimum
105 * between the TX width of the protected data frame and the maximum width supported
106 * by the solicited station.
107 *
108 * \param muRts the MU-RTS Trigger Frame
109 * \param txWidth the TX width of the protected data frame
110 * \param receiver the MAC address of the solicited station
111 */
113 uint16_t txWidth,
114 const Mac48Address& receiver) const;
115
116 Ptr<WifiMac> m_mac; //!< MAC which is using this Protection Manager
117 uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on
118};
119
120} // namespace ns3
121
122#endif /* WIFI_PROTECTION_MANAGER_H */
Headers for Trigger frames.
Definition: ctrl-headers.h:942
an EUI-48 address
Definition: mac48-address.h:46
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
WifiProtectionManager is an abstract base class.
void DoDispose() override
Destructor implementation.
virtual std::unique_ptr< WifiProtection > TryAggregateMsdu(Ptr< const WifiMpdu > msdu, const WifiTxParameters &txParams)=0
Determine the protection method to use if the given MSDU is aggregated to the current frame.
Ptr< WifiMac > m_mac
MAC which is using this Protection Manager.
void AddUserInfoToMuRts(CtrlTriggerHeader &muRts, uint16_t txWidth, const Mac48Address &receiver) const
Add a User Info field to the given MU-RTS Trigger Frame to solicit a CTS from the station with the gi...
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
uint8_t m_linkId
ID of the link this Protection Manager is operating on.
virtual std::unique_ptr< WifiProtection > TryAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)=0
Determine the protection method to use if the given MPDU is added to the current frame.
void SetLinkId(uint8_t linkId)
Set the ID of the link this Protection Manager is associated with.
void SetWifiMac(Ptr< WifiMac > mac)
Set the MAC which is using this Protection 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.