FTP Protocol (File Transfer Protocol)
FTP Protocol (File Transfer Protocol)
FTP protocol (File Transfer Protocol) is, as its name indicates a protocol for transferring
files.
The implementation of FTP dates from 1971 when a file transfer system (described
in RFC141) between MIT machines (Massachusetts Institute of Technology) was
developed. Many RFC have since made improvements to the basic protocol, but the
greatest innovations date from July 1973.
The FTP protocol is currently defined by RFC 959 (File Transfer Protocol (FTP) -
Specifications).
FTP protocol defines the way in which data must be transferred over a TCP/IPnetwork.
The aim of FTP protocol is to:
FTP protocol falls within a client-server model, i.e. one machine sends orders (the
client) and the other awaits requests to carry out actions (the server).
DTP (Data Transfer Process) is the process in charge of establishing the connection
and managing the data channel. The server side DTP is calledSERVER-DTP, the client
side DTP is called USER-DTP
PI (Protocol Interpreter) interprets the protocol allowing the DTP to be controlled
using commands received over the control channel. It is different on the client and
the server:
The SERVER-PI is responsible for listening to the commands coming from a
USER-PI over the control channel on a data port, establishing the connection for
the control channel, receiving FTP commands from the USER-PI over this,
responding to them and running the SERVER-DTP.
The USER-PI is responsible for establishing the connection with the FTP server,
sending FTP commands, receiving responses from the SERVER-PI and controlling
the USER-DTP if needed.
When an FTP client is connected to a FTP server, the USER-PI initiates the connection to
the server according to the Telnet protocol. The client sends FTP commands to the
server, the server interprets them, runs its DTP, then sends a standard response. Once
the connection is established, the server-PI gives the port on which data will be sent to
the Client DTP. The client DTP then listens on the specified port for data coming from
the server.
It is important to note that since the control and data ports are separate channels, it is
possible to send commands from one machine and receive data on another. So, for
example it is possible to transfer data between FTP servers by passing through a client
to send control instructions and by transferring information between two server
processes connected on the right port.
In this configuration, the protocol imposes that the control channels remain open
throughout the data transfer. So a server can stop a transmission if the control channel
is broken during transmission.
Command Description
Command Description
This command enables the type of format in which the data will
TYPE
be sent to be specified.
Command Description
This command (RETRIEVE) asks the server DTP for a copy of the
RETR
file whose access path is given in the parameters.
This command (store) asks the server DTP to accept the data
sent over the data channel and store them in a file bearing the
STOR
name given in the parameters. If the file does not exist, the
server creates it, if not it overwrites it.
The FTP responses make it possible to ensure synchronization between the client and
FTP server. So, at each command sent by the client, the server will potentially carry out
an action and systematically send back a response.
The responses are made up of a 3 digit code indicating the way in which the command
sent by the client has been processed. However, since this 3 digit code is hard to read
for humans, it is accompanied by a text (Telnet character string separated from the
numeric code by a space).
The response codes are made up of 3 numbers the meanings of which are as follows:
The first number indicates the status of the response (success or fail)
The second number indicates what the response refers to.
The third number gives a more specific meaning (relative to each second digit)
First number
x5z File system The response relates to the remote file system
Source: http://en.kioskea.net/contents/272-ftp-protocol-file-transfer-protocol