A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mu-edca-parameter-set.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef MU_EDCA_PARAMETER_SET_H
10#define MU_EDCA_PARAMETER_SET_H
11
12#include "ns3/nstime.h"
13#include "ns3/wifi-information-element.h"
14
15#include <array>
16
17namespace ns3
18{
19
20/**
21 * \brief The MU EDCA Parameter Set
22 * \ingroup wifi
23 *
24 * The 802.11ax MU EDCA Parameter Set.
25 */
27{
28 public:
30
31 WifiInformationElementId ElementId() const override;
33
34 /**
35 * Set the QoS Info field in the MuEdcaParameterSet information element.
36 *
37 * \param qosInfo the QoS Info field in the MuEdcaParameterSet information element
38 */
39 void SetQosInfo(uint8_t qosInfo);
40 /**
41 * Set the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record
42 * field corresponding to the given AC Index (<i>aci</i>). Note that <i>aifsn</i>
43 * can either be zero (EDCA disabled) or in the range from 2 to 15.
44 *
45 * \param aci the AC Index
46 * \param aifsn the value for the AIFSN subfield
47 */
48 void SetMuAifsn(uint8_t aci, uint8_t aifsn);
49 /**
50 * Set the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter Record
51 * field corresponding to the given AC Index (<i>aci</i>). Note that <i>cwMin</i>
52 * must be a power of 2 minus 1 in the range from 0 to 32767.
53 *
54 * \param aci the AC Index
55 * \param cwMin the CWmin value encoded by the ECWmin field
56 */
57 void SetMuCwMin(uint8_t aci, uint16_t cwMin);
58 /**
59 * Set the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter Record
60 * field corresponding to the given AC Index (<i>aci</i>). Note that <i>cwMax</i>
61 * must be a power of 2 minus 1 in the range from 0 to 32767.
62 *
63 * \param aci the AC Index
64 * \param cwMax the CWmax value encoded by the ECWmax field
65 */
66 void SetMuCwMax(uint8_t aci, uint16_t cwMax);
67 /**
68 * Set the MU EDCA Timer field in the MU AC Parameter Record field corresponding
69 * to the given AC Index (<i>aci</i>). Note that <i>timer</i> must be an integer
70 * multiple of 8 TUs (i.e., 8 * 1024 = 8192 microseconds) in the range from
71 * 8.192 milliseconds to 2088.96 milliseconds. A value of 0 is used to indicate
72 * that the MU EDCA Parameter Set element must not be sent and therefore it is
73 * only allowed if the MU EDCA Timer is set to 0 for all ACs.
74 *
75 * \param aci the AC Index
76 * \param timer the value for the timer encoded by the MU EDCA Timer field
77 */
78 void SetMuEdcaTimer(uint8_t aci, Time timer);
79
80 /**
81 * Return the QoS Info field in the MuEdcaParameterSet information element.
82 *
83 * \return the QoS Info field in the MuEdcaParameterSet information element
84 */
85 uint8_t GetQosInfo() const;
86 /**
87 * Get the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record
88 * field corresponding to the given AC Index (<i>aci</i>).
89 *
90 * \param aci the AC Index
91 * \return the value of the AIFSN subfield
92 */
93 uint8_t GetMuAifsn(uint8_t aci) const;
94 /**
95 * Get the CWmin value encoded by the ECWmin subfield of the ECWmin/ECWmax field
96 * in the MU AC Parameter Record field corresponding to the given AC Index (<i>aci</i>).
97 *
98 * \param aci the AC Index
99 * \return the CWmin value
100 */
101 uint16_t GetMuCwMin(uint8_t aci) const;
102 /**
103 * Get the CWmax value encoded by the ECWmax subfield of the ECWmin/ECWmax field
104 * in the MU AC Parameter Record field corresponding to the given AC Index (<i>aci</i>).
105 *
106 * \param aci the AC Index
107 * \return the CWmax value
108 */
109 uint16_t GetMuCwMax(uint8_t aci) const;
110 /**
111 * Get the MU EDCA Timer value encoded in the MU AC Parameter Record field corresponding
112 * to the given AC Index (<i>aci</i>).
113 *
114 * \param aci the AC Index
115 * \return the MU EDCA Timer value
116 */
117 Time GetMuEdcaTimer(uint8_t aci) const;
118
119 private:
120 uint16_t GetInformationFieldSize() const override;
121 void SerializeInformationField(Buffer::Iterator start) const override;
122 uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
123
124 /**
125 * MU AC Parameter Record type
126 */
128 {
129 uint8_t aifsnField; ///< the ACI/AIFSN field
130 uint8_t cwMinMax; ///< the ECWmin/ECWmax field
131 uint8_t muEdcaTimer; ///< the MU EDCA Timer field
132 };
133
134 uint8_t m_qosInfo; ///< QoS info field
135 std::array<ParameterRecord, 4> m_records; ///< MU AC Parameter Record fields
136};
137
138} // namespace ns3
139
140#endif /* MU_EDCA_PARAMETER_SET_H */
iterator in a Buffer instance
Definition buffer.h:89
The MU EDCA Parameter Set.
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 GetMuCwMin(uint8_t aci) const
Get the CWmin value encoded by the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
void SetMuCwMin(uint8_t aci, uint16_t cwMin)
Set the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
void SetMuEdcaTimer(uint8_t aci, Time timer)
Set the MU EDCA Timer field in the MU AC Parameter Record field corresponding to the given AC Index (...
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetMuAifsn(uint8_t aci, uint8_t aifsn)
Set the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the MuEdcaParameterSet information element.
uint8_t GetMuAifsn(uint8_t aci) const
Get the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
uint16_t GetMuCwMax(uint8_t aci) const
Get the CWmax value encoded by the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter ...
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t GetQosInfo() const
Return the QoS Info field in the MuEdcaParameterSet information element.
std::array< ParameterRecord, 4 > m_records
MU AC Parameter Record fields.
Time GetMuEdcaTimer(uint8_t aci) const
Get the MU EDCA Timer value encoded in the MU AC Parameter Record field corresponding to the given AC...
uint8_t m_qosInfo
QoS info field.
void SetMuCwMax(uint8_t aci, uint16_t cwMax)
Set the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
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.