hole-punch | A simple UDP-based NAT hole punching example for C | Networking library

 by   ckennelly C Version: Current License: BSL-1.0

kandi X-RAY | hole-punch Summary

kandi X-RAY | hole-punch Summary

hole-punch is a C library typically used in Networking applications. hole-punch has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

This repository contains a simple example of UDP hole punching in C. It compiles to two binaries, a server that relays client information and a simple client that ping-pongs data to and from another instance of itself. This protocol may fail when two clients are behind the same NAT and encounter a router that will not send packets to its own external IP address. This example is licensed under the Boost Software License 1.0. For more information see COPYING.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              hole-punch has a low active ecosystem.
              It has 107 star(s) with 44 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of hole-punch is current.

            kandi-Quality Quality

              hole-punch has 0 bugs and 0 code smells.

            kandi-Security Security

              hole-punch has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              hole-punch code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              hole-punch is licensed under the BSL-1.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              hole-punch releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hole-punch
            Get all kandi verified functions for this library.

            hole-punch Key Features

            No Key Features are available at this moment for hole-punch.

            hole-punch Examples and Code Snippets

            No Code Snippets are available at this moment for hole-punch.

            Community Discussions

            QUESTION

            UDP hole-punch explanation
            Asked 2022-Jan-08 at 05:10

            I'm trying to understand UDP hole punching and I just don't quite get it. In concept it seems simple but when I put it into practice I can't pull it off. From what I understand there's a public server we call the hole-punch server. A client makes a request to hole-punch server (this is public). The hole-punch server spits out a public ip and port of the client that just made the request. So long as that port is open then essentially any random client can make a request to that client using that specific port and ip ?

            The issue I guess I'm having is, the client is able to make a request to the server. The server is able to send data back to the client on that public port and ip however when another client tries to send a request to that client using that same port and ip it just doesn't go through and that's what's confusing me. If the server can make the request why can't another random client make that request?

            ...

            ANSWER

            Answered 2022-Jan-08 at 05:10

            The thing to know about UDP hole-punching is that many consumer-grade Internet routers/NAT-firewalls have a policy along the lines of "block any incoming UDP packets, except for UDP packets coming from an IP address that the user's local computer has recently sent a UDP packet to"; the idea being that if the local user is sending packets to a particular IP address, then the packets coming back from that same IP address are probably legitimate/desirable.

            So in order to get UDP packets flowing between two firewalled/NAT'd computers, you have to get each of the two computers to first send a UDP packet to the other one; which is a bit of a chicken-and-egg problem since they can't know where to send the UDP packet without being able to communicate; the public server is what solves that problem. Since that server is public, both clients can communicate with the server (via UDP or TCP or HTTP or whatever), and that server can tell each client the IP address and port to send its UDP packets to. Once each client has sent some initial packets to the other, it should also (in most cases) then be able to receive UDP packets from the other client as well, at which point the server is no longer necessary as a go-between.

            Source https://stackoverflow.com/questions/70629259

            QUESTION

            UPnP hole punching can't use external IP to access device on local subnet
            Asked 2020-Feb-10 at 05:28

            I have a somewhat unique situation where I require the ability to perform NAT hole punching for a multi node peer to peer type application; where all nodes must reference each other from publicly accessible IP addresses, even when some of those nodes might reside on the local subnet.

            I have been able to successfully map ports with help from this question (UDP hole punching implementation) using Open.Nat.

            My code is basically as simple as this:

            ...

            ANSWER

            Answered 2020-Feb-10 at 05:28

            This isn't really something you can fix, and it isn't really specific to C#. Most routers will only match NAT packets that arrive on their internet facing interface. If you want to allow for multiple nodes running behind the same NAT to connect directly to each other, you will need to implement another solution.

            For example, you could share each node's private interface addresses. Then attempt to connect directly if the public address matches.

            Source https://stackoverflow.com/questions/60096062

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install hole-punch

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/ckennelly/hole-punch.git

          • CLI

            gh repo clone ckennelly/hole-punch

          • sshUrl

            git@github.com:ckennelly/hole-punch.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Networking Libraries

            Moya

            by Moya

            diaspora

            by diaspora

            kcptun

            by xtaci

            cilium

            by cilium

            kcp

            by skywind3000

            Try Top Libraries by ckennelly

            asymmetricfs

            by ckennellyC++

            panoptes

            by ckennellyC++

            P0401

            by ckennellyHTML

            P1355

            by ckennellyHTML

            P1072

            by ckennellyHTML