Protocols/Methods available to synchronize msgs and their acks in a broadcast asynchronous network system?
What are the protocols/methods available to synchronize msgs and their acks in a broadcast asynchronous network system? We are using UDP with ACKs and timer to see if there is a need for开发者_StackOverflow社区 a resend (max send same msg 3 times).
If you're using ACKs and resends, you should think hard about using TCP as building reliability and scalability on top of UDP is fraught with peril (3x resends don't actually give you reliability, either). In a broadcast system that needs to scale you should think about just doing periodic resends and have the receivers unsubscribe once they have the information that they need (which is how lots of auto-discovery systems work).
UDP with ACKs. Try TCP; it does all that and more.
If you really wish to do it by hand, look at sliding window. Long story short, you can send multiple messages at once and expect multiple ACKs (instead of sending and waiting for ACK). How you proceed once an ACK times out (is not received) depends on you. If you are sending video frames, you may choose to ignore it. On the other hand, you may choose to resend only the packets that have not been ACKed, or resend all after last expired ACK.
Wikipedia describes the sliding window protocol here.
A visual demo is at this link: http://www.osischool.com/protocol/Tcp/slidingWindow/index.php
精彩评论