A Discrete-Event Network Simulator
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
20namespace ns3
21{
22
23class WifiTxVector;
24
25/*
26 * @ingroup wifi
27 * @brief the interface for the table-driven OFDM error model
28 *
29 */
31{
32 public:
33 /**
34 * @brief Get the type ID.
35 * @return the object TypeId
36 */
37 static TypeId GetTypeId();
38
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:
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
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 */
the interface for Wifi's error models
Smart pointer class similar to boost::intrusive_ptr.
Introspection did not find any typical Config paths.
Ptr< ErrorRateModel > m_fallbackErrorModel
Error rate model to fallback to if no value is found in the table.
static std::optional< uint8_t > GetMcsForMode(WifiMode mode)
Utility function to convert WifiMode to an MCS value.
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.
static TypeId GetTypeId()
Get the type ID.
dB_u RoundSnr(dB_u snr, double precision) const
Round SNR to the specified precision.
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.
uint64_t m_threshold
Threshold in bytes over which the table for large size frames is used.
a unique identifier for an interface.
Definition type-id.h:48
represent a single transmission mode
Definition wifi-mode.h:40
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPpduField
The type of PPDU field (grouped for convenience)
Every class exported by the ns3 library is enclosed in the ns3 namespace.