Unix administration - Active FTP PORT command - port number

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2007 > Active FTP PORT command - port number





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Active FTP PORT command - port number
allab@sympatico.ca

2007-01-28, 1:27 am

Hello All,

The PORT request has a parameter in the form

h1,h2,h3,h4,p1,p2

meaning that the client is listening for connections on TCP port
p1*256+p2 at IP address h1.h2.h3.h4.

Where p1 and p2 numbers are coming from? Are there any ftp
configuration files?

Thanks,
Alona

Barry Margolin

2007-01-28, 1:18 pm

In article <1169954472.299107.148130@v33g2000cwv.googlegroups.com>,
allab@sympatico.ca wrote:

> Hello All,
>
> The PORT request has a parameter in the form
>
> h1,h2,h3,h4,p1,p2
>
> meaning that the client is listening for connections on TCP port
> p1*256+p2 at IP address h1.h2.h3.h4.
>
> Where p1 and p2 numbers are coming from? Are there any ftp
> configuration files?


The FTP server normally asks the stack to find an unused port number and
bind the socket to it. It will change from connection to connection.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
allab@sympatico.ca

2007-01-29, 1:33 am

Barry,

The question was regarding PORT command in ACTIVE FTP mode.

In active mode FTP the client connects from a random unprivileged port
(N > 1023) to the FTP server's command port, port 21. Then, the client
starts listening to port N+1 and sends the FTP command PORT N+1 to the
FTP server. The server will then connect back to the client's
specified data port from its local data port, which is port 20.

Where does the number of a random unprivileged port come from?

Thanks,
Alona

On Jan 28, 9:42 am, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <1169954472.299107.148...@v33g2000cwv.googlegroups.com>,
>
> a...@sympatico.ca wrote:
>
>
>
>
> bind the socket to it. It will change from connection to connection.
>
> --
> Barry Margolin, bar...@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com