471,353 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Getting around NATs

Lets say I have two clients behind NAT(router) that know each others
routers global address.

I'm woundering if I set up a tcplistener (or maybe UDP scoket( on both
clients, and a tcpclient on both clients could I tunnel through to each
using the following:

1. Client A starts listening and attemps to connect to Client B's
global IP which will discarded by the firewall of B.
1. Client B also attemps to connect to A, and am I correct in assuming
that the router of client A will think the client Bs attempts to
connect is the response from the original connection attempt from A and
map the ports accordingly? Or is this a hopeless failure.

Thanks for your ideas
Carmen

Dec 15 '05 #1
5 1420
Configure both routers to allow the traffic.

--

Derek Davis
dd******@gmail.com

<cb*****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Lets say I have two clients behind NAT(router) that know each others
routers global address.

I'm woundering if I set up a tcplistener (or maybe UDP scoket( on both
clients, and a tcpclient on both clients could I tunnel through to each
using the following:

1. Client A starts listening and attemps to connect to Client B's
global IP which will discarded by the firewall of B.
1. Client B also attemps to connect to A, and am I correct in assuming
that the router of client A will think the client Bs attempts to
connect is the response from the original connection attempt from A and
map the ports accordingly? Or is this a hopeless failure.

Thanks for your ideas
Carmen

Dec 15 '05 #2
Why would you waste bandwidth with such a pointless reply. Obviously if
this was an option I would do that.

Try explaining to clients what a router is, then try and explain to
them what ports are, and then port forwarding, and then have them
troubleshoot their shitty router. . . . and on and on.

Please save your words for useful responses.

Carmen

Dec 15 '05 #3
cb*****@gmail.com wrote:
Lets say I have two clients behind NAT(router) that know each others
routers global address.

I'm woundering if I set up a tcplistener (or maybe UDP scoket( on both
clients, and a tcpclient on both clients could I tunnel through to
each using the following:

1. Client A starts listening and attemps to connect to Client B's
global IP which will discarded by the firewall of B.
1. Client B also attemps to connect to A, and am I correct in assuming
that the router of client A will think the client Bs attempts to
connect is the response from the original connection attempt from A
and map the ports accordingly? Or is this a hopeless failure.


Yeah, no. There's no way, in software, to resolve this issue.

Either you need a third server which is not behind a NAT(router) to hook the
two connections together (e.g. most IM protocols go through a third server)

Or you need to change the routing rules in the router to direct a specified
port (called port forwarding) to a specified machine behind the firewall (or
make a machine the DMZ machine, but I wouldn't do that). I've managed to
get the port fowarding to work with my firewall, and it was not hard to do.

HTH

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
Dec 15 '05 #4
LOL. Ok.

--

Derek Davis
dd******@gmail.com

<cb*****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Why would you waste bandwidth with such a pointless reply. Obviously if
this was an option I would do that.

Try explaining to clients what a router is, then try and explain to
them what ports are, and then port forwarding, and then have them
troubleshoot their shitty router. . . . and on and on.

Please save your words for useful responses.

Carmen

Dec 15 '05 #5
Hi,

cb*****@gmail.com wrote:
1. Client B also attemps to connect to A, and am I correct in assuming
that the router of client A will think the client Bs attempts to
connect is the response from the original connection attempt from A
and map the ports accordingly?
No, you are not correct in that assumption. There is a difference between
packets related to an established connection and a new connection handshake,
which even the most primitive NAT router will be able to tell.
Or is this a hopeless failure.


The scenario you suggest is, but there are options.

Most SOHO routers these days are UPnP (Universal Plug and Play) aware. The
whole point of UPnP is for applications to be able to programatically
discover things like routers and instruct them to forward the required
ports. I don't have any practical experience to offer in that area, but it
is definitely something you should research.

Another option may be to provide a server, to which both clients can then
make an outbound connection. Some instant messaging programs use that as a
last resort for file transfers.
--
Chris Priede
Dec 15 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

303 posts views Thread by mike420 | last post: by
9 posts views Thread by Wayfarer | last post: by
3 posts views Thread by Bryan | last post: by
3 posts views Thread by Mike Spertus | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.