英文:
How to get the SNR and the SNIR values when a packet is received in the MAC layer also the network layer
问题
在Omnet++ 6和Inet 4.4框架中:
- 在接收节点的MAC层接收数据包时,如何获取或计算信噪比(SNR)和信噪比增益(SNIR)的数值?应该由接收数据包的每个无线电接口分别计算SNR和SNIR的数值吗?
- 在网络层和更高层面又如何呢?
请在解释中附带必要的代码。
提前感谢。
英文:
By the Omnet++ 6 and then Inet 4.4 framework:
I have a WiFi network that includes some multi-radio multi-interface nodes,
- 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?
- How about in the network layer and the upper layers?
Please include the necessary code in addition to the explanation.
Thanks in advance
答案1
得分: 0
每个由MAC接收的数据包应包含SnirInd
标签。根据此标签的描述:
> 此指示指定在接收数据包期间检测到的信噪比。它可能出现在从物理层到应用层的数据包上。
要获取该标签,可以使用以下代码片段:
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;
}
SnirInd
标签在传递给上层时存在于数据包中,因此相同的代码片段可用于网络层。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论