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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef WIFI_DEFAULT_PROTECTION_MANAGER_H
10#define WIFI_DEFAULT_PROTECTION_MANAGER_H
11
13
14namespace ns3
15{
16
17class WifiTxParameters;
18class WifiMpdu;
19class WifiMacHeader;
20
21/**
22 * \ingroup wifi
23 *
24 * WifiDefaultProtectionManager is the default protection manager, which selects
25 * the protection method for a frame based on its size.
26 */
28{
29 public:
30 /**
31 * \brief Get the type ID.
32 * \return the object TypeId
33 */
34 static TypeId GetTypeId();
35
38
39 std::unique_ptr<WifiProtection> TryAddMpdu(Ptr<const WifiMpdu> mpdu,
40 const WifiTxParameters& txParams) override;
41 std::unique_ptr<WifiProtection> TryAggregateMsdu(Ptr<const WifiMpdu> msdu,
42 const WifiTxParameters& txParams) override;
43
44 protected:
45 /**
46 * Select the protection method for a single PSDU.
47 *
48 * \param hdr the MAC header of the PSDU
49 * \param txParams the TX parameters describing the PSDU
50 * \return the selected protection method
51 */
52 virtual std::unique_ptr<WifiProtection> GetPsduProtection(
53 const WifiMacHeader& hdr,
54 const WifiTxParameters& txParams) const;
55
56 private:
57 /**
58 * Calculate the protection method to use if the given MPDU is added to the
59 * current DL MU PPDU (represented by the given TX parameters). If the computed
60 * protection method is the same as the current one, a null pointer is
61 * returned. Otherwise, the computed protection method is returned.
62 * The TX width of the PPDU containing the MU-RTS is the same as the DL MU PPDU
63 * being protected. Each non-AP station is solicited to transmit a CTS occupying a
64 * bandwidth equal to the minimum between the TX width of the DL MU PPDU and the
65 * maximum channel width supported by the non-AP station.
66 *
67 * \param mpdu the given MPDU
68 * \param txParams the TX parameters describing the current DL MU PPDU
69 * \return the new protection method or a null pointer if the protection method
70 * is unchanged
71 */
72 virtual std::unique_ptr<WifiProtection> TryAddMpduToMuPpdu(Ptr<const WifiMpdu> mpdu,
73 const WifiTxParameters& txParams);
74
75 /**
76 * Calculate the protection method for the UL MU transmission solicited by the given
77 * Trigger Frame.
78 * The TX width of the PPDU containing the MU-RTS is the same as the TB PPDUs being
79 * solicited by the given Trigger Frame. Each non-AP station is solicited to transmit a CTS
80 * occupying a bandwidth equal to the minimum between the TX width of the PPDU containing
81 * the MU-RTS and the maximum channel width supported by the non-AP station.
82 *
83 * \param mpdu the given Trigger Frame
84 * \param txParams the current TX parameters (just the TXVECTOR needs to be set)
85 * \return the protection method for the UL MU transmission solicited by the given Trigger Frame
86 */
87 virtual std::unique_ptr<WifiProtection> TryUlMuTransmission(Ptr<const WifiMpdu> mpdu,
88 const WifiTxParameters& txParams);
89
90 bool m_sendMuRts; //!< true for sending an MU-RTS to protect DL MU PPDUs
91 bool m_singleRtsPerTxop; //!< true for using protection only once in a TXOP
92};
93
94} // namespace ns3
95
96#endif /* WIFI_DEFAULT_PROTECTION_MANAGER_H */
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
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.