路径MTU发现 [英] Path MTU Discovery

查看:298
本文介绍了路径MTU发现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发,其处理(视频处理等),并发送大文件(高达数十GB)通过网络的应用程序。我使用FTP发送文件。为了提高应用程序的性能/内存消耗,我想优化的缓冲,使我不发送数据包,这是太大,并得到分散。我的问题是,我没有多的内存来保存文件数据的同时发送。基本上,我读刚够个字节的磁盘,进程,并立即发送到目的地。目前,我希望实施MTU路径发现。

I am developing an application which processes (video processing, etc) and sends large files (up to tens of gigabytes) over a network. I am sending the files using FTP. To improve the performance/memory consumption of the application, I would like optimize the buffers so that i dont send packets which are too large and get fragmented. The problem i have is that i dont have much RAM to hold the file data whilst sending. Basically, i read just enough bytes from disk, process it and immediately send to the destination. Currently i am looking to implement MTU path discovery.

我熟悉如何做到这一点的基本概念。我想知道是否有Windows中的任何.NET API,它跟踪的MTU到一个目的地是哪里?

I am familiar with the basic concept of how to do it. I would like to know if there is any .NET API in windows which keeps track of the MTU to a destination ?

我猜有没有这样的事,但我的一个朋友告诉我的Windows Vista跟踪。

I am guessing there is no such thing, but a friend of mine told me windows vista keeps track.

我开发这个应用程序适用于Windows XP,但我想了解是否有是Windows这样的网络跟踪API。

I am developing this application for windows XP, but i would like to learn if there is such a network tracking API in windows.

推荐答案

的Winsock并不支持报告所发现的MTU,即使其他的TCP / IP协议栈(通过套接字选项IP_GETPMTU如AIX)做的。由于winsock的不能报告,.NET不能提供一个API(这必须是Winsock的顶部)。

winsock doesn't support reporting the discovered MTU, even though other TCP/IP stacks do (e.g. AIX through a socket option IP_GETPMTU). As winsock cannot report that, .NET can't provide an API (which would have to be on top of winsock).

我建议在64kiB大块发送数据。这是最大的IP包大小,并有可能大于MTU,因此堆栈会送几个全段。最后一个片段可能较小,但随后,该系统可能会延迟发送它(因为它仍然需要接收确认的以前的数据),因此,如果您快速跟进下一个发送64kiB,系统将再次结合块成使用路径MTU的数据包。

I recommend sending data in chunks of 64kiB. This is the maximum IP packet size, and likely larger than the MTU, so the stack will send several full segments. The last fragment may be smaller, but then, the system may delay sending it (because it still needs to receive acknowledges for earlier data), so if you follow up quickly with the next send of 64kiB, the system will combine the chunks again into packets using the path mtu.

这篇关于路径MTU发现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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