可用于在广播异步网络系统中同步消息及其确认的协议/方法?
有哪些协议/方法可用于在广播异步网络系统中同步消息及其确认?我们使用带有 ACK 和计时器的 UDP 来查看是否需要重新发送(最多发送相同消息 3 次)。
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 a resend (max send same msg 3 times).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您正在使用 ACK 和重新发送,您应该认真考虑使用 TCP,因为在 UDP 之上构建可靠性和可扩展性充满了危险(3 次重新发送实际上也不能为您提供可靠性)。在需要扩展的广播系统中,您应该考虑定期重新发送,并在接收者获得所需信息后取消订阅(这就是许多自动发现系统的工作原理)。
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).
带有 ACK 的 UDP。尝试 TCP;它可以做到这一切,甚至更多。
如果您确实想手动完成,请查看滑动窗口。长话短说,您可以一次发送多条消息并期待多个 ACK(而不是发送并等待 ACK)。一旦 ACK 超时(未收到),您如何处理取决于您。如果您正在发送视频帧,您可以选择忽略它。另一方面,您可以选择仅重新发送尚未确认的数据包,或者在上次过期的 ACK 后重新发送所有数据包。
维基百科在此处描述了滑动窗口协议。
视觉演示位于此链接:http://www.osischool.com/protocol /Tcp/slidingWindow/index.php
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