Giter VIP home page Giter VIP logo

Comments (8)

shovon avatar shovon commented on September 27, 2024

I really hope the whole "NAT traversal" feature is not mentioned in this repo. I should have removed all mention of it a long time ago. If any occurrence of the word "NAT traversal" is still present in this repo, I will remove all of it.

UDP hole punching is how NAT traversal works with this library. But beyond that, when it comes to NAT traversal, UDP hole punching does not generally work. It will work with full-cone and I think address-restricted-cone, but beyond that, UDP hole punching is either really difficult (read, impractical), or impossible.

from node-rudp.

wilfreddenton avatar wilfreddenton commented on September 27, 2024

Thanks for the response.

You mention NAT traversal on the npm page.

No really; that above code will actually work, even if all hosts were sitting behind a NAT. Give it a try. For the heck of it, give rudp a try with a file sharing example.

From my understanding. UDP hole punching works on the majority of routers. I read this in this paper; see section 6.2. This paper also says that a rendezvous server is required for hole punching to work. You say your module uses hole punching but I don't see where I point it to a rendezvous server. Am I missing something?

from node-rudp.

shovon avatar shovon commented on September 27, 2024

This paper also says that a rendezvous server is required for hole punching to work. You say your module uses hole punching but I don't see where I point it to a rendezvous server. Am I missing something?

Yes, a rendezvous server is very helpful (if not, it's a requirement). You send a packet to the server, the server now has access to an IP address and port number. When another host asks for the address:port of the host that they want to talk to, the server will respond with said address:port, and will also record the host's address:port.

Then each client may go ahead and ping each other at the address and port that they got.

from node-rudp.

shovon avatar shovon commented on September 27, 2024

And the use of a rendezvous is not implemented in this library.

from node-rudp.

wilfreddenton avatar wilfreddenton commented on September 27, 2024

Ok so what you're saying basically is that if I wanted to use your library to connect two UDP clients behind NAT routers I would need to write/host my own rendezvous server as well as implement the hole punching algorithm on top of the library?

from node-rudp.

shovon avatar shovon commented on September 27, 2024

Yes.

from node-rudp.

wilfreddenton avatar wilfreddenton commented on September 27, 2024

Ok. Thank you for taking the time to discuss with this me. I'm trying to create a p2p chat app to learn more about p2p networking and I've slowly been putting the pieces together in my mind. This has been very helpful.

from node-rudp.

shovon avatar shovon commented on September 27, 2024

If you look at my example code, you will notice that the rudp.Client constructor expects a dgram socket as its first parameter.

I did this specifically so that this library may be able to piggy-back off of another NAT-traversal handshake library. After the handshake, it may continue communicating using the reliable UDP protocol.

from node-rudp.

Related Issues (12)

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.