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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef WIFI_PROTECTION_MANAGER_H
10#define WIFI_PROTECTION_MANAGER_H
11
12#include "wifi-protection.h"
13
14#include "ns3/object.h"
15
16#include <memory>
17
18namespace ns3
19{
20
21class WifiTxParameters;
22class WifiMpdu;
23class WifiMac;
24class WifiRemoteStationManager;
25
26/**
27 * \ingroup wifi
28 *
29 * WifiProtectionManager is an abstract base class. Each subclass defines a logic
30 * to select the protection method for a given frame.
31 */
33{
34 public:
35 /**
36 * \brief Get the type ID.
37 * \return the object TypeId
38 */
39 static TypeId GetTypeId();
41 ~WifiProtectionManager() override;
42
43 /**
44 * Set the MAC which is using this Protection Manager
45 *
46 * \param mac a pointer to the MAC
47 */
48 void SetWifiMac(Ptr<WifiMac> mac);
49 /**
50 * Set the ID of the link this Protection Manager is associated with.
51 *
52 * \param linkId the ID of the link this Protection Manager is associated with
53 */
54 void SetLinkId(uint8_t linkId);
55
56 /**
57 * Determine the protection method to use if the given MPDU is added to the current
58 * frame. Return a null pointer if the protection method is unchanged or the new
59 * protection method otherwise.
60 *
61 * \param mpdu the MPDU to be added to the current frame
62 * \param txParams the current TX parameters for the current frame
63 * \return a null pointer if the protection method is unchanged or the new
64 * protection method otherwise
65 */
66 virtual std::unique_ptr<WifiProtection> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
67 const WifiTxParameters& txParams) = 0;
68
69 /**
70 * Determine the protection method to use if the given MSDU is aggregated to the
71 * current frame. Return a null pointer if the protection method is unchanged or
72 * the new protection method otherwise.
73 *
74 * \param msdu the MSDU to be aggregated to the current frame
75 * \param txParams the current TX parameters for the current frame
76 * \return a null pointer if the protection method is unchanged or the new
77 * protection method otherwise
78 */
79 virtual std::unique_ptr<WifiProtection> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
80 const WifiTxParameters& txParams) = 0;
81
82 protected:
83 void DoDispose() override;
84
85 /**
86 * \return the remote station manager operating on our link
87 */
89
90 /**
91 * Add a User Info field to the given MU-RTS Trigger Frame to solicit a CTS from
92 * the station with the given MAC address. The MU-RTS is intended to protect a data
93 * frame having the given TX width. The TX width of the solicited CTS is the minimum
94 * between the TX width of the protected data frame and the maximum width supported
95 * by the solicited station.
96 *
97 * \param muRts the MU-RTS Trigger Frame
98 * \param txWidth the TX width of the protected data frame
99 * \param receiver the MAC address of the solicited station
100 */
102 MHz_u txWidth,
103 const Mac48Address& receiver) const;
104
105 Ptr<WifiMac> m_mac; //!< MAC which is using this Protection Manager
106 uint8_t m_linkId; //!< ID of the link this Protection Manager is operating on
107};
108
109} // namespace ns3
110
111#endif /* WIFI_PROTECTION_MANAGER_H */
Headers for Trigger frames.
an EUI-48 address
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
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, MHz_u 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.