Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCP File Transfer behind NAT

0 views
Skip to first unread message

Saurabh

unread,
Apr 3, 2008, 6:14:02 AM4/3/08
to
Dear All,

Can anyone tell me, how to write such a program that can transfer
files (either binary or text) behind NAT devices( such as for
computers behind firewalls and routers and other NAT devices) using
TCP socket programming.

I have a mechanism through which the public IP of the router and Port
number will be forwarded to me. But after that I am not sure that
simple TCP/IP socket programming will suffice or I need to do
something more for that.

If you have any article link or article or any example that shows how
the File Transfer can be done for such a case then please help me
regarding this.

Any sought of help or idea will be appreciated from you all.

from-
Saurabh Srivastava

Nathan Mates

unread,
Apr 3, 2008, 12:37:01 PM4/3/08
to
In article <d5caf205-74db-4daf...@d21g2000prf.googlegroups.com>,

Saurabh <sends...@gmail.com> wrote:
>Can anyone tell me, how to write such a program that can transfer
>files (either binary or text) behind NAT devices( such as for
>computers behind firewalls and routers and other NAT devices) using
>TCP socket programming.

What you're asking for is *tough*. NAT devices and other firewalls
are designed to drop packets that are spontaneously received from the
outside. Only if an outgoing connection is established is return
traffic allowed. So, by design, things will reject what you want to
do.

There are some ways to work around this feature. Skype, in
particular, has a lot of ways to punch thru firewalls, most of which
aren't explained anywhere. There are things like
http://blog.pjsip.org/2007/04/06/introducing-pjnath-open-source-ice-stun-and-turn/
which explain a little more. There may be some open source things
that can help, but don't expect perfection.

Nathan Mates

--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein

0 new messages