开发者

Reliable multicast communication in LAN

开发者 https://www.devze.com 2023-02-09 09:35 出处:网络
I have a network application working on Linux. What I want to do is to make my application able to announce it\'s presence in LAN and then notify other applications about some changes. Because I don\'

I have a network application working on Linux. What I want to do is to make my application able to announce it's presence in LAN and then notify other applications about some changes. Because I don't know how many instances of my application already works on other hosts in LAN I cannot use SCTP, multicast communication is the only way (or maybe you know other solution?).

Structure I want to send over multicast address has fixed size (320 bytes) and contains binary data, which are in开发者_运维问答 fact structure of numbers and bit flags.

I'm wondering if there are any well-know programming techniques, which can make UDP communication a bit more reliable. I only figured out two things:

  1. I drop all packets received by recvmsg() which are smaller then 320 bytes.
  2. I surround every packet with with well-know header and footer, and then check them each time when I receive new message, however packet still can be damaged somewhere in the middle right?

Edit: I found a PGN protocol, but the only Linux implementation is known to work on x86. It's partial solution for me, because I want to run my program on ARM architecture too


You can try porting PGM to ARM, there are not that many requirements in OpenPGM, it already runs fine on IBM s390 mainframes for example.

Disclosure: I'm the author of OpenPGM \:D/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号