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
table-based-error-rate-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 University of Washington
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Rohan Patidar <rpatidar@uw.edu>
7
* Sébastien Deronne <sebastien.deronne@gmail.com>
8
*/
9
10
#ifndef TABLE_BASED_ERROR_RATE_MODEL_H
11
#define TABLE_BASED_ERROR_RATE_MODEL_H
12
13
#include "
error-rate-model.h
"
14
#include "
wifi-mode.h
"
15
16
#include "ns3/error-rate-tables.h"
17
18
#include <optional>
19
20
namespace
ns3
21
{
22
23
class
WifiTxVector;
24
25
/*
26
* @ingroup wifi
27
* @brief the interface for the table-driven OFDM error model
28
*
29
*/
30
class
TableBasedErrorRateModel
:
public
ErrorRateModel
31
{
32
public
:
33
/**
34
* @brief Get the type ID.
35
* @return the object TypeId
36
*/
37
static
TypeId
GetTypeId
();
38
39
TableBasedErrorRateModel
();
40
~TableBasedErrorRateModel
()
override
;
41
42
/**
43
* @brief Utility function to convert WifiMode to an MCS value
44
* @param mode the WifiMode
45
* @return the equivalent MCS value, if found
46
*/
47
static
std::optional<uint8_t>
GetMcsForMode
(
WifiMode
mode);
48
49
private
:
50
double
DoGetChunkSuccessRate
(
WifiMode
mode,
51
const
WifiTxVector
& txVector,
52
double
snr,
53
uint64_t nbits,
54
uint8_t numRxAntennas,
55
WifiPpduField
field,
56
uint16_t staId)
const override
;
57
58
/**
59
* Round SNR to the specified precision
60
*
61
* @param snr the SNR to round
62
* @param precision the precision to use
63
* @return the rounded SNR to the specified precision
64
*/
65
dB_u
RoundSnr
(
dB_u
snr,
double
precision)
const
;
66
67
/**
68
* Fetch the frame success rate for a given Wi-Fi mode, TXVECTOR, SNR and frame size.
69
* @param mode the Wi-Fi mode
70
* @param txVector the TXVECTOR
71
* @param snr the SNR (linear scale)
72
* @param nbits the number of bits
73
* @return the frame success rate for a given Wi-Fi mode, TXVECTOR, SNR and frame size
74
*/
75
double
FetchFsr
(
WifiMode
mode,
const
WifiTxVector
& txVector,
double
snr, uint64_t nbits)
const
;
76
77
Ptr<ErrorRateModel>
78
m_fallbackErrorModel
;
//!< Error rate model to fallback to if no value is found in the table
79
80
uint64_t
m_threshold
;
//!< Threshold in bytes over which the table for large size frames is used
81
};
82
83
}
// namespace ns3
84
85
#endif
/* TABLE_BASED_ERROR_RATE_MODEL_H */
double
ns3::ErrorRateModel
the interface for Wifi's error models
Definition
error-rate-model.h:25
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TableBasedErrorRateModel
Introspection did not find any typical Config paths.
Definition
table-based-error-rate-model.h:31
ns3::TableBasedErrorRateModel::m_fallbackErrorModel
Ptr< ErrorRateModel > m_fallbackErrorModel
Error rate model to fallback to if no value is found in the table.
Definition
table-based-error-rate-model.h:78
ns3::TableBasedErrorRateModel::~TableBasedErrorRateModel
~TableBasedErrorRateModel() override
Definition
table-based-error-rate-model.cc:62
ns3::TableBasedErrorRateModel::GetMcsForMode
static std::optional< uint8_t > GetMcsForMode(WifiMode mode)
Utility function to convert WifiMode to an MCS value.
Definition
table-based-error-rate-model.cc:77
ns3::TableBasedErrorRateModel::DoGetChunkSuccessRate
double DoGetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas, WifiPpduField field, uint16_t staId) const override
A pure virtual method that must be implemented in the subclass.
Definition
table-based-error-rate-model.cc:139
ns3::TableBasedErrorRateModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
table-based-error-rate-model.cc:36
ns3::TableBasedErrorRateModel::TableBasedErrorRateModel
TableBasedErrorRateModel()
Definition
table-based-error-rate-model.cc:57
ns3::TableBasedErrorRateModel::RoundSnr
dB_u RoundSnr(dB_u snr, double precision) const
Round SNR to the specified precision.
Definition
table-based-error-rate-model.cc:69
ns3::TableBasedErrorRateModel::FetchFsr
double FetchFsr(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits) const
Fetch the frame success rate for a given Wi-Fi mode, TXVECTOR, SNR and frame size.
ns3::TableBasedErrorRateModel::m_threshold
uint64_t m_threshold
Threshold in bytes over which the table for large size frames is used.
Definition
table-based-error-rate-model.h:80
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::WifiMode
represent a single transmission mode
Definition
wifi-mode.h:40
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:101
error-rate-model.h
ns3::WifiPpduField
WifiPpduField
The type of PPDU field (grouped for convenience)
Definition
wifi-phy-common.h:313
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
wifi-mode.h
src
wifi
model
table-based-error-rate-model.h
Generated on Sun Dec 1 2024 18:20:49 for ns-3 by
1.11.0