A Discrete-Event Network Simulator
API
mpdu-aggregator.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013
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: Ghada Badawy <gbadawy@gmail.com>
19  */
20 
21 #ifndef MPDU_AGGREGATOR_H
22 #define MPDU_AGGREGATOR_H
23 
24 #include "ns3/object.h"
25 #include "wifi-mode.h"
26 #include "qos-txop.h"
27 #include "ns3/nstime.h"
28 #include <vector>
29 
30 namespace ns3 {
31 
32 class AmpduSubframeHeader;
33 class WifiTxVector;
34 class Packet;
35 class WifiMacQueueItem;
36 class RegularWifiMac;
37 class WifiTxParameters;
38 
43 class MpduAggregator : public Object
44 {
45 public:
49  typedef std::map<AcIndex, Ptr<QosTxop> > EdcaQueues;
50 
51 
56  static TypeId GetTypeId (void);
57 
58  MpduAggregator ();
59  virtual ~MpduAggregator ();
60 
68  static void Aggregate (Ptr<const WifiMacQueueItem> mpdu, Ptr<Packet> ampdu, bool isSingle);
69 
78  static uint32_t GetSizeIfAggregated (uint32_t mpduSize, uint32_t ampduSize);
79 
89  uint32_t GetMaxAmpduSize (Mac48Address recipient, uint8_t tid,
90  WifiModulationClass modulation) const;
91 
125  std::vector<Ptr<WifiMacQueueItem>> GetNextAmpdu (Ptr<WifiMacQueueItem> mpdu,
126  WifiTxParameters& txParams,
127  Time availableTime,
129 
135  void SetWifiMac (const Ptr<RegularWifiMac> mac);
136 
145  static uint8_t CalculatePadding (uint32_t ampduSize);
146 
155  static AmpduSubframeHeader GetAmpduSubframeHeader (uint16_t mpduSize, bool isSingle);
156 
157 protected:
158  void DoDispose () override;
159 
160 private:
162 };
163 
164 } //namespace ns3
165 
166 #endif /* MPDU_AGGREGATOR_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::MpduAggregator::SetWifiMac
void SetWifiMac(const Ptr< RegularWifiMac > mac)
Set the MAC layer to use.
Definition: mpdu-aggregator.cc:74
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
qos-txop.h
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
third.mac
mac
Definition: third.py:99
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition: wifi-tx-parameters.h:45
ns3::MpduAggregator::GetMaxAmpduSize
uint32_t GetMaxAmpduSize(Mac48Address recipient, uint8_t tid, WifiModulationClass modulation) const
Determine the maximum size for an A-MPDU of the given TID that can be sent to the given receiver when...
Definition: mpdu-aggregator.cc:121
ns3::MpduAggregator::GetAmpduSubframeHeader
static AmpduSubframeHeader GetAmpduSubframeHeader(uint16_t mpduSize, bool isSingle)
Get the A-MPDU subframe header corresponding to the MPDU size and whether the MPDU is a single MPDU.
Definition: mpdu-aggregator.cc:182
ns3::MpduAggregator::m_mac
Ptr< RegularWifiMac > m_mac
the MAC of this station
Definition: mpdu-aggregator.h:161
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::MpduAggregator::GetNextAmpdu
std::vector< Ptr< WifiMacQueueItem > > GetNextAmpdu(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams, Time availableTime, WifiMacQueueItem::QueueIteratorPair queueIt) const
Attempt to aggregate other MPDUs to the given MPDU, while meeting the following constraints:
Definition: mpdu-aggregator.cc:194
ns3::MpduAggregator::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: mpdu-aggregator.cc:48
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
wifi-mode.h
ns3::AmpduSubframeHeader
Headers for A-MPDU subframes.
Definition: ampdu-subframe-header.h:33
ns3::MpduAggregator::EdcaQueues
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.
Definition: mpdu-aggregator.h:49
ns3::WifiMacQueueItem::QueueIteratorPair
Information needed to remove an MSDU from the queue.
Definition: wifi-mac-queue-item.h:147
ns3::MpduAggregator::Aggregate
static void Aggregate(Ptr< const WifiMacQueueItem > mpdu, Ptr< Packet > ampdu, bool isSingle)
Aggregate an MPDU to an A-MPDU.
Definition: mpdu-aggregator.cc:81
ns3::MpduAggregator::MpduAggregator
MpduAggregator()
Definition: mpdu-aggregator.cc:58
ns3::MpduAggregator::DoDispose
void DoDispose() override
Destructor implementation.
Definition: mpdu-aggregator.cc:67
ns3::MpduAggregator::CalculatePadding
static uint8_t CalculatePadding(uint32_t ampduSize)
Definition: mpdu-aggregator.cc:176
ns3::MpduAggregator::~MpduAggregator
virtual ~MpduAggregator()
Definition: mpdu-aggregator.cc:62
ns3::MpduAggregator
Aggregator used to construct A-MPDUs.
Definition: mpdu-aggregator.h:44
ns3::MpduAggregator::GetSizeIfAggregated
static uint32_t GetSizeIfAggregated(uint32_t mpduSize, uint32_t ampduSize)
Compute the size of the A-MPDU resulting from the aggregation of an MPDU of size mpduSize and an A-MP...
Definition: mpdu-aggregator.cc:113
ns3::WifiModulationClass
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Definition: wifi-phy-common.h:117