BER and Packet Error Calculation in NetSim DTDMA

How are BER and packet errors calculated in NetSim DTDMA?

Applies to: NetSim Pro v14/v15

Dynamic TDMA (DTDMA) evaluates each received packet using the received signal power, fading, interference, modulation, bandwidth, and packet size. It first obtains a bit error rate (BER) and then decides whether that packet is received without error or marked as errored.


BER and PER

TermMeaning in this context
BERProbability that a transmitted bit is received incorrectly for the calculated radio conditions.
Packet error probabilityProbability of a packet containing an error, derived from BER and packet length.
Observed PERRatio of errored packet receptions to all packet reception attempts measured from a simulation run.

DTDMA does not expose a separate configurable PER property. NetSim calculates BER and uses it with the packet size to decide each packet's error status.

DTDMA packet-error processing sequence

  1. Obtain the packet's received power.
  2. Apply fading loss to the received power.
  3. Calculate interference power.
  4. Calculate SINR using received power, interference power, and bandwidth.
  5. Obtain BER using the selected BER model.
  6. Pass BER and packet size to the packet-error decision API.
  7. Mark the packet as error-free or errored.

The DTDMA entry point for this processing is:

fn_NetSim_DTDMA_CalculatePacketError()

It is implemented in:

<NetSim_Install_Directory>\src\Simulation\DTDMA\DTDMA_Phy.c

BER calculation methods


1. SINR-BER table

When the BER model is SINR-BER_by_Table, DTDMA calls:

pb = get_BER_from_Table(sinr);

The table-loading and lookup code is in:

<NetSim_Install_Directory>\src\Simulation\DTDMA\DTDMA_SINR_BER.c

The selected CSV file is read from the simulation IOPath. Its SINR values must be in ascending order. Blank lines, comments beginning with #, and a header containing SINR are skipped.

2. Formula-based BER with FEC

When forward error correction is enabled, DTDMA calls:

calculate_FEC_BER(
modulation,
codingRate,
receivedPower,
interferencePower,
bandwidth,
dataRate);

3. Formula-based BER without FEC

When forward error correction is disabled, DTDMA calls:

calculate_BER(
modulation,
receivedPower,
interferencePower,
bandwidth);

The declarations for the formula-based BER APIs are in:

<NetSim_Install_Directory>\src\Simulation\Include\ErrorModel.h

Their implementations belong to the internal NetSim framework and are not part of the editable DTDMA source.

How the packet result is decided

After calculating BER, DTDMA calls:

fn_NetSim_Packet_DecideError(
pb,
packet->pstruPhyData->dPacketSize);

The API is declared in:

<NetSim_Install_Directory>\src\Simulation\Include\Packet.h

It derives a packet-error probability from BER and packet length and then determines the outcome for that reception. Its implementation is part of the internal framework.

Calculating observed PER from simulation results

For a chosen receiver, link, application, or time interval, calculate:

Observed PER =
(Number of errored packet receptions) / (Total packet reception attempts)

State the scope used for both counts. Mixing different receivers, applications, or time intervals can produce a misleading value.

Files involved

FileRole
DTDMA\DTDMA_Phy.cCalculates received power, interference, SINR, BER, and invokes the packet-error decision.
DTDMA\DTDMA_SINR_BER.cLoads and looks up the SINR-BER table.
Include\ErrorModel.hDeclares SINR and formula-based BER APIs.
Include\Packet.hDeclares the packet-error decision API.