A Discrete-Event Network Simulator
API
wifi-tx-parameters.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
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: Stefano Avallone <stavallo@unina.it>
19  */
20 
21 #ifndef WIFI_TX_PARAMETERS_H
22 #define WIFI_TX_PARAMETERS_H
23 
24 #include "wifi-tx-vector.h"
25 #include "wifi-mac-header.h"
26 #include "ns3/nstime.h"
27 #include <map>
28 #include <set>
29 #include <memory>
30 
31 namespace ns3 {
32 
33 class WifiMacQueueItem;
34 struct WifiProtection;
35 struct WifiAcknowledgment;
36 
45 {
46 public:
53  WifiTxParameters (const WifiTxParameters& txParams);
54 
61 
63  std::unique_ptr<WifiProtection> m_protection;
64  std::unique_ptr<WifiAcknowledgment> m_acknowledgment;
66 
70  void Clear (void);
71 
79 
87 
94  uint32_t GetSizeIfAddMpdu (Ptr<const WifiMacQueueItem> mpdu) const;
95 
103  std::pair<uint32_t, uint32_t> GetSizeIfAggregateMsdu (Ptr<const WifiMacQueueItem> msdu) const;
104 
111  uint32_t GetSize (Mac48Address receiver) const;
112 
114  struct PsduInfo
115  {
117  uint32_t amsduSize;
118  uint32_t ampduSize;
120  std::map<uint8_t, std::set<uint16_t>> seqNumbers;
122  };
124 
132  const PsduInfo* GetPsduInfo (Mac48Address receiver) const;
133 
135  typedef std::map<Mac48Address, PsduInfo> PsduInfoMap;
136 
142  const PsduInfoMap& GetPsduInfoMap (void) const;
143 
148  void Print (std::ostream &os) const;
149 
150 private:
152 };
154 
162 std::ostream& operator<< (std::ostream& os, const WifiTxParameters* txParams);
163 
164 } //namespace ns3
165 
166 #endif /* WIFI_TX_PARAMETERS_H */
ns3::WifiTxParameters::PsduInfo::ampduSize
uint32_t ampduSize
the size in bytes of the A-MPDU if multiple MPDUs have been added, and zero otherwise
Definition: wifi-tx-parameters.h:119
ns3::WifiTxParameters::PsduInfoMap
std::map< Mac48Address, PsduInfo > PsduInfoMap
Map containing information about the PSDUs addressed to every receiver.
Definition: wifi-tx-parameters.h:135
ns3::WifiTxParameters::GetPsduInfo
const PsduInfo * GetPsduInfo(Mac48Address receiver) const
Get a pointer to the information about the PSDU addressed to the given receiver, if present,...
Definition: wifi-tx-parameters.cc:80
ns3::WifiTxParameters::Print
void Print(std::ostream &os) const
Print the object contents.
Definition: wifi-tx-parameters.cc:249
ns3::WifiTxParameters::m_txDuration
Time m_txDuration
TX duration of the frame.
Definition: wifi-tx-parameters.h:65
ns3::WifiTxParameters::GetPsduInfoMap
const PsduInfoMap & GetPsduInfoMap(void) const
Get a const reference to the map containing information about PSDUs.
Definition: wifi-tx-parameters.cc:92
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiTxParameters::GetSize
uint32_t GetSize(Mac48Address receiver) const
Get the size in bytes of the (A-)MPDU addressed to the given receiver.
Definition: wifi-tx-parameters.cc:227
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiTxParameters::operator=
WifiTxParameters & operator=(const WifiTxParameters &txParams)
Copy assignment operator.
Definition: wifi-tx-parameters.cc:49
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition: wifi-tx-parameters.h:45
ns3::WifiTxParameters::m_protection
std::unique_ptr< WifiProtection > m_protection
protection method
Definition: wifi-tx-parameters.h:63
wifi-mac-header.h
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::WifiTxParameters::PsduInfo::header
WifiMacHeader header
MAC header of the last MPDU added.
Definition: wifi-tx-parameters.h:116
ns3::WifiTxParameters::GetSizeIfAddMpdu
uint32_t GetSizeIfAddMpdu(Ptr< const WifiMacQueueItem > mpdu) const
Get the size in bytes of the frame in case the given MPDU is added.
Definition: wifi-tx-parameters.cc:147
ns3::WifiTxParameters::WifiTxParameters
WifiTxParameters()
Definition: wifi-tx-parameters.cc:35
ns3::WifiTxParameters::PsduInfo::seqNumbers
std::map< uint8_t, std::set< uint16_t > > seqNumbers
set of the sequence numbers of the MPDUs added for each TID
Definition: wifi-tx-parameters.h:121
wifi-tx-vector.h
ns3::WifiTxParameters::GetSizeIfAggregateMsdu
std::pair< uint32_t, uint32_t > GetSizeIfAggregateMsdu(Ptr< const WifiMacQueueItem > msdu) const
Get the size in bytes of the frame in case the given MSDU is aggregated.
Definition: wifi-tx-parameters.cc:187
ns3::WifiTxParameters::Clear
void Clear(void)
Reset the TX parameters.
Definition: wifi-tx-parameters.cc:67
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::WifiTxParameters::m_acknowledgment
std::unique_ptr< WifiAcknowledgment > m_acknowledgment
acknowledgment method
Definition: wifi-tx-parameters.h:64
ns3::Time::Min
static Time Min()
Minimum representable Time Not to be confused with Min(Time,Time).
Definition: nstime.h:274
ns3::WifiTxParameters::m_txVector
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
Definition: wifi-tx-parameters.h:62
ns3::WifiTxParameters::m_info
PsduInfoMap m_info
information about the frame being prepared.
Definition: wifi-tx-parameters.h:151
ns3::WifiTxParameters::PsduInfo::amsduSize
uint32_t amsduSize
the size in bytes of the MSDU or A-MSDU included in the last MPDU added
Definition: wifi-tx-parameters.h:117
ns3::WifiTxParameters::PsduInfo
information about the frame being prepared for a specific receiver
Definition: wifi-tx-parameters.h:115
ns3::WifiTxParameters::AggregateMsdu
void AggregateMsdu(Ptr< const WifiMacQueueItem > msdu)
Record that an MSDU is being aggregated to the last MPDU added to the frame that hase the same receiv...
Definition: wifi-tx-parameters.cc:174
ns3::WifiTxParameters::AddMpdu
void AddMpdu(Ptr< const WifiMacQueueItem > mpdu)
Record that an MPDU is being added to the current frame.
Definition: wifi-tx-parameters.cc:98
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137