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 KCP tunneling option #177

Closed
ghost opened this issue Jun 16, 2018 · 21 comments
Closed

Add KCP tunneling option #177

ghost opened this issue Jun 16, 2018 · 21 comments
Labels
backlog Seems valid, but no plans to tackle immediately feature request New feature or request server

Comments

@ghost
Copy link

ghost commented Jun 16, 2018

I suggest adding an option to use KCP to encapsulate Shadowsocks traffic. This will help mobile and China users.

@sailosha
Copy link

KCPtun? It is cost more internet data usage to speed up transfer speed and lower the delay, well it is not necessary. I think we need tell new bird to use BBR to speed up first. Cuz in Asia cost of internet data transfer is not cheap. ( kcptun can boast up 5 times data usage, it gonna over cost)

I support we should give an opition to use it.

@ghost
Copy link

ghost commented Jun 17, 2018 via email

@ghost
Copy link
Author

ghost commented Jun 17, 2018

@studentmain In some countries UDP may be up to 100 Mbps and TCP is only 10 Mbps. In these cases KCP may be much faster.

@ghost
Copy link
Author

ghost commented Jun 17, 2018

On my current connection (100 Mbps advertised, Russia):
UDP: 81.1 Mbps
KCP: 58.0 Mbps
TCP (with or without BBR): 29.8 Mbps

I got these values using iperf3 and a VPS by DigitalOcean located in Frankfurt, Germany. I disabled compression and encryption and set all window sizes in kcptun to 768.

@ghost
Copy link
Author

ghost commented Jun 17, 2018

@studentmain I don't mean we should enable it by default, just let the users decide.

@fortuna
Copy link
Collaborator

fortuna commented Jul 16, 2018

Please correct me if I'm wrong, but my understanding is the KCP has a very lax bandwidth control and achieves higher bandwidth by flooding the connection. While it will get higher speed, it can hurt other connections trying to use the network.

Besides being "unfair" to other clients, it also has a cost in terms of data and battery. You end up using the network card and sending a lot more data than you need to.

@fortuna fortuna added server feature request New feature or request labels Jul 19, 2018
@trevj trevj added the backlog Seems valid, but no plans to tackle immediately label Jul 27, 2018
@fortuna
Copy link
Collaborator

fortuna commented Aug 20, 2018

More info on KCP: https://github.com/skywind3000/kcp/blob/master/README.en.md

I found this case where someone was seeing 60% of data waste with KCP: xtaci/kcptun#441

When people measure KCP bandwidth, you have to be careful to measure the effective, useful, data transferred, and not the total data transferred, since there's a lot of redundancy and retransmission. The total data transferred is not the number we care about.

@arminmacx
Copy link

@fortuna As i see you really like to close the opened discussion without getting any result so fast (like mine and this about kcp). as @YegorIevlev said it could be decided features by user to enable it on server or not. As myself which already have my own shadowsocks+kcp for months i have better performance rather than using shadowsocks alone. So instead of closing it so fast lets see what other users thinking.

@fortuna
Copy link
Collaborator

fortuna commented Aug 20, 2018

@arminmacx I closed #63 because it was a duplicate of this one, which remains open. It's better to discuss in one place, rather than spread the discussion in multiple places. I'm sorry for the confusion.

@arminmacx
Copy link

@fortuna i was oppend it before this one i guess because as i serched it i couldn't found any discussion about kcp that time

@seandex
Copy link

seandex commented Sep 17, 2018

KCPtun? It is cost more internet data usage to speed up transfer speed and lower the delay, well it is not necessary. I think we need tell new bird to use BBR to speed up first. Cuz in Asia cost of internet data transfer is not cheap. ( kcptun can boast up 5 times data usage, it gonna over cost)

I support we should give an opition to use it.

BBR makes poor network faster but not as fast as kcp.
BBR makes the fast networks slower.
BBR doesn't know about VZ networks, so getting KVMs will cost more in spec and KVM charge more on traffic,
BBR shall not be the reason for the server consideration.
BBR doesn't know how to wrap the data perfectly as kcp.

even kcp beats most of the comparison.
however, still, kcp is not the best.

there is 2 more of these control packet projects and one of them is the best at speed and reliability.

BBR literally sucks and shouldn't be as a recommendation.

@fortuna
Copy link
Collaborator

fortuna commented Sep 19, 2018

We've seen huge boosts in performance in poor networks with BBR and this is corroborated by many reports online. So saying BBR sucks is simply wrong.

One other important thing to consider is that KCP is essentially a different protocol. You need extra software in the server and the client, and you lose compatibility. BBR is a modification of TCP, and anyone using Shadowsocks over TCP can still communicate without new software.

Now that we are done with the Windows full system VPN (phew!) we will take another look into adding BBR.

@sailosha
Copy link

Especially in Asia CN2 internet cost at least 0.2USD/GB, I set up on CN2 for the faster speed(boast up to 35Mb/s). BBR is super useful for this case, reduce delay and keep cost in the same level.

btw, @fortuna is outline already full system vpn?

@fortuna
Copy link
Collaborator

fortuna commented Oct 8, 2018

@sailosha , Outline has been a full VPN since launch in every platform it supported except for Windows. We launched the full VPN on Windows in September: https://www.reddit.com/r/outlinevpn/comments/9ivvkw/september_25th_whats_new_in_outline/

@sailosha
Copy link

sailosha commented Oct 8, 2018

@fortuna thanks so much for the reply!

@fortuna
Copy link
Collaborator

fortuna commented Oct 26, 2018

FYI, we have launched BBR for new DigitalOcean installations:
https://www.reddit.com/r/outlinevpn/comments/9rl82x/october_26th_bbr_support_on_new_digitalocean/

This can't be backported easily to older installations because the host image is an older version of Ubuntu, with a kernel that doesn't support BBR. If you're advanced, you can upgrade the host kernel and enable BBR: https://www.techrepublic.com/article/how-to-enable-tcp-bbr-to-improve-network-speed-on-linux/

@hktalent
Copy link

hktalent commented Jan 16, 2019

udp tunnel socks5?
@fortuna

@fortuna
Copy link
Collaborator

fortuna commented Jan 31, 2019

@hktalent I didn't understand your question. Outline Servers relay UDP traffic.

@Henry586
Copy link

Henry586 commented Feb 18, 2022

Outline is a good shadowsocks client because it provides user friendly GUI interface and works well for iOS.
I just setup Outline with chacha20-ietf-poly1305, but it was blocked by GFW after several days .
While Shadowrocket over Kcptun is still fine after then.

@jinixx
Copy link

jinixx commented Apr 20, 2023

Hi guys, doesn't seem to have any update ever since. Is kcptun still on the road map?

@fortuna
Copy link
Collaborator

fortuna commented Apr 20, 2023

KCP tunneling is not on the roadmap.

Without a clear story for how KCP helps we won't consider it further.

Take the example of Shadowrocket over KCP. Is the reason why it's not blocked is KCP or is it that UDP is not blocked?
If we have to use UDP, there are other options to consider.

KCP also has design issues. It floods the network, that's why it gets higher speed. But put multiple KCP users in the same network and you've degraded your network.

It seems the protocol allowlist in China is no longer enabled, so Outline Shadowsocks should work fine, if it gets re-enabled, you can use TCP connection prefixes to bypass it.

@fortuna fortuna closed this as completed Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Seems valid, but no plans to tackle immediately feature request New feature or request server
Projects
None yet
Development

No branches or pull requests

8 participants