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 
41 class MpduAggregator : public Object
42 {
43 public:
47  typedef std::map<AcIndex, Ptr<QosTxop> > EdcaQueues;
48 
49 
54  static TypeId GetTypeId (void);
55 
56  MpduAggregator ();
57  virtual ~MpduAggregator ();
58 
66  static void Aggregate (Ptr<const WifiMacQueueItem> mpdu, Ptr<Packet> ampdu, bool isSingle);
67 
76  static uint32_t GetSizeIfAggregated (uint32_t mpduSize, uint32_t ampduSize);
77 
87  uint32_t GetMaxAmpduSize (Mac48Address recipient, uint8_t tid,
88  WifiModulationClass modulation) const;
89 
118  std::vector<Ptr<WifiMacQueueItem>> GetNextAmpdu (Ptr<const WifiMacQueueItem> mpdu,
119  WifiTxVector txVector,
120  Time ppduDurationLimit = Time::Min ()) const;
121 
127  void SetEdcaQueues (EdcaQueues edcaQueues);
128 
137  static uint8_t CalculatePadding (uint32_t ampduSize);
138 
146  static AmpduSubframeHeader GetAmpduSubframeHeader (uint16_t mpduSize, bool isSingle);
147 
148 private:
150 };
151 
152 } //namespace ns3
153 
154 #endif /* MPDU_AGGREGATOR_H */
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
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
Definition: nstime.h:273
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...
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
std::vector< Ptr< WifiMacQueueItem > > GetNextAmpdu(Ptr< const WifiMacQueueItem > mpdu, WifiTxVector txVector, Time ppduDurationLimit=Time::Min()) const
Attempt to aggregate other MPDUs to the given MPDU, while meeting the following constraints: ...
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:36
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.
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.
A base class which provides memory management and object aggregation.
Definition: object.h:87
EdcaQueues m_edca
the map of EDCA queues
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
void SetEdcaQueues(EdcaQueues edcaQueues)
Set the map of EDCA queues.