surban / aggligator

Aggregates multiple links (TCP, Bluetooth, USB or similar) into one connection having their combined bandwidth and provides resiliency against failure of individual links.
https://crates.io/crates/aggligator
Other
129 stars 8 forks source link

need help to port aggligator to golang #1

Closed uoosef closed 11 months ago

uoosef commented 1 year ago

hi,

I am from Iran, and we are suffering from heavy filtering and slow internet speed.

Your awesome project can help us circumvent these restrictions. I'm currently working on a new proxy in Golang, and I want to use your project for "muxing," or multiplexing, my proxy packets between client and server in order to achieve higher speed and a more resilient network connection. Can you help us port your project to Golang?

surban commented 1 year ago

Hello,

I greatly appreciate your reaching out and acknowledge the significant effort you're putting into your project. I understand the challenges you're facing and I'm glad that you find my project valuable for your situation.

Regrettably, I don't have the necessary experience with Golang to assist in porting the project directly. However, there are a couple of potential routes you might consider.

One possibility is to build a C API for Aggligator, which can then be interfaced with your Golang project using FFI. This could provide a practical bridge between the two languages, allowing you to leverage Aggligator in your current project. You would still need to write a bit of Rust code, but the effort seems manageable.

Alternatively, you might consider porting your proxy to Rust. Rust, being a more advanced and robust language than Go, could potentially offer you more flexibility and efficiency. Additionally, I'm well-versed in Rust and could provide more effective assistance and advice if you chose this route.

However, the choice ultimately lies with you and depends on your personal preference and proficiency with these languages. Both approaches have their merits.

I wish you all the best with your project, and please don't hesitate to reach out if you have further questions!

surban commented 1 year ago

As a very basic solution: Have you already tried using the agg-tunnel utility from aggligator-util ?

uoosef commented 1 year ago

Hello,

Thank you for your response. Even though it is feasible to use FFI to use Rust code in Golang, it isn't a good solution for my project because a simple TCP connection can't bypass DPI and some special tweaks are needed. For example, it's crucial that in a TLS connection, we forge TLS client hello and SNI, or sometimes it's needed to change the TCP window manually or use a fake TCP ACK or NACK in a connection to bypass the dpi system. Also, many experienced tunnel and anti-dpi developers are developing their solutions in Golang, so if I want to use their code in my project or vice versa, it won't be as simple when I write the whole thing in Golang. therefor I am learning Rust, reading your code, and trying to implement something inspired by your work as the project link aggregator.

Another question:

Can you briefly explain or document how your program works, and what is the algorithm or the main idea behind this system you developed, please?

surban commented 1 year ago

Currently writing detailed design documents is out of question due to time constraints.

However, the main idea is to perform credit-based flow control over each link while dynamically updating the maximum number of outstanding (unacknowledged) bytes for each link. Many approaches are possible here and the best solution depends on the exact characteristics of the network. You can gain some background information by searching for papers and articles on MPTCP window scaling.