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