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 */
iterator in a Buffer instance
Definition: buffer.h:99
Protocol header serialization and deserialization.
Definition: header.h:43
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
HT PHY header (HT-SIG1/2).
Definition: ht-ppdu.h:53
void Print(std::ostream &os) const override
Definition: ht-ppdu.cc:116
static TypeId GetTypeId(void)
Get the type ID.
Definition: ht-ppdu.cc:99
uint8_t m_mcs
Modulation and Coding Scheme index.
Definition: ht-ppdu.h:132
uint16_t GetHtLength(void) const
Return the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:163
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:157
uint16_t m_htLength
HT length.
Definition: ht-ppdu.h:134
virtual ~HtSigHeader()
Definition: ht-ppdu.cc:94
bool GetShortGuardInterval(void) const
Return the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:187
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
Definition: ht-ppdu.cc:132
uint32_t GetSerializedSize(void) const override
Definition: ht-ppdu.cc:126
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: ht-ppdu.cc:151
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
Definition: ht-ppdu.cc:139
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:169
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
Definition: ht-ppdu.cc:145
uint8_t m_sgi
Short Guard Interval.
Definition: ht-ppdu.h:136
uint8_t m_cbw20_40
CBW 20/40.
Definition: ht-ppdu.h:133
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:181
uint8_t m_aggregation
Aggregation.
Definition: ht-ppdu.h:135
void Serialize(Buffer::Iterator start) const override
Definition: ht-ppdu.cc:193
bool GetAggregation(void) const
Return the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:175
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: ht-ppdu.cc:110
HT PPDU (11n)
Definition: ht-ppdu.h:45
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: ht-ppdu.h:161
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: ht-ppdu.cc:58
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: ht-ppdu.cc:71
virtual ~HtPpdu()
Destructor for HtPpdu.
Definition: ht-ppdu.cc:53
HtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an HT PPDU.
Definition: ht-ppdu.cc:34
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: ht-ppdu.cc:80
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1853