A Discrete-Event Network Simulator
API
qos-frame-exchange-manager.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef QOS_FRAME_EXCHANGE_MANAGER_H
22 #define QOS_FRAME_EXCHANGE_MANAGER_H
23 
24 #include "frame-exchange-manager.h"
25 
26 namespace ns3 {
27 
28 
37 {
38 public:
43  static TypeId GetTypeId (void);
45  virtual ~QosFrameExchangeManager ();
46 
47  bool StartTransmission (Ptr<Txop> edca) override;
48 
62  bool TryAddMpdu (Ptr<const WifiMacQueueItem> mpdu, WifiTxParameters& txParams, Time availableTime) const;
63 
74  virtual bool IsWithinLimitsIfAddMpdu (Ptr<const WifiMacQueueItem> mpdu, const WifiTxParameters& txParams,
75  Time ppduDurationLimit) const;
76 
90  virtual bool IsWithinSizeAndTimeLimits (uint32_t ppduPayloadSize, Mac48Address receiver,
91  const WifiTxParameters& txParams, Time ppduDurationLimit) const;
92 
93 protected:
94  void DoDispose () override;
95 
96  void ReceiveMpdu (Ptr<WifiMacQueueItem> mpdu, RxSignalInfo rxSignalInfo,
97  const WifiTxVector& txVector, bool inAmpdu) override;
98  void PreProcessFrame (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector) override;
99  Time GetFrameDurationId (const WifiMacHeader& header, uint32_t size,
100  const WifiTxParameters& txParams,
101  Ptr<Packet> fragmentedPacket) const override;
102  Time GetRtsDurationId (const WifiTxVector& rtsTxVector, Time txDuration,
103  Time response) const override;
104  Time GetCtsToSelfDurationId (const WifiTxVector& ctsTxVector, Time txDuration,
105  Time response) const override;
106  void TransmissionSucceeded (void) override;
107  void TransmissionFailed (void) override;
108  void ForwardMpduDown (Ptr<WifiMacQueueItem> mpdu, WifiTxVector& txVector) override;
109 
119  virtual bool StartTransmission (Ptr<QosTxop> edca, Time txopDuration);
120 
134  virtual bool StartFrameExchange (Ptr<QosTxop> edca, Time availableTime, bool initialFrame);
135 
141  void PifsRecovery (void);
142 
149  virtual bool SendCfEndIfNeeded (void);
150 
157  virtual void SetTxopHolder (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector);
158 
164 private:
165 
170  void CancelPifsRecovery (void);
171 
176 };
177 
178 } //namespace ns3
179 
180 #endif /* QOS_FRAME_EXCHANGE_MANAGER_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::QosFrameExchangeManager::m_setQosQueueSize
bool m_setQosQueueSize
whether to set the Queue Size subfield of the QoS Control field of QoS data frames
Definition: qos-frame-exchange-manager.h:161
ns3::QosFrameExchangeManager::ForwardMpduDown
void ForwardMpduDown(Ptr< WifiMacQueueItem > mpdu, WifiTxVector &txVector) override
Forward an MPDU down to the PHY layer.
Definition: qos-frame-exchange-manager.cc:519
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QosFrameExchangeManager::m_initialFrame
bool m_initialFrame
true if transmitting the initial frame of a TXOP
Definition: qos-frame-exchange-manager.h:172
ns3::QosFrameExchangeManager::TransmissionFailed
void TransmissionFailed(void) override
Take necessary actions upon a transmission failure.
Definition: qos-frame-exchange-manager.cc:565
ns3::QosFrameExchangeManager::IsWithinSizeAndTimeLimits
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...
Definition: qos-frame-exchange-manager.cc:406
ns3::QosFrameExchangeManager::TransmissionSucceeded
void TransmissionSucceeded(void) override
Take necessary actions upon a transmission success.
Definition: qos-frame-exchange-manager.cc:536
ns3::QosFrameExchangeManager::ReceiveMpdu
void ReceiveMpdu(Ptr< WifiMacQueueItem > mpdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, bool inAmpdu) override
This method handles the reception of an MPDU (possibly included in an A-MPDU)
Definition: qos-frame-exchange-manager.cc:658
ns3::QosFrameExchangeManager::~QosFrameExchangeManager
virtual ~QosFrameExchangeManager()
Definition: qos-frame-exchange-manager.cc:66
ns3::QosFrameExchangeManager::StartFrameExchange
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...
Definition: qos-frame-exchange-manager.cc:262
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::QosFrameExchangeManager::StartTransmission
bool StartTransmission(Ptr< Txop > edca) override
Request the FrameExchangeManager to start a frame exchange sequence.
Definition: qos-frame-exchange-manager.cc:151
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition: wifi-tx-parameters.h:45
ns3::QosFrameExchangeManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition: qos-frame-exchange-manager.cc:72
ns3::QosFrameExchangeManager::CancelPifsRecovery
void CancelPifsRecovery(void)
Cancel the PIFS recovery event and have the EDCAF attempting PIFS recovery release the channel.
Definition: qos-frame-exchange-manager.cc:139
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::Ptr< Txop >
ns3::QosFrameExchangeManager
QosFrameExchangeManager handles the frame exchange sequences for QoS stations.
Definition: qos-frame-exchange-manager.h:37
ns3::QosFrameExchangeManager::m_txopHolder
Mac48Address m_txopHolder
MAC address of the TXOP holder.
Definition: qos-frame-exchange-manager.h:160
ns3::QosFrameExchangeManager::m_pifsRecovery
bool m_pifsRecovery
true if performing a PIFS recovery after failure
Definition: qos-frame-exchange-manager.h:173
ns3::QosFrameExchangeManager::m_edca
Ptr< QosTxop > m_edca
the EDCAF that gained channel access
Definition: qos-frame-exchange-manager.h:159
ns3::QosFrameExchangeManager::PreProcessFrame
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...
Definition: qos-frame-exchange-manager.cc:615
ns3::QosFrameExchangeManager::GetRtsDurationId
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 ...
Definition: qos-frame-exchange-manager.cc:468
frame-exchange-manager.h
ns3::QosFrameExchangeManager::GetFrameDurationId
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.
Definition: qos-frame-exchange-manager.cc:441
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::QosFrameExchangeManager::PifsRecovery
void PifsRecovery(void)
Perform a PIFS recovery as a response to transmission failure within a TXOP.
Definition: qos-frame-exchange-manager.cc:118
ns3::QosFrameExchangeManager::SetTxopHolder
virtual void SetTxopHolder(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
Set the TXOP holder, if needed, based on the received frame.
Definition: qos-frame-exchange-manager.cc:641
ns3::QosFrameExchangeManager::IsWithinLimitsIfAddMpdu
virtual bool IsWithinLimitsIfAddMpdu(Ptr< const WifiMacQueueItem > 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...
Definition: qos-frame-exchange-manager.cc:392
ns3::QosFrameExchangeManager::m_pifsRecoveryEvent
EventId m_pifsRecoveryEvent
event associated with an attempt of PIFS recovery
Definition: qos-frame-exchange-manager.h:174
ns3::RxSignalInfo
RxSignalInfo structure containing info on the received signal.
Definition: phy-entity.h:67
ns3::QosFrameExchangeManager::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: qos-frame-exchange-manager.cc:38
ns3::FrameExchangeManager
FrameExchangeManager is a base class handling the basic frame exchange sequences for non-QoS stations...
Definition: frame-exchange-manager.h:52
ns3::QosFrameExchangeManager::QosFrameExchangeManager
QosFrameExchangeManager()
Definition: qos-frame-exchange-manager.cc:60
ns3::QosFrameExchangeManager::m_edcaBackingOff
Ptr< Txop > m_edcaBackingOff
channel access function that invoked backoff during TXOP
Definition: qos-frame-exchange-manager.h:175
ns3::QosFrameExchangeManager::TryAddMpdu
bool TryAddMpdu(Ptr< const WifiMacQueueItem > mpdu, WifiTxParameters &txParams, Time availableTime) const
Recompute the protection and acknowledgment methods to use if the given MPDU is added to the frame be...
Definition: qos-frame-exchange-manager.cc:309
ns3::QosFrameExchangeManager::SendCfEndIfNeeded
virtual bool SendCfEndIfNeeded(void)
Send a CF-End frame to indicate the completion of the TXOP, provided that the remaining duration is l...
Definition: qos-frame-exchange-manager.cc:82
ns3::QosFrameExchangeManager::GetCtsToSelfDurationId
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...
Definition: qos-frame-exchange-manager.cc:493