INET Framework for OMNeT++/OMNEST
inet::physicallayer::Ieee80211ErrorModelBase Class Referenceabstract

#include <Ieee80211ErrorModelBase.h>

Inheritance diagram for inet::physicallayer::Ieee80211ErrorModelBase:
inet::physicallayer::ErrorModelBase inet::physicallayer::IErrorModel inet::IPrintableObject inet::physicallayer::Ieee80211NistErrorModel inet::physicallayer::Ieee80211YansErrorModel inet::physicallayer::Ieee80211OfdmErrorModel

Public Member Functions

 Ieee80211ErrorModelBase ()
 
virtual double computePacketErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override
 Returns the packet error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
 
virtual double computeBitErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override
 Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
 
virtual double computeSymbolErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override
 Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const
 Prints this object to the provided output stream. More...
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

virtual double getHeaderSuccessRate (const IIeee80211Mode *mode, unsigned int bitLength, double snir) const =0
 
virtual double getDataSuccessRate (const IIeee80211Mode *mode, unsigned int bitLength, double snir) const =0
 
virtual PacketcomputeCorruptedPacket (const Packet *packet, double ber) const override
 
virtual double getDsssDbpskSuccessRate (unsigned int bitLength, double snir) const
 
virtual double getDsssDqpskSuccessRate (unsigned int bitLength, double snir) const
 
virtual double getDsssDqpskCck5_5SuccessRate (unsigned int bitLength, double snir) const
 
virtual double getDsssDqpskCck11SuccessRate (unsigned int bitLength, double snir) const
 
- Protected Member Functions inherited from inet::physicallayer::ErrorModelBase
virtual void initialize (int stage) override
 
virtual double getScalarSnir (const ISnir *snir) const
 
virtual bool hasProbabilisticError (b length, double ber) const
 
virtual PacketcorruptBits (const Packet *packet, double ber, bool &isCorrupted) const
 
virtual PacketcorruptBytes (const Packet *packet, double ber, bool &isCorrupted) const
 
virtual PacketcorruptChunks (const Packet *packet, double ber, bool &isCorrupted) const
 
virtual PacketcorruptPacket (const Packet *packet, bool &isCorrupted) const
 
virtual PacketcomputeCorruptedPacket (const ISnir *snir) const override
 

Protected Attributes

double spectralEfficiency1bit = 2000000.0 / 1000000.0
 
double spectralEfficiency2bit = 2000000.0 / 1000000.0 / 2.0
 
double sirPerfect = 10.0
 
double sirImpossible = 0.1
 
- Protected Attributes inherited from inet::physicallayer::ErrorModelBase
CorruptionMode corruptionMode = CorruptionMode::CM_UNDEFINED
 
SnirMode snirMode = SnirMode::SM_UNDEFINED
 
double snirOffset = NaN
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::ErrorModelBase
enum  CorruptionMode {
  CorruptionMode::CM_UNDEFINED = -1, CorruptionMode::CM_PACKET, CorruptionMode::CM_CHUNK, CorruptionMode::CM_BYTE,
  CorruptionMode::CM_BIT
}
 
enum  SnirMode { SnirMode::SM_UNDEFINED = -1, SnirMode::SM_MIN, SnirMode::SM_MEAN }
 
- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Constructor & Destructor Documentation

◆ Ieee80211ErrorModelBase()

inet::physicallayer::Ieee80211ErrorModelBase::Ieee80211ErrorModelBase ( )
18 {
19 }

Member Function Documentation

◆ computeBitErrorRate()

double inet::physicallayer::Ieee80211ErrorModelBase::computeBitErrorRate ( const ISnir snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

48 {
49  Enter_Method("computeBitErrorRate");
50  return NaN;
51 }

◆ computeCorruptedPacket()

Packet * inet::physicallayer::Ieee80211ErrorModelBase::computeCorruptedPacket ( const Packet packet,
double  ber 
) const
overrideprotectedvirtual

Reimplemented from inet::physicallayer::ErrorModelBase.

60 {
62  return ErrorModelBase::computeCorruptedPacket(packet, ber);
63  else
64  throw cRuntimeError("Unimplemented corruption mode");
65 }

◆ computePacketErrorRate()

double inet::physicallayer::Ieee80211ErrorModelBase::computePacketErrorRate ( const ISnir snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the packet error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

22 {
23  Enter_Method("computePacketErrorRate");
24  auto transmission = snir->getReception()->getTransmission();
25  auto flatTransmission = dynamic_cast<const FlatTransmissionBase *>(transmission);
26  auto ieee80211Transmission = check_and_cast<const Ieee80211TransmissionBase *>(transmission);
27  auto mode = ieee80211Transmission->getMode();
28  auto headerLength = flatTransmission != nullptr ? flatTransmission->getHeaderLength() : mode->getHeaderMode()->getLength();
29  auto dataLength = flatTransmission != nullptr ? flatTransmission->getDataLength() : mode->getDataMode()->getCompleteLength(transmission->getPacket()->getTotalLength() - headerLength);
30  // TODO check header length and data length for OFDM (signal) field
31  double headerSuccessRate = getHeaderSuccessRate(mode, b(headerLength).get(), getScalarSnir(snir));
32  double dataSuccessRate = getDataSuccessRate(mode, b(dataLength).get(), getScalarSnir(snir));
33  switch (part) {
35  return 1.0 - headerSuccessRate * dataSuccessRate;
37  return 0;
39  return 1.0 - headerSuccessRate;
41  return 1.0 - dataSuccessRate;
42  default:
43  throw cRuntimeError("Unknown signal part: '%s'", IRadioSignal::getSignalPartName(part));
44  }
45 }

Referenced by inet::physicallayer::Ieee80211OfdmErrorModel::computePacketModel().

◆ computeSymbolErrorRate()

double inet::physicallayer::Ieee80211ErrorModelBase::computeSymbolErrorRate ( const ISnir snir,
IRadioSignal::SignalPart  part 
) const
overridevirtual

Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics.

Implements inet::physicallayer::IErrorModel.

54 {
55  Enter_Method("computeSymbolErrorRate");
56  return NaN;
57 }

◆ getDataSuccessRate()

virtual double inet::physicallayer::Ieee80211ErrorModelBase::getDataSuccessRate ( const IIeee80211Mode mode,
unsigned int  bitLength,
double  snir 
) const
protectedpure virtual

◆ getDsssDbpskSuccessRate()

double inet::physicallayer::Ieee80211ErrorModelBase::getDsssDbpskSuccessRate ( unsigned int  bitLength,
double  snir 
) const
protectedvirtual
68 {
69  double EbN0 = snir * spectralEfficiency1bit; // 1 bit per symbol with 1 MSPS
70  double bitErrorRate = 0.5 * exp(-EbN0);
71  return pow((1.0 - bitErrorRate), (int)bitLength);
72 }

Referenced by inet::physicallayer::Ieee80211NistErrorModel::getDSSSAndHrDSSSChunkSuccessRate(), and inet::physicallayer::Ieee80211YansErrorModel::getDSSSAndHrDSSSChunkSuccessRate().

◆ getDsssDqpskCck11SuccessRate()

double inet::physicallayer::Ieee80211ErrorModelBase::getDsssDqpskCck11SuccessRate ( unsigned int  bitLength,
double  snir 
) const
protectedvirtual
99 {
100  double bitErrorRate;
101  if (snir > sirPerfect)
102  bitErrorRate = 0.0;
103  else if (snir < sirImpossible)
104  bitErrorRate = 0.5;
105  else {
106  double a1 = 7.9056742265333456e-003;
107  double a2 = -1.8397449399176360e-001;
108  double a3 = 1.0740689468707241e+000;
109  double a4 = 1.0523316904502553e+000;
110  double a5 = 3.0552298746496687e-001;
111  double a6 = 2.2032715128698435e+000;
112  bitErrorRate = (a1 * snir * snir + a2 * snir + a3) / (snir * snir * snir + a4 * snir * snir + a5 * snir + a6);
113  }
114  return pow((1.0 - bitErrorRate), (int)bitLength);
115 }

Referenced by inet::physicallayer::Ieee80211NistErrorModel::getDSSSAndHrDSSSChunkSuccessRate(), and inet::physicallayer::Ieee80211YansErrorModel::getDSSSAndHrDSSSChunkSuccessRate().

◆ getDsssDqpskCck5_5SuccessRate()

double inet::physicallayer::Ieee80211ErrorModelBase::getDsssDqpskCck5_5SuccessRate ( unsigned int  bitLength,
double  snir 
) const
protectedvirtual
82 {
83  double bitErrorRate;
84  if (snir > sirPerfect)
85  bitErrorRate = 0.0;
86  else if (snir < sirImpossible)
87  bitErrorRate = 0.5;
88  else {
89  double a1 = 5.3681634344056195e-001;
90  double a2 = 3.3092430025608586e-003;
91  double a3 = 4.1654372361004000e-001;
92  double a4 = 1.0288981434358866e+000;
93  bitErrorRate = a1 * exp(-(pow((snir - a2) / a3, a4)));
94  }
95  return pow((1.0 - bitErrorRate), (int)bitLength);
96 }

Referenced by inet::physicallayer::Ieee80211NistErrorModel::getDSSSAndHrDSSSChunkSuccessRate(), and inet::physicallayer::Ieee80211YansErrorModel::getDSSSAndHrDSSSChunkSuccessRate().

◆ getDsssDqpskSuccessRate()

double inet::physicallayer::Ieee80211ErrorModelBase::getDsssDqpskSuccessRate ( unsigned int  bitLength,
double  snir 
) const
protectedvirtual
75 {
76  double EbN0 = snir * spectralEfficiency2bit; // 2 bits per symbol, 1 MSPS
77  double bitErrorRate = ((sqrt(2.0) + 1.0) / sqrt(8.0 * 3.1415926 * sqrt(2.0))) * (1.0 / sqrt(EbN0)) * exp(-(2.0 - sqrt(2.0)) * EbN0);
78  return pow((1.0 - bitErrorRate), (int)bitLength);
79 }

Referenced by inet::physicallayer::Ieee80211NistErrorModel::getDSSSAndHrDSSSChunkSuccessRate(), and inet::physicallayer::Ieee80211YansErrorModel::getDSSSAndHrDSSSChunkSuccessRate().

◆ getHeaderSuccessRate()

virtual double inet::physicallayer::Ieee80211ErrorModelBase::getHeaderSuccessRate ( const IIeee80211Mode mode,
unsigned int  bitLength,
double  snir 
) const
protectedpure virtual

Member Data Documentation

◆ sirImpossible

double inet::physicallayer::Ieee80211ErrorModelBase::sirImpossible = 0.1
protected

◆ sirPerfect

double inet::physicallayer::Ieee80211ErrorModelBase::sirPerfect = 10.0
protected

◆ spectralEfficiency1bit

double inet::physicallayer::Ieee80211ErrorModelBase::spectralEfficiency1bit = 2000000.0 / 1000000.0
protected

Referenced by getDsssDbpskSuccessRate().

◆ spectralEfficiency2bit

double inet::physicallayer::Ieee80211ErrorModelBase::spectralEfficiency2bit = 2000000.0 / 1000000.0 / 2.0
protected

Referenced by getDsssDqpskSuccessRate().


The documentation for this class was generated from the following files:
inet::physicallayer::Ieee80211ErrorModelBase::sirPerfect
double sirPerfect
Definition: Ieee80211ErrorModelBase.h:23
inet::physicallayer::IRadioSignal::SIGNAL_PART_WHOLE
@ SIGNAL_PART_WHOLE
Definition: IRadioSignal.h:26
inet::physicallayer::Ieee80211ErrorModelBase::spectralEfficiency1bit
double spectralEfficiency1bit
Definition: Ieee80211ErrorModelBase.h:21
inet::physicallayer::Ieee80211ErrorModelBase::sirImpossible
double sirImpossible
Definition: Ieee80211ErrorModelBase.h:24
inet::physicallayer::ErrorModelBase::CorruptionMode::CM_PACKET
@ CM_PACKET
inet::physicallayer::Ieee80211ErrorModelBase::spectralEfficiency2bit
double spectralEfficiency2bit
Definition: Ieee80211ErrorModelBase.h:22
inet::physicallayer::Ieee80211ErrorModelBase::getHeaderSuccessRate
virtual double getHeaderSuccessRate(const IIeee80211Mode *mode, unsigned int bitLength, double snir) const =0
inet::units::sqrt
value< Value, pow< Unit, 1, 2 > > sqrt(const value< Value, Unit > &a)
Definition: Units.h:272
inet::physicallayer::ErrorModelBase::corruptionMode
CorruptionMode corruptionMode
Definition: ErrorModelBase.h:35
inet::physicallayer::IRadioSignal::SIGNAL_PART_HEADER
@ SIGNAL_PART_HEADER
Definition: IRadioSignal.h:28
inet::physicallayer::IRadioSignal::SIGNAL_PART_PREAMBLE
@ SIGNAL_PART_PREAMBLE
Definition: IRadioSignal.h:27
inet::physicallayer::ErrorModelBase::computeCorruptedPacket
virtual Packet * computeCorruptedPacket(const Packet *packet, double ber) const
Definition: ErrorModelBase.cc:113
NaN
#define NaN
Definition: INETMath.h:91
inet::physicallayer::IRadioSignal::getSignalPartName
static const char * getSignalPartName(SignalPart signalPart)
Returns the name of the provided signal part.
Definition: IRadioSignal.cc:23
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
inet::physicallayer::IRadioSignal::SIGNAL_PART_DATA
@ SIGNAL_PART_DATA
Definition: IRadioSignal.h:29
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::physicallayer::ErrorModelBase::getScalarSnir
virtual double getScalarSnir(const ISnir *snir) const
Definition: ErrorModelBase.cc:41
inet::physicallayer::Ieee80211ErrorModelBase::getDataSuccessRate
virtual double getDataSuccessRate(const IIeee80211Mode *mode, unsigned int bitLength, double snir) const =0