Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add to emulate a TCP connection(linux)? #23

Open
linnuxx opened this issue Apr 20, 2024 · 4 comments
Open

add to emulate a TCP connection(linux)? #23

linnuxx opened this issue Apr 20, 2024 · 4 comments

Comments

@linnuxx
Copy link

linnuxx commented Apr 20, 2024

.

@cnbatch
Copy link
Owner

cnbatch commented Apr 20, 2024

If the feature only benefits Linux, then this feature will not be implemented.

Because I use kcptube too, and I'm using it on Windows and FreeBSD. TCP simulation mode can also be done on Windows and FreeBSD, but simulating TCP requires privilege mode, no matter Linux, FreeBSD or Windows. In Windows, it will cause a UAC pop-up window to appear every time it is used, which will be even more inconvenient.

On the other hand, if the UDP speed is limited, it may be due to the limitation of the VPS provider, the limitation of your home broadband service provider, or the insufficient international outgoing bandwidth of your country (if the location of your VPS is not in your country).

Chinese ISPs have different throttling modes for UDP, among which the most common is ‘port number throttling’ — the initial burst traffic can be very high, and it will be throttled after a while. The ‘port hopping’ function of KCPTube and UDPHop is designed for this throttling.

I'm not sure whether other countries' broadband service providers also throttle UDP like China does.

@cnbatch
Copy link
Owner

cnbatch commented Apr 21, 2024

‘the hosting itself does it’?
UDP speed is limited by VPS Hosting Provider? Ah, that's new to me.

May I know:

  • Which VPS Hosting Provider are you using?
  • Which speed test tool are you using?
  • Have you tried using iperf to test the speed directly without going through wireguard?

Tip: When using iperf to test UDP speed, please use the -b option to test multiple times with multiple bandwidth values, such as 10M, 100M, and 1G, to check the actual UDP bandwidth and packet loss rate.

@cnbatch
Copy link
Owner

cnbatch commented Apr 21, 2024

The speed (traffic) of TCP is higher than UDP, this is a common situation in China. We describe it as ‘ISP's QoS, TCP has higher priority than UDP’.

As previously mentioned, UDP speed can be restricted on various locations, including restrictions imposed by your local ISP or limited by the international outbound bandwidth in your region or your local ISP.

This is the reason you need to use iperf to test your network bandwidth (particularly UDP) first.
No need to do iperf speed tests inside the WireGuard tunnel yet. Just run iperf in server mode on your VPS, and run iperf in client mode on your home computer or router. And then, as I mentioned before, test the UDP speed by using -b option to test different bandwidth values and see what the resulting packet loss and speed rates are.

server side:
iperf -s -u

client side, test download speed of UDP:

iperf -c your_vps_ip_address -u -b 10M -R -t 30
iperf -c your_vps_ip_address -u -b 100M -R -t 30
iperf -c your_vps_ip_address -u -b 1000M -R -t 30

or using iperf3
server side:
iperf3 -s

client side:

iperf3 -c your_vps_ip_address -u -b 10M -R -t 30
iperf3 -c your_vps_ip_address -u -b 100M -R -t 30
iperf3 -c your_vps_ip_address -u -b 1000M -R -t 30

@cnbatch
Copy link
Owner

cnbatch commented Apr 23, 2024

The screenshot clearly shows that the actual usable bandwidth for UDP connections reaches 104 Mbps, higher than the 11.62 Mbps reported by the speedtest command. This suggests that the ‘speed limitation’ is not in ‘UDP throttling’ but more likely a configuration error.

Based on the configuration file from another Issue, it appears that the inbound_bandwidth value you set for client mode is significantly higher than 104 Mbps, which can actually reduce the transfering speed (as mentioned in #22 ). Please try to setting the client mode inbound_bandwidth to 100M.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants