A Discrete-Event Network Simulator
API
vht-capabilities.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Ghada Badawy <gbadawy@gmail.com>
19  * S├ębastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #ifndef VHT_CAPABILITIES_H
23 #define VHT_CAPABILITIES_H
24 
25 #include <stdint.h>
26 #include "ns3/buffer.h"
27 #include "ns3/attribute-helper.h"
28 #include "ns3/wifi-information-element.h"
29 
30 namespace ns3 {
31 
38 {
39 public:
40  VhtCapabilities ();
41  void SetVhtSupported (uint8_t vhtsupported);
42 
44  uint8_t GetInformationFieldSize () const;
46  uint8_t DeserializeInformationField (Buffer::Iterator start, uint8_t length);
47 
53  void SetVhtCapabilitiesInfo (uint32_t ctrl);
59  void SetSupportedMcsAndNssSet (uint64_t ctrl);
60 
61  /*
62  * Return the VHT Capabilties Info field in the VHT Capabilities information element.
63  *
64  * \return the VHT Capabilties Info field in the VHT Capabilities information element
65  */
66  uint32_t GetVhtCapabilitiesInfo () const;
67  /*
68  * Return the MCS and NSS field in the VHT Capabilities information element.
69  *
70  * \return the MCS and NSS field in the VHT Capabilities information element
71  */
72  uint64_t GetSupportedMcsAndNssSet () const;
73 
74  //Capabilities Info fields
75  void SetMaxMpduLength (uint8_t length);
76  void SetSupportedChannelWidthSet (uint8_t channelwidthset);
77  void SetRxLdpc (uint8_t rxldpc);
78  void SetShortGuardIntervalFor80Mhz (uint8_t shortguardinterval);
79  void SetShortGuardIntervalFor160Mhz (uint8_t shortguardinterval);
80  void SetRxStbc (uint8_t rxstbc);
81  void SetTxStbc (uint8_t txstbc);
82  void SetMaxAmpduLengthExponent (uint8_t exponent);
83 
84  uint8_t GetMaxMpduLength () const;
85  uint8_t GetSupportedChannelWidthSet () const;
86  uint8_t GetRxLdpc () const;
87  uint8_t GetShortGuardIntervalFor80Mhz () const;
88  uint8_t GetShortGuardIntervalFor160Mhz () const;
89  uint8_t GetRxStbc () const;
90  uint8_t GetTxStbc () const;
91  uint8_t GetMaxAmpduLengthExponent () const;
92 
93  // MCS and NSS field information
94  // For each value of NSS ranging from 1 to 8, we need to encode two bits.
95  // The value 0 indicates that the maximum MCS for that spatial stream is 7.
96  // The value 1 indicates that the maximum MCS for that spatial stream is 8.
97  // The value 2 indicates that the maximum MCS for that spatial stream is 9.
98  //
99  // The maps may be set all at once by passing in a 16-bit field corresponding
100  // to the above, or incrementally for each NSS separately, where the
101  // MCS value must be in the range 7-9.
105  void SetRxMcsMap (uint16_t map);
110  void SetRxMcsMap (uint8_t mcs, uint8_t nss);
114  void SetTxMcsMap (uint16_t map);
119  void SetTxMcsMap (uint8_t mcs, uint8_t nss);
120  void SetRxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
121  void SetTxHighestSupportedLgiDataRate (uint16_t supporteddatarate);
122  bool IsSupportedMcs (uint8_t mcs, uint8_t Nss) const;
123 
124  uint16_t GetRxMcsMap () const;
125  uint16_t GetTxMcsMap () const;
126  uint16_t GetRxHighestSupportedLgiDataRate () const;
127  uint16_t GetTxHighestSupportedLgiDataRate () const;
128 
129  bool IsSupportedTxMcs (uint8_t mcs) const;
130  bool IsSupportedRxMcs (uint8_t mcs) const;
131 
132  /*
133  * This information element is a bit special in that it is only
134  * included if the STA is an VHT STA. To support this we
135  * override the Serialize and GetSerializedSize methods of
136  * WifiInformationElement.
137  */
139  uint16_t GetSerializedSize () const;
140 
141 
142 private:
143  //Capabilities Info fields
144  uint16_t m_maxMpduLength;
146  uint8_t m_rxLdpc;
149  uint8_t m_txStbc;
150  uint8_t m_rxStbc;
157  uint8_t m_vhtTxopPs;
163 
164  //MCS and NSS field information
165  std::vector<uint8_t> m_rxMcsMap;
167  std::vector<uint8_t> m_txMcsMap;
169 
170  //This is used to decide if this element should be added to the frame or not
171  uint8_t m_vhtSupported;
172 };
173 
174 std::ostream &operator << (std::ostream &os, const VhtCapabilities &vhtcapabilities);
175 std::istream &operator >> (std::istream &is, VhtCapabilities &vhtcapabilities);
176 
178 
179 } //namespace ns3
180 
181 #endif /* VHT_CAPABILITY_H */
uint8_t m_numberOfSoundingDimensions
uint32_t GetVhtCapabilitiesInfo() const
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:48
void SetShortGuardIntervalFor80Mhz(uint8_t shortguardinterval)
bool IsSupportedTxMcs(uint8_t mcs) const
uint8_t m_shortGuardIntervalFor160Mhz
uint16_t GetTxMcsMap() const
uint16_t GetTxHighestSupportedLgiDataRate() const
uint8_t GetSupportedChannelWidthSet() const
void SetTxMcsMap(uint16_t map)
void SetMaxMpduLength(uint8_t length)
def start()
Definition: core.py:1482
uint16_t m_rxHighestSupportedLongGuardIntervalDataRate
uint8_t GetMaxMpduLength() const
uint8_t GetShortGuardIntervalFor160Mhz() const
void SetVhtSupported(uint8_t vhtsupported)
void SetRxLdpc(uint8_t rxldpc)
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
void SetSupportedMcsAndNssSet(uint64_t ctrl)
Set the MCS and NSS field in the VHT Capabilities information element.
uint8_t GetRxStbc() const
std::vector< uint8_t > m_rxMcsMap
void SetShortGuardIntervalFor160Mhz(uint8_t shortguardinterval)
iterator in a Buffer instance
Definition: buffer.h:98
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
std::vector< uint8_t > m_txMcsMap
The IEEE 802.11ac VHT Capabilities.
uint8_t m_rxAntennaPatternConsistency
void SetTxHighestSupportedLgiDataRate(uint16_t supporteddatarate)
uint16_t GetRxMcsMap() const
void SetSupportedChannelWidthSet(uint8_t channelwidthset)
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
uint8_t m_txAntennaPatternConsistency
uint8_t m_shortGuardIntervalFor80Mhz
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SetRxStbc(uint8_t rxstbc)
uint8_t GetMaxAmpduLengthExponent() const
uint8_t GetShortGuardIntervalFor80Mhz() const
Buffer::Iterator Serialize(Buffer::Iterator start) const
uint16_t m_txHighestSupportedLongGuardIntervalDataRate
void SetRxHighestSupportedLgiDataRate(uint16_t supporteddatarate)
void SetRxMcsMap(uint16_t map)
uint16_t GetSerializedSize() const
uint64_t GetSupportedMcsAndNssSet() const
bool IsSupportedRxMcs(uint8_t mcs) const
bool IsSupportedMcs(uint8_t mcs, uint8_t Nss) const
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
WifiInformationElementId ElementId() const
Own unique Element ID.
uint8_t GetTxStbc() const
uint8_t GetRxLdpc() const
uint16_t m_supportedChannelWidthSet
uint16_t GetRxHighestSupportedLgiDataRate() const
void SerializeInformationField(Buffer::Iterator start) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
void SetTxStbc(uint8_t txstbc)
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type.
void SetVhtCapabilitiesInfo(uint32_t ctrl)
Set the VHT Capabilties Info field in the VHT Capabilities information element.
void SetMaxAmpduLengthExponent(uint8_t exponent)