A Discrete-Event Network Simulator
API
wifi-ppdu.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2019 Orange Labs
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: Rediet <getachew.redieteab@orange.com>
19  */
20 
21 #ifndef WIFI_PPDU_H
22 #define WIFI_PPDU_H
23 
24 #include <list>
25 #include <unordered_map>
26 #include "ns3/nstime.h"
27 #include "wifi-tx-vector.h"
28 #include "wifi-phy-header.h"
29 #include "wifi-phy-band.h"
30 
31 namespace ns3 {
32 
33 class WifiPsdu;
34 
35 typedef std::unordered_map <uint16_t /* staId */, Ptr<const WifiPsdu> /* PSDU */> WifiConstPsduMap;
36 
43 class WifiPpdu : public SimpleRefCount<WifiPpdu>
44 {
45 public:
54  WifiPpdu (Ptr<const WifiPsdu> psdu, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band);
55 
64  WifiPpdu (const WifiConstPsduMap & psdus, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band);
65 
66  virtual ~WifiPpdu ();
67 
72  WifiTxVector GetTxVector (void) const;
73 
80  Ptr<const WifiPsdu> GetPsdu (uint8_t bssColor = 64, uint16_t staId = SU_STA_ID) const;
81 
86  bool IsTruncatedTx (void) const;
87 
91  void SetTruncatedTx (void);
92 
97  Time GetTxDuration () const;
98 
103  bool IsMu (void) const;
104 
109  WifiModulationClass GetModulation (void) const;
110 
115  void Print (std::ostream &os) const;
116 
117 
118 private:
126  void SetPhyHeaders (WifiTxVector txVector, Time ppduDuration, WifiPhyBand band);
127 
138  uint16_t m_channelWidth;
139  uint8_t m_txPowerLevel;
141 };
142 
150 std::ostream& operator<< (std::ostream& os, const WifiPpdu &ppdu);
151 
159 std::ostream & operator << (std::ostream &os, const WifiConstPsduMap &psdus);
160 
161 } //namespace ns3
162 
163 #endif /* WIFI_PPDU_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiTxVector::HeMuUserInfoMap m_muUserInfos
the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented) ...
Definition: wifi-ppdu.h:140
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Definition: wifi-ppdu.h:33
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
void SetTruncatedTx(void)
Indicate that the PPDU&#39;s transmission was aborted due to transmitter switch off.
Definition: wifi-ppdu.cc:401
Implements the IEEE 802.11ac PHY header (VHT-SIG-A1/A2/B).
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
Definition: wifi-ppdu.cc:172
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: wifi-ppdu.h:132
Ptr< const WifiPsdu > GetPsdu(uint8_t bssColor=64, uint16_t staId=SU_STA_ID) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:373
WifiModulationClass GetModulation(void) const
Get the modulation used for the PPDU.
Definition: wifi-ppdu.cc:476
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:32
void SetPhyHeaders(WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
Fill in the PHY headers.
Definition: wifi-ppdu.cc:67
void Print(std::ostream &os) const
Print the PPDU contents.
Definition: wifi-ppdu.cc:482
WifiPreamble m_preamble
the PHY preamble
Definition: wifi-ppdu.h:133
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: wifi-ppdu.h:130
Implements the IEEE 802.11 OFDM and ERP OFDM L-SIG PHY header.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:43
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition: wifi-psdu.h:40
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
Definition: wifi-ppdu.h:137
bool IsTruncatedTx(void) const
Return true if the PPDU&#39;s transmission was aborted due to transmitter switch off. ...
Definition: wifi-ppdu.cc:395
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~WifiPpdu()
Definition: wifi-ppdu.cc:62
uint8_t m_txPowerLevel
the transmission power level (used only for TX and initializing the returned WifiTxVector) ...
Definition: wifi-ppdu.h:139
Implements the IEEE 802.11n PHY header (HT-SIG1/2).
bool m_truncatedTx
flag indicating whether the frame&#39;s transmission was aborted due to transmitter switch off ...
Definition: wifi-ppdu.h:136
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:30
WifiConstPsduMap m_psdus
the PSDUs contained in this PPDU
Definition: wifi-ppdu.h:135
Implements the IEEE 802.11ax HE-SIG PHY header (HE-SIG-A1/A2/B)
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:38
Implements the IEEE 802.11 DSSS SIG PHY header.
DsssSigHeader m_dsssSig
the DSSS SIG PHY header
Definition: wifi-ppdu.h:128
LSigHeader m_lSig
the L-SIG PHY header
Definition: wifi-ppdu.h:129
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
Definition: wifi-ppdu.h:131
WifiPpdu(Ptr< const WifiPsdu > psdu, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
Create a SU PPDU storing a PSDU.
Definition: wifi-ppdu.cc:32
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz
Definition: wifi-ppdu.h:138
Time GetTxDuration() const
Get the total transmission duration of the PPDU.
Definition: wifi-ppdu.cc:408
A template-based reference counting class.
bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: wifi-ppdu.cc:470
WifiModulationClass m_modulation
the modulation used for the transmission of this PPDU
Definition: wifi-ppdu.h:134
#define SU_STA_ID
Definition: wifi-mode.h:30