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

Please add udp transparent packages such as dns udp packages #917

Open
peterwillcn opened this issue Apr 8, 2023 · 18 comments
Open

Please add udp transparent packages such as dns udp packages #917

peterwillcn opened this issue Apr 8, 2023 · 18 comments
Labels

Comments

@peterwillcn
Copy link

peterwillcn commented Apr 8, 2023

Default packaging TCP ->kcp (udp) ->TCP

  • 1 Add udp ->kcp (udp) ->udp
@aguegu
Copy link

aguegu commented Apr 9, 2023

It would be great to have.

otherwise the walk around would look like udp -> udptunnel(tcp) -> kcp(udp) -> udptunnel(tcp) -> udp

@xtaci
Copy link
Owner

xtaci commented Apr 9, 2023

to bind a single UDP port on client side to external server port via server?

@xtaci
Copy link
Owner

xtaci commented Apr 9, 2023

It seems this feature is not useful if we can only do remote port forwarding on a SINGLE port

@xtaci
Copy link
Owner

xtaci commented Apr 9, 2023

An ideal solution is to create tun devices between client and server, by manipulation of iptables, all UDP packets could be carried to remote server, and then the remote server could initates connection pairs to any endpoints and then forward back packets.

@aguegu
Copy link

aguegu commented Apr 10, 2023

kcptun with multi-port support is quite powerful. But wireguard does not have this feature yet.

@xtaci
Copy link
Owner

xtaci commented Apr 10, 2023

The question is , How users will use this UDP port forward feature.
All I know iss that, for me ,single port forwarding is not useful.

@aguegu
Copy link

aguegu commented Apr 10, 2023

wireguard does not tunnel over TCP

To build an Wireguard virtual lan, in the endpoint configuration, it is usually set to an public ip with an UDP port, on which the remote wireguard listen to.

But I notices that a static UDP port configured got to be blocked (by you know what) after a few hours. Then I would have to change the configuration. So I think it would be great if I could empower wireguard with kcptun and its port range feature.

@xtaci xtaci pinned this issue Apr 13, 2023
@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

https://www.jianshu.com/p/55c0259d1a36

https://develop.socks-proto.cpp.al/socks/protocol/requests_and_replies/udp_associate.html

https://ph4ntonn.github.io/Socks5-UDP

A possible solution is UDP Associate

maybe ss-libev(UDP) -> client(UDP) -> KCP packets -> server(UDP) -> ss-libev(UDP) -> UDP packets is feasible.

@xtaci xtaci added the UDP label Apr 13, 2023
@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

So, do you guys think supporting carrying packets of "single port UDP Associate" could satisfy the requirements?

@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

that seems solved the problem, an external UDP to TCP protocol conversion seems simple and elegant. One only have to start another kcp instance pair.

@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

The issue is compatibility, I have to implement a special smux stream inside kcp channel, this smux stream could be identified by kcp server easily, such as inserting a magic number of 16 Bytes at the beginning of the stream. Meanwhile, on the kcp server side, this magic stream must be identified by the program to be treated as UDP forwarding packets streams.

And the changes above is not compatible with previous versions.

@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

By adding an extra parameter -enableUDP is sufficient, program can bind UDP+TCP on the same port.

But the development needs some time, I can only work on this feature when I'm free.

But suggestions are appreciated.

@xtaci
Copy link
Owner

xtaci commented Apr 13, 2023

If someone willing to implement a Proof of Concept UDP stream, I'm willing to participate.

@kokrange
Copy link

that seems solved the problem, an external UDP to TCP protocol conversion seems simple and elegant. One only have to start another kcp instance pair.

Which udp to tcp conversion tool do you suggest? I have tried udp2raw and datagramTunneler, but both don't seem to work on kcptun tcp-over-udp tunneling.

@xtaci xtaci unpinned this issue Jun 24, 2023
@omaidb
Copy link

omaidb commented Jun 30, 2023

kcptun 具有多端口支持,功能相当强大。但wireguard还没有这个功能。

多端口支持,请给一个json配置文件的示例

@omaidb
Copy link

omaidb commented Jun 30, 2023

By adding an extra parameter -enableUDP is sufficient, program can bind UDP+TCP on the same port.

But the development needs some time, I can only work on this feature when I'm free.

But suggestions are appreciated.

期待这个功能。

@omaidb
Copy link

omaidb commented Jul 10, 2023

如果有人愿意实施概念验证 UDP 流,我愿意参与。

我尽可能的来参与验证这个功能

@cnbatch
Copy link

cnbatch commented Jul 12, 2023

我用原版KCP试了下,转发UDP完全没问题,高流量时速率十分稳定,流量曲线比TCP更加平滑。
同一条KCP通道混合传输TCP与UDP做起来很麻烦(我觉得麻烦,其他人应该有简便高效的办法),分开通道效果最好。

只不过我是用C++做的,并且写得版面混乱,冗余代码一堆,对于Golang项目而言可能没什么帮助。
如果确实想看代码,可以来我的用户主页进入相应仓库。

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

No branches or pull requests

6 participants