outline-server icon indicating copy to clipboard operation
outline-server copied to clipboard

Add KCP tunneling option

Open ghost opened this issue 6 years ago • 19 comments

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

ghost avatar Jun 16 '18 18:06 ghost

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.

sailosha avatar Jun 17 '18 13:06 sailosha

China Mobile's router in some area can't handle kcp properly.

Yegor Ievlev [email protected] 于 2018年6月17日周日 02:24写道:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Jigsaw-Code/outline-server/issues/177, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVHEtJ4uAxmGKXOZJGhqnxI0oB8gxsEks5t9U1NgaJpZM4Uqkad .

ghost avatar Jun 17 '18 14:06 ghost

@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 avatar Jun 17 '18 17:06 ghost

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 avatar Jun 17 '18 20:06 ghost

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

ghost avatar Jun 17 '18 20:06 ghost

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 avatar Jul 16 '18 19:07 fortuna

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: https://github.com/xtaci/kcptun/issues/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.

fortuna avatar Aug 20 '18 18:08 fortuna

@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.

arminmacx avatar Aug 20 '18 18:08 arminmacx

@arminmacx I closed https://github.com/Jigsaw-Code/outline-server/issues/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.

fortuna avatar Aug 20 '18 18:08 fortuna

@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

arminmacx avatar Aug 20 '18 19:08 arminmacx

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.

seandex avatar Sep 17 '18 15:09 seandex

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.

fortuna avatar Sep 19 '18 13:09 fortuna

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?

sailosha avatar Sep 29 '18 23:09 sailosha

@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/

fortuna avatar Oct 08 '18 22:10 fortuna

@fortuna thanks so much for the reply!

sailosha avatar Oct 08 '18 22:10 sailosha

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/

fortuna avatar Oct 26 '18 16:10 fortuna

udp tunnel socks5? @fortuna

hktalent avatar Jan 16 '19 00:01 hktalent

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

fortuna avatar Jan 31 '19 16:01 fortuna

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.

Henry586 avatar Feb 18 '22 01:02 Henry586

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

jinixx avatar Apr 20 '23 13:04 jinixx

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 avatar Apr 20 '23 14:04 fortuna