omnet++inet

How to get the SNR and the SNIR values when a packet is received in the MAC layer also the network layer


By the Omnet++ 6 and then Inet 4.4 framework:

I have a WiFi network that includes some multi-radio multi-interface nodes,

  1. How can I get or calculate the SNR and the SNIR values when receiving a packet at the MAC layer of the receiver node? Should the amount of the SNR and the SNIR be calculated by each radio interface that received the packet?
  2. How about in the network layer and the upper layers?

Please include the necessary code in addition to the explanation.

Thanks in advance


Solution

  • Every packet received by MAC should contain SnirInd tag. According to the description of this tag:

    This indication specifies the signal to noise ratio that was detected during receiving the packet. It may be present on a packet from the phyiscal layer to the application.

    In order to obtain that tag one may use that piece of code:

    if (packet->findTag<SnirInd>()) {
       auto snirIndTag = packet->getTag<SnirInd>();
       double snirMin = snirIndTag->getMinimumSnir();
       double snirMax = snirIndTag->getMaximumSnir();
       double snirAvg = snirIndTag->getAverageSnir();
       EV_INFO << "SNIR min=" << snirMin << ", SNIR max=" << snirMax <<
                  ", SNIR avg=" << snirAvg << endl;
    } 
    

    The SnirInd is present in a packet during passing it to the upper layers therefore the same piece of code may be used in the network layer.