在 Inet 中寻找执行应用层接收消息的最佳方法 [英] Finding the best methods in the Inet which perform receiving messages the application layer

查看:73
本文介绍了在 Inet 中寻找执行应用层接收消息的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找出 Inet 中哪些方法最适合以下条件和请求:

I need to find which methods in the Inet are best for the following conditions and requests:

应用层的所有应用程序,如TcpApp、UDPApp、UdpBasicApp等,在接收到消息或数据包时,都以通用的方式处理.例如,当发送 UdpBasicApp 数据包时,该数据包在该函数(方法)中进行处理.此外,接收到一个 TcpApp 数据包,该数据包在该函数(方法)中进行处理.我猜这个函数(方法)在到达所有应用程序之前应该属于公共路径上的一个类(我猜应该在网络层或传输层).

All applications in the application layer such as TcpApp, UDPApp, UdpBasicApp, etc are processed in a common method when a message or packet is received. For example, when a UdpBasicApp packet is sent, that packet is processed in that function(method). Also, a TcpApp packet is received, that packet is processed in that function(method). I guess that function(method) should be belonging a class on the common path before arriving to all applications(I guess that should be in Network Layer or Transport Layer).

假设我的 omnetpp.ini 的一部分是:

Suppose a part of my omnetpp.ini is:

*.hostA.numApps = 1
*.hostA.app[0].typename = "UdpBasicApp"
*.hostA.app[0].destAddresses = "hostB"
*.hostA.app[0].destPort = 5000
*.hostA.app[0].messageLength = 1000B
*.hostA.app[0].sendInterval = exponential(12ms)
*.hostA.app[0].packetName = "UDPData"

*.hostB.numApps = 1
*.hostB.app[0].typename = "UdpSink"
*.hostB.app[0].localPort = 5000

hostA 和 hostB 是节点.提前致谢

The hostA and the hostB are nodes. Thanks in advance

推荐答案

应用程序数据包的内容特定于任何给定的应用程序,因此没有可以捕获所有"应用程序数据的通用功能.即使有这样的方法,你也不能对数据包做任何事情,因为你不知道包里面是什么以及如何解释它.您只会看到 X 字节的数据.

The content of the application data packet is specific to any given application so there is no common function where you could catch 'all' application data. Even if there would be such a method, you would not be able to do anything with the data packet, because you would not know what is inside the packet and how to interpret it. You would just see X bytes of data.

在下层也没有共同点.

  • 在链路层,如果您有多个网卡,数据可以通过各种接口进入.
  • 在网络层,您可以使用 IPv6 或 IPv4 流量,因此同样没有通用路径.
  • 在传输层,您可以使用 UDP、TCP 或 SCTP
  • 在应用程序层,您有许多应用程序,每个应用程序都以不同的方式解释应用程序数据.

简而言之,没有这样的方法,实际上也没有任何意义.

In short, there is no such method and in fact it does not make sense to have one.

这篇关于在 Inet 中寻找执行应用层接收消息的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆