是否有一种基于 UDP 的协议可以在没有数据报可靠性的情况下提供更可靠的大型数据元素发送?
一方面,您有 TCP,它保证数据包到达并且按顺序到达。它还专为商品互联网而设计,具有在流量中“发挥良好作用”的拥塞控制算法。另一方面,UDP 不保证数据包的到达时间和顺序,但它允许您向接收器发送大量数据。在中间的某个地方,您有可靠的基于 UDP 的程序,例如 UDT,它提供定制的拥塞控制算法和可靠性,但具有更高的速度和灵活性。
然而,我正在寻找的是通过 UDP 发送大块数据的能力(大于 UDP 的 64k 数据报大小),但无需担心每个数据报的可靠性。这个想法是将大数据分解为指定大小(<= 64,000 字节)的数据报,可能将一些标头数据粘在前面并通过网络发送。在接收端,这些数据报被读入并存储。如果数据报未到达,则与该传输相关的所有数据报都会被客户端丢弃。
大多数“可靠的UDP”实现都试图维护每个数据报的可靠性,但我只对整体感兴趣,如果我没有得到整体,也没关系——把它全部扔掉并等待下一个。我必须更深入地挖掘,但使用 UDT 中的自定义拥塞控制算法可能是可能的。但是,有采用这种方法的协议吗?
On one end, you have TCP, which guarantees that packets arrive and that they arrive in order. It's also designed for the commodity Internet, with congestion control algorithms that "play nice" in traffic. On the other end of the spectrum, you have UDP, which doesn't guarantee arrival time and order of packets, and it allows you to send large data to a receiver. Somewhere in the middle, you have reliable UDP-based programs, such as UDT, that offer customized congestion control algorithms and reliability, but with greater speed and flexibility.
However, what I'm looking for is the capability to send large chunks of data over UDP (greater than the 64k datagram size of UDP), but without a concern for reliability of each individual datagram. The idea is that the large data is broken down into datagrams of a specified size (<= 64,000 bytes), probably with some header data stuck on the front and sent over the network. On the receiving side, these datagrams are read in and stored. If a datagram doesn't arrive, all of the datagrams associated with that transfer are simply thrown out by the client.
Most of the "reliable UDP" implementations try to maintain reliability of each datagram, but I'm only interested in the whole, and if I don't get the whole, it doesn't matter - throw it all away and wait for the next. I'd have to dig deeper, but it might be possible with custom congestion control algorithms in UDT. However, are there any protocols with this approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 ENet,虽然不是专门针对您想要做的事情,但它确实具有“碎片数据块”的概念,即您发送大于其 MTU 的数据,并且它作为带有标头详细信息的 MTU 数据报序列发送将序列的一部分与其余部分联系起来。我使用的版本仅支持“可靠”片段(即 ENet 可靠性层将启动以重新发送丢失的片段),但我似乎记得在邮件列表上看到过关于不可靠片段的讨论,这可能正是您想要的;即,如果全部有效负载全部到达,则传送整个有效负载;如果没有到达,则丢弃部分位。
请参阅 http://enet.bespin.org/
或者查看此问题的答案:< a href="https://stackoverflow.com/questions/107668/what-do-you-use-when-you-need-reliable-udp">当您需要可靠的 UDP 时,您会使用什么?
You could try ENet, whilst not specifically aimed at what you're trying to do it does have the concept of 'fragmented data blocks' whereby you send data larger than its MTU and it sends as a sequence of datagrams of its MTU with header details that relate one part of the sequence to the rest. The version I'm using only supports 'reliable' fragments (that is the ENet reliability layer will kick in to resend missing fragments) but I seem to remember seeing discussion on the mailing list about unreliable fragments which would likely to exactly what you want; i.e. deliver the whole payload if it all arrives and throw away the bits if it doesn't.
See http://enet.bespin.org/
Alternatively take a look at the answers to this question: What do you use when you need reliable UDP?