HP-UX IPFilter Version A.03.05.14 Administrator's Guide

HP-UX IPFilter and FTP
FTP Basics
Chapter 7 115
FTP Basics
The File Transfer Protocol (FTP) is a user-level protocol for transferring
files between host computers.
An FTP session involves two separate connections:
Control connection
1. The server listens for client connections on port 21.
2. The client opens a connection to the server port 21 on a client
port above 1023.
3. The client uses this connection to send commands to, and receive
replies from, the server.
This connection lasts through the FTP session.
Data connection
The data connection is used for transferring data between the client
and server. A new data connection is opened for each FTP command.
The way the data connection is created depends on the type of FTP
session—active or passive.
In active FTP, the client actively opens a connection to the FTP server at
port 21. It uses a port number > 1023 as its port for the control
connection. The client then opens a new port (passive open) as its data
port and sends this port number across to the server using the PORT
command. The server then opens a data connection (active open) to the
data port specified in the PORT command of the client. The server uses
port 20 as its data connection port.
In passive FTP, the control connection is established the same as it is in
active FTP. In passive FTP, to establish a data connection the server
opens an arbitrary data port >1023. It uses the PASV command to send
the data port number to the client. The client connects to the port
specified by the PASV command and uses a different port >1023 as its
data port.