Comments (11)
Pipe is nothing but a buffer in the kernel. And with SPLICE_F_MOVE flag it moves data from socket, instead of copying it, into that buffer.
https://blog.cloudflare.com/sockmap-tcp-splicing-of-the-future/
from ipt2socks.
Works great with glibc. Great job!
But it may still need some patch when compiling with uclibc, since splice may be still too new for it.
from ipt2socks.
有编译报错的可以请请教下 @simon-on-gh (报错应该是 splice() 啥的未定义吧)。有这问题的应该都是嵌入式设备的Linux发行版
from ipt2socks.
It seems that the reference only supports TCP, though.
wongsyrone/transocks-wong#5
from ipt2socks.
http://man7.org/linux/man-pages/man2/splice.2.html
看了下文档,两个fd中必须至少有一个是pipe管道,所以没有意义。
from ipt2socks.
看起来似乎有点意思,周末在研究下
from ipt2socks.
不过看cf的那个博客,感觉sockmap更加有趣哈。UPDATE:sockmap似乎很复杂。还是splice()方便。
from ipt2socks.
Pipe is nothing but a buffer in the kernel. And with SPLICE_F_MOVE flag it moves data from socket, instead of copying it, into that buffer.
https://blog.cloudflare.com/sockmap-tcp-splicing-of-the-future/
仔细想想其实是这个道理,只不过我现在是通过用户空间的一个buffer做中转,而利用splice()的话,其实就是用一个pipe管道充当这个buffer而已。
from ipt2socks.
SPLICE_F_MOVE
Attempt to move pages instead of copying. This is only a hint
to the kernel: pages may still be copied if the kernel cannot
move the pages from the pipe, or if the pipe buffers don't
refer to full pages. The initial implementation of this flag
was buggy: therefore starting in Linux 2.6.21 it is a no-op
(but is still permitted in a splice() call); in the future, a
correct implementation may be restored.
如果真如文档所说(或许现在已实现真正的Move?),我觉得 splice() 与我现在的实现方式并无本质区别(这两种方式都存在两次 copy 操作),当然性能可能是会有差距,可能是因为内核空间复制数据更快?另外也少了几个系统调用的开销。不过,还是决定实现一个看看,究竟性能如何。
from ipt2socks.
The blog tests it with 4.14 kernel and it seems that the performance of splice() is pretty close to sockmap
from ipt2socks.
已替换为 splice() 接口。感觉还可以(在 rpi3b 上测试)。欢迎继续测试,感谢你的好建议。
from ipt2socks.
Related Issues (20)
- 请求增加fake dns功能 HOT 5
- [udp_socks5_recv_udpmessage_cb] bind tproxy reply address: Address in use HOT 8
- 谁可以分享一下 ipt2socks ipatables透明代理规则。 HOT 5
- 是否能承受高负载转发 HOT 1
- How can I forward ipt2socks TPROXY port to a subnet? HOT 2
- 建议增加dns to socks5这里的功能 HOT 3
- linux
- 请各位大佬帮我看看为什么用ipt2socks转UDP出错,xray转就没问题 HOT 5
- '-b' 参数不起作用 HOT 4
- Can't forward UDP to a sub-net with tproxy HOT 4
- 编译环境有问题 HOT 8
- 可否加入代理链的支持? HOT 1
- 能否加入 socks4 协议支持? HOT 8
- [Question] How can I forward traffic across network namespaces with ipt2socks? HOT 3
- 在speedtest.net测试单线程峰值速度更高 HOT 28
- Is "really" transparent proxy? HOT 3
- ERROR: package/feeds/helloworld/ipt2socks failed to build. HOT 4
- nftables全局代理配置寻求帮助 HOT 16
- 为什么ipt2socks需要udp 443的端口监听呢? HOT 9
- 当socks服务开在本地服务器时,则会陷入socks循环请求(iptables规则死循环) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipt2socks.