6

I'm looking for suggestions or a solution for peer-to-peer NAT traversal in .Net. Say I have a chat application and two clients need to connect but both are behind NAT:

For home scenarios, uPNP is probably ok since only a cable modem or consumer router is involved. But what about corporate environments where uPNP isn't possible?

I'm familiar with UDP hole-punching which is OK for handshaking but I'd rather not rely on it for transmitting real application data.

I also looked into IPv6 and Teredo but I'm not confident that every client would have IPv6 availability, and it's a bit confusing as to all the Teredo requirements (servers, relays, etc.)

It's 2011 and IM/Chat clients have been around for a decade and then some - so I gotta believe this issue has been resolved many times over. Can anyone recommend best practices i this area? Thanks in advance!

znelson
  • 919
  • 1
  • 10
  • 24
  • A external server for handling the NAT-T is doable to you ? – bratao Mar 19 '11 at 20:28
  • Yep - both clients have to auth with a 3rd party server so that's fine. I'm looking into TCP/IP hole punching now via multiple sockets on one port. WCF supports this out of the box so it may be a perfect solution. http://www.brynosaurus.com/pub/net/p2pnat/ Section 4.2 and http://msdn.microsoft.com/en-us/library/ms734772.aspx – znelson Mar 19 '11 at 20:49

1 Answers1

0

XMPP supports chat with NAT traversal, and there are several open-source clients for .NET. Use any XMPP server, such as OpenFire.

Yusuf X
  • 14,513
  • 5
  • 35
  • 47