A Discrete-Event Network Simulator
API
ht-ppdu.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 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> (HtSigHeader)
21  */
22 
23 #ifndef HT_PPDU_H
24 #define HT_PPDU_H
25 
26 #include "ns3/ofdm-ppdu.h"
27 
34 namespace ns3 {
35 
36 class WifiPsdu;
37 
44 class HtPpdu : public OfdmPpdu
45 {
46 public:
47 
52  class HtSigHeader : public Header
53  {
54  public:
55  HtSigHeader ();
56  virtual ~HtSigHeader ();
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 SetMcs (uint8_t mcs);
81  uint8_t GetMcs (void) const;
87  void SetChannelWidth (uint16_t channelWidth);
93  uint16_t GetChannelWidth (void) const;
99  void SetAggregation (bool aggregation);
105  bool GetAggregation (void) const;
111  void SetShortGuardInterval (bool sgi);
117  bool GetShortGuardInterval (void) const;
123  void SetHtLength (uint16_t length);
129  uint16_t GetHtLength (void) const;
130 
131  private:
132  uint8_t m_mcs;
133  uint8_t m_cbw20_40;
134  uint16_t m_htLength;
135  uint8_t m_aggregation;
136  uint8_t m_sgi;
137  }; //HtSigHeader
138 
148  HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
149  WifiPhyBand band, uint64_t uid);
153  virtual ~HtPpdu ();
154 
155  Time GetTxDuration (void) const override;
156  Ptr<WifiPpdu> Copy (void) const override;
157 
158 private:
159  WifiTxVector DoGetTxVector (void) const override;
160 
162 }; //class HtPpdu
163 
164 } //namespace ns3
165 
166 #endif /* HT_PPDU_H */
ns3::HtPpdu::HtSigHeader::GetMcs
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
Definition: ht-ppdu.cc:139
ns3::OfdmPpdu
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::HtPpdu::HtSigHeader::GetSerializedSize
uint32_t GetSerializedSize(void) const override
Definition: ht-ppdu.cc:126
ns3::HtPpdu::HtSigHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition: ht-ppdu.cc:193
ns3::HtPpdu::HtSigHeader::m_mcs
uint8_t m_mcs
Modulation and Coding Scheme index.
Definition: ht-ppdu.h:132
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::HtPpdu::Copy
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: ht-ppdu.cc:80
ns3::HtPpdu::HtSigHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: ht-ppdu.cc:99
ns3::HtPpdu::HtSigHeader::m_aggregation
uint8_t m_aggregation
Aggregation.
Definition: ht-ppdu.h:135
ns3::HtPpdu::DoGetTxVector
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: ht-ppdu.cc:58
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::HtPpdu::HtSigHeader::GetHtLength
uint16_t GetHtLength(void) const
Return the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:163
ns3::HtPpdu::HtSigHeader::Print
void Print(std::ostream &os) const override
Definition: ht-ppdu.cc:116
ns3::HtPpdu::HtSigHeader::~HtSigHeader
virtual ~HtSigHeader()
Definition: ht-ppdu.cc:94
ns3::HtPpdu::HtSigHeader::SetChannelWidth
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
Definition: ht-ppdu.cc:145
ns3::HtPpdu::~HtPpdu
virtual ~HtPpdu()
Destructor for HtPpdu.
Definition: ht-ppdu.cc:53
ns3::HtPpdu::HtSigHeader::m_cbw20_40
uint8_t m_cbw20_40
CBW 20/40.
Definition: ht-ppdu.h:133
ns3::Ptr< const WifiPsdu >
visualizer.core.start
def start()
Definition: core.py:1855
ns3::HtPpdu::HtSigHeader::m_htLength
uint16_t m_htLength
HT length.
Definition: ht-ppdu.h:134
ns3::HtPpdu::HtSigHeader::SetShortGuardInterval
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:181
ns3::HtPpdu::HtSigHeader::m_sgi
uint8_t m_sgi
Short Guard Interval.
Definition: ht-ppdu.h:136
ns3::HtPpdu::HtSigHeader::SetHtLength
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:157
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::Header
Protocol header serialization and deserialization.
Definition: header.h:43
ns3::HtPpdu::GetTxDuration
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: ht-ppdu.cc:71
ns3::HtPpdu::HtSigHeader
HT PHY header (HT-SIG1/2).
Definition: ht-ppdu.h:53
ns3::HtPpdu::HtPpdu
HtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an HT PPDU.
Definition: ht-ppdu.cc:34
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::HtPpdu::m_htSig
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: ht-ppdu.h:161
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition: buffer.h:99
ns3::HtPpdu::HtSigHeader::SetAggregation
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:169
ns3::HtPpdu
HT PPDU (11n)
Definition: ht-ppdu.h:45
ns3::HtPpdu::HtSigHeader::GetChannelWidth
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: ht-ppdu.cc:151
ns3::HtPpdu::HtSigHeader::HtSigHeader
HtSigHeader()
Definition: ht-ppdu.cc:85
ns3::HtPpdu::HtSigHeader::GetShortGuardInterval
bool GetShortGuardInterval(void) const
Return the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:187
ns3::HtPpdu::HtSigHeader::SetMcs
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
Definition: ht-ppdu.cc:132
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
ns3::HtPpdu::HtSigHeader::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: ht-ppdu.cc:110
ns3::HtPpdu::HtSigHeader::GetAggregation
bool GetAggregation(void) const
Return the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:175