Giter Club home page Giter Club logo

conn-p2p's Introduction

Hole Punching & NAT Traversal

An implementation of a UDP Hole Punching which uses synchronization techniques like the ones used in DCUtR.

Usage

This is just and experimental project to learn more about p2p, hole-punching & NAT Traversal.

Running the project (WIP)

Usage of ./main:
  -c	         node as client(c)
  -p string      port for local addr (default ":1111")
  -rAddr string  relay address (default ":5173")
  -s	         node as server(s)

Running Node Client

go run ./cmd/ -c -p :[CLIENT_PORT] -rAddr [RELAY_IP]:[RELAY_PORT]

Running Relay Server

go run ./cmd/ -s -p :[PORT]

conn-p2p's People

Contributors

orangeseeds avatar

Watchers

 avatar

conn-p2p's Issues

Implement NAT Traversal for symmetic NAT

The initial handshake to exchange information works nicely, but after getting the public IP and ports, when the peers try to fire a packet to one another the packet was seemingly going nowhere.

I completely missed the fact that on giving the packet a new address(the remote peer address rather than the relay address) a new binding was created in the NAT even when sending the packet from the same port. So the problem was both the peers were sending packets to ports which were being used for the relay connection and thus due to symmetric NAT and not matching the remote address in the connection the packets were essentially getting discarded on the side of the receiver.

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.