Solved

Bypass NAT Router Solution - by using a intermediate "server/service"

Posted on 2006-06-13
9
1,458 Views
Last Modified: 2008-01-09
Need some sample code or direction on how to Bypass NAT (Network Address Translation).


(Destop Application)---->NAT Router------>(Log Server)<--------(Client)

I want the "System" to work as follows:

(a)
The Desktop Application Authenticates to the Log Server, and Anounces its IP Adress when Ever it Changes with its ID.
(b)
The Log Server keeps track of the Desktop IP and ID.
(c)
Client connects Log Server and gives it an ID to Connect to, It receivec the IP Address of the Desktop Application.

In short I am not sure if this will work in practice.

What I need to do is be able to connect to the Desktop Application from the Client, even if the Desktop is behind a
NAT Router with a changing IP Address.

The internet connection can be either a Cell Phone Connection or a ADSL Line for the (Desktop Application).

Example Code would be Nice. Any Language will Do but preferably Java or Delphi.
Also need something that can withstand Load on the Billing Server, Where TCP Throughput is VERY VERY important.
"my thoughts are that the" Log server runs on Linux/FreeBsd where I can make use of an EXREMELY fast Database.










0
Comment
Question by:crestty
  • 4
  • 2
9 Comments
 
LVL 8

Accepted Solution

by:
colr__ earned 250 total points
ID: 16894753
You cannot bypass NAT, it is a network infrastructure in place mostly  for security reasons.

As long as your are plugged nto the router, and the router is configured to use NAT, then this is not bypassable.

colr__
0
 
LVL 8

Expert Comment

by:colr__
ID: 16894817
Since the router maps NAT addresses to local addresses, there isnt any way to go through the NAT with a public IP address - the only IP address that exists for each machine is a local domain address.

The only way round this would be to add a router table entry that maps a public IP address to a specific local machine, but a seperate public IP address and router entry would be required for each machine, essentially making this unmanageable.
0
 

Author Comment

by:crestty
ID: 16894962
mmm.


I must disagree,  for Peer to Peer applications Bypass NAT Routers.

Then I do not want to make use of peer 2 peer, I want to use the Log Server as a GATEWAY that knows the Destination.
But I guess this would mean that the Desktop would always keep a connection open to the LOG SERVER or else the NAT
Server will TimeOut the "Nat Structure" on the Router.

I am just guessing here. But surely it can be done.

If the Desktop connects to the Log Server via the NAT router: and keeps a structure similar to that of the NAT Router, would it not be possible to
communicate to the Desktop via the Log Server, if the Log Server knows the NAT structure.

I assume the Nat structure looks similar to this.

 Source IP : The Desktop IP
 Source PORT : The Desktop Port
 Dest IP : the Log Server IP
 Dest Port : the Log Server Listening Port
 NAT Port : The New Source Port/Fake, actual Open Port on the NAS Router.
 NAT IP: The Ip Address of the NAT Router.

Can one not then Establish a connection to the Desktop from the client if that structure is known via the Log Server?


0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 8

Expert Comment

by:colr__
ID: 16895059
I dont think so, although you might want to post a similar question in the networking forum - youll probably get a better answer there.

colr__
0
 

Author Comment

by:crestty
ID: 16895089
Thankx, for the answer though, debate is hard via a Forum, lol. , it is not my intenention though.
0
 
LVL 8

Expert Comment

by:colr__
ID: 16895106
Not probs, a bit of debate never hurt anyone!

;-)
0
 
LVL 3

Assisted Solution

by:stimpyjcat
stimpyjcat earned 250 total points
ID: 16954163
The way to "bypass" NAT is to have a server which is reachable by both parties negotiate connections on behalf of both of them.  Let A, B be peers and C be the reachable server.  

A connects to C.
B connects to C.

A requests a connection to B (the problem of A knowing about B is a separate issue).
C uses its existing connection to B to request another channel.
B connects again to C (or multiplexes its existing channel).
C connects the channel on which A's connection request arrived to the new channel from B.
A and B can now talk to each other.

The networking complexity is increased because you now have 4 points of failure (A, B, C, and NAT) rather than just two (A, B).

It's generally not possible with NAT to have an entity outside the NAT make a direct connection to an entity within the NAT.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
custom annotations 9 39
object oriented programming comparison 5 72
fibonacci ten numbers 4 39
difference between sorce folder and folder in eclipise 3 13
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question