A Discrete-Event Network Simulator
API
msdu-aggregator.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 MIRKO BANCHI
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: Mirko Banchi <mk.banchi@gmail.com>
19  */
20 
21 #ifndef MSDU_AGGREGATOR_H
22 #define MSDU_AGGREGATOR_H
23 
24 #include "ns3/object.h"
25 #include "ns3/nstime.h"
26 #include "wifi-mode.h"
27 #include "qos-utils.h"
28 #include "wifi-mac-queue-item.h"
29 #include <map>
30 
31 namespace ns3 {
32 
33 class Packet;
34 class QosTxop;
35 class WifiTxVector;
36 class RegularWifiMac;
37 class HtFrameExchangeManager;
38 class WifiTxParameters;
39 
44 class MsduAggregator : public Object
45 {
46 public:
48  typedef std::map<AcIndex, Ptr<QosTxop> > EdcaQueues;
49 
54  static TypeId GetTypeId (void);
55 
56  MsduAggregator ();
57  virtual ~MsduAggregator ();
58 
69  static uint16_t GetSizeIfAggregated (uint16_t msduSize, uint16_t amsduSize);
70 
102  Time availableTime) const;
103 
113  uint16_t GetMaxAmsduSize (Mac48Address recipient, uint8_t tid,
114  WifiModulationClass modulation) const;
115 
122 
128  void SetWifiMac (const Ptr<RegularWifiMac> mac);
129 
139  static uint8_t CalculatePadding (uint16_t amsduSize);
140 
141 protected:
142  void DoDispose () override;
143 
144 private:
147 };
148 
149 } //namespace ns3
150 
151 #endif /* MSDU_AGGREGATOR_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::MsduAggregator::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: msdu-aggregator.cc:42
ns3::MsduAggregator::CalculatePadding
static uint8_t CalculatePadding(uint16_t amsduSize)
Calculate how much padding must be added to the end of an A-MSDU of the given size if a new MSDU is a...
Definition: msdu-aggregator.cc:152
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MsduAggregator::m_htFem
Ptr< HtFrameExchangeManager > m_htFem
the HT Frame Exchange Manager of this station
Definition: msdu-aggregator.h:146
qos-utils.h
ns3::MsduAggregator::DoDispose
void DoDispose() override
Destructor implementation.
Definition: msdu-aggregator.cc:61
ns3::MsduAggregator::~MsduAggregator
virtual ~MsduAggregator()
Definition: msdu-aggregator.cc:56
ns3::WifiMacQueueItem::DeaggregatedMsdus
std::list< std::pair< Ptr< const Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
DeaggregatedMsdus typedef.
Definition: wifi-mac-queue-item.h:135
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::MsduAggregator::EdcaQueues
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.
Definition: msdu-aggregator.h:48
wifi-mac-queue-item.h
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::Ptr< WifiMacQueueItem >
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
wifi-mode.h
ns3::MsduAggregator::m_mac
Ptr< RegularWifiMac > m_mac
the MAC of this station
Definition: msdu-aggregator.h:145
ns3::MsduAggregator::GetSizeIfAggregated
static uint16_t GetSizeIfAggregated(uint16_t msduSize, uint16_t amsduSize)
Compute the size of the A-MSDU resulting from the aggregation of an MSDU of size msduSize and an A-MS...
Definition: msdu-aggregator.cc:77
ns3::MsduAggregator::Deaggregate
static WifiMacQueueItem::DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
Definition: msdu-aggregator.cc:223
ns3::MsduAggregator
Aggregator used to construct A-MSDUs.
Definition: msdu-aggregator.h:45
ns3::MsduAggregator::SetWifiMac
void SetWifiMac(const Ptr< RegularWifiMac > mac)
Set the MAC layer to use.
Definition: msdu-aggregator.cc:69
ns3::MsduAggregator::GetMaxAmsduSize
uint16_t GetMaxAmsduSize(Mac48Address recipient, uint8_t tid, WifiModulationClass modulation) const
Determine the maximum size for an A-MSDU of the given TID that can be sent to the given receiver when...
Definition: msdu-aggregator.cc:158
ns3::MsduAggregator::GetNextAmsdu
Ptr< WifiMacQueueItem > GetNextAmsdu(Ptr< const WifiMacQueueItem > peekedItem, WifiTxParameters &txParams, Time availableTime) const
Attempt to aggregate other MSDUs to the given A-MSDU while meeting the following constraints:
Definition: msdu-aggregator.cc:86
ns3::WifiModulationClass
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Definition: wifi-phy-common.h:122
ns3::MsduAggregator::MsduAggregator
MsduAggregator()
Definition: msdu-aggregator.cc:52