问题描述
我在Omnet 5.1.1中使用INET 3.6.
I use INET 3.6 in Omnet 5.1.1.
我已经成功完成了波纹管链接中提到的这种结构.
I have done this structure which has been mentioned in bellow link successfully.
https://stackoverflow.com/a/36647631/6640504
然后,我在(inet-> application-> base)中制作了一个简单的模块,并将其NED文件添加到node.但是我无法将任何数据包发送到其他节点.
Then,I have made simple module in (inet --> application --> base) and added its NED file to node. But I could not send any packet to other nodes.
请您指导我如何在不使用udpapp或tcpapp的情况下在应用程序层中发送或接收广播数据包吗?
Would you please guide me how to send or receive broadcast packets in Application layer without using udpapp or tcpapp?
谢谢.
推荐答案
要能够在omnet中发送广播数据包,您需要执行以下任一操作:
To be able to send broadcast packets in omnet, you need to do either of below:
- 将您的udp套接字绑定到网络接口,或者
- 在omnet.ini中,设置"**.forceBroadcast = true",这将要求omnet将广播数据包发送到所有可用接口
否则,您的广播数据包将被丢弃,并发出 packetFromUpperDroppedSignal 信号.
otherwise, your broadcast packets will be dropped and a signal packetFromUpperDroppedSignal will be emitted.
这篇关于如何在INET的应用程序层中发送广播数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!