大网数据广告活动
服务器运维问答

What is TCP-over-TCP and how does OpenVPN under TCP mode avoid the issue?

· 52CE 我爱测

This article explains why TCP-over-TCP could be a performance disaster. My understanding about the issue is that the 'outer' TCP connection deals with packet loss and congestion of the network and acts accordingly by increasing t…

问题原文

原帖链接 · diwenx · CC BY-SA 4.0

This article explains why TCP-over-TCP could be a performance disaster.

My understanding about the issue is that the 'outer' TCP connection deals with packet loss and congestion of the network and acts accordingly by increasing timeouts (and thus reducing throughputs). However, the 'inner' TCP connection does not see these network conditions because they are 'fixed' by the outer TCP. And therefore, the 'inner' TCP keeps sending packets at previous speed and thus explodes the internal sending buffer of the 'outer' TCP connection.

My questions are:

  1. Is my understanding correct?
  2. It seems that the TCP-over-TCP meltdown is only internal (i.e., it only affects local buffers) but does it also affect the network as well? Does it cause more congestions in the network and does it degrade other connections on the same network?
  3. How does TCP-based VPNs solve this problem? OpenVPN has an article on this but it does not say why it is not a problem in practice (or is it?)

Many thanks for any answer!

社区高分解答

原帖链接 · ASBai · CC BY-SA 4.0

In my understanding, the "tcp meltdown" problem is not difficult to solve: you only need to set a large retransmission timeout for the inner tcp connection.

By greatly increasing the minimum retransmission timeout of the inner TCP connection, we have effectively disabled the timeout retransmission mechanism of the inner TCP. Therefore, the TCP meltdown problem is avoided.

For example, in linux, you can use ip route replace 192.168.168.1/24 via 192.168.168.2 rto_min 12s to increase the minimum retransmission timeout of all internal connections established through OpenVPN from 0.2 seconds to 12 seconds (It is assumed that 192.168.168.1/24 is your OpenVPN network segment).

You can set the above command as OpenVPN's up event callback. In this way, we have actually avoided the tcp meltdown problem in a simple way.

We use this method to optimize the tcp-over-tcp link. Even on the line with high latency (hundreds of milliseconds) and high packet loss, we have not found any adverse effects.

PS: On a line with high latency, high packet loss, and high bandwidth, it is obvious that you need to prepare a large window for the inner tcp connections to take up the full bandwidth.

UPDATE:

The question here is that why TCP-over-TCP doesn't have a noticeable effect on TCP based VPN?

Because on a high-quality line that rarely loses packets, the TCP meltdown phenomenon is not prominent.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-12-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。