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 size the size in bytes of the PSDU
61 * \param txVector the TxVector used to transmit the PSDU
62 * \return the selected protection method
63 */
64 virtual std::unique_ptr<WifiProtection> GetPsduProtection(const WifiMacHeader& hdr,
65 uint32_t size,
66 const WifiTxVector& txVector) const;
67
68 private:
69 /**
70 * Calculate the protection method to use if the given MPDU is added to the
71 * current DL MU PPDU (represented by the given TX parameters). If the computed
72 * protection method is the same as the current one, a null pointer is
73 * returned. Otherwise, the computed protection method is returned.
74 * The TX width of the PPDU containing the MU-RTS is the same as the DL MU PPDU
75 * being protected. Each non-AP station is solicited to transmit a CTS occupying a
76 * bandwidth equal to the minimum between the TX width of the DL MU PPDU and the
77 * maximum channel width supported by the non-AP station.
78 *
79 * \param mpdu the given MPDU
80 * \param txParams the TX parameters describing the current DL MU PPDU
81 * \return the new protection method or a null pointer if the protection method
82 * is unchanged
83 */
84 virtual std::unique_ptr<WifiProtection> TryAddMpduToMuPpdu(Ptr<const WifiMpdu> mpdu,
85 const WifiTxParameters& txParams);
86
87 /**
88 * Calculate the protection method for the UL MU transmission solicited by the given
89 * Trigger Frame.
90 * The TX width of the PPDU containing the MU-RTS is the same as the TB PPDUs being
91 * solicited by the given Trigger Frame. Each non-AP station is solicited to transmit a CTS
92 * occupying a bandwidth equal to the minimum between the TX width of the PPDU containing
93 * the MU-RTS and the maximum channel width supported by the non-AP station.
94 *
95 * \param mpdu the given Trigger Frame
96 * \param txParams the current TX parameters (just the TXVECTOR needs to be set)
97 * \return the protection method for the UL MU transmission solicited by the given Trigger Frame
98 */
99 virtual std::unique_ptr<WifiProtection> TryUlMuTransmission(Ptr<const WifiMpdu> mpdu,
100 const WifiTxParameters& txParams);
101
102 bool m_sendMuRts; //!< true for sending an MU-RTS to protect DL MU PPDUs
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.
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 > 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...
virtual std::unique_ptr< WifiProtection > GetPsduProtection(const WifiMacHeader &hdr, uint32_t size, const WifiTxVector &txVector) const
Select the protection method for a single PSDU.
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,...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.