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 
154  static AmpduSubframeHeader GetAmpduSubframeHeader (uint16_t mpduSize, bool isSingle);
155 
156 protected:
157  virtual void DoDispose ();
158 
159 private:
161 };
162 
163 } //namespace ns3
164 
165 #endif /* MPDU_AGGREGATOR_H */
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802...
Aggregator used to construct A-MPDUs.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
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: ...
Information needed to remove an MSDU from the queue.
void SetWifiMac(const Ptr< RegularWifiMac > mac)
Set the MAC layer to use.
Ptr< RegularWifiMac > m_mac
the MAC of this station
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...
virtual void DoDispose()
Destructor implementation.
mac
Definition: third.py:99
Headers for A-MPDU subframes.
static void Aggregate(Ptr< const WifiMacQueueItem > mpdu, Ptr< Packet > ampdu, bool isSingle)
Aggregate an MPDU to an A-MPDU.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static uint8_t CalculatePadding(uint32_t ampduSize)
an EUI-48 address
Definition: mac48-address.h:43
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 TypeId GetTypeId(void)
Get the type ID.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism...
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.
A base class which provides memory management and object aggregation.
Definition: object.h:87
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...
a unique identifier for an interface.
Definition: type-id.h:58