A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-default-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_DEFAULT_PROTECTION_MANAGER_H
21#define WIFI_DEFAULT_PROTECTION_MANAGER_H
22
24
25namespace ns3
26{
27
28class WifiTxParameters;
29class WifiMpdu;
30class WifiMacHeader;
31
32/**
33 * \ingroup wifi
34 *
35 * WifiDefaultProtectionManager is the default protection manager, which selects
36 * the protection method for a frame based on its size.
37 */
39{
40 public:
41 /**
42 * \brief Get the type ID.
43 * \return the object TypeId
44 */
45 static TypeId GetTypeId();
46
49
50 std::unique_ptr<WifiProtection> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
51 const WifiTxParameters& txParams) override;
52 std::unique_ptr<WifiProtection> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
53 const WifiTxParameters& txParams) override;
54
55 protected:
56 /**
57 * Select the protection method for a single PSDU.
58 *
59 * \param hdr the MAC header of the PSDU
60 * \param txParams the TX parameters describing the PSDU
61 * \return the selected protection method
62 */
63 virtual std::unique_ptr<WifiProtection> GetPsduProtection(
64 const WifiMacHeader& hdr,
65 const WifiTxParameters& txParams) const;
66
67 private:
68 /**
69 * Calculate the protection method to use if the given MPDU is added to the
70 * current DL MU PPDU (represented by the given TX parameters). If the computed
71 * protection method is the same as the current one, a null pointer is
72 * returned. Otherwise, the computed protection method is returned.
73 * The TX width of the PPDU containing the MU-RTS is the same as the DL MU PPDU
74 * being protected. Each non-AP station is solicited to transmit a CTS occupying a
75 * bandwidth equal to the minimum between the TX width of the DL MU PPDU and the
76 * maximum channel width supported by the non-AP station.
77 *
78 * \param mpdu the given MPDU
79 * \param txParams the TX parameters describing the current DL MU PPDU
80 * \return the new protection method or a null pointer if the protection method
81 * is unchanged
82 */
83 virtual std::unique_ptr<WifiProtection> TryAddMpduToMuPpdu(Ptr<const WifiMpdu> mpdu,
84 const WifiTxParameters& txParams);
85
86 /**
87 * Calculate the protection method for the UL MU transmission solicited by the given
88 * Trigger Frame.
89 * The TX width of the PPDU containing the MU-RTS is the same as the TB PPDUs being
90 * solicited by the given Trigger Frame. Each non-AP station is solicited to transmit a CTS
91 * occupying a bandwidth equal to the minimum between the TX width of the PPDU containing
92 * the MU-RTS and the maximum channel width supported by the non-AP station.
93 *
94 * \param mpdu the given Trigger Frame
95 * \param txParams the current TX parameters (just the TXVECTOR needs to be set)
96 * \return the protection method for the UL MU transmission solicited by the given Trigger Frame
97 */
98 virtual std::unique_ptr<WifiProtection> TryUlMuTransmission(Ptr<const WifiMpdu> mpdu,
99 const WifiTxParameters& txParams);
100
101 bool m_sendMuRts; //!< true for sending an MU-RTS to protect DL MU PPDUs
102 bool m_singleRtsPerTxop; //!< true for using protection only once in a TXOP
103};
104
105} // namespace ns3
106
107#endif /* WIFI_DEFAULT_PROTECTION_MANAGER_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
WifiDefaultProtectionManager is the default protection manager, which selects the protection method f...
std::unique_ptr< WifiProtection > TryAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams) override
Determine the protection method to use if the given MPDU is added to the current frame.
bool m_sendMuRts
true for sending an MU-RTS to protect DL MU PPDUs
std::unique_ptr< WifiProtection > TryAggregateMsdu(Ptr< const WifiMpdu > msdu, const WifiTxParameters &txParams) override
Determine the protection method to use if the given MSDU is aggregated to the current frame.
bool m_singleRtsPerTxop
true for using protection only once in a TXOP
virtual std::unique_ptr< WifiProtection > TryUlMuTransmission(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Calculate the protection method for the UL MU transmission solicited by the given Trigger Frame.
virtual std::unique_ptr< WifiProtection > GetPsduProtection(const WifiMacHeader &hdr, const WifiTxParameters &txParams) const
Select the protection method for a single PSDU.
virtual std::unique_ptr< WifiProtection > TryAddMpduToMuPpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)
Calculate the protection method to use if the given MPDU is added to the current DL MU PPDU (represen...
Implements the IEEE 802.11 MAC header.
WifiProtectionManager is an abstract base class.
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.