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 "wifi-mac-queue-item.h"
27 #include "ns3/nstime.h"
28 #include <vector>
29 
30 namespace ns3 {
31 
32 class AmpduSubframeHeader;
33 class WifiTxVector;
34 class QosTxop;
35 class Packet;
36 class WifiMac;
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 
123  std::vector<Ptr<WifiMacQueueItem>> GetNextAmpdu (Ptr<WifiMacQueueItem> mpdu,
124  WifiTxParameters& txParams,
125  Time availableTime) const;
126 
132  void SetWifiMac (const Ptr<WifiMac> mac);
133 
142  static uint8_t CalculatePadding (uint32_t ampduSize);
143 
152  static AmpduSubframeHeader GetAmpduSubframeHeader (uint16_t mpduSize, bool isSingle);
153 
154 protected:
155  void DoDispose () override;
156 
157 private:
159 };
160 
161 } //namespace ns3
162 
163 #endif /* MPDU_AGGREGATOR_H */
Headers for A-MPDU subframes.
an EUI-48 address
Definition: mac48-address.h:44
Aggregator used to construct A-MPDUs.
static uint8_t CalculatePadding(uint32_t ampduSize)
void DoDispose() override
Destructor implementation.
Ptr< WifiMac > m_mac
the MAC of this station
static TypeId GetTypeId(void)
Get the type ID.
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.
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...
static void Aggregate(Ptr< const WifiMacQueueItem > mpdu, Ptr< Packet > ampdu, bool isSingle)
Aggregate an MPDU to an A-MPDU.
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.
void SetWifiMac(const Ptr< WifiMac > mac)
Set the MAC layer to use.
std::vector< Ptr< WifiMacQueueItem > > GetNextAmpdu(Ptr< WifiMacQueueItem > mpdu, WifiTxParameters &txParams, Time availableTime) const
Attempt to aggregate other MPDUs to the given MPDU, while meeting the following constraints:
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...
A base class which provides memory management and object aggregation.
Definition: object.h:88
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mac
Definition: third.py:99