How to Send a broadcast packet in application layer in INET

坚强是说给别人听的谎言 提交于 2019-12-11 06:30:10

问题


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

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.

Would you please guide me how to send or receive broadcast packets in Application layer without using udpapp or tcpapp?

Thank you in advance.


回答1:


To be able to send broadcast packets in omnet, you need to do either of below:

  1. bind your udp socket to a network interface, or
  2. in omnet.ini, set "**.forceBroadcast = true", which will ask omnet to send your broadcast packets to all available interfaces

otherwise, your broadcast packets will be dropped and a signal packetFromUpperDroppedSignal will be emitted.



来源:https://stackoverflow.com/questions/45534833/how-to-send-a-broadcast-packet-in-application-layer-in-inet

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!