A Discrete-Event Network Simulator
API
vht-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  * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
20  * Sébastien Deronne <sebastien.deronne@gmail.com> (VhtSigHeader)
21  */
22 
23 #ifndef VHT_PPDU_H
24 #define VHT_PPDU_H
25 
26 #include "ns3/ofdm-ppdu.h"
27 
34 namespace ns3 {
35 
36 class WifiPsdu;
37 
44 class VhtPpdu : public OfdmPpdu
45 {
46 public:
47 
52  class VhtSigHeader : public Header
53  {
54  public:
55  VhtSigHeader ();
56  virtual ~VhtSigHeader ();
57 
62  static TypeId GetTypeId (void);
63 
64  TypeId GetInstanceTypeId (void) const override;
65  void Print (std::ostream &os) const override;
66  uint32_t GetSerializedSize (void) const override;
67  void Serialize (Buffer::Iterator start) const override;
68  uint32_t Deserialize (Buffer::Iterator start) override;
69 
75  void SetMuFlag (bool mu);
76 
82  void SetChannelWidth (uint16_t channelWidth);
88  uint16_t GetChannelWidth (void) const;
94  void SetNStreams (uint8_t nStreams);
100  uint8_t GetNStreams (void) const;
101 
107  void SetShortGuardInterval (bool sgi);
113  bool GetShortGuardInterval (void) const;
119  void SetShortGuardIntervalDisambiguation (bool disambiguation);
125  bool GetShortGuardIntervalDisambiguation (void) const;
131  void SetSuMcs (uint8_t mcs);
137  uint8_t GetSuMcs (void) const;
138 
139  private:
140  //VHT-SIG-A1 fields
141  uint8_t m_bw;
142  uint8_t m_nsts;
143 
144  //VHT-SIG-A2 fields
145  uint8_t m_sgi;
147  uint8_t m_suMcs;
148 
150  bool m_mu;
151  }; //class VhtSigHeader
152 
162  VhtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
163  WifiPhyBand band, uint64_t uid);
167  virtual ~VhtPpdu ();
168 
169  Time GetTxDuration (void) const override;
170  Ptr<WifiPpdu> Copy (void) const override;
171  WifiPpduType GetType (void) const override;
172 
173 private:
174  WifiTxVector DoGetTxVector (void) const override;
175 
177 }; //class VhtPpdu
178 
179 } //namespace ns3
180 
181 #endif /* VHT_PPDU_H */
Protocol header serialization and deserialization.
Definition: header.h:42
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...
uint8_t m_sgi
Short GI.
Definition: vht-ppdu.h:145
void SetShortGuardIntervalDisambiguation(bool disambiguation)
Fill the short GI NSYM disambiguation field of VHT-SIG-A2.
Definition: vht-ppdu.cc:226
VHT PHY header (VHT-SIG-A1/A2/B).
Definition: vht-ppdu.h:52
uint8_t GetSuMcs(void) const
Return the SU VHT MCS field of VHT-SIG-A2.
Definition: vht-ppdu.cc:245
def start()
Definition: core.py:1855
uint8_t m_suMcs
SU VHT MCS.
Definition: vht-ppdu.h:147
static TypeId GetTypeId(void)
Get the type ID.
Definition: vht-ppdu.cc:113
void Serialize(Buffer::Iterator start) const override
Definition: vht-ppdu.cc:251
uint32_t GetSerializedSize(void) const override
Definition: vht-ppdu.cc:140
iterator in a Buffer instance
Definition: buffer.h:98
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: vht-ppdu.cc:87
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
Definition: vht-ppdu.h:176
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: vht-ppdu.cc:153
bool GetShortGuardIntervalDisambiguation(void) const
Return the short GI NSYM disambiguation field of VHT-SIG-A2.
Definition: vht-ppdu.cc:232
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: vht-ppdu.cc:124
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: vht-ppdu.h:150
VhtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create a VHT PPDU.
Definition: vht-ppdu.cc:33
OFDM PPDU (11a)OfdmPpdu stores a preamble, PHY headers and a PSDU of a PPDU with non-HT header...
Definition: ofdm-ppdu.h:47
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of VHT-SIG-A1 (in MHz).
Definition: vht-ppdu.cc:159
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of VHT-SIG-A2.
Definition: vht-ppdu.cc:214
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: vht-ppdu.cc:70
WifiPpduType GetType(void) const override
Return the PPDU type (.
Definition: vht-ppdu.cc:93
uint8_t m_sgi_disambiguation
Short GI NSYM Disambiguation.
Definition: vht-ppdu.h:146
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
uint8_t m_nsts
NSTS.
Definition: vht-ppdu.h:142
void SetSuMcs(uint8_t mcs)
Fill the SU VHT MCS field of VHT-SIG-A2.
Definition: vht-ppdu.cc:238
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:32
virtual ~VhtPpdu()
Destructor for VhtPpdu.
Definition: vht-ppdu.cc:52
uint32_t Deserialize(Buffer::Iterator start) override
Definition: vht-ppdu.cc:277
uint8_t GetNStreams(void) const
Return the number of streams.
Definition: vht-ppdu.cc:208
void Print(std::ostream &os) const override
Definition: vht-ppdu.cc:130
VHT PPDU (11ac)VhtPpdu stores a preamble, PHY headers and a PSDU of a PPDU with VHT header...
Definition: vht-ppdu.h:44
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: vht-ppdu.cc:57
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of VHT-SIG-A1.
Definition: vht-ppdu.cc:201
a unique identifier for an interface.
Definition: type-id.h:58
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: vht-ppdu.cc:180
bool GetShortGuardInterval(void) const
Return the short GI field of VHT-SIG-A2.
Definition: vht-ppdu.cc:220