获取MAC层和网络层接收到数据包时的SNR和SNIR值。

huangapple go评论88阅读模式
英文:

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框架中:

  1. 在接收节点的MAC层接收数据包时,如何获取或计算信噪比(SNR)和信噪比增益(SNIR)的数值?应该由接收数据包的每个无线电接口分别计算SNR和SNIR的数值吗?
  2. 在网络层和更高层面又如何呢?

请在解释中附带必要的代码。

提前感谢。

英文:

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

答案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-&gt;findTag&lt;SnirInd&gt;()) {
   auto snirIndTag = packet-&gt;getTag&lt;SnirInd&gt;();
   double snirMin = snirIndTag-&gt;getMinimumSnir();
   double snirMax = snirIndTag-&gt;getMaximumSnir();
   double snirAvg = snirIndTag-&gt;getAverageSnir();
   EV_INFO &lt;&lt; &quot;SNIR min=&quot; &lt;&lt; snirMin &lt;&lt; &quot;, SNIR max=&quot; &lt;&lt; snirMax &lt;&lt;
              &quot;, SNIR avg=&quot; &lt;&lt; snirAvg &lt;&lt; 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.

huangapple
  • 本文由 发表于 2023年5月25日 10:29:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76328520.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定