A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
yans-error-rate-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef YANS_ERROR_RATE_MODEL_H
10#define YANS_ERROR_RATE_MODEL_H
11
12#include "error-rate-model.h"
13
14namespace ns3
15{
16
17/**
18 * \brief Model the error rate for different modulations.
19 * \ingroup wifi
20 *
21 * A packet of interest (e.g., a packet can potentially be received by the MAC)
22 * is divided into chunks. Each chunk is related to an start/end receiving event.
23 * For each chunk, it calculates the ratio (SINR) between received power of packet
24 * of interest and summation of noise and interfering power of all the other incoming
25 * packets. Then, it will calculate the success rate of the chunk based on
26 * BER of the modulation. The success reception rate of the packet is derived from
27 * the success rate of all chunks.
28 *
29 * The 802.11b modulations:
30 * - 1 Mbps mode is based on DBPSK. BER is from equation 5.2-69 from John G. Proakis
31 * Digital Communications, 2001 edition
32 * - 2 Mbps model is based on DQPSK. Equation 8 from "Tight bounds and accurate
33 * approximations for DQPSK transmission bit error rate", G. Ferrari and G.E. Corazza
34 * ELECTRONICS LETTERS, 40(20):1284-1285, September 2004
35 * - 5.5 Mbps and 11 Mbps are based on equations (18) and (17) from "Properties and
36 * performance of the IEEE 802.11b complementary code-key signal sets",
37 * Michael B. Pursley and Thomas C. Royster. IEEE TRANSACTIONS ON COMMUNICATIONS,
38 * 57(2):440-449, February 2009.
39 * - More detailed description and validation can be found in
40 * http://www.nsnam.org/~pei/80211b.pdf
41 */
43{
44 public:
45 /**
46 * \brief Get the type ID.
47 * \return the object TypeId
48 */
49 static TypeId GetTypeId();
50
52
53 private:
55 const WifiTxVector& txVector,
56 double snr,
57 uint64_t nbits,
58 uint8_t numRxAntennas,
59 WifiPpduField field,
60 uint16_t staId) const override;
61 /**
62 * Return BER of BPSK with the given parameters.
63 *
64 * \param snr SNR ratio (not dB)
65 * \param signalSpread
66 * \param phyRate
67 *
68 * \return BER of BPSK at the given SNR
69 */
70 double GetBpskBer(double snr, uint32_t signalSpread, uint64_t phyRate) const;
71 /**
72 * Return BER of QAM-m with the given parameters.
73 *
74 * \param snr SNR ratio (not dB)
75 * \param m
76 * \param signalSpread
77 * \param phyRate
78 *
79 * \return BER of BPSK at the given SNR
80 */
81 double GetQamBer(double snr, unsigned int m, uint32_t signalSpread, uint64_t phyRate) const;
82 /**
83 * Return k!
84 *
85 * \param k
86 *
87 * \return k!
88 */
90 /**
91 * Return Binomial distribution for a given k, p, and n
92 *
93 * \param k
94 * \param p
95 * \param n
96 *
97 * \return a Binomial distribution
98 */
99 double Binomial(uint32_t k, double p, uint32_t n) const;
100 /**
101 * \param ber
102 * \param d
103 *
104 * \return double
105 */
106 double CalculatePdOdd(double ber, unsigned int d) const;
107 /**
108 * \param ber
109 * \param d
110 *
111 * \return double
112 */
113 double CalculatePdEven(double ber, unsigned int d) const;
114 /**
115 * \param ber
116 * \param d
117 *
118 * \return double
119 */
120 double CalculatePd(double ber, unsigned int d) const;
121 /**
122 * \param snr SNR ratio (not dB)
123 * \param nbits
124 * \param signalSpread
125 * \param phyRate
126 * \param dFree
127 * \param adFree
128 *
129 * \return double
130 */
131 double GetFecBpskBer(double snr,
132 uint64_t nbits,
133 uint32_t signalSpread,
134 uint64_t phyRate,
135 uint32_t dFree,
136 uint32_t adFree) const;
137 /**
138 * \param snr SNR ratio (not dB)
139 * \param nbits
140 * \param signalSpread
141 * \param phyRate
142 * \param m
143 * \param dfree
144 * \param adFree
145 * \param adFreePlusOne
146 *
147 * \return double
148 */
149 double GetFecQamBer(double snr,
150 uint64_t nbits,
151 uint32_t signalSpread,
152 uint64_t phyRate,
153 uint32_t m,
154 uint32_t dfree,
155 uint32_t adFree,
156 uint32_t adFreePlusOne) const;
157};
158
159} // namespace ns3
160
161#endif /* YANS_ERROR_RATE_MODEL_H */
the interface for Wifi's error models
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...
Model the error rate for different modulations.
double GetFecBpskBer(double snr, uint64_t nbits, uint32_t signalSpread, uint64_t phyRate, uint32_t dFree, uint32_t adFree) const
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.
double Binomial(uint32_t k, double p, uint32_t n) const
Return Binomial distribution for a given k, p, and n.
double CalculatePdEven(double ber, unsigned int d) const
double GetQamBer(double snr, unsigned int m, uint32_t signalSpread, uint64_t phyRate) const
Return BER of QAM-m with the given parameters.
uint32_t Factorial(uint32_t k) const
Return k!
double CalculatePdOdd(double ber, unsigned int d) const
double GetFecQamBer(double snr, uint64_t nbits, uint32_t signalSpread, uint64_t phyRate, uint32_t m, uint32_t dfree, uint32_t adFree, uint32_t adFreePlusOne) const
double CalculatePd(double ber, unsigned int d) const
double GetBpskBer(double snr, uint32_t signalSpread, uint64_t phyRate) const
Return BER of BPSK with the given parameters.
WifiPpduField
The type of PPDU field (grouped for convenience)
Every class exported by the ns3 library is enclosed in the ns3 namespace.