How NetSim Decides 802.11 PHY Rate | NetSim

How is the PHY rate decided in NetSim 802.11?


Applicable versionsNetSim StandardNetSim Pro

 

The PHY Rate when rate adaptation is set to false is based on Received power (RSSI) and SINR. 


Received_power (at receiver from any node) = Transmit_power - Propagation_Loss 


Propagation loss (pathloss) is implemented in IEEE_802_11_Phy.c in the function


In NetSim v12:


dReceivedPower = GET_RX_POWER_dbm(packet-> nTransmitterId,

  ifid,

  pstruEventDetails->nDeviceId,

  pstruEventDetails-> nInterfaceId,

  packet->pstruPhyData-> dArrivalTime); 

In NetSim v13:

double pdbm = GET_RX_POWER_dbm(packet-> nTransmitterId,

  ifid,

  pstruEventDetails->nDeviceId,

  pstruEventDetails-> nInterfaceId,

  packet->pstruPhyData-> dArrivalTime);

which is actually as a macro    


#define GET_RX_POWER_dbm(tx, txi, rx, rxi, time) (propagation_get_received_ power_dbm(propagationHandle, tx, txi, rx, rxi, time))


The code for this is proprietary and is not part of our open-source codes.


Next, 


SINR = Receiver_Power (from source) / (Thermal_Noise + Sum of (Received_power (from all nodes except source))


In IEEE_802_11_Phy.c in IEEE802_11 project the function 

int fn_NetSim_IEEE802_11_OFDMPhy_ DataRate(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, NETSIM_ID nReceiverId,NetSim_PACKET* packet,double time) is used for data rate calculation. In the structure


static struct stru_802_11_Phy_Parameters_ OFDM struPhyParameters_20MHz[8] =

{

//IEEE802.11-OFDM Phy

{1,-82,Modulation_BPSK,6, Coding_1_2,1,48,24},

{2,-79,Modulation_BPSK,9, Coding_3_4,1,48,36},

{3,-77,Modulation_QPSK,12, Coding_1_2,2,96,48},

{4,-74,Modulation_QPSK,18, Coding_3_4,2,96,72},

{5,-70,Modulation_16_QAM,24, Coding_1_2,4,192,96},

{6,-66,Modulation_16_QAM,36, Coding_3_4,4,192,144},

{7,-65,Modulation_64_QAM,48, Coding_2_3,6,288,192},

{8,-64,Modulation_64_QAM,54, Coding_3_4,6,288,216},

};


The second value is the Rx_Sensitivity and the fourth parameter is the data rate


In IEEE802.11_OFDMPhy.c the function 


int fn_NetSim_IEEE802_11_OFDMPhy_DataRate(NETSIM_ID nDeviceId, NETSIM_ID nInterfaceId, NETSIM_ID nReceiverId,NetSim_PACKET* packet,double time) 


contains the code


for(i=MAX_RATE_INDEX;i>=MIN_RATE_INDEX;i--)

{

    double ber = calculate_BER(struPhyParameters[i].nModulation,power,pstruPhy->dChannelBandwidth);

    if((ber<=TARGET_BER && power >= struPhyParameters[i].dRxSensitivity) || i==MIN_RATE_INDEX)

    //if(power >= struPhyParameters[i].dRxSensitivity)

        {

            ...

            ....


This means you start at the highest rate and work your way down to the MIN_RATE till the condition 


ber<=TARGET_BER && power >= struPhyParameters[i].dRxSensitivity 


is met. This means the BER must be <= TARGET_BER which is #defined as 1.0e-5 (in line 60) and RSSI is greater than Rx Sensitivity.


The SINR is used to look up an SNR-BER curve to find out the Bit Error Rate. This is inside the function call in the previous line


double ber = calculate_BER(struPhyParameters[i].nModulation,power,pstruPhy->dChannelBandwidth);


Hence it is a combination of SINR & RSSI that determines the rate.


NOTE: An alternate logic is to NOT use the SINR/BER and just compare RSSI against Rx_Sensitivity to determine the rate. This is the reason for the commented code


    //if(power >= struPhyParameters[i].dRxSensitivity)


Related articles:

how-to-obtain-a-log-of-receiver-sensitivity-received-power-and-phy-data-rate-for-802-11-based-simulations-

in-802-11-can-we-monitor-phy-rate-negotiation-between-access-point-and-wireless-nodes-

what-are-the-different-phy-rates-in-802-11b-