A Discrete-Event Network Simulator
API
qos-frame-exchange-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 QOS_FRAME_EXCHANGE_MANAGER_H
21#define QOS_FRAME_EXCHANGE_MANAGER_H
22
24
25namespace ns3
26{
27
36{
37 public:
42 static TypeId GetTypeId();
44 ~QosFrameExchangeManager() override;
45
46 bool StartTransmission(Ptr<Txop> edca, uint16_t allowedWidth) override;
47
61 bool TryAddMpdu(Ptr<const WifiMpdu> mpdu, WifiTxParameters& txParams, Time availableTime) const;
62
74 const WifiTxParameters& txParams,
75 Time ppduDurationLimit) const;
76
90 virtual bool IsWithinSizeAndTimeLimits(uint32_t ppduPayloadSize,
91 Mac48Address receiver,
92 const WifiTxParameters& txParams,
93 Time ppduDurationLimit) const;
94
95 protected:
96 void DoDispose() override;
97
99 RxSignalInfo rxSignalInfo,
100 const WifiTxVector& txVector,
101 bool inAmpdu) override;
102 void PreProcessFrame(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector) override;
104 uint32_t size,
105 const WifiTxParameters& txParams,
106 Ptr<Packet> fragmentedPacket) const override;
107 Time GetRtsDurationId(const WifiTxVector& rtsTxVector,
108 Time txDuration,
109 Time response) const override;
110 Time GetCtsToSelfDurationId(const WifiTxVector& ctsTxVector,
111 Time txDuration,
112 Time response) const override;
113 void TransmissionSucceeded() override;
114 void TransmissionFailed() override;
115 void ForwardMpduDown(Ptr<WifiMpdu> mpdu, WifiTxVector& txVector) override;
116
126 virtual bool StartTransmission(Ptr<QosTxop> edca, Time txopDuration);
127
141 virtual bool StartFrameExchange(Ptr<QosTxop> edca, Time availableTime, bool initialFrame);
142
148 void PifsRecovery();
149
156 virtual bool SendCfEndIfNeeded();
157
164 virtual void SetTxopHolder(Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
165
171 private:
176 void CancelPifsRecovery();
177
182};
183
184} // namespace ns3
185
186#endif /* QOS_FRAME_EXCHANGE_MANAGER_H */
An identifier for simulation events.
Definition: event-id.h:55
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
an EUI-48 address
Definition: mac48-address.h:46
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
EventId m_pifsRecoveryEvent
event associated with an attempt of PIFS recovery
void ForwardMpduDown(Ptr< WifiMpdu > mpdu, WifiTxVector &txVector) override
Forward an MPDU down to the PHY layer.
void ReceiveMpdu(Ptr< const WifiMpdu > mpdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, bool inAmpdu) override
This method handles the reception of an MPDU (possibly included in an A-MPDU)
void TransmissionFailed() override
Take necessary actions upon a transmission failure.
virtual bool StartFrameExchange(Ptr< QosTxop > edca, Time availableTime, bool initialFrame)
Start a frame exchange (including protection frames and acknowledgment frames as needed) that fits wi...
virtual void SetTxopHolder(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Set the TXOP holder, if needed, based on the received frame.
Time GetFrameDurationId(const WifiMacHeader &header, uint32_t size, const WifiTxParameters &txParams, Ptr< Packet > fragmentedPacket) const override
Compute how to set the Duration/ID field of a frame being transmitted with the given TX parameters.
Time GetCtsToSelfDurationId(const WifiTxVector &ctsTxVector, Time txDuration, Time response) const override
Compute how to set the Duration/ID field of a CTS-to-self frame to send to protect a frame transmitte...
Ptr< QosTxop > m_edca
the EDCAF that gained channel access
virtual bool IsWithinLimitsIfAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams, Time ppduDurationLimit) const
Check whether the given MPDU can be added to the frame being built (as described by the given TX para...
Mac48Address m_txopHolder
MAC address of the TXOP holder.
bool StartTransmission(Ptr< Txop > edca, uint16_t allowedWidth) override
Request the FrameExchangeManager to start a frame exchange sequence.
Time GetRtsDurationId(const WifiTxVector &rtsTxVector, Time txDuration, Time response) const override
Compute how to set the Duration/ID field of an RTS frame to send to protect a frame transmitted with ...
virtual bool SendCfEndIfNeeded()
Send a CF-End frame to indicate the completion of the TXOP, provided that the remaining duration is l...
bool m_initialFrame
true if transmitting the initial frame of a TXOP
void TransmissionSucceeded() override
Take necessary actions upon a transmission success.
static TypeId GetTypeId()
Get the type ID.
bool m_pifsRecovery
true if performing a PIFS recovery after failure
Ptr< Txop > m_edcaBackingOff
channel access function that invoked backoff during TXOP
void PreProcessFrame(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector) override
Perform actions that are possibly needed when receiving any frame, independently of whether the frame...
bool m_setQosQueueSize
whether to set the Queue Size subfield of the QoS Control field of QoS data frames
void PifsRecovery()
Perform a PIFS recovery as a response to transmission failure within a TXOP.
virtual bool IsWithinSizeAndTimeLimits(uint32_t ppduPayloadSize, Mac48Address receiver, const WifiTxParameters &txParams, Time ppduDurationLimit) const
Check whether the transmission time of the frame being built (as described by the given TX parameters...
void CancelPifsRecovery()
Cancel the PIFS recovery event and have the EDCAF attempting PIFS recovery release the channel.
bool TryAddMpdu(Ptr< const WifiMpdu > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
void DoDispose() override
Destructor implementation.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
Implements the IEEE 802.11 MAC header.
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.
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:70