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

Looking for some docs #8

Open
tjjh89017 opened this issue Jul 27, 2019 · 8 comments
Open

Looking for some docs #8

tjjh89017 opened this issue Jul 27, 2019 · 8 comments

Comments

@tjjh89017
Copy link

Hi,
I'm very interested in this project.
But I found less docs about the design.
Could you tell us more about this? (master branch)
Thanks a lot

@manuels
Copy link
Owner

manuels commented Jul 27, 2019

Hi @tjjh89017, I am currently working on a new version (though it's just a hobby and I do not know when it's production ready, yet).

I'm not sure what you mean by design. The software roughly works like this:

  • open a UDP socket and run STUN over the socket to determine it's public ip and port.
  • publish this public ip and port encrypted in OpenDHT.
  • lookup the other peer's public ip and port in OpenDHT.
  • try to connect to the other peer using this UDP socket.
  • open a local UDP socket and connect to the local wireguard port.
  • forward all packets between these two UDP sockets.

@tjjh89017
Copy link
Author

So wg-p2p will act as a proxy between the wg port and really port?

If you are busy, plz ignore my questions.
Thanks

@manuels
Copy link
Owner

manuels commented Jul 27, 2019

Exactly, I could not find a design where this forwarding is not required. Though I might replace it with a eBPF program one day ;)

@tjjh89017
Copy link
Author

I'm not sure
But maybe Bittorrent UDP hole punch will help?

@manuels
Copy link
Owner

manuels commented Jul 31, 2019

Not sure how this should help. I use STUN for that.

@tjjh89017
Copy link
Author

Use hole punch, we can connect wireguard without proxy
Let me think about it

@tjjh89017
Copy link
Author

@manuels
I survey a lot for this topic
I think BPF or eBPF will help this

I want to implement a similar approach using BPF or eBPF (new C++ or Golang project)
(if you don't mind)
Wireguard's example use a custom server to do the UDP hole punching. [1]
This part may be replaced with STUN or TURN server to determine the port in use or relay the UDP traffic, and use OpenDHT or Mainline DHT to store the IP and port info.

  1. BPF or eBPF for avoiding use "proxy"
  2. TURN server for symmetric NAT

and i don't think "pubkey exchange" will be necessary. (if i'm wrong, please correct me)

[1] https://github.com/WireGuard/WireGuard/tree/master/contrib/examples/nat-hole-punching

@afeiszli
Copy link

afeiszli commented Sep 9, 2020

Hi, I'm also interested in Docs. A simple readme with an example configuration would be enough. Just hard to use without any info.

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

No branches or pull requests

3 participants