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

查看:17
本文介绍了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 兆位/秒),往返延迟为 100 毫秒(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.这显然太小了,无法让您充分利用端到端带宽;一旦发送了 64kbytes (512kbits) 的数据,您的发送进程将等待接收方的窗口更新,表明一些数据已被消耗,然后再将更多数据发送到线路上.

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天全站免登陆