Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCP NAT traversal

Status
Not open for further replies.

ueberbill

Programmer
Aug 22, 2000
21
US
We have a (basically P2P) application that uses TCP and we're trying to get it to work when one or both of the machines are behind a NAT box. I've read a lot of literature on how to get UDP through NAT's but they all say that TCP is hard to get working without using a relay for all of the traffic. Does anyone have any experience traversing NAT's with TCP? Is there literature (or, dare I hope, code) out there?

Thanks,
Bill
 
Are you writing the app, or just using it?

NAT traversal is a problem, but the millions of Kazaa, eDoneky network client, and instant messenger clients show it is not insurmountable.


You can either:

. uPnP enable the application, or make entries to open the ports through the uPnP client for the gateway;

. Use the router's ability to forward ports to specific LAN-side IPs.


The first would allow an applicaton to open the necessary port forwards automaticly; the latter would require user intervention.

 
We are actually writing the app and we're looking for a way to make it work with all kinds of NAT configurations without having to communicate with any routing/NAT hardware.
UPnP does look pretty cool, I have one question-
Does it work now? I looked at the UPnP.org site and it didn't seem to say whether or not I could write a UPnP-enabled app and have it work right now.

The problem is we're trying to avoid requiring any special firewall hardware and it looks like we'd have to have a UPnP enabled NAT box if we were going to use UPnP (unless, and it's happened before, I am wrong).

We're basically trying to allow two clients to connect to each other when/if they are behind NAT boxes. We're pretty early in the brainstorming phase, but ideas we've had include:
-Using UDP to tunnel through (as there are myriad methods for making UDP connections through NAT which don't work well for TCP)
-Using a relay (obviously not a great solution as it would be a big slow mess under load)

There are others but I can't seem to locate my notes. How do those lucky Kazaa, eDonkey, and AIM users surmount the NAT TCP problem?

Thanks for your help,
Bill

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top