A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-operation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Sébastien Deronne
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 * Authors: Sébastien Deronne <sebastien.deronne@gmail.com>
18 * Stefano Avallone <stavallo@unina.it>
19 */
20
21#ifndef HE_OPERATION_H
22#define HE_OPERATION_H
23
24#include "ns3/wifi-information-element.h"
25#include "ns3/wifi-opt-field.h"
26
27namespace ns3
28{
29
30/**
31 * \brief The HE Operation Information Element
32 * \ingroup wifi
33 *
34 * This class knows how to serialise and deserialise
35 * the HE Operation Information Element
36 */
38{
39 public:
41
42 // Implementations of pure virtual methods of WifiInformationElement
43 WifiInformationElementId ElementId() const override;
45 void Print(std::ostream& os) const override;
46
47 /// HE Operation Parameters field
49 {
50 uint8_t m_defaultPeDuration : 3 {0}; ///< Default PE Duration
51 uint8_t m_twtRequired : 1 {0}; ///< TWT Required
52 uint16_t m_txopDurRtsThresh : 10 {0}; ///< TXOP Duration RTS Threshold
53 uint8_t m_vhOpPresent : 1 {0}; ///< VHT Operation Information Present (value 1 unsupported)
54 uint8_t m_coHostedBss : 1 {0}; ///< Co-Hosted BSS (value 1 unsupported)
55 uint8_t m_erSuDisable : 1 {0}; ///< ER SU Disable
56 bool m_6GHzOpPresent{false}; ///< 6 GHz Operation Information Present (do not set, it is
57 ///< set by the OptFieldWithPresenceInd)
58
59 /**
60 * Print the content of the HE Operation Parameters field.
61 *
62 * \param os output stream
63 */
64 void Print(std::ostream& os) const;
65
66 /**
67 * \return the serialized size of the HE Operation Parameters field
68 */
69 uint16_t GetSerializedSize() const;
70
71 /**
72 * Serialize the HE Operation Parameters field
73 *
74 * \param start an iterator which points to where the information should be written
75 */
76 void Serialize(Buffer::Iterator& start) const;
77
78 /**
79 * Deserialize the HE Operation Parameters field.
80 *
81 * \param start an iterator which points to where the information should be read from
82 * \return the number of bytes read
83 */
84 uint16_t Deserialize(Buffer::Iterator& start);
85 };
86
87 /// BSS Color Information field
89 {
90 uint8_t m_bssColor : 6 {0}; ///< BSS Color
91 uint8_t m_partialBssColor : 1 {0}; ///< Partial BSS Color
92 uint8_t m_bssColorDisabled : 1 {0}; ///< BSS Color Disabled
93
94 /**
95 * Print the content of the BSS Color Information field.
96 *
97 * \param os output stream
98 */
99 void Print(std::ostream& os) const;
100
101 /**
102 * \return the serialized size of the BSS Color Information field
103 */
104 uint16_t GetSerializedSize() const;
105
106 /**
107 * Serialize the BSS Color Information field
108 *
109 * \param start an iterator which points to where the information should be written
110 */
111 void Serialize(Buffer::Iterator& start) const;
112
113 /**
114 * Deserialize the BSS Color Information field.
115 *
116 * \param start an iterator which points to where the information should be read from
117 * \return the number of bytes read
118 */
119 uint16_t Deserialize(Buffer::Iterator& start);
120 };
121
122 /// 6 GHz Operation Information field
124 {
125 uint8_t m_primCh{0}; ///< Primary Channel
126 uint8_t m_chWid : 2 {0}; ///< Channel Width
127 uint8_t m_dupBeacon : 1 {0}; ///< Duplicate Beacon
128 uint8_t m_regInfo : 3 {0}; ///< Regulatory Info
129 uint8_t : 2; ///< Reserved bits
130 uint8_t m_chCntrFreqSeg0{0}; ///< Channel center frequency segment 0
131 uint8_t m_chCntrFreqSeg1{0}; ///< Channel center frequency segment 1
132 uint8_t m_minRate{0}; ///< Minimum Rate
133
134 /**
135 * Print the content of the 6 GHz Operation Information field.
136 *
137 * \param os output stream
138 */
139 void Print(std::ostream& os) const;
140
141 /**
142 * \return the serialized size of the 6 GHz Operation Information field
143 */
144 uint16_t GetSerializedSize() const;
145
146 /**
147 * Serialize the 6 GHz Operation Information field
148 *
149 * \param start an iterator which points to where the information should be written
150 */
151 void Serialize(Buffer::Iterator& start) const;
152
153 /**
154 * Deserialize the 6 GHz Operation Information field.
155 *
156 * \param start an iterator which points to where the information should be read from
157 * \return the number of bytes read
158 */
159 uint16_t Deserialize(Buffer::Iterator& start);
160 };
161
162 /**
163 * Set the Basic HE-MCS and NSS field in the HE Operation information element
164 * by specifying the pair (<i>nss</i>, <i>maxMcs</i>).
165 *
166 * \param nss the NSS
167 * \param maxHeMcs the maximum supported HE-MCS value corresponding to that NSS
168 */
169 void SetMaxHeMcsPerNss(uint8_t nss, uint8_t maxHeMcs);
170
171 // Fields
172 HeOperationParams m_heOpParams; //!< HE Operation Parameters field
173 BssColorInfo m_bssColorInfo; //!< BSS Color Information field
174 uint16_t m_basicHeMcsAndNssSet; ///< Basic HE-MCS And NSS set (use setter to set value)
175 OptFieldWithPresenceInd<OpInfo6GHz> m_6GHzOpInfo; ///< 6 GHz Operation Information field
176
177 private:
178 uint16_t GetInformationFieldSize() const override;
179 void SerializeInformationField(Buffer::Iterator start) const override;
180 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
181};
182
183} // namespace ns3
184
185#endif /* HE_OPERATION_H */
iterator in a Buffer instance
Definition: buffer.h:100
The HE Operation Information Element.
Definition: he-operation.h:38
OptFieldWithPresenceInd< OpInfo6GHz > m_6GHzOpInfo
6 GHz Operation Information field
Definition: he-operation.h:175
void Print(std::ostream &os) const override
Generate human-readable form of IE.
void SetMaxHeMcsPerNss(uint8_t nss, uint8_t maxHeMcs)
Set the Basic HE-MCS and NSS field in the HE Operation information element by specifying the pair (ns...
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
Definition: he-operation.cc:39
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
uint16_t m_basicHeMcsAndNssSet
Basic HE-MCS And NSS set (use setter to set value)
Definition: he-operation.h:174
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
Definition: he-operation.cc:33
HeOperationParams m_heOpParams
HE Operation Parameters field.
Definition: he-operation.h:172
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
BssColorInfo m_bssColorInfo
BSS Color Information field.
Definition: he-operation.h:173
OptFieldWithPresenceInd is a class modeling an optional field (in an Information Element,...
Information element, as defined in 802.11-2007 standard.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
BSS Color Information field.
Definition: he-operation.h:89
void Serialize(Buffer::Iterator &start) const
Serialize the BSS Color Information field.
uint8_t m_bssColorDisabled
BSS Color Disabled.
Definition: he-operation.h:92
void Print(std::ostream &os) const
Print the content of the BSS Color Information field.
Definition: he-operation.cc:87
uint8_t m_bssColor
BSS Color.
Definition: he-operation.h:90
uint16_t Deserialize(Buffer::Iterator &start)
Deserialize the BSS Color Information field.
uint16_t GetSerializedSize() const
Definition: he-operation.cc:94
uint8_t m_partialBssColor
Partial BSS Color.
Definition: he-operation.h:91
HE Operation Parameters field.
Definition: he-operation.h:49
uint8_t m_erSuDisable
ER SU Disable.
Definition: he-operation.h:55
void Print(std::ostream &os) const
Print the content of the HE Operation Parameters field.
Definition: he-operation.cc:45
void Serialize(Buffer::Iterator &start) const
Serialize the HE Operation Parameters field.
Definition: he-operation.cc:61
uint8_t m_vhOpPresent
VHT Operation Information Present (value 1 unsupported)
Definition: he-operation.h:53
bool m_6GHzOpPresent
6 GHz Operation Information Present (do not set, it is set by the OptFieldWithPresenceInd)
Definition: he-operation.h:56
uint8_t m_coHostedBss
Co-Hosted BSS (value 1 unsupported)
Definition: he-operation.h:54
uint16_t Deserialize(Buffer::Iterator &start)
Deserialize the HE Operation Parameters field.
Definition: he-operation.cc:71
uint8_t m_defaultPeDuration
Default PE Duration.
Definition: he-operation.h:50
uint8_t m_twtRequired
TWT Required.
Definition: he-operation.h:51
uint16_t m_txopDurRtsThresh
TXOP Duration RTS Threshold.
Definition: he-operation.h:52
6 GHz Operation Information field
Definition: he-operation.h:124
uint8_t m_chCntrFreqSeg0
Channel center frequency segment 0.
Definition: he-operation.h:130
void Print(std::ostream &os) const
Print the content of the 6 GHz Operation Information field.
uint8_t m_chWid
Channel Width.
Definition: he-operation.h:126
uint16_t GetSerializedSize() const
uint8_t m_chCntrFreqSeg1
Channel center frequency segment 1.
Definition: he-operation.h:131
uint8_t m_minRate
Minimum Rate.
Definition: he-operation.h:132
uint16_t Deserialize(Buffer::Iterator &start)
Deserialize the 6 GHz Operation Information field.
uint8_t m_regInfo
Regulatory Info.
Definition: he-operation.h:128
uint8_t m_dupBeacon
Duplicate Beacon.
Definition: he-operation.h:127
void Serialize(Buffer::Iterator &start) const
Serialize the 6 GHz Operation Information field.
uint8_t m_primCh
Primary Channel.
Definition: he-operation.h:125