A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
wifi-phy-common.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005,2006,2007 INRIA
4
* Copyright (c) 2020 Orange Labs
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation;
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
*
19
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Rediet <getachew.redieteab@orange.com>
21
*/
22
23
#ifndef WIFI_PHY_COMMON_H
24
#define WIFI_PHY_COMMON_H
25
26
#include <ostream>
27
#include "ns3/fatal-error.h"
28
40
namespace
ns3
{
41
51
typedef
uint16_t
WifiCodeRate
;
52
const
uint16_t
WIFI_CODE_RATE_UNDEFINED
= 0;
53
const
uint16_t
WIFI_CODE_RATE_1_2
= 1;
54
const
uint16_t
WIFI_CODE_RATE_2_3
= 2;
55
const
uint16_t
WIFI_CODE_RATE_3_4
= 3;
56
const
uint16_t
WIFI_CODE_RATE_5_6
= 4;
57
62
enum
WifiPreamble
63
{
64
WIFI_PREAMBLE_LONG
,
65
WIFI_PREAMBLE_SHORT
,
66
WIFI_PREAMBLE_HT_MF
,
67
WIFI_PREAMBLE_VHT_SU
,
68
WIFI_PREAMBLE_VHT_MU
,
69
WIFI_PREAMBLE_HE_SU
,
70
WIFI_PREAMBLE_HE_ER_SU
,
71
WIFI_PREAMBLE_HE_MU
,
72
WIFI_PREAMBLE_HE_TB
73
};
74
82
inline
std::ostream&
operator<<
(std::ostream &os,
const
WifiPreamble
&preamble)
83
{
84
switch
(preamble)
85
{
86
case
WIFI_PREAMBLE_LONG
:
87
return
(os <<
"LONG"
);
88
case
WIFI_PREAMBLE_SHORT
:
89
return
(os <<
"SHORT"
);
90
case
WIFI_PREAMBLE_HT_MF
:
91
return
(os <<
"HT_MF"
);
92
case
WIFI_PREAMBLE_VHT_SU
:
93
return
(os <<
"VHT_SU"
);
94
case
WIFI_PREAMBLE_VHT_MU
:
95
return
(os <<
"VHT_MU"
);
96
case
WIFI_PREAMBLE_HE_SU
:
97
return
(os <<
"HE_SU"
);
98
case
WIFI_PREAMBLE_HE_ER_SU
:
99
return
(os <<
"HE_ER_SU"
);
100
case
WIFI_PREAMBLE_HE_MU
:
101
return
(os <<
"HE_MU"
);
102
case
WIFI_PREAMBLE_HE_TB
:
103
return
(os <<
"HE_TB"
);
104
default
:
105
NS_FATAL_ERROR
(
"Invalid preamble"
);
106
return
(os <<
"INVALID"
);
107
}
108
}
109
116
enum
WifiModulationClass
117
{
120
WIFI_MOD_CLASS_UNKNOWN
= 0,
121
WIFI_MOD_CLASS_DSSS
,
122
WIFI_MOD_CLASS_HR_DSSS
,
123
WIFI_MOD_CLASS_ERP_OFDM
,
124
WIFI_MOD_CLASS_OFDM
,
125
WIFI_MOD_CLASS_HT
,
126
WIFI_MOD_CLASS_VHT
,
127
WIFI_MOD_CLASS_HE
128
};
129
137
inline
std::ostream&
operator<<
(std::ostream &os,
const
WifiModulationClass
&modulation)
138
{
139
switch
(modulation)
140
{
141
case
WIFI_MOD_CLASS_DSSS
:
142
return
(os <<
"DSSS"
);
143
case
WIFI_MOD_CLASS_HR_DSSS
:
144
return
(os <<
"HR/DSSS"
);
145
case
WIFI_MOD_CLASS_ERP_OFDM
:
146
return
(os <<
"ERP-OFDM"
);
147
case
WIFI_MOD_CLASS_OFDM
:
148
return
(os <<
"OFDM"
);
149
case
WIFI_MOD_CLASS_HT
:
150
return
(os <<
"HT"
);
151
case
WIFI_MOD_CLASS_VHT
:
152
return
(os <<
"VHT"
);
153
case
WIFI_MOD_CLASS_HE
:
154
return
(os <<
"HE"
);
155
default
:
156
NS_FATAL_ERROR
(
"Unknown modulation"
);
157
return
(os <<
"unknown"
);
158
}
159
}
160
165
enum
WifiPpduField
166
{
173
WIFI_PPDU_FIELD_PREAMBLE
= 0,
180
WIFI_PPDU_FIELD_NON_HT_HEADER
,
181
WIFI_PPDU_FIELD_HT_SIG
,
182
WIFI_PPDU_FIELD_TRAINING
,
183
WIFI_PPDU_FIELD_SIG_A
,
184
WIFI_PPDU_FIELD_SIG_B
,
185
WIFI_PPDU_FIELD_DATA
186
};
187
195
inline
std::ostream&
operator<<
(std::ostream &os,
const
WifiPpduField
&field)
196
{
197
switch
(field)
198
{
199
case
WIFI_PPDU_FIELD_PREAMBLE
:
200
return
(os <<
"preamble"
);
201
case
WIFI_PPDU_FIELD_NON_HT_HEADER
:
202
return
(os <<
"non-HT header"
);
203
case
WIFI_PPDU_FIELD_HT_SIG
:
204
return
(os <<
"HT-SIG"
);
205
case
WIFI_PPDU_FIELD_TRAINING
:
206
return
(os <<
"training"
);
207
case
WIFI_PPDU_FIELD_SIG_A
:
208
return
(os <<
"SIG-A"
);
209
case
WIFI_PPDU_FIELD_SIG_B
:
210
return
(os <<
"SIG-B"
);
211
case
WIFI_PPDU_FIELD_DATA
:
212
return
(os <<
"data"
);
213
default
:
214
NS_FATAL_ERROR
(
"Unknown field"
);
215
return
(os <<
"unknown"
);
216
}
217
}
218
223
enum
WifiPpduType
224
{
225
WIFI_PPDU_TYPE_SU
= 0,
226
WIFI_PPDU_TYPE_DL_MU
,
227
WIFI_PPDU_TYPE_UL_MU
228
};
229
237
inline
std::ostream&
operator<<
(std::ostream &os,
const
WifiPpduType
&type)
238
{
239
switch
(type)
240
{
241
case
WIFI_PPDU_TYPE_SU
:
242
return
(os <<
"SU"
);
243
case
WIFI_PPDU_TYPE_DL_MU
:
244
return
(os <<
"DL MU"
);
245
case
WIFI_PPDU_TYPE_UL_MU
:
246
return
(os <<
"UL MU"
);
247
default
:
248
NS_FATAL_ERROR
(
"Unknown type"
);
249
return
(os <<
"unknown"
);
250
}
251
}
252
257
enum
WifiPhyRxfailureReason
258
{
259
UNKNOWN
= 0,
260
UNSUPPORTED_SETTINGS
,
261
CHANNEL_SWITCHING
,
262
RXING
,
263
TXING
,
264
SLEEPING
,
265
BUSY_DECODING_PREAMBLE
,
266
PREAMBLE_DETECT_FAILURE
,
267
RECEPTION_ABORTED_BY_TX
,
268
L_SIG_FAILURE
,
269
HT_SIG_FAILURE
,
270
SIG_A_FAILURE
,
271
SIG_B_FAILURE
,
272
PREAMBLE_DETECTION_PACKET_SWITCH
,
273
FRAME_CAPTURE_PACKET_SWITCH
,
274
OBSS_PD_CCA_RESET
,
275
HE_TB_PPDU_TOO_LATE
,
276
FILTERED
277
};
278
286
inline
std::ostream&
operator<<
(std::ostream &os,
const
WifiPhyRxfailureReason
&reason)
287
{
288
switch
(reason)
289
{
290
case
UNSUPPORTED_SETTINGS
:
291
return
(os <<
"UNSUPPORTED_SETTINGS"
);
292
case
CHANNEL_SWITCHING
:
293
return
(os <<
"CHANNEL_SWITCHING"
);
294
case
RXING
:
295
return
(os <<
"RXING"
);
296
case
TXING
:
297
return
(os <<
"TXING"
);
298
case
SLEEPING
:
299
return
(os <<
"SLEEPING"
);
300
case
BUSY_DECODING_PREAMBLE
:
301
return
(os <<
"BUSY_DECODING_PREAMBLE"
);
302
case
PREAMBLE_DETECT_FAILURE
:
303
return
(os <<
"PREAMBLE_DETECT_FAILURE"
);
304
case
RECEPTION_ABORTED_BY_TX
:
305
return
(os <<
"RECEPTION_ABORTED_BY_TX"
);
306
case
L_SIG_FAILURE
:
307
return
(os <<
"L_SIG_FAILURE"
);
308
case
HT_SIG_FAILURE
:
309
return
(os <<
"HT_SIG_FAILURE"
);
310
case
SIG_A_FAILURE
:
311
return
(os <<
"SIG_A_FAILURE"
);
312
case
SIG_B_FAILURE
:
313
return
(os <<
"SIG_B_FAILURE"
);
314
case
PREAMBLE_DETECTION_PACKET_SWITCH
:
315
return
(os <<
"PREAMBLE_DETECTION_PACKET_SWITCH"
);
316
case
FRAME_CAPTURE_PACKET_SWITCH
:
317
return
(os <<
"FRAME_CAPTURE_PACKET_SWITCH"
);
318
case
OBSS_PD_CCA_RESET
:
319
return
(os <<
"OBSS_PD_CCA_RESET"
);
320
case
HE_TB_PPDU_TOO_LATE
:
321
return
(os <<
"HE_TB_PPDU_TOO_LATE"
);
322
case
FILTERED
:
323
return
(os <<
"FILTERED"
);
324
case
UNKNOWN
:
325
default
:
326
NS_FATAL_ERROR
(
"Unknown reason"
);
327
return
(os <<
"UNKNOWN"
);
328
}
329
}
330
331
}
//namespace ns3
332
333
#endif
/* WIFI_PHY_COMMON_H */
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition:
fatal-error.h:165
ns3::WifiPhyRxfailureReason
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
Definition:
wifi-phy-common.h:258
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition:
wifi-phy-common.h:63
ns3::WifiPpduType
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
Definition:
wifi-phy-common.h:224
ns3::WifiModulationClass
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Definition:
wifi-phy-common.h:117
ns3::WifiPpduField
WifiPpduField
The type of PPDU field (grouped for convenience)
Definition:
wifi-phy-common.h:166
ns3::OBSS_PD_CCA_RESET
@ OBSS_PD_CCA_RESET
Definition:
wifi-phy-common.h:274
ns3::PREAMBLE_DETECT_FAILURE
@ PREAMBLE_DETECT_FAILURE
Definition:
wifi-phy-common.h:266
ns3::HE_TB_PPDU_TOO_LATE
@ HE_TB_PPDU_TOO_LATE
Definition:
wifi-phy-common.h:275
ns3::FRAME_CAPTURE_PACKET_SWITCH
@ FRAME_CAPTURE_PACKET_SWITCH
Definition:
wifi-phy-common.h:273
ns3::UNSUPPORTED_SETTINGS
@ UNSUPPORTED_SETTINGS
Definition:
wifi-phy-common.h:260
ns3::L_SIG_FAILURE
@ L_SIG_FAILURE
Definition:
wifi-phy-common.h:268
ns3::RECEPTION_ABORTED_BY_TX
@ RECEPTION_ABORTED_BY_TX
Definition:
wifi-phy-common.h:267
ns3::SIG_A_FAILURE
@ SIG_A_FAILURE
Definition:
wifi-phy-common.h:270
ns3::CHANNEL_SWITCHING
@ CHANNEL_SWITCHING
Definition:
wifi-phy-common.h:261
ns3::UNKNOWN
@ UNKNOWN
Definition:
wifi-phy-common.h:259
ns3::SLEEPING
@ SLEEPING
Definition:
wifi-phy-common.h:264
ns3::BUSY_DECODING_PREAMBLE
@ BUSY_DECODING_PREAMBLE
Definition:
wifi-phy-common.h:265
ns3::SIG_B_FAILURE
@ SIG_B_FAILURE
Definition:
wifi-phy-common.h:271
ns3::HT_SIG_FAILURE
@ HT_SIG_FAILURE
Definition:
wifi-phy-common.h:269
ns3::RXING
@ RXING
Definition:
wifi-phy-common.h:262
ns3::FILTERED
@ FILTERED
Definition:
wifi-phy-common.h:276
ns3::PREAMBLE_DETECTION_PACKET_SWITCH
@ PREAMBLE_DETECTION_PACKET_SWITCH
Definition:
wifi-phy-common.h:272
ns3::TXING
@ TXING
Definition:
wifi-phy-common.h:263
ns3::WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_LONG
Definition:
wifi-phy-common.h:64
ns3::WIFI_PREAMBLE_HE_ER_SU
@ WIFI_PREAMBLE_HE_ER_SU
Definition:
wifi-phy-common.h:70
ns3::WIFI_PREAMBLE_HE_TB
@ WIFI_PREAMBLE_HE_TB
Definition:
wifi-phy-common.h:72
ns3::WIFI_PREAMBLE_HE_MU
@ WIFI_PREAMBLE_HE_MU
Definition:
wifi-phy-common.h:71
ns3::WIFI_PREAMBLE_HE_SU
@ WIFI_PREAMBLE_HE_SU
Definition:
wifi-phy-common.h:69
ns3::WIFI_PREAMBLE_VHT_MU
@ WIFI_PREAMBLE_VHT_MU
Definition:
wifi-phy-common.h:68
ns3::WIFI_PREAMBLE_VHT_SU
@ WIFI_PREAMBLE_VHT_SU
Definition:
wifi-phy-common.h:67
ns3::WIFI_PREAMBLE_SHORT
@ WIFI_PREAMBLE_SHORT
Definition:
wifi-phy-common.h:65
ns3::WIFI_PREAMBLE_HT_MF
@ WIFI_PREAMBLE_HT_MF
Definition:
wifi-phy-common.h:66
ns3::WIFI_PPDU_TYPE_DL_MU
@ WIFI_PPDU_TYPE_DL_MU
Definition:
wifi-phy-common.h:226
ns3::WIFI_PPDU_TYPE_UL_MU
@ WIFI_PPDU_TYPE_UL_MU
Definition:
wifi-phy-common.h:227
ns3::WIFI_PPDU_TYPE_SU
@ WIFI_PPDU_TYPE_SU
Definition:
wifi-phy-common.h:225
ns3::WIFI_MOD_CLASS_OFDM
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
Definition:
wifi-phy-common.h:124
ns3::WIFI_MOD_CLASS_HR_DSSS
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
Definition:
wifi-phy-common.h:122
ns3::WIFI_MOD_CLASS_UNKNOWN
@ WIFI_MOD_CLASS_UNKNOWN
Modulation class unknown or unspecified.
Definition:
wifi-phy-common.h:120
ns3::WIFI_MOD_CLASS_HT
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Definition:
wifi-phy-common.h:125
ns3::WIFI_MOD_CLASS_VHT
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
Definition:
wifi-phy-common.h:126
ns3::WIFI_MOD_CLASS_HE
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Definition:
wifi-phy-common.h:127
ns3::WIFI_MOD_CLASS_DSSS
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
Definition:
wifi-phy-common.h:121
ns3::WIFI_MOD_CLASS_ERP_OFDM
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Definition:
wifi-phy-common.h:123
ns3::WIFI_PPDU_FIELD_SIG_B
@ WIFI_PPDU_FIELD_SIG_B
SIG-B field.
Definition:
wifi-phy-common.h:184
ns3::WIFI_PPDU_FIELD_TRAINING
@ WIFI_PPDU_FIELD_TRAINING
STF + LTF fields (excluding those in preamble for HT-GF)
Definition:
wifi-phy-common.h:182
ns3::WIFI_PPDU_FIELD_NON_HT_HEADER
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
Definition:
wifi-phy-common.h:180
ns3::WIFI_PPDU_FIELD_HT_SIG
@ WIFI_PPDU_FIELD_HT_SIG
HT-SIG field.
Definition:
wifi-phy-common.h:181
ns3::WIFI_PPDU_FIELD_PREAMBLE
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
Definition:
wifi-phy-common.h:173
ns3::WIFI_PPDU_FIELD_DATA
@ WIFI_PPDU_FIELD_DATA
data field
Definition:
wifi-phy-common.h:185
ns3::WIFI_PPDU_FIELD_SIG_A
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
Definition:
wifi-phy-common.h:183
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WIFI_CODE_RATE_UNDEFINED
const uint16_t WIFI_CODE_RATE_UNDEFINED
undefined coding rate
Definition:
wifi-phy-common.h:52
ns3::WIFI_CODE_RATE_3_4
const uint16_t WIFI_CODE_RATE_3_4
3/4 coding rate
Definition:
wifi-phy-common.h:55
ns3::WIFI_CODE_RATE_1_2
const uint16_t WIFI_CODE_RATE_1_2
1/2 coding rate
Definition:
wifi-phy-common.h:53
ns3::WIFI_CODE_RATE_2_3
const uint16_t WIFI_CODE_RATE_2_3
2/3 coding rate
Definition:
wifi-phy-common.h:54
ns3::WifiCodeRate
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
Definition:
wifi-phy-common.h:51
ns3::WIFI_CODE_RATE_5_6
const uint16_t WIFI_CODE_RATE_5_6
5/6 coding rate
Definition:
wifi-phy-common.h:56
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:137
src
wifi
model
wifi-phy-common.h
Generated on Mon Sep 27 2021 10:49:55 for ns-3 by
1.9.1