Re: UDP Hole Punching Demo
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Sat, 16 Sep 2006 00:24:28 -0700
"Hans Peter Gerdes" <noemail@xxxxxxxxxx> wrote in message
news:OfadcZV2GHA.328@xxxxxxxxxxxxxxxxxxxxxxx
Pete,
thanks for answer.
I searching for a sample source, because i am not a Socket and NAT
specialist, but i can read a lot out of the source. ;-)
Not that this is .NET specific (so this is pretty off-topic here), but here
are some resources that you may find helpful.
Winsock FAQ (.NET sockets are basically just Winsock with .NET wrapper):
http://tangentsoft.net/wskfaq/
Also, the FAQ covers a variety of basic UDP techniques with samples.
A paper that was recently presented on the topic:
http://www.usenix.org/events/usenix05/tech/general/full_papers/ford/ford_html/index.html
Note: the basic idea behind hole punching is simple...two peers both contact
a common third-party, who then provides destination information to each
peer. The peers then attempt to contact each other...in most cases, as long
as they use the same IP address and port that the common third-party was
using for each, the NAT router will route the UDP datagrams appropriately.
Wikipedia even has an article on the topic:
http://en.wikipedia.org/wiki/UDP_hole_punching
Of course, MSDN has some sample code with respect to use of UDP sockets in
..NET. But UDP sockets are pretty straight-forward. Make a datagram and a
Socket to send with, use SendTo to send it to a particular address (IP and
port), and use ReceiveFrom to receive a datagram from someone else.
One final comment: IMHO, hole-punching is not a very good technique to rely
on. There is talk of creating a standard that NAT routers can follow, but
IMHO the existing standard of Universal Plug-and-Play addresses these issues
reasonably well without relying on undefined behavior from the NAT router
(and I'd guess that at least as many NAT routers implement UPnP as can be
relied upon to support hole-punching).
Pete
.
- Follow-Ups:
- Re: UDP Hole Punching Demo
- From: Hans Peter Gerdes
- Re: UDP Hole Punching Demo
- References:
- UDP Hole Punching Demo
- From: Hans Peter Gerdes
- Re: UDP Hole Punching Demo
- From: Peter Duniho
- Re: UDP Hole Punching Demo
- From: Hans Peter Gerdes
- UDP Hole Punching Demo
- Prev by Date: Re: UDP Hole Punching Demo
- Next by Date: Re: listing computer names on network?
- Previous by thread: Re: UDP Hole Punching Demo
- Next by thread: Re: UDP Hole Punching Demo
- Index(es):
Relevant Pages
|