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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Rediet <getachew.redieteab@orange.com>
7 * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
8 * Sébastien Deronne <sebastien.deronne@gmail.com> (DsssSigHeader)
9 */
10
11#ifndef DSSS_PPDU_H
12#define DSSS_PPDU_H
13
14#include "ns3/wifi-ppdu.h"
15
16/**
17 * @file
18 * @ingroup wifi
19 * Declaration of ns3::DsssPpdu class.
20 */
21
22namespace ns3
23{
24
25class WifiPsdu;
26
27/**
28 * @brief DSSS (HR/DSSS) PPDU (11b)
29 * @ingroup wifi
30 *
31 * DsssPpdu stores a preamble, PHY headers and a PSDU of a PPDU with DSSS modulation.
32 */
33class DsssPpdu : public WifiPpdu
34{
35 public:
36 /**
37 * DSSS SIG PHY header.
38 * See section 16.2.2 in IEEE 802.11-2016.
39 */
41 {
42 public:
44
45 /**
46 * Fill the RATE field of L-SIG (in bit/s).
47 *
48 * @param rate the RATE field of L-SIG expressed in bit/s
49 */
50 void SetRate(uint64_t rate);
51 /**
52 * Return the RATE field of L-SIG (in bit/s).
53 *
54 * @return the RATE field of L-SIG expressed in bit/s
55 */
56 uint64_t GetRate() const;
57 /**
58 * Fill the LENGTH field of L-SIG (in bytes).
59 *
60 * @param length the LENGTH field of L-SIG expressed in bytes
61 */
62 void SetLength(uint16_t length);
63 /**
64 * Return the LENGTH field of L-SIG (in bytes).
65 *
66 * @return the LENGTH field of L-SIG expressed in bytes
67 */
68 uint16_t GetLength() const;
69
70 private:
71 uint8_t m_rate; ///< RATE field
72 uint16_t m_length; ///< LENGTH field
73 }; // class DsssSigHeader
74
75 /**
76 * Create a DSSS (HR/DSSS) PPDU.
77 *
78 * @param psdu the PHY payload (PSDU)
79 * @param txVector the TXVECTOR that was used for this PPDU
80 * @param channel the operating channel of the PHY used to transmit this PPDU
81 * @param ppduDuration the transmission duration of this PPDU
82 * @param uid the unique ID of this PPDU
83 */
85 const WifiTxVector& txVector,
86 const WifiPhyOperatingChannel& channel,
88 uint64_t uid);
89
90 Time GetTxDuration() const override;
91 Ptr<WifiPpdu> Copy() const override;
92
93 private:
94 WifiTxVector DoGetTxVector() const override;
95
96 /**
97 * Fill in the PHY headers.
98 *
99 * @param txVector the TXVECTOR that was used for this PPDU
100 * @param ppduDuration the transmission duration of this PPDU
101 */
102 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
103
104 /**
105 * Fill in the DSSS header.
106 *
107 * @param dsssSig the DSSS header to fill in
108 * @param txVector the TXVECTOR that was used for this PPDU
109 * @param ppduDuration the transmission duration of this PPDU
110 */
112 const WifiTxVector& txVector,
113 Time ppduDuration) const;
114
115 /**
116 * Fill in the TXVECTOR from DSSS header.
117 *
118 * @param txVector the TXVECTOR to fill in
119 * @param dsssSig the DSSS header
120 */
121 virtual void SetTxVectorFromDsssHeader(WifiTxVector& txVector,
122 const DsssSigHeader& dsssSig) const;
123
124 DsssSigHeader m_dsssSig; //!< the DSSS SIG PHY header
125}; // class DsssPpdu
126
127} // namespace ns3
128
129#endif /* DSSS_PPDU_H */
DSSS SIG PHY header.
Definition dsss-ppdu.h:41
uint16_t m_length
LENGTH field.
Definition dsss-ppdu.h:72
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Definition dsss-ppdu.cc:144
uint8_t m_rate
RATE field.
Definition dsss-ppdu.h:71
uint64_t GetRate() const
Return the RATE field of L-SIG (in bit/s).
Definition dsss-ppdu.cc:119
void SetRate(uint64_t rate)
Fill the RATE field of L-SIG (in bit/s).
Definition dsss-ppdu.cc:90
uint16_t GetLength() const
Return the LENGTH field of L-SIG (in bytes).
Definition dsss-ppdu.cc:150
DSSS (HR/DSSS) PPDU (11b)
Definition dsss-ppdu.h:34
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition dsss-ppdu.cc:70
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition dsss-ppdu.cc:54
DsssSigHeader m_dsssSig
the DSSS SIG PHY header
Definition dsss-ppdu.h:124
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition dsss-ppdu.cc:78
virtual void SetTxVectorFromDsssHeader(WifiTxVector &txVector, const DsssSigHeader &dsssSig) const
Fill in the TXVECTOR from DSSS header.
Definition dsss-ppdu.cc:64
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition dsss-ppdu.cc:37
void SetDsssHeader(DsssSigHeader &dsssSig, const WifiTxVector &txVector, Time ppduDuration) const
Fill in the DSSS header.
Definition dsss-ppdu.cc:44
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
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:47
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.