Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ThePok on June 04, 2012, 07:23:18 PM



Title: Lets use "UDP hole punching"
Post by: ThePok on June 04, 2012, 07:23:18 PM
Hi!

Why dont we use "UDP hole punching"

"UDP hole punching is a commonly used technique employed in network address translator (NAT) applications for maintaining User Datagram Protocol (UDP) packet streams that traverse the NAT."

Its the Sytem that the old Skypeprotocol did use!

Heres the Wikiarticle: http://en.wikipedia.org/wiki/UDP_hole_punching

It could let Bidcoinnodes behind firewalls talk direcly to each other, that would result in less stress on the listeningnodes. They only had to make known cients behind firewalls to each other.

Blocks could be exchanged indepentendly!

It would create thousends of semi-listening-hosts :)


Title: Re: Lets use "UDP hole punching"
Post by: DeathAndTaxes on June 04, 2012, 07:54:24 PM
My understanding of "UDP punching" is an interm party is used to allow the two firewalled entities to communicate.

In Bitcoin that would be listening nodes.

Instead of:
Firewalled Node < -----  Listening Node

It becomes:
Firewalled Node <------ Listening Node as a relay <--------- Firewalled Node

Since the listening node already has a complete block chain it makes little sense to act as a relay and instead just provide the requested data directly.


Title: Re: Lets use "UDP hole punching"
Post by: ThePok on June 04, 2012, 07:58:49 PM
no....

read the Wikiarticle again ;)


It becomes:
Firewalled Node <---------------> Firewalled Node

Listening Node is only used for initalisation. The firewalled nodes have to know the IP of the other node, and they have to send and recive in a ~5 minit Timewindow to get the Connection going :)

Heres a better description:
http://www.brynosaurus.com/pub/net/p2pnat/


Title: Re: Lets use "UDP hole punching"
Post by: Theo on June 04, 2012, 10:14:30 PM
Bitcoin does not use UDP. It's not trivial to add a reliable UDP transport on top of a TCP-based application. Certainly possible, but usually not worth the hassle.


Title: Re: Lets use "UDP hole punching"
Post by: ThePok on June 05, 2012, 09:57:24 AM
But it would make it much harder to DOS the Bitcoinnetwork! At least it would work for some days, even without listeningnodes at all!


Title: Re: Lets use "UDP hole punching"
Post by: Matt Corallo on June 06, 2012, 11:37:31 PM
TCP hole punching does exist and works very similar to the UDP variant, so TCP isnt whats holding us back.  Its quite doable, but getting two peers to know about each other and be willing to start a connection between them in a completely decentralized fashion takes a ton of work, so no one has done it yet for bitcoin.