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 
29 namespace ns3 {
30 
31 class AmsduSubframeHeader;
32 class Packet;
33 class QosTxop;
34 class WifiMacQueueItem;
35 class WifiTxVector;
36 
41 class MsduAggregator : public Object
42 {
43 public:
45  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> > DeaggregatedMsdus;
47  typedef std::list<std::pair<Ptr<Packet>, AmsduSubframeHeader> >::const_iterator DeaggregatedMsdusCI;
49  typedef std::map<AcIndex, Ptr<QosTxop> > EdcaQueues;
50 
55  static TypeId GetTypeId (void);
56 
57  MsduAggregator ();
58  virtual ~MsduAggregator ();
59 
68  void Aggregate (Ptr<const Packet> msdu, Ptr<Packet> amsdu,
69  Mac48Address src, Mac48Address dest) const;
70 
81  static uint16_t GetSizeIfAggregated (uint16_t msduSize, uint16_t amsduSize);
82 
110  Ptr<WifiMacQueueItem> GetNextAmsdu (Mac48Address recipient, uint8_t tid,
111  WifiTxVector txVector, uint32_t ampduSize = 0,
112  Time ppduDurationLimit = Seconds (0)) const;
113 
123  uint16_t GetMaxAmsduSize (Mac48Address recipient, uint8_t tid,
124  WifiModulationClass modulation) const;
125 
131  static DeaggregatedMsdus Deaggregate (Ptr<Packet> aggregatedPacket);
132 
138  void SetEdcaQueues (EdcaQueues map);
139 
140 private:
150  static uint8_t CalculatePadding (uint16_t amsduSize);
151 
153 };
154 
155 } //namespace ns3
156 
157 #endif /* MSDU_AGGREGATOR_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
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...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > >::const_iterator DeaggregatedMsdusCI
DeaggregatedMsdusCI typedef.
static DeaggregatedMsdus Deaggregate(Ptr< Packet > aggregatedPacket)
EdcaQueues m_edca
the map of EDCA queues
Ptr< WifiMacQueueItem > GetNextAmsdu(Mac48Address recipient, uint8_t tid, WifiTxVector txVector, uint32_t ampduSize=0, Time ppduDurationLimit=Seconds(0)) const
Dequeue MSDUs to be transmitted to a given station and belonging to a given TID from the correspondin...
void SetEdcaQueues(EdcaQueues map)
Set the map of EDCA queues.
static TypeId GetTypeId(void)
Get the type ID.
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...
void Aggregate(Ptr< const Packet > msdu, Ptr< Packet > amsdu, Mac48Address src, Mac48Address dest) const
Aggregate an MSDU to an A-MSDU.
std::list< std::pair< Ptr< Packet >, AmsduSubframeHeader > > DeaggregatedMsdus
DeaggregatedMsdus typedef.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
an EUI-48 address
Definition: mac48-address.h:43
Introspection did not find any typical Config paths.
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:36
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1062
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...
Aggregator used to construct A-MSDUs.
A base class which provides memory management and object aggregation.
Definition: object.h:87
a unique identifier for an interface.
Definition: type-id.h:58
std::map< AcIndex, Ptr< QosTxop > > EdcaQueues
EDCA queues typedef.