0% found this document useful (0 votes)
27 views12 pages

File Transfer Protocol (FTP) 2020bece037

The document discusses the File Transfer Protocol (FTP) which allows copying files between hosts. It describes the client and server components, the control and data connections, and how files are transferred using various commands over these connections.

Uploaded by

Fehad Nazir 037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views12 pages

File Transfer Protocol (FTP) 2020bece037

The document discusses the File Transfer Protocol (FTP) which allows copying files between hosts. It describes the client and server components, the control and data connections, and how files are transferred using various commands over these connections.

Uploaded by

Fehad Nazir 037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

File Transfer

Protocol (FTP)
Introduction

File Transfer Protocol (FTP) is the standard protocol provided by TCP/IP for
copying a file from one host to another.

FTP solves problems of different file name conventions, data representations,


and directory structures between systems.

FTP is preferred over HTTP for transferring large files or files with different
formats.

FTP ensures efficient and reliable file transfer.


Client Server
The client has three components: the The server has two components: the
user interface, the client control server control process and the server
process, and the client data transfer data transfer process.
process.
Two Connections

The two connections in FTP are control connection and data connection.

The two connections in FTP have different lifetimes.

The control connection remains connected during the entire interactive FTP
session. The data connection is opened and then closed for each file transfer
activity

FTP uses two well-known TCP ports: port 21 is used for the control connection, and
port 20 is used for the data connection.
Conrol Connection

FTP uses NVT ASCII for control communication.

Communication is achieved through commands and responses.

This simple method is adequate for the control connection because we send one
command (or response) at a time.

Each line is terminated with a two-character (carriage return and line feed) end-
of-line token.

During this control connection, commands are sent from the client to the server
and responses are sent from the server to the client.

Commands, which are sent from the FTP client control process, are in the form of
ASCII uppercase, which may or may not be followed by an argument.
Some FTP commands
Responses

Every FTP command generates at least one response.


A response has two parts: a three-digit number followed by text.
The numeric part defines the code; the text part defines needed parameters or
further explanations

Some FTP responses


Data Connection

The data connection uses the well-known port 20 at the server site and for the client
side, it uses an ephemeral port.

The client issues a passive open using an ephemeral port. This must be done by the
client because it is the client that issues the commands for transferring files.

Using the PORT command the client sends this port number to the server.

The server receives the port number and issues an active open using the well-known
port 20 and the received ephemeral port number.
Communication over Data Connection
The client must define the type of file to be transferred, the structure of the data, and the
transmission mode.

Before sending the file through the data connection, we prepare for transmission through the
control connection.

The heterogeneity problem is resolved by defining three attributes of communication: file


type, data structure, and transmission mode.

File Type
FTP can transfer one of the following file types across the data connection: ASCII file, EBCDIC file,
or image file.

Data Structure
FTP can transfer a file across the data connection using one of the following interpretations of
the structure of the data: file structure, record structure, or page structure.
Transmission Mode

FTP can transfer a file across the data connection using one of the following three transmission
modes: stream mode, block mode, or compressed mode

File Transfer

File transfer occurs over the data connection under the control of the commands sent over the
control connection.

However, we should remember that file transfer in FTP means one of three things: retrieving a
file (server to client), storing a file (client to server), and directory listing (server to client).
FTP for retrieving a file
Security for FTP

The FTP protocol was designed when security was not a big issue.

Although FTP requires a password, the password is sent in plaintext (unencrypted),


which means it can be intercepted and used by an attacker.

The data transfer connection also transfers data in plain- text, which is insecure.

To be secure, one can add a Secure Socket Layer between the FTP application layer and
the TCP layer. In this case FTP is called SSL-FTP.

You might also like