|
Article :
30125
Date :
04-04-2008
From :
Barry Margolin
Sujet :
Re: TCP File Transfer behind NAT
In article
<7ee48a57-143e-49b0-b4ca-e6aa5d11344f@r9g2000prd.googlegroups.com>,
Saurabh wrote:
> 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
You don't need to do anything special. The port forwarding of the
router should handle it all.
Things only get complicated if the application data includes the server
IP, because the client will expect this to be the public IP, but the
server expects it to be the private IP. This is an issue for the FTP
protocol, because private IPs are included in the PORT command and PASV
response; NAT routers have to recognize the FTP protocol specially and
rewrite these lines with the translated address.
But if you're designing a simple transfer protocol from scratch, just
make sure you don't do anything like this. As far as the socket
programming goes, NAT is transparent.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***
Posez vos questions, réponses et remarques sur
les forums de FrameIP
|