Code Monkey home page Code Monkey logo

Comments (14)

liulilittle avatar liulilittle commented on May 17, 2024

TCP转发就可以了(因为这个最麻烦),UDP的话需要你自己添加上去就可以了

from tun2socks.

dl2k avatar dl2k commented on May 17, 2024

不太擅长C++开发,所以想咨询一下。

from tun2socks.

578141611 avatar 578141611 commented on May 17, 2024

兄弟应该有看过https://github.com/ambrop72/badvpn/

这个?在看了c语言版本的,我自己也有想要实现一个C++的版本,也是考虑使用boost库实现。没想到在网上竟然找到了你的实现。
能问下你这个版本后续还有计划维护吗?想和你讨论一下一起做维护。

from tun2socks.

liulilittle avatar liulilittle commented on May 17, 2024

兄弟应该有看过https://github.com/ambrop72/badvpn/

这个?在看了c语言版本的,我自己也有想要实现一个C++的版本,也是考虑使用boost库实现。没想到在网上竟然找到了你的实现。
能问下你这个版本后续还有计划维护吗?想和你讨论一下一起做维护。

不是太考虑维护这个项目,基于 “Lwip” 协议栈的效率太差了,极限只能跑到20~30Mbps,而且由于 “Lwip” 协议栈代码限制几乎很难做到协议栈的多核优化(高并发)。。另外我已经重新设计新的工具 “适应.NET CLR 2.0/4.0 ”的 VPN自用工具(PPP);;;其原理为 “内核协议栈桥接”,物理与虚拟链路重叠的一种实现办法。

你或许可以参考这种原理思路自己做一个,TCP/Link上网效率优异,除了打游戏延迟可靠性没有传统VPN工具(Pptp、L2TP、SkylakeNAT)好~~~几乎没有太多的缺点。。。

dd: ----
Local -> V -> Local Listener -> VPN server
Local <- V <- Local Listener <- VPN server

from tun2socks.

caobug avatar caobug commented on May 17, 2024

@liulilittle 最近正在研究LWIP,遇到点小问题。。。

写入数据似乎有250ms延迟,尽管调用tcp_nagle_disable可以解决此问题,但时常出现tcp_write写入的数据不能完整发送。

具体表现为调用tcp_write写入5840 Bytes,但是只发送了一部分比如1440sent_callback打印),其余的数据不再继续发送,像是卡主了。不调用tcp_nagle_disable即便跑满100Mbps也一切正常。

日志打印没找到可用的信息,不知你有遇到此问题吗?

from tun2socks.

liulilittle avatar liulilittle commented on May 17, 2024

你要需要主动调用 tcp_output,tcp_write 只是把发送流拷贝到发送滑块窗口之中,如果不主动调用 tcp_output 函数,是无法发送出去的,

lwip 分了两种模式
1、后台线程,不需要主动调用 tcp_output ,
2、收到TCP报文,触发 tcp_output

from tun2socks.

caobug avatar caobug commented on May 17, 2024

tcp_write 和 tcp_output 这2个函数,在外部其它函数和 tcp_sent 回调中,都是依次调用的。

我不大理解,为什么tcp_nagle_disable会导致数据不继续发送,不调用此宏又一切正常。

from tun2socks.

liulilittle avatar liulilittle commented on May 17, 2024

这个只有具体看代码了,具体分析了。。LwIP也有很多发行版本,每个版本可能遇到的问题都不一样,你用最新的未必见得会遇到这个问题,但是 pcb 内存泄漏的问题,那么版本都有。

from tun2socks.

caobug avatar caobug commented on May 17, 2024

嗯,谢谢建议。我目前使用的最新版2.12,抽空降到1.4试一试。

使用Xcode和valgrind检测过,暂时还没有遇到内存泄漏和crash问题。

from tun2socks.

liulilittle avatar liulilittle commented on May 17, 2024

那挺好的,我是经常遇到内存泄漏 carsh 的问题,一切都是正常操作,然而当它的协议栈一旦工作开始跑了一会之后(流量要大),就会出现各种难以解决的:内存泄漏(严重的)、或者访问PCB/BUF堆内存被释放的问题。。

from tun2socks.

caobug avatar caobug commented on May 17, 2024

我只是粗略的测试,流量小和时间短。听你这么描述,好像是多线程引发的问题

from tun2socks.

liulilittle avatar liulilittle commented on May 17, 2024

不是多线程引起的,协议栈与逻辑处理代码都运行在同一个线程上面循环处理, LwIP 只允许一个线程R/W协议栈(多线程访问是低级错误),但是上述提到的问题还是会出现的;我太清楚你的版本会不会出现,但是我手上 1.x 的版本这个问题是经常发生的。

from tun2socks.

ikeity avatar ikeity commented on May 17, 2024

不是多线程引起的,协议栈与逻辑处理代码都运行在同一个线程上面循环处理, LwIP 只允许一个线程R/W协议栈(多线程访问是低级错误),但是上述提到的问题还是会出现的;我太清楚你的版本会不会出现,但是我手上 1.x 的版本这个问题是经常发生的。

兄弟现在base哪里,方便联系吗

from tun2socks.

dylu9988 avatar dylu9988 commented on May 17, 2024

不是多线程引起的,协议栈与逻辑处理代码都运行在同一个线程上面循环处理, LwIP 只允许一个线程R/W协议栈(多线程访问是低级错误),但是上述提到的问题还是会出现的;我太清楚你的版本会不会出现,但是我手上 1.x 的版本这个问题是经常发生的。

加个QQ联系下可以吗?

from tun2socks.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.