By the Omnet++ 6 and then Inet 4.4 framework:
I have a WiFi network that includes some multi-radio multi-interface nodes,
Please include the necessary code in addition to the explanation.
Thanks in advance
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.