最大吞吐量的UDP数据包的最佳大小是多少? [英] What is the optimal size of a UDP packet for maximum throughput?

查看:1560
本文介绍了最大吞吐量的UDP数据包的最佳大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过可能有损的网络从一个主机向另一个主机发送数据包。为了最小化数据包延迟,我不考虑TCP / IP。但是,我希望最大化吞吐量uisng UDP。

I need to send packets from one host to another over a potentially lossy network. In order to minimize packet latency, I'm not considering TCP/IP. But, I wish to maximize the throughput uisng UDP. What should be the optimal size of UDP packet to use?

这里有一些注意事项:


  • 网络中交换机的MTU大小为1500.如果我使用大数据包,例如8192,这将导致碎片。丢失一个片段将导致整个数据包的丢失,对吗?

  • The MTU size of the switches in the network is 1500. If I use a large packet, for example 8192, this will cause fragmentation. Loss of one fragment will result in the loss of the entire packet, right?

如果我使用更小的数据包, IP头

If I use smaller packets, I'll incur the overhead of the UDP and IP header

如果我使用真的大包,我可以使用的最大的是什么?我读到最大的数据报大小是65507.什么是我应该使用的缓冲区大小,以允许我发送这样的大小?

If I use a really large packet, what is the largest that I can use? I read that the largest datagram size is 65507. What is the buffer size I should use to allow me to send such sizes? Would that help to bump up my throughput?

常见操作系统支持的典型最大数据报大小是多少(例如Windows,Linux等)?

What are the typical maximum datagram size supported by the common OSes (eg. Windows, Linux, etc.)?

更新时间:

数据是未实现TCP / IP协议栈的嵌入式系统。

Some of the receivers of the data are embedded systems for which TCP/IP stack is not implemented.

我知道这个地方充满了非常关心使用可用内容的人。但我希望有更好的答案,而不仅仅关注MTU。

I know that this place is filled with people who are very adament about using what's available. But I hope to have better answers than just focusing on MTU alone.

推荐答案

替代答案:注意不要重复发明轮子。

Alternative answer: be careful to not reinvent the wheel.

TCP是几十年的网络经验的产物。有一个共鸣每一个或几乎每一个它做的事情。它有几个算法,大多数人不经常考虑(拥塞控制,重传,缓冲区管理,处理重排序数据包,等等)。

TCP is the product of decades of networking experience. There is a reson for every or almost every thing it does. It has several algorithms most people do not think about often (congestion control, retransmission, buffer management, dealing with reordered packets, and so on).

如果你开始重新实现所有TCP的算法,你可能会遇到一个问题(解释为 Greenspun的第十条规则)特别的,非正式指定,缺陷,TCP执行缓慢。

If you start reimplementing all the TCP algorithms, you risk ending up with an (paraphasing Greenspun's Tenth Rule) "ad hoc, informally-specified, bug-ridden, slow implementation of TCP".

如果你还没有这样做,最好看一些最近的替代TCP / UDP,如SCTP或DCCP。它们被设计用于没有TCP或UDP匹配的位置,准确地允许人们使用已经调试的协议,而不是为每个新应用程序重新发明轮子。

If you have not done so yet, it could be a good idea to look at some recent alternatives to TCP/UDP, like SCTP or DCCP. They were designed for niches where neither TCP nor UDP was a good match, precisely to allow people to use an already "debugged" protocol instead of reinventing the wheel for every new application.

这篇关于最大吞吐量的UDP数据包的最佳大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆