How do I use a holepuncher? (UDP Hole-punching) 01-10-2014, 04:30 AM
#1
I've just finished some proof-of-concept stuff, and thought you all might like to try it out. First, let's get some definitions out of the way(If you're good on vocabulary, skip down to the red star):
UDP - User Datagram Protocol
Some protocol, only important thing to know is that it does not use handshakes, so there is no guarantee that data was delivered, or that an request was received. It's mostly used when dropping data is preferable to being "behind" (In real time)
UDP Holepunching
One of many methods used to establish a connection to a computer that is not port forwarded
NAT - Network Address Translator
The thing in your router that decides where to send data that comes in through the modem. This is more often than not a part of the network, and not an physical piece of hardware.
When using UDP holepunching, a server that IS port forwarded is still required in order to establish connections from one peer to another. However, once the connection is created, the server does not need to be used any longer.
UDP holepunching abuses the way (most) NAT's work, by sending some data to a computer it knows is not a server, but since data was sent, the NAT will allow incoming data from the computer, on the same port.
*
Here's how it goes
1) Computer A and B are connect to the central server
2) At some point, Computer A sends a request to the central server that he wants to be connected to Computer B
3) Computer A send some data to computer B ( it shouldn't respond to the data, because it's behind a firewall)
4) The central server tells Computer B to send data to A (It won't receive the data A sent, but will send it's own)
5) The NAT allows the communication though, because Computer A had sent a message to computer B moments ago.
6)Computer A sends a second message to B (Remember that A can now receive from B, but B cannot yet receive from A. B has only sent a message)
7)If Computer B revives the second message from A, the NAT holepunch was successful, and the two computers can now communicate back and forth, without the need for a central server.
If you're familiar with how redirects work, you can think of it like the server is redirecting the two clients that want to be connected with each-other, to each-other.
Thank you for your time. Comments, questions, criticisms, ect.
P.S. I'm back-ish
UDP - User Datagram Protocol
Some protocol, only important thing to know is that it does not use handshakes, so there is no guarantee that data was delivered, or that an request was received. It's mostly used when dropping data is preferable to being "behind" (In real time)
UDP Holepunching
One of many methods used to establish a connection to a computer that is not port forwarded
NAT - Network Address Translator
The thing in your router that decides where to send data that comes in through the modem. This is more often than not a part of the network, and not an physical piece of hardware.
When using UDP holepunching, a server that IS port forwarded is still required in order to establish connections from one peer to another. However, once the connection is created, the server does not need to be used any longer.
UDP holepunching abuses the way (most) NAT's work, by sending some data to a computer it knows is not a server, but since data was sent, the NAT will allow incoming data from the computer, on the same port.
*
Here's how it goes
1) Computer A and B are connect to the central server
2) At some point, Computer A sends a request to the central server that he wants to be connected to Computer B
3) Computer A send some data to computer B ( it shouldn't respond to the data, because it's behind a firewall)
4) The central server tells Computer B to send data to A (It won't receive the data A sent, but will send it's own)
5) The NAT allows the communication though, because Computer A had sent a message to computer B moments ago.
6)Computer A sends a second message to B (Remember that A can now receive from B, but B cannot yet receive from A. B has only sent a message)
7)If Computer B revives the second message from A, the NAT holepunch was successful, and the two computers can now communicate back and forth, without the need for a central server.
If you're familiar with how redirects work, you can think of it like the server is redirecting the two clients that want to be connected with each-other, to each-other.
Thank you for your time. Comments, questions, criticisms, ect.
P.S. I'm back-ish


![[Image: jWSyE88.png]](http://i.imgur.com/jWSyE88.png)
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)