A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
error-rate-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2005,2006 INRIA
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18
*/
19
20
#ifndef ERROR_RATE_MODEL_H
21
#define ERROR_RATE_MODEL_H
22
23
#include "
wifi-mode.h
"
24
25
#include "ns3/object.h"
26
27
namespace
ns3
28
{
29
30
/**
31
* \ingroup wifi
32
* \brief the interface for Wifi's error models
33
*
34
*/
35
class
ErrorRateModel
:
public
Object
36
{
37
public
:
38
/**
39
* \brief Get the type ID.
40
* \return the object TypeId
41
*/
42
static
TypeId
GetTypeId
();
43
44
/**
45
* \param txVector a specific transmission vector including WifiMode
46
* \param ber a target BER
47
*
48
* \return the SNR which corresponds to the requested BER
49
*/
50
double
CalculateSnr
(
const
WifiTxVector
& txVector,
double
ber)
const
;
51
52
/**
53
* \return true if the model is for AWGN channels,
54
* false otherwise
55
*/
56
virtual
bool
IsAwgn
()
const
;
57
58
/**
59
* This method returns the probability that the given 'chunk' of the
60
* packet will be successfully received by the PHY.
61
*
62
* A chunk can be viewed as a part of a packet with equal SNR.
63
* The probability of successfully receiving the chunk depends on
64
* the mode, the SNR, and the size of the chunk.
65
*
66
* Note that both a WifiMode and a WifiTxVector (which contains a WifiMode)
67
* are passed into this method. The WifiTxVector may be from a signal that
68
* contains multiple modes (e.g. PHY header sent differently from PHY
69
* payload). Consequently, the mode parameter is what the method uses
70
* to calculate the chunk error rate, and the txVector is used for
71
* other information as needed.
72
*
73
* This method handles 802.11b rates by using the DSSS error rate model.
74
* For all other rates, the method implemented by the subclass is called.
75
*
76
* \param mode the Wi-Fi mode applicable to this chunk
77
* \param txVector TXVECTOR of the overall transmission
78
* \param snr the SNR of the chunk
79
* \param nbits the number of bits in this chunk
80
* \param numRxAntennas the number of active RX antennas (1 if not provided)
81
* \param field the PPDU field to which the chunk belongs to (assumes this is for the payload
82
* part if not provided)
83
* \param staId the station ID for MU
84
*
85
* \return probability of successfully receiving the chunk
86
*/
87
double
GetChunkSuccessRate
(
WifiMode
mode,
88
const
WifiTxVector
& txVector,
89
double
snr,
90
uint64_t nbits,
91
uint8_t numRxAntennas = 1,
92
WifiPpduField
field =
WIFI_PPDU_FIELD_DATA
,
93
uint16_t staId =
SU_STA_ID
)
const
;
94
95
/**
96
* Assign a fixed random variable stream number to the random variables
97
* used by this model. Return the number of streams (possibly zero) that
98
* have been assigned.
99
*
100
* \param stream first stream index to use
101
* \return the number of stream indices assigned by this model
102
*/
103
virtual
int64_t
AssignStreams
(int64_t stream);
104
105
private
:
106
/**
107
* A pure virtual method that must be implemented in the subclass.
108
*
109
* \param mode the Wi-Fi mode applicable to this chunk
110
* \param txVector TXVECTOR of the overall transmission
111
* \param snr the SNR of the chunk
112
* \param nbits the number of bits in this chunk
113
* \param numRxAntennas the number of active RX antennas
114
* \param field the PPDU field to which the chunk belongs to
115
* \param staId the station ID for MU
116
*
117
* \return probability of successfully receiving the chunk
118
*/
119
virtual
double
DoGetChunkSuccessRate
(
WifiMode
mode,
120
const
WifiTxVector
& txVector,
121
double
snr,
122
uint64_t nbits,
123
uint8_t numRxAntennas,
124
WifiPpduField
field,
125
uint16_t staId)
const
= 0;
126
};
127
128
}
// namespace ns3
129
130
#endif
/* ERROR_RATE_MODEL_H */
ns3::ErrorRateModel
the interface for Wifi's error models
Definition:
error-rate-model.h:36
ns3::ErrorRateModel::IsAwgn
virtual bool IsAwgn() const
Definition:
error-rate-model.cc:98
ns3::ErrorRateModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
error-rate-model.cc:32
ns3::ErrorRateModel::GetChunkSuccessRate
double GetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas=1, WifiPpduField field=WIFI_PPDU_FIELD_DATA, uint16_t staId=SU_STA_ID) const
This method returns the probability that the given 'chunk' of the packet will be successfully receive...
Definition:
error-rate-model.cc:65
ns3::ErrorRateModel::DoGetChunkSuccessRate
virtual double DoGetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas, WifiPpduField field, uint16_t staId) const =0
A pure virtual method that must be implemented in the subclass.
ns3::ErrorRateModel::AssignStreams
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
error-rate-model.cc:104
ns3::ErrorRateModel::CalculateSnr
double CalculateSnr(const WifiTxVector &txVector, double ber) const
Definition:
error-rate-model.cc:39
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::WifiMode
represent a single transmission mode
Definition:
wifi-mode.h:51
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition:
wifi-tx-vector.h:111
ns3::WifiPpduField
WifiPpduField
The type of PPDU field (grouped for convenience)
Definition:
wifi-phy-common.h:307
ns3::WIFI_PPDU_FIELD_DATA
@ WIFI_PPDU_FIELD_DATA
data field
Definition:
wifi-phy-common.h:328
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SU_STA_ID
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition:
wifi-mode.h:35
wifi-mode.h
src
wifi
model
error-rate-model.h
Generated on Tue May 28 2024 23:40:11 for ns-3 by
1.9.6