A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
dsss-ppdu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Orange Labs
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Rediet <getachew.redieteab@orange.com>
18 * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
19 * Sébastien Deronne <sebastien.deronne@gmail.com> (DsssSigHeader)
20 */
21
22#ifndef DSSS_PPDU_H
23#define DSSS_PPDU_H
24
25#include "ns3/wifi-ppdu.h"
26
27/**
28 * \file
29 * \ingroup wifi
30 * Declaration of ns3::DsssPpdu class.
31 */
32
33namespace ns3
34{
35
36class WifiPsdu;
37
38/**
39 * \brief DSSS (HR/DSSS) PPDU (11b)
40 * \ingroup wifi
41 *
42 * DsssPpdu stores a preamble, PHY headers and a PSDU of a PPDU with DSSS modulation.
43 */
44class DsssPpdu : public WifiPpdu
45{
46 public:
47 /**
48 * DSSS SIG PHY header.
49 * See section 16.2.2 in IEEE 802.11-2016.
50 */
52 {
53 public:
55
56 /**
57 * Fill the RATE field of L-SIG (in bit/s).
58 *
59 * \param rate the RATE field of L-SIG expressed in bit/s
60 */
61 void SetRate(uint64_t rate);
62 /**
63 * Return the RATE field of L-SIG (in bit/s).
64 *
65 * \return the RATE field of L-SIG expressed in bit/s
66 */
67 uint64_t GetRate() const;
68 /**
69 * Fill the LENGTH field of L-SIG (in bytes).
70 *
71 * \param length the LENGTH field of L-SIG expressed in bytes
72 */
73 void SetLength(uint16_t length);
74 /**
75 * Return the LENGTH field of L-SIG (in bytes).
76 *
77 * \return the LENGTH field of L-SIG expressed in bytes
78 */
79 uint16_t GetLength() const;
80
81 private:
82 uint8_t m_rate; ///< RATE field
83 uint16_t m_length; ///< LENGTH field
84 }; // class DsssSigHeader
85
86 /**
87 * Create a DSSS (HR/DSSS) PPDU.
88 *
89 * \param psdu the PHY payload (PSDU)
90 * \param txVector the TXVECTOR that was used for this PPDU
91 * \param channel the operating channel of the PHY used to transmit this PPDU
92 * \param ppduDuration the transmission duration of this PPDU
93 * \param uid the unique ID of this PPDU
94 */
96 const WifiTxVector& txVector,
97 const WifiPhyOperatingChannel& channel,
98 Time ppduDuration,
99 uint64_t uid);
100
101 Time GetTxDuration() const override;
102 Ptr<WifiPpdu> Copy() const override;
103
104 private:
105 WifiTxVector DoGetTxVector() const override;
106
107 /**
108 * Fill in the PHY headers.
109 *
110 * \param txVector the TXVECTOR that was used for this PPDU
111 * \param ppduDuration the transmission duration of this PPDU
112 */
113 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
114
115 /**
116 * Fill in the DSSS header.
117 *
118 * \param dsssSig the DSSS header to fill in
119 * \param txVector the TXVECTOR that was used for this PPDU
120 * \param ppduDuration the transmission duration of this PPDU
121 */
122 void SetDsssHeader(DsssSigHeader& dsssSig,
123 const WifiTxVector& txVector,
124 Time ppduDuration) const;
125
126 /**
127 * Fill in the TXVECTOR from DSSS header.
128 *
129 * \param txVector the TXVECTOR to fill in
130 * \param dsssSig the DSSS header
131 */
132 virtual void SetTxVectorFromDsssHeader(WifiTxVector& txVector,
133 const DsssSigHeader& dsssSig) const;
134
135 DsssSigHeader m_dsssSig; //!< the DSSS SIG PHY header
136}; // class DsssPpdu
137
138} // namespace ns3
139
140#endif /* DSSS_PPDU_H */
DSSS SIG PHY header.
Definition: dsss-ppdu.h:52
uint16_t m_length
LENGTH field.
Definition: dsss-ppdu.h:83
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Definition: dsss-ppdu.cc:155
uint8_t m_rate
RATE field.
Definition: dsss-ppdu.h:82
uint64_t GetRate() const
Return the RATE field of L-SIG (in bit/s).
Definition: dsss-ppdu.cc:130
void SetRate(uint64_t rate)
Fill the RATE field of L-SIG (in bit/s).
Definition: dsss-ppdu.cc:101
uint16_t GetLength() const
Return the LENGTH field of L-SIG (in bytes).
Definition: dsss-ppdu.cc:161
DSSS (HR/DSSS) PPDU (11b)
Definition: dsss-ppdu.h:45
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: dsss-ppdu.cc:81
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: dsss-ppdu.cc:65
DsssSigHeader m_dsssSig
the DSSS SIG PHY header
Definition: dsss-ppdu.h:135
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: dsss-ppdu.cc:89
virtual void SetTxVectorFromDsssHeader(WifiTxVector &txVector, const DsssSigHeader &dsssSig) const
Fill in the TXVECTOR from DSSS header.
Definition: dsss-ppdu.cc:75
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition: dsss-ppdu.cc:48
void SetDsssHeader(DsssSigHeader &dsssSig, const WifiTxVector &txVector, Time ppduDuration) const
Fill in the DSSS header.
Definition: dsss-ppdu.cc:55
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Class that keeps track of all information about the current PHY operating channel.
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:57
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Every class exported by the ns3 library is enclosed in the ns3 namespace.