A Discrete-Event Network Simulator
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
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  */
23 #ifndef HT_PPDU_H
24 #define HT_PPDU_H
26 #include "ns3/ofdm-ppdu.h"
34 namespace ns3 {
36 class WifiPsdu;
44 class HtPpdu : public OfdmPpdu
45 {
46 public:
52  class HtSigHeader : public Header
53  {
54  public:
55  HtSigHeader ();
56  virtual ~HtSigHeader ();
62  static TypeId GetTypeId (void);
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;
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;
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
148  HtPpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
149  WifiPhyBand band, uint64_t uid);
153  virtual ~HtPpdu ();
155  Time GetTxDuration (void) const override;
156  Ptr<WifiPpdu> Copy (void) const override;
158 private:
159  WifiTxVector DoGetTxVector (void) const override;
162 }; //class HtPpdu
164 } //namespace ns3
166 #endif /* HT_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...
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: ht-ppdu.cc:80
def start()
Definition: core.py:1855
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: ht-ppdu.cc:58
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: ht-ppdu.h:161
uint32_t GetSerializedSize(void) const override
Definition: ht-ppdu.cc:126
HT PPDU (11n)HtPpdu stores a preamble, PHY headers and a PSDU of a PPDU with HT header.
Definition: ht-ppdu.h:44
virtual ~HtSigHeader()
Definition: ht-ppdu.cc:94
uint8_t m_cbw20_40
CBW 20/40.
Definition: ht-ppdu.h:133
bool GetShortGuardInterval(void) const
Return the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:187
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t m_aggregation
Definition: ht-ppdu.h:135
HT PHY header (HT-SIG1/2).
Definition: ht-ppdu.h:52
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
Definition: ht-ppdu.cc:139
static TypeId GetTypeId(void)
Get the type ID.
Definition: ht-ppdu.cc:99
uint8_t m_sgi
Short Guard Interval.
Definition: ht-ppdu.h:136
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: ht-ppdu.cc:151
OFDM PPDU (11a)OfdmPpdu stores a preamble, PHY headers and a PSDU of a PPDU with non-HT header...
Definition: ofdm-ppdu.h:47
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: ht-ppdu.cc:71
HtPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an HT PPDU.
Definition: ht-ppdu.cc:34
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
Definition: ht-ppdu.cc:145
uint8_t m_mcs
Modulation and Coding Scheme index.
Definition: ht-ppdu.h:132
void Print(std::ostream &os) const override
Definition: ht-ppdu.cc:116
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:157
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:169
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: ht-ppdu.cc:110
Identifies the PHY band.
Definition: wifi-phy-band.h:32
uint16_t m_htLength
HT length.
Definition: ht-ppdu.h:134
uint32_t Deserialize(Buffer::Iterator start) override
Definition: ht-ppdu.cc:207
void Serialize(Buffer::Iterator start) const override
Definition: ht-ppdu.cc:193
virtual ~HtPpdu()
Destructor for HtPpdu.
Definition: ht-ppdu.cc:53
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
Definition: ht-ppdu.cc:132
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:181
a unique identifier for an interface.
Definition: type-id.h:58
uint16_t GetHtLength(void) const
Return the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:163
bool GetAggregation(void) const
Return the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:175