File Transfer Protocol
File Transfer Protocol
• FTP (File Transfer Protocol) is the simplest and
most secure way to exchange files over the
Internet.
• Transferring files from a client computer to a server
computer is called "uploading" and transferring from
a server to a client is "downloading".
• To access an FTP server, users must be able to
connect to the Internet or an intranet (via a modem
or local area network) with an FTP client program.
File Transfer Protocol
• FTP doesn’t not really move, it copies files
from one computer to another
• FTP is the file transfer protocol in the
Internet's TCP/IP protocol suite’s Application
Layer.
File Transfer Protocol
• An FTP Client is software that is designed to move
files back-and-forth between two computers over
the Internet.
• It needs to be installed on your computer and can
only be used with a live connection to the
Internet.
FTP Clients
• There are many FTP client programs, some of
which are run from a command-line (such as
the command ftp, a standard installed in many
operating systems), but a large majority allow
the user to manipulate files via a graphical
interface (such as CuteFTP), which makes file
transfers more user-friendly.
History
• The completion 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/changes to the basic protocol, but
the greatest innovation date from July 1973.
• The FTP protocol is currently defined by RFC 959
(File Transfer Protocol (FTP) - Specifications).
Feature
s
• FTP operates in a client/server
environment, meaning that the remote
machine is configured as a server, and
consequently waits for the other
machine(client) to request a service from it.
• In UNIX, the service is provided by what is
called a daemon, a small task that runs in the
background. The FTP daemon is called ftpd.
Feature
s
• The FTP protocol is used for transferring one file
at a time, in either direction, between the client
machine (the one which initiated the
connection, i.e. the calling machine) and the
server machine (which provided the FTP
service, i.e. the called machine).
• The FTP protocol can also perform other
actions, such as creating and deleting directories
(only if they are empty), listing files, deleting and
renaming files, etc.
Feature
s
• FTP allows files to have ownership and access
restrictions
• FTP hides the details of individual computer
systems
Example
• downloading MP3.
• Online games rely heavily on FTP.
• Other events like auctions and online trading
use FTP to transact business
• FTP is commonly used to transfer Web page
files from their creator to the computer that
acts as their server for everyone on the
Internet.
Differences between FTP and HTTP
• The major difference between FTP and HTTP is
that FTP is a two-way system - FTP can be used to
copy or move files from a server to a client
computer as well as upload or transfer files from
a client to a server.
• HTTP, on the other hand, is strictly one-way:
"transferring" text, pictures and other
data(Multimedia files) from the "server"
to a client computer which uses a web
browser to view the data.
Differences between FTP and HTTP
• FTP systems generally encode and transmit their
data in binary sets which allow for faster data
transfer; HTTP systems encode their data in
MIME format which is larger and more complex.
• Files are automatically copied or moved from a
file server to a client computer's hard drive, and
vice versa. On the other hand, files in an HTTP
transfer are viewed and can 'disappear' when the
browser is turned off unless the user executes
commands to move the data to the computer's
memory.
The FTP model
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).
During an FTP connection, two transmission
channels are open:
• A channel for commands (control channel) , a
control channel that stays open for the entire
session
• A channel for data , data channel that opens and
closes to transfer data such as folder listings and
files to or from the server as requested by the
client.
The FTP model
Control Channel occurs on port 21
The FTP model
So, both the client and server have two processes
allowing these two types of information to be
managed:
• DTP (Data Transfer Process) It establishes the
connection and managing the data channel. The
server side DTP is called SERVER-DTP, the client side
DTP is called USER-DTP
• PI (Protocol Interpreter) Controls DTP using
commands received over the control channel. It is
different on the client and the server:
The FTP model
– The SERVER-PI is responsible for listening to
the commands coming from a USER-PI over
the control, 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.
The FTP model
• 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.
The FTP model
• 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.
Types of connections
• When an FTP client connects to an FTP server
it opens a connection to the FTP control port
21. Then the client tells the FTP server
whether to establish an active or passive
connection.
• The type of connection chosen by the client
determines how the server responds and on
what ports transactions will occur.
Types of connections
• Active Connections:
When an active connection is established, the
server opens a data connection to the client
from port 20 to a high range port on the client
machine.
All data from the server is then passed over
this connection.
Types of connections
Passive Connections :When a passive connection
is established, the client asks the FTP server to
establish a passive connection port, which can be
on any port higher than 10,000.
• The server then binds to this high-numbered port
for this particular session and relays that port
number back to the client. The client then opens
the newly bound port for the data connection.
• Each data request the client makes results in a
separate data connection. Most modern FTP
clients attempt to establish a passive connection
when requesting data from servers.
Types of connections