KCP Tube Wiki in English Version - cnbatch/kcptube GitHub Wiki
Basic Introduction
Anyone who has used home broadband from the three major telecom operators in China and needs to connect to other home networks will almost always experience UDP speed restrictions. In order to avoid the QoS targeting UDP by the three major telecom operators, I have developed a tool, named UDP Hop。The principle of this tool is to regularly change the port number.
However, UDP Hop can only forwards UDP traffic. In order to forward TCP traffic using UDP, KCP Tube is developed. The reliable retransmission of KCP ensures that the forwarded TCP packets will not be lost.
Another reason why I developed KCP Tube is that other KCP forwarding tools can only forward TCP traffic, but I need to forward UDP traffic as well. This is mainly for the convenience of playing games.
Of course, in fact, both udphop and kcptube were conceived at the same time. So for convenience, KCP Tube was first developed with a framework, and then trimmed into udphop based on KCP Tube. Then the patch code of udphop was merged back into KCP Tube in reverse.
In order to facilitate the use of Full Cone NAT users, when KCP Tube runs in server basic mode, it can use STUN to punch holes, and supports both IPv4 and IPv6.
Just like the purpose of KCP itself, the main goal of KCP Tube is to reduce latency, rather than focusing on transmitting large amounts of data. Can it transmit large amounts of data? Yes, but the effect may not be better than existing TCP forwarding tools.
Multiplexing
The function of multiplexing is not automatically enabled by default. For each incoming connection accepted, a corresponding outgoing connection is created.
The reason is to avoid the QoS of operators. Once a port number is affected by QoS in multiplexing mode, other sessions sharing the same port number will also be blocked until the port number is changed.
The connections are independent of each other. Even if a port number is affected by QoS, only this session will be affected, not other sessions.
Unless the carried program generates many independent connections. In this case, KCP Tube will create many KCP channels and consume more CPU resources during communication.
If you really need to use the ‘multiplexing’ function, you can refer to the following classifications:
-
Scenarios suitable for using multiplexing:
- Proxy forwarding programs, such as Shadowsocks
-
Scenarios that do not require using multiplexing:
- VPN, such as
- OpenVPN
- Wireguard
- VPN, such as
The timeout period for KCP channel is 30 seconds after enabling the multiplexing function.
Supported Modes
Currently 3 modes are supported:
- Client Mode
- Servers Mode
- Relay Mode
Usage
Command
kcptube config.conf
or
kcptube config1.conf config2.conf
If there are multiple files, you can then add them.
Examples of Client and Server Mode
Please refer General Configuration introduction page
Example of Realy Mode
Please refer Relay Mode Configuration introduction page
Parameters
Please refer parameter list