TCP是否可以通过多个连接实现更高的传输速率? [英] TCP is it possible to achieve higher transfer rate with multiple connections?

查看:419
本文介绍了TCP是否可以通过多个连接实现更高的传输速率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在高延迟环境中使用多个并行TCP连接来实现更好的数据传输速率(公共互联网的地理距离较大,假设每个连接或诸如此类的东西都没有流量整形),或者TCP可以利用单个带宽来利用整个带宽连接吗?

Is it possible to achieve better data transfer rate with multiple parallel TCP connections in high-latency environment (public internet with large geographical distance assuming no traffic shaping per connection or stuff like that) or can TCP utilize the whole bandwidth with a single connection?

如果接收器未报告窗口大小为0的缓冲区拥塞,TCP是否会以最快的速度发送数据?因此,例如RTT大约是60秒,那么它根本不会影响速率吗?是否有一些最大窗口大小或其他限制速率的信息?

Is TCP sending data as fast as it cans if receiver doesn't report buffer congestion with 0 windows size? So if RTT is for example like 60 seconds it doesn't affect the rate at all? Is there some maximum window size or something else limiting the rate?

推荐答案

多个并发连接的一个优点可能(根据dove和Brian提到的警告)可以使您更好地克服了TCP接收窗口太小的问题.

One advantage multiple concurrent connections may give you (subject to the same caveats mentioned by dove and Brian) is you will be able to better overcome the problem of having too small a TCP receive window.

与此相关的原理是带宽延迟积. (在此处有更详细的说明).

The principle this relates to is bandwidth delay product. (There's a more detailed explanation here).

简短摘要:在高延迟,高带宽的环境中,TCP等可靠的通信通常受到在任何给定时间飞行中的数据量的限制.解决此问题的一种方法是使用多个连接,因为带宽延迟乘积分别应用于每个连接.

A brief summary: in high-latency, high-bandwidth environments, reliable communications such as TCP are often limited by the amount of data in flight at any given time. Multiple connections are one way around this, as the bandwidth delay product applies to each connection individually.

更详细地,请考虑以下内容:端到端带宽为每秒10 ^ 8位(10兆位/秒),往返延迟为100ms(0.1秒).因此,在对第一位数据的确认返回给发送方之前,最多可以发送10 ^ 7位(10兆位=〜1.25兆字节)的数据.

In more detail, consider the following: you have an end-to-end bandwidth of 10^8 bits per second (10 megabits/second), and a round-trip delay of 100ms (0.1 seconds). Therefore, there can be up to 10^7 bits (10 megabits = ~1.25 megabytes) of data sent before the acknowledgment of the first bit of data has gotten back to the sender.

这将取决于您操作系统的TCP堆栈,但是TCP接收窗口大小的常见值是64 KB.显然,这太小了,无法让您充分利用端到端带宽.一旦发送了64kB(512kbit)的数据,您的发送过程将等待接收方进行窗口更新,指示已消耗一些数据,然后再将更多数据放入网络.

This will vary depending on the TCP stack of your OS, but a not-uncommon value for TCP receive window size is 64Kbytes. This is obviously far too small to allow you to make full use of the end to end bandwidth; once 64kbytes (512kbits) of data have been sent, your sending process will wait for a window update from the receiver indicating that some data has been consumed before putting any more data on the wire.

由于每个TCP会话都有自己的发送/接收缓冲区,因此可以打开多个TCP会话.

Having multiple TCP sessions open gets around this by virtue of the fact that each TCP session will have its own send/receive buffers.

当然,由于TCP窗口大小,争用等原因,在Internet上很难确定真正的可用端到端带宽.如果您能够提供一些示例数据,我们也许可以为您提供帮助更多.

Of course, on the internet it's difficult to determine the true available end-to-end bandwidth, due to TCP window size, contention, etc. If you're able to provide some sample figures, we may be able to assist more.

您应该考虑的另一种选择是在创建套接字时设置一个较大的接收窗口,可以使用操作系统设置全局设置,也可以使用套接字选项在每个套接字的基础上设置.

The other option you should look into is setting a larger receive window when you create your socket, either globally using an OS setting, or on a per socket basis using socket options.

这篇关于TCP是否可以通过多个连接实现更高的传输速率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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